diff --git a/src/Bundle/ChillEventBundle/Form/AddEventBudgetElementType.php b/src/Bundle/ChillEventBundle/Form/AddEventBudgetElementType.php index 94b7f2e69..4c3dcc467 100644 --- a/src/Bundle/ChillEventBundle/Form/AddEventBudgetElementType.php +++ b/src/Bundle/ChillEventBundle/Form/AddEventBudgetElementType.php @@ -34,8 +34,8 @@ class AddEventBudgetElementType extends AbstractType $builder->add('kind', ChoiceType::class, [ 'choices' => [ - 'Charges' => $charges, - 'Resources' => $resources, + 'event.budget.charges' => $charges, + 'event.budget.resources' => $resources, ], 'choice_label' => fn (EventBudgetKind $kind) => $this->translatableStringHelper->localize($kind->getName()), 'choice_value' => fn (?EventBudgetKind $kind) => $kind?->getId(), diff --git a/src/Bundle/ChillEventBundle/Resources/views/Event/edit.html.twig b/src/Bundle/ChillEventBundle/Resources/views/Event/edit.html.twig index 052a13e26..2f879de26 100644 --- a/src/Bundle/ChillEventBundle/Resources/views/Event/edit.html.twig +++ b/src/Bundle/ChillEventBundle/Resources/views/Event/edit.html.twig @@ -20,6 +20,7 @@ {{ form_row(edit_form.themes) }} {{ form_row(edit_form.moderator) }} {{ form_row(edit_form.location) }} + {{ form_row(edit_form.budgetElements) }} {{ form_row(edit_form.organizationCost) }} {{ form_row(edit_form.comment) }} diff --git a/src/Bundle/ChillEventBundle/Resources/views/Event/show.html.twig b/src/Bundle/ChillEventBundle/Resources/views/Event/show.html.twig index b124c528b..f4a6f2f3c 100644 --- a/src/Bundle/ChillEventBundle/Resources/views/Event/show.html.twig +++ b/src/Bundle/ChillEventBundle/Resources/views/Event/show.html.twig @@ -50,10 +50,6 @@ {{ 'Moderator'|trans }} {{ event.moderator|trans|default('-') }} - - {{ 'event.fields.organizationCost'|trans }} - {{ event.organizationCost|format_currency('EUR') }} - {{ 'event.fields.location'|trans }} @@ -68,6 +64,77 @@ +
+ {% set resources = event.budgetElements|filter(e => e.kind.type.value == 'Resource') %} + {% set charges = event.budgetElements|filter(e => e.kind.type.value == 'Charge') %} + +

Budget de l'événement

+ +

Ressources

+ {% if resources is not empty %} + + + + + + + + + + {% set totalResources = 0 %} + {% for res in resources %} + + + + + + {% set totalResources = totalResources + res.amount %} + {% endfor %} + + + + + + + +
{{ 'event.budget.element type'|trans }}{{ 'event.budget.amount'|trans }}{{ 'event.budget.comment'|trans }}
{{ res.kind.name|localize_translatable_string }}{{ res.amount|format_currency('EUR') }}{{ res.comment.comment|chill_print_or_message(null, 'blockquote') }}
Total{{ totalResources|format_currency('EUR') }}
+ {% else %} +

{{ 'event.budget.no elements'|trans }}

+ {% endif %} + +

Charges

+ {% if charges is not empty %} + + + + + + + + + + {% set totalCharges = 0 %} + {% for chg in charges %} + + + + + + {% set totalCharges = totalCharges + chg.amount %} + {% endfor %} + + + + + + + +
{{ 'event.budget.element type'|trans }}{{ 'event.budget.amount'|trans }}{{ 'event.budget.comment'|trans }}
{{ chg.kind.name|localize_translatable_string }}{{ chg.amount|format_currency('EUR') }}{{ chg.comment.comment|chill_print_or_message(null, 'blockquote') }}
Total{{ totalCharges|format_currency('EUR') }}
+ {% else %} +

{{ 'event.budget.no elements' }}

+ {% endif %} +
+ {% if event.documents|length > 0 %}

{{ 'event.fields.documents'|trans }}

diff --git a/src/Bundle/ChillEventBundle/translations/messages.fr.yml b/src/Bundle/ChillEventBundle/translations/messages.fr.yml index 73f56f27f..ac55f93bf 100644 --- a/src/Bundle/ChillEventBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillEventBundle/translations/messages.fr.yml @@ -142,6 +142,9 @@ event: filter: event_types: Par types d'événement event_dates: Par date d'événement + budget: + resources: Ressources + charges: Charges crud: event_theme: