Next major version 2 with PHP 8.1, Symfony 6, Tabler UI, 2FA ... (#2902)

This commit is contained in:
Kevin Papst
2022-12-31 21:19:55 +01:00
committed by GitHub
parent 95e06746bd
commit 90a0fd8a22
2164 changed files with 83700 additions and 86426 deletions

View File

@@ -1,13 +1,14 @@
<!DOCTYPE html>
{% set fallback = app.request is not null ? app.request.locale : 'en' %}
{% set language = model.template.language|default(fallback) %}
{% set isDecimal = model.template.decimalDuration|default(false) %}
{% set currency = model.currency %}
{%- 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 }}">
<head>
<meta charset="UTF-8">
<title>{% block title %}{{ model.invoiceNumber }}-{{ model.customer.company|default(model.customer.name)|u.snake }}{% endblock %}</title>
<style type="text/css">
<style>
{{ encore_entry_css_source('invoice-pdf')|raw }}
</style>
</head>
@@ -20,7 +21,7 @@
{{ model.template.title }}
</td>
<td class="date text-right">
{{ 'label.date'|trans }}: {{ model.invoiceDate|date_short }}
{{ 'date'|trans }}: {{ model.invoiceDate|date_short }}
</td>
</tr>
</table>
@@ -30,10 +31,10 @@
<table class="footer">
<tr>
<td>
<strong>{{ 'label.contact'|trans }}</strong>:
<strong>{{ 'contact'|trans }}</strong>:
{{ model.template.contact|nl2str(' &ndash; ') }}
<br>
<strong>{{ 'label.invoice_bank_account'|trans }}</strong>:
<strong>{{ 'invoice_bank_account'|trans }}</strong>:
{{ model.template.paymentDetails|nl2str(' &ndash; ') }}
</td>
<td align="right">
@@ -44,7 +45,6 @@
</htmlpagefooter>
<sethtmlpagefooter page="ALL" value="on" name="footer" show-this-page="1" />
mpdf-->
<div class="wrapper">
<table class="addresses">
<tr>
<td style="width:60%">
@@ -55,7 +55,7 @@ mpdf-->
{{ model.customer.address|nl2br }}
{% if model.customer.vatId is not empty %}
<br>
{{ 'label.vat_id'|trans }}: {{ model.customer.vatId }}
{{ 'vat_id'|trans }}: {{ model.customer.vatId }}
{% endif %}
</td>
<td>
@@ -66,7 +66,7 @@ mpdf-->
{{ model.template.address|trim|nl2br }}
{% if model.template.vatId is not empty %}
<br>
{{ 'label.vat_id'|trans }}:
{{ 'vat_id'|trans }}:
{{ model.template.vatId }}
{% endif %}
</td>
@@ -83,25 +83,29 @@ mpdf-->
{% if model.customer.number is not empty %}
<br>
{{ 'label.number'|trans }}:
{{ 'number'|trans }}:
{{ model.customer.number }}
{% endif %}
{% if model.query.project is not empty and model.query.project.orderNumber is not empty %}
{% if project is not null and project.orderNumber is not empty %}
<br>
{{ 'label.orderNumber'|trans }}:
{{ model.query.project.orderNumber }}
{{ 'orderNumber'|trans }}:
{{ project.orderNumber }}
{% endif %}
</p>
{% if model.customer.invoiceText is not empty%}
<p>{{ model.customer.invoiceText|md2html }}</p>
{% endif %}
<table class="items">
<thead>
<tr>
<th class="first"><strong>{{ 'label.date'|trans }}</strong></th>
<th><strong>{{ 'label.description'|trans }}</strong></th>
<th class="text-right"><strong>{{ 'label.unit_price'|trans }}</strong></th>
<th class="text-right"><strong>{{ 'label.amount'|trans }}</strong></th>
<th class="last text-right"><strong>{{ 'label.total_rate'|trans }}</strong></th>
<th class="first"><strong>{{ 'date'|trans }}</strong></th>
<th><strong>{{ 'description'|trans }}</strong></th>
<th class="text-right"><strong>{{ 'unit_price'|trans }}</strong></th>
<th class="text-right"><strong>{{ 'amount'|trans }}</strong></th>
<th class="last text-right"><strong>{{ 'total_rate'|trans }}</strong></th>
</tr>
</thead>
<tbody>
@@ -114,7 +118,7 @@ mpdf-->
{% else %}
{% set rate = entry.hourlyRate %}
{% endif %}
<tr{# class="{{ cycle(['odd', 'even'], id) }}"#}>
<tr>
<td nowrap class="first text-nowrap">{{ entry.begin|date_short }}</td>
<td contenteditable="true">
{% if entry.description is not empty %}
@@ -160,6 +164,5 @@ mpdf-->
{{ model.template.paymentTerms|md2html }}
</div>
{% endif %}
</div>
</body>
</html>

View File

@@ -1,13 +1,14 @@
{% extends 'invoice/layout.html.twig' %}
{% block invoice %}
{% set isDecimal = model.template.decimalDuration|default(false) %}
{% set isDecimal = true %}
{% set currency = model.currency %}
{% set project = model.query.project %}
<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>
<small class="pull-right">{{ 'date'|trans }}: {{ model.invoiceDate|date_short }}</small>
</h2>
</div>
</div>
@@ -20,15 +21,15 @@
{{ model.customer.address|nl2br }}
{% if model.customer.vatId is not empty %}
<br>
{{ 'label.vat_id'|trans }}: {{ model.customer.vatId }}
{{ 'vat_id'|trans }}: {{ model.customer.vatId }}
{% endif %}
{% if model.customer.number is not empty %}
<br>
{{ 'label.number'|trans }}: {{ model.customer.number }}
{{ 'number'|trans }}: {{ model.customer.number }}
{% endif %}
{% if model.query.project is not empty and model.query.project.orderNumber is not empty %}
{% if project is not null and project.orderNumber is not empty %}
<br>
{{ 'label.orderNumber'|trans }}: {{ model.query.project.orderNumber }}
{{ 'orderNumber'|trans }}: {{ project.orderNumber }}
{% endif %}
</address>
</div>
@@ -40,7 +41,7 @@
{{ model.template.address|trim|nl2br }}
{% if model.template.vatId is not empty %}
<br>
{{ 'label.vat_id'|trans }}:
{{ 'vat_id'|trans }}:
{{ model.template.vatId }}
{% endif %}
</address>
@@ -66,11 +67,11 @@
<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>
<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>
@@ -91,32 +92,32 @@
{% if entry.activity is not null %}{{ entry.activity.name }} / {% endif %}{{ entry.project.name }}
{% 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="text-nowrap text-right">{{ entry.rate|money(currency) }}</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-right">
<td colspan="4" class="text-end">
{{ 'invoice.subtotal'|trans }}
</td>
<td class="text-right">{{ model.calculator.subtotal|money(currency) }}</td>
<td class="text-end">{{ model.calculator.subtotal|money(currency) }}</td>
</tr>
<tr>
<td colspan="4" class="text-right">
<td colspan="4" class="text-end">
{{ 'invoice.tax'|trans }} ({{ model.calculator.vat }}%)
</td>
<td class="text-right">{{ model.calculator.tax|money(currency) }}</td>
<td class="text-end">{{ model.calculator.tax|money(currency) }}</td>
</tr>
{% endif %}
<tr>
<td colspan="4" class="text-right text-nowrap">
<td colspan="4" class="text-end text-nowrap">
<strong>{{ 'invoice.total'|trans }}</strong>
</td>
<td class="text-right">
<td class="text-end">
<strong>{{ model.calculator.total|money(currency) }}</strong>
</td>
</tr>
@@ -137,11 +138,11 @@
<footer class="footer">
<p>
<strong>{{ 'label.address'|trans }}</strong>: {{ model.template.company }} &ndash; {{ model.template.address|nl2str(' &ndash; ') }}
<strong>{{ 'address'|trans }}</strong>: {{ model.template.company }} &ndash; {{ model.template.address|nl2str(' &ndash; ') }}
<br>
<strong>{{ 'label.invoice_bank_account'|trans }}</strong>: {{ model.template.paymentDetails|nl2str(' &ndash; ') }}
<strong>{{ 'invoice_bank_account'|trans }}</strong>: {{ model.template.paymentDetails|nl2str(' &ndash; ') }}
<br>
<strong>{{ 'label.contact'|trans }}</strong>: {{ model.template.contact|nl2str(' &ndash; ') }}
<strong>{{ 'contact'|trans }}</strong>: {{ model.template.contact|nl2str(' &ndash; ') }}
</p>
</footer>
{% endblock %}

View File

@@ -1,6 +0,0 @@
{% set items = [] %}
{% for entry in entries %}
{% set items = items|merge([entry]) %}
{% endfor %}
{% set json = invoice|merge({'items': items}) %}
{{ json|json_encode|raw}}

View File

@@ -1,13 +1,14 @@
<!DOCTYPE html>
{% set fallback = app.request is not null ? app.request.locale : 'en' %}
{% set language = model.template.language|default(fallback) %}
{% set isDecimal = model.template.decimalDuration|default(false) %}
{% set currency = model.currency %}
{%- 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 }}">
<head>
<meta charset="UTF-8">
<title>{% block title %}{{ model.invoiceNumber }}-{{ model.customer.company|default(model.customer.name)|u.snake }}{% endblock %}</title>
<style type="text/css">
<style>
{{ encore_entry_css_source('invoice-pdf')|raw }}
</style>
</head>
@@ -19,7 +20,7 @@
<td class="text-small">
{{ model.template.company }} &ndash; {{ model.template.address|nl2str(' &ndash; ') }}
{% if model.template.vatId is not empty %}
&ndash; {{ 'label.vat_id'|trans }}: {{ model.template.vatId }}
&ndash; {{ 'vat_id'|trans }}: {{ model.template.vatId }}
{% endif %}
</td>
<td class="text-small text-right">
@@ -33,18 +34,18 @@
<table class="footer text-small">
<tr>
<td style="width: 33%">
<strong>{{ 'label.address'|trans }}</strong>
<strong>{{ 'address'|trans }}</strong>
<br>
{{ model.template.company }}<br>
{{ model.template.address|nl2br }}
</td>
<td class="text-center">
<strong>{{ 'label.invoice_bank_account'|trans }}</strong>
<strong>{{ 'invoice_bank_account'|trans }}</strong>
<br>
{{ model.template.paymentDetails|nl2br }}
</td>
<td class="text-right" style="width: 33%">
<strong>{{ 'label.contact'|trans }}</strong>
<strong>{{ 'contact'|trans }}</strong>
<br>
{{ model.template.contact|nl2br }}
</td>
@@ -53,7 +54,6 @@
</htmlpagefooter>
<sethtmlpagefooter page="ALL" value="on" name="footer" show-this-page="1" />
mpdf-->
<div class="wrapper">
<table class="addresses">
<tr>
<td>
@@ -65,7 +65,7 @@ mpdf-->
{% set classRight = 'text-right text-nowrap padding-left' %}
<table style="width: 240px">
<tr>
<td class="{{ classLeft }}">{{ 'label.date'|trans }}</td>
<td class="{{ classLeft }}">{{ 'date'|trans }}</td>
<td class="{{ classRight }}">{{ model.invoiceDate|date_short }}</td>
</tr>
<tr>
@@ -82,19 +82,19 @@ mpdf-->
</tr>
{% if model.customer.number is not empty %}
<tr>
<td class="{{ classLeft }}">{{ 'label.number'|trans }}</td>
<td class="{{ classLeft }}">{{ 'number'|trans }}</td>
<td class="{{ classRight }}">{{ model.customer.number }}</td>
</tr>
{% endif %}
{% if model.query.project is not empty and model.query.project.orderNumber is not empty %}
{% if project is not null and project.orderNumber is not empty %}
<tr>
<td class="{{ classLeft }}">{{ 'label.orderNumber'|trans }}</td>
<td class="{{ classRight }}">{{ model.query.project.orderNumber }}</td>
<td class="{{ classLeft }}">{{ 'orderNumber'|trans }}</td>
<td class="{{ classRight }}">{{ project.orderNumber }}</td>
</tr>
{% endif %}
{% if model.customer.vatId is not empty %}
<tr>
<td class="{{ classLeft }}">{{ 'label.vat_id'|trans }}</td>
<td class="{{ classLeft }}">{{ 'vat_id'|trans }}</td>
<td class="{{ classRight }}">{{ model.customer.vatId }}</td>
</tr>
{% endif %}
@@ -105,13 +105,17 @@ mpdf-->
<h2 style="margin-top: 60px">{{ model.template.title }}</h2>
{% if model.customer.invoiceText is not empty%}
<p>{{ model.customer.invoiceText|md2html }}</p>
{% endif %}
<table class="items">
<thead>
<tr>
<th class="first">{{ 'label.description'|trans }}</th>
<th class="text-right">{{ 'label.unit_price'|trans }}</th>
<th class="text-right">{{ 'label.amount'|trans }}</th>
<th class="last text-right">{{ 'label.total_rate'|trans }}</th>
<th class="first">{{ 'description'|trans }}</th>
<th class="text-right">{{ 'unit_price'|trans }}</th>
<th class="text-right">{{ 'amount'|trans }}</th>
<th class="last text-right">{{ 'total_rate'|trans }}</th>
</tr>
</thead>
<tbody>
@@ -170,6 +174,5 @@ mpdf-->
{{ model.template.paymentTerms|md2html }}
</p>
{% endif %}
</div>
</body>
</html>

View File

@@ -1,15 +0,0 @@
{% for key, value in invoice %}
{{ key }}
{% if value is not empty %}
{{ value|multiline_indent(' ') }}
{% endif %}
{% endfor %}
{% for entry in entries %}
---
{% for key, value in entry %}
{{ key }}
{% if value is not empty %}
{{ value|multiline_indent(' ') }}
{% endif %}
{% endfor %}
{% endfor %}

View File

@@ -2,7 +2,9 @@
{% extends 'invoice/layout.html.twig' %}
{% block invoice %}
{% set isDecimal = model.template.decimalDuration|default(false) %}
{% set isDecimal = true %}
{% set project = model.query.project %}
{% set activity = model.query.activity %}
<div class="row">
<div class="col-xs-12">
<h2 class="page-header">
@@ -13,7 +15,7 @@
<div class="row">
<div class="col-xs-12">
<table class="table no-border table-condensed">
<table class="table no-border table-sm">
<tr>
<th>{{ 'invoice.from'|trans }}</th>
<td contenteditable="true">
@@ -25,7 +27,7 @@
</td>
</tr>
<tr>
<th>{{ 'label.date'|trans }}</th>
<th>{{ '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 }}
@@ -35,28 +37,28 @@
</td>
</tr>
<tr>
<th>{{ 'label.customer'|trans }}</th>
<th>{{ '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 %}
</td>
</tr>
{% if model.query.project is not empty %}
{% if project is not null %}
<tr>
<th>{{ 'label.project'|trans }}</th>
<th>{{ 'project'|trans }}</th>
<td contenteditable="true">
{{ model.query.project.name }}
{% if model.query.project.orderNumber is not empty %}
({{ 'label.orderNumber'|trans }}: {{ model.query.project.orderNumber }})
{{ project.name }}
{% if project.orderNumber is not empty %}
({{ 'orderNumber'|trans }}: {{ project.orderNumber }})
{% endif %}
</td>
</tr>
{% endif %}
{% if model.query.activity is not empty %}
{% if activity is not null %}
<tr>
<th>{{ 'label.activity'|trans }}</th>
<th>{{ 'activity'|trans }}</th>
<td contenteditable="true">
{{ model.query.activity.name }}
{{ activity.name }}
</td>
</tr>
{% endif %}
@@ -69,12 +71,12 @@
<table class="table table-striped">
<thead>
<tr>
<th>{{ 'label.date'|trans }}</th>
<th>{{ 'date'|trans }}</th>
{% if model.query.user is empty %}
<th>{{ 'label.user'|trans }}</th>
<th>{{ 'user'|trans }}</th>
{% endif %}
<th>{{ 'label.activity'|trans }}</th>
<th class="text-right">{{ 'label.hours'|trans }}</th>
<th>{{ 'activity'|trans }}</th>
<th class="text-right">{{ 'hours'|trans }}</th>
</tr>
</thead>
<tbody>
@@ -112,7 +114,7 @@
<div class="row">
<div class="col-xs-12">
{% if model.template.paymentTerms is not empty %}
<p class="lead">{{ 'label.payment_terms'|trans }}</p>
<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 }}

View File

@@ -1,19 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<kimai version="{{ constant('App\\Constants::VERSION') }}">
{% for key, value in invoice %}
<{{ key }}{% if value is empty %}/>{% else %}>{{ value|escape }}</{{ key }}>{% endif %}
{% endfor %}
<items>
{%- for entry in entries %}
<item>
{% for key, value in entry %}
<{{ key }}{% if value is empty %}/>{% else %}>{{ value|escape }}</{{ key }}>{% endif %}
{% endfor %}
</item>
{%- endfor %}
</items>
</kimai>