arreglado que no se mostraba el tiempo cuando se añadian los servicios por defecto

This commit is contained in:
2024-08-20 13:23:06 +02:00
parent 2734a94983
commit 996cafeb65

View File

@ -527,7 +527,7 @@ function init_servicio_encuadernado(){
'</option>' + '</option>' +
'</select>', '</select>',
'<span id="precio_unidad_encuadernado_' + element.tarifa_encuadernado_id + '">' + parseFloat(element.precio_unidad).toFixed(2) + '</span>', '<span id="precio_unidad_encuadernado_' + element.tarifa_encuadernado_id + '">' + parseFloat(element.precio_unidad).toFixed(2) + '</span>',
'<span id="tiempo_encuadernado_' + element.tiempo + '">' + convertirTiempo(element.tiempo) + '</span>', '<span id="tiempo_encuadernado_' + element.tarifa_encuadernado_id + '">' + convertirTiempo(element.tiempo) + '</span>',
'<input class="update-totales-servicios" id="precio_total_encuadernado_' + element.tarifa_encuadernado_id +'" value="' + parseFloat(element.precio_total).toFixed(2) + '"></input>', '<input class="update-totales-servicios" id="precio_total_encuadernado_' + element.tarifa_encuadernado_id +'" value="' + parseFloat(element.precio_total).toFixed(2) + '"></input>',
'<span style="display: none;" class="update-totales" id="enc_margen_' + element.tarifa_encuadernado_id + '">' + parseFloat(element.margen).toFixed(2) + '</span>', '<span style="display: none;" class="update-totales" id="enc_margen_' + element.tarifa_encuadernado_id + '">' + parseFloat(element.margen).toFixed(2) + '</span>',
'<a href="javascript:void(0);"><i class="ti ti-trash ti-sm btn-delete-serv mx-2" data-id="' + element.tarifa_encuadernado_id +'"></i></a>' '<a href="javascript:void(0);"><i class="ti ti-trash ti-sm btn-delete-serv mx-2" data-id="' + element.tarifa_encuadernado_id +'"></i></a>'
@ -590,7 +590,7 @@ function init_servicio_encuadernado(){
} }
function convertirTiempo(horas){ function convertirTiempo(horas){
if(horas != null && horas.length>0){ if(horas != null){
if(parseFloat(horas)>0){ if(parseFloat(horas)>0){
const seconds = parseFloat(horas) * 3600; const seconds = parseFloat(horas) * 3600;
// se convierte a formato hh:mm:ss // se convierte a formato hh:mm:ss
@ -719,7 +719,7 @@ async function get_tarifas_enc(tipo=null, tarifa_id = -1){
'</option>' + '</option>' +
'</select>', '</select>',
'<span id="precio_unidad_encuadernado_' + row.tarifa_id + '">' + parseFloat(row.precio_unidad).toFixed(2) + '</span>', '<span id="precio_unidad_encuadernado_' + row.tarifa_id + '">' + parseFloat(row.precio_unidad).toFixed(2) + '</span>',
'<span id="tiempo_encuadernado_' + row.tiempo + '">' + convertirTiempo(row.tiempo) + '</span>', '<span id="tiempo_encuadernado_' + row.tarifa_id + '">' + convertirTiempo(row.tiempo) + '</span>',
'<input class="update-totales-servicios" id="precio_total_encuadernado_' + row.tarifa_id +'" value="' + parseFloat(row.total).toFixed(2) + '"></input>', '<input class="update-totales-servicios" id="precio_total_encuadernado_' + row.tarifa_id +'" value="' + parseFloat(row.total).toFixed(2) + '"></input>',
'<span style="display: none;" class="update-totales" id="enc_margen_' + row.tarifa_id + '">' + parseFloat(row.margen).toFixed(2) + '</span>', '<span style="display: none;" class="update-totales" id="enc_margen_' + row.tarifa_id + '">' + parseFloat(row.margen).toFixed(2) + '</span>',
'<a href="javascript:void(0);"><i class="ti ti-trash ti-sm btn-delete-serv mx-2" data-id="' + row.tarifa_id +'"></i></a>' '<a href="javascript:void(0);"><i class="ti ti-trash ti-sm btn-delete-serv mx-2" data-id="' + row.tarifa_id +'"></i></a>'