mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-09 00:01:18 +00:00
fix: condition
This commit is contained in:
committed by
Deepesh Garg
parent
153323ee41
commit
1dd3396b60
@@ -1337,7 +1337,7 @@ def apply_early_payment_discount(paid_amount, received_amount, doc):
|
||||
difference_amount = 0
|
||||
if doc.doctype in ["Sales Invoice", "Purchase Invoice"] and doc.payment_schedule:
|
||||
for term in doc.payment_schedule:
|
||||
if not term.discounted_amount and term.discount_percentage and getdate(nowdate()) <= term.due_date:
|
||||
if not term.paid_amount and term.discount_percentage and getdate(nowdate()) <= term.due_date:
|
||||
discount_amount = term.payment_amount * (term.discount_percentage / 100)
|
||||
discount_amount_in_foreign_currency = discount_amount * doc.get('conversion_rate', 1)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user