mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-13 10:11:20 +00:00
fix: opening invoice creation tool not taking in accouting dimension
(cherry picked from commit e2267cdba8)
This commit is contained in:
@@ -135,7 +135,7 @@ class OpeningInvoiceCreationTool(Document):
|
|||||||
default_uom = frappe.db.get_single_value("Stock Settings", "stock_uom") or _("Nos")
|
default_uom = frappe.db.get_single_value("Stock Settings", "stock_uom") or _("Nos")
|
||||||
rate = flt(row.outstanding_amount) / flt(row.qty)
|
rate = flt(row.outstanding_amount) / flt(row.qty)
|
||||||
|
|
||||||
return frappe._dict({
|
item_dict = frappe._dict({
|
||||||
"uom": default_uom,
|
"uom": default_uom,
|
||||||
"rate": rate or 0.0,
|
"rate": rate or 0.0,
|
||||||
"qty": row.qty,
|
"qty": row.qty,
|
||||||
@@ -146,6 +146,13 @@ class OpeningInvoiceCreationTool(Document):
|
|||||||
"cost_center": cost_center
|
"cost_center": cost_center
|
||||||
})
|
})
|
||||||
|
|
||||||
|
for dimension in get_accounting_dimensions():
|
||||||
|
item_dict.update({
|
||||||
|
dimension: row.get(dimension)
|
||||||
|
})
|
||||||
|
|
||||||
|
return item_dict
|
||||||
|
|
||||||
item = get_item_dict()
|
item = get_item_dict()
|
||||||
|
|
||||||
invoice = frappe._dict({
|
invoice = frappe._dict({
|
||||||
@@ -166,7 +173,7 @@ class OpeningInvoiceCreationTool(Document):
|
|||||||
accounting_dimension = get_accounting_dimensions()
|
accounting_dimension = get_accounting_dimensions()
|
||||||
for dimension in accounting_dimension:
|
for dimension in accounting_dimension:
|
||||||
invoice.update({
|
invoice.update({
|
||||||
dimension: item.get(dimension)
|
dimension: self.get(dimension) or item.get(dimension)
|
||||||
})
|
})
|
||||||
|
|
||||||
return invoice
|
return invoice
|
||||||
|
|||||||
Reference in New Issue
Block a user