mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Update twig templates for display budget elements
This commit is contained in:
parent
b024eef493
commit
3f1e625dee
@ -34,8 +34,8 @@ class AddEventBudgetElementType extends AbstractType
|
|||||||
|
|
||||||
$builder->add('kind', ChoiceType::class, [
|
$builder->add('kind', ChoiceType::class, [
|
||||||
'choices' => [
|
'choices' => [
|
||||||
'Charges' => $charges,
|
'event.budget.charges' => $charges,
|
||||||
'Resources' => $resources,
|
'event.budget.resources' => $resources,
|
||||||
],
|
],
|
||||||
'choice_label' => fn (EventBudgetKind $kind) => $this->translatableStringHelper->localize($kind->getName()),
|
'choice_label' => fn (EventBudgetKind $kind) => $this->translatableStringHelper->localize($kind->getName()),
|
||||||
'choice_value' => fn (?EventBudgetKind $kind) => $kind?->getId(),
|
'choice_value' => fn (?EventBudgetKind $kind) => $kind?->getId(),
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
{{ form_row(edit_form.themes) }}
|
{{ form_row(edit_form.themes) }}
|
||||||
{{ form_row(edit_form.moderator) }}
|
{{ form_row(edit_form.moderator) }}
|
||||||
{{ form_row(edit_form.location) }}
|
{{ form_row(edit_form.location) }}
|
||||||
|
{{ form_row(edit_form.budgetElements) }}
|
||||||
{{ form_row(edit_form.organizationCost) }}
|
{{ form_row(edit_form.organizationCost) }}
|
||||||
|
|
||||||
{{ form_row(edit_form.comment) }}
|
{{ form_row(edit_form.comment) }}
|
||||||
|
@ -50,10 +50,6 @@
|
|||||||
<th>{{ 'Moderator'|trans }}</th>
|
<th>{{ 'Moderator'|trans }}</th>
|
||||||
<td>{{ event.moderator|trans|default('-') }}</td>
|
<td>{{ event.moderator|trans|default('-') }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
|
||||||
<th>{{ 'event.fields.organizationCost'|trans }}</th>
|
|
||||||
<td>{{ event.organizationCost|format_currency('EUR') }}</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
<tr>
|
||||||
<th>{{ 'event.fields.location'|trans }}</th>
|
<th>{{ 'event.fields.location'|trans }}</th>
|
||||||
<td>
|
<td>
|
||||||
@ -68,6 +64,77 @@
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
<div class="budget-wrapper" style="background-color: whitesmoke; padding: 1rem; margin-bottom: .5rem;">
|
||||||
|
{% set resources = event.budgetElements|filter(e => e.kind.type.value == 'Resource') %}
|
||||||
|
{% set charges = event.budgetElements|filter(e => e.kind.type.value == 'Charge') %}
|
||||||
|
|
||||||
|
<h2>Budget de l'événement</h2>
|
||||||
|
|
||||||
|
<h3>Ressources</h3>
|
||||||
|
{% if resources is not empty %}
|
||||||
|
<table class="table table-bordered border-dark align-middle">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>{{ 'event.budget.element type'|trans }}</th>
|
||||||
|
<th>{{ 'event.budget.amount'|trans }}</th>
|
||||||
|
<th>{{ 'event.budget.comment'|trans }}</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{% set totalResources = 0 %}
|
||||||
|
{% for res in resources %}
|
||||||
|
<tr>
|
||||||
|
<td>{{ res.kind.name|localize_translatable_string }}</td>
|
||||||
|
<td>{{ res.amount|format_currency('EUR') }}</td>
|
||||||
|
<td>{{ res.comment.comment|chill_print_or_message(null, 'blockquote') }}</td>
|
||||||
|
</tr>
|
||||||
|
{% set totalResources = totalResources + res.amount %}
|
||||||
|
{% endfor %}
|
||||||
|
</tbody>
|
||||||
|
<tfoot>
|
||||||
|
<tr>
|
||||||
|
<th>Total</th>
|
||||||
|
<td>{{ totalResources|format_currency('EUR') }}</td>
|
||||||
|
</tr>
|
||||||
|
</tfoot>
|
||||||
|
</table>
|
||||||
|
{% else %}
|
||||||
|
<p class="chill-no-data-statement">{{ 'event.budget.no elements'|trans }}</p>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
<h3>Charges</h3>
|
||||||
|
{% if charges is not empty %}
|
||||||
|
<table class="table table-bordered border-dark align-middle">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>{{ 'event.budget.element type'|trans }}</th>
|
||||||
|
<th>{{ 'event.budget.amount'|trans }}</th>
|
||||||
|
<th>{{ 'event.budget.comment'|trans }}</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{% set totalCharges = 0 %}
|
||||||
|
{% for chg in charges %}
|
||||||
|
<tr>
|
||||||
|
<td>{{ chg.kind.name|localize_translatable_string }}</td>
|
||||||
|
<td>{{ chg.amount|format_currency('EUR') }}</td>
|
||||||
|
<td>{{ chg.comment.comment|chill_print_or_message(null, 'blockquote') }}</td>
|
||||||
|
</tr>
|
||||||
|
{% set totalCharges = totalCharges + chg.amount %}
|
||||||
|
{% endfor %}
|
||||||
|
</tbody>
|
||||||
|
<tfoot>
|
||||||
|
<tr>
|
||||||
|
<th>Total</th>
|
||||||
|
<td>{{ totalCharges|format_currency('EUR') }}</td>
|
||||||
|
</tr>
|
||||||
|
</tfoot>
|
||||||
|
</table>
|
||||||
|
{% else %}
|
||||||
|
<p class="chill-no-data-statement">{{ 'event.budget.no elements' }}</p>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
|
||||||
{% if event.documents|length > 0 %}
|
{% if event.documents|length > 0 %}
|
||||||
<div>
|
<div>
|
||||||
<p><strong>{{ 'event.fields.documents'|trans }}</strong></p>
|
<p><strong>{{ 'event.fields.documents'|trans }}</strong></p>
|
||||||
|
@ -142,6 +142,9 @@ event:
|
|||||||
filter:
|
filter:
|
||||||
event_types: Par types d'événement
|
event_types: Par types d'événement
|
||||||
event_dates: Par date d'événement
|
event_dates: Par date d'événement
|
||||||
|
budget:
|
||||||
|
resources: Ressources
|
||||||
|
charges: Charges
|
||||||
|
|
||||||
crud:
|
crud:
|
||||||
event_theme:
|
event_theme:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user