From daaf60cf65ab4adc0f21241a4b514dc409909a61 Mon Sep 17 00:00:00 2001 From: Hrishabh Tiwari <74908943+Hrishabh17@users.noreply.github.com> Date: Tue, 4 Jun 2024 14:26:15 +0530 Subject: [PATCH] Fix header amount (#182) * Delete purchase_invoice, line_items on failed exports from hh2, type-check for current_state * Fix header amount by rounding off * fix amount round off --- apps/sage300/exports/purchase_invoice/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/sage300/exports/purchase_invoice/models.py b/apps/sage300/exports/purchase_invoice/models.py index f45b34af..a8653b6b 100644 --- a/apps/sage300/exports/purchase_invoice/models.py +++ b/apps/sage300/exports/purchase_invoice/models.py @@ -49,7 +49,7 @@ def create_or_update_object(self, accounting_export: AccountingExport, advance_s purchase_invoice, _ = PurchaseInvoice.objects.update_or_create( accounting_export=accounting_export, defaults={ - 'amount': amount, + 'amount': round(amount, 2), 'vendor_id': vendor_id, 'description': description, 'invoice_date': invoice_date, @@ -143,7 +143,7 @@ def create_or_update_object(self, accounting_export: AccountingExport, advance_s purchase_invoice_id=purchase_invoice.id, expense_id=lineitem.id, defaults={ - 'amount': lineitem.amount, + 'amount': round(lineitem.amount, 2), 'accounts_payable_account_id': account.destination_account.destination_id, 'job_id': job_id, 'commitment_id': commitment_id,