terminado

This commit is contained in:
2025-05-05 07:42:27 +02:00
parent 058857e51b
commit ba3f4ab43c
2 changed files with 16 additions and 2 deletions

View File

@ -204,7 +204,7 @@
<th colspan="11">
<div class="text-end">
<?= lang("Logistica.unidadesTotalesFooter") ?>
<span id="footer-unidades-envio"></span>
<span id="footer-unidades"></span>
</div>
</th>
</tr>

View File

@ -200,7 +200,21 @@ class EtiquetaEdit {
targets: [6, 7, 8, 10],
visible: false
}
]
],
footerCallback: function (tfoot, data, start, end, display) {
const api = this.api();
let unidades = 0;
let peso = 0;
api.rows().data().each(function(rowData) {
unidades += parseInt(rowData.unidadesRaw) || 0;
peso += (parseInt(rowData.unidadesRaw) * parseFloat(rowData.pesoUnidad)) || 0;
});
$('#footer-unidades').html(unidades);
$('#footer-peso').html(peso.toFixed(2) + ' kg');
}
});
$('#tableLineasEtiqueta tbody').on('click', 'tr.group-header', function () {