mirror of
https://github.com/frappe/erpnext.git
synced 2026-09-01 15:47:06 +00:00
fix: Accounting dimensions for child tables
This commit is contained in:
@@ -339,7 +339,7 @@ class AccountsController(TransactionBase):
|
||||
frappe.throw(_("Row #{0}: Account {1} does not belong to company {2}")
|
||||
.format(d.idx, d.account_head, self.company))
|
||||
|
||||
def get_gl_dict(self, args, account_currency=None):
|
||||
def get_gl_dict(self, args, account_currency=None, item=None):
|
||||
"""this method populates the common properties of a gl entry record"""
|
||||
|
||||
posting_date = args.get('posting_date') or self.get('posting_date')
|
||||
@@ -372,6 +372,8 @@ class AccountsController(TransactionBase):
|
||||
|
||||
for dimension in accounting_dimensions:
|
||||
dimension_dict[dimension] = self.get(dimension)
|
||||
if item and item.get(dimension):
|
||||
dimension_dict[dimension] = item.get(dimension)
|
||||
|
||||
gl_dict.update(dimension_dict)
|
||||
gl_dict.update(args)
|
||||
|
||||
@@ -80,7 +80,7 @@ class StockController(AccountsController):
|
||||
"cost_center": item_row.cost_center,
|
||||
"remarks": self.get("remarks") or "Accounting Entry for Stock",
|
||||
"debit": flt(sle.stock_value_difference, 2),
|
||||
}, warehouse_account[sle.warehouse]["account_currency"]))
|
||||
}, warehouse_account[sle.warehouse]["account_currency"], item=item_row))
|
||||
|
||||
# to target warehouse / expense account
|
||||
gl_list.append(self.get_gl_dict({
|
||||
@@ -90,7 +90,7 @@ class StockController(AccountsController):
|
||||
"remarks": self.get("remarks") or "Accounting Entry for Stock",
|
||||
"credit": flt(sle.stock_value_difference, 2),
|
||||
"project": item_row.get("project") or self.get("project")
|
||||
}))
|
||||
}, item=item_row))
|
||||
elif sle.warehouse not in warehouse_with_no_account:
|
||||
warehouse_with_no_account.append(sle.warehouse)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user