fix: fetch rounded total while pulling reference details on SO
(cherry picked from commit 714b8289c1)
This commit is contained in:
@@ -1867,10 +1867,15 @@ def get_reference_details(reference_doctype, reference_name, party_account_curre
|
|||||||
if not total_amount:
|
if not total_amount:
|
||||||
if party_account_currency == company_currency:
|
if party_account_currency == company_currency:
|
||||||
# for handling cases that don't have multi-currency (base field)
|
# for handling cases that don't have multi-currency (base field)
|
||||||
total_amount = ref_doc.get("base_grand_total") or ref_doc.get("grand_total")
|
total_amount = (
|
||||||
|
ref_doc.get("base_rounded_total")
|
||||||
|
or ref_doc.get("rounded_total")
|
||||||
|
or ref_doc.get("base_grand_total")
|
||||||
|
or ref_doc.get("grand_total")
|
||||||
|
)
|
||||||
exchange_rate = 1
|
exchange_rate = 1
|
||||||
else:
|
else:
|
||||||
total_amount = ref_doc.get("grand_total")
|
total_amount = ref_doc.get("rounded_total") or ref_doc.get("grand_total")
|
||||||
if not exchange_rate:
|
if not exchange_rate:
|
||||||
# Get the exchange rate from the original ref doc
|
# Get the exchange rate from the original ref doc
|
||||||
# or get it based on the posting date of the ref doc.
|
# or get it based on the posting date of the ref doc.
|
||||||
|
|||||||
Reference in New Issue
Block a user