From 893909024d2b2c9c29f3213c9878110b3e3c135f Mon Sep 17 00:00:00 2001 From: Ashutosh singh <55102089+Ashutosh619-sudo@users.noreply.github.com> Date: Tue, 26 Nov 2024 11:36:31 +0530 Subject: [PATCH] Fix: Rounding Amount in payload to 2 points (#581) --- apps/sage_intacct/utils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/sage_intacct/utils.py b/apps/sage_intacct/utils.py index 2afb770b..5c777dd7 100644 --- a/apps/sage_intacct/utils.py +++ b/apps/sage_intacct/utils.py @@ -969,11 +969,13 @@ def __construct_expense_report(self, expense_report: ExpenseReport, expense_link = self.get_expense_link(lineitem) tax_exclusive_amount, _ = self.get_tax_exclusive_amount(lineitem.amount, general_mappings.default_tax_code_id) + amount = lineitem.amount - lineitem.tax_amount if (lineitem.tax_code and lineitem.tax_amount) else tax_exclusive_amount + amount = round(amount, 2) expense = { 'expensetype' if lineitem.expense_type_id else 'glaccountno': lineitem.expense_type_id \ if lineitem.expense_type_id else lineitem.gl_account_number, - 'amount': lineitem.amount - lineitem.tax_amount if (lineitem.tax_code and lineitem.tax_amount) else tax_exclusive_amount, + 'amount': amount, 'expensedate': { 'year': transaction_date.year, 'month': transaction_date.month,