From 651e8531569e28c85c61669fee9dde4416e72363 Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Wed, 21 Aug 2024 11:16:41 +0530 Subject: [PATCH 1/3] refactor: allow equity types on Payment Entry (cherry picked from commit 6cbf98294ae9231843764cda9aa60b7bd15444f8) # Conflicts: # erpnext/accounts/doctype/payment_entry/payment_entry.js --- .../doctype/payment_entry/payment_entry.js | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.js b/erpnext/accounts/doctype/payment_entry/payment_entry.js index 3d5d030a9ee..4a099f7b860 100644 --- a/erpnext/accounts/doctype/payment_entry/payment_entry.js +++ b/erpnext/accounts/doctype/payment_entry/payment_entry.js @@ -21,8 +21,19 @@ frappe.ui.form.on('Payment Entry', { frm.set_query("paid_from", function() { frm.events.validate_company(frm); +<<<<<<< HEAD var account_types = ["Pay", "Internal Transfer"].includes(frm.doc.payment_type) ? ["Bank", "Cash"] : [frappe.boot.party_account_types[frm.doc.party_type]]; +======= + 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"); + } + +>>>>>>> 6cbf98294a (refactor: allow equity types on Payment Entry) return { filters: { "account_type": ["in", account_types], @@ -75,8 +86,17 @@ frappe.ui.form.on('Payment Entry', { frm.set_query("paid_to", function() { frm.events.validate_company(frm); +<<<<<<< HEAD var account_types = ["Receive", "Internal Transfer"].includes(frm.doc.payment_type) ? ["Bank", "Cash"] : [frappe.boot.party_account_types[frm.doc.party_type]]; +======= + 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"); + } +>>>>>>> 6cbf98294a (refactor: allow equity types on Payment Entry) return { filters: { "account_type": ["in", account_types], From 30ad25d86c37ec07573aa04e6a4b32f25501007a Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Wed, 21 Aug 2024 14:19:30 +0530 Subject: [PATCH 2/3] refactor: filter shareholder on company (cherry picked from commit 63ad9f4f86f841ffbf7c2e8b31fc16adc694259f) # Conflicts: # erpnext/accounts/doctype/payment_entry/payment_entry.js --- .../accounts/doctype/payment_entry/payment_entry.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.js b/erpnext/accounts/doctype/payment_entry/payment_entry.js index 4a099f7b860..25261d91fe3 100644 --- a/erpnext/accounts/doctype/payment_entry/payment_entry.js +++ b/erpnext/accounts/doctype/payment_entry/payment_entry.js @@ -339,6 +339,7 @@ frappe.ui.form.on('Payment Entry', { frm.set_query("party", function() { if(frm.doc.party_type == 'Employee'){ return { +<<<<<<< HEAD query: "erpnext.controllers.queries.employee_query" } } @@ -346,6 +347,16 @@ frappe.ui.form.on('Payment Entry', { return { query: "erpnext.controllers.queries.customer_query" } +======= + query: "erpnext.controllers.queries.employee_query", + }; + } else if (frm.doc.party_type == "Shareholder") { + return { + filters: { + company: frm.doc.company, + }, + }; +>>>>>>> 63ad9f4f86 (refactor: filter shareholder on company) } }); From 164b417136dee1a32e6097e9a64fdd9b8c211c26 Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Thu, 22 Aug 2024 17:33:26 +0530 Subject: [PATCH 3/3] chore: resolve conflict --- .../doctype/payment_entry/payment_entry.js | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.js b/erpnext/accounts/doctype/payment_entry/payment_entry.js index 25261d91fe3..137dedf80ec 100644 --- a/erpnext/accounts/doctype/payment_entry/payment_entry.js +++ b/erpnext/accounts/doctype/payment_entry/payment_entry.js @@ -21,19 +21,13 @@ frappe.ui.form.on('Payment Entry', { frm.set_query("paid_from", function() { frm.events.validate_company(frm); -<<<<<<< HEAD var account_types = ["Pay", "Internal Transfer"].includes(frm.doc.payment_type) ? ["Bank", "Cash"] : [frappe.boot.party_account_types[frm.doc.party_type]]; -======= - 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"); } ->>>>>>> 6cbf98294a (refactor: allow equity types on Payment Entry) return { filters: { "account_type": ["in", account_types], @@ -86,17 +80,11 @@ frappe.ui.form.on('Payment Entry', { frm.set_query("paid_to", function() { frm.events.validate_company(frm); -<<<<<<< HEAD var account_types = ["Receive", "Internal Transfer"].includes(frm.doc.payment_type) ? ["Bank", "Cash"] : [frappe.boot.party_account_types[frm.doc.party_type]]; -======= - 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"); } ->>>>>>> 6cbf98294a (refactor: allow equity types on Payment Entry) return { filters: { "account_type": ["in", account_types], @@ -339,7 +327,6 @@ frappe.ui.form.on('Payment Entry', { frm.set_query("party", function() { if(frm.doc.party_type == 'Employee'){ return { -<<<<<<< HEAD query: "erpnext.controllers.queries.employee_query" } } @@ -347,16 +334,12 @@ frappe.ui.form.on('Payment Entry', { return { query: "erpnext.controllers.queries.customer_query" } -======= - query: "erpnext.controllers.queries.employee_query", - }; } else if (frm.doc.party_type == "Shareholder") { return { filters: { company: frm.doc.company, }, }; ->>>>>>> 63ad9f4f86 (refactor: filter shareholder on company) } });