gnucash maint: [receipt] remove dead code

Christopher Lam clam at code.gnucash.org
Mon Apr 20 08:27:56 EDT 2020


Updated	 via  https://github.com/Gnucash/gnucash/commit/bbee48ce (commit)
	from  https://github.com/Gnucash/gnucash/commit/8913e932 (commit)



commit bbee48cec4f15b396fe7f0578a0c64c80793aeb5
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Sun Apr 5 21:05:15 2020 +0800

    [receipt] remove dead code
    
    * taxrate in unused; it was copied as-is from taxinvoice.scm
    * customers-only has never been in use

diff --git a/gnucash/report/business-reports/receipt.scm b/gnucash/report/business-reports/receipt.scm
index f51b583ec..c57343c62 100644
--- a/gnucash/report/business-reports/receipt.scm
+++ b/gnucash/report/business-reports/receipt.scm
@@ -34,38 +34,6 @@
 (use-modules (srfi srfi-13)) ; for extra string functions
 (use-modules (ice-9 format)) ; for number formatting
 
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;; Report-specific routines
-
-(define (taxrate taxable taxtable curr)
-  ;; Display the tax rate applicable to an invoice line.
-  ;; This may be e.g. "15%" or "£5.00" or "15% + £5.00" or "n/a"
-  ;; depending on how complicated the tax table is.
-  ;; (When called from within the eguile template, anything
-  ;; (display)ed becomes part of the HTML string.)
-  (if (or (not taxable) (eq? taxtable '()))
-    (display " ")
-    (let* ((amttot  (gnc:make-commodity-collector))
-           (pctot   (gnc:make-value-collector))
-           (entries (gncTaxTableGetEntries taxtable))
-           (amt?    #f)  ; becomes #t if any entries are amounts
-           (pc?     #f)) ; becomes #t if any entries are percentages
-      (for entry in entries do
-          (let ((tttype (gncTaxTableEntryGetType   entry))
-                (ttamt  (gncTaxTableEntryGetAmount entry)))
-            (if (equal? tttype GNC-AMT-TYPE-VALUE)
-              (begin
-                (set! amt? #t)
-                (amttot 'add curr ttamt))
-              (begin
-                (set! pc? #t)
-                (pctot 'add ttamt)))))
-      (if pc? (begin (display (fmtnumeric (pctot 'total #f))) (display "%")))
-      (if (and amt? pc?) (display " + "))        ; both - this seems unlikely in practice
-      (if amt?
-        (display-comm-coll-total amttot #f))
-      (if (and (not amt?) (not pc?)) (display (_ "n/a"))))))        ; neither
-
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Define all the options
 
@@ -102,20 +70,6 @@
 (define optname-extra-notes    (N_ "Extra notes"))
 (define optname-date-format    (N_ "Today date format"))
 
-; Choose only customer invoices
-; (This doesn't work very nicely -- all invoices and bills
-;  are offered for selection, but if a non-customer invoice
-;  is selected, the user is dumped back to viewing the
-;  previous invoice (or none) with no error message)
-(define (customers-only invoice)
-  (let* ((owner     (gncInvoiceGetOwner  invoice))
-         (endowner  (gncOwnerGetEndOwner owner))
-         (ownertype (gncOwnerGetType     endowner)))
-    ;(gnc:debug "ownertype is ")(gnc:debug ownertype)
-    (if (eqv? ownertype GNC-OWNER-CUSTOMER)
-      (list #t invoice)
-      (list #f invoice))))
-
 (define (options-generator)
   ;; Options
   (define report-options (gnc:new-options))
@@ -125,8 +79,7 @@
   (add-option
     (gnc:make-invoice-option ; defined in gnucash/scm/business-options.scm
       generalpage optname-invoice-number
-      "a" "" (lambda () '())
-      #f))        ;customers-only)) ;-- see above
+      "a" "" (lambda () '()) #f))
 
   ;; Display options
   (add-option (gnc:make-string-option displaypage optname-template-file "a"



Summary of changes:
 gnucash/report/business-reports/receipt.scm | 49 +----------------------------
 1 file changed, 1 insertion(+), 48 deletions(-)



More information about the gnucash-changes mailing list