gnucash unstable: Multiple changes pushed

John Ralls jralls at code.gnucash.org
Fri Mar 30 18:50:13 EDT 2018


Updated	 via  https://github.com/Gnucash/gnucash/commit/f910d931 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/b99dee17 (commit)
	from  https://github.com/Gnucash/gnucash/commit/4601cfcb (commit)



commit f910d931f74b2628ee9192cb3e23494a9b1e52f9
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Sat Mar 31 05:32:37 2018 +0800

    gncInvoice: complete removal gncInvoiceDateExists

diff --git a/libgnucash/engine/gncInvoice.c b/libgnucash/engine/gncInvoice.c
index 6d26a57..35b7f9f 100644
--- a/libgnucash/engine/gncInvoice.c
+++ b/libgnucash/engine/gncInvoice.c
@@ -1856,14 +1856,6 @@ gncInvoiceApplyPayment (const GncInvoice *invoice, Transaction *txn,
     gncOwnerAutoApplyPaymentsWithLots (owner, selected_lots);
 }
 
-static gboolean gncInvoiceDateExists (time64 date)
-{
-/* Going forward we want to use INT64_MAX to indicate "no date", but for
- * backward compatibility we need to treat 0 as no date as well.
- */
-    return (date != INT64_MAX && date !=0);
-}
-
 gboolean gncInvoiceIsPosted (const GncInvoice *invoice)
 {
     if (!invoice) return FALSE;

commit b99dee17361be2ca02d107b141d823c9322c668c
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Sat Mar 31 05:26:36 2018 +0800

    Replace gncInvoiceDateExists to gncInvoiceIsPosted
    
    This commit partially reverts commit 862956a7609 which exported
    gncInvoiceDateExists. Remove this API and use gncInvoiceIsPosted
    instead.

diff --git a/gnucash/report/business-reports/job-report.scm b/gnucash/report/business-reports/job-report.scm
index 260d02a..b377f94 100644
--- a/gnucash/report/business-reports/job-report.scm
+++ b/gnucash/report/business-reports/job-report.scm
@@ -191,10 +191,9 @@
 	(addto! row-contents (qof-print-date date)))
     (if (date-due-col column-vector)
 	(addto! row-contents 
-		(if (and due-date
-			 (gncInvoiceDateExists due-date))
-		    (qof-print-date due-date)
-		    "")))
+                (if due-date
+                    (qof-print-date due-date)
+                    "")))
     (if (num-col column-vector)
 	(addto! row-contents num))
     (if (type-col column-vector)
@@ -264,8 +263,9 @@
 	  (set! printed? (add-balance-row table column-vector txn odd-row? printed? start-date total))
 	  
 	  ; Now print out the invoice row
-	  (if (not (null? invoice))
-	      (set! due-date (gncInvoiceGetDateDue invoice)))
+          (if (and (not (null? invoice))
+                   (gncInvoiceIsPosted invoice))
+              (set! due-date (gncInvoiceGetDateDue invoice)))
 
 	  (let ((row (make-row column-vector date due-date (gnc-get-num-action txn split)
 			       type-str (xaccSplitGetMemo split)
diff --git a/gnucash/report/business-reports/owner-report.scm b/gnucash/report/business-reports/owner-report.scm
index 972cbb4..39010d5 100644
--- a/gnucash/report/business-reports/owner-report.scm
+++ b/gnucash/report/business-reports/owner-report.scm
@@ -290,8 +290,7 @@
         (addto! row-contents (qof-print-date date)))
     (if (date-due-col column-vector)
         (addto! row-contents 
-         (if (and due-date
-                  (gncInvoiceDateExists due-date))
+         (if due-date
              (qof-print-date due-date)
              "")))
     (if (num-col column-vector)
@@ -382,7 +381,8 @@
       ; Now print out the invoice row
       (if (not (null? invoice))
         (begin
-          (set! due-date (gncInvoiceGetDateDue invoice))
+          (set! due-date (and (gncInvoiceIsPosted invoice)
+                              (gncInvoiceGetDateDue invoice)))
           (set! sale (gncInvoiceGetTotalSubtotal invoice))
           (set! tax (gncInvoiceGetTotalTax invoice))))
 
diff --git a/gnucash/report/business-reports/taxinvoice.eguile.scm b/gnucash/report/business-reports/taxinvoice.eguile.scm
index 8e359b5..a76fd50 100644
--- a/gnucash/report/business-reports/taxinvoice.eguile.scm
+++ b/gnucash/report/business-reports/taxinvoice.eguile.scm
@@ -36,6 +36,7 @@
            (invoiceid    (gncInvoiceGetID         opt-invoice))
            (credit-note? (gncInvoiceGetIsCreditNote opt-invoice))
            (book         (gncInvoiceGetBook       opt-invoice))
+           (isposted     (gncInvoiceIsPosted      opt-invoice))
            (postdate     (gncInvoiceGetDatePosted opt-invoice))
            (duedate      (gncInvoiceGetDateDue    opt-invoice))
            (billingid    (gncInvoiceGetBillingID  opt-invoice))
@@ -246,7 +247,7 @@
         <td align="right" class="invnum"><big><strong><?scm:d invoiceid ?></strong></big></td>
       </tr>
       <?scm )) ?>
-      <?scm (if (not (gncInvoiceDateExists postdate)) (begin ?>
+      <?scm (if (not isposted) (begin ?>
         <tr>
            <td colspan="2" align="right"><?scm:d (_ "Invoice in progress...") ?></td>
         </tr>
diff --git a/libgnucash/engine/gncInvoice.c b/libgnucash/engine/gncInvoice.c
index 6bbbd11..6d26a57 100644
--- a/libgnucash/engine/gncInvoice.c
+++ b/libgnucash/engine/gncInvoice.c
@@ -1856,7 +1856,7 @@ gncInvoiceApplyPayment (const GncInvoice *invoice, Transaction *txn,
     gncOwnerAutoApplyPaymentsWithLots (owner, selected_lots);
 }
 
-gboolean gncInvoiceDateExists (time64 date)
+static gboolean gncInvoiceDateExists (time64 date)
 {
 /* Going forward we want to use INT64_MAX to indicate "no date", but for
  * backward compatibility we need to treat 0 as no date as well.
diff --git a/libgnucash/engine/gncInvoice.h b/libgnucash/engine/gncInvoice.h
index befef4e..1b5b65a 100644
--- a/libgnucash/engine/gncInvoice.h
+++ b/libgnucash/engine/gncInvoice.h
@@ -275,7 +275,6 @@ static inline GncInvoice * gncInvoiceLookup (const QofBook *book, const GncGUID
 void gncInvoiceBeginEdit (GncInvoice *invoice);
 void gncInvoiceCommitEdit (GncInvoice *invoice);
 int gncInvoiceCompare (const GncInvoice *a, const GncInvoice *b);
-gboolean gncInvoiceDateExists (time64 date);
 gboolean gncInvoiceIsPosted (const GncInvoice *invoice);
 gboolean gncInvoiceIsPaid (const GncInvoice *invoice);
 



Summary of changes:
 gnucash/report/business-reports/job-report.scm        | 12 ++++++------
 gnucash/report/business-reports/owner-report.scm      |  6 +++---
 gnucash/report/business-reports/taxinvoice.eguile.scm |  3 ++-
 libgnucash/engine/gncInvoice.c                        |  8 --------
 libgnucash/engine/gncInvoice.h                        |  1 -
 5 files changed, 11 insertions(+), 19 deletions(-)



More information about the gnucash-changes mailing list