Compare commits
2 Commits
e8c8085a07
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 3c571bd4f9 | |||
| 4d18d1f0a8 |
@@ -15,10 +15,11 @@ classifiers = [
|
||||
|
||||
|
||||
dependencies = [
|
||||
'PyYAML',
|
||||
'Jinja2',
|
||||
'xhtml2pdf',
|
||||
'Markdown'
|
||||
'PyYAML==6.0.1',
|
||||
'Jinja2==3.1.3',
|
||||
'xhtml2pdf==0.2.15',
|
||||
'Markdown==3.5.2',
|
||||
'python-bidi==0.4.2'
|
||||
]
|
||||
|
||||
[build-system]
|
||||
|
||||
@@ -2,3 +2,4 @@ Jinja2==3.1.3
|
||||
Markdown==3.5.2
|
||||
PyYAML==6.0.1
|
||||
xhtml2pdf==0.2.15
|
||||
python-bidi==0.4.2
|
||||
|
||||
17
test_data/templates/invoice.html
Normal file → Executable file
17
test_data/templates/invoice.html
Normal file → Executable file
@@ -146,6 +146,9 @@
|
||||
</head>
|
||||
|
||||
<body>
|
||||
{% macro format_number_de(value) -%}
|
||||
{{ "{:,.2f}".format(value|float).replace(",", "X").replace(".", ",").replace("X", ".") }}
|
||||
{%- endmacro %}
|
||||
<!-- Content for Static Frame 'header_frame' -->
|
||||
<div id="address_frame_content">
|
||||
<p class="underline small center">{{ envelope.AddressContent.AddressBoxSender }}</p>
|
||||
@@ -190,10 +193,10 @@
|
||||
{% for position in invoice.Positions %}
|
||||
<tr>
|
||||
<td class="links position_top">{{ position.Title }}</td>
|
||||
<td class="rechts" rowspan="2">{{ format_float(position.Quantity | float) }}</td>
|
||||
<td class="rechts" rowspan="2">{{ format_float((position.PricePerUnit or invoice.PricePerUnit) | float) }}
|
||||
<td class="rechts" rowspan="2">{{ format_number_de(position.Quantity) }}</td>
|
||||
<td class="rechts" rowspan="2">{{ format_number_de(position.PricePerUnit or invoice.PricePerUnit) }}
|
||||
</td>
|
||||
<td class="rechts" rowspan="2">{{ format_float(position.Quantity * ( position.PricePerUnit or
|
||||
<td class="rechts" rowspan="2">{{ format_number_de(position.Quantity * ( position.PricePerUnit or
|
||||
invoice.PricePerUnit ))}}
|
||||
</td>
|
||||
</tr>
|
||||
@@ -204,17 +207,17 @@
|
||||
<tr class="summe">
|
||||
<td></td>
|
||||
<td colspan="2" class="rechts">Nettosumme:</td>
|
||||
<td class="rechts">{{ format_float(calculate_total(invoice)) }}</td>
|
||||
<td class="rechts">{{ format_number_de(calculate_total(invoice)) }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td colspan="2" class="rechts">USt. ({{ format_float(invoice.Vat) }}%):</td>
|
||||
<td class="rechts">{{ format_float(calculate_total(invoice) * ((invoice.Vat / 100))) }}</td>
|
||||
<td colspan="2" class="rechts">USt. ({{ format_number_de(invoice.Vat) }}%):</td>
|
||||
<td class="rechts">{{ format_number_de(calculate_total(invoice) * ((invoice.Vat / 100))) }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td colspan="2" class="rechts bold overline">Gesamt Summe:</td>
|
||||
<td class="rechts bold overline">{{ format_float(calculate_total(invoice) * ((invoice.Vat / 100)+1)) }}</td>
|
||||
<td class="rechts bold overline">{{ format_number_de(calculate_total(invoice) * ((invoice.Vat / 100)+1)) }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</section>
|
||||
|
||||
Reference in New Issue
Block a user