Merge branch 'story/105855968-directo' into staging

# Conflicts:
#	config/locales/en.yml
This commit is contained in:
Vladimir Krylov 2016-03-16 17:51:06 +02:00
commit 0779657b41
7 changed files with 14 additions and 10 deletions

View file

@ -57,7 +57,7 @@ class Admin::RegistrarsController < AdminController
def registrar_params def registrar_params
params.require(:registrar).permit( params.require(:registrar).permit(
:name, :reg_no, :vat_no, :street, :city, :state, :zip, :billing_address, :name, :reg_no, :vat_no, :street, :city, :state, :zip, :billing_address,
:country_code, :email, :phone, :billing_email, :code, :exclude_in_monthly_directo :country_code, :email, :phone, :billing_email, :code, :test_registrar
) )
end end
end end

View file

@ -75,7 +75,7 @@ class Directo < ActiveRecord::Base
end end
directo_next = last_directo directo_next = last_directo
Registrar.where.not(exclude_in_monthly_directo: true).find_each do |registrar| Registrar.where.not(test_registrar: true).find_each do |registrar|
unless registrar.cash_account unless registrar.cash_account
Rails.logger.info("[DIRECTO] Monthly invoice for registrar #{registrar.id} has been skipped as it doesn't has cash_account") Rails.logger.info("[DIRECTO] Monthly invoice for registrar #{registrar.id} has been skipped as it doesn't has cash_account")
next next
@ -126,7 +126,7 @@ class Directo < ActiveRecord::Base
xml.invoices{ xml.invoices{
xml.invoice("Number" =>directo_next, xml.invoice("Number" =>directo_next,
"InvoiceDate" =>invoices_until.strftime(date_format), "InvoiceDate" =>invoices_until.strftime(date_format),
"PaymentTerm" =>"E", "PaymentTerm" =>Setting.directo_receipt_payment_term,
"CustomerCode"=>registrar.directo_handle, "CustomerCode"=>registrar.directo_handle,
"Language" =>"", "Language" =>"",
"Currency" =>registrar_activities.first.currency, "Currency" =>registrar_activities.first.currency,

View file

@ -84,9 +84,9 @@
= f.text_field(:code, class: 'form-control', disabled: !f.object.new_record?) = f.text_field(:code, class: 'form-control', disabled: !f.object.new_record?)
.form-group .form-group
.col-md-4.control-label .col-md-4.control-label
= f.label :exclude_in_monthly_directo = f.label :test_registrar
.col-md-7 .col-md-7
= f.check_box :exclude_in_monthly_directo, class: 'form-control' = f.check_box :test_registrar, class: 'form-control'
%hr %hr
.row .row

View file

@ -14,12 +14,15 @@
= sort_link(@q, 'reg_no', t(:reg_no)) = sort_link(@q, 'reg_no', t(:reg_no))
%th{class: 'col-xs-4'} %th{class: 'col-xs-4'}
= t(:credit_balance) = t(:credit_balance)
%th{class: 'col-xs-4'}
= t(:test_registrar)
%tbody %tbody
- @registrars.each do |x| - @registrars.each do |x|
%tr %tr
%td= link_to(x, [:admin, x]) %td= link_to(x, [:admin, x])
%td= x.reg_no %td= x.reg_no
%td= "#{x.balance}" %td= "#{x.balance}"
%td= "#{x.test_registrar}"
.row .row
.col-md-12 .col-md-12
= paginate @registrars = paginate @registrars

View file

@ -934,5 +934,6 @@ en:
add_blocked_domain: 'Add domain to blocked list' add_blocked_domain: 'Add domain to blocked list'
edit_pw: 'Edit Pw' edit_pw: 'Edit Pw'
optional: 'Optional' optional: 'Optional'
test_registrar: "Test registrar?"
next: 'Next' next: 'Next'
previous: 'Previous' previous: 'Previous'

View file

@ -1,5 +0,0 @@
class AddExcludeMonthlyDirectoToRegistrar < ActiveRecord::Migration
def change
add_column :registrars, :exclude_in_monthly_directo, :boolean, default: false
end
end

View file

@ -0,0 +1,5 @@
class AddTestRegistrarToRegistrar < ActiveRecord::Migration
def change
add_column :registrars, :test_registrar, :boolean, default: false
end
end