fix: Add multi currency check and proper account filters
This commit is contained in:
parent
db83c29079
commit
978de8779c
@ -173,7 +173,8 @@ frappe.ui.form.on("Journal Entry", {
|
||||
"company": doc.company,
|
||||
"voucher_type": doc.voucher_type,
|
||||
"naming_series": doc.naming_series,
|
||||
"is_opening": doc.is_opening
|
||||
"is_opening": doc.is_opening,
|
||||
"multi_currency": doc.multi_currency
|
||||
})
|
||||
update_jv_details(frm.doc, doc.accounts);
|
||||
});
|
||||
|
@ -4,13 +4,22 @@
|
||||
frappe.ui.form.on("Journal Entry Template", {
|
||||
setup: function(frm) {
|
||||
frappe.model.set_default_values(frm.doc);
|
||||
|
||||
frm.set_query("account" ,"accounts", function(){
|
||||
return {
|
||||
filters: {
|
||||
"company": frm.doc.company,
|
||||
}
|
||||
var filters = {
|
||||
company: frm.doc.company,
|
||||
is_group: 0
|
||||
};
|
||||
|
||||
if(!frm.doc.multi_currency) {
|
||||
$.extend(filters, {
|
||||
account_currency: frappe.get_doc(":Company", frm.doc.company).default_currency
|
||||
});
|
||||
}
|
||||
|
||||
return { filters: filters };
|
||||
});
|
||||
|
||||
frappe.call({
|
||||
type: "GET",
|
||||
method: "erpnext.accounts.doctype.journal_entry_template.journal_entry_template.get_naming_series",
|
||||
|
@ -14,6 +14,7 @@
|
||||
"column_break_3",
|
||||
"company",
|
||||
"is_opening",
|
||||
"multi_currency",
|
||||
"section_break_3",
|
||||
"accounts"
|
||||
],
|
||||
@ -76,10 +77,16 @@
|
||||
{
|
||||
"fieldname": "section_break_3",
|
||||
"fieldtype": "Section Break"
|
||||
},
|
||||
{
|
||||
"default": "0",
|
||||
"fieldname": "multi_currency",
|
||||
"fieldtype": "Check",
|
||||
"label": "Multi Currency"
|
||||
}
|
||||
],
|
||||
"links": [],
|
||||
"modified": "2020-04-29 10:52:33.526433",
|
||||
"modified": "2020-05-01 18:32:01.420488",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Journal Entry Template",
|
||||
|
Loading…
Reference in New Issue
Block a user