Skip to content

Commit

Permalink
[register] remove dead utility and invoice code
Browse files Browse the repository at this point in the history
  • Loading branch information
christopherlam committed Feb 22, 2019
1 parent b96e48f commit 83d5c21
Showing 1 changed file with 8 additions and 69 deletions.
77 changes: 8 additions & 69 deletions gnucash/report/standard-reports/register.scm
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,8 @@
(set-col (opt-val "Display" "Shares") 5)
(set-col (opt-val "Display" "Lot") 14)
(set-col (opt-val "Display" "Price") 6)
(let ((invoice? #f)
(amount-setting (opt-val "Display" "Amount")))
(if (or invoice? (eq? amount-setting 'single))
(let ((amount-setting (opt-val "Display" "Amount")))
(if (eq? amount-setting 'single)
(set-col #t 7)
(begin
(set-col #t 8)
Expand Down Expand Up @@ -486,8 +485,6 @@
(opt-val "__reg" "ledger-type"))
(define (reg-report-double?)
(opt-val "__reg" "double"))
(define (reg-report-invoice?)
#f)
(define (reg-report-show-totals?)
(opt-val "Display" "Totals"))

Expand Down Expand Up @@ -523,13 +520,12 @@

(if (or single-col credit-col debit-col)
(begin
(if (not (reg-report-invoice?))
(gnc:html-table-append-row!
table
(list
(gnc:make-html-table-cell/size
1 (num-columns-required used-columns)
(gnc:make-html-text (gnc:html-markup-hr))))))
(gnc:html-table-append-row!
table
(list
(gnc:make-html-table-cell/size
1 (num-columns-required used-columns)
(gnc:make-html-text (gnc:html-markup-hr)))))

(for-each (lambda (currency)
(gnc:html-table-append-row/markup!
Expand Down Expand Up @@ -750,63 +746,6 @@
(gnc:make-commodity-collector)
(gnc:make-commodity-collector))
table))
;; -----------------------------------------------------------------
;; misc
;; -----------------------------------------------------------------
(define (string-expand string character replace-string)
(define (car-line chars)
(take-while (lambda (c) (not (eqv? c character))) chars))
(define (cdr-line chars)
(let ((rest (drop-while (lambda (c) (not (eqv? c character))) chars)))
(if (null? rest)
'()
(cdr rest))))
(define (line-helper chars)
(if (null? chars)
""
(let ((first (car-line chars))
(rest (cdr-line chars)))
(string-append (list->string first)
(if (null? rest) "" replace-string)
(line-helper rest)))))
(line-helper (string->list string)))

(define (make-client-table address)
(let ((table (gnc:make-html-table)))
(gnc:html-table-set-style!
table "table"
'attribute (list "border" 0)
'attribute (list "cellspacing" 0)
'attribute (list "cellpadding" 0))
(gnc:html-table-append-row!
table
(list
(string-append (_ "Client") ": ")
(string-expand address #\newline "<br>")))
(gnc:html-table-set-last-row-style!
table "td"
'attribute (list "valign" "top"))
table))

(define (make-info-table address)
(let ((table (gnc:make-html-table)))
(gnc:html-table-set-style!
table "table"
'attribute (list "border" 0)
'attribute (list "cellspacing" 20)
'attribute (list "cellpadding" 0))
(gnc:html-table-append-row!
table
(list
(string-append
(_ "Date") ":&nbsp;"
(string-expand (qof-print-date (current-time))
#\space "&nbsp;"))
(make-client-table address)))
(gnc:html-table-set-last-row-style!
table "td"
'attribute (list "valign" "top"))
table))

(define (reg-renderer report-obj)
(define (opt-val section name)
Expand Down

0 comments on commit 83d5c21

Please sign in to comment.