{% extends "layout.html.twig" %} {% block title %}{{ gruppo.nome }} · {{ app_name }}{% endblock %} {% set can_write = current_user.ruolo in ['admin', 'editor'] %} {% set tipo_label = { 'nascita': 'Nascita', 'morte': 'Morte', 'acquisto': 'Acquisto', 'trasferimento_in': 'Trasferimento in', 'trasferimento_out': 'Trasferimento out', 'spostamento_luogo': 'Spostamento luogo' } %} {% set entrate = ['nascita', 'acquisto', 'trasferimento_in'] %} {% block content %}

Gruppi / {{ gruppo.nome }}

{{ gruppo.nome }} {% if gruppo.stato == 'chiuso' %}(chiuso){% endif %}

Report costi {% if can_write %} Modifica
{{ csrf_field() }}
{% endif %}
{{ gruppo.elemento_nome }} {% if gruppo.variante_nome %}{{ gruppo.variante_nome }}{% endif %} 📍 {{ gruppo.luogo_nome }} {{ gruppo.stato }}
{% if gruppo.note %}

{{ gruppo.note|nl2br }}

{% endif %} {# Consistenza attuale #}
Consistenza attuale (calcolata dai movimenti)
{{ consistenza }} capi
{{ breakdown.nascite }}
nati
{{ breakdown.acquisti }}
acquistati
{{ breakdown.trasf_in }}
trasf. in
{{ breakdown.morti }}
morti
{{ breakdown.trasf_out }}
trasf. out
{# Riepilogo macellazioni #} {% if macell.capi > 0 %}
Macellazioni
{{ macell.capi }} capi · {{ macell.peso }} kg totali · {{ macell.medio }} kg/capo (peso medio)
{% endif %} {# Movimenti #}

Movimenti

{% if can_write and gruppo.stato == 'attivo' %} + Movimento {% endif %}
{% if movimenti is empty %}

Nessun movimento registrato.

{% else %}
{% for m in movimenti %} {% endfor %}
DataTipoQuantitàDettagli
{{ m.data|date('d/m/Y') }} {{ tipo_label[m.tipo] ?? m.tipo }} {% if m.tipo == 'spostamento_luogo' %}— {% elseif m.tipo in entrate %}+{{ m.quantita }} {% else %}−{{ m.quantita }}{% endif %} {%- if m.causa_morte %}{{ m.causa_morte }}{% endif -%} {%- if m.tipo == 'morte' and m.causa_morte == 'macellazione' and m.peso_lavorato_kg %} · {{ m.peso_lavorato_kg }} kg{% if m.quantita > 0 %} ({{ (m.peso_lavorato_kg / m.quantita)|round(3) }} kg/capo){% endif %} {% endif -%} {%- if m.origine_tipo %} · {{ m.origine_tipo }}{% endif -%} {%- if m.venditore %} · {{ m.venditore }}{% endif -%} {%- if m.fonte %} · {{ m.fonte }}{% endif -%} {%- if m.costo %} · € {{ m.costo }}{% endif -%} {%- if m.collegato_nome %} · ↔ {{ m.collegato_nome }}{% endif -%} {%- if m.luogo_nome %} · → {{ m.luogo_nome }}{% endif -%} {%- if m.fonte_link %} · link ↗{% endif -%} {%- if m.note %} · {{ m.note }}{% endif -%}
{% endif %} {% endblock %}