* improve console version output
* fix empty string issue in csv export (DDE protection) - fixes #3189
* fix twig sort deprecation in php 8
* sort user by displayName in users report
* fix missing custom translations in edit modal
* fix font-family in invoice.css
* invoice template "freelancer pdf" - added customer number, moved some fields around
* invoice template "default" - relocate customer number and order number in
This commit is contained in:
Kevin Papst
2022-03-11 23:25:23 +01:00
committed by GitHub
parent 317ac59f47
commit 00b5a65859
21 changed files with 363 additions and 300 deletions

View File

@@ -1,6 +1,8 @@
<!DOCTYPE html>
<html lang="{{ app.request.locale }}">
<head></head>
<head>
<title>{% block page_title %}{{- get_title() -}}{% endblock %}</title>
</head>
<body class="ajax-forms">
<div id="ajax-messages">
{{ include('@AdminLTE/Partials/_flash_messages.html.twig') }}

View File

@@ -47,7 +47,7 @@ mpdf-->
<div class="wrapper">
<table class="addresses">
<tr>
<td width="60%">
<td style="width:60%">
{{ 'invoice.to'|trans }}
<br>
<strong>{{ model.customer.company|default(model.customer.name) }}</strong>
@@ -57,14 +57,6 @@ mpdf-->
<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 %}
</td>
<td>
{{ 'invoice.from'|trans }}
@@ -82,12 +74,24 @@ mpdf-->
</table>
<p>
<strong>{{ 'invoice.number'|trans }}:</strong>
{{ 'invoice.number'|trans }}:
{{ model.invoiceNumber }}
<br>
<strong>{{ 'invoice.due_days'|trans }}:</strong>
{{ 'invoice.due_days'|trans }}:
{{ model.dueDate|date_short }}
{% 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 %}
</p>
<table class="items">

View File

@@ -18,6 +18,9 @@
<tr>
<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 }}
{% endif %}
</td>
<td class="text-small text-right">
{{ 'export.page_of'|trans({'%page%': '{PAGENO}', '%pages%': '{nb}'}) }}
@@ -56,39 +59,43 @@ mpdf-->
<td>
<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 %}
</td>
<td class="text-right">
{% set classLeft = 'text-left' %}
{% set classRight = 'text-right text-nowrap padding-left' %}
<table style="width: 240px">
<tr>
<td>{{ 'label.date'|trans }}:</td>
<td class="text-nowrap padding-left">{{ model.invoiceDate|date_short }}</td>
<td class="{{ classLeft }}">{{ 'label.date'|trans }}</td>
<td class="{{ classRight }}">{{ model.invoiceDate|date_short }}</td>
</tr>
<tr>
<td>{{ 'invoice.service_date'|trans }}:</td>
<td class="text-nowrap padding-left">{{ model.query.end|month_name }} {{ model.query.end|date('Y') }}</td>
<td class="{{ classLeft }}">{{ 'invoice.service_date'|trans }}</td>
<td class="{{ classRight }}">{{ model.query.end|month_name }} {{ model.query.end|date('Y') }}</td>
</tr>
<tr>
<td>{{ 'invoice.number'|trans }}:</td>
<td class="text-nowrap padding-left">{{ model.invoiceNumber }}</td>
<td class="{{ classLeft }}">{{ 'invoice.number'|trans }}</td>
<td class="{{ classRight }}">{{ model.invoiceNumber }}</td>
</tr>
<tr>
<td>{{ 'invoice.due_days'|trans }}:</td>
<td class="text-nowrap padding-left">{{ model.dueDate|date_short }}</td>
<td class="{{ classLeft }}">{{ 'invoice.due_days'|trans }}</td>
<td class="{{ classRight }}">{{ model.dueDate|date_short }}</td>
</tr>
{% if model.query.project is not empty and model.query.project.orderNumber is not empty %}
{% if model.customer.number is not empty %}
<tr>
<td>{{ 'label.orderNumber'|trans }}</td>
<td class="text-nowrap padding-left">{{ model.query.project.orderNumber }}</td>
<td class="{{ classLeft }}">{{ 'label.number'|trans }}</td>
<td class="{{ classRight }}">{{ model.customer.number }}</td>
</tr>
{% endif %}
{% if model.template.vatId is not empty %}
{% if model.query.project is not empty and model.query.project.orderNumber is not empty %}
<tr>
<td>{{ 'label.vat_id'|trans }}:</td>
<td class="text-nowrap padding-left">{{ model.template.vatId }}</td>
<td class="{{ classLeft }}">{{ 'label.orderNumber'|trans }}</td>
<td class="{{ classRight }}">{{ model.query.project.orderNumber }}</td>
</tr>
{% endif %}
{% if model.customer.vatId is not empty %}
<tr>
<td class="{{ classLeft }}">{{ 'label.vat_id'|trans }}</td>
<td class="{{ classRight }}">{{ model.customer.vatId }}</td>
</tr>
{% endif %}
</table>

View File

@@ -528,7 +528,7 @@
<td class="avatars">
{% set teamHiddenId = 'team_' ~ team.id ~ '_hiddenUser' ~ random() %}
{% set counter = 0 %}
{% for member in members|sort((a, b) => a.teamlead < b.teamlead) %}
{% for member in members|sort((a, b) => b.teamlead <=> a.teamlead) %}
{% set user = member.user %}
{% if member.teamlead %}
{{ _self.user_avatar(user, ('label.teamlead'|trans ~ ': ' ~ user.displayName), 'teamlead') }}

View File

@@ -158,7 +158,7 @@
{% endfor %}
</tr>
{% set yearTotal = 0 %}
{% for userYearStat in userYearStats|sort((a, b) => a.duration <= b.duration) %}
{% for userYearStat in userYearStats|sort((a, b) => b.duration <=> a.duration) %}
{% set user = userYearStat.user %}
{% set userYear = userYearStat.year %}
{% set userTotal = userYearStat.duration %}
@@ -216,7 +216,7 @@
<div class="row">
<div class="col-xs-12 col-sm-9 col-md-8 col-lg-6">
<table class="table table-hover dataTable">
{% for stat in activities|sort((a, b) => a.duration <= b.duration) %}
{% for stat in activities|sort((a, b) => b.duration <=> a.duration) %}
{% set dataset = dataset|merge([{'value': stat.duration, 'name': stat.name, 'color': stat.activity.color|colorize(stat.activity.name), 'duration': stat.duration|duration, 'rate': stat.rate|money(currency)}]) %}
{% set percentage = 0 %}
{% if totalDuration > 0 and stat.duration > 0 %}
@@ -413,7 +413,7 @@
{% set totalDuration = 0 %}
{% set datasets = [] %}
{% set labels = [] %}
{% for userStat in project_details.userStats|sort((a, b) => a.duration <= b.duration) %}
{% for userStat in project_details.userStats|sort((a, b) => b.duration <=> a.duration) %}
{% set user = userStat.user %}
{% set color = user.color|colorize(user.displayName) %}
{% set rateTotal = rateTotal + userStat.rate %}

View File

@@ -26,7 +26,7 @@
</tr>
</thead>
<tbody>
{% for userPeriod in stats|filter(row => row.user is not null) %}
{% for userPeriod in stats|filter(row => row.user is not null)|sort((a,b) => a.user.displayName|lower <=> b.user.displayName|lower) %}
{% set usersTotalDuration = 0 %}
{% set usersTotalInternalRate = 0 %}
{% set usersTotalRate = 0 %}