GnuCash  2.6.16
Macros | Functions

API for Transactions and Splits (journal entries) More...

#include <time.h>
#include "gnc-commodity.h"
#include "gnc-engine.h"
#include "Split.h"

Go to the source code of this file.

Macros

#define GNC_TYPE_TRANSACTION   (gnc_transaction_get_type ())
 
#define GNC_TRANSACTION(o)   (G_TYPE_CHECK_INSTANCE_CAST ((o), GNC_TYPE_TRANSACTION, Transaction))
 
#define GNC_TRANSACTION_CLASS(k)   (G_TYPE_CHECK_CLASS_CAST((k), GNC_TYPE_TRANSACTION, TransactionClass))
 
#define GNC_IS_TRANSACTION(o)   (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNC_TYPE_TRANSACTION))
 
#define GNC_IS_TRANSACTION_CLASS(k)   (G_TYPE_CHECK_CLASS_TYPE ((k), GNC_TYPE_TRANSACTION))
 
#define GNC_TRANSACTION_GET_CLASS(o)   (G_TYPE_INSTANCE_GET_CLASS ((o), GNC_TYPE_TRANSACTION, TransactionClass))
 
#define GNC_IS_TRANS(obj)   GNC_IS_TRANSACTION(obj)
 
#define GNC_TRANS(obj)   GNC_TRANSACTION(obj)
 
#define RECONCILED_MATCH_TYPE   "reconciled-match"
 
#define xaccTransGetBook(X)   qof_instance_get_book (QOF_INSTANCE(X))
 
#define xaccTransGetGUID(X)   qof_entity_get_guid(QOF_INSTANCE(X))
 
#define xaccTransReturnGUID(X)   (X ? *(qof_entity_get_guid(QOF_INSTANCE(X))) : *(guid_null()))
 
#define xaccTransGetSlots(X)   qof_instance_get_slots (QOF_INSTANCE(X))
 
Transaction Type field values
#define TXN_TYPE_NONE   '\0'
 
#define TXN_TYPE_INVOICE   'I'
 
#define TXN_TYPE_PAYMENT   'P'
 
#define TXN_TYPE_LINK   'L'
 
Transaction Parameter names
#define TRANS_KVP   "kvp"
 
#define TRANS_NUM   "num"
 
#define TRANS_DESCRIPTION   "desc"
 
#define TRANS_DATE_ENTERED   "date-entered"
 
#define TRANS_DATE_POSTED   "date-posted"
 
#define TRANS_DATE_DUE   "date-due"
 
#define TRANS_IMBALANCE   "trans-imbalance"
 
#define TRANS_IS_BALANCED   "trans-balanced?"
 
#define TRANS_IS_CLOSING   "trans-is-closing?"
 
#define TRANS_NOTES   "notes"
 
#define TRANS_ASSOCIATION   "assoc"
 
#define TRANS_TYPE   "type"
 
#define TRANS_VOID_STATUS   "void-p"
 
#define TRANS_VOID_REASON   "void-reason"
 
#define TRANS_VOID_TIME   "void-time"
 
#define TRANS_SPLITLIST   "split-list" /* for guid_match_all */
 

Functions

GType gnc_transaction_get_type (void)
 
Transaction date setters/getters
void xaccTransSetDate (Transaction *trans, int day, int mon, int year)
 
void xaccTransSetDatePostedGDate (Transaction *trans, GDate date)
 
void xaccTransSetDatePostedSecs (Transaction *trans, time64 time)
 
void xaccTransSetDatePostedSecsNormalized (Transaction *trans, time64 time)
 
void xaccTransSetDatePostedTS (Transaction *trans, const Timespec *ts)
 
void xaccTransSetDateEnteredSecs (Transaction *trans, time64 time)
 
void xaccTransSetDateEnteredTS (Transaction *trans, const Timespec *ts)
 
void xaccTransSetDateDueTS (Transaction *trans, const Timespec *ts)
 
time64 xaccTransGetDate (const Transaction *trans)
 
void xaccTransGetDatePostedTS (const Transaction *trans, Timespec *ts)
 
Timespec xaccTransRetDatePostedTS (const Transaction *trans)
 
GDate xaccTransGetDatePostedGDate (const Transaction *trans)
 
time64 xaccTransGetDateEntered (const Transaction *trans)
 
void xaccTransGetDateEnteredTS (const Transaction *trans, Timespec *ts)
 
Timespec xaccTransRetDateEnteredTS (const Transaction *trans)
 
Timespec xaccTransRetDateDueTS (const Transaction *trans)
 
void xaccTransGetDateDueTS (const Transaction *trans, Timespec *ts)
 
Transaction voiding
void xaccTransVoid (Transaction *transaction, const char *reason)
 
void xaccTransUnvoid (Transaction *transaction)
 
Transaction * xaccTransReverse (Transaction *transaction)
 
Transaction * xaccTransGetReversedBy (const Transaction *trans)
 
gboolean xaccTransGetVoidStatus (const Transaction *transaction)
 
const char * xaccTransGetVoidReason (const Transaction *transaction)
 
Timespec xaccTransGetVoidTime (const Transaction *tr)
 

Transaction creation and editing

#define xaccTransLookupDirect(g, b)   xaccTransLookup(&(g),b)
 
Transaction * xaccMallocTransaction (QofBook *book)
 
void xaccTransDestroy (Transaction *trans)
 
Transaction * xaccTransClone (const Transaction *t)
 
gboolean xaccTransEqual (const Transaction *ta, const Transaction *tb, gboolean check_guids, gboolean check_splits, gboolean check_balances, gboolean assume_ordered)
 
void xaccTransBeginEdit (Transaction *trans)
 
void xaccTransCommitEdit (Transaction *trans)
 
void xaccTransRollbackEdit (Transaction *trans)
 
gboolean xaccTransIsOpen (const Transaction *trans)
 
Transaction * xaccTransLookup (const GncGUID *guid, QofBook *book)
 
Transaction * xaccTransCopyToClipBoard (const Transaction *from_trans)
 
void xaccTransCopyOnto (const Transaction *from_trans, Transaction *to_trans)
 
void xaccTransCopyFromClipBoard (const Transaction *from_trans, Transaction *to_trans, const Account *from_acc, Account *to_acc, gboolean no_date)
 
Split * xaccTransFindSplitByAccount (const Transaction *trans, const Account *acc)
 
void xaccTransScrubGains (Transaction *trans, Account *gain_acc)
 
guint gnc_book_count_transactions (QofBook *book)
 

Transaction general getters/setters

#define xaccTransAppendSplit(t, s)   xaccSplitSetParent((s), (t))
 
gboolean xaccTransUseTradingAccounts (const Transaction *trans)
 
void xaccTransSortSplits (Transaction *trans)
 
void xaccTransSetTxnType (Transaction *trans, char type)
 
char xaccTransGetTxnType (const Transaction *trans)
 
void xaccTransSetNum (Transaction *trans, const char *num)
 
void xaccTransSetDescription (Transaction *trans, const char *desc)
 
void xaccTransSetAssociation (Transaction *trans, const char *assoc)
 
void xaccTransSetNotes (Transaction *trans, const char *notes)
 
const char * xaccTransGetNum (const Transaction *trans)
 
const char * xaccTransGetDescription (const Transaction *trans)
 
const char * xaccTransGetAssociation (const Transaction *trans)
 
const char * xaccTransGetNotes (const Transaction *trans)
 
void xaccTransSetIsClosingTxn (Transaction *trans, gboolean is_closing)
 
gboolean xaccTransGetIsClosingTxn (const Transaction *trans)
 
Split * xaccTransGetSplit (const Transaction *trans, int i)
 
int xaccTransGetSplitIndex (const Transaction *trans, const Split *split)
 
SplitListxaccTransGetSplitList (const Transaction *trans)
 
gboolean xaccTransStillHasSplit (const Transaction *trans, const Split *s)
 
Split * xaccTransGetFirstPaymentAcctSplit (const Transaction *trans)
 
Split * xaccTransGetFirstAPARAcctSplit (const Transaction *trans)
 
void xaccTransSetReadOnly (Transaction *trans, const char *reason)
 
void xaccTransClearReadOnly (Transaction *trans)
 
const char * xaccTransGetReadOnly (const Transaction *trans)
 
gboolean xaccTransIsReadonlyByPostedDate (const Transaction *trans)
 
gboolean xaccTransInFutureByPostedDate (const Transaction *trans)
 
int xaccTransCountSplits (const Transaction *trans)
 
gboolean xaccTransHasReconciledSplits (const Transaction *trans)
 
gboolean xaccTransHasReconciledSplitsByAccount (const Transaction *trans, const Account *account)
 
gboolean xaccTransHasSplitsInState (const Transaction *trans, const char state)
 
gboolean xaccTransHasSplitsInStateByAccount (const Transaction *trans, const char state, const Account *account)
 
gnc_commodity * xaccTransGetCurrency (const Transaction *trans)
 
void xaccTransSetCurrency (Transaction *trans, gnc_commodity *curr)
 
gnc_numeric xaccTransGetImbalanceValue (const Transaction *trans)
 
MonetaryList * xaccTransGetImbalance (const Transaction *trans)
 
gboolean xaccTransIsBalanced (const Transaction *trans)
 
gnc_numeric xaccTransGetAccountValue (const Transaction *trans, const Account *account)
 
gnc_numeric xaccTransGetAccountAmount (const Transaction *trans, const Account *account)
 
gboolean xaccTransGetRateForCommodity (const Transaction *trans, const gnc_commodity *split_com, const Split *split_to_exclude, gnc_numeric *rate)
 
gnc_numeric xaccTransGetAccountConvRate (const Transaction *txn, const Account *acc)
 
gnc_numeric xaccTransGetAccountBalance (const Transaction *trans, const Account *account)
 
int xaccTransOrder (const Transaction *ta, const Transaction *tb)
 
int xaccTransOrder_num_action (const Transaction *ta, const char *actna, const Transaction *tb, const char *actnb)
 

Detailed Description

API for Transactions and Splits (journal entries)

Author
Copyright (C) 1997 Robin D. Clark
Copyright (C) 1997-2001 Linas Vepstas linas.nosp@m.@lin.nosp@m.as.or.nosp@m.g

Definition in file Transaction.h.