Skip to content

Commit

Permalink
Fix header amount (#182)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
Hrishabh17 authored Jun 4, 2024
1 parent 73a5b3a commit daaf60c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/sage300/exports/purchase_invoice/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit daaf60c

Please sign in to comment.