fix: dimension name in remark

This commit is contained in:
Gursheen Anand 2023-07-27 15:45:48 +05:30
parent 3f5afb9cac
commit 4f9242d699

View File

@ -66,15 +66,16 @@ def make_acc_dimensions_offsetting_entry(gl_map):
offsetting_entries = []
for gle in gl_map:
for dimension in accounting_dimensions_to_offset:
offsetting_account = dimension.offsetting_account
offsetting_entry = gle.copy()
debit = flt(gle.credit) / no_of_dimensions if gle.credit != 0 else 0
credit = flt(gle.debit) / no_of_dimensions if gle.debit != 0 else 0
offsetting_entry.update(
{
"account": offsetting_account,
"debit": flt(gle.credit) / no_of_dimensions if gle.credit != 0 else 0,
"credit": flt(gle.debit) / no_of_dimensions if gle.debit != 0 else 0,
"debit_in_account_currency": flt(gle.credit) / no_of_dimensions if gle.credit != 0 else 0,
"credit_in_account_currency": flt(gle.debit) / no_of_dimensions if gle.debit != 0 else 0,
"account": dimension.offsetting_account,
"debit": debit,
"credit": credit,
"debit_in_account_currency": debit,
"credit_in_account_currency": credit,
"remarks": _("Offsetting for Accounting Dimension") + " - {0}".format(dimension.name),
"against_voucher": None,
}
@ -91,7 +92,7 @@ def get_accounting_dimensions_for_offsetting_entry(gl_map, company):
frappe.qb.from_(acc_dimension)
.inner_join(dimension_detail)
.on(acc_dimension.name == dimension_detail.parent)
.select(acc_dimension.fieldname, dimension_detail.offsetting_account)
.select(acc_dimension.fieldname, acc_dimension.name, dimension_detail.offsetting_account)
.where(
(acc_dimension.disabled == 0)
& (dimension_detail.company == company)