diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.js b/erpnext/accounts/doctype/journal_entry/journal_entry.js index 3d6aab4d1a1113f4fb4342f55280b38e4665f86e..e2b714289f94f16144acc5b6660bb4d996514280 100644 --- a/erpnext/accounts/doctype/journal_entry/journal_entry.js +++ b/erpnext/accounts/doctype/journal_entry/journal_entry.js @@ -296,6 +296,10 @@ 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, "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 b5fa02d53c841d68b8bc54531744cc5a1c6532a6..35d959c286bb0c96beca69b5a91e3f7807d44e1d 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-27 13:09:58.814734", + "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 18704ab4be23c7c59bb39f25ace9c5e6f690fe4a..f18eb1c640c09c9c12d94f088bbdcc2b407067fa 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": "2024-03-27 13:09:58.986448", + "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 dc6ba22ad1a50b518160d9ce23f494a5c9c51603..6c4a9508a1ba987d433460929be1b1b88d3ca49e 100644 --- a/erpnext/accounts/page/bank_reconciliation/bank_reconciliation.py +++ b/erpnext/accounts/page/bank_reconciliation/bank_reconciliation.py @@ -348,6 +348,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 6e1ec446577224bd68888f58e44521b2d468ae3c..f9f86c8d34f6a04e9f6e2bf6a772b3ae9850d4e7 100644 --- a/erpnext/accounts/page/bank_reconciliation/bank_reconciliation_page/BankReconciliationTransactionList.vue +++ b/erpnext/accounts/page/bank_reconciliation/bank_reconciliation_page/BankReconciliationTransactionList.vue @@ -174,6 +174,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", @@ -268,12 +296,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, });