Merge pull request #27749 from GangaManoj/fix-pe-payment-term

fix: Display appropriate message for Payment Term discrepancies in Payment Entry
This commit is contained in:
Deepesh Garg
2021-10-04 11:06:20 +05:30
committed by GitHub

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'))