mirror of
https://github.com/internetee/registry.git
synced 2025-07-22 18:56:05 +02:00
Fix invoice linking with directo record
This commit is contained in:
parent
cd871ca829
commit
26adaa9743
2 changed files with 3 additions and 4 deletions
|
@ -67,8 +67,7 @@ class DirectoInvoiceForwardJob < Que::Job
|
|||
end
|
||||
|
||||
def sync_with_directo
|
||||
Rails.logger.info('[Directo] - attempting to send following XML:')
|
||||
puts @client.invoices.as_xml
|
||||
Rails.logger.info("[Directo] - attempting to send following XML:\n #{@client.invoices.as_xml}")
|
||||
|
||||
return if @dry
|
||||
|
||||
|
@ -95,7 +94,7 @@ class DirectoInvoiceForwardJob < Que::Job
|
|||
directo_record = Directo.new(response: res.as_json.to_h,
|
||||
request: req, invoice_number: res.attributes['docid'].value.to_i)
|
||||
if invoice
|
||||
directo_record.invoice = invoice
|
||||
directo_record.item = invoice
|
||||
invoice.update_columns(in_directo: true)
|
||||
else
|
||||
update_directo_number(num: directo_record.invoice_number)
|
||||
|
|
|
@ -21,7 +21,7 @@ class DirectoInvoiceForwardJobTest < ActiveSupport::TestCase
|
|||
end.to_return(status: 200, body: response)
|
||||
|
||||
assert_nothing_raised do
|
||||
Directo.send_receipts
|
||||
DirectoInvoiceForwardJob.run(monthly: false, dry: false)
|
||||
end
|
||||
|
||||
assert_not_empty @invoice.directo_records.first.request
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue