class="table table-bordered"> | class="table table-bordered"> | ||||
<thead> | <thead> | ||||
<tr> | <tr> | ||||
<th></th> | |||||
<th> | |||||
<input type="checkbox" class="check-all-checkboxes" data-selector=".checkbox-delivery-note" /> | |||||
</th> | |||||
<th>Libellé</th> | <th>Libellé</th> | ||||
<th v-if="taxRateProducer != 0">Montant (TTC)</th> | <th v-if="taxRateProducer != 0">Montant (TTC)</th> | ||||
<th v-else>Montant</th> | <th v-else>Montant</th> | ||||
</thead> | </thead> | ||||
<tbody> | <tbody> | ||||
<tr v-for="deliveryNote in deliveryNoteCreateArray"> | <tr v-for="deliveryNote in deliveryNoteCreateArray"> | ||||
<td><input type="checkbox" name="Invoice[deliveryNotes][]" | |||||
:value="deliveryNote.id"/></td> | |||||
<td><input type="checkbox" class="checkbox-delivery-note" name="Invoice[deliveryNotes][]" :value="deliveryNote.id"/></td> | |||||
<td>{{ deliveryNote.name }}</td> | <td>{{ deliveryNote.name }}</td> | ||||
<td>{{ formatPrice(deliveryNote.total) }}</td> | <td>{{ formatPrice(deliveryNote.total) }}</td> | ||||
</tr> | </tr> |
opendistrib_user_form(); | opendistrib_user_form(); | ||||
opendistrib_features_index(); | opendistrib_features_index(); | ||||
opendistrib_point_sale_form(); | opendistrib_point_sale_form(); | ||||
opendistrib_check_all_checkboxes(); | |||||
}); | }); | ||||
var UrlManager = { | var UrlManager = { | ||||
} | } | ||||
}; | }; | ||||
function opendistrib_check_all_checkboxes() { | |||||
$('.check-all-checkboxes').change(function() { | |||||
var selector = $(this).data('selector'); | |||||
var checked = $(this).prop('checked'); | |||||
$(selector).prop('checked', checked); | |||||
if(checked){ | |||||
$(selector).unbind('change').change(function() { | |||||
if(!$(this).prop('checked')) { | |||||
$('.check-all-checkboxes').prop('checked', false); | |||||
} | |||||
}); | |||||
} | |||||
}); | |||||
} | |||||
function opendistrib_point_sale_form() { | function opendistrib_point_sale_form() { | ||||
if($('.point-sale-form').length) { | if($('.point-sale-form').length) { | ||||
opendistrib_point_sale_form_days_distribution_event(); | opendistrib_point_sale_form_days_distribution_event(); |
} else { | } else { | ||||
app.document.address = ''; | app.document.address = ''; | ||||
} | } | ||||
setTimeout("opendistrib_check_all_checkboxes();", 500); | |||||
}); | }); | ||||
}, | }, | ||||
deleteDeliveryNoteFromInvoice: function(event) { | deleteDeliveryNoteFromInvoice: function(event) { |