Merge branch 'version-13-hotfix' into small-fixes

This commit is contained in:
Saurabh
2022-11-23 18:16:49 +05:30
committed by GitHub

View File

@@ -298,13 +298,15 @@ def make_round_off_gle(gl_map, debit_credit_diff, precision):
round_off_account, round_off_cost_center = get_round_off_account_and_cost_center( round_off_account, round_off_cost_center = get_round_off_account_and_cost_center(
gl_map[0].company, gl_map[0].voucher_type, gl_map[0].voucher_no gl_map[0].company, gl_map[0].voucher_type, gl_map[0].voucher_no
) )
round_off_account_exists = False
round_off_gle = frappe._dict() round_off_gle = frappe._dict()
round_off_account_exists = False
if gl_map[0].voucher_type != "Period Closing Voucher":
for d in gl_map: for d in gl_map:
if d.account == round_off_account: if d.account == round_off_account:
round_off_gle = d round_off_gle = d
if d.debit: if d.debit:
debit_credit_diff -= flt(d.debit) debit_credit_diff -= flt(d.debit) - flt(d.credit)
else: else:
debit_credit_diff += flt(d.credit) debit_credit_diff += flt(d.credit)
round_off_account_exists = True round_off_account_exists = True
@@ -334,7 +336,6 @@ def make_round_off_gle(gl_map, debit_credit_diff, precision):
) )
update_accounting_dimensions(round_off_gle) update_accounting_dimensions(round_off_gle)
if not round_off_account_exists: if not round_off_account_exists:
gl_map.append(round_off_gle) gl_map.append(round_off_gle)