fix: Unable to allocate advance against invoice (#35007)

fix: Unable to allocate advance against invoice (#35007)

(cherry picked from commit f7b50f2ade)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
This commit is contained in:
mergify[bot]
2023-04-25 20:51:35 +05:30
committed by GitHub
parent d5a80b5615
commit 61a3121172

View File

@@ -1632,7 +1632,10 @@ class AccountsController(TransactionBase):
)
self.append("payment_schedule", data)
if not automatically_fetch_payment_terms:
if not (
automatically_fetch_payment_terms
and self.linked_order_has_payment_terms(po_or_so, fieldname, doctype)
):
for d in self.get("payment_schedule"):
if d.invoice_portion:
d.payment_amount = flt(