mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Balance ENTER with a LEAVE for all exit points.
For xaccLotFill and xaccLotScrubDoubleBalance, anyway.
This commit is contained in:
parent
3f8718ea3b
commit
dd10aab53a
@ -106,14 +106,28 @@ xaccLotFill (GNCLot *lot)
|
|||||||
ENTER ("(lot=%s, acc=%s)", gnc_lot_get_title(lot), xaccAccountGetName(acc));
|
ENTER ("(lot=%s, acc=%s)", gnc_lot_get_title(lot), xaccAccountGetName(acc));
|
||||||
|
|
||||||
/* If balance already zero, we have nothing to do. */
|
/* If balance already zero, we have nothing to do. */
|
||||||
if (gnc_lot_is_closed (lot)) return;
|
if (gnc_lot_is_closed (lot))
|
||||||
|
{
|
||||||
|
LEAVE ("Lot Closed (lot=%s, acc=%s)", gnc_lot_get_title(lot),
|
||||||
|
xaccAccountGetName(acc));
|
||||||
|
return;
|
||||||
|
}
|
||||||
split = pcy->PolicyGetSplit (pcy, lot);
|
split = pcy->PolicyGetSplit (pcy, lot);
|
||||||
if (!split) return; /* Handle the common case */
|
if (!split)
|
||||||
|
{
|
||||||
|
LEAVE ("No Split (lot=%s, acc=%s)", gnc_lot_get_title(lot),
|
||||||
|
xaccAccountGetName(acc));
|
||||||
|
return; /* Handle the common case */
|
||||||
|
}
|
||||||
|
|
||||||
/* Reject voided transactions */
|
/* Reject voided transactions */
|
||||||
if (gnc_numeric_zero_p(split->amount) &&
|
if (gnc_numeric_zero_p(split->amount) &&
|
||||||
xaccTransGetVoidStatus(split->parent)) return;
|
xaccTransGetVoidStatus(split->parent))
|
||||||
|
{
|
||||||
|
LEAVE ("Voided transaction (lot=%s, acc=%s)",
|
||||||
|
gnc_lot_get_title(lot), xaccAccountGetName(acc));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
xaccAccountBeginEdit (acc);
|
xaccAccountBeginEdit (acc);
|
||||||
|
|
||||||
@ -166,7 +180,11 @@ xaccLotScrubDoubleBalance (GNCLot *lot)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* We double-check only closed lots */
|
/* We double-check only closed lots */
|
||||||
if (FALSE == gnc_lot_is_closed (lot)) return;
|
if (FALSE == gnc_lot_is_closed (lot))
|
||||||
|
{
|
||||||
|
LEAVE ("lot=%s is closed", gnc_lot_get_title(lot));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
for (snode = gnc_lot_get_split_list(lot); snode; snode = snode->next)
|
for (snode = gnc_lot_get_split_list(lot); snode; snode = snode->next)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user