From e3d64fc5536e05b85f0db8f53079f90fb685c554 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Tue, 5 Sep 2023 16:32:58 +0530 Subject: [PATCH] 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 b9c556c4a9ac1102113c73ae9d92b5614bd603f2) Co-authored-by: ruthra kumar --- .../report/accounts_receivable/accounts_receivable.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py index 3700f00ee226..14f8993727a9 100755 --- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py +++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py @@ -467,6 +467,10 @@ def get_payment_terms(self, row): 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)