diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.js b/erpnext/accounts/doctype/journal_entry/journal_entry.js index 0e5eee4186..2e5d6b3847 100644 --- a/erpnext/accounts/doctype/journal_entry/journal_entry.js +++ b/erpnext/accounts/doctype/journal_entry/journal_entry.js @@ -123,9 +123,9 @@ frappe.ui.form.on("Journal Entry", { voucher_type: function(frm){ - if(!frm.doc.company) return; - - if((!(frm.doc.accounts || []).length) || ((frm.doc.accounts || []).length==1 && !frm.doc.accounts[0].account)) { + if(!frm.doc.company) return null; + + if((!(frm.doc.accounts || []).length) || ((frm.doc.accounts || []).length === 1 && !frm.doc.accounts[0].account)) { if(in_list(["Bank Entry", "Cash Entry"], frm.doc.voucher_type)) { return frappe.call({ type: "GET", @@ -143,7 +143,7 @@ frappe.ui.form.on("Journal Entry", { } } } - }) + }); } else if(frm.doc.voucher_type=="Opening Entry") { return frappe.call({ @@ -157,9 +157,9 @@ frappe.ui.form.on("Journal Entry", { if(r.message) { update_jv_details(frm.doc, r.message); } - cur_frm.set_value("is_opening", "Yes") + cur_frm.set_value("is_opening", "Yes"); } - }) + }); } } }, @@ -176,10 +176,7 @@ frappe.ui.form.on("Journal Entry", { "is_opening": doc.is_opening }) update_jv_details(frm.doc, doc.accounts); - }) - .catch((err)=>{ - console.log(err); - }) + }); } } }); diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.json b/erpnext/accounts/doctype/journal_entry/journal_entry.json index 7892042bb9..9d5063929f 100644 --- a/erpnext/accounts/doctype/journal_entry/journal_entry.json +++ b/erpnext/accounts/doctype/journal_entry/journal_entry.json @@ -11,11 +11,11 @@ "title", "voucher_type", "naming_series", - "from_template", - "column_break1", - "posting_date", - "company", "finance_book", + "column_break1", + "from_template", + "company", + "posting_date", "2_add_edit_gl_entries", "accounts", "section_break99", @@ -503,7 +503,7 @@ "idx": 176, "is_submittable": 1, "links": [], - "modified": "2020-04-26 13:04:05.230155", + "modified": "2020-04-29 10:55:28.240916", "modified_by": "Administrator", "module": "Accounts", "name": "Journal Entry", 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 3dc66aaa58..2a549778d7 100644 --- a/erpnext/accounts/doctype/journal_entry_template/journal_entry_template.js +++ b/erpnext/accounts/doctype/journal_entry_template/journal_entry_template.js @@ -33,7 +33,7 @@ frappe.ui.form.on("Journal Entry Template", { } if(!frm.doc.company) return; - + frm.trigger("clear_child"); switch(frm.doc.voucher_type){ case "Opening Entry": @@ -49,7 +49,7 @@ frappe.ui.form.on("Journal Entry Template", { add_accounts(frm.doc, r.message); } } - }) + }); break; case "Bank Entry": case "Cash Entry": 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 3f6cb026aa..c411401a3f 100644 --- a/erpnext/accounts/doctype/journal_entry_template/journal_entry_template.json +++ b/erpnext/accounts/doctype/journal_entry_template/journal_entry_template.json @@ -9,11 +9,10 @@ "field_order": [ "section_break_1", "template_title", - "section_break_2", - "company", "voucher_type", - "column_break_3", "naming_series", + "column_break_3", + "company", "is_opening", "section_break_3", "accounts" @@ -52,10 +51,6 @@ "label": "Is Opening", "options": "No\nYes" }, - { - "fieldname": "section_break_2", - "fieldtype": "Section Break" - }, { "fieldname": "accounts", "fieldtype": "Table", @@ -84,7 +79,7 @@ } ], "links": [], - "modified": "2020-04-26 04:29:03.347852", + "modified": "2020-04-29 10:52:33.526433", "modified_by": "Administrator", "module": "Accounts", "name": "Journal Entry Template",