From 6fd216af38b12d2e20fa3146d9a66d29ba8e0abf Mon Sep 17 00:00:00 2001 From: Oleg Hasjanov Date: Thu, 4 Jan 2024 10:54:13 +0200 Subject: [PATCH] quick fix: send invoices amount to billing --- lib/tasks/send_invoice_amount_to_billing.rake | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 lib/tasks/send_invoice_amount_to_billing.rake diff --git a/lib/tasks/send_invoice_amount_to_billing.rake b/lib/tasks/send_invoice_amount_to_billing.rake new file mode 100644 index 000000000..7836542cd --- /dev/null +++ b/lib/tasks/send_invoice_amount_to_billing.rake @@ -0,0 +1,10 @@ +namespace :invoices do + desc 'One time task to export invoice data to billing system' + task send_amount_to_billing: :environment do + invoices = Invoice.issued + + invoices.each do |invoice| + EisBilling::UpdateInvoiceDataService.call(invoice_number: invoice.number, transaction_amount: invoice.total.to_f) + end + end +end