* 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
150 lines
6.3 KiB
Twig
150 lines
6.3 KiB
Twig
{% import "macros/widgets.html.twig" as widgets %}
|
|
|
|
{% extends 'invoice/layout.html.twig' %}
|
|
|
|
{% block invoice %}
|
|
|
|
<div class="row" id="freelancer-invoice">
|
|
<div class="col-xs-12">
|
|
<header>
|
|
<address>
|
|
<p contenteditable="true">{{ model.template.company }} – {{ model.template.address|replace({"\n": ' – ', "\r\n": ' – ', "\r": ' – '})|raw }}</p>
|
|
</address>
|
|
</header>
|
|
<article class="address">
|
|
<h1>{{ 'invoice.to'|trans }}</h1>
|
|
<address>
|
|
<p>
|
|
<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 %}
|
|
</p>
|
|
</address>
|
|
<table class="meta">
|
|
<tr>
|
|
<th>{{ 'label.date'|trans }}:</th>
|
|
<td contenteditable="true">{{ model.invoiceDate|date_short }}</td>
|
|
</tr>
|
|
<tr>
|
|
<th>{{ 'invoice.service_date'|trans }}:</th>
|
|
<td><span contenteditable="true">{{ model.query.end|month_name|trans }} {{ model.query.end|date('Y') }}</td>
|
|
</tr>
|
|
<tr>
|
|
<th>{{ 'invoice.number'|trans }}:</th>
|
|
<td><span contenteditable="true">{{ model.numberGenerator.invoiceNumber }}</td>
|
|
</tr>
|
|
{% if model.query.project is not empty and model.query.project.orderNumber is not empty %}
|
|
<tr>
|
|
<th>{{ 'label.orderNumber'|trans }}</th>
|
|
<td contenteditable="true">
|
|
{{ model.query.project.orderNumber }}
|
|
</td>
|
|
</tr>
|
|
{% endif %}
|
|
{% if model.template.vatId is not empty %}
|
|
<tr>
|
|
<th>{{ 'label.vat_id'|trans }}:</th>
|
|
<td>
|
|
{{ model.template.vatId }}
|
|
</td>
|
|
</tr>
|
|
{% endif %}
|
|
</table>
|
|
</article>
|
|
<article class="invoice-items">
|
|
<h2>{{ model.template.title|default('timesheet'|trans({}, 'invoice-renderer')) }}</h2>
|
|
<p contenteditable="true">
|
|
{{ 'label.invoice_salutation'|trans|nl2br }}
|
|
</p>
|
|
<table class="inventory">
|
|
<thead>
|
|
<tr>
|
|
<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 %}
|
|
{% if entry.fixedRate is not null %}
|
|
{% set rate = entry.fixedRate %}
|
|
{% set duration = entry.amount|amount %}
|
|
{% else %}
|
|
{% set rate = entry.hourlyRate %}
|
|
{% endif %}
|
|
|
|
<tr>
|
|
<td contenteditable="true">
|
|
{% if entry.description is not empty %}
|
|
{{ entry.description|nl2br }}
|
|
{% else %}
|
|
{{ entry.activity.name }} / {{ entry.project.name }}
|
|
{% endif %}
|
|
</td>
|
|
<td class="text-right text-nowrap">{{ rate|money(model.calculator.currency) }}</td>
|
|
<td class="text-right text-nowrap">{{ duration }}</td>
|
|
<td class="text-right text-nowrap">{{ entry.rate|money(model.calculator.currency) }}</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
<table class="balance">
|
|
<tr>
|
|
<th>{{ 'invoice.subtotal'|trans }}</th>
|
|
<td>{{ model.calculator.subtotal|money(model.calculator.currency) }}</td>
|
|
</tr>
|
|
<tr>
|
|
<th>{{ 'invoice.tax'|trans }} ({{ model.calculator.vat }}%)</th>
|
|
<td>{{ model.calculator.tax|money(model.calculator.currency) }}</td>
|
|
</tr>
|
|
<tr>
|
|
<th class="total">{{ 'invoice.total'|trans }}</th>
|
|
<td class="total">{{ model.calculator.total|money(model.calculator.currency) }}</td>
|
|
</tr>
|
|
</table>
|
|
</article>
|
|
{% if model.template.paymentTerms is not empty %}
|
|
<article class="paymentTerms">
|
|
<div contenteditable="true">
|
|
{{ model.template.paymentTerms|nl2br|md2html }}
|
|
</div>
|
|
</article>
|
|
{% endif %}
|
|
<footer class="footer">
|
|
<div class="row">
|
|
<div class="col-sm-4" contenteditable="true">
|
|
<p>
|
|
<strong>{{ 'label.address'|trans }}</strong>
|
|
</p>
|
|
<p>
|
|
{{ model.template.company }}<br>
|
|
{{ model.template.address|nl2br }}
|
|
</p>
|
|
</div>
|
|
<div class="col-sm-4 text-center" contenteditable="true">
|
|
<p>
|
|
<strong>{{ 'label.invoice_bank_account'|trans }}</strong>
|
|
</p>
|
|
<p>
|
|
{{ model.template.paymentDetails|nl2br }}
|
|
</p>
|
|
</div>
|
|
<div class="col-sm-4 text-right" contenteditable="true">
|
|
<p>
|
|
<strong>{{ 'label.contact'|trans }}</strong>
|
|
</p>
|
|
<p>
|
|
{{ model.template.contact|nl2br }}
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</footer>
|
|
</div>
|
|
</div>
|
|
|
|
{% endblock %} |