mirror of
https://github.com/internetee/registry.git
synced 2025-07-23 19:20:37 +02:00
Merge remote-tracking branch 'origin/master' into 1422-record-payment-method-and-failed-payments
This commit is contained in:
commit
23b427e9dc
10 changed files with 79 additions and 11 deletions
|
@ -22,14 +22,16 @@ class Directo < ApplicationRecord
|
|||
counter += 1
|
||||
|
||||
num = invoice.number
|
||||
paid_at = invoice.account_activity.bank_transaction&.paid_at&.strftime("%Y-%m-%d")
|
||||
mappers[num] = invoice
|
||||
xml.invoice(
|
||||
"SalesAgent" => Setting.directo_sales_agent,
|
||||
"Number" => num,
|
||||
"InvoiceDate" => invoice.issue_date.strftime("%Y-%m-%d"),
|
||||
"PaymentTerm" => Setting.directo_receipt_payment_term,
|
||||
"Currency" => invoice.currency,
|
||||
"CustomerCode"=> invoice.buyer.accounting_customer_code
|
||||
"SalesAgent" => Setting.directo_sales_agent,
|
||||
"Number" => num,
|
||||
"InvoiceDate" => invoice.issue_date.strftime("%Y-%m-%d"),
|
||||
'TransactionDate' => paid_at,
|
||||
"PaymentTerm" => Setting.directo_receipt_payment_term,
|
||||
"Currency" => invoice.currency,
|
||||
"CustomerCode"=> invoice.buyer.accounting_customer_code
|
||||
){
|
||||
xml.line(
|
||||
"ProductID" => Setting.directo_receipt_product_name,
|
||||
|
|
|
@ -60,7 +60,8 @@ module DNS
|
|||
end
|
||||
|
||||
def blocked?
|
||||
BlockedDomain.where(name: name).any?
|
||||
BlockedDomain.where(name: name).any? ||
|
||||
BlockedDomain.where(name: SimpleIDN.to_unicode(name)).any?
|
||||
end
|
||||
|
||||
def reserved?
|
||||
|
|
|
@ -33,7 +33,9 @@ class DomainNameValidator < ActiveModel::EachValidator
|
|||
|
||||
def validate_blocked(value)
|
||||
return true unless value
|
||||
return false if BlockedDomain.where(name: value).count.positive?
|
||||
return false if BlockedDomain.where(name: value).any?
|
||||
return false if BlockedDomain.where(name: SimpleIDN.to_unicode(value)).any?
|
||||
|
||||
DNS::Zone.where(origin: value).count.zero?
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue