Skip to content

Commit

Permalink
fix: Display appropriate message if different Payment Terms are used …
Browse files Browse the repository at this point in the history
…in PE and its Payment References (#27763)

(cherry picked from commit 9f14695)

Co-authored-by: GangaManoj <ganga.manoj98@gmail.com>
Co-authored-by: Afshan <33727827+AfshanKhan@users.noreply.github.com>
  • Loading branch information
3 people authored Oct 5, 2021
1 parent ab0e381 commit 046ec92
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions erpnext/accounts/doctype/payment_entry/payment_entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,9 @@ def update_payment_schedule(self, cancel=0):
invoice_paid_amount_map[invoice_key]['discounted_amt'] = ref.total_amount * (term.discount / 100)

for key, allocated_amount in iteritems(invoice_payment_amount_map):
if not invoice_paid_amount_map.get(key):
frappe.throw(_('Payment term {0} not used in {1}').format(key[0], key[1]))

outstanding = flt(invoice_paid_amount_map.get(key, {}).get('outstanding'))
discounted_amt = flt(invoice_paid_amount_map.get(key, {}).get('discounted_amt'))

Expand Down

0 comments on commit 046ec92

Please sign in to comment.