diff options
-rwxr-xr-x | lasku.py | 7 | ||||
-rw-r--r-- | template.tex | 2 |
2 files changed, 5 insertions, 4 deletions
@@ -1,6 +1,7 @@ #!/usr/bin/env python3 +import os import sys import yaml @@ -62,8 +63,6 @@ class Item: total_vat_cents = self['total_vat_cents'] total_cents = self['total_cents'] - debug(self.dict) - assert unit_net_cents * count == total_net_cents, \ '{} * {} != {}'.format(unit_net_cents, count, total_net_cents) @@ -123,7 +122,9 @@ def substitute_all(text, subst): return text -text = cat('template.tex') +dirname = os.path.dirname(__file__) +filename = os.path.join(dirname, 'template.tex') +text = cat(filename) with open(sys.argv[1]) as f: company = yaml.safe_load(f) diff --git a/template.tex b/template.tex index 5f1f4b6..1039e49 100644 --- a/template.tex +++ b/template.tex @@ -152,7 +152,7 @@ } & \parbox[t]{3.25cm}{ Viitenumero: {\tt \mbox{#invoicerefcode#}} \\ -% VAT: {\tt \mbox{#companyvat#}} + VAT: {\tt \mbox{#companyvat#}} } \\ \end{tabular} } |