WIP: Improve assignment information display
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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');
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user