mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Bug 632588 - Scrub doesn't fix missing currency
So assign the currency from the first split (that belongs to an account.) git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@23522 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
16eaec05b2
commit
4a82768e18
@ -1018,7 +1018,7 @@ xaccTransScrubCurrency (Transaction *trans)
|
|||||||
SplitList *node;
|
SplitList *node;
|
||||||
char guid_str[GUID_ENCODING_LENGTH + 1];
|
char guid_str[GUID_ENCODING_LENGTH + 1];
|
||||||
guid_to_string_buff(xaccTransGetGUID(trans), guid_str);
|
guid_to_string_buff(xaccTransGetGUID(trans), guid_str);
|
||||||
PWARN ("no common transaction currency found for trans=\"%s\" (%s)",
|
PWARN ("no common transaction currency found for trans=\"%s\" (%s);",
|
||||||
trans->description, guid_str);
|
trans->description, guid_str);
|
||||||
|
|
||||||
for (node = trans->splits; node; node = node->next)
|
for (node = trans->splits; node; node = node->next)
|
||||||
@ -1030,9 +1030,15 @@ xaccTransScrubCurrency (Transaction *trans)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
PWARN (" split=\"%s\" account=\"%s\" commodity=\"%s\"",
|
gnc_commodity *currency = xaccAccountGetCommodity(split->acc);
|
||||||
|
PWARN ("setting to split=\"%s\" account=\"%s\" commodity=\"%s\"",
|
||||||
split->memo, xaccAccountGetName(split->acc),
|
split->memo, xaccAccountGetName(split->acc),
|
||||||
gnc_commodity_get_mnemonic(xaccAccountGetCommodity(split->acc)));
|
gnc_commodity_get_mnemonic(currency));
|
||||||
|
|
||||||
|
xaccTransBeginEdit (trans);
|
||||||
|
xaccTransSetCurrency (trans, currency);
|
||||||
|
xaccTransCommitEdit (trans);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user