mirror of
https://github.com/Gnucash/gnucash.git
synced 2024-11-23 01:16:43 -06:00
Use the correct fraction when editing expanded multiple currency transactions.
When a transaction is expanded and trading accounts are in use, the debit and credit cells contain values in the split's commodity not the transaction's currency. For example if you have a transaction involving JPY and USD currencies and the transaction's currency is JPY, you can only enter whole dollar amounts in the USD splits. This fixes this problem. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@22673 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
40fd5ccd5c
commit
ba9b85a260
@ -345,7 +345,19 @@ gnc_split_register_set_cell_fractions (SplitRegister *reg, Split *split)
|
||||
int fraction;
|
||||
|
||||
trans = xaccSplitGetParent (split);
|
||||
currency = xaccTransGetCurrency (trans);
|
||||
if (gnc_split_register_current_trans_expanded (reg) &&
|
||||
xaccTransUseTradingAccounts (trans))
|
||||
{
|
||||
/* If the transaction is expanded and using trading accounts then
|
||||
* the debit and credit fields are in the split's commodity not
|
||||
* the transaction's currency
|
||||
*/
|
||||
currency = xaccAccountGetCommodity (xaccSplitGetAccount (split));
|
||||
}
|
||||
else
|
||||
{
|
||||
currency = xaccTransGetCurrency (trans);
|
||||
}
|
||||
if (!currency)
|
||||
currency = gnc_default_currency ();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user