From e9b63e45b90082eb7147976a6f4b5e75fed80263 Mon Sep 17 00:00:00 2001 From: Saqib Ansari Date: Tue, 7 Apr 2020 17:22:11 +0530 Subject: [PATCH] chore: hide redundant base received amount --- erpnext/accounts/doctype/payment_entry/payment_entry.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.js b/erpnext/accounts/doctype/payment_entry/payment_entry.js index d2080874533..cfe64e0c1fe 100644 --- a/erpnext/accounts/doctype/payment_entry/payment_entry.js +++ b/erpnext/accounts/doctype/payment_entry/payment_entry.js @@ -157,7 +157,7 @@ frappe.ui.form.on('Payment Entry', { frm.toggle_display("base_paid_amount", frm.doc.paid_from_account_currency != company_currency); frm.toggle_display("base_received_amount", (frm.doc.paid_to_account_currency != company_currency && - frm.doc.paid_from_account_currency != frm.doc.paid_to_account_currency)); + frm.doc.paid_from_account_currency != frm.doc.paid_to_account_currency && frm.doc.base_paid_amount != frm.doc.base_received_amount)); frm.toggle_display("received_amount", (frm.doc.payment_type=="Internal Transfer" || frm.doc.paid_from_account_currency != frm.doc.paid_to_account_currency)) @@ -501,6 +501,7 @@ frappe.ui.form.on('Payment Entry', { paid_amount: function(frm) { frm.set_value("base_paid_amount", flt(frm.doc.paid_amount) * flt(frm.doc.source_exchange_rate)); frm.trigger("reset_received_amount"); + frm.events.hide_unhide_fields(frm); }, received_amount: function(frm) { @@ -524,6 +525,7 @@ frappe.ui.form.on('Payment Entry', { frm.events.set_unallocated_amount(frm); frm.set_paid_amount_based_on_received_amount = false; + frm.events.hide_unhide_fields(frm); }, reset_received_amount: function(frm) {