{{:admin_header title="Notes de frais"}} {{:assign where="$$.user_id = %d"|args:$logged_user.id}} {{#restrict section="accounting" level="read"}} {{if $_GET.status === 'all'}} {{:assign where="1"}} {{elseif $_GET.status}} {{:assign status=$_GET.status|quote_sql}} {{:assign where="$$.status = %s"|args:$status}} {{:assign check=true}} {{/if}} {{/restrict}}
{{#list select="$$.number AS 'Numéro'; $$.user_name AS 'Membre'; $$.date AS 'Date'; $$.label AS 'Libellé'; CASE $$.status WHEN 'waiting' THEN 'À accepter' WHEN 'payable' THEN 'À payer' WHEN 'paid' THEN 'Payée' WHEN 'cancelled' THEN 'Annulée' ELSE 'Brouillon' END AS 'Statut'; (SELECT SUM($$.amount) FROM @TABLE AS b WHERE $$.type = 'line' AND $$.claim = @TABLE.key) AS 'Montant'"|args:$config.user_fields.name_sql order=1 desc=true where="$$.type = 'claim' AND %s"|args:$where check=$check }} {{if $check}} {{if $status === 'payable'}} {{:input type="checkbox" name="claims[]" value=$key}} {{:assign has_checkboxes=true}} {{/if}} {{/if}} {{:link href="details.html?key=%s"|args:$key label=$number}} {{$col2}} {{$date|date_short}} {{$col4}} {{if $status === 'waiting'}} {{:tag label=$col5 color="lightcoral"}} {{elseif $status === 'payable'}} {{:tag label=$col5 color="darkorange"}} {{elseif $status === 'paid'}} {{:tag label=$col5 color="darkseagreen"}} {{elseif $status === 'cancelled'}} {{:tag label=$col5 color="#999"}} {{else}} {{:tag label=$col5 color="tan"}} {{/if}} {{$col6|money_currency}} {{:linkbutton href="details.html?key=%s"|args:$key label="Ouvrir" shape="menu"}} {{else}}

Aucune note de frais ici.

{{/list}} {{if $has_checkboxes}}

{{:button type="submit" label="Saisir un paiement pour les notes de frais sélectionnées" shape="right"}}

{{/if}}
{{:admin_footer}}