WIP: Improve assignment information display

This commit is contained in:
Björn Fromme
2023-10-19 15:20:44 +02:00
parent 21968b833c
commit 585f86e45f
15 changed files with 84 additions and 55 deletions
+26
View File
@@ -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;
}
}
+1 -1
View File
@@ -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();
@@ -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');
+2 -2
View File
@@ -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);
+1 -1
View File
@@ -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);
+1 -1
View File
@@ -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
@@ -17,7 +17,7 @@
Einsatztermin
</div>
<div>
{{ 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') }}
</div>
{% if assignment.pickup and assignment.pickupDate %}
<div>
@@ -15,7 +15,7 @@
Einsatztermin
</div>
<div>
{{ 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') }}
</div>
</div>
<div class="grid grid-cols-2 gap-x-4 gap-y-3">
@@ -1,8 +1,8 @@
<ul class="list-disc pl-4 pb-4">
{% if assignment.pickup and assignment.pickupDate %}
{% if assignment.pickup and assignment.effectivePickupDate %}
<li>
<div class="flex items-center space-x-2">
<span>Busbegleitung ab {{ assignment.pickup|bpn_pickup_label }} am {{ assignment.pickupDate|date('d.m.Y') }}</span>
<span>Busbegleitung ab {{ assignment.pickup|bpn_pickup_label }} am {{ assignment.effectivePickupDate|date('d.m.Y') }}</span>
{% if teamer.hasPickup(assignment.pickup) %}
{{ icon('check', 'w-5 h-5 text-emerald-500') }}
{% else %}
+36 -19
View File
@@ -12,10 +12,7 @@
<thead>
<tr>
<th>
{{ knp_pagination_sortable(pagination, 'Einsatzbeginn', 'destination.dateFrom') }}
</th>
<th>
{{ knp_pagination_sortable(pagination, 'Einsatzende', 'destination.dateTo') }}
{{ knp_pagination_sortable(pagination, 'Einsatz&shy;zeitraum', 'destination.dateFrom') }}
</th>
<th>
{{ knp_pagination_sortable(pagination, 'Jobprofil', 'job_profile.name') }}
@@ -24,7 +21,7 @@
{{ knp_pagination_sortable(pagination, 'Destination', 'destination.product') }}
</th>
<th>
{{ knp_pagination_sortable(pagination, 'Busbegleitung ab', 'destination.pickup') }}
{{ knp_pagination_sortable(pagination, 'Bus', 'destination.pickup') }}
</th>
<th>
{{ knp_pagination_sortable(pagination, 'Bewerber*in', 'teamer.lastName') }}
@@ -37,34 +34,54 @@
{% set assignment = application.assignment %}
<tr>
<td>
{{ assignment.destination.dateFrom|date('d.m.Y') }}
<a href="{{ path('app_admin_assignment_detail', { 'uuid': assignment.uuid }) }}">
{{ assignment.effectivePeriod.start|date('d.m.Y') }} -
{{ assignment.effectivePeriod.end|date('d.m.Y') }}
</a>
</td>
<td>
{{ assignment.destination.dateTo|date('d.m.Y') }}
<a href="{{ path('app_admin_assignment_detail', { 'uuid': assignment.uuid }) }}">
{{ assignment.jobProfile.name }}
</a>
</td>
<td>
{{ assignment.jobProfile.name }}
<a href="{{ path('app_admin_assignment_detail', { 'uuid': assignment.uuid }) }}">
{{ assignment.destination.product }}
<br>
{{ assignment.destination.hotel }}
</a>
</td>
<td>
{{ assignment.destination.product }}
<br>
{{ assignment.destination.hotel }}
<a href="{{ path('app_admin_assignment_detail', { 'uuid': assignment.uuid }) }}">
{{ assignment.pickup ? assignment.pickup|bpn_pickup_label : '-' }}
<br>
{{ assignment.effectivePickupDate ? assignment.effectivePickupDate|date('d.m.Y') : '' }}
</a>
</td>
<td>
{{ assignment.pickup ? assignment.pickup|bpn_pickup_label : '-' }}
<a href="{{ path('app_admin_assignment_detail', { 'uuid': assignment.uuid }) }}">
{{ application.teamer }}
</a>
</td>
<td>
{{ application.teamer }}
</td>
<td>
<button type="button" class="btn">
Welche Funktion?
</button>
<div class="flex items-center justify-end space-x-1">
{% 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 %}
<span>{{ application.completedTrainingsCount }}/{{ requiredTrainingsCount }}</span>
{% endif %}
</div>
</td>
</tr>
{% else %}
<tr>
<td colspan="7">
<td colspan="6">
Keine Daten...
</td>
</tr>
+1 -1
View File
@@ -65,7 +65,7 @@
'title': 'Bewerbungsstatus bearbeiten',
'url': path('app_admin_application_status', { 'uuid': application.uuid })
}) }}>
Status ändern
Status
</button>
{% endif %}
{% if is_granted('DELETE', application) %}
+4 -12
View File
@@ -12,10 +12,7 @@
<thead>
<tr>
<th>
{{ knp_pagination_sortable(pagination, 'Einsatz&shy;beginn', 'assignment.dateFrom') }}
</th>
<th>
{{ knp_pagination_sortable(pagination, 'Einsatz&shy;ende', 'assignment.dateTo') }}
{{ knp_pagination_sortable(pagination, 'Einsatz&shy;zeitraum', 'assignment.dateFrom') }}
</th>
<th>
{{ knp_pagination_sortable(pagination, 'Jobprofil', 'assignment.jobProfile') }}
@@ -36,15 +33,10 @@
{% for assignment in pagination %}
<tr>
<td>
{% set dateFrom = assignment.dateFrom ? assignment.dateFrom : assignment.destination.dateFrom %}
<a href="{{ path('app_admin_assignment_detail', { 'uuid': assignment.uuid, 'r': return_url() }) }}">
{{ dateFrom|date('d.m.Y') }}
</a>
</td>
<td>
{% set dateTo = assignment.dateTo ? assignment.dateTo : assignment.destination.dateTo %}
<a href="{{ path('app_admin_assignment_detail', { 'uuid': assignment.uuid, 'r': return_url() }) }}">
{{ dateTo|date('d.m.Y') }}
{{ assignment.effectivePeriod.start|date('d.m.Y') }} -
<br>
{{ assignment.effectivePeriod.end|date('d.m.Y') }}
</a>
</td>
<td>
-1
View File
@@ -72,7 +72,6 @@
</button>
{% endif %}
<a href="{{ path('app_common_download', { 'uuid': upload.uuid }) }}"
target="_blank"
title="Download">
{{ icon('download') }}
</a>
+5 -11
View File
@@ -23,10 +23,7 @@
<thead>
<tr>
<th>
{{ knp_pagination_sortable(pagination, 'Einsatz&shy;beginn', 'assignment.dateFrom') }}
</th>
<th>
{{ knp_pagination_sortable(pagination, 'Einsatz&shy;ende', 'assignment.dateTo') }}
{{ knp_pagination_sortable(pagination, 'Einsatz&shy;zeitraum', 'assignment.dateFrom') }}
</th>
<th>
{{ knp_pagination_sortable(pagination, 'Jobprofil', 'assignment.jobProfile') }}
@@ -35,7 +32,7 @@
{{ knp_pagination_sortable(pagination, 'Destination', 'destination.dateFrom') }}
</th>
<th>
{{ knp_pagination_sortable(pagination, 'Busbegleitung ab', 'assignment.pickup') }}
{{ knp_pagination_sortable(pagination, 'Bus', 'assignment.pickup') }}
</th>
<th></th>
</tr>
@@ -44,12 +41,9 @@
{% for assignment in pagination %}
<tr>
<td>
{% set dateFrom = assignment.dateFrom ? assignment.dateFrom : assignment.destination.dateFrom %}
{{ dateFrom|date('d.m.Y') }}
</td>
<td>
{% set dateTo = assignment.dateTo ? assignment.dateTo : assignment.destination.dateTo %}
{{ dateTo|date('d.m.Y') }}
{{ assignment.effectivePeriod.start|date('d.m.Y') }} -
<br>
{{ assignment.effectivePeriod.end|date('d.m.Y') }}
</td>
<td>
{{ assignment.jobProfile.name }}
+2 -1
View File
@@ -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: