Simplification sortie matériel en stock
This commit is contained in:
parent
c681b47e7f
commit
d3b48c677e
2 changed files with 7 additions and 143 deletions
|
|
@ -15,6 +15,9 @@
|
|||
{{/if}}
|
||||
{{/foreach}}
|
||||
|
||||
{{* récupérer les infos du matériel *}}
|
||||
{{#load key=$_GET.key assign="equipment"}}{{/load}}
|
||||
|
||||
{{* Traiter l'envoi du formulaire *}}
|
||||
{{#form on="save"}}
|
||||
{{* interdire date dans le futur *}}
|
||||
|
|
@ -36,9 +39,6 @@
|
|||
{{:assign var="user.name" value=$name}}
|
||||
{{/foreach}}
|
||||
|
||||
{{* récupérer les infos du matériel *}}
|
||||
{{#load type="equipment" key=$_GET.key assign="equipment"}}{{/load}}
|
||||
|
||||
{{:assign stock=0}}
|
||||
{{:assign exterieur=0}}
|
||||
{{:assign nonproprio=0}}
|
||||
|
|
@ -151,20 +151,12 @@
|
|||
{{* barre de navigation *}}
|
||||
{{:include file="../../_nav.html" current="sorties"}}
|
||||
{{/if}}
|
||||
{{:form_errors}}
|
||||
|
||||
{{* Extraire et compiler les infos de la base *}}
|
||||
{{:include file="../../_calcul_dispo.html" eqpmt_key=$_GET.key keep="categories,equipments"}}
|
||||
{{:assign var=stock from="equipments.%s.stock"|args:$_GET.key}}
|
||||
{{:assign var=exterieur from="equipments.%s.exterieur"|args:$_GET.key}}
|
||||
{{:assign dispo="%d-%d"|math:$stock:$exterieur}}
|
||||
{{#load key=$equipment.category assign="category"}}{{/load}}
|
||||
{{:assign dispo="%d-%d"|math:$equipment.stock:$equipment.out}}
|
||||
|
||||
{{if $dispo > 0}}
|
||||
|
||||
{{* déterminer le matériel concerné par le mouvement *}}
|
||||
{{#load key=$_GET.key assign="equipment"}}{{/load}}
|
||||
{{:assign var=cat_name from=categories.%s|args:$equipment.category}}
|
||||
|
||||
{{* formulaire de sortie de matériel *}}
|
||||
<form method="post" action="">
|
||||
<fieldset class="informations">
|
||||
|
|
@ -173,7 +165,7 @@
|
|||
<dt>Matériel</dt>
|
||||
<dd>{{$equipment.name}}</dd>
|
||||
<dt>Catégorie</dt>
|
||||
<dd>{{$cat_name}}</dd>
|
||||
<dd>{{$category.name}}</dd>
|
||||
<dt>Quantité disponible</dt>
|
||||
<dd class="num">{{$dispo}}</dd>
|
||||
</dl>
|
||||
|
|
@ -203,12 +195,5 @@
|
|||
<p class="block error">Il n'y a aucune unité de ce matériel disponible à la date du {{$now|date_short}}</p>
|
||||
{{/if}}
|
||||
|
||||
{{:form_errors}}
|
||||
{{:admin_footer}}
|
||||
|
||||
<script type="text/javascript" src="scripts.js"></script>
|
||||
<script type="text/javascript">
|
||||
let op = $('#f_operation');
|
||||
op.addEventListener("change", (evt) => {
|
||||
toggleUserChoice(document.querySelector("#user"));
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue