Skip to content

Commit 8b3d65a

Browse files
Revert "fix: sync paid and received amount" (backport #54238) (#54292)
Co-authored-by: Vishnu Priya Baskaran <145791817+ervishnucs@users.noreply.github.com> fix: sync paid and received amount" (#54238)
1 parent 0e9b3b4 commit 8b3d65a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

erpnext/accounts/doctype/payment_entry/payment_entry.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -839,7 +839,7 @@ frappe.ui.form.on("Payment Entry", {
839839
paid_amount: function (frm) {
840840
frm.set_value("base_paid_amount", flt(frm.doc.paid_amount) * flt(frm.doc.source_exchange_rate));
841841
let company_currency = frappe.get_doc(":Company", frm.doc.company).default_currency;
842-
if (frm.doc.paid_amount) {
842+
if (!frm.doc.received_amount) {
843843
if (frm.doc.paid_from_account_currency == frm.doc.paid_to_account_currency) {
844844
frm.set_value("received_amount", frm.doc.paid_amount);
845845
} else if (company_currency == frm.doc.paid_to_account_currency) {
@@ -860,7 +860,7 @@ frappe.ui.form.on("Payment Entry", {
860860
flt(frm.doc.received_amount) * flt(frm.doc.target_exchange_rate)
861861
);
862862

863-
if (frm.doc.received_amount) {
863+
if (!frm.doc.paid_amount) {
864864
if (frm.doc.paid_from_account_currency == frm.doc.paid_to_account_currency) {
865865
frm.set_value("paid_amount", frm.doc.received_amount);
866866
if (frm.doc.target_exchange_rate) {

0 commit comments

Comments
 (0)