Use the Book-KVP-Options for the Company Name and Company Address in

the PrintInvoice, Customer, and Vendor reports.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@7100 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Derek Atkins 2002-07-08 16:32:47 +00:00
parent 066484edb3
commit 4b71c08cb8
2 changed files with 39 additions and 38 deletions

View File

@ -516,8 +516,16 @@
'attribute (list "valign" "top")) 'attribute (list "valign" "top"))
table)) table))
(define (make-myname-table date-format) (define (make-myname-table book date-format)
(let ((table (gnc:make-html-table))) (let* ((table (gnc:make-html-table))
(slots (gnc:book-get-slots book))
(name (gnc:kvp-frame-get-slot-path
slots (append gnc:*kvp-option-path*
(list gnc:*business-label* gnc:*company-name*))))
(addy (gnc:kvp-frame-get-slot-path
slots (append gnc:*kvp-option-path*
(list gnc:*business-label* gnc:*company-addy*)))))
(gnc:html-table-set-style! (gnc:html-table-set-style!
table "table" table "table"
'attribute (list "border" 0) 'attribute (list "border" 0)
@ -525,21 +533,12 @@
'attribute (list "valign" "top") 'attribute (list "valign" "top")
'attribute (list "cellspacing" 0) 'attribute (list "cellspacing" 0)
'attribute (list "cellpadding" 0)) 'attribute (list "cellpadding" 0))
(gnc:html-table-append-row! (gnc:html-table-append-row! table (list (if name name "")))
table (gnc:html-table-append-row! table (list (string-expand
(list (if addy addy "")
(gnc:option-value #\newline "<br>")))
(gnc:lookup-global-option "User Info" "User Name")))) (gnc:html-table-append-row! table (list (date->string (current-date)
(gnc:html-table-append-row! date-format)))
table
(list
(string-expand
(gnc:option-value
(gnc:lookup-global-option "User Info" "User Address"))
#\newline "<br>")))
(gnc:html-table-append-row!
table
(list (date->string (current-date) date-format)))
table)) table))
(define (make-break! document) (define (make-break! document)
@ -574,7 +573,7 @@
(gnc:html-document-set-title! document title) (gnc:html-document-set-title! document title)
(if invoice (if invoice
(begin (let ((book (gnc:invoice-get-book invoice)))
(set! table (make-entry-table invoice (set! table (make-entry-table invoice
(gnc:report-options report-obj) (gnc:report-options report-obj)
add-order)) add-order))
@ -587,7 +586,7 @@
(gnc:html-document-add-object! (gnc:html-document-add-object!
document document
(make-myname-table (opt-val "Display" "Today Date Format"))) (make-myname-table book (opt-val "Display" "Today Date Format")))
(let ((date-table #f) (let ((date-table #f)
(post-date (gnc:invoice-get-date-posted invoice)) (post-date (gnc:invoice-get-date-posted invoice))

View File

@ -388,8 +388,16 @@
'attribute (list "valign" "top")) 'attribute (list "valign" "top"))
table)) table))
(define (make-myname-table date-format) (define (make-myname-table book date-format)
(let ((table (gnc:make-html-table))) (let* ((table (gnc:make-html-table))
(slots (gnc:book-get-slots book))
(name (gnc:kvp-frame-get-slot-path
slots (append gnc:*kvp-option-path*
(list gnc:*business-label* gnc:*company-name*))))
(addy (gnc:kvp-frame-get-slot-path
slots (append gnc:*kvp-option-path*
(list gnc:*business-label* gnc:*company-addy*)))))
(gnc:html-table-set-style! (gnc:html-table-set-style!
table "table" table "table"
'attribute (list "border" 0) 'attribute (list "border" 0)
@ -397,21 +405,14 @@
'attribute (list "valign" "top") 'attribute (list "valign" "top")
'attribute (list "cellspacing" 0) 'attribute (list "cellspacing" 0)
'attribute (list "cellpadding" 0)) 'attribute (list "cellpadding" 0))
(gnc:html-table-append-row!
table (gnc:html-table-append-row! table (list (if name name "")))
(list (gnc:html-table-append-row! table (list (string-expand
(gnc:option-value (if addy addy "")
(gnc:lookup-global-option "User Info" "User Name")))) #\newline "<br>")))
(gnc:html-table-append-row! (gnc:html-table-append-row! table
table (list (date->string (current-date)
(list date-format)))
(string-expand
(gnc:option-value
(gnc:lookup-global-option "User Info" "User Address"))
#\newline "<br>")))
(gnc:html-table-append-row!
table
(list (date->string (current-date) date-format)))
table)) table))
(define (make-break! document) (define (make-break! document)
@ -435,7 +436,8 @@
(report-date (gnc:timepair-end-day-time (report-date (gnc:timepair-end-day-time
(gnc:date-option-absolute-time (gnc:date-option-absolute-time
(opt-val gnc:pagename-general (N_ "To"))))) (opt-val gnc:pagename-general (N_ "To")))))
(title #f)) (title #f)
(book (gnc:get-current-book))) ;XXX Grab this from elsewhere
(if (not (null? account-list)) (if (not (null? account-list))
(set! account (car account-list))) (set! account (car account-list)))
@ -479,7 +481,7 @@
(gnc:html-document-add-object! (gnc:html-document-add-object!
document document
(make-myname-table (opt-val gnc:pagename-general (N_ "Today Date Format")))) (make-myname-table book (opt-val gnc:pagename-general (N_ "Today Date Format"))))
(gnc:html-document-add-object! (gnc:html-document-add-object!
document document