49#define GNC_TYPE_SPLIT (gnc_split_get_type ())
51 (G_TYPE_CHECK_INSTANCE_CAST ((o), GNC_TYPE_SPLIT, Split))
52#define GNC_SPLIT_CLASS(k) \
53 (G_TYPE_CHECK_CLASS_CAST((k), GNC_TYPE_SPLIT, SplitClass))
54#define GNC_IS_SPLIT(o) \
55 (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNC_TYPE_SPLIT))
56#define GNC_IS_SPLIT_CLASS(k) \
57 (G_TYPE_CHECK_CLASS_TYPE ((k), GNC_TYPE_SPLIT))
58#define GNC_SPLIT_GET_CLASS(o) \
59 (G_TYPE_INSTANCE_GET_CLASS ((o), GNC_TYPE_SPLIT, SplitClass))
60GType gnc_split_get_type(
void);
84gnc_numeric xaccSplitConvertAmount (
const Split *split,
const Account * account);
101void xaccSplitReinit(Split * split);
141void xaccSplitSetAccount (Split *s,
Account *acc);
145void xaccSplitSetParent (Split *split, Transaction *trans);
301 const gnc_commodity * base_currency);
310 const gnc_commodity * base_currency);
382 gboolean check_guids,
383 gboolean check_balances,
384 gboolean check_txn_splits);
390#define xaccSplitLookupDirect(g,b) xaccSplitLookup(&(g),b)
448gint xaccSplitOrderDateOnly (
const Split *sa,
const Split *sb);
499void xaccSplitDump (
const Split *split,
const char *tag);
555#define SPLIT_DATE_RECONCILED "date-reconciled"
556#define SPLIT_BALANCE "balance"
557#define SPLIT_CLEARED_BALANCE "cleared-balance"
558#define SPLIT_RECONCILED_BALANCE "reconciled-balance"
559#define SPLIT_MEMO "memo"
560#define SPLIT_ACTION "action"
561#define SPLIT_RECONCILE "reconcile-flag"
562#define SPLIT_AMOUNT "amount"
563#define SPLIT_SHARE_PRICE "share-price"
564#define SPLIT_VALUE "value"
565#define SPLIT_TYPE "type"
566#define SPLIT_VOIDED_AMOUNT "voided-amount"
567#define SPLIT_VOIDED_VALUE "voided-value"
568#define SPLIT_LOT "lot"
569#define SPLIT_TRANS "trans"
570#define SPLIT_ACCOUNT "account"
571#define SPLIT_ACCOUNT_GUID "account-guid"
573#define SPLIT_ACCT_FULLNAME "acct-fullname"
574#define SPLIT_CORR_ACCT_NAME "corr-acct-fullname"
575#define SPLIT_CORR_ACCT_CODE "corr-acct-code"
579#define xaccSplitGetGUID(X) qof_entity_get_guid(QOF_INSTANCE(X))
Commodity handling public routines.
All type declarations for the whole Gnucash engine.
gint64 time64
Most systems that are currently maintained, including Microsoft Windows, BSD-derived Unixes and Linux...
int xaccSplitCompareAccountCodes(const Split *sa, const Split *sb)
Compare two splits by code of account.
Transaction * xaccSplitGetParent(const Split *split)
Returns the parent transaction of the split.
void xaccSplitSetAdjustedAmount(Split *split, gnc_numeric amount)
Sets the stock split adjusted amount of a split.
void xaccSplitSetReconcile(Split *split, char reconciled_flag)
Set the reconcile flag.
gboolean xaccSplitDestroy(Split *split)
Destructor.
char xaccSplitGetReconcile(const Split *split)
Returns the value of the reconcile flag.
gnc_numeric xaccSplitGetClearedBalance(const Split *split)
The cleared-balance is the currency-denominated balance of all transactions that have been marked as ...
void xaccSplitSetMemo(Split *split, const char *memo)
The memo is an arbitrary string associated with a split.
int xaccSplitCompareOtherAccountFullNames(const Split *sa, const Split *sb)
Compare two splits by full name of the other account.
void xaccSplitSetSharePrice(Split *split, gnc_numeric price)
gint xaccSplitOrder(const Split *sa, const Split *sb)
The xaccSplitOrder(sa,sb) method is useful for sorting.
void xaccSplitMergePeerSplits(Split *split, const Split *other_split)
Merge the other_split's peer splits into split's peers.
Split * xaccSplitLookup(const GncGUID *guid, QofBook *book)
The xaccSplitLookup() subroutine will return the split associated with the given id,...
void xaccSplitSetValue(Split *split, gnc_numeric value)
The xaccSplitSetValue() method sets the value of this split in the transaction's commodity.
const char * xaccSplitGetCorrAccountName(const Split *sa)
document me
void xaccSplitRemovePeerSplit(Split *split, const Split *other_split)
Remove a peer split from this split's lot-split list.
Split * xaccMallocSplit(QofBook *book)
Constructor.
gnc_numeric xaccSplitGetNoclosingBalance(const Split *split)
The noclosing-balance is the currency-denominated balance of all transactions except 'closing' transa...
void xaccSplitSetAmount(Split *split, gnc_numeric amount)
The xaccSplitSetAmount() method sets the amount in the account's commodity that the split should have...
const char * xaccSplitGetAction(const Split *split)
Returns the action string.
const char * xaccSplitGetType(Split *s)
Returns the split type, which is either the string "normal", or "stock-split" for a split from a stoc...
GNCLot * xaccSplitGetLot(const Split *split)
Returns the pointer to the debited/credited Lot where this split belongs to, or NULL if it doesn't be...
char * xaccSplitGetCorrAccountFullName(const Split *sa)
These functions take a split, get the corresponding split on the "other side" of the transaction,...
time64 xaccSplitGetDateReconciled(const Split *split)
Retrieve the date when the Split was reconciled.
gnc_numeric xaccSplitVoidFormerValue(const Split *split)
Returns the original pre-void value of a split.
gnc_numeric xaccSplitGetValue(const Split *split)
Returns the value of this split in the transaction's commodity.
void xaccSplitSetLot(Split *split, GNCLot *lot)
Assigns the split to a specific Lot.
gnc_numeric xaccSplitGetSharePrice(const Split *split)
Returns the price of the split, that is, the value divided by the amount.
const char * xaccSplitGetCorrAccountCode(const Split *sa)
document me
int xaccSplitCompareAccountFullNames(const Split *sa, const Split *sb)
Compare two splits by full name of account.
gnc_numeric xaccSplitGetReconciledBalance(const Split *split)
Returns the reconciled-balance of this split.
gboolean xaccSplitEqual(const Split *sa, const Split *sb, gboolean check_guids, gboolean check_balances, gboolean check_txn_splits)
Equality.
gboolean xaccSplitHasPeers(const Split *split)
Does this split have peers?
Account * xaccSplitGetAccount(const Split *split)
Returns the account of this split, which was set through xaccAccountInsertSplit().
int xaccSplitCompareOtherAccountCodes(const Split *sa, const Split *sb)
Compare two splits by code of the other account.
void xaccSplitCopyOnto(const Split *from_split, Split *to_split)
This is really a helper for xaccTransCopyOnto.
void xaccSplitSetSharePriceAndAmount(Split *split, gnc_numeric price, gnc_numeric amount)
The xaccSplitSetSharePriceAndAmount() method will simultaneously update the share price and the numbe...
const char * xaccSplitGetMemo(const Split *split)
Returns the memo string.
void xaccSplitSetDateReconciledSecs(Split *split, time64 time)
Set the date on which this split was reconciled by specifying the time as time64.
gnc_numeric xaccSplitVoidFormerAmount(const Split *split)
Returns the original pre-void amount of a split.
void xaccSplitSetOnlineID(Split *split, const char *id)
The online_id is the OFX/HBCI "FITID" recorded on a split when it is imported.
void xaccSplitSetBaseValue(Split *split, gnc_numeric value, const gnc_commodity *base_currency)
Depending on the base_currency, set either the value or the amount of this split or both: If the base...
gnc_numeric xaccSplitGetBaseValue(const Split *split, const gnc_commodity *base_currency)
Depending on the base_currency, return either the value or the amount of this split: If the base_curr...
const char * xaccSplitGetOnlineID(const Split *split)
Returns the split's online_id.
Split * xaccSplitGetOtherSplit(const Split *split)
The xaccSplitGetOtherSplit() is a convenience routine that returns the other of a pair of splits.
QofBook * xaccSplitGetBook(const Split *split)
Returns the book of this split, i.e.
gnc_numeric xaccSplitGetAdjustedAmount(const Split *split)
Returns the stock-split adjusted amount of the split in the account's commodity.
void xaccSplitAddPeerSplit(Split *split, const Split *other_split, const time64 timestamp)
Add a peer split to this split's lot-split list.
gnc_numeric xaccSplitGetBalance(const Split *split)
Returns the running balance up to and including the indicated split.
gboolean xaccSplitIsPeerSplit(const Split *split, const Split *other_split)
Report if a split is a peer of this one.
void xaccSplitSetAction(Split *split, const char *action)
The Action is an arbitrary user-assigned string.
gboolean xaccSplitIsStockSplit(Split *s)
Returns true if the split is of type stock split.
gnc_numeric xaccSplitGetAmount(const Split *split)
Returns the amount of the split in the account's commodity.
void xaccSplitMakeStockSplit(Split *s)
Mark a split to be of type stock split - after this, you shouldn't modify the value anymore,...
gboolean xaccSplitHasOnlineID(const Split *split)
Returns TRUE if the split has a non-empty online_id.
The type used to store guids in C.