fix: index error on Receivable report based on payment terms (#36963)

fix: index error on Receivable report based on payment terms

cr note's don't have payment terms. So, skip for them.

(cherry picked from commit b9c556c4a9)

Co-authored-by: ruthra kumar <ruthra@erpnext.com>
This commit is contained in:
mergify[bot]
2023-09-05 16:32:58 +05:30
committed by GitHub
parent c125dea0f1
commit e3d64fc553

View File

@@ -467,6 +467,10 @@ class ReceivablePayableReport(object):
original_row = frappe._dict(row)
row.payment_terms = []
# Cr Note's don't have Payment Terms
if not payment_terms_details:
return
# Advance allocated during invoicing is not considered in payment terms
# Deduct that from paid amount pre allocation
row.paid -= flt(payment_terms_details[0].total_advance)