new patch for invoice posting with a split per entry

Daniel Lindenaar d.j.w.lindenaar at student.tue.nl
Tue Sep 21 18:01:30 EDT 2004


Hi all,
Here is the patch again, but now implemented as a check-box in the 
Post-dialog and a default option in the business preferences.

I'd like to compliment the coders of gnucash as it was REALLY easy to 
implement this feature...

greetz Daniel
p.s. Derek, there are two files... ;-)
-------------- next part --------------
diff -urw -x 'Make*' gnucash-1.8.9/src/business/business-core/gncInvoice.c patchedgnucash/src/business/business-core/gncInvoice.c
--- gnucash-1.8.9/src/business/business-core/gncInvoice.c	2003-07-31 04:03:33.000000000 +0200
+++ patchedgnucash/src/business/business-core/gncInvoice.c	2004-09-21 17:13:16.000000000 +0200
@@ -552,6 +552,7 @@
   return invoice->active;
 }
 
+
 gnc_numeric gncInvoiceGetToChargeAmount (GncInvoice *invoice)
 {
   if (!invoice) return gnc_numeric_zero();
@@ -691,7 +692,7 @@
 
 Transaction * gncInvoicePostToAccount (GncInvoice *invoice, Account *acc,
 				       Timespec *post_date, Timespec *due_date,
-				       const char * memo)
+				       const char * memo, gboolean accumulatesplits)
 {
   Transaction *txn;
   GNCLot *lot = NULL;
@@ -795,7 +796,25 @@
 		gncEntryGetBillAccount (entry));
     if (this_acc) {
       if (gnc_numeric_check (value) == GNC_ERROR_OK) {
-	splitinfo = gncAccountValueAdd (splitinfo, this_acc, value);
+	if (accumulatesplits) {
+	    gncAccountValueAdd (splitinfo, this_acc, value);
+	} else {
+		Split *split;
+
+		split = xaccMallocSplit (invoice->book);
+		/* set action and memo? */
+
+		xaccSplitSetMemo (split, gncEntryGetDescription (entry));
+		xaccSplitSetAction (split, type);
+
+		xaccSplitSetBaseValue (split, (reverse ? gnc_numeric_neg (value)
+				: value),
+				 invoice->currency);
+       	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
 	 * payment type, the don't add it to the total, and instead
diff -urw -x 'Make*' gnucash-1.8.9/src/business/business-core/gncInvoice.h patchedgnucash/src/business/business-core/gncInvoice.h
--- gnucash-1.8.9/src/business/business-core/gncInvoice.h	2003-05-29 18:22:36.000000000 +0200
+++ patchedgnucash/src/business/business-core/gncInvoice.h	2004-09-21 17:14:08.000000000 +0200
@@ -81,7 +80,7 @@
 Transaction *
 gncInvoicePostToAccount (GncInvoice *invoice, Account *acc,
 			 Timespec *posted_date, Timespec *due_date,
-			 const char *memo);
+			 const char *memo, gboolean accumulatesplits);
 
 /*
  * UNpost this invoice.  This will destroy the posted transaction
diff -urw -x 'Make*' gnucash-1.8.9/src/business/business-gnome/dialog-date-close.c patchedgnucash/src/business/business-gnome/dialog-date-close.c
--- gnucash-1.8.9/src/business/business-gnome/dialog-date-close.c	2003-01-19 00:36:35.000000000 +0100
+++ patchedgnucash/src/business/business-gnome/dialog-date-close.c	2004-09-21 20:43:38.000000000 +0200
@@ -25,6 +25,7 @@
   GtkWidget *post_date;
   GtkWidget *acct_combo;
   GtkWidget *memo_entry;
+  GtkWidget *question_check;
   GncBillTerm *terms;
   Timespec *ts, *ts2;
   GList * acct_types;
@@ -32,6 +33,7 @@
   Account *acct;
   char **memo;
   gboolean retval;
+  gboolean answer;
 } DialogDateClose;
 
 static void
@@ -66,7 +68,8 @@
   if (ddc->memo_entry && ddc->memo)
     *(ddc->memo) = gtk_editable_get_chars (GTK_EDITABLE (ddc->memo_entry),
 					   0, -1);
-
+  if (ddc->question_check)
+	  ddc->answer = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(ddc->question_check));
   ddc->retval = TRUE;
   gnome_dialog_close (GNOME_DIALOG (ddc->dialog));
 }
@@ -209,16 +212,17 @@
 }
 
 gboolean
-gnc_dialog_dates_acct_parented (GtkWidget *parent, const char *message,
+gnc_dialog_dates_acct_question_parented (GtkWidget *parent, const char *message,
 				const char *ddue_label_message,
 				const char *post_label_message,
 				const char *acct_label_message,
+				const char *question_check_message,
 				gboolean ok_is_default,
 				GList * acct_types, GNCBook *book,
 				GncBillTerm *terms,
 				/* Returned Data... */
 				Timespec *ddue, Timespec *post,
-				char **memo, Account **acct)
+				char **memo, Account **acct, gboolean *answer)
 {
   DialogDateClose *ddc;
   GtkWidget *hbox;
@@ -231,6 +235,8 @@
   if (!message || !ddue_label_message || !post_label_message ||
       !acct_label_message || !acct_types || !book || !ddue || !post || !acct)
     return FALSE;
+  if (question_check_message && !answer)
+	  return FALSE;
 
   ddc = g_new0 (DialogDateClose, 1);
   ddc->ts = ddue;
@@ -257,6 +263,8 @@
   ddc->post_date = gnc_date_edit_new (time(NULL), FALSE, FALSE);
   gtk_box_pack_start (GTK_BOX(date_box), ddc->post_date, TRUE, TRUE, 0);
 
+  ddc->question_check = glade_xml_get_widget(xml, "question_check");
+  
   if (parent)
     gnome_dialog_set_parent (GNOME_DIALOG(ddc->dialog), GTK_WINDOW(parent));
 
@@ -270,6 +278,16 @@
   label = glade_xml_get_widget (xml, "acct_label");
   gtk_label_set_text (GTK_LABEL (label), acct_label_message);
 
+  if (question_check_message)
+  {
+	  gtk_label_set_text(GTK_LABEL(GTK_BIN(ddc->question_check)->child), question_check_message);
+	  gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(ddc->question_check), *answer);
+  } else {
+	  gtk_widget_hide(ddc->question_check);
+	  gtk_widget_hide(glade_xml_get_widget(xml, "hide1"));
+  }
+
+
   /* Set the post date widget */
   gnc_date_edit_set_time_ts (GNC_DATE_EDIT (ddc->post_date), *post);
 
@@ -302,6 +320,8 @@
 
   retval = ddc->retval;
   *acct = ddc->acct;
+  if (question_check_message)
+	  *answer = ddc->answer;
   g_free (ddc);
 
   return retval;
diff -urw -x 'Make*' gnucash-1.8.9/src/business/business-gnome/dialog-date-close.h patchedgnucash/src/business/business-gnome/dialog-date-close.h
--- gnucash-1.8.9/src/business/business-gnome/dialog-date-close.h	2002-06-22 23:54:55.000000000 +0200
+++ patchedgnucash/src/business/business-gnome/dialog-date-close.h	2004-09-21 20:44:01.000000000 +0200
@@ -27,16 +27,40 @@
  */
 
 gboolean
-gnc_dialog_dates_acct_parented (GtkWidget *parent, const char *message,
+gnc_dialog_dates_acct_question_parented (GtkWidget *parent, const char *message,
 				const char *ddue_label_message,
 				const char *post_label_message,
 				const char *acct_label_message,
+				const char *question_check_message,
 				gboolean ok_is_default,
 				GList * acct_types, GNCBook *book,
 				GncBillTerm *terms,
 				/* Returned Data... */
 				Timespec *ddue, Timespec *post,
-				char **memo, Account **acct);
+				char **memo, Account **acct, gboolean *answer);
+
+#define gnc_dialog_dates_acct_parented(parent, message,	\
+				ddue_label_message,							\
+				post_label_message,							\
+				acct_label_message,							\
+				ok_is_default,								\
+				acct_types, book,							\
+				terms,										\
+				/* Returned Data... */						\
+				ddue, post,									\
+				memo, acct)									\
+		gnc_dialog_dates_acct_question_parented (parent, message,	\
+				ddue_label_message,							\
+				post_label_message,							\
+				acct_label_message,							\
+				NULL,						\
+				ok_is_default,								\
+				acct_types, book,							\
+				terms,										\
+				/* Returned Data... */						\
+				ddue, post,									\
+				memo, acct, NULL)									\
+
 
 gboolean
 gnc_dialog_date_acct_parented (GtkWidget *parent, const char *message,
diff -urw -x 'Make*' gnucash-1.8.9/src/business/business-gnome/dialog-invoice.c patchedgnucash/src/business/business-gnome/dialog-invoice.c
--- gnucash-1.8.9/src/business/business-gnome/dialog-invoice.c	2003-06-16 04:26:03.000000000 +0200
+++ patchedgnucash/src/business/business-gnome/dialog-invoice.c	2004-09-21 20:52:49.000000000 +0200
@@ -535,10 +535,11 @@
 {
   InvoiceWindow *iw = data;
   GncInvoice *invoice;
-  char *message, *memo, *ddue_label, *post_label, *acct_label;
+  char *message, *memo, *ddue_label, *post_label, *acct_label, *question_label;
   Account *acc = NULL;
   GList * acct_types = NULL;
   Timespec ddue, postdate;
+  gboolean accumulate;
 
   /* Make sure the invoice is ok */
   if (!gnc_invoice_window_verify_ok (iw))
@@ -563,6 +564,7 @@
   ddue_label = _("Due Date");
   post_label = _("Post Date");
   acct_label = _("Post to Account");
+  question_label = _("Accumulate Splits?");
 
   /* Determine the type of account to post to */
   acct_types = gnc_business_account_types (&(iw->owner));
@@ -572,10 +574,13 @@
   ddue = postdate;
   memo = NULL;
 
-  if (!gnc_dialog_dates_acct_parented (iw->dialog, message, ddue_label,
-				       post_label, acct_label, TRUE,
+  /* Get the default for the accumulate option */
+  accumulate = gnc_lookup_boolean_option("Business", "Accumulate splits on Post?", TRUE);
+
+  if (!gnc_dialog_dates_acct_question_parented (iw->dialog, message, ddue_label,
+				       post_label, acct_label, question_label, TRUE,
 				       acct_types, iw->book, iw->terms,
-				       &ddue, &postdate, &memo, &acc))
+				       &ddue, &postdate, &memo, &acc, &accumulate))
     return;
 
   /* Yep, we're posting.  So, save the invoice... 
@@ -587,7 +592,7 @@
   gnc_invoice_window_ok_save (iw);
 
   /* ... post it; post date is set to now ... */
-  gncInvoicePostToAccount (invoice, acc, &postdate, &ddue, memo);
+  gncInvoicePostToAccount (invoice, acc, &postdate, &ddue, memo, accumulate);
   gncInvoiceCommitEdit (invoice);
   gnc_resume_gui_refresh ();
 
diff -urw -x 'Make*' gnucash-1.8.9/src/business/business-gnome/glade/date-close.glade patchedgnucash/src/business/business-gnome/glade/date-close.glade
--- gnucash-1.8.9/src/business/business-gnome/glade/date-close.glade	2003-04-02 05:20:38.000000000 +0200
+++ patchedgnucash/src/business/business-gnome/glade/date-close.glade	2004-09-21 16:32:41.000000000 +0200
@@ -382,6 +382,23 @@
 	      <fill>False</fill>
 	    </child>
 	  </widget>
+
+	  <widget>
+	    <class>GtkLabel</class>
+	    <name>hide1</name>
+	    <label></label>
+	    <justify>GTK_JUSTIFY_RIGHT</justify>
+	    <wrap>False</wrap>
+	    <xalign>1</xalign>
+	    <yalign>0.5</yalign>
+	    <xpad>0</xpad>
+	    <ypad>0</ypad>
+	    <child>
+	      <padding>0</padding>
+	      <expand>False</expand>
+	      <fill>False</fill>
+	    </child>
+	  </widget>
 	</widget>
 
 	<widget>
@@ -457,6 +474,20 @@
 	      <class>Placeholder</class>
 	    </widget>
 	  </widget>
+
+	  <widget>
+	    <class>GtkCheckButton</class>
+	    <name>question_check</name>
+	    <can_focus>True</can_focus>
+	    <label>question</label>
+	    <active>False</active>
+	    <draw_indicator>True</draw_indicator>
+	    <child>
+	      <padding>0</padding>
+	      <expand>False</expand>
+	      <fill>False</fill>
+	    </child>
+	  </widget>
 	</widget>
 
 	<widget>
diff -urw -x 'Make*' gnucash-1.8.9/src/business/business-utils/business-prefs.scm patchedgnucash/src/business/business-utils/business-prefs.scm
--- gnucash-1.8.9/src/business/business-utils/business-prefs.scm	2003-05-25 03:23:25.000000000 +0200
+++ patchedgnucash/src/business/business-utils/business-prefs.scm	2004-09-21 20:37:43.000000000 +0200
@@ -44,6 +44,15 @@
 
 (gnc:register-configuration-option
  (gnc:make-simple-boolean-option
+  gnc:*business-label* (N_ "Accumulate splits on Post?")
+  "f0" (N_ (string-append
+	   "Whether multiple entries in an invoice which transfer to "
+	   "the same account should be accumulated into a single split by default."
+	   "This setting can be changed in the Post dialog."))
+  #t))
+
+(gnc:register-configuration-option
+ (gnc:make-simple-boolean-option
   gnc:*business-label* (N_ "Invoice Tax Included?")
   "f1" (N_ (string-append
 	   "Whether tax is included by default in entries on Invoices. "
-------------- next part --------------
Index: src/business/business-core/gncInvoice.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/business/business-core/gncInvoice.c,v
retrieving revision 1.92
diff -u -r1.92 gncInvoice.c
--- src/business/business-core/gncInvoice.c	19 Aug 2004 19:47:34 -0000	1.92
+++ src/business/business-core/gncInvoice.c	21 Sep 2004 19:10:11 -0000
@@ -612,6 +612,7 @@
   return invoice->active;
 }
 
+
 gnc_numeric gncInvoiceGetToChargeAmount (GncInvoice *invoice)
 {
   if (!invoice) return gnc_numeric_zero();
@@ -742,7 +743,7 @@
 
 Transaction * gncInvoicePostToAccount (GncInvoice *invoice, Account *acc,
 				       Timespec *post_date, Timespec *due_date,
-				       const char * memo)
+				       const char * memo, gboolean accumulatesplits)
 {
   Transaction *txn;
   GNCLot *lot = NULL;
@@ -853,7 +854,25 @@
 		gncEntryGetBillAccount (entry));
     if (this_acc) {
       if (gnc_numeric_check (value) == GNC_ERROR_OK) {
-	splitinfo = gncAccountValueAdd (splitinfo, this_acc, value);
+	if (accumulatesplits) {
+	    gncAccountValueAdd (splitinfo, this_acc, value);
+	} else {
+		Split *split;
+
+		split = xaccMallocSplit (invoice->book);
+		/* set action and memo? */
+
+		xaccSplitSetMemo (split, gncEntryGetDescription (entry));
+		xaccSplitSetAction (split, type);
+
+		xaccSplitSetBaseValue (split, (reverse ? gnc_numeric_neg (value)
+				: value),
+				 invoice->currency);
+       	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
 	 * payment type, the don't add it to the total, and instead
Index: src/business/business-core/gncInvoice.h
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/business/business-core/gncInvoice.h,v
retrieving revision 1.41
diff -u -r1.41 gncInvoice.h
--- src/business/business-core/gncInvoice.h	7 May 2004 05:11:49 -0000	1.41
+++ src/business/business-core/gncInvoice.h	21 Sep 2004 19:10:11 -0000
@@ -111,7 +111,7 @@
 Transaction *
 gncInvoicePostToAccount (GncInvoice *invoice, Account *acc,
 			 Timespec *posted_date, Timespec *due_date,
-			 const char *memo);
+			 const char *memo, gboolean accumulatesplits);
 
 /**
  * UNpost this invoice.  This will destroy the posted transaction and
Index: src/business/business-gnome/dialog-date-close.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/business/business-gnome/dialog-date-close.c,v
retrieving revision 1.17
diff -u -r1.17 dialog-date-close.c
--- src/business/business-gnome/dialog-date-close.c	23 Oct 2003 04:32:31 -0000	1.17
+++ src/business/business-gnome/dialog-date-close.c	21 Sep 2004 19:10:12 -0000
@@ -42,6 +42,7 @@
   GtkWidget *post_date;
   GtkWidget *acct_combo;
   GtkWidget *memo_entry;
+  GtkWidget *question_check;
   GncBillTerm *terms;
   Timespec *ts, *ts2;
   GList * acct_types;
@@ -49,6 +50,7 @@
   Account *acct;
   char **memo;
   gboolean retval;
+  gboolean answer;
 } DialogDateClose;
 
 static void
@@ -83,7 +85,8 @@
   if (ddc->memo_entry && ddc->memo)
     *(ddc->memo) = gtk_editable_get_chars (GTK_EDITABLE (ddc->memo_entry),
 					   0, -1);
-
+  if (ddc->question_check)
+	  ddc->answer = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(ddc->question_check));
   ddc->retval = TRUE;
   gnome_dialog_close (GNOME_DIALOG (ddc->dialog));
 }
@@ -226,16 +229,17 @@
 }
 
 gboolean
-gnc_dialog_dates_acct_parented (GtkWidget *parent, const char *message,
+gnc_dialog_dates_acct_question_parented (GtkWidget *parent, const char *message,
 				const char *ddue_label_message,
 				const char *post_label_message,
 				const char *acct_label_message,
+				const char *question_check_message,
 				gboolean ok_is_default,
 				GList * acct_types, GNCBook *book,
 				GncBillTerm *terms,
 				/* Returned Data... */
 				Timespec *ddue, Timespec *post,
-				char **memo, Account **acct)
+				char **memo, Account **acct, gboolean *answer)
 {
   DialogDateClose *ddc;
   GtkWidget *hbox;
@@ -248,6 +252,8 @@
   if (!message || !ddue_label_message || !post_label_message ||
       !acct_label_message || !acct_types || !book || !ddue || !post || !acct)
     return FALSE;
+  if (question_check_message && !answer)
+	  return FALSE;
 
   ddc = g_new0 (DialogDateClose, 1);
   ddc->ts = ddue;
@@ -274,6 +280,8 @@
   ddc->post_date = gnc_date_edit_new (time(NULL), FALSE, FALSE);
   gtk_box_pack_start (GTK_BOX(date_box), ddc->post_date, TRUE, TRUE, 0);
 
+  ddc->question_check = glade_xml_get_widget(xml, "question_check");
+  
   if (parent)
     gnome_dialog_set_parent (GNOME_DIALOG(ddc->dialog), GTK_WINDOW(parent));
 
@@ -287,6 +295,16 @@
   label = glade_xml_get_widget (xml, "acct_label");
   gtk_label_set_text (GTK_LABEL (label), acct_label_message);
 
+  if (question_check_message)
+  {
+	  gtk_label_set_text(GTK_LABEL(GTK_BIN(ddc->question_check)->child), question_check_message);
+	  gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(ddc->question_check), *answer);
+  } else {
+	  gtk_widget_hide(ddc->question_check);
+	  gtk_widget_hide(glade_xml_get_widget(xml, "hide1"));
+  }
+
+
   /* Set the post date widget */
   gnc_date_edit_set_time_ts (GNC_DATE_EDIT (ddc->post_date), *post);
 
@@ -319,6 +337,8 @@
 
   retval = ddc->retval;
   *acct = ddc->acct;
+  if (question_check_message)
+	  *answer = ddc->answer;
   g_free (ddc);
 
   return retval;
Index: src/business/business-gnome/dialog-date-close.h
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/business/business-gnome/dialog-date-close.h,v
retrieving revision 1.7
diff -u -r1.7 dialog-date-close.h
--- src/business/business-gnome/dialog-date-close.h	23 Oct 2003 04:32:31 -0000	1.7
+++ src/business/business-gnome/dialog-date-close.h	21 Sep 2004 19:10:12 -0000
@@ -44,16 +44,40 @@
  */
 
 gboolean
-gnc_dialog_dates_acct_parented (GtkWidget *parent, const char *message,
+gnc_dialog_dates_acct_question_parented (GtkWidget *parent, const char *message,
 				const char *ddue_label_message,
 				const char *post_label_message,
 				const char *acct_label_message,
+				const char *question_check_message,
 				gboolean ok_is_default,
 				GList * acct_types, GNCBook *book,
 				GncBillTerm *terms,
 				/* Returned Data... */
 				Timespec *ddue, Timespec *post,
-				char **memo, Account **acct);
+				char **memo, Account **acct, gboolean *answer);
+
+#define gnc_dialog_dates_acct_parented(parent, message,	\
+				ddue_label_message,							\
+				post_label_message,							\
+				acct_label_message,							\
+				ok_is_default,								\
+				acct_types, book,							\
+				terms,										\
+				/* Returned Data... */						\
+				ddue, post,									\
+				memo, acct)									\
+		gnc_dialog_dates_acct_question_parented (parent, message,	\
+				ddue_label_message,							\
+				post_label_message,							\
+				acct_label_message,							\
+				NULL,						\
+				ok_is_default,								\
+				acct_types, book,							\
+				terms,										\
+				/* Returned Data... */						\
+				ddue, post,									\
+				memo, acct, NULL)									\
+
 
 gboolean
 gnc_dialog_date_acct_parented (GtkWidget *parent, const char *message,
Index: src/business/business-gnome/dialog-invoice.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/business/business-gnome/dialog-invoice.c,v
retrieving revision 1.100
diff -u -r1.100 dialog-invoice.c
--- src/business/business-gnome/dialog-invoice.c	26 Jun 2004 14:52:12 -0000	1.100
+++ src/business/business-gnome/dialog-invoice.c	21 Sep 2004 19:10:14 -0000
@@ -616,10 +616,11 @@
 {
   InvoiceWindow *iw = data;
   GncInvoice *invoice;
-  char *message, *memo, *ddue_label, *post_label, *acct_label;
+  char *message, *memo, *ddue_label, *post_label, *acct_label, *question_label;
   Account *acc = NULL;
   GList * acct_types = NULL;
   Timespec ddue, postdate;
+  gboolean accumulate;
 
   /* Make sure the invoice is ok */
   if (!gnc_invoice_window_verify_ok (iw))
@@ -644,6 +645,7 @@
   ddue_label = _("Due Date");
   post_label = _("Post Date");
   acct_label = _("Post to Account");
+  question_label = _("Accumulate Splits?");
 
   /* Determine the type of account to post to */
   acct_types = gnc_business_account_types (&(iw->owner));
@@ -653,10 +655,13 @@
   ddue = postdate;
   memo = NULL;
 
-  if (!gnc_dialog_dates_acct_parented (iw->dialog, message, ddue_label,
-				       post_label, acct_label, TRUE,
+  /* Get the default for the accumulate option */
+  accumulate = gnc_lookup_boolean_option("Business", "Accumulate splits on Post?", TRUE);
+
+  if (!gnc_dialog_dates_acct_question_parented (iw->dialog, message, ddue_label,
+				       post_label, acct_label, question_label, TRUE,
 				       acct_types, iw->book, iw->terms,
-				       &ddue, &postdate, &memo, &acc))
+				       &ddue, &postdate, &memo, &acc, &accumulate))
     return;
 
   /* Yep, we're posting.  So, save the invoice... 
@@ -668,7 +673,7 @@
   gnc_invoice_window_ok_save (iw);
 
   /* ... post it; post date is set to now ... */
-  gncInvoicePostToAccount (invoice, acc, &postdate, &ddue, memo);
+  gncInvoicePostToAccount (invoice, acc, &postdate, &ddue, memo, accumulate);
   gncInvoiceCommitEdit (invoice);
   gnc_resume_gui_refresh ();
 
Index: src/business/business-gnome/glade/date-close.glade
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/business/business-gnome/glade/date-close.glade,v
retrieving revision 1.3
diff -u -r1.3 date-close.glade
--- src/business/business-gnome/glade/date-close.glade	2 Apr 2003 03:19:41 -0000	1.3
+++ src/business/business-gnome/glade/date-close.glade	21 Sep 2004 19:10:14 -0000
@@ -382,6 +382,23 @@
 	      <fill>False</fill>
 	    </child>
 	  </widget>
+
+	  <widget>
+	    <class>GtkLabel</class>
+	    <name>hide1</name>
+	    <label></label>
+	    <justify>GTK_JUSTIFY_RIGHT</justify>
+	    <wrap>False</wrap>
+	    <xalign>1</xalign>
+	    <yalign>0.5</yalign>
+	    <xpad>0</xpad>
+	    <ypad>0</ypad>
+	    <child>
+	      <padding>0</padding>
+	      <expand>False</expand>
+	      <fill>False</fill>
+	    </child>
+	  </widget>
 	</widget>
 
 	<widget>
@@ -457,6 +474,20 @@
 	      <class>Placeholder</class>
 	    </widget>
 	  </widget>
+
+	  <widget>
+	    <class>GtkCheckButton</class>
+	    <name>question_check</name>
+	    <can_focus>True</can_focus>
+	    <label>question</label>
+	    <active>False</active>
+	    <draw_indicator>True</draw_indicator>
+	    <child>
+	      <padding>0</padding>
+	      <expand>False</expand>
+	      <fill>False</fill>
+	    </child>
+	  </widget>
 	</widget>
 
 	<widget>
Index: src/business/business-utils/business-prefs.scm
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/business/business-utils/business-prefs.scm,v
retrieving revision 1.7
diff -u -r1.7 business-prefs.scm
--- src/business/business-utils/business-prefs.scm	23 Oct 2003 04:27:13 -0000	1.7
+++ src/business/business-utils/business-prefs.scm	21 Sep 2004 19:10:14 -0000
@@ -44,6 +44,15 @@
 
 (gnc:register-configuration-option
  (gnc:make-simple-boolean-option
+  gnc:*business-label* (N_ "Accumulate splits on Post?")
+  "f0" (N_ (string-append
+	   "Whether multiple entries in an invoice which transfer to "
+	   "the same account should be accumulated into a single split by default."
+	   "This setting can be changed in the Post dialog."))
+  #t))
+
+(gnc:register-configuration-option
+ (gnc:make-simple-boolean-option
   gnc:*business-label* (N_ "Invoice Tax Included?")
   "f1" (N_ (string-append
 	   "Whether tax is included by default in entries on Invoices. "


More information about the gnucash-patches mailing list