{# Fiche produit d'une demande, partagée par l'écran admin et l'écran sourceur. Reprend la structure de la fiche sourceur du Radar (radar/templates/candidate/sourcing_sheet.html.twig) : le produit RECHERCHÉ et l'exemple SIMILAIRE restent séparés. Attend `sheet` (App\Entity\Request). Rien d'interne ici : ni sourceurs assignés, ni trace d'import, ni notes — ce partiel est vu par le sourceur. Les liens viennent du fichier importé : seul safe_url() décide s'ils sont cliquables. #} {% macro money(amount) %}{% set fr = app.request.locale == 'fr' %}{{ amount|number_format(2, fr ? ',' : '.', fr ? ' ' : ',') }}{% endmacro %} {# Un prix ou une fourchette, avec sa devise — « à confirmer » quand on ne la connaît pas. #} {% macro price(range) %} {%- import _self as m -%} {%- set currency = range.currency ?? ('price.currency_unknown'|trans({}, 'sourcing_sheet')) -%} {%- if range.max -%} {{- 'price.range'|trans({'%min%': m.money(range.min), '%max%': m.money(range.max), '%currency%': currency}, 'sourcing_sheet') -}} {%- else -%} {{- 'price.from'|trans({'%min%': m.money(range.min), '%currency%': currency}, 'sourcing_sheet') -}} {%- endif -%} {% endmacro %} {% import _self as m %} {% set doc = 'sourcing_sheet' %} {% set heading = 'border-b border-gray-200 pb-1 font-structure text-sm font-bold uppercase tracking-wide text-pepite-navy' %} {% set subheading = 'mt-4 font-structure text-xs font-bold uppercase tracking-wide text-pepite-ink/50' %}
{% if sheet.need %}

{{ 'need'|trans({'%need%': sheet.need}, doc) }}

{% endif %}

{{ 'ask'|trans({}, doc)|raw }}

{# ============ Produit recherché ============ #}

{{ 'section.product'|trans({}, doc) }}

{% if sheet.photos is not empty %}
{% for photo in sheet.photos %}
{{ loop.first ? 'photos.alt_main'|trans({'%name%': sheet.title}, doc) : 'photos.alt_other'|trans({}, doc) }}
{% endfor %}

{{ 'photos.caption'|trans({}, doc) }}

{% else %}

{{ 'photos.none'|trans({}, doc) }}

{% endif %} {% if sheet.description or sheet.commercialReason or sheet.differences %}
{% if sheet.description %}

{{ 'pitch.use'|trans({}, doc) }} {{ sheet.description }}

{% endif %} {% if sheet.commercialReason %}

{{ 'pitch.why'|trans({}, doc) }} {{ sheet.commercialReason }}

{% endif %} {% if sheet.differences %}

{{ 'pitch.diff'|trans({}, doc) }} {{ sheet.differences }}

{% endif %}
{% endif %}
{# ============ Ce que nous savons ============ #} {% if sheet.specs or sheet.variants or sheet.priceLadder or sheet.observedPrice or sheet.observedMoq or sheet.certifications %}

{{ 'section.known'|trans({}, doc) }}

{{ 'known.note'|trans({}, doc) }}

{% if sheet.specs %} {% for spec in sheet.specs %} {% endfor %}
{{ spec.label }} {{ spec.value }}
{% endif %} {% if sheet.variants %}

{{ 'known.variants'|trans({}, doc) }}

{% endif %} {% if sheet.priceLadder or sheet.observedPrice or sheet.observedMoq %}

{{ 'known.prices'|trans({}, doc) }}

{% endif %} {% if sheet.certifications %}

{{ 'known.certs'|trans({}, doc) }}

{{ sheet.certifications|join(' · ') }}

{% endif %}
{% endif %} {# ============ Où le produit a été vu ============ #} {% if sheet.sourcesSeen %}

{{ 'section.seen'|trans({}, doc) }}

{% endif %} {# ============ Exemple similaire : illustration, jamais une référence à commander ============ #} {% if sheet.similarExample %} {% set example = sheet.similarExample %} {% set exampleLink = safe_url(example.url) %} {% set exampleImage = safe_url(example.image) %}

{{ 'section.example'|trans({}, doc) }}

{{ 'example.note'|trans({}, doc)|raw }}

{% if exampleImage %}
{{ 'example.alt'|trans({}, doc) }}
{% endif %}

{{ example.title }}

{% if exampleLink %}

{{ exampleLink }}

{% elseif example.url %}

{{ example.url }}

{% endif %}

{%- set parts = [] -%} {%- if example.price %}{% set parts = parts|merge(['example.price_seen'|trans({'%price%': m.price(example.price)}, doc)]) %}{% endif -%} {%- if example.moq %}{% set parts = parts|merge(['example.moq'|trans({'%count%': example.moq}, doc)]) %}{% endif -%} {%- if example.country %}{% set parts = parts|merge([example.country]) %}{% endif -%} {{ parts|join(' · ') }}

{% endif %} {# ============ Ce qu'on ne sait pas encore ============ #} {% if sheet.openQuestions or sheet.unknownPoints %}

{{ 'section.unknown'|trans({}, doc) }}

{{ 'unknown.intro'|trans({}, doc) }}

{% if sheet.unknownPoints %}

{{ 'unknown.to_confirm'|trans({}, doc) }} {{ sheet.unknownPoints }}

{% endif %} {% if sheet.openQuestions %}
    {% for key in sheet.openQuestions %} {% set text = sheet_question_text(key) %}
  1. {{ sheet_question_topic(key) }}{% if text %}{{ 'topic_sep'|trans({}, doc) }}{% endif %} {{ text }}
  2. {% endfor %}
{% endif %}
{% endif %} {# ============ Ce qu'on attend ============ #} {% if sheet.expected %}

{{ 'section.expected'|trans({}, doc) }}

{% endif %}