The output file can be imported into KOMA-Script-letters. This works primarily for germany. Internationalization welcome!
\code latex_invoice file://testfile \endcode will create file data.lco. \code latex –output-format=pdf Invoice.tex \endcode should run latex on file Invoice.tex and result in Invoice.pdf. Invoice.tex includes data.lco.
Additional information :
Finding information about the api can be difficult. So here some aditional sources:
- this project export gnucash to json (in a self invented method) https://github.com/cirrax/gnucash-toolset/tree/master/gnucashtoolset
- This is an api documentation, however I found inconsistencies with the current api I used: https://piecash.readthedocs.io/en/latest/tutorial/index_existing.html#other-objects
apt install texlive-latex-base texlive-latex-recommended python-gnucash texlive-lang-german pdflatex ipython
latex_invoices.py: scroll down to ‘def main’ and change input_url = ” to your gnucash connections (file, mysql, etc.) for MySQL it’s mysql://\<USERNAME>:\<PASSWORD>@\<SERVER>/\<DATABASE> Replace Benjamin_Franklein.pdf with your signature (source:https://commons.wikimedia.org/wiki/File:Autograph_of_Benjamin_Franklin.svg) adapt company.lco to fit your needs
- I got this from this repo. He also has a wiki in german mostly, so if you need help you could try and translate that.
- Main function as proposed by Guido van Rossum at http://www.artima.com/weblogs/viewpost.jsp?thread=4829
- Invoice.tex is derived from\n scrlttr2.tex v0.3. (c) by Juergen Fenn <[email protected]>\n http://www.komascript.de/node/355\n english translation: ftp://ftp.dante.de/tex-archive/info/templates/fenn/scrlttr2en.tex
- rechnung.sty\n from M G Berberich ([email protected]) and Ulrich Sibiller ([email protected]) Ver3.10 from http://www.forwiss.uni-passau.de/~berberic/TeX/Rechnung/index.html
- Propper localization
- get own contact data from gnucash
- have own bank information in footline
- nicer formatting of invoice date and date due
- is there anything else missing in this invoice ?
- Use jinja templates instead (for example): https://code.gnucash.org/docs/MASTER/gncinvoice__jinja_8py_source.html
- Python 3
- arg parse rather than not invented here
- We could maybe eventually try to merge this project with offertex (once I ported that to jinjia among other things)
- Invoice.tex\n
Example template file. Should be modified according to personal needs.
- rechnung.sty\n
style file for invoices.\n This file is not part of the python-bindings!\n For an example where to get it see section credits below.