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

* fix: payment allocation in invoice payment schedule

* test: payment allocation for payment terms

* chore: linting issues
This commit is contained in:
Gursheen Kaur Anand
2023-08-04 17:49:17 +05:30
committed by GitHub
parent 49be740736
commit edbefee10c
2 changed files with 51 additions and 0 deletions

View File

@@ -1756,8 +1756,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"):