ALT Linux Bugzilla
– Attachment 15593 Details for
Bug 49500
Если счёт ведётся не в основной валюте, дополнительно показать его сумму в основной валюте
New bug
|
Search
|
[?]
|
Help
Register
|
Log In
[x]
|
Forgot Password
Login:
[x]
|
EN
|
RU
[patch]
Additionaly show account value in base currency
patch_to_khomeview_p.h (text/plain), 1.40 KB, created by
campanula_rot
on 2024-02-23 16:31:06 MSK
(
hide
)
Description:
Additionaly show account value in base currency
Filename:
MIME Type:
Creator:
campanula_rot
Created:
2024-02-23 16:31:06 MSK
Size:
1.40 KB
patch
obsolete
>--- ./old_khomeview_p.h 2022-07-30 11:40:15.000000000 +0300 >+++ ./khomeview_p.h 2024-02-03 14:49:07.303025200 +0300 >@@ -169,6 +169,8 @@ > > /** > * Print an account and its balance and limit >+ * >+ * value, valueToMinBal - in currency of acc, not in base currency > */ > void showAccountEntry(const MyMoneyAccount& acc, const MyMoneyMoney& value, const MyMoneyMoney& valueToMinBal, const bool showMinBal) > { >@@ -181,6 +183,17 @@ > //format amounts > amount = MyMoneyUtils::formatMoney(value, acc, currency); > amount.replace(QChar(' '), " "); >+ >+ if (acc.currencyId() != file->baseCurrency().id()) { >+ const auto curPrice = file->price(acc.tradingCurrencyId(), file->baseCurrency().id(), QDate::currentDate()); >+ const auto curRate = curPrice.rate(file->baseCurrency().id()); >+ auto baseValue = value * curRate; >+ baseValue = baseValue.convert(file->baseCurrency().smallestAccountFraction()); >+ QString amountBaseCurrency = MyMoneyUtils::formatMoney(baseValue, file->baseCurrency()); >+ amountBaseCurrency.replace(QChar(' '), " "); >+ amount = amount + " (" + amountBaseCurrency + ")"; >+ } >+ > if (showMinBal) { > amountToMinBal = MyMoneyUtils::formatMoney(valueToMinBal, acc, currency); > amountToMinBal.replace(QChar(' '), " ");
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 49500
:
15592
| 15593