mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Fix bugs, spelling errors.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@3639 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
961b14e8ff
commit
208fc49354
@ -681,7 +681,7 @@ xaccAccountRemoveSplit (Account *acc, Split *split)
|
||||
* value of such an account is the number of shares times the *
|
||||
* current share price. *
|
||||
* *
|
||||
* Part of the complexity of this computatation stems from the fact *
|
||||
* Part of the complexity of this computation stems from the fact *
|
||||
* xacc uses a double-entry system, meaning that one transaction *
|
||||
* appears in two accounts: one account is debited, and the other *
|
||||
* is credited. When the transaction represents a sale of shares, *
|
||||
@ -700,7 +700,7 @@ price_xfer(Split * s, gnc_numeric share_count) {
|
||||
gnc_numeric temp;
|
||||
if(!gnc_numeric_zero_p(s->damount)) {
|
||||
temp = gnc_numeric_div(s->value, s->damount,
|
||||
GNC_DENOM_AUTO, GNC_DENOM_EXACT);
|
||||
1000000, GNC_DENOM_LCD);
|
||||
temp = gnc_numeric_mul(share_count, temp,
|
||||
gnc_numeric_denom(s->value),
|
||||
GNC_RND_ROUND);
|
||||
@ -726,6 +726,7 @@ xaccAccountRecomputeBalance (Account * acc)
|
||||
if(NULL == acc) return;
|
||||
if(acc->editlevel > 0) return;
|
||||
if(!acc->balance_dirty) return;
|
||||
if(acc->do_free) return;
|
||||
|
||||
dbalance = acc->starting_balance;
|
||||
dcleared_balance = acc->starting_cleared_balance;
|
||||
@ -765,7 +766,7 @@ xaccAccountRecomputeBalance (Account * acc)
|
||||
split -> share_reconciled_balance = share_reconciled_balance;
|
||||
split -> balance = price_xfer(split, share_balance);
|
||||
split -> cleared_balance = price_xfer(split, share_cleared_balance);
|
||||
split -> reconciled_balance =
|
||||
split -> reconciled_balance =
|
||||
price_xfer(split, share_reconciled_balance);
|
||||
}
|
||||
else {
|
||||
|
@ -156,6 +156,26 @@ xaccAccountGroupCommitEdit (AccountGroup *grp)
|
||||
/********************************************************************\
|
||||
\********************************************************************/
|
||||
|
||||
void
|
||||
xaccGroupMarkDoFree (AccountGroup *grp)
|
||||
{
|
||||
GList *node;
|
||||
|
||||
if (!grp) return;
|
||||
|
||||
for (node = grp->accounts; node; node = node->next)
|
||||
{
|
||||
Account *account = node->data;
|
||||
|
||||
account->do_free = TRUE;
|
||||
|
||||
xaccGroupMarkDoFree (account->children);
|
||||
}
|
||||
}
|
||||
|
||||
/********************************************************************\
|
||||
\********************************************************************/
|
||||
|
||||
void
|
||||
xaccFreeAccountGroup (AccountGroup *grp)
|
||||
{
|
||||
|
@ -62,11 +62,15 @@ void xaccGroupMergeAccounts (AccountGroup *grp);
|
||||
*
|
||||
* The xaccGroupMarkNotSaved() subroutine will mark
|
||||
* the given group as not having been saved.
|
||||
*
|
||||
* The xaccGroupMarkDoFree() subroutine will mark
|
||||
* all accounts in the group as being destroyed.
|
||||
*/
|
||||
|
||||
gboolean xaccGroupNotSaved (AccountGroup *grp);
|
||||
void xaccGroupMarkSaved (AccountGroup *grp);
|
||||
void xaccGroupMarkNotSaved (AccountGroup *grp);
|
||||
void xaccGroupMarkDoFree (AccountGroup *grp);
|
||||
|
||||
/*
|
||||
* The xaccRemoveAccount() subroutine will remove the indicated
|
||||
|
@ -659,6 +659,10 @@ gnc_book_destroy (GNCBook *book)
|
||||
if (book->backend) g_free(book->backend);
|
||||
xaccGroupSetBackend (book->topgroup, NULL);
|
||||
|
||||
/* mark the accounts as being freed
|
||||
* to avoid tons of balance recomputations. */
|
||||
xaccGroupMarkDoFree (book->topgroup);
|
||||
|
||||
xaccFreeAccountGroup (book->topgroup);
|
||||
book->topgroup = NULL;
|
||||
xaccLogEnable();
|
||||
|
@ -66,7 +66,7 @@ kvp_frame * kvp_frame_copy(const kvp_frame * frame);
|
||||
* associating it with 'key'.
|
||||
* The kvp_frame_set_slot_nc() routine puts the value (without copying
|
||||
* it) into the frame, associating it with 'key'. This routine is
|
||||
* handy for aviding excess memory allocations & frees.
|
||||
* handy for avoiding excess memory allocations & frees.
|
||||
*/
|
||||
void kvp_frame_set_slot(kvp_frame * frame,
|
||||
const char * key, const kvp_value * value);
|
||||
@ -75,7 +75,7 @@ void kvp_frame_set_slot_nc(kvp_frame * frame,
|
||||
kvp_value * kvp_frame_get_slot(kvp_frame * frame,
|
||||
const char * key);
|
||||
|
||||
/* The kvp_frame_set_slot_path() routines walk the heirarchy,
|
||||
/* The kvp_frame_set_slot_path() routines walk the hierarchy,
|
||||
* using the key falues to pick each branch. When the terminal node
|
||||
* is reached, the value is copied into it.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user