|
Lines 169-174
Link Here
|
| 169 |
|
169 |
|
| 170 |
/** |
170 |
/** |
| 171 |
* Print an account and its balance and limit |
171 |
* Print an account and its balance and limit |
|
|
172 |
* |
| 173 |
* value, valueToMinBal - in currency of acc, not in base currency |
| 172 |
*/ |
174 |
*/ |
| 173 |
void showAccountEntry(const MyMoneyAccount& acc, const MyMoneyMoney& value, const MyMoneyMoney& valueToMinBal, const bool showMinBal) |
175 |
void showAccountEntry(const MyMoneyAccount& acc, const MyMoneyMoney& value, const MyMoneyMoney& valueToMinBal, const bool showMinBal) |
| 174 |
{ |
176 |
{ |
|
Lines 181-186
Link Here
|
| 181 |
//format amounts |
183 |
//format amounts |
| 182 |
amount = MyMoneyUtils::formatMoney(value, acc, currency); |
184 |
amount = MyMoneyUtils::formatMoney(value, acc, currency); |
| 183 |
amount.replace(QChar(' '), " "); |
185 |
amount.replace(QChar(' '), " "); |
|
|
186 |
|
| 187 |
if (acc.currencyId() != file->baseCurrency().id()) { |
| 188 |
const auto curPrice = file->price(acc.tradingCurrencyId(), file->baseCurrency().id(), QDate::currentDate()); |
| 189 |
const auto curRate = curPrice.rate(file->baseCurrency().id()); |
| 190 |
auto baseValue = value * curRate; |
| 191 |
baseValue = baseValue.convert(file->baseCurrency().smallestAccountFraction()); |
| 192 |
QString amountBaseCurrency = MyMoneyUtils::formatMoney(baseValue, file->baseCurrency()); |
| 193 |
amountBaseCurrency.replace(QChar(' '), " "); |
| 194 |
amount = amount + " (" + amountBaseCurrency + ")"; |
| 195 |
} |
| 196 |
|
| 184 |
if (showMinBal) { |
197 |
if (showMinBal) { |
| 185 |
amountToMinBal = MyMoneyUtils::formatMoney(valueToMinBal, acc, currency); |
198 |
amountToMinBal = MyMoneyUtils::formatMoney(valueToMinBal, acc, currency); |
| 186 |
amountToMinBal.replace(QChar(' '), " "); |
199 |
amountToMinBal.replace(QChar(' '), " "); |