46 #include "TransactionP.h"
58 static inline gboolean
59 gains_possible (
GNCLot *lot)
70 if (!node)
return FALSE;
75 return (FALSE == comeq);
87 gboolean splits_deleted = FALSE;
89 gboolean opening_baln_is_pos, lot_baln_is_pos;
93 if (!lot)
return FALSE;
111 pcy->PolicyGetLotOpening (pcy, lot, &opening_baln, NULL, NULL);
118 if ((opening_baln_is_pos || lot_baln_is_pos) &&
119 ((!opening_baln_is_pos) || (!lot_baln_is_pos)))
124 Split *s = node->data;
125 if (pcy->PolicyIsOpeningSplit (pcy, lot, s))
continue;
126 gnc_lot_remove_split (lot, s);
145 if (gains_possible (lot))
147 xaccLotComputeCapGains (lot, NULL);
153 return splits_deleted;
170 for (node = lots; node; node = node->next)
183 lot_scrub_cb (
Account *acc, gpointer data)
190 xaccAccountTreeScrubLots (
Account *acc)
High-Level API for imposing Lot constraints.
gboolean xaccScrubMergeLotSubSplits(GNCLot *lot, gboolean strict)
gchar * gnc_num_dbg_to_string(gnc_numeric n)
void xaccLotFill(GNCLot *lot)
void gnc_account_foreach_descendant(const Account *acc, AccountCb thunk, gpointer user_data)
#define PINFO(format, args...)
Utilities to Convert Stock Accounts to use Lots.
gboolean xaccAccountHasTrades(const Account *acc)
void xaccAccountAssignLots(Account *acc)
gboolean gnc_numeric_zero_p(gnc_numeric a)
void xaccAccountScrubLots(Account *acc)
#define ENTER(format, args...)
const char * gnc_lot_get_title(const GNCLot *lot)
Account handling public routines.
Implement Accounting Policy Private header File.
SplitList * gnc_lot_get_split_list(const GNCLot *lot)
void xaccLotScrubDoubleBalance(GNCLot *lot)
LotList * xaccAccountGetLotList(const Account *acc)
All type declarations for the whole Gnucash engine.
gboolean gnc_numeric_positive_p(gnc_numeric a)
void xaccAccountBeginEdit(Account *acc)
gnc_commodity * xaccAccountGetCommodity(const Account *acc)
#define LEAVE(format, args...)
gboolean xaccScrubLot(GNCLot *lot)
Account * gnc_lot_get_account(const GNCLot *lot)
const char * xaccAccountGetName(const Account *acc)
API for Transactions and Splits (journal entries)
void xaccAccountCommitEdit(Account *acc)
Utilities to Automatically Compute Capital Gains/Losses.
Commodity handling public routines.
GNCPolicy * gnc_account_get_policy(Account *acc)
gboolean gnc_commodity_equiv(const gnc_commodity *a, const gnc_commodity *b)
gnc_numeric gnc_lot_get_balance(GNCLot *lot)
const gchar * QofLogModule