Skip to content

Commit

Permalink
fix: index error on Receivable report based on payment terms (#36963)
Browse files Browse the repository at this point in the history
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 b9c556c)

Co-authored-by: ruthra kumar <[email protected]>
  • Loading branch information
mergify[bot] and ruthra-kumar authored Sep 5, 2023
1 parent c125dea commit e3d64fc
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit e3d64fc

Please sign in to comment.