mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
rename transaction method names
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@487 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
87e4ad928f
commit
c9e8127c2b
@ -671,8 +671,7 @@ createCB( Widget mw, XtPointer cd, XtPointer cb )
|
||||
}
|
||||
|
||||
/* Add an opening balance transaction (as the first transaction) */
|
||||
trans = mallocTransaction();
|
||||
initTransaction(trans);
|
||||
trans = xaccMallocTransaction();
|
||||
|
||||
todaysDate( &(trans->date) );
|
||||
xaccTransSetDescription (trans, OPEN_BALN_STR);
|
||||
|
@ -123,7 +123,7 @@ freeAccount( Account *acc )
|
||||
}
|
||||
|
||||
if ( (!dont_free_transaction) && (NULL == trans->credit_split.acc) ) {
|
||||
freeTransaction( trans );
|
||||
xaccFreeTransaction( trans );
|
||||
}
|
||||
|
||||
i++;
|
||||
@ -531,11 +531,11 @@ xaccConsolidateTransactions (Account * acc)
|
||||
if (0 == DEQ(sa->share_price, sb->share_price)) continue;
|
||||
if (strcmp (sa->memo, sb->memo)) continue;
|
||||
|
||||
#ifdef STIL_BROKEN
|
||||
#ifdef STILL_BROKEN
|
||||
/* hack alert -- still broken from splits */
|
||||
/* Free the transaction, and shuffle down by one.
|
||||
* Need to shuffle in order to preserve date ordering. */
|
||||
freeTransaction (tb);
|
||||
xaccFreeTransaction (tb);
|
||||
|
||||
for (k=j+1; k<acc->numTrans; k++) {
|
||||
acc->transaction[k-1] = acc->transaction[k];
|
||||
|
@ -297,7 +297,7 @@ adjBOkCB( Widget mw, XtPointer cd, XtPointer cb )
|
||||
acc->parent->saved = False;
|
||||
|
||||
/* allocate mem for the new transaction */
|
||||
trans = mallocTransaction();
|
||||
trans = xaccMallocTransaction();
|
||||
|
||||
/* Create the "trans" transaction */
|
||||
str = XmTextGetString(adjBData->date);
|
||||
|
28
src/FileIO.c
28
src/FileIO.c
@ -496,7 +496,7 @@ readTransaction( int fd, Account *acc, int token )
|
||||
double share_price = 0.0;
|
||||
|
||||
/* create a transaction structure */
|
||||
trans = mallocTransaction();
|
||||
trans = xaccMallocTransaction();
|
||||
|
||||
ENTER ("readTransaction");
|
||||
|
||||
@ -504,7 +504,7 @@ readTransaction( int fd, Account *acc, int token )
|
||||
if( trans->num == NULL )
|
||||
{
|
||||
PERR ("Premature end of Transaction at num");
|
||||
freeTransaction(trans);
|
||||
xaccFreeTransaction(trans);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -512,7 +512,7 @@ readTransaction( int fd, Account *acc, int token )
|
||||
if( date == NULL )
|
||||
{
|
||||
PERR ("Premature end of Transaction at date");
|
||||
freeTransaction(trans);
|
||||
xaccFreeTransaction(trans);
|
||||
return NULL;
|
||||
}
|
||||
trans->date = *date;
|
||||
@ -522,7 +522,7 @@ readTransaction( int fd, Account *acc, int token )
|
||||
if( trans->description == NULL )
|
||||
{
|
||||
PERR ("Premature end of Transaction at description");
|
||||
freeTransaction(trans);
|
||||
xaccFreeTransaction(trans);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -535,7 +535,7 @@ readTransaction( int fd, Account *acc, int token )
|
||||
if( NULL == tmp )
|
||||
{
|
||||
PERR ("Premature end of Transaction at memo");
|
||||
freeTransaction(trans);
|
||||
xaccFreeTransaction(trans);
|
||||
return NULL;
|
||||
}
|
||||
xaccTransSetMemo (trans, tmp);
|
||||
@ -547,7 +547,7 @@ readTransaction( int fd, Account *acc, int token )
|
||||
if( tmp == NULL )
|
||||
{
|
||||
PERR ("Premature end of Transaction at action");
|
||||
freeTransaction(trans);
|
||||
xaccFreeTransaction(trans);
|
||||
return NULL;
|
||||
}
|
||||
xaccTransSetAction (trans, tmp);
|
||||
@ -558,7 +558,7 @@ readTransaction( int fd, Account *acc, int token )
|
||||
if( err != sizeof(int) )
|
||||
{
|
||||
PERR ("Premature end of Transaction at catagory");
|
||||
freeTransaction(trans);
|
||||
xaccFreeTransaction(trans);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -566,7 +566,7 @@ readTransaction( int fd, Account *acc, int token )
|
||||
if( err != sizeof(char) )
|
||||
{
|
||||
PERR ("Premature end of Transaction at reconciled");
|
||||
freeTransaction(trans);
|
||||
xaccFreeTransaction(trans);
|
||||
return NULL;
|
||||
}
|
||||
xaccTransSetReconcile (trans, recn);
|
||||
@ -602,7 +602,7 @@ readTransaction( int fd, Account *acc, int token )
|
||||
if( err != sizeof(int) )
|
||||
{
|
||||
PERR ("Premature end of Transaction at V1 amount");
|
||||
freeTransaction(trans);
|
||||
xaccFreeTransaction(trans);
|
||||
return NULL;
|
||||
}
|
||||
XACC_FLIP_INT (amount);
|
||||
@ -616,7 +616,7 @@ readTransaction( int fd, Account *acc, int token )
|
||||
if( err != sizeof(double) )
|
||||
{
|
||||
PERR ("Premature end of Transaction at amount");
|
||||
freeTransaction(trans);
|
||||
xaccFreeTransaction(trans);
|
||||
return NULL;
|
||||
}
|
||||
XACC_FLIP_DOUBLE (damount);
|
||||
@ -628,7 +628,7 @@ readTransaction( int fd, Account *acc, int token )
|
||||
if( err != sizeof(double) )
|
||||
{
|
||||
PERR ("Premature end of Transaction at share_price");
|
||||
freeTransaction(trans);
|
||||
xaccFreeTransaction(trans);
|
||||
return NULL;
|
||||
}
|
||||
XACC_FLIP_DOUBLE (damount);
|
||||
@ -647,7 +647,7 @@ readTransaction( int fd, Account *acc, int token )
|
||||
if( err != sizeof(int) )
|
||||
{
|
||||
PERR ("Premature end of Transaction at credit");
|
||||
freeTransaction(trans);
|
||||
xaccFreeTransaction(trans);
|
||||
return NULL;
|
||||
}
|
||||
XACC_FLIP_INT (acc_id);
|
||||
@ -664,7 +664,7 @@ readTransaction( int fd, Account *acc, int token )
|
||||
if( err != sizeof(int) )
|
||||
{
|
||||
PERR ("Premature end of Transaction at debit");
|
||||
freeTransaction(trans);
|
||||
xaccFreeTransaction(trans);
|
||||
return NULL;
|
||||
}
|
||||
XACC_FLIP_INT (acc_id);
|
||||
@ -711,7 +711,7 @@ readTransaction( int fd, Account *acc, int token )
|
||||
if( err != sizeof(int) )
|
||||
{
|
||||
PERR ("Premature end of Transaction at num-splits");
|
||||
freeTransaction(trans);
|
||||
xaccFreeTransaction(trans);
|
||||
return NULL;
|
||||
}
|
||||
XACC_FLIP_INT (numSplits);
|
||||
|
@ -605,7 +605,7 @@ char * xaccReadQIFTransaction (int fd, Account *acc)
|
||||
if (!qifline) return NULL;
|
||||
if ('!' == qifline [0]) return qifline;
|
||||
|
||||
trans = mallocTransaction ();
|
||||
trans = xaccMallocTransaction ();
|
||||
|
||||
/* scan for transaction date, description, type */
|
||||
while (qifline) {
|
||||
@ -769,7 +769,7 @@ char * xaccReadQIFTransaction (int fd, Account *acc)
|
||||
* if we see something else, assume the worst, free the last
|
||||
* transaction, and return */
|
||||
if ('!' == qifline[0]) {
|
||||
freeTransaction (trans);
|
||||
xaccFreeTransaction (trans);
|
||||
return qifline;
|
||||
}
|
||||
|
||||
|
@ -163,12 +163,12 @@ double xaccGetShareBalance (Split *s)
|
||||
}
|
||||
|
||||
/********************************************************************\
|
||||
* initTransaction
|
||||
* xaccInitTransaction
|
||||
* Initialize a transaction structure
|
||||
\********************************************************************/
|
||||
|
||||
void
|
||||
initTransaction( Transaction * trans )
|
||||
xaccInitTransaction( Transaction * trans )
|
||||
{
|
||||
|
||||
/* fill in some sane defaults */
|
||||
@ -188,11 +188,12 @@ initTransaction( Transaction * trans )
|
||||
|
||||
/********************************************************************\
|
||||
\********************************************************************/
|
||||
|
||||
Transaction *
|
||||
mallocTransaction( void )
|
||||
xaccMallocTransaction( void )
|
||||
{
|
||||
Transaction *trans = (Transaction *)_malloc(sizeof(Transaction));
|
||||
initTransaction (trans);
|
||||
xaccInitTransaction (trans);
|
||||
return trans;
|
||||
}
|
||||
|
||||
@ -200,7 +201,7 @@ mallocTransaction( void )
|
||||
\********************************************************************/
|
||||
|
||||
void
|
||||
freeTransaction( Transaction *trans )
|
||||
xaccFreeTransaction( Transaction *trans )
|
||||
{
|
||||
int i;
|
||||
Split *s;
|
||||
|
@ -458,7 +458,7 @@ xferCB( Widget mw, XtPointer cd, XtPointer cb )
|
||||
grp->saved = False;
|
||||
|
||||
/* a double-entry transfer -- just one record, two accounts */
|
||||
trans = mallocTransaction();
|
||||
trans = xaccMallocTransaction();
|
||||
split = xaccMallocSplit();
|
||||
xaccTransAppendSplit (trans, split);
|
||||
|
||||
@ -475,6 +475,9 @@ xferCB( Widget mw, XtPointer cd, XtPointer cb )
|
||||
xaccTransSetDescription (trans, XmTextGetString(xferData->desc));
|
||||
xaccTransSetReconcile (trans, NREC);
|
||||
|
||||
/* make sure that all monetary sums are up-to-date */
|
||||
xaccTransRecomputeAmount (trans);
|
||||
|
||||
/* make note of which accounts this was transfered from & to */
|
||||
acc = getAccount(grp,xferData->from);
|
||||
split->acc = (struct _account *) acc;
|
||||
|
Loading…
Reference in New Issue
Block a user