From dedb90ea72e5d2eb5f213f3aa7887672d4f68078 Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Sat, 23 Apr 2022 21:40:08 +0530 Subject: [PATCH] fix: Add accounting dimensions for round off GL Entry (cherry picked from commit 015812b0b8216d0d66e005700691dfa1ace74bf7) --- erpnext/accounts/general_ledger.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/erpnext/accounts/general_ledger.py b/erpnext/accounts/general_ledger.py index 7973387067b..6f7535fb964 100644 --- a/erpnext/accounts/general_ledger.py +++ b/erpnext/accounts/general_ledger.py @@ -310,10 +310,22 @@ def make_round_off_gle(gl_map, debit_credit_diff, precision): } ) + update_accounting_dimensions(round_off_gle) + if not round_off_account_exists: gl_map.append(round_off_gle) +def update_accounting_dimensions(round_off_gle): + dimensions = get_accounting_dimensions() + dimension_values = frappe.db.get_value( + round_off_gle["voucher_type"], round_off_gle["voucher_no"], dimensions + ) + + for dimension in dimensions: + round_off_gle[dimension] = dimension_values.get(dimension) + + def get_round_off_account_and_cost_center(company, voucher_type, voucher_no): round_off_account, round_off_cost_center = frappe.get_cached_value( "Company", company, ["round_off_account", "round_off_cost_center"]