allow to hide tax rows in invoice templates if vat rate is zero (#3484)
This commit is contained in:
@@ -77,6 +77,10 @@ final class InvoiceModel
|
|||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
private $invoiceNumber;
|
private $invoiceNumber;
|
||||||
|
/**
|
||||||
|
* @var bool
|
||||||
|
*/
|
||||||
|
private $hideZeroTax = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @internal use InvoiceModelFactory
|
* @internal use InvoiceModelFactory
|
||||||
@@ -316,4 +320,14 @@ final class InvoiceModel
|
|||||||
|
|
||||||
return $values;
|
return $values;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function isHideZeroTax(): bool
|
||||||
|
{
|
||||||
|
return $this->hideZeroTax;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setHideZeroTax(bool $hideZeroTax): void
|
||||||
|
{
|
||||||
|
$this->hideZeroTax = $hideZeroTax;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -130,6 +130,7 @@ mpdf-->
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tbody>
|
</tbody>
|
||||||
<tfoot>
|
<tfoot>
|
||||||
|
{% if model.calculator.tax > 0 or not model.isHideZeroTax() %}
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="4" class="text-right">
|
<td colspan="4" class="text-right">
|
||||||
{{ 'invoice.subtotal'|trans }}
|
{{ 'invoice.subtotal'|trans }}
|
||||||
@@ -142,6 +143,7 @@ mpdf-->
|
|||||||
</td>
|
</td>
|
||||||
<td class="last text-right">{{ model.calculator.tax|money(currency) }}</td>
|
<td class="last text-right">{{ model.calculator.tax|money(currency) }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
{% endif %}
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="4" class="text-right text-nowrap">
|
<td colspan="4" class="text-right text-nowrap">
|
||||||
<strong>{{ 'invoice.total'|trans }}</strong>
|
<strong>{{ 'invoice.total'|trans }}</strong>
|
||||||
|
|||||||
@@ -98,6 +98,7 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tbody>
|
</tbody>
|
||||||
<tfoot>
|
<tfoot>
|
||||||
|
{% if model.calculator.tax > 0 or not model.isHideZeroTax() %}
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="4" class="text-right">
|
<td colspan="4" class="text-right">
|
||||||
{{ 'invoice.subtotal'|trans }}
|
{{ 'invoice.subtotal'|trans }}
|
||||||
@@ -110,6 +111,7 @@
|
|||||||
</td>
|
</td>
|
||||||
<td class="text-right">{{ model.calculator.tax|money(currency) }}</td>
|
<td class="text-right">{{ model.calculator.tax|money(currency) }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
{% endif %}
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="4" class="text-right text-nowrap">
|
<td colspan="4" class="text-right text-nowrap">
|
||||||
<strong>{{ 'invoice.total'|trans }}</strong>
|
<strong>{{ 'invoice.total'|trans }}</strong>
|
||||||
|
|||||||
@@ -140,6 +140,7 @@ mpdf-->
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tbody>
|
</tbody>
|
||||||
<tfoot>
|
<tfoot>
|
||||||
|
{% if model.calculator.tax > 0 or not model.isHideZeroTax() %}
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="3" class="text-right">
|
<td colspan="3" class="text-right">
|
||||||
{{ 'invoice.subtotal'|trans }}
|
{{ 'invoice.subtotal'|trans }}
|
||||||
@@ -152,6 +153,7 @@ mpdf-->
|
|||||||
</td>
|
</td>
|
||||||
<td class="last text-right">{{ model.calculator.tax|money(currency) }}</td>
|
<td class="last text-right">{{ model.calculator.tax|money(currency) }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
{% endif %}
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="3" class="text-right text-nowrap">
|
<td colspan="3" class="text-right text-nowrap">
|
||||||
<strong>{{ 'invoice.total'|trans }}</strong>
|
<strong>{{ 'invoice.total'|trans }}</strong>
|
||||||
|
|||||||
Reference in New Issue
Block a user