[Gnucash-changes] Properly accumulate splits (bug #165053).
Derek Atkins
warlord at cvs.gnucash.org
Sun Jan 23 23:33:31 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).
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.1879
retrieving revision 1.1880
diff -LChangeLog -LChangeLog -u -r1.1879 -r1.1880
--- 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.94
retrieving revision 1.95
diff -Lsrc/business/business-core/gncInvoice.c -Lsrc/business/business-core/gncInvoice.c -u -r1.94 -r1.95
--- src/business/business-core/gncInvoice.c
+++ src/business/business-core/gncInvoice.c
@@ -855,23 +855,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->inst.book);
- /* set action and memo? */
+ split = xaccMallocSplit (invoice->inst.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