[Gnucash-changes] Send an 'invoice modified' event when a payment
is applied (#139092).
Derek Atkins
warlord at cvs.gnucash.org
Sat Dec 4 16:56:43 EST 2004
Log Message:
-----------
Send an 'invoice modified' event when a payment is applied (#139092).
* src/business/business-core/gncInvoice.c:
send an event when a payment is processed so the invoice gets
updated as "paid" in the search window.
Fixes #139092.
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.1863
retrieving revision 1.1864
diff -LChangeLog -LChangeLog -u -r1.1863 -r1.1864
--- ChangeLog
+++ ChangeLog
@@ -1,5 +1,10 @@
2004-12-04 Derek Atkins <derek at ihtfp.com>
+ * src/business/business-core/gncInvoice.c:
+ send an event when a payment is processed so the invoice gets
+ updated as "paid" in the search window.
+ Fixes #139092.
+
* src/business/business-gnome/dialog-vendor.c:
Make sure we set the proper search-type when we create the
query, otherwise the search will fail later.
Index: gncInvoice.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/business/business-core/gncInvoice.c,v
retrieving revision 1.93
retrieving revision 1.94
diff -Lsrc/business/business-core/gncInvoice.c -Lsrc/business/business-core/gncInvoice.c -u -r1.93 -r1.94
--- src/business/business-core/gncInvoice.c
+++ src/business/business-core/gncInvoice.c
@@ -1161,6 +1161,7 @@
Split *split;
GList *lot_list, *fifo = NULL;
GNCLot *lot, *prepay_lot = NULL;
+ GncInvoice *invoice;
const char *name;
gnc_commodity *commodity;
gnc_numeric split_amt;
@@ -1259,6 +1260,11 @@
xaccTransAppendSplit (txn, split);
gnc_lot_add_split (lot, split);
+ /* Now send an event for the invoice so it gets updated as paid */
+ invoice = gncInvoiceGetInvoiceFromLot(lot);
+ if (invoice)
+ gnc_engine_gen_event (&invoice->inst.entity, GNC_EVENT_MODIFY);
+
if (gnc_numeric_zero_p (amount))
break;
}
More information about the gnucash-changes
mailing list