Skip to content

Commit

Permalink
Merge pull request #44748 from frappe/mergify/bp/version-15-hotfix/pr…
Browse files Browse the repository at this point in the history
…-44685

fix: set company bank account if default account not set in mode of p… (backport #44685)
  • Loading branch information
ruthra-kumar authored Dec 17, 2024
2 parents 96691bf + a8f7393 commit 09b28e8
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions erpnext/accounts/doctype/payment_entry/payment_entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -1328,6 +1328,24 @@ frappe.ui.form.on("Payment Entry", {
if (r.message) {
if (!frm.doc.mode_of_payment) {
frm.set_value(field, r.message.account);
} else {
frappe.call({
method: "frappe.client.get_value",
args: {
doctype: "Mode of Payment Account",
filters: {
parent: frm.doc.mode_of_payment,
company: frm.doc.company,
},
fieldname: "default_account",
parent: "Mode of Payment",
},
callback: function (res) {
if (!res.message.default_account) {
frm.set_value(field, r.message.account);
}
},
});
}
frm.set_value("bank", r.message.bank);
frm.set_value("bank_account_no", r.message.bank_account_no);
Expand Down

0 comments on commit 09b28e8

Please sign in to comment.