fix: Add accounting dimensions for round off GL Entry

This commit is contained in:
Deepesh Garg 2022-04-23 21:40:08 +05:30
parent c42547d40f
commit 015812b0b8

View File

@ -392,10 +392,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"]