Skip to content

Commit

Permalink
Merge pull request #42851 from ruthra-kumar/allow_equity_type_for_sha…
Browse files Browse the repository at this point in the history
…reholders

refactor: Allow equity type Account in Payment Entry for shareholders
  • Loading branch information
ruthra-kumar authored Aug 22, 2024
2 parents 930286e + 63ad9f4 commit 1efdc04
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 @@ -35,6 +35,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 @@ -90,6 +95,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 @@ -412,6 +420,12 @@ frappe.ui.form.on("Payment Entry", {
return {
query: "erpnext.controllers.queries.employee_query",
};
} else if (frm.doc.party_type == "Shareholder") {
return {
filters: {
company: frm.doc.company,
},
};
}
});

Expand Down

0 comments on commit 1efdc04

Please sign in to comment.