fix: rework document and disposition workflow

This commit is contained in:
Björn Fromme
2024-04-19 12:34:04 +02:00
parent 94e01773d4
commit 4372cdaaeb
6 changed files with 52 additions and 27 deletions
+27 -3
View File
@@ -5,7 +5,7 @@
{% block content %}
{% set assignment = disposition.assignment %}
<h1 class="text-2xl font-bold pb-8">
{% if workflow_has_marked_place(disposition, 'completed') %}
{% if workflow_has_marked_place(disposition, 'ended') %}
Dein Einsatz ist abgeschlossen
{% else %}
Dein Einsatz wurde bestätigt!
@@ -76,10 +76,23 @@
{% endif %}
{# Upload invoice #}
{% if workflow_has_marked_place(disposition, 'completed') %}
{% if workflow_has_marked_place(disposition, 'ended') %}
<h2 class="text-lg font-bold pb-4">
Honorarnote
</h2>
{# Existing invoice has been rejected #}
{% set invoice = disposition.documentByType('invoice') %}
{% if invoice and invoice.status == constant('App\\Entity\\Upload::STATUS_REJECTED') %}
<twig:MessageBox message="Deine Honorarnote muss überarbeitet werden" type="error"/>
{% if invoice.comment %}
<div class="py-2">
<strong>Begründung:</strong> {{ invoice.comment|nl2br }}
</div>
{% endif %}
{% endif %}
{# New invoice #}
{% if workflow_can(disposition, 'upload_invoice') %}
{{ form_start(form) }}
<div class="flex flex-col space-y-4">
@@ -135,10 +148,21 @@
<div class="pb-4">
Wir prüfen das Dokument schnellstmöglich.
</div>
{# Existing upload is being checked #}
{% set invoice = disposition.documentByType('invoice') %}
{% if invoice and invoice.status == constant('App\\Entity\\Upload::STATUS_PENDING') %}
<twig:MessageBox message="Deine Honorarnote befindet sich in Bearbeitung"/>
{% if invoice.comment %}
<div class="py-2">
<strong>Begründung:</strong> {{ invoice.comment|nl2br }}
</div>
{% endif %}
{% endif %}
{% endif %}
{# Invoice paid #}
{% if workflow_has_marked_place(disposition, 'paid') %}
{% if workflow_has_marked_place(disposition, 'completed') %}
<h3 class="text-xl font-bold pb-4">
Dein Honorar wurde überwiesen
</h3>