Bug 797676 - Register displays amount in transaction currency...

instead of register currency.
This commit is contained in:
John Ralls 2020-04-10 14:05:48 -07:00
parent 642885a186
commit aac3ea6909

View File

@ -1879,10 +1879,6 @@ gnc_split_register_get_debcred_entry (VirtualLocation virt_loc,
} }
else else
{ {
/* If this account is not a stock/mutual/currency account, and
* currency != the account commodity, then use the SplitAmount
* instead of the SplitValue.
*/
gboolean currency_match; gboolean currency_match;
switch (reg->type) switch (reg->type)
{ {
@ -1893,10 +1889,21 @@ gnc_split_register_get_debcred_entry (VirtualLocation virt_loc,
print_info = gnc_commodity_print_info (currency, reg->mismatched_commodities); print_info = gnc_commodity_print_info (currency, reg->mismatched_commodities);
break; break;
/* If the register is not a stock/fund register that
* displays both amount and value, display the split value
* in the register's currency instead of the transaction's
* currency. Note that we don't want the split amount as
* some splits will be in a different currency.
*/
default: default:
if (commodity && !gnc_commodity_equal (commodity, currency))
/* Convert this to the "local" value */
amount = xaccSplitConvertAmount(split, account);
else
amount = xaccSplitGetValue (split); amount = xaccSplitGetValue (split);
print_info = gnc_account_print_info (account, reg->mismatched_commodities); print_info = gnc_account_print_info (account, reg->mismatched_commodities);
print_info.commodity = currency; print_info.commodity = commodity;
break; break;
} }
} }