Skip to content
Snippets Groups Projects
Commit 5b0f3345 authored by Tom Teichler's avatar Tom Teichler :beers:
Browse files

Merge branch 'fix-invoice-view' into sepaxml

parents 8220c85f 7d4387f9
No related branches found
No related tags found
1 merge request!16Sepaxml
Pipeline #82370 failed
......@@ -157,19 +157,20 @@ class Invoice(BasePayment, PureDjangoModel):
@property
def totals_table(self):
tax_amounts = {}
for item in self.get_purchased_items():
tax_amounts.setdefault(item.tax_rate, 0)
tax_amounts[item.tax_rate] += item.price * item.tax_rate / 100
values = []
for tax_rate, total in tax_amounts.items():
values.append(
{
"name": _("VAT {} %").format(tax_rate),
"value": total,
"currency": self.currency,
}
)
if self.for_object:
for item in self.get_purchased_items():
tax_amounts.setdefault(item.tax_rate, 0)
tax_amounts[item.tax_rate] += item.price * item.tax_rate / 100
for tax_rate, total in tax_amounts.items():
values.append(
{
"name": _("VAT {} %").format(tax_rate),
"value": total,
"currency": self.currency,
}
)
values.append(
{
......
......@@ -112,7 +112,9 @@
</div>
{% if can_view_purchased_items %}
{% render_table object.purchased_items_table %}
{% if object.for_object %}
{% render_table object.purchased_items_table %}
{% endif %}
{% render_table object.totals_table %}
{% endif %}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment