mirror of
https://github.com/internetee/registry.git
synced 2025-07-22 18:56:05 +02:00
Merge pull request #65 from internetee/story/105852786-directo
Story/105852786 directo
This commit is contained in:
commit
89c8b74430
2 changed files with 8 additions and 1 deletions
|
@ -8,12 +8,15 @@ class Directo < ActiveRecord::Base
|
|||
builder = Nokogiri::XML::Builder.new(encoding: "UTF-8") do |xml|
|
||||
xml.invoices {
|
||||
group.each do |invoice|
|
||||
next if invoice.account_activity.nil? || invoice.account_activity.bank_transaction.nil?
|
||||
next if invoice.account_activity.bank_transaction.sum.nil? || invoice.account_activity.bank_transaction.sum != invoice.sum_cache
|
||||
|
||||
num = invoice.number
|
||||
mappers[num] = invoice
|
||||
xml.invoice(
|
||||
"SalesAgent" => Setting.directo_sales_agent,
|
||||
"Number" => num,
|
||||
"InvoiceDate" => (invoice.account_activity.try(:bank_transaction).try(:paid_at) || invoice.updated_at).strftime("%Y-%m-%dT%H:%M:%S"),
|
||||
"InvoiceDate" => invoice.created_at.strftime("%Y-%m-%dT%H:%M:%S"),
|
||||
"PaymentTerm" => Setting.directo_receipt_payment_term,
|
||||
"Currency" => invoice.currency,
|
||||
"CustomerCode"=> invoice.buyer.try(:directo_handle)
|
||||
|
|
|
@ -53,6 +53,10 @@ if @cron_group == 'registry'
|
|||
every 52.minutes do
|
||||
runner 'Domain.start_redemption_grace_period'
|
||||
end
|
||||
|
||||
every :day, at: '19:00pm' do
|
||||
runner 'Directo.send_receipts'
|
||||
end if @environment == 'production'
|
||||
end
|
||||
|
||||
every 10.minutes do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue