fix: Wrong Overdue Status in Sales Invoices (Floating-point arithmetic) (#46146)
* fix: Wrong Overdue Status in Sales Invoices (Floating-point arithmetic)
* style: after run pre-commit
(cherry picked from commit 89bcdd6fa5)
Co-authored-by: Diógenes Souza <103958767+devdiogenes@users.noreply.github.com>
This commit is contained in:
@@ -1937,13 +1937,16 @@ def is_overdue(doc, total):
|
||||
"base_payment_amount" if doc.party_account_currency != doc.currency else "payment_amount"
|
||||
)
|
||||
|
||||
payable_amount = sum(
|
||||
payment.get(payment_amount_field)
|
||||
for payment in doc.payment_schedule
|
||||
if getdate(payment.due_date) < today
|
||||
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):
|
||||
|
||||
Reference in New Issue
Block a user