Skip to content

Commit

Permalink
fix: Add accounting dimensions for round off GL Entry
Browse files Browse the repository at this point in the history
(cherry picked from commit 015812b)
  • Loading branch information
deepeshgarg007 authored and mergify-bot committed Apr 25, 2022
1 parent fe9f329 commit dedb90e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions erpnext/accounts/general_ledger.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down

0 comments on commit dedb90e

Please sign in to comment.