mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Merge branch 'add/impresion_etiquetas_footer' into 'main'
terminado See merge request jjimenez/safekat!767
This commit is contained in:
@ -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>
|
||||
|
||||
@ -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 () {
|
||||
|
||||
Reference in New Issue
Block a user