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

This commit is contained in:
Deepesh Garg 2023-04-25 19:18:45 +05:30 committed by GitHub
parent 72b5c1f70a
commit f7b50f2ade
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1662,7 +1662,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(