Modifs ajout {form_field}
This commit is contained in:
parent
2014dff1a1
commit
8adc144bfa
5 changed files with 93 additions and 134 deletions
|
|
@ -15,6 +15,7 @@
|
|||
<ul class="actions">
|
||||
<li><input type="radio" name="type" value="facture" {form_field name=type checked=facture default=facture} id="f_type_facture"/><label for="f_type_facture">Facture</label></li>
|
||||
<li><input type="radio" name="type" value="devis" {form_field name=type checked=devis} id="f_type_devis" /><label for="f_type_devis">Devis</label></li>
|
||||
<li><input type="radio" name="type" value="cerfa" {form_field name=type checked=cerfa} id="f_type_cerfa"/><label for="f_type_cerfa">Reçu fiscal</label></li>
|
||||
</ul>
|
||||
|
||||
<fieldset>
|
||||
|
|
@ -138,49 +139,7 @@
|
|||
</dl>
|
||||
</fieldset>
|
||||
|
||||
<script type="text/javascript">
|
||||
{literal}
|
||||
|
||||
function updateSum(){
|
||||
var total = 0;
|
||||
e = document.querySelectorAll('input[name="prix[]"]');
|
||||
e.forEach( function sum(item, index){
|
||||
total = total + Number(item.value);
|
||||
});
|
||||
document.getElementById('total').innerHTML = total.toFixed(2);
|
||||
}
|
||||
|
||||
(function () {
|
||||
|
||||
function plus(){
|
||||
var newdiv = document.createElement('tr');
|
||||
newdiv.innerHTML = document.getElementById('Line1').innerHTML;
|
||||
document.getElementById('Lines').appendChild(newdiv);
|
||||
}
|
||||
plus();
|
||||
|
||||
$('#ajouter_ligne').onclick = plus;
|
||||
|
||||
function changeTypeSaisie(type)
|
||||
{
|
||||
g.toggle(['.type_client', '.type_membre'], false);
|
||||
g.toggle('.type_' + type, true);
|
||||
}
|
||||
|
||||
changeTypeSaisie(document.forms[0].base_receveur.value);
|
||||
|
||||
var inputs = $('input[name="base_receveur"]');
|
||||
|
||||
for (var i = 0; i < inputs.length; i++)
|
||||
{
|
||||
inputs[i].onchange = function (e) {
|
||||
changeTypeSaisie(this.value);
|
||||
};
|
||||
}
|
||||
|
||||
} ());
|
||||
{/literal}
|
||||
</script>
|
||||
{include file="%s/templates/_js.tpl"|args:$plugin_root}
|
||||
|
||||
<p class="submit">
|
||||
{csrf_field key="ajout_facture"}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue