|
|
|
@@ -179,11 +179,16 @@ class Application: |
|
|
|
|
|
|
|
log.debug("Creating TeX invoice...") |
|
|
|
self._check_path(self.tmp_path) |
|
|
|
|
|
|
|
format_decimal=lambda x: '{:20,.2f}'.format(x).replace(',', '\\,').replace('.', ',') |
|
|
|
format_eur=lambda x: format_decimal(x) + ' EUR' |
|
|
|
|
|
|
|
result = tempita.Template(open(tex_template).read()).substitute( |
|
|
|
invoice=invoice_data, |
|
|
|
issuer=issuer_data, |
|
|
|
customer=customer_data, |
|
|
|
eur=lambda x: '{:20,.2f} EUR'.format(x).replace(',', '\\,').replace('.', ',')) |
|
|
|
decimal=format_decimal, |
|
|
|
eur=format_eur) |
|
|
|
open(tex_file, "w").write(str(result)) |
|
|
|
assert(os.path.exists(tex_file)) |
|
|
|
|
|
|
|
|