mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
[invoice.scm] add qrcode section
This commit is contained in:
parent
b881e85d4e
commit
80baf53bf1
@ -188,5 +188,7 @@
|
||||
"td.centered-label-cell { text-align: center; " centered-label-cell-info " }\n"
|
||||
"sub { top: 0.4em; }\n"
|
||||
"sub, sup { vertical-align: baseline; position: relative; top: -0.4em; }\n"
|
||||
".qr-code-error { color: white; background-color: red }\n"
|
||||
"@media print { .qr-code-error { display:none; }}\n"
|
||||
"@media print { html, body { height: unset; }}\n"
|
||||
(or (gnc:html-document-style-text doc) "")))))
|
||||
|
@ -295,6 +295,18 @@ for styling the invoice. Please see the exported report for the CSS class names.
|
||||
"u" (N_ "Extra notes to put on the invoice.")
|
||||
(G_ "Thank you for your patronage!"))
|
||||
|
||||
(gnc-register-multichoice-callback-option
|
||||
options
|
||||
(N_ "Display") (N_ "QR Code")
|
||||
"te" "QR Code"
|
||||
"none"
|
||||
(list
|
||||
(vector 'none (N_ "None") (N_ "None"))
|
||||
(vector 'epc (N_ "EPC QR Code") (N_ "EPC QR Code")))
|
||||
(lambda _
|
||||
(gnc-optiondb-set-option-selectable-by-name
|
||||
options "Display" "QR Code" (gnc-qrcode-available))))
|
||||
|
||||
(gnc-register-multichoice-option options
|
||||
(N_ "Layout") (N_ "Row 1 Left")
|
||||
"1a" "1st row, left"
|
||||
@ -738,6 +750,7 @@ for styling the invoice. Please see the exported report for the CSS class names.
|
||||
(else
|
||||
(G_ "Invoice"))))
|
||||
(title (if (string-null? custom-title) default-title custom-title))
|
||||
(opt-qrcode (opt-val "Display" "QR Code"))
|
||||
;; Translators: This is the format of the invoice
|
||||
;; title. The first ~a is one of "Invoice", "Credit
|
||||
;; Note", and so on and the second the number. Replace
|
||||
@ -828,6 +841,17 @@ for styling the invoice. Please see the exported report for the CSS class names.
|
||||
(multiline-to-html-text
|
||||
(string-append contact-str ": " contact)))))))
|
||||
|
||||
(cond
|
||||
((eq? opt-qrcode 'none) #f)
|
||||
((not (gnc-qrcode-available))
|
||||
(gnc:warn "invoice QR: libqrencode not available"))
|
||||
((eq? opt-qrcode 'epc)
|
||||
(gnc:html-table-append-row!
|
||||
main-table
|
||||
(gnc:make-html-table-cell/size
|
||||
1 2 (apply gnc:make-html-div/markup (gnc:make-epc-qrcode invoice)))))
|
||||
(else (gnc:warn "QR option invalid")))
|
||||
|
||||
(gnc:html-table-append-row! main-table
|
||||
(gnc:make-html-table-cell/size
|
||||
1 2 (gnc:make-html-div/markup
|
||||
|
Loading…
Reference in New Issue
Block a user