diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.js b/erpnext/accounts/doctype/journal_entry/journal_entry.js index 475e95750ca6d6bdd5c5efa75be9754632bd2a3e..227f7993ee6f565b57d46143441ba206dc3c64b7 100644 --- a/erpnext/accounts/doctype/journal_entry/journal_entry.js +++ b/erpnext/accounts/doctype/journal_entry/journal_entry.js @@ -248,7 +248,8 @@ frappe.ui.form.on("Journal Entry", { "voucher_type": doc.voucher_type, "naming_series": doc.naming_series, "is_opening": doc.is_opening, - "multi_currency": doc.multi_currency + "multi_currency": doc.multi_currency, + "accounting_journal": doc.accounting_journal, }) update_jv_details(frm.doc, doc.accounts); }); diff --git a/erpnext/accounts/doctype/journal_entry_template/journal_entry_template.js b/erpnext/accounts/doctype/journal_entry_template/journal_entry_template.js index 846d0f9f1d64a5b0d20a94c5fe17740e1faa2b05..71a06c98cc154ceee2ac725b5baab4a4be4dc5dc 100644 --- a/erpnext/accounts/doctype/journal_entry_template/journal_entry_template.js +++ b/erpnext/accounts/doctype/journal_entry_template/journal_entry_template.js @@ -17,6 +17,15 @@ frappe.ui.form.on("Journal Entry Template", { }); } }, + setup: function(frm) { + frm.set_query("accounting_journal", function(){ + return { + filters: { + "company": frm.doc.company + } + } + }); + }, refresh: function(frm) { frappe.model.set_default_values(frm.doc); 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 d7fe6cdde4ca80331382b12e1c2b0e065c4f5414..6536dfc73c5e4b497f92a8b4501ffb4ffef395dc 100644 --- a/erpnext/accounts/doctype/journal_entry_template/journal_entry_template.json +++ b/erpnext/accounts/doctype/journal_entry_template/journal_entry_template.json @@ -10,6 +10,7 @@ "section_break_1", "template_title", "voucher_type", + "accounting_journal", "naming_series", "column_break_3", "company", @@ -83,13 +84,20 @@ "fieldname": "multi_currency", "fieldtype": "Check", "label": "Multi Currency" + }, + { + "fieldname": "accounting_journal", + "fieldtype": "Link", + "label": "Accounting Journal", + "options": "Accounting Journal" } ], "links": [], - "modified": "2020-05-01 18:32:01.420488", + "modified": "2024-03-23 14:18:06.010774", "modified_by": "Administrator", "module": "Accounts", "name": "Journal Entry Template", + "naming_rule": "By fieldname", "owner": "Administrator", "permissions": [ { @@ -129,6 +137,7 @@ "search_fields": "voucher_type, company", "sort_field": "modified", "sort_order": "DESC", + "states": [], "title_field": "template_title", "track_changes": 1 -} \ No newline at end of file +} 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 866e2a3eb9ddc7a3b173f6fe85c2a776dbc66f61..831c1be6d46d693126f3e452fcf9e46822837ddd 100644 --- a/erpnext/accounts/doctype/journal_entry_template/journal_entry_template.py +++ b/erpnext/accounts/doctype/journal_entry_template/journal_entry_template.py @@ -8,6 +8,44 @@ from frappe.utils import cint class JournalEntryTemplate(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 + + from erpnext.accounts.doctype.journal_entry_template_account.journal_entry_template_account import ( + JournalEntryTemplateAccount, + ) + + accounting_journal: DF.Link | None + accounts: DF.Table[JournalEntryTemplateAccount] + company: DF.Link + is_opening: DF.Literal["No", "Yes"] + multi_currency: DF.Check + naming_series: DF.Literal[None] + template_title: DF.Data + voucher_type: DF.Literal[ + "Journal Entry", + "Inter Company Journal Entry", + "Bank Entry", + "Cash Entry", + "Credit Card Entry", + "Debit Note", + "Credit Note", + "Contra Entry", + "Excise Entry", + "Write Off Entry", + "Opening Entry", + "Depreciation Entry", + "Exchange Rate Revaluation", + "Deferred Revenue", + "Deferred Expense", + ] + # end: auto-generated types + pass