Skip to content

Commit

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

refactor: Allow equity type Account in Payment Entry for shareholders (backport #42851)
  • Loading branch information
ruthra-kumar authored Aug 22, 2024
2 parents 752f93c + 164b417 commit dffd5f2
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions erpnext/accounts/doctype/payment_entry/payment_entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ frappe.ui.form.on('Payment Entry', {

var account_types = ["Pay", "Internal Transfer"].includes(frm.doc.payment_type) ?
["Bank", "Cash"] : [frappe.boot.party_account_types[frm.doc.party_type]];

if (frm.doc.party_type == "Shareholder") {
account_types.push("Equity");
}

return {
filters: {
"account_type": ["in", account_types],
Expand Down Expand Up @@ -77,6 +82,9 @@ frappe.ui.form.on('Payment Entry', {

var account_types = ["Receive", "Internal Transfer"].includes(frm.doc.payment_type) ?
["Bank", "Cash"] : [frappe.boot.party_account_types[frm.doc.party_type]];
if (frm.doc.party_type == "Shareholder") {
account_types.push("Equity");
}
return {
filters: {
"account_type": ["in", account_types],
Expand Down Expand Up @@ -326,6 +334,12 @@ frappe.ui.form.on('Payment Entry', {
return {
query: "erpnext.controllers.queries.customer_query"
}
} else if (frm.doc.party_type == "Shareholder") {
return {
filters: {
company: frm.doc.company,
},
};
}
});

Expand Down

0 comments on commit dffd5f2

Please sign in to comment.