* include user teams in user entity * prevent unauthorized access via API * improve teamlead permission handling in team timesheets * add team data to user entity * add security tests * highlight menu for invoice template copy * unified handling of invoice data across all templates * access to the current users data in invoice templates * permission improvement in invoice form * allow to skip record rows * allow to add new invoice locations without overwriting the global ones * allow to order user preferences * change permission for normal users with access to view_other_timesheets * properly validate invoice template field length * allow to replace multiple variables in cell values text * upgraded office invoice template * doctrine deprecation fix * upgrade phpoffice/phpword * fix future begin check for default rounding rules * dashboard widget counter: respect visibility and teams - fixes #1161 * fix future begin check for default rounding rules * added new events for pre and post invoice rendering * fix permission issue for users without team seeing all records * prevent error in spreadsheet renderer for empty invoices
145 lines
5.8 KiB
Twig
145 lines
5.8 KiB
Twig
{% extends 'invoice/layout.html.twig' %}
|
|
|
|
{% block invoice %}
|
|
<div class="row">
|
|
<div class="col-xs-12">
|
|
<h2 class="page-header">
|
|
<span contenteditable="true">{{ model.template.title }}</span>
|
|
<small class="pull-right">{{ 'label.date'|trans }}: {{ model.invoiceDate|date_short }}</small>
|
|
</h2>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row">
|
|
<div class="col-sm-5">
|
|
{{ 'invoice.from'|trans }}
|
|
<address contenteditable="true">
|
|
<strong>{{ model.template.company }}</strong><br>
|
|
{{ model.template.address|trim|nl2br }}
|
|
{% if model.template.vatId is not empty %}
|
|
<br>
|
|
{{ 'label.vat_id'|trans }}:
|
|
{{ model.template.vatId }}
|
|
{% endif %}
|
|
</address>
|
|
</div>
|
|
<div class="col-sm-2"></div>
|
|
<div class="col-sm-5">
|
|
{% set customerPhone = model.customer.phone|default(model.customer.mobile) %}
|
|
{{ 'invoice.to'|trans }}
|
|
<address contenteditable="true">
|
|
<strong>{{ model.customer.company|default(model.customer.name) }}</strong><br>
|
|
{{ model.customer.address|nl2br }}
|
|
{% if model.customer.vatId is not empty %}
|
|
<br>
|
|
{{ 'label.vat_id'|trans }}: {{ model.customer.vatId }}
|
|
{% endif %}
|
|
{% if model.customer.number is not empty %}
|
|
<br>
|
|
{{ 'label.number'|trans }}: {{ model.customer.number }}
|
|
{% endif %}
|
|
{% if model.query.project is not empty and model.query.project.orderNumber is not empty %}
|
|
<br>
|
|
{{ 'label.orderNumber'|trans }}: {{ model.query.project.orderNumber }}
|
|
{% endif %}
|
|
</address>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row">
|
|
<div class="col-sm-5">
|
|
<p contenteditable="true">
|
|
<strong>{{ 'invoice.number'|trans }}:</strong>
|
|
{{ model.numberGenerator.invoiceNumber }}
|
|
|
|
<br>
|
|
<strong>{{ 'invoice.due_days'|trans }}:</strong>
|
|
{{ model.dueDate|date_short }}
|
|
</p>
|
|
</div>
|
|
<div class="col-sm-7"></div>
|
|
</div>
|
|
|
|
<div class="row invoice-items">
|
|
<div class="col-xs-12 table-responsive">
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>{{ 'label.date'|trans }}</th>
|
|
<th>{{ 'label.description'|trans }}</th>
|
|
<th class="text-right">{{ 'label.unit_price'|trans }}</th>
|
|
<th class="text-right">{{ 'label.amount'|trans }}</th>
|
|
<th class="text-right">{{ 'label.total_rate'|trans }}</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for entry in model.calculator.entries %}
|
|
{% set duration = entry.duration|duration_decimal %}
|
|
{% if entry.fixedRate %}
|
|
{% set rate = entry.fixedRate %}
|
|
{% set duration = entry.amount|amount %}
|
|
{% else %}
|
|
{% set rate = entry.hourlyRate %}
|
|
{% endif %}
|
|
<tr>
|
|
<td nowrap class="text-nowrap">{{ entry.begin|date_short }}</td>
|
|
<td contenteditable="true">
|
|
{% if entry.description is not empty %}
|
|
{{ entry.description|nl2br }}
|
|
{% else %}
|
|
{{ entry.activity.name }} / {{ entry.project.name }}
|
|
{% endif %}
|
|
</td>
|
|
<td nowrap class="text-nowrap text-right">{{ rate|money(model.calculator.currency) }}</td>
|
|
<td nowrap class="text-nowrap text-right">{{ duration }}</td>
|
|
<td nowrap class="text-nowrap text-right">{{ entry.rate|money(model.calculator.currency) }}</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
<tfoot>
|
|
<tr>
|
|
<td colspan="4" class="text-right">
|
|
{{ 'invoice.subtotal'|trans }}
|
|
</td>
|
|
<td class="text-right">{{ model.calculator.subtotal|money(model.calculator.currency) }}</td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan="4" class="text-right">
|
|
{{ 'invoice.tax'|trans }} ({{ model.calculator.vat }}%)
|
|
</td>
|
|
<td class="text-right">{{ model.calculator.tax|money(model.calculator.currency) }}</td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan="4" class="text-right text-nowrap">
|
|
<strong>{{ 'invoice.total'|trans }}</strong>
|
|
</td>
|
|
<td class="text-right">
|
|
<strong>{{ model.calculator.total|money(model.calculator.currency) }}</strong>
|
|
</td>
|
|
</tr>
|
|
</tfoot>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row">
|
|
<div class="col-xs-12">
|
|
{% if model.template.paymentTerms is not empty %}
|
|
<div contenteditable="true" class="paymentTerms">
|
|
{{ model.template.paymentTerms|nl2br|md2html }}
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
|
|
<footer class="footer">
|
|
<p>
|
|
<strong>{{ 'label.address'|trans }}</strong>: {{ model.template.company }} – {{ model.template.address|replace({"\n": ' – ', "\r\n": ' – ', "\r": ' – '})|raw }}
|
|
<br>
|
|
<strong>{{ 'label.invoice_bank_account'|trans }}</strong>: {{ model.template.paymentDetails|replace({"\n": ' – ', "\r\n": ' – ', "\r": ' – '})|raw }}
|
|
<br>
|
|
<strong>{{ 'label.contact'|trans }}</strong>: {{ model.template.contact|replace({"\n": ' – ', "\r\n": ' – ', "\r": ' – '})|raw }}
|
|
</p>
|
|
</footer>
|
|
|
|
{% endblock %} |