Sortie temporaire : ajout date retour
This commit is contained in:
parent
8266ab8aeb
commit
fc526918f9
8 changed files with 159 additions and 4 deletions
|
|
@ -14,7 +14,7 @@
|
|||
{{/load}}
|
||||
|
||||
{{* récupérer la config des entrées/sorties *}}
|
||||
{{:include file="../_get_config.html" keep="config, directions"}}
|
||||
{{:include file="../_get_config.html" keep="config, directions, loan_duration"}}
|
||||
{{:assign var="type_mvt" from="config.%s_nature.%s.type"|args:$mvt_new.direction:$mvt_new.operation}}
|
||||
|
||||
{{* interdire de dupliquer un retour => utiliser le bouton « Retour » *}}
|
||||
|
|
@ -93,6 +93,11 @@
|
|||
{{:assign var="mvt_new.amount" value=$_POST.amount}}
|
||||
{{:assign var="mvt_new.date" value=$_POST.date|parse_date}}
|
||||
{{:assign var="mvt_new.comment" value=$_POST.comment}}
|
||||
{{if $_POST.set_return_date != null}}
|
||||
{{:assign return_date=$_POST.return_date}}
|
||||
{{else}}
|
||||
{{:assign return_date=null}}
|
||||
{{/if}}
|
||||
|
||||
{{*
|
||||
lister les mouvements
|
||||
|
|
@ -198,6 +203,7 @@
|
|||
user=$user.id
|
||||
storage=$_POST.storage
|
||||
transactions=$transactions
|
||||
return_date=$return_date|parse_date
|
||||
}}
|
||||
{{:redirect force="../equipment_history.html?ok=1&key=%s&prop=%s&msg=copie"|args:$eqpmt_key:$prop}}
|
||||
{{/form}}
|
||||
|
|
@ -272,6 +278,22 @@
|
|||
{{/if}}
|
||||
{{/if}}
|
||||
{{:input type="textarea" name="comment" label="Remarques" cols="40", rows="3" required=false default=$mvt_new.comment}}
|
||||
{{if $mvt_new.direction == "output" && $type_mvt == "temporaire"}}
|
||||
{{if $mvt_new.return_date != null}}
|
||||
{{:assign checked="checked"}}
|
||||
{{:assign visibility="visible"}}
|
||||
{{:assign return_date=$mvt_new.return_date}}
|
||||
{{else}}
|
||||
{{:assign visibility="hidden"}}
|
||||
{{:assign ts_sortie=$mvt_new.date|strtotime}}
|
||||
{{:assign ts_retour="%d+%d*(60*60*24)"|math:$ts_sortie:$loan_duration}}
|
||||
{{:assign return_date=$ts_retour|date_short}}
|
||||
{{/if}}
|
||||
{{:input id="set_return_date" type="checkbox" value=1 name="set_return_date" label="Fixer une date de retour" help="Cocher pour fixer une date de retour" checked="%s"|args:$checked}}
|
||||
<div id="div_return_date" style="visibility:{{$visibility}}">
|
||||
{{:input type="date" name="return_date" label="Date de retour" default=$return_date}}
|
||||
</div>
|
||||
{{/if}}
|
||||
</dl>
|
||||
</fieldset>
|
||||
|
||||
|
|
@ -282,3 +304,14 @@
|
|||
</form>
|
||||
|
||||
{{:admin_footer}}
|
||||
|
||||
<script type="text/javascript" src="../scripts.js"></script>
|
||||
<script type="text/javascript">
|
||||
function changeVisibility(evt, idcheck = 'f_set_return_date_1', fields = ['div_return_date']) {
|
||||
toggleVisibility(idcheck, fields);
|
||||
}
|
||||
|
||||
(function () {
|
||||
document.getElementById('f_set_return_date_1').onclick = changeVisibility;
|
||||
})();
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue