Merge pull request #36963 from ruthra-kumar/index_error_on_receivable_report

fix: index error on Receivable report based on payment terms
This commit is contained in:
ruthra kumar 2023-09-05 16:12:38 +05:30 committed by GitHub
commit ccd2e2b086
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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)