mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Remove rebalance cruft.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@3339 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
1e3fd8b171
commit
2230fbb54f
@ -1085,7 +1085,7 @@ LedgerAutoCompletion(SplitRegister *reg, gncTableTraversalDir dir,
|
||||
if (auto_trans == NULL)
|
||||
return FALSE;
|
||||
|
||||
xaccTransBeginEdit (trans, TRUE);
|
||||
xaccTransBeginEdit (trans);
|
||||
gnc_copy_trans_onto_trans (auto_trans, trans, FALSE, FALSE);
|
||||
|
||||
if (info->default_source_account != NULL)
|
||||
@ -1517,7 +1517,7 @@ LedgerDestroy (SplitRegister *reg)
|
||||
pending_trans = NULL;
|
||||
}
|
||||
|
||||
xaccTransBeginEdit (trans, TRUE);
|
||||
xaccTransBeginEdit (trans);
|
||||
xaccTransDestroy (trans);
|
||||
xaccTransCommitEdit (trans);
|
||||
|
||||
@ -1900,7 +1900,7 @@ xaccSRDuplicateCurrent (SplitRegister *reg)
|
||||
|
||||
new_split = xaccMallocSplit();
|
||||
|
||||
xaccTransBeginEdit(trans, TRUE);
|
||||
xaccTransBeginEdit(trans);
|
||||
xaccTransAppendSplit(trans, new_split);
|
||||
xaccTransCommitEdit(trans);
|
||||
|
||||
@ -1930,7 +1930,7 @@ xaccSRDuplicateCurrent (SplitRegister *reg)
|
||||
|
||||
gnc_copy_trans_onto_trans(trans, new_trans, FALSE, TRUE);
|
||||
|
||||
xaccTransBeginEdit(new_trans, TRUE);
|
||||
xaccTransBeginEdit(new_trans);
|
||||
xaccTransSetDateSecs(new_trans, info->last_date_entered);
|
||||
xaccTransCommitEdit(new_trans);
|
||||
|
||||
@ -2153,7 +2153,7 @@ xaccSRPasteCurrent (SplitRegister *reg)
|
||||
{ /* We are on a null split in an expanded transaction. */
|
||||
split = xaccMallocSplit();
|
||||
|
||||
xaccTransBeginEdit(trans, TRUE);
|
||||
xaccTransBeginEdit(trans);
|
||||
xaccTransAppendSplit(trans, split);
|
||||
xaccTransCommitEdit(trans);
|
||||
}
|
||||
@ -2262,7 +2262,7 @@ xaccSRDeleteCurrentSplit (SplitRegister *reg)
|
||||
|
||||
account = xaccSplitGetAccount(split);
|
||||
|
||||
xaccTransBeginEdit(trans, TRUE);
|
||||
xaccTransBeginEdit(trans);
|
||||
xaccAccountBeginEdit(account);
|
||||
xaccSplitDestroy(split);
|
||||
xaccAccountCommitEdit(account);
|
||||
@ -2314,7 +2314,7 @@ xaccSRDeleteCurrentTrans (SplitRegister *reg)
|
||||
pending_trans = NULL;
|
||||
}
|
||||
|
||||
xaccTransBeginEdit (trans, TRUE);
|
||||
xaccTransBeginEdit (trans);
|
||||
xaccTransDestroy (trans);
|
||||
xaccTransCommitEdit (trans);
|
||||
|
||||
@ -2332,7 +2332,7 @@ xaccSRDeleteCurrentTrans (SplitRegister *reg)
|
||||
|
||||
accounts = gnc_trans_prepend_account_list(trans, NULL);
|
||||
|
||||
xaccTransBeginEdit(trans, TRUE);
|
||||
xaccTransBeginEdit(trans);
|
||||
xaccTransDestroy(trans);
|
||||
xaccTransCommitEdit(trans);
|
||||
|
||||
@ -2384,7 +2384,7 @@ xaccSREmptyCurrentTrans (SplitRegister *reg)
|
||||
pending_trans = NULL;
|
||||
}
|
||||
|
||||
xaccTransBeginEdit (trans, TRUE);
|
||||
xaccTransBeginEdit (trans);
|
||||
xaccTransDestroy (trans);
|
||||
xaccTransCommitEdit (trans);
|
||||
|
||||
@ -2403,7 +2403,7 @@ xaccSREmptyCurrentTrans (SplitRegister *reg)
|
||||
accounts = gnc_trans_prepend_account_list(trans, NULL);
|
||||
splits = gnc_trans_prepend_split_list(trans, NULL);
|
||||
|
||||
xaccTransBeginEdit(trans, TRUE);
|
||||
xaccTransBeginEdit(trans);
|
||||
for (node = splits; node; node = node->next)
|
||||
if (node->data != split)
|
||||
xaccSplitDestroy(node->data);
|
||||
@ -2701,7 +2701,7 @@ xaccSRSaveRegEntry (SplitRegister *reg, gboolean do_commit)
|
||||
if (pending_trans != trans) {
|
||||
if (xaccTransIsOpen (pending_trans))
|
||||
xaccTransCommitEdit (pending_trans);
|
||||
xaccTransBeginEdit (trans, TRUE);
|
||||
xaccTransBeginEdit (trans);
|
||||
pending_trans = trans;
|
||||
info->pending_trans_guid = *xaccTransGetGUID(trans);
|
||||
}
|
||||
@ -4238,7 +4238,7 @@ xaccSRLoadRegister (SplitRegister *reg, GList * slist,
|
||||
|
||||
trans = xaccMallocTransaction ();
|
||||
|
||||
xaccTransBeginEdit (trans, TRUE);
|
||||
xaccTransBeginEdit (trans);
|
||||
xaccTransSetDateSecs (trans, info->last_date_entered);
|
||||
blank_split = xaccMallocSplit ();
|
||||
xaccTransAppendSplit (trans, blank_split);
|
||||
|
@ -29,6 +29,7 @@ be created as a shared library for use by other programs.
|
||||
* Accounts::
|
||||
* Account Groups::
|
||||
* GNCBooks::
|
||||
* Scrub::
|
||||
@end menu
|
||||
|
||||
|
||||
@ -46,22 +47,19 @@ arbitrary data (@pxref{Key-Value Pair Frames}).
|
||||
Transactions (@pxref{Transactions}) embody the notion of "double entry"
|
||||
accounting. A Transaction consists of a date, a description, a number, a
|
||||
list of one or more Splits, and a key-value frame. When double-entry
|
||||
rules are properly enabled in the engine (they are settable with various
|
||||
flags), the total value of the splits is forced to be zero. Note that
|
||||
if there is just one split, its value must be zero; this is useful
|
||||
because a zero-valued split can store a price (useful for e.g. tracking
|
||||
stocks). If there are two splits, then the value of one must be
|
||||
positive, the other negative: this denotes that one account is credited,
|
||||
and another is debited by an equal amount. Positive Split values are
|
||||
'debits' and negative Split values are 'credits'. Forcing the Splits to
|
||||
'add up' to zero causes a double-entry accounting system to always
|
||||
balance.
|
||||
rules are enforced, the total value of the splits is zero. Note that if
|
||||
there is just one split, its value must be zero for double-entry
|
||||
accounting; this is useful because a zero-valued split can store a price
|
||||
(useful for e.g. tracking stocks). If there are two splits, then the
|
||||
value of one must be positive, the other negative: this denotes that one
|
||||
account is credited, and another is debited by an equal amount. Positive
|
||||
Split values are 'debits' and negative Split values are 'credits'.
|
||||
Ensuring the Splits to 'add up' to zero causes a double-entry accounting
|
||||
system to always balance.
|
||||
|
||||
Through various flags, forced double-entry can be disabled; this is
|
||||
often desirable for novice, home-oriented users. As an alternative, it
|
||||
may be better to leave double-entry enabled, but credit all dangling
|
||||
splits to some dummy account, and then simply not show that dummy
|
||||
account to the user.
|
||||
The engine does not enforce double-entry accounting, but provides an API
|
||||
to enable user-code to find unbalanced transactions and 'repair' them so
|
||||
that they are in balance. @xref{Scrub}.
|
||||
|
||||
Note the sum of the values of Splits in a Transaction is always computed
|
||||
with respect to a currency; thus splits can be balanced even when they
|
||||
@ -1256,8 +1254,7 @@ Set the share price of @var{split} to @var{price}.
|
||||
@deftypefun void xaccSplitSetSharePriceAndAmount (Split * @var{split}, gnc_numeric @var{price}, gnc_numeric @var{amount})
|
||||
Set both the share price and share quantity of @var{split}. This routine
|
||||
is more efficent than calling @code{xaccSplitSetShareAmount} and
|
||||
@code{xaccSplitSetSharePrice} in succesion, because the parent Transaction
|
||||
is only rebalanced once. @xref{Transactions}.
|
||||
@code{xaccSplitSetSharePrice} in succesion.
|
||||
@end deftypefun
|
||||
|
||||
@deftypefun void xaccSplitSetValue (Split * @var{split}, gnc_numeric @var{value})
|
||||
@ -1371,14 +1368,9 @@ be freed, or by @code{xaccTransRollbackEdit()}, in which case all the
|
||||
original Splits are put back into place.
|
||||
@end deftypefun
|
||||
|
||||
@deftypefun void xaccTransBeginEdit (Transaction * @var{trans}, gboolean @var{defer})
|
||||
@deftypefun void xaccTransBeginEdit (Transaction * @var{trans})
|
||||
This method must be called before any changes are made to @var{trans} or
|
||||
any of its component Splits. If this is not done, errors will result. If
|
||||
@var{defer} is true, then the automated re-balancing of all Splits in
|
||||
this transaction is deferred until the @code{xaccTransCommitEdit()}
|
||||
call. This allows multiple splits to be edited, quantities modified,
|
||||
with the whole system temporarily out of balance, up until the
|
||||
Commit call is made when double-entry is once again enforced.
|
||||
any of its component Splits. If this is not done, errors will result.
|
||||
@end deftypefun
|
||||
|
||||
@deftypefun void xaccTransCommitEdit (Transaction * @var{trans})
|
||||
@ -1511,7 +1503,7 @@ Set the description field of @var{trans} to @var{desc}.
|
||||
@tindex AccountGroup
|
||||
|
||||
|
||||
@node GNCBooks, , Account Groups, Engine
|
||||
@node GNCBooks, Scrub, Account Groups, Engine
|
||||
@section GNCBooks
|
||||
@tindex GNCBook
|
||||
|
||||
@ -1647,3 +1639,7 @@ Commit all changes that have been made to the book.
|
||||
Release the session lock. It will @emph{not} save the account group to
|
||||
a file. Thus, this method acts as an "abort" or "rollback" primitive.
|
||||
@end deftypefun
|
||||
|
||||
|
||||
@node Scrub, , GNCBooks, Engine
|
||||
@section Scrub
|
||||
|
@ -88,6 +88,7 @@ Engine
|
||||
* Accounts::
|
||||
* Account Groups::
|
||||
* GNCBooks::
|
||||
* Scrub::
|
||||
|
||||
Globally Unique Identifiers
|
||||
|
||||
|
@ -146,7 +146,7 @@ xaccFreeAccount (Account *acc)
|
||||
for(lp = acc->splits; lp; lp = lp->next) {
|
||||
Split *s = (Split *) lp->data;
|
||||
t = s->parent;
|
||||
xaccTransBeginEdit (t, TRUE);
|
||||
xaccTransBeginEdit (t);
|
||||
xaccSplitDestroy (s);
|
||||
xaccTransCommitEdit (t);
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ struct _backend
|
||||
int (*book_end) (GNCBook *);
|
||||
int (*account_begin_edit) (Backend *, Account *, int defer);
|
||||
int (*account_commit_edit) (Backend *, Account *);
|
||||
int (*trans_begin_edit) (Backend *, Transaction *, int defer);
|
||||
int (*trans_begin_edit) (Backend *, Transaction *);
|
||||
int (*trans_commit_edit) (Backend *, Transaction *new, Transaction *orig);
|
||||
int (*trans_rollback_edit) (Backend *, Transaction *);
|
||||
};
|
||||
|
@ -195,7 +195,7 @@ xaccSplitScrub (Split *split)
|
||||
trans_was_open = xaccTransIsOpen (trans);
|
||||
|
||||
if (!trans_was_open)
|
||||
xaccTransBeginEdit (trans, TRUE);
|
||||
xaccTransBeginEdit (trans);
|
||||
|
||||
xaccSplitSetShareAmount (split, xaccSplitGetValue (split));
|
||||
|
||||
@ -303,7 +303,7 @@ xaccTransScrubImbalance (Transaction *trans)
|
||||
trans_was_open = xaccTransIsOpen (trans);
|
||||
|
||||
if (!trans_was_open)
|
||||
xaccTransBeginEdit (trans, TRUE);
|
||||
xaccTransBeginEdit (trans);
|
||||
|
||||
common_currency = xaccTransFindCommonCurrency (trans);
|
||||
account = xaccSplitGetAccount (balance_split);
|
||||
|
@ -66,8 +66,7 @@ int force_double_entry = 0;
|
||||
typedef enum
|
||||
{
|
||||
BEGIN_EDIT = 1 << 0,
|
||||
DEFER_REBALANCE = 1 << 1,
|
||||
BEING_DESTROYED = 1 << 2,
|
||||
BEING_DESTROYED = 1 << 1,
|
||||
} TransFlags;
|
||||
|
||||
/* arbitrary price per share increment FIXME */
|
||||
@ -77,9 +76,6 @@ typedef enum
|
||||
/* This static indicates the debugging module that this .o belongs to. */
|
||||
static short module = MOD_ENGINE;
|
||||
|
||||
/* Prototypes *******************************************************/
|
||||
static void xaccSplitRebalance (Split *split);
|
||||
|
||||
|
||||
/********************************************************************\
|
||||
* xaccInitSplit
|
||||
@ -385,8 +381,6 @@ xaccSplitSetSharePriceAndAmount (Split *s, gnc_numeric price,
|
||||
s->value = gnc_numeric_mul(s->damount, price,
|
||||
get_currency_denom(s), GNC_RND_ROUND);
|
||||
|
||||
/* force double entry to always balance */
|
||||
xaccSplitRebalance (s);
|
||||
mark_split (s);
|
||||
}
|
||||
|
||||
@ -403,8 +397,6 @@ xaccSplitSetSharePrice (Split *s, gnc_numeric price) {
|
||||
s->value = gnc_numeric_mul(s->damount, price, get_currency_denom(s),
|
||||
GNC_RND_ROUND);
|
||||
|
||||
/* force double entry to always balance */
|
||||
xaccSplitRebalance (s);
|
||||
mark_split (s);
|
||||
}
|
||||
|
||||
@ -428,8 +420,6 @@ DxaccSplitSetShareAmount (Split *s, double damt) {
|
||||
s->value = gnc_numeric_mul(s->damount, old_price,
|
||||
get_currency_denom(s), GNC_RND_ROUND);
|
||||
|
||||
/* force double entry to always balance */
|
||||
xaccSplitRebalance (s);
|
||||
mark_split (s);
|
||||
}
|
||||
|
||||
@ -439,7 +429,6 @@ xaccSplitSetShareAmount (Split *s, gnc_numeric amt) {
|
||||
|
||||
s->damount = gnc_numeric_convert(amt, get_security_denom(s), GNC_RND_ROUND);
|
||||
|
||||
xaccSplitRebalance (s);
|
||||
mark_split (s);
|
||||
}
|
||||
|
||||
@ -467,8 +456,6 @@ DxaccSplitSetValue (Split *s, double damt) {
|
||||
GNC_RND_ROUND);
|
||||
}
|
||||
|
||||
/* force double entry to always balance */
|
||||
xaccSplitRebalance (s);
|
||||
mark_split (s);
|
||||
}
|
||||
|
||||
@ -478,7 +465,6 @@ xaccSplitSetValue (Split *s, gnc_numeric amt) {
|
||||
|
||||
s->value = gnc_numeric_convert(amt, get_currency_denom(s), GNC_RND_ROUND);;
|
||||
|
||||
xaccSplitRebalance (s);
|
||||
mark_split (s);
|
||||
}
|
||||
|
||||
@ -1138,111 +1124,6 @@ xaccTransIsCommonExclSCurrency (Transaction *trans,
|
||||
/********************************************************************\
|
||||
\********************************************************************/
|
||||
|
||||
/* hack alert -- the algorithm used in this rebalance routine
|
||||
* is less than intuitive, and could use some write-up.
|
||||
* Maybe it does indeed do the right thing, but that is
|
||||
* not at all obvious.
|
||||
*/
|
||||
|
||||
static void
|
||||
xaccTransRebalance (Transaction * trans)
|
||||
{
|
||||
return;
|
||||
|
||||
if (!trans || !trans->splits)
|
||||
return;
|
||||
|
||||
xaccSplitRebalance (trans->splits->data);
|
||||
}
|
||||
|
||||
void
|
||||
xaccSplitRebalance (Split *split)
|
||||
{
|
||||
const gnc_commodity * base_currency = NULL;
|
||||
Transaction *trans;
|
||||
gnc_numeric value;
|
||||
Split *s;
|
||||
|
||||
return;
|
||||
|
||||
trans = split->parent;
|
||||
|
||||
/* We might have gotten here if someone is manipulating
|
||||
* a split that has not yet been inserted in a transaction.
|
||||
* Rather than punishing them with an assert, lets just
|
||||
* quietly return.
|
||||
*/
|
||||
if (!trans) return;
|
||||
|
||||
if (DEFER_REBALANCE & (trans->open)) return;
|
||||
|
||||
if (split->acc)
|
||||
{
|
||||
const gnc_commodity * ra, * rb;
|
||||
|
||||
if (split->acc->editlevel > 0) return;
|
||||
|
||||
assert (trans->splits);
|
||||
assert (trans->splits->data);
|
||||
|
||||
/* lets find out if we are dealing with multiple currencies,
|
||||
* and which one(s) all of the splits have in common. */
|
||||
ra = xaccAccountGetCurrency (split->acc);
|
||||
rb = xaccAccountGetSecurity (split->acc);
|
||||
base_currency = FindCommonCurrency (trans->splits, ra, rb);
|
||||
|
||||
if (!base_currency) {
|
||||
GList *node;
|
||||
PERR ("no common split currencies\n");
|
||||
for (node = trans->splits; node; node = node->next) {
|
||||
Split *s = node->data;
|
||||
|
||||
if (s->acc) {
|
||||
PERR ("\taccount=%s currency=%s security=%s\n",
|
||||
s->acc->accountName,
|
||||
gnc_commodity_get_printname(xaccAccountGetCurrency (s->acc)),
|
||||
gnc_commodity_get_printname(xaccAccountGetSecurity (s->acc)));
|
||||
} else {
|
||||
PERR ("\t*** No parent account *** \n");
|
||||
}
|
||||
}
|
||||
assert (0);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
assert (trans->splits);
|
||||
assert (trans->splits->data);
|
||||
}
|
||||
|
||||
if (g_list_length (trans->splits) != 2)
|
||||
return;
|
||||
|
||||
/* pick the other split */
|
||||
if (split == trans->splits->data)
|
||||
s = g_list_nth_data (trans->splits, 1);
|
||||
else
|
||||
s = trans->splits->data;
|
||||
|
||||
if (!s)
|
||||
return;
|
||||
|
||||
/* the new value of the destination split will be the result. */
|
||||
value = xaccSplitsComputeValue (trans->splits, s, base_currency);
|
||||
|
||||
/* what do we do if the value is different in the denominator
|
||||
* than the one for the account? */
|
||||
|
||||
/* KLUDGE -- bg */
|
||||
xaccSplitSetBaseValue (s, gnc_numeric_neg (value), base_currency);
|
||||
mark_split (s);
|
||||
xaccAccountRecomputeBalance (s->acc);
|
||||
}
|
||||
|
||||
/********************************************************************\
|
||||
\********************************************************************/
|
||||
|
||||
G_INLINE_FUNC void check_open (Transaction *trans);
|
||||
G_INLINE_FUNC void
|
||||
check_open (Transaction *trans)
|
||||
@ -1256,7 +1137,7 @@ check_open (Transaction *trans)
|
||||
}
|
||||
|
||||
void
|
||||
xaccTransBeginEdit (Transaction *trans, gboolean defer)
|
||||
xaccTransBeginEdit (Transaction *trans)
|
||||
{
|
||||
char open;
|
||||
Backend *be;
|
||||
@ -1264,14 +1145,13 @@ xaccTransBeginEdit (Transaction *trans, gboolean defer)
|
||||
assert (trans);
|
||||
open = trans->open;
|
||||
trans->open = BEGIN_EDIT;
|
||||
if (defer) trans->open |= DEFER_REBALANCE;
|
||||
|
||||
if (open & BEGIN_EDIT) return;
|
||||
|
||||
/* See if there's a backend. If there is, invoke it. */
|
||||
be = xaccTransactionGetBackend (trans);
|
||||
if (be && be->trans_begin_edit) {
|
||||
(be->trans_begin_edit) (be, trans, defer);
|
||||
}
|
||||
if (be && be->trans_begin_edit)
|
||||
(be->trans_begin_edit) (be, trans);
|
||||
|
||||
xaccOpenLog ();
|
||||
xaccTransWriteLog (trans, 'B');
|
||||
@ -1339,11 +1219,6 @@ xaccTransCommitEdit (Transaction *trans)
|
||||
xaccSplitSetValue(s, gnc_numeric_neg(split->value));
|
||||
}
|
||||
|
||||
/* xaccTransScrubSplits (trans); */
|
||||
|
||||
trans->open &= ~DEFER_REBALANCE;
|
||||
xaccTransRebalance (trans);
|
||||
|
||||
/* ------------------------------------------------- */
|
||||
/* OK, at this point, we are done making sure that
|
||||
* we've got a validly constructed transaction.
|
||||
@ -1634,29 +1509,17 @@ xaccSplitDestroy (Split *split)
|
||||
assert (trans->splits);
|
||||
check_open (trans);
|
||||
|
||||
xaccRemoveEntity(&split->guid);
|
||||
xaccRemoveEntity (&split->guid);
|
||||
|
||||
ismember = (g_list_find (trans->splits, split) != NULL);
|
||||
|
||||
assert (ismember);
|
||||
|
||||
/* If the account has three or more splits,
|
||||
* merely unlink & free the split.
|
||||
*
|
||||
* Or if the account has only two splits,
|
||||
* then this destroy will leave only one split.
|
||||
* Don't rebalance, as this will goof up the
|
||||
* value of the remaining split. (The rebalance
|
||||
* happens later(?) during commit(?).)
|
||||
*/
|
||||
mark_split (split);
|
||||
xaccTransRemoveSplit (trans, split);
|
||||
xaccAccountRemoveSplit (split->acc, split);
|
||||
xaccAccountRecomputeBalance (split->acc);
|
||||
xaccFreeSplit (split);
|
||||
|
||||
if (g_list_length (trans->splits) > 1)
|
||||
xaccTransRebalance (trans);
|
||||
}
|
||||
|
||||
/********************************************************************\
|
||||
@ -1681,11 +1544,6 @@ xaccTransAppendSplit (Transaction *trans, Split *split)
|
||||
/* now, insert the split into the array */
|
||||
split->parent = trans;
|
||||
trans->splits = g_list_append (trans->splits, split);
|
||||
|
||||
/* force double entry to always be consistent */
|
||||
xaccSplitRebalance (split);
|
||||
if (oldtrans && oldtrans != trans)
|
||||
xaccTransRebalance (oldtrans);
|
||||
}
|
||||
|
||||
/********************************************************************\
|
||||
|
@ -97,12 +97,7 @@ void xaccTransDestroy (Transaction *trans);
|
||||
|
||||
/* The xaccTransBeginEdit() method must be called before any changes
|
||||
* are made to a transaction or any of its component splits. If
|
||||
* this is not done, errors will result. If the defer flag is set,
|
||||
* then the automated re-balancing of all splits in this transaction
|
||||
* is deferred until the xaccTransCommitEdit() call. This allows
|
||||
* multiple splits to be edited, and quantities modified, and the
|
||||
* whole system temporarily out of balance, up until the Commit
|
||||
* call is made when double-entry is once again enforced.
|
||||
* this is not done, errors will result.
|
||||
*
|
||||
* The xaccTransCommitEdit() method indicates that the changes to the
|
||||
* transaction and its splits are complete and should be made
|
||||
@ -118,7 +113,7 @@ void xaccTransDestroy (Transaction *trans);
|
||||
*
|
||||
* The xaccTransIsOpen() method returns TRUE if the transaction
|
||||
* is open for editing. Otherwise, it returns false. */
|
||||
void xaccTransBeginEdit (Transaction *trans, gboolean defer);
|
||||
void xaccTransBeginEdit (Transaction *trans);
|
||||
void xaccTransCommitEdit (Transaction *trans);
|
||||
void xaccTransRollbackEdit (Transaction *trans);
|
||||
|
||||
|
@ -818,7 +818,7 @@ readTransaction( int fd, Account *acc, int token )
|
||||
|
||||
/* create a transaction structure */
|
||||
trans = xaccMallocTransaction();
|
||||
xaccTransBeginEdit (trans, 1);
|
||||
xaccTransBeginEdit (trans);
|
||||
|
||||
/* add in one split -- xaccMallocTransaction no longer auto-creates them. */
|
||||
{
|
||||
|
@ -3226,7 +3226,7 @@ txn_restore_start_handler(GSList* sibling_data,
|
||||
|
||||
if(!trans) return(FALSE);
|
||||
|
||||
xaccTransBeginEdit(trans, 1);
|
||||
xaccTransBeginEdit(trans);
|
||||
|
||||
*data_for_children = trans;
|
||||
|
||||
|
@ -722,7 +722,7 @@ gnc_xfer_dialog_ok_cb(GtkWidget * widget, gpointer data)
|
||||
/* Create the transaction */
|
||||
trans = xaccMallocTransaction();
|
||||
|
||||
xaccTransBeginEdit(trans, TRUE);
|
||||
xaccTransBeginEdit(trans);
|
||||
xaccTransSetDateSecs(trans, time);
|
||||
|
||||
string = gtk_entry_get_text(GTK_ENTRY(xferData->num_entry));
|
||||
@ -762,7 +762,7 @@ gnc_xfer_dialog_ok_cb(GtkWidget * widget, gpointer data)
|
||||
/* Create the transaction */
|
||||
trans = xaccMallocTransaction();
|
||||
|
||||
xaccTransBeginEdit(trans, TRUE);
|
||||
xaccTransBeginEdit(trans);
|
||||
xaccTransSetDateSecs(trans, time);
|
||||
|
||||
string = gtk_entry_get_text(GTK_ENTRY(xferData->num_entry));
|
||||
@ -808,7 +808,7 @@ gnc_xfer_dialog_ok_cb(GtkWidget * widget, gpointer data)
|
||||
/* Create the transaction */
|
||||
trans = xaccMallocTransaction();
|
||||
|
||||
xaccTransBeginEdit(trans, TRUE);
|
||||
xaccTransBeginEdit(trans);
|
||||
xaccTransSetDateSecs(trans, time);
|
||||
|
||||
string = gtk_entry_get_text(GTK_ENTRY(xferData->num_entry));
|
||||
|
@ -700,7 +700,7 @@ gnc_ui_reconcile_window_delete_cb(GtkButton *button, gpointer data)
|
||||
affected_accounts = g_list_prepend(affected_accounts, a);
|
||||
}
|
||||
|
||||
xaccTransBeginEdit(trans, 1);
|
||||
xaccTransBeginEdit(trans);
|
||||
xaccTransDestroy(trans);
|
||||
xaccTransCommitEdit(trans);
|
||||
|
||||
|
@ -250,7 +250,7 @@
|
||||
(begin
|
||||
;; open the transaction for editing
|
||||
(if (not (gnc:transaction-is-open trans))
|
||||
(gnc:transaction-begin-edit trans #t))
|
||||
(gnc:transaction-begin-edit trans))
|
||||
|
||||
;; copy in the transaction values
|
||||
(let ((description (gnc:transaction-scm-get-description trans-scm))
|
||||
|
@ -264,7 +264,7 @@
|
||||
(begin
|
||||
;; create and fill in the GNC transaction
|
||||
(let ((gnc-xtn (gnc:transaction-create)))
|
||||
(gnc:transaction-begin-edit gnc-xtn #t)
|
||||
(gnc:transaction-begin-edit gnc-xtn)
|
||||
|
||||
;; build the transaction
|
||||
(qif-import:qif-xtn-to-gnc-xtn
|
||||
|
Loading…
Reference in New Issue
Block a user