diff --git a/app/jobs/send_e_invoice_job.rb b/app/jobs/send_e_invoice_job.rb index 91e068b9f..e3880963e 100644 --- a/app/jobs/send_e_invoice_job.rb +++ b/app/jobs/send_e_invoice_job.rb @@ -1,5 +1,5 @@ class SendEInvoiceJob < Que::Job - def run(invoice_id, payable: true) + def run(invoice_id, payable = true) invoice = run_condition(Invoice.find_by(id: invoice_id), payable: payable) invoice.to_e_invoice(payable: payable).deliver diff --git a/app/models/registrar.rb b/app/models/registrar.rb index e5020d83f..e2ffcbfd4 100644 --- a/app/models/registrar.rb +++ b/app/models/registrar.rb @@ -104,7 +104,7 @@ class Registrar < ApplicationRecord InvoiceMailer.invoice_email(invoice: invoice, recipient: billing_email).deliver_now end - SendEInvoiceJob.enqueue(invoice.id, payable: payable) + SendEInvoiceJob.enqueue(invoice.id, payable) invoice end diff --git a/test/jobs/send_e_invoice_job_test.rb b/test/jobs/send_e_invoice_job_test.rb index 384479e92..86d761b42 100644 --- a/test/jobs/send_e_invoice_job_test.rb +++ b/test/jobs/send_e_invoice_job_test.rb @@ -13,7 +13,7 @@ class SendEInvoiceJobTest < ActiveSupport::TestCase EInvoice::Providers::TestProvider.deliveries.clear assert_nothing_raised do - SendEInvoiceJob.enqueue(@invoice.id) + SendEInvoiceJob.enqueue(@invoice.id, true) end @invoice.reload @@ -29,7 +29,7 @@ class SendEInvoiceJobTest < ActiveSupport::TestCase stub_request(:get, "https://testfinance.post.ee/finance/erp/erpServices.wsdl").to_timeout assert_raise HTTPClient::TimeoutError do - SendEInvoiceJob.enqueue(@invoice.id) + SendEInvoiceJob.enqueue(@invoice.id, true) end assert @invoicee_invoice_sent_at.blank? @@ -37,7 +37,7 @@ class SendEInvoiceJobTest < ActiveSupport::TestCase EInvoice::Providers::TestProvider.deliveries.clear assert_nothing_raised do - SendEInvoiceJob.enqueue(@invoice.id) + SendEInvoiceJob.enqueue(@invoice.id, true) end @invoice.reload