[Gnucash-changes] Send an 'invoice modified' event when a payment is applied (#139092).

Derek Atkins warlord at cvs.gnucash.org
Sat Dec 4 16:44:45 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.

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.376
retrieving revision 1.1461.2.377
diff -LChangeLog -LChangeLog -u -r1.1461.2.376 -r1.1461.2.377
--- 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.56.2.11
retrieving revision 1.56.2.12
diff -Lsrc/business/business-core/gncInvoice.c -Lsrc/business/business-core/gncInvoice.c -u -r1.56.2.11 -r1.56.2.12
--- src/business/business-core/gncInvoice.c
+++ src/business/business-core/gncInvoice.c
@@ -1084,6 +1084,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;
@@ -1182,6 +1183,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_generate_event (&invoice->guid, GNC_EVENT_MODIFY);
+
     if (gnc_numeric_zero_p (amount))
       break;
   }


More information about the gnucash-changes mailing list