fix: General Ledger and TB opening entries mismatch issues
This commit is contained in:
parent
1d683ca9f2
commit
6acd0325be
@ -149,22 +149,6 @@ frappe.ui.form.on("Journal Entry", {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else if(frm.doc.voucher_type=="Opening Entry") {
|
|
||||||
return frappe.call({
|
|
||||||
type:"GET",
|
|
||||||
method: "erpnext.accounts.doctype.journal_entry.journal_entry.get_opening_accounts",
|
|
||||||
args: {
|
|
||||||
"company": frm.doc.company
|
|
||||||
},
|
|
||||||
callback: function(r) {
|
|
||||||
frappe.model.clear_table(frm.doc, "accounts");
|
|
||||||
if(r.message) {
|
|
||||||
update_jv_details(frm.doc, r.message);
|
|
||||||
}
|
|
||||||
cur_frm.set_value("is_opening", "Yes");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -137,7 +137,8 @@
|
|||||||
"fieldname": "finance_book",
|
"fieldname": "finance_book",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"label": "Finance Book",
|
"label": "Finance Book",
|
||||||
"options": "Finance Book"
|
"options": "Finance Book",
|
||||||
|
"read_only": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "2_add_edit_gl_entries",
|
"fieldname": "2_add_edit_gl_entries",
|
||||||
@ -538,7 +539,7 @@
|
|||||||
"idx": 176,
|
"idx": 176,
|
||||||
"is_submittable": 1,
|
"is_submittable": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2022-04-06 17:18:46.865259",
|
"modified": "2022-06-23 22:01:32.348337",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "Journal Entry",
|
"name": "Journal Entry",
|
||||||
|
@ -1204,24 +1204,6 @@ def get_payment_entry(ref_doc, args):
|
|||||||
return je if args.get("journal_entry") else je.as_dict()
|
return je if args.get("journal_entry") else je.as_dict()
|
||||||
|
|
||||||
|
|
||||||
@frappe.whitelist()
|
|
||||||
def get_opening_accounts(company):
|
|
||||||
"""get all balance sheet accounts for opening entry"""
|
|
||||||
accounts = frappe.db.sql_list(
|
|
||||||
"""select
|
|
||||||
name from tabAccount
|
|
||||||
where
|
|
||||||
is_group=0 and report_type='Balance Sheet' and company={0} and
|
|
||||||
name not in (select distinct account from tabWarehouse where
|
|
||||||
account is not null and account != '')
|
|
||||||
order by name asc""".format(
|
|
||||||
frappe.db.escape(company)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
return [{"account": a, "balance": get_balance_on(a)} for a in accounts]
|
|
||||||
|
|
||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
@frappe.validate_and_sanitize_search_inputs
|
@frappe.validate_and_sanitize_search_inputs
|
||||||
def get_against_jv(doctype, txt, searchfield, start, page_len, filters):
|
def get_against_jv(doctype, txt, searchfield, start, page_len, filters):
|
||||||
|
@ -425,7 +425,7 @@ def get_accountwise_gle(filters, accounting_dimensions, gl_entries, gle_map):
|
|||||||
update_value_in_dict(totals, "opening", gle)
|
update_value_in_dict(totals, "opening", gle)
|
||||||
update_value_in_dict(totals, "closing", gle)
|
update_value_in_dict(totals, "closing", gle)
|
||||||
|
|
||||||
elif gle.posting_date <= to_date:
|
elif gle.posting_date <= to_date or (cstr(gle.is_opening) == "Yes" and show_opening_entries):
|
||||||
if not group_by_voucher_consolidated:
|
if not group_by_voucher_consolidated:
|
||||||
update_value_in_dict(gle_map[group_by_value].totals, "total", gle)
|
update_value_in_dict(gle_map[group_by_value].totals, "total", gle)
|
||||||
update_value_in_dict(gle_map[group_by_value].totals, "closing", gle)
|
update_value_in_dict(gle_map[group_by_value].totals, "closing", gle)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user