Release 2.0.15 (#3970)
This commit is contained in:
@@ -1,13 +1,8 @@
|
||||
<!DOCTYPE html>
|
||||
{%- set fallback = app.request is not null ? app.request.locale : 'en' -%}
|
||||
{%- set language = model.template.language|default(fallback) -%}
|
||||
{%- set isDecimal = true -%}
|
||||
{%- set currency = model.currency -%}
|
||||
{%- set project = model.query.project -%}
|
||||
<html lang="{{ language }}">
|
||||
<html lang="{{ invoice['invoice.language'] }}">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>{% block title %}{{ model.invoiceNumber }}-{{ model.customer.company|default(model.customer.name)|u.snake }}{% endblock %}</title>
|
||||
<meta charset="utf-8">
|
||||
<title>{% block title %}{{ invoice['invoice.number'] }}-{{ invoice['customer.company']|default(invoice['customer.name'])|u.snake }}{% endblock %}</title>
|
||||
<style>
|
||||
{{ encore_entry_css_source('invoice-pdf')|raw }}
|
||||
</style>
|
||||
@@ -18,10 +13,10 @@
|
||||
<table class="header">
|
||||
<tr>
|
||||
<td class="title">
|
||||
{{ model.template.title }}
|
||||
{{ invoice['template.title'] }}
|
||||
</td>
|
||||
<td class="date text-right">
|
||||
{{ 'date'|trans }}: {{ model.invoiceDate|date_short }}
|
||||
{{ 'date'|trans }}: {{ invoice['invoice.date'] }}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -32,10 +27,10 @@
|
||||
<tr>
|
||||
<td>
|
||||
<strong>{{ 'contact'|trans }}</strong>:
|
||||
{{ model.template.contact|nl2str(' – ') }}
|
||||
{{ invoice['template.contact']|nl2str(' – ') }}
|
||||
<br>
|
||||
<strong>{{ 'invoice_bank_account'|trans }}</strong>:
|
||||
{{ model.template.paymentDetails|nl2str(' – ') }}
|
||||
{{ invoice['template.payment_details']|nl2str(' – ') }}
|
||||
</td>
|
||||
<td align="right">
|
||||
{{ 'export.page_of'|trans({'%page%': '{PAGENO}', '%pages%': '{nb}'}) }}
|
||||
@@ -50,24 +45,24 @@ mpdf-->
|
||||
<td style="width:60%">
|
||||
{{ 'invoice.to'|trans }}
|
||||
<br>
|
||||
<strong>{{ model.customer.company|default(model.customer.name) }}</strong>
|
||||
<strong>{{ invoice['customer.company']|default(invoice['customer.name']) }}</strong>
|
||||
<br>
|
||||
{{ model.customer.address|nl2br }}
|
||||
{% if model.customer.vatId is not empty %}
|
||||
{{ invoice['customer.address']|nl2br }}
|
||||
{% if invoice['customer.vat_id'] is not empty %}
|
||||
<br>
|
||||
{{ 'vat_id'|trans }}: {{ model.customer.vatId }}
|
||||
{{ 'vat_id'|trans }}: {{ invoice['customer.vat_id'] }}
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
{{ 'invoice.from'|trans }}
|
||||
<br>
|
||||
<strong>{{ model.template.company }}</strong>
|
||||
<strong>{{ invoice['template.company'] }}</strong>
|
||||
<br>
|
||||
{{ model.template.address|trim|nl2br }}
|
||||
{% if model.template.vatId is not empty %}
|
||||
{{ invoice['template.address']|trim|nl2br }}
|
||||
{% if invoice['template.vat_id'] is not empty %}
|
||||
<br>
|
||||
{{ 'vat_id'|trans }}:
|
||||
{{ model.template.vatId }}
|
||||
{{ invoice['template.vat_id'] }}
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
@@ -75,27 +70,27 @@ mpdf-->
|
||||
|
||||
<p>
|
||||
{{ 'invoice.number'|trans }}:
|
||||
{{ model.invoiceNumber }}
|
||||
{{ invoice['invoice.number'] }}
|
||||
|
||||
<br>
|
||||
{{ 'invoice.due_days'|trans }}:
|
||||
{{ model.dueDate|date_short }}
|
||||
{{ invoice['invoice.due_date'] }}
|
||||
|
||||
{% if model.customer.number is not empty %}
|
||||
{% if invoice['customer.number'] is not empty %}
|
||||
<br>
|
||||
{{ 'number'|trans }}:
|
||||
{{ model.customer.number }}
|
||||
{{ invoice['customer.number'] }}
|
||||
{% endif %}
|
||||
|
||||
{% if project is not null and project.orderNumber is not empty %}
|
||||
{% if invoice['query.project.order_number'] is defined and invoice['query.project.order_number'] is not empty %}
|
||||
<br>
|
||||
{{ 'orderNumber'|trans }}:
|
||||
{{ project.orderNumber }}
|
||||
{{ invoice['query.project.order_number'] }}
|
||||
{% endif %}
|
||||
</p>
|
||||
|
||||
{% if model.customer.invoiceText is not empty%}
|
||||
<p>{{ model.customer.invoiceText|md2html }}</p>
|
||||
{% if invoice['customer.invoice_text'] is not empty%}
|
||||
<p>{{ invoice['customer.invoice_text']|md2html }}</p>
|
||||
{% endif %}
|
||||
|
||||
<table class="items">
|
||||
@@ -109,43 +104,39 @@ mpdf-->
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for id, entry in model.calculator.entries %}
|
||||
{% for invoiceLineItem in entries %}
|
||||
<!-- CONTENT_PART -->
|
||||
{% set duration = entry.duration|duration(isDecimal) %}
|
||||
{% if entry.fixedRate %}
|
||||
{% set rate = entry.fixedRate %}
|
||||
{% set duration = entry.amount|amount %}
|
||||
{% else %}
|
||||
{% set rate = entry.hourlyRate %}
|
||||
{% endif %}
|
||||
<tr>
|
||||
<td nowrap class="first text-nowrap">{{ entry.begin|date_short }}</td>
|
||||
<td contenteditable="true">
|
||||
{% if entry.description is not empty %}
|
||||
{{ entry.description|nl2br }}
|
||||
<td nowrap class="first text-nowrap">{{ invoiceLineItem['entry.begin'] }}</td>
|
||||
<td>
|
||||
{% if invoiceLineItem['entry.description'] is not empty %}
|
||||
{{ invoiceLineItem['entry.description']|nl2br }}
|
||||
{% else %}
|
||||
{% if entry.activity is not null %}{{ entry.activity.name }} / {% endif %}{{ entry.project.name }}
|
||||
{% if invoiceLineItem['entry.activity'] is defined %}
|
||||
{{ invoiceLineItem['entry.activity'] }} /
|
||||
{% endif %}
|
||||
{{ invoiceLineItem['entry.project'] }}
|
||||
{% endif %}
|
||||
</td>
|
||||
<td nowrap class="text-nowrap text-right">{{ rate|money(currency) }}</td>
|
||||
<td nowrap class="text-nowrap text-right">{{ duration }}</td>
|
||||
<td nowrap class="last text-nowrap text-right">{{ entry.rate|money(currency) }}</td>
|
||||
<td nowrap class="text-nowrap text-right">{{ invoiceLineItem['entry.rate'] }}</td>
|
||||
<td nowrap class="text-nowrap text-right">{{ invoiceLineItem['entry.amount'] }}</td>
|
||||
<td nowrap class="last text-nowrap text-right">{{ invoiceLineItem['entry.total'] }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
<tfoot>
|
||||
{% if model.calculator.tax > 0 or not model.isHideZeroTax() %}
|
||||
{% if not invoice['invoice.tax_hide'] %}
|
||||
<tr>
|
||||
<td colspan="4" class="text-right">
|
||||
{{ 'invoice.subtotal'|trans }}
|
||||
</td>
|
||||
<td class="last text-right">{{ model.calculator.subtotal|money(currency) }}</td>
|
||||
<td class="last text-right">{{ invoice['invoice.subtotal'] }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="4" class="text-right">
|
||||
{{ 'invoice.tax'|trans }} ({{ model.calculator.vat }}%)
|
||||
{{ 'invoice.tax'|trans }} ({{ invoice['invoice.vat'] }}%)
|
||||
</td>
|
||||
<td class="last text-right">{{ model.calculator.tax|money(currency) }}</td>
|
||||
<td class="last text-right">{{ invoice['invoice.tax'] }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
<tr>
|
||||
@@ -153,16 +144,16 @@ mpdf-->
|
||||
<strong>{{ 'invoice.total'|trans }}</strong>
|
||||
</td>
|
||||
<td class="last text-right">
|
||||
<strong>{{ model.calculator.total|money(currency) }}</strong>
|
||||
<strong>{{ invoice['invoice.total'] }}</strong>
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
|
||||
{% if model.template.paymentTerms is not empty %}
|
||||
<div class="paymentTerms">
|
||||
{{ model.template.paymentTerms|md2html }}
|
||||
</div>
|
||||
{% if invoice['template.payment_terms'] is not empty %}
|
||||
<div class="paymentTerms">
|
||||
{{ invoice['template.payment_terms']|md2html }}
|
||||
</div>
|
||||
{% endif %}
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,166 +1,158 @@
|
||||
<!DOCTYPE html>
|
||||
{% set fallback = app.request is not null ? app.request.locale : 'en' %}
|
||||
{% set language = model.template.language|default(fallback) %}
|
||||
{% set isDecimal = true %}
|
||||
{% set currency = model.currency %}
|
||||
{% set project = model.query.project %}
|
||||
<html lang="{{ language }}">
|
||||
<html lang="{{ invoice['invoice.language'] }}">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
|
||||
<title>{% block title %}{{ model.invoiceNumber }}-{{ model.customer.company|default(model.customer.name)|u.snake }}{% endblock %}</title>
|
||||
<style type="text/css">
|
||||
<title>{% block title %}{{ invoice['invoice.number'] }}-{{ invoice['customer.company']|default(invoice['customer.name'])|u.snake }}{% endblock %}</title>
|
||||
<style>
|
||||
{{ encore_entry_css_source('invoice')|raw }}
|
||||
</style>
|
||||
</head>
|
||||
<body class="invoice_print">
|
||||
<div class="wrapper">
|
||||
<section class="invoice">
|
||||
<div class="wrapper">
|
||||
<section class="invoice">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<h2 class="page-header">
|
||||
<span contenteditable="true">{{ model.template.title }}</span>
|
||||
<small class="pull-right">{{ 'date'|trans }}: {{ model.invoiceDate|date_short }}</small>
|
||||
</h2>
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<h2 class="page-header">
|
||||
<span contenteditable="true">{{ invoice['template.title'] }}</span>
|
||||
</h2>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-5">
|
||||
{{ '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>
|
||||
{{ 'vat_id'|trans }}: {{ model.customer.vatId }}
|
||||
{% endif %}
|
||||
{% if model.customer.number is not empty %}
|
||||
<br>
|
||||
{{ 'number'|trans }}: {{ model.customer.number }}
|
||||
{% endif %}
|
||||
{% if project is not null and project.orderNumber is not empty %}
|
||||
<br>
|
||||
{{ 'orderNumber'|trans }}: {{ project.orderNumber }}
|
||||
{% endif %}
|
||||
</address>
|
||||
<div class="row">
|
||||
<div class="col-sm-5">
|
||||
{{ 'invoice.to'|trans }}
|
||||
<address contenteditable="true">
|
||||
<strong>{{ invoice['customer.company']|default(invoice['customer.name']) }}</strong><br>
|
||||
{{ invoice['customer.address']|nl2br }}
|
||||
{% if invoice['customer.vat_id'] is not empty %}
|
||||
<br>
|
||||
{{ 'vat_id'|trans }}: {{ invoice['customer.vat_id'] }}
|
||||
{% endif %}
|
||||
{% if invoice['customer.number'] is not empty %}
|
||||
<br>
|
||||
{{ 'number'|trans }}: {{ invoice['customer.number'] }}
|
||||
{% endif %}
|
||||
{% if invoice['query.project.order_number'] is defined and invoice['query.project.order_number'] is not empty %}
|
||||
<br>
|
||||
{{ 'orderNumber'|trans }}: {{ invoice['query.project.order_number'] }}
|
||||
{% endif %}
|
||||
</address>
|
||||
</div>
|
||||
<div class="col-sm-2"></div>
|
||||
<div class="col-sm-5">
|
||||
{{ 'invoice.from'|trans }}
|
||||
<address contenteditable="true">
|
||||
<strong>{{ invoice['template.company'] }}</strong><br>
|
||||
{{ invoice['template.address']|trim|nl2br }}
|
||||
{% if invoice['template.vat_id'] is not empty %}
|
||||
<br>
|
||||
{{ 'vat_id'|trans }}:
|
||||
{{ invoice['template.vat_id'] }}
|
||||
{% endif %}
|
||||
</address>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-2"></div>
|
||||
<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 %}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-5">
|
||||
<p contenteditable="true">
|
||||
<strong>{{ 'date'|trans }}:</strong>
|
||||
{{ invoice['invoice.date'] }}
|
||||
|
||||
<br>
|
||||
{{ 'vat_id'|trans }}:
|
||||
{{ model.template.vatId }}
|
||||
{% endif %}
|
||||
</address>
|
||||
<strong>{{ 'invoice.number'|trans }}:</strong>
|
||||
{{ invoice['invoice.number'] }}
|
||||
|
||||
<br>
|
||||
<strong>{{ 'invoice.due_days'|trans }}:</strong>
|
||||
{{ invoice['invoice.due_date'] }}
|
||||
</p>
|
||||
</div>
|
||||
<div class="col-sm-7"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-5">
|
||||
<p contenteditable="true">
|
||||
<strong>{{ 'invoice.number'|trans }}:</strong>
|
||||
{{ model.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 mt-2 mb-3">
|
||||
<div class="col-xs-12 table-responsive">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ 'date'|trans }}</th>
|
||||
<th>{{ 'description'|trans }}</th>
|
||||
<th class="text-end">{{ 'unit_price'|trans }}</th>
|
||||
<th class="text-end">{{ 'amount'|trans }}</th>
|
||||
<th class="text-end">{{ 'total_rate'|trans }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for entry in model.calculator.entries %}
|
||||
{% set duration = entry.duration|duration(isDecimal) %}
|
||||
{% if entry.fixedRate %}
|
||||
{% set rate = entry.fixedRate %}
|
||||
{% set duration = entry.amount|amount %}
|
||||
{% else %}
|
||||
{% set rate = entry.hourlyRate %}
|
||||
<div class="row invoice-items mt-2 mb-3">
|
||||
<div class="col-xs-12 table-responsive">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ 'date'|trans }}</th>
|
||||
<th>{{ 'description'|trans }}</th>
|
||||
<th class="text-end">{{ 'unit_price'|trans }}</th>
|
||||
<th class="text-end">{{ 'amount'|trans }}</th>
|
||||
<th class="text-end">{{ 'total_rate'|trans }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for invoiceLineItem in entries %}
|
||||
<tr>
|
||||
<td nowrap class="text-nowrap">{{ invoiceLineItem['entry.begin'] }}</td>
|
||||
<td contenteditable="true">
|
||||
{% if invoiceLineItem['entry.description'] is not empty %}
|
||||
{{ invoiceLineItem['entry.description']|nl2br }}
|
||||
{% else %}
|
||||
{% if invoiceLineItem['entry.activity'] is defined %}
|
||||
{{ invoiceLineItem['entry.activity'] }} /
|
||||
{% endif %}
|
||||
{{ invoiceLineItem['entry.project'] }}
|
||||
{% endif %}
|
||||
</td>
|
||||
<td nowrap class="text-nowrap text-end">{{ invoiceLineItem['entry.rate'] }}</td>
|
||||
<td nowrap class="text-nowrap text-end">{{ invoiceLineItem['entry.amount'] }}</td>
|
||||
<td nowrap class="text-nowrap text-end">{{ invoiceLineItem['entry.total'] }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
<tfoot>
|
||||
{% if not invoice['invoice.tax_hide'] %}
|
||||
<tr>
|
||||
<td colspan="4" class="text-end">
|
||||
{{ 'invoice.subtotal'|trans }}
|
||||
</td>
|
||||
<td class="text-end">{{ invoice['invoice.subtotal'] }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="4" class="text-end">
|
||||
{{ 'invoice.tax'|trans }} ({{ invoice['invoice.vat'] }}%)
|
||||
</td>
|
||||
<td class="text-end">{{ invoice['invoice.tax'] }}</td>
|
||||
</tr>
|
||||
{% 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 %}
|
||||
{% if entry.activity is not null %}{{ entry.activity.name }} / {% endif %}{{ entry.project.name }}
|
||||
{% endif %}
|
||||
<td colspan="4" class="text-end text-nowrap">
|
||||
<strong>{{ 'invoice.total'|trans }}</strong>
|
||||
</td>
|
||||
<td nowrap class="text-nowrap text-end">{{ rate|money(currency) }}</td>
|
||||
<td nowrap class="text-nowrap text-end">{{ duration }}</td>
|
||||
<td nowrap class="text-nowrap text-end">{{ entry.rate|money(currency) }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
<tfoot>
|
||||
{% if model.calculator.tax > 0 or not model.isHideZeroTax() %}
|
||||
<tr>
|
||||
<td colspan="4" class="text-end">
|
||||
{{ 'invoice.subtotal'|trans }}
|
||||
<td class="text-end">
|
||||
<strong>{{ invoice['invoice.total'] }}</strong>
|
||||
</td>
|
||||
<td class="text-end">{{ model.calculator.subtotal|money(currency) }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="4" class="text-end">
|
||||
{{ 'invoice.tax'|trans }} ({{ model.calculator.vat }}%)
|
||||
</td>
|
||||
<td class="text-end">{{ model.calculator.tax|money(currency) }}</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
{% if invoice['template.payment_terms'] is not empty %}
|
||||
<div contenteditable="true" class="paymentTerms">
|
||||
{{ invoice['template.payment_terms']|md2html }}
|
||||
</div>
|
||||
{% endif %}
|
||||
<tr>
|
||||
<td colspan="4" class="text-end text-nowrap">
|
||||
<strong>{{ 'invoice.total'|trans }}</strong>
|
||||
</td>
|
||||
<td class="text-end">
|
||||
<strong>{{ model.calculator.total|money(currency) }}</strong>
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
</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|md2html }}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<footer class="footer">
|
||||
<p>
|
||||
<strong>{{ 'address'|trans }}</strong>: {{ invoice['template.company'] }} – {{ invoice['template.address']|nl2str(' – ') }}
|
||||
<br>
|
||||
<strong>{{ 'invoice_bank_account'|trans }}</strong>: {{ invoice['template.payment_details']|nl2str(' – ') }}
|
||||
<br>
|
||||
<strong>{{ 'contact'|trans }}</strong>: {{ invoice['template.contact']|nl2str(' – ') }}
|
||||
</p>
|
||||
</footer>
|
||||
|
||||
<footer class="footer">
|
||||
<p>
|
||||
<strong>{{ 'address'|trans }}</strong>: {{ model.template.company }} – {{ model.template.address|nl2str(' – ') }}
|
||||
<br>
|
||||
<strong>{{ 'invoice_bank_account'|trans }}</strong>: {{ model.template.paymentDetails|nl2str(' – ') }}
|
||||
<br>
|
||||
<strong>{{ 'contact'|trans }}</strong>: {{ model.template.contact|nl2str(' – ') }}
|
||||
</p>
|
||||
</footer>
|
||||
|
||||
</section>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,13 +1,8 @@
|
||||
<!DOCTYPE html>
|
||||
{%- set fallback = app.request is not null ? app.request.locale : 'en' -%}
|
||||
{%- set language = model.template.language|default(fallback) -%}
|
||||
{%- set isDecimal = true -%}
|
||||
{%- set currency = model.currency -%}
|
||||
{%- set project = model.query.project -%}
|
||||
<html lang="{{ language }}">
|
||||
<html lang="{{ invoice['invoice.language'] }}">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>{% block title %}{{ model.invoiceNumber }}-{{ model.customer.company|default(model.customer.name)|u.snake }}{% endblock %}</title>
|
||||
<meta charset="utf-8">
|
||||
<title>{% block title %}{{ invoice['invoice.number'] }}-{{ invoice['customer.company']|default(invoice['customer.name'])|u.snake }}{% endblock %}</title>
|
||||
<style>
|
||||
{{ encore_entry_css_source('invoice-pdf')|raw }}
|
||||
</style>
|
||||
@@ -18,9 +13,9 @@
|
||||
<table class="header">
|
||||
<tr>
|
||||
<td class="text-small">
|
||||
{{ model.template.company }} – {{ model.template.address|nl2str(' – ') }}
|
||||
{% if model.template.vatId is not empty %}
|
||||
– {{ 'vat_id'|trans }}: {{ model.template.vatId }}
|
||||
{{ invoice['template.company'] }} – {{ invoice['template.address']|nl2str(' – ') }}
|
||||
{% if invoice['template.vat_id'] is not empty %}
|
||||
– {{ 'vat_id'|trans }}: {{ invoice['template.vat_id'] }}
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="text-small text-right">
|
||||
@@ -36,18 +31,18 @@
|
||||
<td style="width: 33%">
|
||||
<strong>{{ 'address'|trans }}</strong>
|
||||
<br>
|
||||
{{ model.template.company }}<br>
|
||||
{{ model.template.address|nl2br }}
|
||||
{{ invoice['template.company'] }}<br>
|
||||
{{ invoice['template.address']|nl2br }}
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<strong>{{ 'invoice_bank_account'|trans }}</strong>
|
||||
<br>
|
||||
{{ model.template.paymentDetails|nl2br }}
|
||||
{{ invoice['template.payment_details']|nl2br }}
|
||||
</td>
|
||||
<td class="text-right" style="width: 33%">
|
||||
<strong>{{ 'contact'|trans }}</strong>
|
||||
<br>
|
||||
{{ model.template.contact|nl2br }}
|
||||
{{ invoice['template.contact']|nl2br }}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -57,8 +52,8 @@ mpdf-->
|
||||
<table class="addresses">
|
||||
<tr>
|
||||
<td>
|
||||
<strong>{{ model.customer.company|default(model.customer.name) }}</strong><br>
|
||||
{{ model.customer.address|nl2br }}
|
||||
<strong>{{ invoice['customer.company']|default(invoice['customer.name']) }}</strong><br>
|
||||
{{ invoice['customer.address']|nl2br }}
|
||||
</td>
|
||||
<td class="text-right">
|
||||
{% set classLeft = 'text-left' %}
|
||||
@@ -66,36 +61,36 @@ mpdf-->
|
||||
<table style="width: 240px">
|
||||
<tr>
|
||||
<td class="{{ classLeft }}">{{ 'date'|trans }}</td>
|
||||
<td class="{{ classRight }}">{{ model.invoiceDate|date_short }}</td>
|
||||
<td class="{{ classRight }}">{{ invoice['invoice.date'] }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="{{ classLeft }}">{{ 'invoice.service_date'|trans }}</td>
|
||||
<td class="{{ classRight }}">{{ model.query.end|month_name }} {{ model.query.end|date('Y') }}</td>
|
||||
<td class="{{ classRight }}">{{ invoice['query.end_month'] }} {{ invoice['query.end_year'] }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="{{ classLeft }}">{{ 'invoice.number'|trans }}</td>
|
||||
<td class="{{ classRight }}">{{ model.invoiceNumber }}</td>
|
||||
<td class="{{ classRight }}">{{ invoice['invoice.number'] }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="{{ classLeft }}">{{ 'invoice.due_days'|trans }}</td>
|
||||
<td class="{{ classRight }}">{{ model.dueDate|date_short }}</td>
|
||||
<td class="{{ classRight }}">{{ invoice['invoice.due_date'] }}</td>
|
||||
</tr>
|
||||
{% if model.customer.number is not empty %}
|
||||
{% if invoice['customer.number'] is not empty %}
|
||||
<tr>
|
||||
<td class="{{ classLeft }}">{{ 'number'|trans }}</td>
|
||||
<td class="{{ classRight }}">{{ model.customer.number }}</td>
|
||||
<td class="{{ classRight }}">{{ invoice['customer.number'] }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% if project is not null and project.orderNumber is not empty %}
|
||||
{% if invoice['query.project.order_number'] is defined and invoice['query.project.order_number'] is not empty %}
|
||||
<tr>
|
||||
<td class="{{ classLeft }}">{{ 'orderNumber'|trans }}</td>
|
||||
<td class="{{ classRight }}">{{ project.orderNumber }}</td>
|
||||
<td class="{{ classRight }}">{{ invoice['query.project.order_number'] }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% if model.customer.vatId is not empty %}
|
||||
{% if invoice['customer.vat_id'] is not empty %}
|
||||
<tr>
|
||||
<td class="{{ classLeft }}">{{ 'vat_id'|trans }}</td>
|
||||
<td class="{{ classRight }}">{{ model.customer.vatId }}</td>
|
||||
<td class="{{ classRight }}">{{ invoice['customer.vat_id'] }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
</table>
|
||||
@@ -103,10 +98,10 @@ mpdf-->
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<h2 style="margin-top: 60px">{{ model.template.title }}</h2>
|
||||
<h2 style="margin-top: 60px">{{ invoice['template.title'] }}</h2>
|
||||
|
||||
{% if model.customer.invoiceText is not empty%}
|
||||
<p>{{ model.customer.invoiceText|md2html }}</p>
|
||||
{% if invoice['customer.invoice_text'] is not empty%}
|
||||
<p>{{ invoice['customer.invoice_text']|md2html }}</p>
|
||||
{% endif %}
|
||||
|
||||
<table class="items">
|
||||
@@ -119,43 +114,38 @@ mpdf-->
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for entry in model.calculator.entries %}
|
||||
{% for invoiceLineItem in entries %}
|
||||
<!-- CONTENT_PART -->
|
||||
{% set duration = entry.duration|duration(isDecimal) %}
|
||||
{% if entry.fixedRate is not null %}
|
||||
{% set rate = entry.fixedRate %}
|
||||
{% set duration = entry.amount|amount %}
|
||||
{% else %}
|
||||
{% set rate = entry.hourlyRate %}
|
||||
{% endif %}
|
||||
|
||||
<tr>
|
||||
<td class="first">
|
||||
{% if entry.description is not empty %}
|
||||
{{ entry.description|nl2br }}
|
||||
{% if invoiceLineItem['entry.description'] is not empty %}
|
||||
{{ invoiceLineItem['entry.description']|nl2br }}
|
||||
{% else %}
|
||||
{% if entry.activity is not null %}{{ entry.activity.name }} / {% endif %}{{ entry.project.name }}
|
||||
{% if invoiceLineItem['entry.activity'] is defined %}
|
||||
{{ invoiceLineItem['entry.activity'] }} /
|
||||
{% endif %}
|
||||
{{ invoiceLineItem['entry.project'] }}
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="text-right text-nowrap">{{ rate|money(currency) }}</td>
|
||||
<td class="text-right text-nowrap">{{ duration }}</td>
|
||||
<td class="last text-right text-nowrap">{{ entry.rate|money(currency) }}</td>
|
||||
<td class="text-right text-nowrap">{{ invoiceLineItem['entry.rate'] }}</td>
|
||||
<td class="text-right text-nowrap">{{ invoiceLineItem['entry.amount'] }}</td>
|
||||
<td class="last text-right text-nowrap">{{ invoiceLineItem['entry.total'] }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
<tfoot>
|
||||
{% if model.calculator.tax > 0 or not model.isHideZeroTax() %}
|
||||
{% if not invoice['invoice.tax_hide'] %}
|
||||
<tr>
|
||||
<td colspan="3" class="text-right">
|
||||
{{ 'invoice.subtotal'|trans }}
|
||||
</td>
|
||||
<td class="last text-right">{{ model.calculator.subtotal|money(currency) }}</td>
|
||||
<td class="last text-right">{{ invoice['invoice.subtotal'] }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3" class="text-right">
|
||||
{{ 'invoice.tax'|trans }} ({{ model.calculator.vat }}%)
|
||||
{{ 'invoice.tax'|trans }} ({{ invoice['invoice.vat'] }}%)
|
||||
</td>
|
||||
<td class="last text-right">{{ model.calculator.tax|money(currency) }}</td>
|
||||
<td class="last text-right">{{ invoice['invoice.tax'] }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
<tr>
|
||||
@@ -163,16 +153,16 @@ mpdf-->
|
||||
<strong>{{ 'invoice.total'|trans }}</strong>
|
||||
</td>
|
||||
<td class="last text-right">
|
||||
<strong>{{ model.calculator.total|money(currency) }}</strong>
|
||||
<strong>{{ invoice['invoice.total'] }}</strong>
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
|
||||
{% if model.template.paymentTerms is not empty %}
|
||||
<p>
|
||||
{{ model.template.paymentTerms|md2html }}
|
||||
</p>
|
||||
{% if invoice['template.payment_terms'] is not empty %}
|
||||
<div class="paymentTerms">
|
||||
{{ invoice['template.payment_terms']|md2html }}
|
||||
</div>
|
||||
{% endif %}
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,88 +1,91 @@
|
||||
<!DOCTYPE html>
|
||||
{% set fallback = app.request is not null ? app.request.locale : 'en' %}
|
||||
{% set language = model.template.language|default(fallback) %}
|
||||
{% set isDecimal = true %}
|
||||
{% set project = model.query.project %}
|
||||
{% set activity = model.query.activity %}
|
||||
<html lang="{{ language }}">
|
||||
<html lang="{{ invoice['invoice.language'] }}">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
|
||||
<title>{{ model.invoiceNumber }}-{{ model.customer.company|default(model.customer.name)|u.snake }}</title>
|
||||
<style type="text/css">
|
||||
<title>{{ invoice['invoice.number'] }}-{{ invoice['customer.company']|default(invoice['customer.name'])|u.snake }}</title>
|
||||
<style>
|
||||
{{ encore_entry_css_source('invoice')|raw }}
|
||||
</style>
|
||||
</head>
|
||||
<body class="invoice_print">
|
||||
<div class="wrapper">
|
||||
<section class="invoice">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<h2 class="page-header">
|
||||
<span contenteditable="true">{{ model.template.title }}</span>
|
||||
<span contenteditable="true">{{ invoice['template.title'] }}</span>
|
||||
</h2>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<table class="table no-border table-sm">
|
||||
<tr>
|
||||
<th class="ps-0">{{ 'invoice.from'|trans }}</th>
|
||||
<td contenteditable="true">
|
||||
{% if model.query.user is not empty %}
|
||||
{{ model.query.user.displayName }}
|
||||
{% if not invoice['user.see_others'] and invoice['user.display'] is defined %}
|
||||
{{ invoice['user.display'] }}
|
||||
{% else %}
|
||||
{{ model.template.company }}
|
||||
{{ invoice['template.company'] }}
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="ps-0">{{ 'date'|trans }}</th>
|
||||
<td contenteditable="true">
|
||||
{% if model.query.begin|date('m') != model.query.end|date('m') or model.query.begin|date('Y') != model.query.end|date('Y') %}
|
||||
{{ model.query.begin|date_short }} - {{ model.query.end|date_short }}
|
||||
{% if invoice['query.begin_month_number'] != invoice['query.end_month_number'] or invoice['query.begin_year'] != invoice['query.end_year'] %}
|
||||
{{ invoice['query.begin'] }} - {{ invoice['query.end'] }}
|
||||
{% else %}
|
||||
{{ model.query.end|month_name }} {{ model.query.end|date('Y') }}
|
||||
{{ invoice['query.end_month'] }} {{ invoice['query.end_year'] }}
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="ps-0">{{ 'customer'|trans }}</th>
|
||||
<td contenteditable="true">
|
||||
{% if model.customer.number is not empty %}[{{ model.customer.number }}]{% endif %}
|
||||
{{ model.customer.name }}{% if model.customer.contact is not empty %} / {{ model.customer.contact }}{% endif %}
|
||||
{% if invoice['customer.number'] is not empty %}
|
||||
[{{ invoice['customer.number'] }}]
|
||||
{% endif %}
|
||||
{{ invoice['customer.name'] }}
|
||||
{% if invoice['customer.contact'] is not empty %}
|
||||
/ {{ invoice['customer.contact'] }}
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% if project is not null %}
|
||||
{% if invoice['query.project.name'] is defined %}
|
||||
<tr>
|
||||
<th class="ps-0">{{ 'project'|trans }}</th>
|
||||
<td contenteditable="true">
|
||||
{{ project.name }}
|
||||
{% if project.orderNumber is not empty %}
|
||||
({{ 'orderNumber'|trans }}: {{ project.orderNumber }})
|
||||
{{ invoice['query.project.name'] }}
|
||||
{% if invoice['query.project.order_number'] is not empty %}
|
||||
({{ 'orderNumber'|trans }}: {{ invoice['query.project.order_number'] }})
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% if activity is not null %}
|
||||
{% if invoice['query.activity.name'] is defined %}
|
||||
<tr>
|
||||
<th class="ps-0">{{ 'activity'|trans }}</th>
|
||||
<td contenteditable="true">
|
||||
{{ activity.name }}
|
||||
{{ invoice['query.activity.name'] }}
|
||||
</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row invoice-items mt-2 mb-3">
|
||||
<div class="col-xs-12 table-responsive">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ 'date'|trans }}</th>
|
||||
{% if model.query.user is empty %}
|
||||
{% if invoice['user.see_others'] %}
|
||||
<th>{{ 'user'|trans }}</th>
|
||||
{% endif %}
|
||||
<th>{{ 'activity'|trans }}</th>
|
||||
@@ -90,44 +93,48 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for entry in model.calculator.entries %}
|
||||
{% for timesheet in entries %}
|
||||
<tr>
|
||||
<td>{{ entry.begin|date_short }}</td>
|
||||
{% if model.query.user is empty %}
|
||||
<td>{{ entry.user.displayName }}</td>
|
||||
<td>{{ timesheet['entry.begin'] }}</td>
|
||||
{% if invoice['user.see_others'] %}
|
||||
<td>{{ timesheet['entry.user_display'] }}</td>
|
||||
{% endif %}
|
||||
<td contenteditable="true">
|
||||
{% if entry.description is not empty %}
|
||||
{{ entry.description|nl2br }}
|
||||
{% if timesheet['entry.description'] is not empty %}
|
||||
{{ timesheet['entry.description']|nl2br }}
|
||||
{% else %}
|
||||
{% if entry.activity is not null %}{{ entry.activity.name }} / {% endif %}{{ entry.project.name }}
|
||||
{% if timesheet['entry.activity'] is defined %}
|
||||
{{ timesheet['entry.activity'] }} /
|
||||
{% endif %}
|
||||
{{ timesheet['entry.project'] }}
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="text-right text-nowrap">{{ entry.duration|duration(isDecimal) }}</td>
|
||||
<td class="text-right text-nowrap">{{ timesheet['entry.amount'] }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th></th>
|
||||
{% if model.query.user is empty %}
|
||||
{% if invoice['user.see_others'] %}
|
||||
<th></th>
|
||||
{% endif %}
|
||||
<th>{{ 'invoice.total_working_time'|trans }}</th>
|
||||
<th class="text-right text-nowrap">{{ model.calculator.timeWorked|duration(isDecimal) }}</th>
|
||||
<th class="text-right text-nowrap">{{ invoice['invoice.duration_decimal'] }}</th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
{% if model.template.paymentTerms is not empty %}
|
||||
{% if invoice['template.payment_terms'] is not empty %}
|
||||
<p class="lead">{{ 'payment_terms'|trans }}</p>
|
||||
|
||||
<p class="text-muted well well-sm no-shadow" contenteditable="true" style="margin-bottom: 100px">
|
||||
{{ model.template.paymentTerms|trim|nl2br }}
|
||||
</p>
|
||||
<div class="paymentTerms" contenteditable="true" style="margin-bottom: 100px">
|
||||
{{ invoice['template.payment_terms']|md2html }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="table-responsive">
|
||||
@@ -136,6 +143,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</section>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user