41 #include "TransactionP.h"
69 for (node = splits; node; node = node->next)
71 Split * split = node->data;
74 if (split->lot)
continue;
115 split = pcy->PolicyGetSplit (pcy, lot);
127 LEAVE (
"Voided transaction (lot=%s, acc=%s)",
141 if (subsplit == split)
143 PERR (
"Accounting Policy gave us a split that "
144 "doesn't fit into this lot\n"
145 "lot baln=%s, isclosed=%d, aplit amt=%s",
154 split = pcy->PolicyGetSplit (pcy, lot);
178 Split *s = snode->data;
191 Split *s = snode->data;
195 if (NULL == currency)
197 currency = trans->common_currency;
203 PWARN (
"Lot with multiple currencies:\n"
212 PINFO (
"Split=%p value=%s Accum Lot value=%s", s,
226 PERR (
"Closed lot fails to double-balance !! lot value=%s",
230 Split *s = node->data;
231 PERR (
"s=%p amt=%s val=%s", s,
242 static inline gboolean
243 is_subsplit (
Split *split)
248 if (!split)
return FALSE;
249 g_return_val_if_fail (split->parent, FALSE);
252 kval = kvp_frame_get_slot (split->inst.kvp_data,
"lot-split");
253 if (!kval)
return FALSE;
293 sb->inst.kvp_data,
"lot-split");
314 remove_guids (sa, sb);
330 if ((sb->gains_split) &&
331 (sb->gains_split->gains & GAINS_STATUS_GAINS))
355 if (strict && (FALSE == is_subsplit (split)))
return FALSE;
362 for (node = txn->splits; node; node = node->next)
364 Split *s = node->data;
366 if (s == split)
continue;
381 "peer_guid", guid) == NULL)
385 merge_splits (split, s);
391 PWARN (
"Result of merge has zero amt!");
393 LEAVE (
" splits merged=%d", rc);
403 if (!lot)
return FALSE;
409 Split *s = node->data;
415 LEAVE (
" splits merged=%d", rc);
void xaccSplitSetValue(Split *s, gnc_numeric amt)
gboolean gnc_numeric_equal(gnc_numeric a, gnc_numeric b)
gboolean xaccScrubMergeLotSubSplits(GNCLot *lot, gboolean strict)
gchar * gnc_num_dbg_to_string(gnc_numeric n)
const GncGUID * qof_instance_get_guid(gconstpointer)
void xaccLotFill(GNCLot *lot)
SplitList * xaccAccountGetSplitList(const Account *acc)
#define PINFO(format, args...)
gboolean xaccSplitDestroy(Split *split)
Utilities to Convert Stock Accounts to use Lots.
gboolean qof_instance_get_destroying(gconstpointer ptr)
void xaccSplitComputeCapGains(Split *split, Account *gain_acc)
gnc_numeric gnc_numeric_add(gnc_numeric a, gnc_numeric b, gint64 denom, gint how)
void xaccAccountAssignLots(Account *acc)
gboolean gnc_numeric_zero_p(gnc_numeric a)
void xaccSplitSetReconcile(Split *split, char recn)
#define PERR(format, args...)
#define ENTER(format, args...)
void kvp_frame_delete(KvpFrame *frame)
void gnc_kvp_bag_merge(KvpFrame *kvp_into, const char *intopath, KvpFrame *kvp_from, const char *frompath)
const char * gnc_lot_get_title(const GNCLot *lot)
void xaccTransDestroy(Transaction *trans)
#define PWARN(format, args...)
void xaccSplitSetAmount(Split *s, gnc_numeric amt)
Account handling public routines.
Implement Accounting Policy Private header File.
SplitList * gnc_lot_get_split_list(const GNCLot *lot)
void xaccLotScrubDoubleBalance(GNCLot *lot)
const char * xaccTransGetDescription(const Transaction *trans)
const char * gnc_commodity_get_fullname(const gnc_commodity *cm)
gboolean xaccScrubMergeSubSplits(Split *split, gboolean strict)
void xaccTransCommitEdit(Transaction *trans)
void xaccTransBeginEdit(Transaction *trans)
All type declarations for the whole Gnucash engine.
KvpFrame * gnc_kvp_bag_find_by_guid(KvpFrame *root, const char *path, const char *guid_name, const GncGUID *desired_guid)
Split * xaccSplitAssignToLot(Split *split, GNCLot *lot)
gboolean xaccTransGetVoidStatus(const Transaction *trans)
gboolean xaccSplitAssign(Split *split)
gboolean gnc_lot_is_closed(GNCLot *lot)
void gnc_kvp_bag_remove_frame(KvpFrame *root, const char *path, KvpFrame *fr)
gnc_numeric xaccSplitGetValue(const Split *split)
void xaccAccountBeginEdit(Account *acc)
Account * xaccSplitGetAccount(const Split *s)
struct KvpFrameImpl KvpFrame
#define LEAVE(format, args...)
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.
struct KvpValueImpl KvpValue
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)
GNCLot * xaccSplitGetLot(const Split *split)
const gchar * QofLogModule
gnc_numeric xaccSplitGetAmount(const Split *split)