[GNC] Custom invoices don't work after upgrade
lomax at clickworkorange.com
lomax at clickworkorange.com
Thu Jul 2 11:01:10 EDT 2020
On Thu, 2020-07-02 at 13:32 +0100, lomax at clickworkorange.com wrote:
> My custom invoice template that I've used for many years stopped
> working after upgrading to 3.4 as part of a dist-upgrade. I had to
> remove a few things such as
>
> (use-modules (gnucash gnc-module))
> (use-modules (gnucash printf))
>
> in order for the template to compile, but I now get
>
> Unbound variable: qof-book-get-slots
> In ice-9/boot-9.scm:
> 829:9 4 (catch _ _ # _)
> In eguile-gnc.scm:
> 187:6 3 (eval-input)
> 187:6 2 (lp)
> 191:13 1 (loop)
> In ice-9/eval.scm:
> 619:8 0 (_ #(#(#(#(#) # …) …) …))
>
> when opening it in gnucash. My template does not contain any use of
> qof-book-get-slots. The closest I have is (define (coy-info slots
> key)
> but removing this block of company info makes no difference. I'm a
> little desperate as a client has just approved my fees for the first
> job I've had since Covid-19 struck and really need to get my invoice
> out today. It's a little frustrating that the templating API keeps
> changing - I think this is the third time I've upgraded gnucash only
> to
> find I have to spend lots of time "fixing" my invoice template.
> Please
> help!
I went through my template looking at every instance of "key", "qof",
"coy" and similar, and commented out the only bits I could find which
seemed even remotely relevant:
; (define (coy-info slots key)
; ;; Extract a value from the company info key-value pairs
; (kvp-frame-get-slot-path-gslist
; slots
; (append gnc:*kvp-option-path* (list gnc:*business-label*
key))))
and
; (add-option (gnc:make-text-option notespage optname-extra-css "b"
; (N_ "Embedded CSS.") "h1.coyname { text-align:
left;}"))
That got rid of the earlier error message, but I'm not sure if this
brought me closer to getting paid or not, because the report now
explodes with
16 (apply-smob/1 #<catch-closure 55f113765c60>)
In c-interface.scm:
22:4 15 (gnc:call-with-error-handling _ _)
In ice-9/boot-9.scm:
829:9 14 (catch #t #<procedure 55f114e07630 at c-
interface.scm:23:8 ()> #<procedure 55f114e108c0 at c-
interface.scm:31:8 (key . parameters)> _)
In c-interface.scm:
29:29 13 (_)
In unknown file:
12 (eval-string "(gnc:report-run 2)" #<undefined>)
In ice-9/boot-9.scm:
2312:4 11 (save-module-excursion #<procedure 55f114e10820 at ice-
9/eval-string.scm:66:9 ()>)
In ice-9/eval-string.scm:
38:6 10 (read-and-eval #<input: string 55f114e0dcb0> #:lang _)
In report.scm:
830:4 9 (gnc:report-run _)
In c-interface.scm:
70:23 8 (gnc:backtrace-if-exception _ . _)
22:4 7 (gnc:call-with-error-handling _ _)
In ice-9/boot-9.scm:
829:9 6 (catch #t #<procedure 55f114e075a0 at c-
interface.scm:23:8 ()> #<procedure 55f114e10660 at c-
interface.scm:31:8 (key . parameters)> _)
In c-interface.scm:
27:29 5 (_)
In report.scm:
834:24 4 (_)
807:34 3 (gnc:report-render-html #<<report> type:
6e28a7d672124a8a854a668434f02c7 id: 2 options: #<procedure dispatch
(key)> dirty?: #t needs-save?: #t editor-w…> …)
In /home/me/.config/gnucash/my-invoice.scm:
310:36 2 (report-renderer _)
In options.scm:
144:16 1 (gnc:option-value _)
113:2 0 (gnc:option-getter _)
In procedure vector-ref: Wrong type argument in position 1
(expecting vector): #f
If possible an even more indecipherable exception "In procedure vector-
ref: Wrong type argument in position 1 (expecting vector): #f" I cannot
see a vector-ref anywhere in my template, but I do have this block at
the end:
(gnc:define-report
'version 1
'name (N_ "My Invoice")
'report-guid "6e28a7d672124a8a854a668434f02c7"
'menu-name (N_ "My Invoice")
'menu-tip (N_ "Display a customer invoice in my style")
'menu-path (list gnc:menuname-business-reports)
'options-generator options-generator
'renderer report-renderer)
I have compared this with the shipped reports (e.g. taxinvoice.scm) and
it looks correct. So, a few hours killed, no progress. Any suggestions?
More information about the gnucash-user
mailing list