fix: Display appropriate message if different Payment Terms are used in PE and its Payment References (#27763)

(cherry picked from commit 9f14695743)

Co-authored-by: GangaManoj <ganga.manoj98@gmail.com>
Co-authored-by: Afshan <33727827+AfshanKhan@users.noreply.github.com>
This commit is contained in:
mergify[bot]
2021-10-05 12:21:21 +05:30
committed by GitHub
parent ab0e381cfc
commit 046ec928e0

View File

@@ -390,6 +390,9 @@ class PaymentEntry(AccountsController):
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'))