{{#restrict block=true section="accounting" level="read"}} {{/restrict}} {{:include file="./_config_default.tpl" keep="module.config"}} {{:admin_header title="Reçus fiscaux" current="acc"}}
Filtrer par année

{{:assign var="years." value="— Voir toutes les années —"}} {{#load select="SUBSTR($$.date, 1, 4) AS year" group="SUBSTR($$.date, 1, 4)"}} {{:assign var="years.%d"|args:$year value=$year}} {{/load}} {{:input type="select" name="year" options=$years default=$_GET.year|or:0 required=true onchange="this.form.submit();"}}

Chercher un reçu

{{:input type="search" name="q" placeholder="Nom, numéro, ou date" default=$_GET.q}} {{:button type="submit" label="Chercher" shape="right"}}

{{if $_GET.q}} {{if $_GET.q|regexp_match:'/^\d+$/'}} {{:assign where="id = :id_search" id=$_GET.q|intval}} {{elseif $_GET.q|parse_date}} {{:assign where="$$.date = :date" date=$_GET.q|parse_date}} {{else}} {{:assign nom2=$_GET.q|trim|regexp_replace:'/[!%_]/':'!$0'}} {{:assign where="$$.nom LIKE :nom ESCAPE '!'" nom="%%%s%%"|args:$nom2}} {{/if}} {{elseif $_GET.year}} {{:assign where="SUBSTR($$.date, 1, 4) = :year"}} {{/if}} {{#list select="id AS 'Numéro'; $$.nom AS 'Nom du bénéficiaire'; $$.date AS 'Date d''émission'; $$.montant AS 'Montant'; CASE WHEN $$.annule = 1 THEN 'Annulé' ELSE '' END AS 'Annulé ?'" where=$where order=1 desc=true :year=$_GET.year :date=$date :id_search=$id :nom=$nom }} {{:link href="recu.html?id=%d"|args:$id label=$id target="_dialog"}} {{if $linked_user}} {{:link href="!users/details.php?id=%d"|args:$linked_user label=$nom}} {{else}} {{$nom}} {{/if}} {{$date|date_short}} {{$montant|raw|money_currency}} {{if $annule}}Annulé{{/if}} {{if !$annule}} {{:linkbutton shape="delete" label="Annuler" href="annuler.html?id=%d"|args:$id target="_dialog"}} {{/if}} {{:linkbutton shape="eye" label="Ouvrir" href="recu.html?id=%d"|args:$id target="_dialog"}} {{:linkbutton shape="mail" label="Envoyer" href="envoyer.html?id=%d"|args:$id target="_dialog"}} {{else}}

{{if $_GET.q}} Aucun reçu n'a été trouvé pour la recherche "{{$_GET.q}}". {{elseif $_GET.year}} Aucun reçu n'a été trouvé pour l'année sélectionnée. {{else}} Aucun reçu n'a encore été créé. {{/if}}

{{/list}} {{:admin_footer}}