mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
[invoice] Add customer/vendor ID in client section
This aims, but does not completely fixes bug 430259 or 742086 which would require data model changes. It upgrades invoice.scm to add the customer/vendor/employee internal ID. Job invoices will display the job owner's ID.
This commit is contained in:
parent
941acee04e
commit
ad361d1e69
@ -110,10 +110,10 @@
|
|||||||
(gnc:make-gnc-monetary currency numeric)))
|
(gnc:make-gnc-monetary currency numeric)))
|
||||||
|
|
||||||
(define layout-key-list
|
(define layout-key-list
|
||||||
(list (cons 'client (list (cons 'text "Client details")
|
(list (cons 'client (list (cons 'text (_ "Their details"))
|
||||||
(cons 'tip "Client name and address")))
|
(cons 'tip (_ "Client or vendor name, address and ID"))))
|
||||||
|
|
||||||
(cons 'company (list (cons 'text "Company details")
|
(cons 'company (list (cons 'text "Our details")
|
||||||
(cons 'tip "Company name, address and tax-ID")))
|
(cons 'tip "Company name, address and tax-ID")))
|
||||||
|
|
||||||
(cons 'invoice (list (cons 'text "Invoice details")
|
(cons 'invoice (list (cons 'text "Invoice details")
|
||||||
@ -333,6 +333,11 @@ for styling the invoice. Please see the exported report for the CSS class names.
|
|||||||
(N_ "Display") (N_ "Billing ID")
|
(N_ "Display") (N_ "Billing ID")
|
||||||
"ta" (N_ "Display the billing id?") #t))
|
"ta" (N_ "Display the billing id?") #t))
|
||||||
|
|
||||||
|
(gnc:register-inv-option
|
||||||
|
(gnc:make-simple-boolean-option
|
||||||
|
(N_ "Display") (N_ "Invoice owner ID")
|
||||||
|
"tam" (N_ "Display the customer/vendor id?") #f))
|
||||||
|
|
||||||
(gnc:register-inv-option
|
(gnc:register-inv-option
|
||||||
(gnc:make-simple-boolean-option
|
(gnc:make-simple-boolean-option
|
||||||
(N_ "Display") (N_ "Invoice Notes")
|
(N_ "Display") (N_ "Invoice Notes")
|
||||||
@ -669,7 +674,10 @@ for styling the invoice. Please see the exported report for the CSS class names.
|
|||||||
(gnc:make-html-text
|
(gnc:make-html-text
|
||||||
(gnc:html-markup-img img-url)))
|
(gnc:html-markup-img img-url)))
|
||||||
|
|
||||||
(define (make-client-table owner orders)
|
(define (make-client-table owner orders options)
|
||||||
|
(define (opt-val section name)
|
||||||
|
(gnc:option-value
|
||||||
|
(gnc:lookup-option options section name)))
|
||||||
;; this is a single-column table.
|
;; this is a single-column table.
|
||||||
(let ((table (gnc:make-html-table)))
|
(let ((table (gnc:make-html-table)))
|
||||||
|
|
||||||
@ -686,6 +694,14 @@ for styling the invoice. Please see the exported report for the CSS class names.
|
|||||||
(multiline-to-html-text
|
(multiline-to-html-text
|
||||||
(gnc:owner-get-address-dep owner)))))
|
(gnc:owner-get-address-dep owner)))))
|
||||||
|
|
||||||
|
(if (opt-val "Display" "Invoice owner ID")
|
||||||
|
(gnc:html-table-append-row! table
|
||||||
|
(list
|
||||||
|
(gnc:make-html-div/markup
|
||||||
|
"maybe-align-right client-id"
|
||||||
|
(multiline-to-html-text
|
||||||
|
(gnc:owner-get-owner-id owner))))))
|
||||||
|
|
||||||
(for-each
|
(for-each
|
||||||
(lambda (order)
|
(lambda (order)
|
||||||
(let ((reference (gncOrderGetReference order)))
|
(let ((reference (gncOrderGetReference order)))
|
||||||
@ -793,7 +809,8 @@ for styling the invoice. Please see the exported report for the CSS class names.
|
|||||||
invoice options)))
|
invoice options)))
|
||||||
(cons 'client (gnc:make-html-div/markup
|
(cons 'client (gnc:make-html-div/markup
|
||||||
"client-table"
|
"client-table"
|
||||||
(make-client-table owner orders)))
|
(make-client-table
|
||||||
|
owner orders options)))
|
||||||
(cons 'company (gnc:make-html-div/markup
|
(cons 'company (gnc:make-html-div/markup
|
||||||
"company-table"
|
"company-table"
|
||||||
(make-company-table book)))
|
(make-company-table book)))
|
||||||
|
Loading…
Reference in New Issue
Block a user