fix: always send account currency in response
This commit is contained in:
parent
68b04e2577
commit
5caaccc94b
@ -233,6 +233,10 @@ def get_account_details(account, company, posting_date, party_type=None, party=N
|
||||
balance = get_balance_on(
|
||||
account, date=posting_date, party_type=party_type, party=party, in_account_currency=False
|
||||
)
|
||||
account_details = {
|
||||
"account_currency": account_currency,
|
||||
}
|
||||
|
||||
if balance:
|
||||
balance_in_account_currency = get_balance_on(
|
||||
account, date=posting_date, party_type=party_type, party=party
|
||||
@ -242,13 +246,14 @@ def get_account_details(account, company, posting_date, party_type=None, party=N
|
||||
)
|
||||
new_exchange_rate = get_exchange_rate(account_currency, company_currency, posting_date)
|
||||
new_balance_in_base_currency = balance_in_account_currency * new_exchange_rate
|
||||
account_details = {
|
||||
"account_currency": account_currency,
|
||||
"balance_in_base_currency": balance,
|
||||
"balance_in_account_currency": balance_in_account_currency,
|
||||
"current_exchange_rate": current_exchange_rate,
|
||||
"new_exchange_rate": new_exchange_rate,
|
||||
"new_balance_in_base_currency": new_balance_in_base_currency,
|
||||
}
|
||||
account_details = account_details.update(
|
||||
{
|
||||
"balance_in_base_currency": balance,
|
||||
"balance_in_account_currency": balance_in_account_currency,
|
||||
"current_exchange_rate": current_exchange_rate,
|
||||
"new_exchange_rate": new_exchange_rate,
|
||||
"new_balance_in_base_currency": new_balance_in_base_currency,
|
||||
}
|
||||
)
|
||||
|
||||
return account_details
|
||||
|
Loading…
Reference in New Issue
Block a user