rearranged fields in journal entry and journal entry type

This commit is contained in:
Abhishek Balam 2020-04-29 11:13:55 +05:30
parent 8aa8457a2d
commit 8dbc4e648b
4 changed files with 17 additions and 25 deletions

View File

@ -123,9 +123,9 @@ frappe.ui.form.on("Journal Entry", {
voucher_type: function(frm){ voucher_type: function(frm){
if(!frm.doc.company) return; if(!frm.doc.company) return null;
if((!(frm.doc.accounts || []).length) || ((frm.doc.accounts || []).length==1 && !frm.doc.accounts[0].account)) { 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)) { if(in_list(["Bank Entry", "Cash Entry"], frm.doc.voucher_type)) {
return frappe.call({ return frappe.call({
type: "GET", type: "GET",
@ -143,7 +143,7 @@ frappe.ui.form.on("Journal Entry", {
} }
} }
} }
}) });
} }
else if(frm.doc.voucher_type=="Opening Entry") { else if(frm.doc.voucher_type=="Opening Entry") {
return frappe.call({ return frappe.call({
@ -157,9 +157,9 @@ frappe.ui.form.on("Journal Entry", {
if(r.message) { if(r.message) {
update_jv_details(frm.doc, 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 "is_opening": doc.is_opening
}) })
update_jv_details(frm.doc, doc.accounts); update_jv_details(frm.doc, doc.accounts);
}) });
.catch((err)=>{
console.log(err);
})
} }
} }
}); });

View File

@ -11,11 +11,11 @@
"title", "title",
"voucher_type", "voucher_type",
"naming_series", "naming_series",
"from_template",
"column_break1",
"posting_date",
"company",
"finance_book", "finance_book",
"column_break1",
"from_template",
"company",
"posting_date",
"2_add_edit_gl_entries", "2_add_edit_gl_entries",
"accounts", "accounts",
"section_break99", "section_break99",
@ -503,7 +503,7 @@
"idx": 176, "idx": 176,
"is_submittable": 1, "is_submittable": 1,
"links": [], "links": [],
"modified": "2020-04-26 13:04:05.230155", "modified": "2020-04-29 10:55:28.240916",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "Journal Entry", "name": "Journal Entry",

View File

@ -33,7 +33,7 @@ frappe.ui.form.on("Journal Entry Template", {
} }
if(!frm.doc.company) return; if(!frm.doc.company) return;
frm.trigger("clear_child"); frm.trigger("clear_child");
switch(frm.doc.voucher_type){ switch(frm.doc.voucher_type){
case "Opening Entry": case "Opening Entry":
@ -49,7 +49,7 @@ frappe.ui.form.on("Journal Entry Template", {
add_accounts(frm.doc, r.message); add_accounts(frm.doc, r.message);
} }
} }
}) });
break; break;
case "Bank Entry": case "Bank Entry":
case "Cash Entry": case "Cash Entry":

View File

@ -9,11 +9,10 @@
"field_order": [ "field_order": [
"section_break_1", "section_break_1",
"template_title", "template_title",
"section_break_2",
"company",
"voucher_type", "voucher_type",
"column_break_3",
"naming_series", "naming_series",
"column_break_3",
"company",
"is_opening", "is_opening",
"section_break_3", "section_break_3",
"accounts" "accounts"
@ -52,10 +51,6 @@
"label": "Is Opening", "label": "Is Opening",
"options": "No\nYes" "options": "No\nYes"
}, },
{
"fieldname": "section_break_2",
"fieldtype": "Section Break"
},
{ {
"fieldname": "accounts", "fieldname": "accounts",
"fieldtype": "Table", "fieldtype": "Table",
@ -84,7 +79,7 @@
} }
], ],
"links": [], "links": [],
"modified": "2020-04-26 04:29:03.347852", "modified": "2020-04-29 10:52:33.526433",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "Journal Entry Template", "name": "Journal Entry Template",