fix: Multi currency opening invoices
This commit is contained in:
parent
1622faad40
commit
a8452c2ba2
@ -114,10 +114,13 @@ class OpeningInvoiceCreationTool(Document):
|
|||||||
)
|
)
|
||||||
or {}
|
or {}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
default_currency = frappe.db.get_value(row.party_type, row.party, "default_currency")
|
||||||
|
|
||||||
if company_details:
|
if company_details:
|
||||||
invoice.update(
|
invoice.update(
|
||||||
{
|
{
|
||||||
"currency": company_details.get("default_currency"),
|
"currency": default_currency or company_details.get("default_currency"),
|
||||||
"letter_head": company_details.get("default_letter_head"),
|
"letter_head": company_details.get("default_letter_head"),
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
@ -154,7 +157,6 @@ class OpeningInvoiceCreationTool(Document):
|
|||||||
"income_account" if row.party_type == "Customer" else "expense_account"
|
"income_account" if row.party_type == "Customer" else "expense_account"
|
||||||
)
|
)
|
||||||
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")
|
||||||
default_currency = frappe.db.get_value(row.party_type, row.party, "default_currency")
|
|
||||||
rate = flt(row.outstanding_amount) / flt(row.qty)
|
rate = flt(row.outstanding_amount) / flt(row.qty)
|
||||||
|
|
||||||
item_dict = frappe._dict(
|
item_dict = frappe._dict(
|
||||||
@ -167,7 +169,6 @@ class OpeningInvoiceCreationTool(Document):
|
|||||||
"description": row.item_name or "Opening Invoice Item",
|
"description": row.item_name or "Opening Invoice Item",
|
||||||
income_expense_account_field: row.temporary_opening_account,
|
income_expense_account_field: row.temporary_opening_account,
|
||||||
"cost_center": cost_center,
|
"cost_center": cost_center,
|
||||||
"currency": default_currency,
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user