Merge remote-tracking branch 'origin/master' into 1651-domain-transfer-fails

This commit is contained in:
Karl Erik Õunapuu 2020-08-04 18:22:55 +03:00
commit c4a6a35743
10 changed files with 155 additions and 14 deletions

View file

@ -24,9 +24,9 @@ class Registrant::DomainDeleteConfirmsController < RegistrantController
confirmed = params[:confirmed] ? true : false
action = if confirmed
@registrant_verification.domain_registrant_delete_reject!("email link #{initiator}")
else
@registrant_verification.domain_registrant_delete_confirm!("email link #{initiator}")
else
@registrant_verification.domain_registrant_delete_reject!("email link #{initiator}")
end
fail_msg = t("registrant_domain_delete_#{confirmed ? 'confirmed' : 'rejected'}_failed".to_sym)
@ -36,9 +36,9 @@ class Registrant::DomainDeleteConfirmsController < RegistrantController
(render 'show' && return) unless action
if confirmed
redirect_to registrant_domain_delete_confirm_path(@domain.id, confirmed: true) && return
redirect_to registrant_domain_delete_confirm_path(@domain.id, confirmed: true)
else
redirect_to registrant_domain_delete_confirm_path(@domain.id, rejected: true) unless confirmed
redirect_to registrant_domain_delete_confirm_path(@domain.id, rejected: true)
end
end
end

View file

@ -5,7 +5,7 @@ module Concerns
def as_directo_json
invoice = ActiveSupport::JSON.decode(ActiveSupport::JSON.encode(self))
invoice['customer_code'] = buyer.accounting_customer_code
invoice['customer'] = compose_directo_customer
invoice['issue_date'] = issue_date.strftime('%Y-%m-%d')
invoice['transaction_date'] = account_activity
.bank_transaction&.paid_at&.strftime('%Y-%m-%d')
@ -21,6 +21,14 @@ module Concerns
subtotal, precision: 2, separator: '.'
) }].as_json
end
def compose_directo_customer
{
'code': buyer.accounting_customer_code,
'destination': buyer_country_code,
'vat_reg_no': buyer_vat_no,
}.as_json
end
end
end
end

View file

@ -12,7 +12,7 @@ module Concerns
invoice = {
'number': 1,
'customer_code': accounting_customer_code,
'customer': compose_directo_customer,
'language': language == 'en' ? 'ENG' : '', 'currency': activities.first.currency,
'date': month.end_of_month.strftime('%Y-%m-%d')
}.as_json
@ -109,6 +109,14 @@ module Concerns
}
end
def compose_directo_customer
{
'code': accounting_customer_code,
'destination': address_country_code,
'vat_reg_no': vat_no,
}.as_json
end
def load_price(account_activity)
@pricelists ||= {}
return @pricelists[account_activity.price_id] if @pricelists.key? account_activity.price_id