diff --git a/src/Invoice/InvoiceModel.php b/src/Invoice/InvoiceModel.php index 26838b48..1c2d650c 100644 --- a/src/Invoice/InvoiceModel.php +++ b/src/Invoice/InvoiceModel.php @@ -77,6 +77,10 @@ final class InvoiceModel * @var string */ private $invoiceNumber; + /** + * @var bool + */ + private $hideZeroTax = false; /** * @internal use InvoiceModelFactory @@ -316,4 +320,14 @@ final class InvoiceModel return $values; } + + public function isHideZeroTax(): bool + { + return $this->hideZeroTax; + } + + public function setHideZeroTax(bool $hideZeroTax): void + { + $this->hideZeroTax = $hideZeroTax; + } } diff --git a/templates/invoice/renderer/default-pdf.pdf.twig b/templates/invoice/renderer/default-pdf.pdf.twig index e73435da..293eda7b 100644 --- a/templates/invoice/renderer/default-pdf.pdf.twig +++ b/templates/invoice/renderer/default-pdf.pdf.twig @@ -130,6 +130,7 @@ mpdf--> {% endfor %} + {% if model.calculator.tax > 0 or not model.isHideZeroTax() %} {{ 'invoice.subtotal'|trans }} @@ -142,6 +143,7 @@ mpdf--> {{ model.calculator.tax|money(currency) }} + {% endif %} {{ 'invoice.total'|trans }} diff --git a/templates/invoice/renderer/default.html.twig b/templates/invoice/renderer/default.html.twig index c87547a0..0faede9f 100644 --- a/templates/invoice/renderer/default.html.twig +++ b/templates/invoice/renderer/default.html.twig @@ -98,6 +98,7 @@ {% endfor %} + {% if model.calculator.tax > 0 or not model.isHideZeroTax() %} {{ 'invoice.subtotal'|trans }} @@ -110,6 +111,7 @@ {{ model.calculator.tax|money(currency) }} + {% endif %} {{ 'invoice.total'|trans }} @@ -142,4 +144,4 @@ {{ 'label.contact'|trans }}: {{ model.template.contact|nl2str(' – ') }}

-{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/templates/invoice/renderer/freelancer.pdf.twig b/templates/invoice/renderer/freelancer.pdf.twig index 2864e122..79a6ef38 100644 --- a/templates/invoice/renderer/freelancer.pdf.twig +++ b/templates/invoice/renderer/freelancer.pdf.twig @@ -140,6 +140,7 @@ mpdf--> {% endfor %} + {% if model.calculator.tax > 0 or not model.isHideZeroTax() %} {{ 'invoice.subtotal'|trans }} @@ -152,6 +153,7 @@ mpdf--> {{ model.calculator.tax|money(currency) }} + {% endif %} {{ 'invoice.total'|trans }}