Browse Source

[Administration] Factures > création : sélection de tous les BL en un clic

feature/souke
Guillaume Bourgeois 9 months ago
parent
commit
6d429fa189
3 changed files with 22 additions and 3 deletions
  1. +4
    -3
      backend/views/document/_form.php
  2. +17
    -0
      backend/web/js/backend.js
  3. +1
    -0
      backend/web/js/vuejs/document-form.js

+ 4
- 3
backend/views/document/_form.php View File

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>

+ 17
- 0
backend/web/js/backend.js View File

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();

+ 1
- 0
backend/web/js/vuejs/document-form.js View File

} else { } else {
app.document.address = ''; app.document.address = '';
} }
setTimeout("opendistrib_check_all_checkboxes();", 500);
}); });
}, },
deleteDeliveryNoteFromInvoice: function(event) { deleteDeliveryNoteFromInvoice: function(event) {

Loading…
Cancel
Save