fix: opening invoice creation tool not taking in accouting dimension
This commit is contained in:
parent
11fae15bec
commit
e2267cdba8
@ -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
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user