diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.js b/erpnext/accounts/doctype/journal_entry/journal_entry.js index 53f45b0d91ab6115a95f83c21d8aa3e062ced364..4973c233f067a297ed01b3535877cec2e289b89f 100644 --- a/erpnext/accounts/doctype/journal_entry/journal_entry.js +++ b/erpnext/accounts/doctype/journal_entry/journal_entry.js @@ -268,7 +268,11 @@ frappe.ui.form.on("Journal Entry", { var update_jv_details = function(doc, r) { $.each(r, function(i, d) { var row = frappe.model.add_child(doc, "Journal Entry Account", "accounts"); - frappe.model.set_value(row.doctype, row.name, "account", d.account) + frappe.model.set_value(row.doctype, row.name, "account", d.account); + frappe.model.set_value(row.doctype, row.name, "party_type", d.party_type); + frappe.model.set_value(row.doctype, row.name, "party", d.party); + frappe.model.set_value(row.doctype, row.name, "project", d.project); + frappe.model.set_value(row.doctype, row.name, "cost_center", d.cost_center); }); refresh_field("accounts"); } diff --git a/erpnext/accounts/doctype/journal_entry_template/journal_entry_template.json b/erpnext/accounts/doctype/journal_entry_template/journal_entry_template.json index 6536dfc73c5e4b497f92a8b4501ffb4ffef395dc..bee39bd7bfa24e3cf47c21a3812acba0b300a11e 100644 --- a/erpnext/accounts/doctype/journal_entry_template/journal_entry_template.json +++ b/erpnext/accounts/doctype/journal_entry_template/journal_entry_template.json @@ -92,8 +92,14 @@ "options": "Accounting Journal" } ], - "links": [], - "modified": "2024-03-23 14:18:06.010774", + "links": [ + { + "group": "Journal Entries", + "link_doctype": "Journal Entry", + "link_fieldname": "from_template" + } + ], + "modified": "2025-02-14 08:52:34.082951", "modified_by": "Administrator", "module": "Accounts", "name": "Journal Entry Template", diff --git a/erpnext/accounts/doctype/journal_entry_template/journal_entry_template.py b/erpnext/accounts/doctype/journal_entry_template/journal_entry_template.py index 831c1be6d46d693126f3e452fcf9e46822837ddd..44ea60a139e0293d644ee6116bbd01570d31dd95 100644 --- a/erpnext/accounts/doctype/journal_entry_template/journal_entry_template.py +++ b/erpnext/accounts/doctype/journal_entry_template/journal_entry_template.py @@ -56,9 +56,7 @@ def get_naming_series(): @frappe.whitelist() @frappe.validate_and_sanitize_search_inputs -def get_bank_journal_entry_template( - doctype, txt, searchfield, start, page_len, filters, as_dict=False -): +def get_bank_journal_entry_template(doctype, txt, searchfield, start, page_len, filters, as_dict=False): if isinstance(filters, str): filters = frappe.parse_json(filters) diff --git a/erpnext/accounts/doctype/journal_entry_template_account/journal_entry_template_account.json b/erpnext/accounts/doctype/journal_entry_template_account/journal_entry_template_account.json index eecd87727d4d7e676ea502b292bb1a3c14ee1bf9..a2c7bf171879f8d6169ebda36115a8d3cb3009e3 100644 --- a/erpnext/accounts/doctype/journal_entry_template_account/journal_entry_template_account.json +++ b/erpnext/accounts/doctype/journal_entry_template_account/journal_entry_template_account.json @@ -5,7 +5,11 @@ "editable_grid": 1, "engine": "InnoDB", "field_order": [ - "account" + "account", + "party_type", + "party", + "project", + "cost_center" ], "fields": [ { @@ -15,11 +19,39 @@ "label": "Account", "options": "Account", "reqd": 1 + }, + { + "fieldname": "party_type", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Party Type", + "options": "DocType" + }, + { + "fieldname": "party", + "fieldtype": "Dynamic Link", + "in_list_view": 1, + "label": "Party", + "options": "party_type" + }, + { + "fieldname": "project", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Project", + "options": "Project" + }, + { + "fieldname": "cost_center", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Cost Center", + "options": "Cost Center" } ], "istable": 1, "links": [], - "modified": "2020-04-25 01:15:44.879839", + "modified": "2025-02-14 08:49:59.420298", "modified_by": "Administrator", "module": "Accounts", "name": "Journal Entry Template Account", diff --git a/erpnext/accounts/doctype/journal_entry_template_account/journal_entry_template_account.py b/erpnext/accounts/doctype/journal_entry_template_account/journal_entry_template_account.py index f84fddd54ca1a6088cb27b0cf97922da60d66b2e..1ab32d346063c9b1288cf92429372fe76d9ea21d 100644 --- a/erpnext/accounts/doctype/journal_entry_template_account/journal_entry_template_account.py +++ b/erpnext/accounts/doctype/journal_entry_template_account/journal_entry_template_account.py @@ -7,4 +7,22 @@ from frappe.model.document import Document class JournalEntryTemplateAccount(Document): + # begin: auto-generated types + # This code is auto-generated. Do not modify anything in this block. + + from typing import TYPE_CHECKING + + if TYPE_CHECKING: + from frappe.types import DF + + account: DF.Link + cost_center: DF.Link | None + parent: DF.Data + parentfield: DF.Data + parenttype: DF.Data + party: DF.DynamicLink | None + party_type: DF.Link | None + project: DF.Link | None + # end: auto-generated types + pass diff --git a/erpnext/accounts/page/bank_reconciliation/bank_reconciliation.py b/erpnext/accounts/page/bank_reconciliation/bank_reconciliation.py index 452d1f1775d797d25922a5031f6df06556d4f274..0c61359e2a6197e5561c5e2fea5fe2db6853b07a 100644 --- a/erpnext/accounts/page/bank_reconciliation/bank_reconciliation.py +++ b/erpnext/accounts/page/bank_reconciliation/bank_reconciliation.py @@ -353,6 +353,10 @@ def make_journal_entry_and_reconcile(template, bank_account, transactions): "accounts", { "account": row.get("account"), + "party_type": row.get("party_type"), + "party": row.get("party"), + "cost_center": row.get("cost_center"), + "project": row.get("project"), "debit_in_account_currency": row.get("debit"), "credit_in_account_currency": row.get("credit"), }, diff --git a/erpnext/accounts/page/bank_reconciliation/bank_reconciliation_page/BankReconciliationTransactionList.vue b/erpnext/accounts/page/bank_reconciliation/bank_reconciliation_page/BankReconciliationTransactionList.vue index ebc76addfe9774ccbcf277a80c642a708da61aee..7fafbae08be943c4596b74e0cb39cea8f659e4e7 100644 --- a/erpnext/accounts/page/bank_reconciliation/bank_reconciliation_page/BankReconciliationTransactionList.vue +++ b/erpnext/accounts/page/bank_reconciliation/bank_reconciliation_page/BankReconciliationTransactionList.vue @@ -154,6 +154,34 @@ async function make_journal_entry() { label: __("Account"), in_list_view: 1 }, + { + fieldname: "party_type", + fieldtype: "Link", + options: "Doctype", + label: __("Party Type"), + hidden: 1, + }, + { + fieldname: "party", + fieldtype: "Dynamic Link", + options: "party_type", + label: __("Party"), + hidden: 1, + }, + { + fieldname: "project", + fieldtype: "Link", + options: "Project", + label: __("Project"), + hidden: 1, + }, + { + fieldname: "cost_center", + fieldtype: "Link", + options: "Cost Center", + label: __("Cost Center"), + hidden: 1, + }, { fieldname: "debit", fieldtype: "Currency", @@ -251,12 +279,20 @@ async function make_journal_entry() { if (bank_account_gl.message.account == row.account) { data.push({ account: row.account, + party_type: row.party_type, + party: row.party, + cost_center: row.cost_center, + project: row.project, debit: total_amount > 0 ? Math.abs(total_amount) : 0.0, credit: total_amount < 0 ? Math.abs(total_amount) : 0.0 }) } else { data.push({ account: row.account, + party_type: row.party_type, + party: row.party, + cost_center: row.cost_center, + project: row.project, debit: total_amount < 0 && !total_allocated ? Math.abs(total_amount) : 0.0, credit: total_amount > 0 && !total_allocated ? Math.abs(total_amount) : 0.0 })