Skip to content

Commit

Permalink
Fix: Rounding Amount in payload to 2 points (#581)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ashutosh619-sudo authored Nov 26, 2024
1 parent 6a85c46 commit 8939090
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion apps/sage_intacct/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 8939090

Please sign in to comment.