<tr id="docFrs_{{ loop.index }}">
{#___________________________________________________________________________#}
    <td style="height: 51.58px;">
        {{ dossier[docAtt.CODE_CAT] ?? ('Autre' | trad) }}
    </td>
{#___________________________________________________________________________#}
{% block colTitle %}
    <td>
        {{ docTitleObligatoireComment(docAtt.TITRE, docAtt.MODE_CONTROL|number_format, docAtt.COMMENTAIRE ?? null) }}
    </td>
{% endblock %}
{#___________________________________________________________________________#}
{% block colStatus %}
    <td class="etat">
        {% if docAtt.Etat == 'ajour' 
            and docAtt.relance != '00000000' and docAtt.relance != ''
            and docAtt.relance <= ('now' | date('Ymd'))
        %}
            <span class="absent">{{ 'Proche péremption' | trad }}</span>
        {% else %}
            {# TODO : suffixe class CSS, also rename to match visual semantique #}	
            <span class="{{ {
                sans_objet: 'sans_objet',
                absent: 'sans_objet',
                ajour: 'ajour',
                perime: 'perime',
            }[ docAtt.Etat ] }}">{{ {
                sans_objet: 'Sans objet' | trad,
                absent: 'Absent' | trad,
                perime: 'Périmé' | trad,
                ajour: 'À jour' | trad,
            }[ docAtt.Etat ] }}</span>	
        {% endif %}
    </td>
{% endblock %}
{#___________________________________________________________________________#}
{% block colCentre %}
    <td>{{ docAtt.RAIS_SOC }} {{ docAtt.CODE_CTR? '('~docAtt.CODE_CTR~')':'' }}</td>
{% endblock %}
{#___________________________________________________________________________#}
{% block colAuteur %}
    <td>{{ docAtt.NOM }} {{ docAtt.AUTEUR? '('~docAtt.AUTEUR~')':'' }}</td>
{% endblock %}
{#___________________________________________________________________________#}
{% block colValable %}
    <td>
        {% if docAtt.DT_VALID =="0" and docAtt.DT_PARUT != "0" %}
            {{ 'Valable à partir du' | trad }} {{ docAtt.DT_PARUT | dateTrad }}
        {% elseif docAtt.DT_VALID =="" and docAtt.DT_PARUT == "" %}
        
        {% elseif docAtt.DT_PARUT == "0" %}
            
        {% else %}
            {{ 'Du' | trad }} {{ docAtt.DT_PARUT | dateTrad }}
            {{ 'au' | trad }} {{ docAtt.DT_VALID | dateTrad }}
        {% endif %}
    </td>
{% endblock %}
{#___________________________________________________________________________#}
    <td>
        {% if code_fournisseur != 'noId' %}
            {% set relance = getRelance(code_fournisseur, docAtt.TITRE)  %}

            {% if relance is not empty 
                and (
                    (
                        docAtt.NOM_FIC != ""
                        and (
                            (date > docAtt.DT_VALID and docAtt.DT_VALID != 0) 
                            or (
                                docAtt.NOM_FIC != ""
                                and date <= docAtt.DT_VALID 
                                and date >= docAtt.relance
                            )
                        )
                    ) 
                    or docAtt.NOM_FIC == ""
                )
            %}
                {{ (relance.DTE_EVE ?? '') | dateTrad }}
                <span class="dernier_contact white-tooltip">
                    <span class="infos_tooltip top-left">
                        {{ 'Dernière mise à jour effectuée par' | trad }} :<br/>
                        <b>{{ relance.NOM }}</b>
                    </span>
                </span>
            {% endif %}
        {% endif %}
    </td>
    <td>
        {% if docAtt.CodePartenaire is not empty %}
            <span class="icosq-partenaire white-tooltip">
                <span class="infos_tooltip left">
                    {{ strBuild(
                        'Géré par @1@' | trad,
                        [mapPartn[ docAtt.CodePartenaire ].label]
                    ) }}
                </span>
            </span>
        {% endif %}
    </td>
{#___________________________________________________________________________#}
{% block colAction %}
    <td class="text-right">
        {{ menuContextuel('docFrs_' ~ loop.index, false, docAtt.menuContextuel, 6) }}
        {% if docAtt.NOM_FIC != "" and (docAtt.DOC_INUTILE|boolSql)==0 %}
            {% set urlDownload = 
                docAtt.urlDownload
                ?? path(
                    'Fournisseur.DocFournisseur.downloadFichier',
                    {id: code_entity, ordre: docAtt.NO_ORDRE}
                )
            %}
            {% if urlDownload %}
                <a href="{{ urlDownload | e('html_attr') }}" 
                    class="action-hover download_v2 mr-small" target="_blank"
                ></a>
            {% endif %}

        {% endif %}
        {% if demandeActif == falsea and not disableRelance %}
            {% if (docAtt.NPRELANCE | boolSql ==0 ) 
                and gestionALG == FALSE 
                and (
                    (
                        (
                            docAtt.NOM_FIC != "" 
                            and date > docAtt.DT_VALID 
                            and docAtt.DT_VALID != '00000000'
                        ) 
                        or docAtt.NOM_FIC == ""
                    ) and docAtt.DOC_INUTILE |boolSql == 0
                )
            %}
                {{ hover_action(
                    'docFrs_'~loop.index,
                    'refresh_v2',
                    'ajaxPopup('
                    ~ path('Fournisseur.DocFournisseur.PopupRelance', {id:code_fournisseur}) | json
                    ~ ',' 
                    ~ (
                        'Relance du document' | trad   
                        ~ " " ~ docAtt.TITRE
                    ) | json ~ ','
                    ~ docAtt.TITRE | json ~ ',' 
                    ~ docAtt.NO_ORDRE | json ~ ');', 
                    'float: right;margin-right: 10px;',
                    'Relance' |trad
                ) }}
            {% endif %}
        {% endif %}
    </td>
{% endblock %}
</tr>