dragotin / kraft

Kraft helps to handle your daily quotes and invoices in your small business.
http://volle-kraft-voraus.de
GNU General Public License v2.0
58 stars 18 forks source link

Looking for a list of available template variables #120

Open Moini opened 2 years ago

Moini commented 2 years ago

Hi again, @dragotin :)

Where can I find a complete list of all available template variables provided by kraft for the new, html-based template type?

I found https://volle-kraft-voraus.de/Main/TemplateVariables - but those look quite different from those used in, e.g. https://github.com/dragotin/kraft/blob/master/reports/invoice_kfg.gtmpl and https://github.com/dragotin/kraft/blob/master/reports/invoice.gtmpl .
Are the example files that are included 'complete', i.e. do they contain all available variables or are there any others hidden somewhere? How can I find those? (I'm fine with finding a list in the source code).

Of special interest to me: if a document is a follow-up document, I would like to have the numbers of the previous documents available.

Are they accessible as variables (i.e. in an order confirmation (Auftragsbestätigung), can I access the offer number (Angebotsnummer))?

dragotin commented 2 years ago

Indeed the predecessor number was not yet added to the weasyprint template variables. Done in commit 41e10028cce5d9c3a9009687dbb68cab180b8c9d

Keeping this open for the list of available variables.

dragotin commented 2 years ago

Meanwhile, here are pointers to the sources which variables exist:

Document attributes: https://github.com/dragotin/kraft/blob/master/src/archdoc.h#L75 Item attributes and sums: https://github.com/dragotin/kraft/blob/master/src/archdocposition.h#L105 Translated labels: https://github.com/dragotin/kraft/blob/master/src/documenttemplate.cpp#L112

Not very convenient, but maybe that helps you out for now ;-)

Thanks for your reports!

Moini commented 2 years ago

Thank you very much, that will help a lot!