feat: show due or invalid documents on teamer dashboard
This commit is contained in:
@@ -57,12 +57,29 @@ class IndexController extends AbstractController
|
||||
->getUpcomingDispositionsByTeamer($teamer)
|
||||
;
|
||||
|
||||
$dispositionDocuments = $this->processDocuments($upcomingDispositions);
|
||||
|
||||
return $this->render('teamer/index.html.twig', [
|
||||
'matchingAssignments' => $matchingAssignments,
|
||||
'recentFeedback' => $recentFeedback,
|
||||
'pendingApplications' => $pendingApplications,
|
||||
'currentDispositions' => $currentDispositions,
|
||||
'upcomingDispositions' => $upcomingDispositions,
|
||||
'dispositionDocuments' => $dispositionDocuments,
|
||||
]);
|
||||
}
|
||||
|
||||
private function processDocuments(array $upcomingDispositions): array
|
||||
{
|
||||
$dispositions = [];
|
||||
|
||||
foreach ($upcomingDispositions as $disposition) {
|
||||
/** @var Disposition $disposition */
|
||||
if ($disposition->isContractDue() || $disposition->isContractRejected() || $disposition->isInvoiceDue()) {
|
||||
$dispositions[] = $disposition;
|
||||
}
|
||||
}
|
||||
|
||||
return $dispositions;
|
||||
}
|
||||
}
|
||||
@@ -206,6 +206,15 @@ class Disposition implements BlameableEntityInterface, TimestampableEntityInterf
|
||||
return $period->isStarted();
|
||||
}
|
||||
|
||||
public function isContractRejected(): bool
|
||||
{
|
||||
if (null === $contractDocument = $this->getDocumentByType(Upload::TYPE_CONTRACT)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return $contractDocument->isRejected();
|
||||
}
|
||||
|
||||
public function isInvoiceDue(): bool
|
||||
{
|
||||
if (null !== $this->getDocumentByType(Upload::TYPE_INVOICE)) {
|
||||
|
||||
@@ -23,27 +23,6 @@
|
||||
} %}
|
||||
</div>
|
||||
<div>
|
||||
{% if disposition.assignment.documents|length %}
|
||||
<h2 class="text-lg font-bold">
|
||||
Dokumente
|
||||
</h2>
|
||||
<ul class="pb-4 divide-y divide-gray-200">
|
||||
{% for document in disposition.assignment.documents %}
|
||||
<li class="py-2">
|
||||
<a href="{{ path('app_common_download', { 'uuid': document.uuid }) }}"
|
||||
target="_blank"
|
||||
title="Download {{ document }}"
|
||||
class="group">
|
||||
<div class="flex items-center justify-between">
|
||||
<span class="flex-1">{{ document }}</span>
|
||||
{{ icon('download', 'w-4 h-4 duration-200 group-hover:scale-125') }}
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
|
||||
{# Upload contract #}
|
||||
{% if workflow_has_marked_place(disposition, 'new') %}
|
||||
<h2 class="text-lg font-bold pb-4">
|
||||
|
||||
@@ -41,9 +41,9 @@
|
||||
Meine Dokumente
|
||||
</h2>
|
||||
<ul class="divide-y divide-gray-200">
|
||||
{% for disposition in currentDispositions %}
|
||||
{% for disposition in dispositionDocuments %}
|
||||
{% set assignment = disposition.assignment %}
|
||||
{% if disposition.contractDue or disposition.invoiceDue %}
|
||||
{% if disposition.contractDue or disposition.invoiceDue or disposition.contractRejected %}
|
||||
<li class="py-2 first:pt-0 last:pb-0">
|
||||
<a href="{{ path('app_teamer_disposition_detail', { 'uuid': disposition.uuid }) }}">
|
||||
<div class="flex items-center space-x-1">
|
||||
@@ -54,7 +54,15 @@
|
||||
<span class="whitespace-nowrap">{{ assignment.destination.hotel }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="pl-5 whitespace-nowrap">{% if disposition.contractDue %}Honorarvertrag{% else %}Honorarnote{% endif %} fällig</div>
|
||||
<div class="pl-5 whitespace-nowrap text-red-500">
|
||||
{%- if disposition.contractDue -%}
|
||||
Honorarvertrag fällig
|
||||
{%- elseif disposition.contractRejected %}
|
||||
Honorarvertrag muss erneut hochgeladen werden
|
||||
{%- elseif disposition.invoiceDue -%}
|
||||
Honorarnote fällig
|
||||
{%- endif %}
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
|
||||
Reference in New Issue
Block a user