[Gnucash-changes] Properly accumulate splits (bug #165053).
Derek Atkins
warlord at cvs.gnucash.org
Sun Jan 23 23:31:55 EST 2005
Log Message:
-----------
Properly accumulate splits (bug #165053).
* src/business/business-core/gncInvoice.c: Properly accumulate
splits (bug #165053). Also fixes a (related) memory leak
(caused by the same lack-of-reference to accumulated splits).
Tags:
----
gnucash-1-8-branch
Modified Files:
--------------
gnucash:
ChangeLog
gnucash/src/business/business-core:
gncInvoice.c
Revision Data
-------------
Index: ChangeLog
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/ChangeLog,v
retrieving revision 1.1461.2.384
retrieving revision 1.1461.2.385
diff -LChangeLog -LChangeLog -u -r1.1461.2.384 -r1.1461.2.385
--- ChangeLog
+++ ChangeLog
@@ -1,3 +1,9 @@
+2005-01-23 Derek Atkins <derek at ihtfp.com>
+
+ * src/business/business-core/gncInvoice.c: Properly accumulate
+ splits (bug #165053). Also fixes a (related) memory leak
+ (caused by the same lack-of-reference to accumulated splits).
+
2005-01-16 Christian Stimming <stimming at tuhh.de>
* src/app-utils/gnc-ui-util.c: Modify tax option code to load
Index: gncInvoice.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/business/business-core/gncInvoice.c,v
retrieving revision 1.56.2.12
retrieving revision 1.56.2.13
diff -Lsrc/business/business-core/gncInvoice.c -Lsrc/business/business-core/gncInvoice.c -u -r1.56.2.12 -r1.56.2.13
--- src/business/business-core/gncInvoice.c
+++ src/business/business-core/gncInvoice.c
@@ -797,23 +797,23 @@
if (this_acc) {
if (gnc_numeric_check (value) == GNC_ERROR_OK) {
if (accumulatesplits) {
- gncAccountValueAdd (splitinfo, this_acc, value);
+ splitinfo = gncAccountValueAdd (splitinfo, this_acc, value);
} else {
- Split *split;
+ Split *split;
- split = xaccMallocSplit (invoice->book);
- /* set action and memo? */
+ split = xaccMallocSplit (invoice->book);
+ /* set action and memo? */
- xaccSplitSetMemo (split, gncEntryGetDescription (entry));
- xaccSplitSetAction (split, type);
+ xaccSplitSetMemo (split, gncEntryGetDescription (entry));
+ xaccSplitSetAction (split, type);
- xaccSplitSetBaseValue (split, (reverse ? gnc_numeric_neg (value)
- : value),
+ xaccSplitSetBaseValue (split, (reverse ? gnc_numeric_neg (value)
+ : value),
invoice->currency);
- xaccAccountBeginEdit (this_acc);
- xaccAccountInsertSplit (this_acc, split);
- xaccAccountCommitEdit (this_acc);
- xaccTransAppendSplit (txn, split);
+ xaccAccountBeginEdit (this_acc);
+ xaccAccountInsertSplit (this_acc, split);
+ xaccAccountCommitEdit (this_acc);
+ xaccTransAppendSplit (txn, split);
}
/* If there is a credit-card account, and this is a CCard
More information about the gnucash-changes
mailing list