move xaccTransScrubSplits to Scrub.c

it's defined in Scrub.h anyway
This commit is contained in:
Christopher Lam 2023-06-01 20:25:36 +08:00
parent d214b2f05d
commit 872e20c555
2 changed files with 22 additions and 17 deletions

View File

@ -331,6 +331,28 @@ xaccSplitScrub (Split *split)
/* ================================================================ */
void
xaccTransScrubSplits (Transaction *trans)
{
if (!trans) return;
gnc_commodity *currency = xaccTransGetCurrency (trans);
if (!currency)
PERR ("Transaction doesn't have a currency!");
xaccTransBeginEdit(trans);
/* The split scrub expects the transaction to have a currency! */
for (GList *n = xaccTransGetSplitList (trans); n; n = g_list_next (n))
xaccSplitScrub (n->data);
xaccTransCommitEdit(trans);
}
/* ================================================================ */
void
xaccAccountTreeScrubImbalance (Account *acc, QofPercentageFunc percentagefunc)
{

View File

@ -2868,23 +2868,6 @@ xaccTransGetReversedBy(const Transaction *trans)
return retval;
}
void
xaccTransScrubSplits (Transaction *trans)
{
gnc_commodity *currency;
if (!trans) return;
xaccTransBeginEdit(trans);
/* The split scrub expects the transaction to have a currency! */
currency = xaccTransGetCurrency (trans);
if (!currency)
PERR ("Transaction doesn't have a currency!");
FOR_EACH_SPLIT(trans, xaccSplitScrub(s));
xaccTransCommitEdit(trans);
}
/* ============================================================== */
/** The xaccTransScrubGainsDate() routine is used to keep the posted date
* of gains splits in sync with the posted date of the transaction