fix: Add accounting dimensions for round off GL Entry

(cherry picked from commit 015812b0b8)
This commit is contained in:
Deepesh Garg
2022-04-23 21:40:08 +05:30
committed by mergify-bot
parent fe9f32946c
commit dedb90ea72

View File

@@ -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"]