mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-20 18:54:55 +00:00
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"
|
"base_payment_amount" if doc.party_account_currency != doc.currency else "payment_amount"
|
||||||
)
|
)
|
||||||
|
|
||||||
payable_amount = sum(
|
payable_amount = flt(
|
||||||
payment.get(payment_amount_field)
|
sum(
|
||||||
for payment in doc.payment_schedule
|
payment.get(payment_amount_field)
|
||||||
if getdate(payment.due_date) < today
|
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):
|
def get_discounting_status(sales_invoice):
|
||||||
|
|||||||
Reference in New Issue
Block a user