Skip to content

Commit

Permalink
fix: Multi currency opening invoices
Browse files Browse the repository at this point in the history
  • Loading branch information
deepeshgarg007 committed Apr 29, 2022
1 parent 1622faa commit a8452c2
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,13 @@ def get_invoices(self):
)
or {}
)

default_currency = frappe.db.get_value(row.party_type, row.party, "default_currency")

if company_details:
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"),
}
)
Expand Down Expand Up @@ -154,7 +157,6 @@ def get_item_dict():
"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(
Expand All @@ -167,7 +169,6 @@ def get_item_dict():
"description": row.item_name or "Opening Invoice Item",
income_expense_account_field: row.temporary_opening_account,
"cost_center": cost_center,
"currency": default_currency,
}
)

Expand Down

0 comments on commit a8452c2

Please sign in to comment.