Fancy Invoice
Derek Atkins
warlord at MIT.EDU
Mon Feb 6 16:34:36 EST 2006
Quoting Brian <dol-sen at telus.net>:
> in the invoice options there is: (Partially modified code)
>
> (gnc:register-inv-option
> (gnc:make-text-option
> (N_ "Display") (N_ "Extra Notes")
> "u" (N_ "Extra notes to put on the invoice")
> ;; oli-custom - Extra notes to add on each invoice, invoice-independent
> ;; yes, I was too lazy to (get-company-name) ;)
> (string-append (_ "Make all cheques payable to: ") ;;c-name
> (_ "\nDirect all inquiries to: ")))) ;;c-contact)))
> ;;"Make all cheques payable to: Company Name Inc.\nDirect all
> inquiries to: Mr. Accounting Contact"))
>
> So far I've not been able to get the c-name & c-contact from the book.
> This module seems to run before the make-myname-table procedure. The
> book parameter is not accessible at this point. I have been far too
> busy this past 2 months to work on it and figure it out. Perhaps you or
> someone that is good at scheming could fix it easily.
Ahh... Okay, a little background. The report options are really just
a template. They are "outside" the book, and exist outside of it.
The templates exist (and are filled in) without access to a book,
so you cannot pull options from the book interface to put them into
the report options.
In other words, there really isn't a way to do what you want.. What you
CAN do is add two checkboxes to let the user decide whether to display the
"Direct all inquiries to: c-cname" and "Make all cheques payable to:
c-contact"
messages. Then you leave the two strings in the options (so the user
can re-define the message) but then you build the actual report based
on the checkbox, the contents of the option string, and the c-{name,contact}
during the invoice run.
Unfortunately there's just no way to seed c-contact and c-name in the options
creation because they exist outside the book setting.
> I'll finish cleaning it up and generate a patch. :)
-derek
--
Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
Member, MIT Student Information Processing Board (SIPB)
URL: http://web.mit.edu/warlord/ PP-ASEL-IA N1NWH
warlord at MIT.EDU PGP key available
More information about the gnucash-devel
mailing list