From f74d8d2e167decd1155cae6b469024f280407316 Mon Sep 17 00:00:00 2001 From: Anuja P Date: Mon, 26 Apr 2021 11:31:51 +0530 Subject: [PATCH] fix: suggested changes --- erpnext/accounts/doctype/payment_entry/payment_entry.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.js b/erpnext/accounts/doctype/payment_entry/payment_entry.js index 936c538e20..830a7f25c0 100644 --- a/erpnext/accounts/doctype/payment_entry/payment_entry.js +++ b/erpnext/accounts/doctype/payment_entry/payment_entry.js @@ -801,14 +801,11 @@ frappe.ui.form.on('Payment Entry', { row.allocated_amount = 0; } else if (frappe.flags.allocate_payment_amount != 0 && (!row.allocated_amount || paid_amount_change)) { - if (row.outstanding_amount > 0 && allocated_positive_outstanding > 0) { + if (row.outstanding_amount > 0 && allocated_positive_outstanding >= 0) { row.allocated_amount = (row.outstanding_amount >= allocated_positive_outstanding) ? allocated_positive_outstanding : row.outstanding_amount; allocated_positive_outstanding -= flt(row.allocated_amount); - } else if (row.outstanding_amount > 0 && allocated_positive_outstanding == 0) { - row.allocated_amount = null; - } else if (row.outstanding_amount < 0 && allocated_negative_outstanding) { row.allocated_amount = (Math.abs(row.outstanding_amount) >= allocated_negative_outstanding) ? -1*allocated_negative_outstanding : row.outstanding_amount;