Merge pull request #30802 from deepeshgarg007/multi_currency_opening

fix: Allow multi-currency opening invoices
This commit is contained in:
Deepesh Garg 2022-04-29 13:34:54 +05:30 committed by GitHub
commit 1622faad40
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -154,6 +154,7 @@ class OpeningInvoiceCreationTool(Document):
"income_account" if row.party_type == "Customer" else "expense_account"
)
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)
item_dict = frappe._dict(
@ -166,6 +167,7 @@ class OpeningInvoiceCreationTool(Document):
"description": row.item_name or "Opening Invoice Item",
income_expense_account_field: row.temporary_opening_account,
"cost_center": cost_center,
"currency": default_currency,
}
)