Skip to content

Commit

Permalink
fix: set company bank account if default account not set in mode of p…
Browse files Browse the repository at this point in the history
…ayment
  • Loading branch information
venkat102 committed Dec 13, 2024
1 parent b584212 commit 91c7e3d
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 91c7e3d

Please sign in to comment.