Skip to content

Commit ed0a9f9

Browse files
committed
fix: ricerca e visualizzazione fatture da importare
1 parent 95a57c5 commit ed0a9f9

4 files changed

Lines changed: 28 additions & 28 deletions

File tree

plugins/importFE_ZIP/edit.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ function upload1(btn) {
223223
</div>
224224
</div>
225225
<br>
226-
<div class="card-body" id="list">';
226+
<div class="card-body" id="list-importfe-zip">';
227227

228228
if (Interaction::isEnabled()) {
229229
echo '
@@ -359,10 +359,10 @@ function searchInvoicesZip(btn) {
359359
var restore = buttonLoading(btn);
360360
361361
// Mostra un\'animazione di caricamento nella lista
362-
$("#list").html("<div class=\"text-center py-5\"><i class=\"fa fa-refresh fa-spin fa-3x fa-fw text-primary\"></i><div class=\"mt-3\">"+globals.translations.searching+"</div></div>");
362+
$("#list-importfe-zip").html("<div class=\"text-center py-5\"><i class=\"fa fa-refresh fa-spin fa-3x fa-fw text-primary\"></i><div class=\"mt-3\">"+globals.translations.searching+"</div></div>");
363363
364364
// Carica la lista delle fatture
365-
$("#list").load("'.$structure->fileurl('list.php').'?id_module='.$id_module.'&id_plugin='.$id_plugin.'", function() {
365+
$("#list-importfe-zip").load("'.$structure->fileurl('list.php').'?id_module='.$id_module.'&id_plugin='.$id_plugin.'", function() {
366366
buttonRestore(btn, restore);
367367
368368
// Applica il filtro di ricerca se presente
@@ -378,12 +378,12 @@ function applySearchFilter() {
378378
379379
// Mostra tutte le righe se il campo di ricerca è vuoto
380380
if(searchValue.length === 0) {
381-
$("table tbody tr").show();
381+
$("#list-importfe-zip table tbody tr").show();
382382
return;
383383
}
384384
385385
// Aggiungi un effetto di evidenziazione durante la ricerca
386-
$("table tbody tr").each(function() {
386+
$("#list-importfe-zip table tbody tr").each(function() {
387387
var rowText = $(this).text().toLowerCase();
388388
var match = rowText.indexOf(searchValue) > -1;
389389
@@ -395,14 +395,14 @@ function applySearchFilter() {
395395
});
396396
397397
// Mostra un messaggio se non ci sono risultati
398-
if($("table tbody tr:visible").length === 0) {
399-
if($("#no-results-message").length === 0) {
400-
$("table tbody").append("<tr id=\"no-results-message\"><td colspan=\"5\" class=\"text-center text-muted py-3\"><i class=\"fa fa-search mr-2\"></i>"+globals.translations.no_results_found+" \"" + searchValue + "\"</td></tr>");
398+
if($("#list-importfe-zip table tbody tr:visible").length === 0) {
399+
if($("#list-importfe-zip #no-results-message").length === 0) {
400+
$("#list-importfe-zip table tbody").append("<tr id=\"no-results-message\"><td colspan=\"5\" class=\"text-center text-muted py-3\"><i class=\"fa fa-search mr-2\"></i>"+globals.translations.no_results_found+" \"" + searchValue + "\"</td></tr>");
401401
} else {
402-
$("#no-results-message td").html("<i class=\"fa fa-search mr-2\"></i>"+globals.translations.no_results_found+" \"" + searchValue + "\"");
402+
$("#list-importfe-zip #no-results-message td").html("<i class=\"fa fa-search mr-2\"></i>"+globals.translations.no_results_found+" \"" + searchValue + "\"");
403403
}
404404
} else {
405-
$("#no-results-message").remove();
405+
$("#list-importfe-zip #no-results-message").remove();
406406
}
407407
}
408408

plugins/importFE_ZIP/list.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
use Carbon\Carbon;
2424
use Plugins\ImportFE\Interaction;
2525

26-
$list = Interaction::getInvoiceList('Fatture di vendita', 'Importazione FE');
26+
$list = Interaction::getFileList($list = [] , 'Fatture di vendita', 'Importazione FE');
2727

2828
$directory = Plugins\ImportFE\FatturaElettronica::getImportDirectory('Fatture di vendita', 'Importazione FE');
2929
if (!empty($list)) {
@@ -219,11 +219,11 @@ function process_fe_vendita(button, file) {
219219
swal("'.tr('Errore').'", response.message || "'.tr('Errore durante l\'elaborazione del file').'", "error");
220220
}
221221
222-
$("#list").load("'.$structure->fileurl('list.php').'?id_module='.$id_module.'&id_plugin='.$id_plugin.'", function() {
222+
$("#list-importfe-zip").load("'.$structure->fileurl('list.php').'?id_module='.$id_module.'&id_plugin='.$id_plugin.'", function() {
223223
buttonRestore(button, restore);
224224
});
225225
} catch (e) {
226-
$("#list").load("'.$structure->fileurl('list.php').'?id_module='.$id_module.'&id_plugin='.$id_plugin.'", function() {
226+
$("#list-importfe-zip").load("'.$structure->fileurl('list.php').'?id_module='.$id_module.'&id_plugin='.$id_plugin.'", function() {
227227
buttonRestore(button, restore);
228228
});
229229
}
@@ -267,7 +267,7 @@ function delete_fe_vendita(button, file_id) {
267267
268268
if (response.success) {
269269
swal("'.tr('Successo').'", response.message || "'.tr('File eliminato correttamente').'", "success");
270-
$("#list").load("'.$structure->fileurl('list.php').'?id_module='.$id_module.'&id_plugin='.$id_plugin.'", function() {
270+
$("#list-importfe-zip").load("'.$structure->fileurl('list.php').'?id_module='.$id_module.'&id_plugin='.$id_plugin.'", function() {
271271
buttonRestore(button, restore);
272272
});
273273
} else {

plugins/receiptFE/edit.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@
170170

171171
echo '
172172
</div>
173-
<div class="card-body" id="list">';
173+
<div class="card-body" id="list-receiptfe">';
174174

175175
if (Interaction::isEnabled()) {
176176
echo '
@@ -210,12 +210,12 @@ function applySearchFilter() {
210210
211211
// Mostra tutte le righe se il campo di ricerca è vuoto
212212
if(searchValue.length === 0) {
213-
$("table tbody tr").show();
213+
$("#list-receiptfe table tbody tr").show();
214214
return;
215215
}
216216
217217
// Aggiungi un effetto di evidenziazione durante la ricerca
218-
$("table tbody tr").each(function() {
218+
$("#list-receiptfe table tbody tr").each(function() {
219219
var rowText = $(this).text().toLowerCase();
220220
var match = rowText.indexOf(searchValue) > -1;
221221
@@ -227,25 +227,25 @@ function applySearchFilter() {
227227
});
228228
229229
// Mostra un messaggio se non ci sono risultati
230-
if($("table tbody tr:visible").length === 0) {
231-
if($("#no-results-message").length === 0) {
232-
$("table tbody").append("<tr id=\"no-results-message\"><td colspan=\"3\" class=\"text-center text-muted py-3\"><i class=\"fa fa-search mr-2\"></i>"+globals.translations.no_results_found+" \"" + searchValue + "\"</td></tr>");
230+
if($("#list-receiptfe table tbody tr:visible").length === 0) {
231+
if($("#list-receiptfe #no-results-message").length === 0) {
232+
$("#list-receiptfe table tbody").append("<tr id=\"no-results-message\"><td colspan=\"3\" class=\"text-center text-muted py-3\"><i class=\"fa fa-search mr-2\"></i>"+globals.translations.no_results_found+" \"" + searchValue + "\"</td></tr>");
233233
} else {
234-
$("#no-results-message td").html("<i class=\"fa fa-search mr-2\"></i>"+globals.translations.no_results_found+" \"" + searchValue + "\"");
234+
$("#list-receiptfe #no-results-message td").html("<i class=\"fa fa-search mr-2\"></i>"+globals.translations.no_results_found+" \"" + searchValue + "\"");
235235
}
236236
} else {
237-
$("#no-results-message").remove();
237+
$("#list-receiptfe #no-results-message").remove();
238238
}
239239
}
240240
241241
function searchReceipts(button) {
242242
var restore = buttonLoading(button);
243243
244244
// Mostra un\'animazione di caricamento nella lista
245-
$("#list").html("<div class=\"text-center py-5\"><i class=\"fa fa-refresh fa-spin fa-3x fa-fw text-primary\"></i><div class=\"mt-3\">"+globals.translations.searching+"</div></div>");
245+
$("#list-receiptfe").html("<div class=\"text-center py-5\"><i class=\"fa fa-refresh fa-spin fa-3x fa-fw text-primary\"></i><div class=\"mt-3\">"+globals.translations.searching+"</div></div>");
246246
247247
// Carica la lista delle ricevute con parametro per forzare refresh cache
248-
$("#list").load("'.$structure->fileurl('list.php').'?id_module='.$id_module.'&id_plugin='.$id_plugin.'&refresh_cache=" + Date.now(), function() {
248+
$("#list-receiptfe").load("'.$structure->fileurl('list.php').'?id_module='.$id_module.'&id_plugin='.$id_plugin.'&refresh_cache=" + Date.now(), function() {
249249
buttonRestore(button, restore);
250250
251251
// Applica il filtro di ricerca se presente
@@ -361,7 +361,7 @@ function importAllReceipt(btn) {
361361
html += "<br><small>'.tr("Se si sono verificati degli errori durante la procedura e il problema continua a verificarsi, contatta l'assistenza ufficiale").'</small>";
362362
}
363363
364-
$("#list").load("'.$structure->fileurl('list.php').'?id_module='.$id_module.'&id_plugin='.$id_plugin.'", function() {
364+
$("#list-receiptfe").load("'.$structure->fileurl('list.php').'?id_module='.$id_module.'&id_plugin='.$id_plugin.'", function() {
365365
swal({
366366
title: "'.tr('Operazione completata!').'",
367367
html: html,

plugins/receiptFE/list.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ function import_fe(button, file) {
107107
importMessage(data);
108108
109109
buttonRestore(button, restore);
110-
$("#list").load("'.$structure->fileurl('list.php').'?id_module='.$id_module.'&id_plugin='.$id_plugin.'");
110+
$("#list-receiptfe").load("'.$structure->fileurl('list.php').'?id_module='.$id_module.'&id_plugin='.$id_plugin.'");
111111
},
112112
error: function(xhr) {
113113
$("#main_loading").fadeOut();
@@ -143,7 +143,7 @@ function delete_fe(button, file_id) {
143143
},
144144
success: function(data) {
145145
$("#main_loading").fadeOut();
146-
$("#list").load("'.$structure->fileurl('list.php').'?id_module='.$id_module.'&id_plugin='.$id_plugin.'", function() {
146+
$("#list-receiptfe").load("'.$structure->fileurl('list.php').'?id_module='.$id_module.'&id_plugin='.$id_plugin.'", function() {
147147
buttonRestore(button, restore);
148148
});
149149
},
@@ -182,7 +182,7 @@ function process_fe(button, file) {
182182
},
183183
success: function(data) {
184184
$("#main_loading").fadeOut();
185-
$("#list").load("'.$structure->fileurl('list.php').'?id_module='.$id_module.'&id_plugin='.$id_plugin.'", function() {
185+
$("#list-receiptfe").load("'.$structure->fileurl('list.php').'?id_module='.$id_module.'&id_plugin='.$id_plugin.'", function() {
186186
buttonRestore(button, restore);
187187
});
188188
},

0 commit comments

Comments
 (0)