mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
bug fix to routine that is currently only used by the sql backend.
p.s. in case you're wondering where I find the time, I've been having to babysit the last few days, and can sneak in and do some work during naps. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4520 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
@@ -1319,15 +1319,16 @@ xaccTransSetCurrency (Transaction *trans, gnc_commodity *curr)
|
||||
*/
|
||||
for (node = trans->splits; node; node = node->next)
|
||||
{
|
||||
Split *s = node->data;
|
||||
const gnc_commodity *currency;
|
||||
const gnc_commodity *security;
|
||||
Split *s = node->data;
|
||||
Account *acct = xaccSplitGetAccount(s);
|
||||
|
||||
currency = xaccAccountGetCurrency (xaccSplitGetAccount(s));
|
||||
security = xaccAccountGetSecurity (xaccSplitGetAccount(s));
|
||||
if (!currency && security)
|
||||
currency = xaccAccountGetCurrency (acct);
|
||||
security = xaccAccountGetSecurity (acct);
|
||||
if (!currency && security && (FALSE == gnc_commodity_equiv(curr, security)))
|
||||
{
|
||||
xaccAccountSetCurrency (xaccSplitGetAccount(s), curr);
|
||||
xaccAccountSetCurrency (acct, curr);
|
||||
}
|
||||
}
|
||||
kimono = xaccTransFindCommonCurrency (trans);
|
||||
|
||||
Reference in New Issue
Block a user