add a few utility routines

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@8173 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Linas Vepstas 2003-04-02 05:09:39 +00:00
parent e5d7cd62ee
commit 9184bf7a1c
2 changed files with 24 additions and 0 deletions

View File

@ -366,7 +366,29 @@ lot_scrub_cb (Account *acc, gpointer data)
void
xaccGroupScrubLotsBalance (AccountGroup *grp)
{
if (!grp) return;
xaccGroupForEachAccount (grp, lot_scrub_cb, NULL, TRUE);
}
void
xaccAccountScrubLotsBalance (Account *acc)
{
if (!acc) return;
if (FALSE == xaccAccountHasTrades (acc)) return;
xaccAccountScrubLots (acc);
xaccAccountScrubDoubleBalance (acc);
}
void
xaccAccountTreeScrubLotsBalance (Account *acc)
{
if (!acc) return;
xaccGroupScrubLotsBalance (acc->children);
if (FALSE == xaccAccountHasTrades (acc)) return;
xaccAccountScrubLots (acc);
xaccAccountScrubDoubleBalance (acc);
}
/* =========================== END OF FILE ======================= */

View File

@ -90,6 +90,8 @@ void xaccAccountScrubDoubleBalance (Account *acc);
* that are trading accounts.
*/
void xaccGroupScrubLotsBalance (AccountGroup *grp);
void xaccAccountScrubLotsBalance (Account *acc);
void xaccAccountTreeScrubLotsBalance (Account *acc);
#endif /* XACC_SCRUB2_H */
/** @} */