Skip to content

Commit

Permalink
fix: Wrong Overdue Status in Sales Invoices (Floating-point arithmetic)
Browse files Browse the repository at this point in the history
  • Loading branch information
devdiogenes committed Feb 25, 2025
1 parent 5a6e06a commit 8b01955
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions erpnext/accounts/doctype/sales_invoice/sales_invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -1934,13 +1934,13 @@ def is_overdue(doc, total):
"base_payment_amount" if doc.party_account_currency != doc.currency else "payment_amount"
)

payable_amount = sum(
payable_amount = flt(sum(
payment.get(payment_amount_field)
for payment in doc.payment_schedule
if getdate(payment.due_date) < today
)
), doc.precision("outstanding_amount"))

return (total - outstanding_amount) < payable_amount
return flt(total - outstanding_amount, doc.precision("outstanding_amount")) < payable_amount


def get_discounting_status(sales_invoice):
Expand Down

0 comments on commit 8b01955

Please sign in to comment.