Release 2.0.15 (#3970)

This commit is contained in:
Kevin Papst
2023-04-16 00:44:00 +02:00
committed by GitHub
parent ecd8ee85f3
commit 046ed313c9
42 changed files with 796 additions and 935 deletions

View File

@@ -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>