diff --git a/src/Entity/Application.php b/src/Entity/Application.php
index 9acab6d..bc4e539 100644
--- a/src/Entity/Application.php
+++ b/src/Entity/Application.php
@@ -117,4 +117,30 @@ class Application implements TimestampableEntityInterface
return $this;
}
+
+ public function matchesPickup(): bool
+ {
+ if (0 === $pickupId = (int) $this->getAssignment()->getPickup()) {
+ return true;
+ }
+
+ $teamer = $this->getTeamer();
+
+ return $teamer->hasPickup($pickupId);
+ }
+
+ public function getCompletedTrainingsCount(): int
+ {
+ $count = 0;
+ $requiredTrainings = $this->getAssignment()->getJobProfile()->getRequiredTrainings();
+ $teamer = $this->getTeamer();
+
+ foreach ($requiredTrainings as $requiredTraining) {
+ if ($teamer->getTrainingAttendance($requiredTraining)) {
+ ++$count;
+ }
+ }
+
+ return $count;
+ }
}
diff --git a/src/Entity/Assignment.php b/src/Entity/Assignment.php
index 982901b..8be5a10 100644
--- a/src/Entity/Assignment.php
+++ b/src/Entity/Assignment.php
@@ -172,7 +172,7 @@ class Assignment implements BlameableEntityInterface, TimestampableEntityInterfa
return $this;
}
- public function getTotalPeriod(): ?CarbonPeriod
+ public function getEffectivePeriod(): ?CarbonPeriod
{
if (null !== $destination = $this->getDestination()) {
$dateFrom = $this->getDateFrom() ?? $destination->getDateFrom();
diff --git a/src/EventListener/DispositionWorkflowGuardSubscriber.php b/src/EventListener/DispositionWorkflowGuardSubscriber.php
index 85d12c3..22b3317 100644
--- a/src/EventListener/DispositionWorkflowGuardSubscriber.php
+++ b/src/EventListener/DispositionWorkflowGuardSubscriber.php
@@ -43,7 +43,7 @@ class DispositionWorkflowGuardSubscriber implements EventSubscriberInterface
/** @var Disposition $disposition */
$disposition = $event->getSubject();
$assignment = $disposition->getAssignment();
- $assignmentPeriod = $assignment->getTotalPeriod();
+ $assignmentPeriod = $assignment->getEffectivePeriod();
$today = new \DateTimeImmutable();
$dueDateFrom = $disposition->getCreatedAt()->modify('+ 7days');
diff --git a/src/Service/Pdf/ContractRenderer.php b/src/Service/Pdf/ContractRenderer.php
index 84fdb76..b092bbe 100644
--- a/src/Service/Pdf/ContractRenderer.php
+++ b/src/Service/Pdf/ContractRenderer.php
@@ -39,8 +39,8 @@ class ContractRenderer extends AbstractPdfRenderer
$pdf->Text(21,104.5, utf8_decode($assignment->getJobProfile()->getName()));
// Period
- $dateFrom = $assignment->getTotalPeriod()->start->format('d.m.Y');
- $dateTo = $assignment->getTotalPeriod()->end->format('d.m.Y');
+ $dateFrom = $assignment->getEffectivePeriod()->start->format('d.m.Y');
+ $dateTo = $assignment->getEffectivePeriod()->end->format('d.m.Y');
$period = sprintf('%s - %s', $dateFrom, $dateTo);
$pdf->Text(57,113, $period);
diff --git a/src/Service/Pdf/InvoiceRenderer.php b/src/Service/Pdf/InvoiceRenderer.php
index a92be21..fb712aa 100644
--- a/src/Service/Pdf/InvoiceRenderer.php
+++ b/src/Service/Pdf/InvoiceRenderer.php
@@ -37,7 +37,7 @@ class InvoiceRenderer extends AbstractPdfRenderer
// Invoice number
$pdf->SetFont('Arial', '', 12);
- $number = $assignment->getTotalPeriod()->start->format('d/m/Y');
+ $number = $assignment->getEffectivePeriod()->start->format('d/m/Y');
$pdf->Text(85,116, $number);
$pdf->SetFont('Arial', '', 10);
diff --git a/src/Twig/AppRuntime.php b/src/Twig/AppRuntime.php
index c2bc698..1946230 100644
--- a/src/Twig/AppRuntime.php
+++ b/src/Twig/AppRuntime.php
@@ -58,7 +58,7 @@ class AppRuntime implements RuntimeExtensionInterface
return 'unbekannt';
}
- return $pickup->getCity();
+ return 'ab '.$pickup->getCity();
}
public function fileIconFilter(Environment $environment, string $mimeType, ?string $classes = 'w-4 h-4'): string
diff --git a/templates/_partials/_assignment_info.html.twig b/templates/_partials/_assignment_info.html.twig
index beddd94..20c1cfc 100644
--- a/templates/_partials/_assignment_info.html.twig
+++ b/templates/_partials/_assignment_info.html.twig
@@ -17,7 +17,7 @@
Einsatztermin
- {{ assignment.totalPeriod.start|date('d.m.Y') }} - {{ assignment.totalPeriod.end|date('d.m.Y') }}
+ {{ assignment.effectivePeriod.start|date('d.m.Y') }} - {{ assignment.effectivePeriod.end|date('d.m.Y') }}
{% if assignment.pickup and assignment.pickupDate %}
diff --git a/templates/_partials/_assignment_info_compact.html.twig b/templates/_partials/_assignment_info_compact.html.twig
index c0fa15b..8c44310 100644
--- a/templates/_partials/_assignment_info_compact.html.twig
+++ b/templates/_partials/_assignment_info_compact.html.twig
@@ -15,7 +15,7 @@
Einsatztermin
- {{ assignment.totalPeriod.start|date('d.m.Y') }} - {{ assignment.totalPeriod.end|date('d.m.Y') }}
+ {{ assignment.effectivePeriod.start|date('d.m.Y') }} - {{ assignment.effectivePeriod.end|date('d.m.Y') }}
diff --git a/templates/_partials/_assignment_requirements_info.html.twig b/templates/_partials/_assignment_requirements_info.html.twig
index a3f56be..06327d4 100644
--- a/templates/_partials/_assignment_requirements_info.html.twig
+++ b/templates/_partials/_assignment_requirements_info.html.twig
@@ -1,8 +1,8 @@
- {% if assignment.pickup and assignment.pickupDate %}
+ {% if assignment.pickup and assignment.effectivePickupDate %}
-
-
Busbegleitung ab {{ assignment.pickup|bpn_pickup_label }} am {{ assignment.pickupDate|date('d.m.Y') }}
+
Busbegleitung ab {{ assignment.pickup|bpn_pickup_label }} am {{ assignment.effectivePickupDate|date('d.m.Y') }}
{% if teamer.hasPickup(assignment.pickup) %}
{{ icon('check', 'w-5 h-5 text-emerald-500') }}
{% else %}
diff --git a/templates/admin/application/index.html.twig b/templates/admin/application/index.html.twig
index 3b08800..1073b37 100644
--- a/templates/admin/application/index.html.twig
+++ b/templates/admin/application/index.html.twig
@@ -12,10 +12,7 @@
|
- {{ knp_pagination_sortable(pagination, 'Einsatzbeginn', 'destination.dateFrom') }}
- |
-
- {{ knp_pagination_sortable(pagination, 'Einsatzende', 'destination.dateTo') }}
+ {{ knp_pagination_sortable(pagination, 'Einsatzzeitraum', 'destination.dateFrom') }}
|
{{ knp_pagination_sortable(pagination, 'Jobprofil', 'job_profile.name') }}
@@ -24,7 +21,7 @@
{{ knp_pagination_sortable(pagination, 'Destination', 'destination.product') }}
|
- {{ knp_pagination_sortable(pagination, 'Busbegleitung ab', 'destination.pickup') }}
+ {{ knp_pagination_sortable(pagination, 'Bus', 'destination.pickup') }}
|
{{ knp_pagination_sortable(pagination, 'Bewerber*in', 'teamer.lastName') }}
@@ -37,34 +34,54 @@
{% set assignment = application.assignment %}
|
|
- {{ assignment.destination.dateFrom|date('d.m.Y') }}
+
+ {{ assignment.effectivePeriod.start|date('d.m.Y') }} -
+ {{ assignment.effectivePeriod.end|date('d.m.Y') }}
+
|
- {{ assignment.destination.dateTo|date('d.m.Y') }}
+
+ {{ assignment.jobProfile.name }}
+
|
- {{ assignment.jobProfile.name }}
+
+ {{ assignment.destination.product }}
+
+ {{ assignment.destination.hotel }}
+
|
- {{ assignment.destination.product }}
-
- {{ assignment.destination.hotel }}
+
+ {{ assignment.pickup ? assignment.pickup|bpn_pickup_label : '-' }}
+
+ {{ assignment.effectivePickupDate ? assignment.effectivePickupDate|date('d.m.Y') : '' }}
+
|
- {{ assignment.pickup ? assignment.pickup|bpn_pickup_label : '-' }}
+
+ {{ application.teamer }}
+
|
- {{ application.teamer }}
- |
-
-
+
+ {% if assignment.pickup %}
+ {% if application.matchesPickup %}
+ {{ icon('bus', 'w-5 h-5 text-green-500 shrink-0') }}
+ {% else %}
+ {{ icon('bus', 'w-5 h-5 text-red-500 shrink-0') }}
+ {% endif %}
+ {% endif %}
+ {% set requiredTrainingsCount = assignment.jobProfile.requiredTrainings|length %}
+ {% if requiredTrainingsCount > 0 %}
+ {{ application.completedTrainingsCount }}/{{ requiredTrainingsCount }}
+ {% endif %}
+
|
{% else %}
- |
+ |
Keine Daten...
|
diff --git a/templates/admin/assignment/detail.html.twig b/templates/admin/assignment/detail.html.twig
index 1d6182c..9b45b2f 100644
--- a/templates/admin/assignment/detail.html.twig
+++ b/templates/admin/assignment/detail.html.twig
@@ -65,7 +65,7 @@
'title': 'Bewerbungsstatus bearbeiten',
'url': path('app_admin_application_status', { 'uuid': application.uuid })
}) }}>
- Status ändern
+ Status
{% endif %}
{% if is_granted('DELETE', application) %}
diff --git a/templates/admin/assignment/index.html.twig b/templates/admin/assignment/index.html.twig
index 33a32e3..dcf28ee 100644
--- a/templates/admin/assignment/index.html.twig
+++ b/templates/admin/assignment/index.html.twig
@@ -12,10 +12,7 @@
|
- {{ knp_pagination_sortable(pagination, 'Einsatzbeginn', 'assignment.dateFrom') }}
- |
-
- {{ knp_pagination_sortable(pagination, 'Einsatzende', 'assignment.dateTo') }}
+ {{ knp_pagination_sortable(pagination, 'Einsatzzeitraum', 'assignment.dateFrom') }}
|
{{ knp_pagination_sortable(pagination, 'Jobprofil', 'assignment.jobProfile') }}
@@ -36,15 +33,10 @@
{% for assignment in pagination %}
|
|
- {% set dateFrom = assignment.dateFrom ? assignment.dateFrom : assignment.destination.dateFrom %}
- {{ dateFrom|date('d.m.Y') }}
-
- |
-
- {% set dateTo = assignment.dateTo ? assignment.dateTo : assignment.destination.dateTo %}
-
- {{ dateTo|date('d.m.Y') }}
+ {{ assignment.effectivePeriod.start|date('d.m.Y') }} -
+
+ {{ assignment.effectivePeriod.end|date('d.m.Y') }}
|
diff --git a/templates/admin/document/index.html.twig b/templates/admin/document/index.html.twig
index 047927e..55bb1d2 100644
--- a/templates/admin/document/index.html.twig
+++ b/templates/admin/document/index.html.twig
@@ -72,7 +72,6 @@
{% endif %}
{{ icon('download') }}
diff --git a/templates/teamer/index.html.twig b/templates/teamer/index.html.twig
index 11371bb..de39d35 100644
--- a/templates/teamer/index.html.twig
+++ b/templates/teamer/index.html.twig
@@ -23,10 +23,7 @@
|
- {{ knp_pagination_sortable(pagination, 'Einsatzbeginn', 'assignment.dateFrom') }}
- |
-
- {{ knp_pagination_sortable(pagination, 'Einsatzende', 'assignment.dateTo') }}
+ {{ knp_pagination_sortable(pagination, 'Einsatzzeitraum', 'assignment.dateFrom') }}
|
{{ knp_pagination_sortable(pagination, 'Jobprofil', 'assignment.jobProfile') }}
@@ -35,7 +32,7 @@
{{ knp_pagination_sortable(pagination, 'Destination', 'destination.dateFrom') }}
|
- {{ knp_pagination_sortable(pagination, 'Busbegleitung ab', 'assignment.pickup') }}
+ {{ knp_pagination_sortable(pagination, 'Bus', 'assignment.pickup') }}
|
|
@@ -44,12 +41,9 @@
{% for assignment in pagination %}
|
- {% set dateFrom = assignment.dateFrom ? assignment.dateFrom : assignment.destination.dateFrom %}
- {{ dateFrom|date('d.m.Y') }}
- |
-
- {% set dateTo = assignment.dateTo ? assignment.dateTo : assignment.destination.dateTo %}
- {{ dateTo|date('d.m.Y') }}
+ {{ assignment.effectivePeriod.start|date('d.m.Y') }} -
+
+ {{ assignment.effectivePeriod.end|date('d.m.Y') }}
|
{{ assignment.jobProfile.name }}
diff --git a/translations/messages.de.yaml b/translations/messages.de.yaml
index 0ad6b2a..91fd2e4 100644
--- a/translations/messages.de.yaml
+++ b/translations/messages.de.yaml
@@ -7,7 +7,8 @@ label:
disposition:
status:
new: neu
- pending: in Prüfung
+ checking_contract: in Bearbeitung
+ checking_invoice: in Bearbeitung
confirmed: bestätigt
document:
type:
| |