fix: payment allocation in invoice payment schedule (#36440)

fix: payment allocation in invoice payment schedule (#36440)
This commit is contained in:
mergify[bot]
2023-08-13 13:21:04 +05:30
committed by GitHub
parent b3c9d0d910
commit e5b38607ce
2 changed files with 51 additions and 0 deletions

View File

@@ -1635,8 +1635,13 @@ class AccountsController(TransactionBase):
)
self.append("payment_schedule", data)
allocate_payment_based_on_payment_terms = frappe.db.get_value(
"Payment Terms Template", self.payment_terms_template, "allocate_payment_based_on_payment_terms"
)
if not (
automatically_fetch_payment_terms
and allocate_payment_based_on_payment_terms
and self.linked_order_has_payment_terms(po_or_so, fieldname, doctype)
):
for d in self.get("payment_schedule"):