86 #ifndef XACC_TRANSACTION_H
87 #define XACC_TRANSACTION_H
98 #define GNC_TYPE_TRANSACTION (gnc_transaction_get_type ())
99 #define GNC_TRANSACTION(o) \
100 (G_TYPE_CHECK_INSTANCE_CAST ((o), GNC_TYPE_TRANSACTION, Transaction))
101 #define GNC_TRANSACTION_CLASS(k) \
102 (G_TYPE_CHECK_CLASS_CAST((k), GNC_TYPE_TRANSACTION, TransactionClass))
103 #define GNC_IS_TRANSACTION(o) \
104 (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNC_TYPE_TRANSACTION))
105 #define GNC_IS_TRANSACTION_CLASS(k) \
106 (G_TYPE_CHECK_CLASS_TYPE ((k), GNC_TYPE_TRANSACTION))
107 #define GNC_TRANSACTION_GET_CLASS(o) \
108 (G_TYPE_INSTANCE_GET_CLASS ((o), GNC_TYPE_TRANSACTION, TransactionClass))
109 GType gnc_transaction_get_type(
void);
113 #define GNC_IS_TRANS(obj) GNC_IS_TRANSACTION(obj)
114 #define GNC_TRANS(obj) GNC_TRANSACTION(obj)
119 #define TXN_TYPE_NONE '\0'
120 #define TXN_TYPE_INVOICE 'I'
121 #define TXN_TYPE_PAYMENT 'P'
122 #define TXN_TYPE_LINK 'L'
190 gboolean check_guids,
191 gboolean check_splits,
192 gboolean check_balances,
193 gboolean assume_ordered);
227 #define xaccTransLookupDirect(g,b) xaccTransLookup(&(g),b)
357 #define xaccTransAppendSplit(t, s) xaccSplitSetParent((s), (t))
479 xaccTransGetRateForCommodity(
const Transaction *trans,
558 int day,
int mon,
int year);
728 #define TRANS_KVP "kvp"
729 #define TRANS_NUM "num"
730 #define TRANS_DESCRIPTION "desc"
731 #define TRANS_DATE_ENTERED "date-entered"
732 #define TRANS_DATE_POSTED "date-posted"
733 #define TRANS_DATE_DUE "date-due"
734 #define TRANS_IMBALANCE "trans-imbalance"
735 #define TRANS_IS_BALANCED "trans-balanced?"
736 #define TRANS_IS_CLOSING "trans-is-closing?"
737 #define TRANS_NOTES "notes"
738 #define TRANS_ASSOCIATION "assoc"
739 #define TRANS_TYPE "type"
740 #define TRANS_VOID_STATUS "void-p"
741 #define TRANS_VOID_REASON "void-reason"
742 #define TRANS_VOID_TIME "void-time"
743 #define TRANS_SPLITLIST "split-list"
746 #ifdef DUMP_FUNCTIONS
747 void xaccTransDump (
const Transaction *trans,
const char *tag);
750 #define RECONCILED_MATCH_TYPE "reconciled-match"
753 #define xaccTransGetBook(X) qof_instance_get_book (QOF_INSTANCE(X))
755 #define xaccTransGetGUID(X) qof_entity_get_guid(QOF_INSTANCE(X))
757 #define xaccTransReturnGUID(X) (X ? *(qof_entity_get_guid(QOF_INSTANCE(X))) : *(guid_null()))
gboolean xaccTransHasReconciledSplits(const Transaction *trans)
Transaction * xaccMallocTransaction(QofBook *book)
void xaccTransSetDatePostedSecsNormalized(Transaction *trans, time64 time)
char xaccTransGetTxnType(const Transaction *trans)
void xaccTransGetDateDueTS(const Transaction *trans, Timespec *ts)
gboolean xaccTransHasSplitsInStateByAccount(const Transaction *trans, const char state, const Account *account)
Split * xaccTransGetSplit(const Transaction *trans, int i)
time64 xaccTransGetDate(const Transaction *trans)
gboolean xaccTransUseTradingAccounts(const Transaction *trans)
gboolean xaccTransIsReadonlyByPostedDate(const Transaction *trans)
gboolean xaccTransIsOpen(const Transaction *trans)
gnc_numeric xaccTransGetAccountBalance(const Transaction *trans, const Account *account)
const char * xaccTransGetAssociation(const Transaction *trans)
void xaccTransSetNotes(Transaction *trans, const char *notes)
const char * xaccTransGetVoidReason(const Transaction *transaction)
void xaccTransGetDateEnteredTS(const Transaction *trans, Timespec *ts)
void xaccTransSetDescription(Transaction *trans, const char *desc)
void xaccTransSetNum(Transaction *trans, const char *num)
Use a 64-bit unsigned int timespec.
void xaccTransCopyOnto(const Transaction *from_trans, Transaction *to_trans)
API for Transactions and Splits (journal entries)
gboolean xaccTransIsBalanced(const Transaction *trans)
const char * xaccTransGetNum(const Transaction *trans)
int xaccTransOrder_num_action(const Transaction *ta, const char *actna, const Transaction *tb, const char *actnb)
void xaccTransSetDatePostedGDate(Transaction *trans, GDate date)
void xaccTransSetDateEnteredTS(Transaction *trans, const Timespec *ts)
gboolean xaccTransHasReconciledSplitsByAccount(const Transaction *trans, const Account *account)
void xaccTransSetCurrency(Transaction *trans, gnc_commodity *curr)
void xaccTransDestroy(Transaction *trans)
const char * xaccTransGetNotes(const Transaction *trans)
Transaction * xaccTransLookup(const GncGUID *guid, QofBook *book)
void xaccTransSetIsClosingTxn(Transaction *trans, gboolean is_closing)
int xaccTransCountSplits(const Transaction *trans)
void xaccTransSetTxnType(Transaction *trans, char type)
gboolean xaccTransHasSplitsInState(const Transaction *trans, const char state)
void xaccTransSetAssociation(Transaction *trans, const char *assoc)
gboolean xaccTransEqual(const Transaction *ta, const Transaction *tb, gboolean check_guids, gboolean check_splits, gboolean check_balances, gboolean assume_ordered)
gnc_numeric xaccTransGetImbalanceValue(const Transaction *trans)
void xaccTransSetReadOnly(Transaction *trans, const char *reason)
void xaccTransVoid(Transaction *transaction, const char *reason)
Transaction * xaccTransClone(const Transaction *t)
Timespec xaccTransRetDateEnteredTS(const Transaction *trans)
void xaccTransCopyFromClipBoard(const Transaction *from_trans, Transaction *to_trans, const Account *from_acc, Account *to_acc, gboolean no_date)
void xaccTransScrubGains(Transaction *trans, Account *gain_acc)
Transaction * xaccTransCloneNoKvp(const Transaction *t)
gboolean xaccTransInFutureByPostedDate(const Transaction *trans)
Timespec xaccTransRetDateDueTS(const Transaction *trans)
const char * xaccTransGetDescription(const Transaction *trans)
void xaccTransSetDate(Transaction *trans, int day, int mon, int year)
void xaccTransCommitEdit(Transaction *trans)
void xaccTransBeginEdit(Transaction *trans)
const char * xaccTransGetReadOnly(const Transaction *trans)
int xaccTransGetSplitIndex(const Transaction *trans, const Split *split)
void xaccTransUnvoid(Transaction *transaction)
All type declarations for the whole Gnucash engine.
time64 xaccTransGetDateEntered(const Transaction *trans)
Transaction * xaccTransReverse(Transaction *transaction)
guint gnc_book_count_transactions(QofBook *book)
void xaccTransSetDatePostedSecs(Transaction *trans, time64 time)
gboolean xaccTransGetVoidStatus(const Transaction *transaction)
Timespec xaccTransGetVoidTime(const Transaction *tr)
gboolean xaccTransGetIsClosingTxn(const Transaction *trans)
gnc_commodity * xaccTransGetCurrency(const Transaction *trans)
MonetaryList * xaccTransGetImbalance(const Transaction *trans)
void xaccTransSetDateDueTS(Transaction *trans, const Timespec *ts)
Transaction * xaccTransGetReversedBy(const Transaction *trans)
Timespec xaccTransRetDatePostedTS(const Transaction *trans)
int xaccTransOrder(const Transaction *ta, const Transaction *tb)
void xaccTransSetDateEnteredSecs(Transaction *trans, time64 time)
void xaccTransSortSplits(Transaction *trans)
GDate xaccTransGetDatePostedGDate(const Transaction *trans)
SplitList * xaccTransGetSplitList(const Transaction *trans)
Commodity handling public routines.
void xaccTransRollbackEdit(Transaction *trans)
Transaction * xaccTransCopyToClipBoard(const Transaction *from_trans)
void xaccTransGetDatePostedTS(const Transaction *trans, Timespec *ts)
gnc_numeric xaccTransGetAccountAmount(const Transaction *trans, const Account *account)
gnc_numeric xaccTransGetAccountValue(const Transaction *trans, const Account *account)
void xaccTransSetDatePostedTS(Transaction *trans, const Timespec *ts)