export client data , WIP ask customer what columns they want
This commit is contained in:
parent
ed4e42f044
commit
61da185b04
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -428,6 +428,7 @@ $('body').on('click', '#exportThanatoData', function () {
|
||||
});
|
||||
|
||||
if(thanatoIdsToExport.length == 0){
|
||||
showError(t('gestion', "Veuillez choisir au moins une ligne de client"));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -443,9 +444,44 @@ $('body').on('click', '#exportThanatoData', function () {
|
||||
}).done(function (response) {
|
||||
let datatable = new DataTable('.tabledt');
|
||||
Thanatopracteur.loadThanatoDT(datatable);
|
||||
showSuccess(t('gestion', "Statistic exported : " + response));
|
||||
showSuccess(t('gestion', "Sauvegardé dans : " + response));
|
||||
}).fail(function (response, code) {
|
||||
showError(t('gestion', "Please select thanato to export"));
|
||||
showError(t('gestion', "Erreur dans l'export de statistique thanato"));
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
$('body').on('click', '#exportClientStat', function () {
|
||||
var oTable = $('.tabledt').dataTable();
|
||||
var rowcollection = oTable.$(".clientToExport:checked", {"page": "all"});
|
||||
let clientIdsToExport = [];
|
||||
rowcollection.each(function(index,elem){
|
||||
var checkbox_value = $(elem).val();
|
||||
clientIdsToExport.push(checkbox_value);
|
||||
});
|
||||
|
||||
if(clientIdsToExport.length == 0){
|
||||
showError(t('gestion', "Veuillez choisir au moins une ligne de client"));
|
||||
return;
|
||||
}
|
||||
|
||||
let exportClientPayload = {
|
||||
clientIdsToExport: clientIdsToExport
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
url: baseUrl + '/client/exportClientStatistic',
|
||||
type: 'POST',
|
||||
contentType: 'application/json',
|
||||
data: JSON.stringify(exportClientPayload)
|
||||
}).done(function (response) {
|
||||
let datatable = new DataTable('.tabledt');
|
||||
Client.loadClientDT(datatable);
|
||||
showSuccess(t('gestion', "Sauvegardé dans : " + response));
|
||||
}).fail(function (response, code) {
|
||||
showError(t('gestion', "Erreur dans l'export de statistique client"));
|
||||
});
|
||||
|
||||
|
||||
|
||||
@ -23,6 +23,7 @@ export class Client {
|
||||
*/
|
||||
getDTRow() {
|
||||
let myrow = [
|
||||
'<input class="clientToExport" data-id= '+ this.id + ' type="checkbox" name="clientToExport" value="' + this.id + '"/>',
|
||||
'<div>' + this.id + '</div>',
|
||||
'<div class="editable" data-table="client" data-column="entreprise" data-id="' + this.id + '">' + this.entreprise + '</div>',
|
||||
'<div class="editable" data-table="client" data-column="prenom" data-id="' + this.id + '">' + this.prenom + '</div>',
|
||||
|
||||
@ -13,9 +13,13 @@
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex jsutify-content-end">
|
||||
<button class="btn btn-secondary" id="exportClientStat">Export client stat</button>
|
||||
</div>
|
||||
<table id="client" class="display tabledt" style="font-size:11px;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php p($l->t('To export'));?></th>
|
||||
<th><?php p($l->t('ID'));?></th>
|
||||
<th><?php p($l->t('Company'));?></th>
|
||||
<th><?php p($l->t('First name'));?></th>
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex jsutify-content-end">
|
||||
<button class="btn btn-secondary" id="exportThanatoData">Export thanato data</button>
|
||||
<button class="btn btn-secondary" id="exportThanatoData">Export thanato stat</button>
|
||||
</div>
|
||||
<table id="client" class="display tabledt" style="font-size:11px;">
|
||||
<thead>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user