2021-12-17 14:35:12 +01:00
{ form_errors }
<form method="post" action=" { $self_url } ">
<fieldset>
<legend>Type d'écriture</legend>
<dl>
{ foreach from = $types_details item = "type" }
<dd class="radio-btn">
{ input type = "radio" name = "type" value = $type.id source = $radio label = null }
<label for="f_type_ { $type.id } ">
<div>
<h3> { $type.label } </h3>
{ if ! empty ( $type.help ) }
<p> { $type.help } </p>
{ /if }
</div>
</label>
</dd>
{ /foreach }
</dl>
</fieldset>
<fieldset>
<legend data-types="t0">Créer un devis</legend>
<legend data-types="t1">Créer une facture</legend>
<dl>
2024-01-11 10:50:58 +01:00
{ input type = "text" name = "numero_facture" maxlength = 1 8 label = "Numéro du document" required = $require_number source = $doc }
2021-12-17 21:10:54 +01:00
<dd class="help">
{ if $require_number }
Chaque document doit comporter un numéro unique délivré chronologiquement et de façon continue. Il faut que le système adopté par l'association garantisse que deux factures émises la même année ne peuvent pas porter le même numéro.
{ else }
Laisser vide pour qu'un numéro soit automatiquement affecté au format <code> { $number_pattern } </code>.
{ /if }
2021-12-17 14:35:12 +01:00
{ input type = "date" name = "date_emission" default = $date label = "Date d'émission" required = 1 source = $doc }
2024-09-06 21:40:27 +02:00
<div data-types="t0 t1">
2021-12-17 14:35:12 +01:00
{ input type = "date" name = "date_echeance" default = $date label = "Date d'échéance" required = 1 source = $doc }
</div>
<dt><label>Statut</label></dt>
2024-09-06 21:40:27 +02:00
2021-12-17 14:35:12 +01:00
{ input type = "checkbox" name = "reglee" value = "1" label = "Réglée" source = $doc data - types = "t1" }
2024-09-06 21:40:27 +02:00
<div data-types="t0 t1">
2021-12-17 14:35:12 +01:00
{ input type = "checkbox" name = "archivee" value = "1" label = "Archivée" source = $doc disabled = "disabled" }
</div>
</dl>
</fieldset>
2024-09-06 21:40:27 +02:00
<fieldset data-types="t0 t1">
2021-12-17 14:35:12 +01:00
<legend>Client</legend>
<dl>
<dt><label>Document adressé à :</label></dt>
{ if ! empty ( $clients ) }
<dd>
{ input type = "radio" name = "base_receveur" value = "membre" label = "Un·e membre" default = 1 source = $doc }
{ input type = "radio" name = "base_receveur" value = "client" label = "Un·e client·e" source = $doc }
</dd>
{ /if }
</dl>
<dl class="type_membre">
2023-08-01 22:56:38 +02:00
{ input type = "select" name = "membre" label = "Membre" options = $users required = 1 source = $doc }
2021-12-17 14:35:12 +01:00
</dl>
{ if ! empty ( $clients ) }
<dl class="type_client">
{ input type = "select" name = "client" label = "Client" options = $clients required = 1 class = "type_client" source = $doc }
</dl>
{ else }
<input type="hidden" name="base_receveur" value="membre" />
{ /if }
</fieldset>
2022-01-07 01:24:32 +01:00
<fieldset data-types="t0 t1">
2021-12-17 14:35:12 +01:00
<legend>Contenu</legend>
<dl>
2022-01-31 19:49:36 +01:00
{ input type = "select" name = "moyen_paiement" required = 1 label = "Moyen de paiement" source = $doc options = $moyens_paiement default = $doc.moyen_paiement }
2021-12-17 14:35:12 +01:00
<dt><label for="f_contenu">Contenu du document</label><dt>
<dd>
<table class="list" style="max-width: 800px;">
<colgroup>
<col width="65%">
<col width="33%">
<col width="2%">
</colgroup>
<thead>
<tr>
<td>Désignation</td>
<td>Prix</td>
<td></td>
</tr>
</thead>
<tbody id="Lines">
{ if count ( $designations ) > 0 }
<tr id="Line1" class="hidden">
<td><textarea name="designation_tpl[]" style="width:98%;"></textarea></td>
{ money_fac name = "prix_tpl[]" }
<td class="fact_rm_line"> { button label = "Enlever" title = "Enlever la ligne" shape = "minus" min = "2" name = "remove_line" } </td>
</tr>
2024-09-06 21:40:27 +02:00
{ foreach from = $designations item = designation key = key }
2021-12-17 14:35:12 +01:00
<tr>
<td><textarea name="designation[]" style="width:98%;"> { $designation } </textarea></td>
{ money_fac value = $prix [ $key ] user = $from_user }
<td class="fact_rm_line"> { button label = "Enlever" title = "Enlever la ligne" shape = "minus" min = "2" name = "remove_line" } </td>
</tr>
{ /foreach }
2024-09-06 21:40:27 +02:00
{ else }
2021-12-17 14:35:12 +01:00
<tr id="Line1" class="hidden">
<td><textarea name="designation_tpl[]" style="width:98%;"></textarea></td>
{ money_fac name = "prix_tpl[]" }
<td class="fact_rm_line"> { button label = "Enlever" title = "Enlever la ligne" shape = "minus" min = "2" name = "remove_line" } </td>
</tr>
{ /if }
</tbody>
<tfoot>
<tr>
<td style="text-align: right;">Total :</td>
<td><span id="total">0.00</span> €</td>
<td> { button label = "Ajouter" title = "Ajouter une ligne" id = "ajouter_ligne" shape = "plus" } </td>
</tr>
</tfoot>
</table>
</dd>
</dl>
</fieldset>
2024-09-06 21:40:27 +02:00
<p class="submit" data-types="t0 t1">
2021-12-17 14:35:12 +01:00
{ csrf_field key = $csrf_key }
{ button type = "submit" name = "save" label = "Enregistrer" shape = "right" class = "main" }
</p>
</form>
{ include file = "%s/templates/_js.tpl" | args : $plugin_root }