@@ -107,7 +107,9 @@ $documentClass = $documentModule->getClass($model); | |||
class="table table-bordered"> | |||
<thead> | |||
<tr> | |||
<th></th> | |||
<th> | |||
<input type="checkbox" class="check-all-checkboxes" data-selector=".checkbox-delivery-note" /> | |||
</th> | |||
<th>Libellé</th> | |||
<th v-if="taxRateProducer != 0">Montant (TTC)</th> | |||
<th v-else>Montant</th> | |||
@@ -115,8 +117,7 @@ $documentClass = $documentModule->getClass($model); | |||
</thead> | |||
<tbody> | |||
<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>{{ formatPrice(deliveryNote.total) }}</td> | |||
</tr> |
@@ -56,6 +56,7 @@ $(document).ready(function () { | |||
opendistrib_user_form(); | |||
opendistrib_features_index(); | |||
opendistrib_point_sale_form(); | |||
opendistrib_check_all_checkboxes(); | |||
}); | |||
var UrlManager = { | |||
@@ -68,6 +69,22 @@ 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() { | |||
if($('.point-sale-form').length) { | |||
opendistrib_point_sale_form_days_distribution_event(); |
@@ -151,6 +151,7 @@ var app = new Vue({ | |||
} else { | |||
app.document.address = ''; | |||
} | |||
setTimeout("opendistrib_check_all_checkboxes();", 500); | |||
}); | |||
}, | |||
deleteDeliveryNoteFromInvoice: function(event) { |