mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
totalizadores de servicios realizado
This commit is contained in:
@ -80,6 +80,7 @@
|
||||
<th><?= lang('Tarifaacabado.tarifaacabado') ?></th>
|
||||
<th><?= lang('Presupuestos.precioUnidad') ?></th>
|
||||
<th><?= lang('Presupuestos.precioTotal') ?></th>
|
||||
<th></th>
|
||||
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
@ -116,6 +117,7 @@
|
||||
<th><?= lang('Presupuestos.id') ?></th>
|
||||
<th><?= lang('Tarifapreimpresion.tarifapreimpresion') ?></th>
|
||||
<th><?= lang('Presupuestos.precio') ?></th>
|
||||
<th></th>
|
||||
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
@ -193,6 +195,7 @@
|
||||
<th><?= lang('Tarifamanipulado.tarifamanipulado') ?></th>
|
||||
<th><?= lang('Presupuestos.precioUnidad') ?></th>
|
||||
<th><?= lang('Presupuestos.precioTotal') ?></th>
|
||||
<th></th>
|
||||
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
@ -398,6 +401,7 @@
|
||||
data.lines.forEach((line) => {
|
||||
$('#precio_unidad_acabado_' + line[0].tarifa_id).text(parseFloat(line[0].precio_unidad).toFixed(2))
|
||||
$('#precio_total_acabado_' + line[0].tarifa_id).val(parseFloat(line[0].total).toFixed(2))
|
||||
$('#acabado_margen_' + line[0].tarifa_id).text(parseFloat(line[0].margen).toFixed(2))
|
||||
});
|
||||
yeniden(data.<?= csrf_token() ?>);
|
||||
}).then(
|
||||
@ -423,6 +427,7 @@
|
||||
$('#proveedor_enc_' + line[0].tarifa_id).val(line[0].proveedor_id)
|
||||
$('#precio_unidad_encuadernado_' + line[0].tarifa_id).text(parseFloat(line[0].precio_unidad).toFixed(2))
|
||||
$('#precio_total_encuadernado_' + line[0].tarifa_id).val(parseFloat(line[0].total).toFixed(2))
|
||||
$('#enc_margen_' + line[0].tarifa_id).val(parseFloat(line[0].margen).toFixed(2))
|
||||
$('#proveedor_enc_' + line[0].tarifa_id).on('change', proveedor_enc_event)
|
||||
});
|
||||
yeniden(data.<?= csrf_token() ?>);
|
||||
@ -444,10 +449,30 @@
|
||||
data.lines.forEach((line) => {
|
||||
$('#precio_unidad_manipulado_' + line[0].tarifa_id).text(parseFloat(line[0].precio_unidad).toFixed(2))
|
||||
$('#precio_total_manipulado_' + line[0].tarifa_id).val(parseFloat(line[0].total).toFixed(2))
|
||||
$('#manipulado_margen_' + line[0].tarifa_id).val(parseFloat(line[0].margen).toFixed(2))
|
||||
});
|
||||
yeniden(data.<?= csrf_token() ?>);
|
||||
})
|
||||
)
|
||||
}).then(
|
||||
fetch(domain + "/presupuestos/presupuestopreimpresiones/update/" + id , {
|
||||
method: "POST",
|
||||
body: JSON.stringify({
|
||||
datos: datosPreimpresion,
|
||||
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
|
||||
}),
|
||||
headers: {
|
||||
"Content-type": "application/json; charset=UTF-8"
|
||||
}
|
||||
})
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
data.lines.forEach((line) => {
|
||||
$('#precio_preimpresion_' + line[0].tarifa_id).val(parseFloat(line[0].total).toFixed(2))
|
||||
$('#preimpresion_margen_' + line[0].tarifa_id).val(parseFloat(line[0].margen).toFixed(2))
|
||||
});
|
||||
yeniden(data.<?= csrf_token() ?>);
|
||||
})
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
}
|
||||
@ -473,7 +498,9 @@
|
||||
language: {
|
||||
url: "//cdn.datatables.net/plug-ins/1.13.4/i18n/<?= config('Basics')->i18n ?>.json"
|
||||
},
|
||||
|
||||
"drawCallback": function(settings ) {
|
||||
updateTotales()
|
||||
}
|
||||
});
|
||||
|
||||
function init_servicio_acabado(){
|
||||
@ -491,7 +518,8 @@
|
||||
element.tarifa_acabado_id,
|
||||
element.nombre,
|
||||
'<span id="precio_unidad_acabado_' + element.tarifa_acabado_id + '">' + parseFloat(element.precio_unidad).toFixed(2) + '</span>',
|
||||
'<input id="precio_total_acabado_' + element.tarifa_acabado_id +'" value="' + parseFloat(element.precio_total).toFixed(2) + '"></input>',
|
||||
'<input class="update-totales" id="precio_total_acabado_' + element.tarifa_acabado_id +'" value="' + parseFloat(element.precio_total).toFixed(2) + '"></input>',
|
||||
'<span style="display: none;" class="update-totales" id="acabado_margen_' + element.tarifa_acabado_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_acabado_id +'"></i></a>'
|
||||
]).draw(false)
|
||||
|
||||
@ -548,7 +576,8 @@
|
||||
row.tarifa_id,
|
||||
row.tarifa_nombre,
|
||||
'<span id="precio_unidad_acabado_' + row.tarifa_id + '">' + parseFloat(row.precio_unidad).toFixed(2) + '</span>',
|
||||
'<input id="precio_total_acabado_' + row.tarifa_id +'" value="' + parseFloat(row.total).toFixed(2) + '"></input>',
|
||||
'<input class="update-totales" id="precio_total_acabado_' + row.tarifa_id +'" value="' + parseFloat(row.total).toFixed(2) + '"></input>',
|
||||
'<span style="display: none;" class="update-totales" id="acabado_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>'
|
||||
]).draw(false)
|
||||
});
|
||||
@ -595,6 +624,9 @@
|
||||
case 3:
|
||||
values['precio_total'] = $(this).children(":first").val()
|
||||
break
|
||||
case 4:
|
||||
values['margen'] = $(this).text()
|
||||
break
|
||||
}
|
||||
})
|
||||
if(Object.keys(values).length>0)
|
||||
@ -624,12 +656,10 @@
|
||||
select: false,
|
||||
language: {
|
||||
url: "//cdn.datatables.net/plug-ins/1.13.4/i18n/<?= config('Basics')->i18n ?>.json"
|
||||
},
|
||||
columnDefs: [{
|
||||
target: 5,
|
||||
visible: false
|
||||
}]
|
||||
|
||||
},
|
||||
"drawCallback": function(settings ) {
|
||||
updateTotales()
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@ -657,7 +687,7 @@
|
||||
'</select>',
|
||||
'<span id="precio_unidad_encuadernado_' + element.tarifa_encuadernado_id + '">' + parseFloat(element.precio_unidad).toFixed(2) + '</span>',
|
||||
'<input class="update-totales" id="precio_total_encuadernado_' + element.tarifa_encuadernado_id +'" value="' + parseFloat(element.precio_total).toFixed(2) + '"></input>',
|
||||
'<span class="update-totales" id="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>'
|
||||
]).draw(false)
|
||||
|
||||
@ -731,7 +761,7 @@
|
||||
|
||||
$('#precio_unidad_encuadernado_' + datos.tarifa_encuadernacion_id).text(parseFloat(data.values[0].precio_unidad).toFixed(2))
|
||||
$('#precio_total_encuadernado_' + datos.tarifa_encuadernacion_id).val(parseFloat(data.values[0].total).toFixed(2))
|
||||
$('#margen_' + datos.tarifa_encuadernacion_id).val(parseFloat(data.values[0].margen).toFixed(2))
|
||||
$('#enc_margen_' + datos.tarifa_encuadernacion_id).val(parseFloat(data.values[0].margen).toFixed(2))
|
||||
yeniden(data.<?= csrf_token() ?>);
|
||||
return true;
|
||||
},
|
||||
@ -796,6 +826,7 @@
|
||||
tableServiciosEnc.clear().draw()
|
||||
|
||||
data.values.forEach((row) => {
|
||||
|
||||
tableServiciosEnc.row.add([
|
||||
row.tarifa_id,
|
||||
row.tarifa_nombre,
|
||||
@ -806,7 +837,7 @@
|
||||
'</select>',
|
||||
'<span id="precio_unidad_encuadernado_' + row.tarifa_id + '">' + parseFloat(row.precio_unidad).toFixed(2) + '</span>',
|
||||
'<input class="update-totales" id="precio_total_encuadernado_' + row.tarifa_id +'" value="' + parseFloat(row.total).toFixed(2) + '"></input>',
|
||||
'<span class="update-totales" id="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>'
|
||||
]).draw(false)
|
||||
|
||||
@ -932,7 +963,9 @@
|
||||
language: {
|
||||
url: "//cdn.datatables.net/plug-ins/1.13.4/i18n/<?= config('Basics')->i18n ?>.json"
|
||||
},
|
||||
|
||||
"drawCallback": function(settings ) {
|
||||
updateTotales()
|
||||
}
|
||||
});
|
||||
|
||||
function init_servicio_manipulado(){
|
||||
@ -951,6 +984,7 @@
|
||||
element.nombre,
|
||||
'<span id="precio_unidad_manipulado_' + element.tarifa_manipulado_id + '">' + parseFloat(element.precio_unidad).toFixed(2) + '</span>',
|
||||
'<input class="update-totales" id="precio_total_manipulado_' + element.tarifa_manipulado_id +'" value="' + parseFloat(element.precio_total).toFixed(2) + '"></input>',
|
||||
'<span style="display: none;" class="update-totales" id="manipulado_margen_' + element.tarifa_manipulado_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_manipulado_id +'"></i></a>'
|
||||
]).draw(false)
|
||||
|
||||
@ -1016,7 +1050,8 @@
|
||||
row.tarifa_id,
|
||||
row.tarifa_nombre,
|
||||
'<span id="precio_unidad_manipulado_' + row.tarifa_id + '">' + parseFloat(row.precio_unidad).toFixed(2) + '</span>',
|
||||
'<input id="precio_total_manipulado_' + row.tarifa_id +'" value="' + parseFloat(row.total).toFixed(2) + '"></input>',
|
||||
'<input class="update-totales" id="precio_total_manipulado_' + row.tarifa_id +'" value="' + parseFloat(row.total).toFixed(2) + '"></input>',
|
||||
'<span style="display: none;" class="update-totales" id="manipulado_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>'
|
||||
]).draw(false)
|
||||
});
|
||||
@ -1036,8 +1071,9 @@
|
||||
const tarifa_text = $('#add_servicio_manipulado_list').select2('data')[0].text.trim()
|
||||
|
||||
if( $('#add_servicio_manipulado_list').select2('data')[0].text.trim().length > 0){
|
||||
if($('#tableOfServiciosManipulado tr > td:contains(' + tarifa_text + ')').length == 0)
|
||||
get_tarifas_manipulado($('#add_servicio_manipulado_list').select2('data')[0].id);
|
||||
if($('#tableOfServiciosManipulado tr > td:contains(' + tarifa_text + ')').length == 0){
|
||||
get_tarifas_manipulado(null, $('#add_servicio_manipulado_list').select2('data')[0].id);
|
||||
}
|
||||
else{
|
||||
popErrorAlert("<?= lang("Presupuestos.errores.error_servicios_duplicados") ?>", 'serv-manipulado-alert')
|
||||
}
|
||||
@ -1064,6 +1100,9 @@
|
||||
case 3:
|
||||
values['precio_total'] = $(this).children(":first").val()
|
||||
break
|
||||
case 4:
|
||||
values['margen'] = $(this).text()
|
||||
break
|
||||
}
|
||||
})
|
||||
if(Object.keys(values).length>0)
|
||||
@ -1095,9 +1134,12 @@
|
||||
language: {
|
||||
url: "//cdn.datatables.net/plug-ins/1.13.4/i18n/<?= config('Basics')->i18n ?>.json"
|
||||
},
|
||||
|
||||
"drawCallback": function(settings ) {
|
||||
updateTotales()
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
function init_servicio_preimpresion(){
|
||||
const serviciospreimpresionList = <?php echo json_encode($serviciosPreimpresionList); ?>;
|
||||
|
||||
@ -1112,7 +1154,8 @@
|
||||
tableServiciosPreimpresion.row.add([
|
||||
element.tarifa_preimpresion_id,
|
||||
element.nombre,
|
||||
'<input id="precio_preimpresion' + element.tarifa_preimpresion_id +'" value="' + parseFloat(element.precio).toFixed(2) + '"></input>',
|
||||
'<input class="update-totales" id="precio_preimpresion_' + element.tarifa_preimpresion_id +'" value="' + parseFloat(element.precio).toFixed(2) + '"></input>',
|
||||
'<span style="display: none;" class="update-totales" id="preimpresion_margen_' + element.tarifa_preimpresion_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_preimpresion_id +'"></i></a>'
|
||||
]).draw(false)
|
||||
|
||||
@ -1156,11 +1199,12 @@
|
||||
success: function (data) {
|
||||
|
||||
data.values.forEach((row) => {
|
||||
|
||||
|
||||
tableServiciosPreimpresion.row.add([
|
||||
row.tarifa_id,
|
||||
row.tarifa_nombre,
|
||||
'<input id="precio_preimpresion' + row.tarifa_id +'" value="' + parseFloat(row.precio).toFixed(2) + '"></input>',
|
||||
'<input class="update-totales" id="precio_preimpresion_' + row.tarifa_id +'" value="' + parseFloat(row.precio).toFixed(2) + '"></input>',
|
||||
'<span style="display: none;" class="update-totales" id="preimpresion_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>'
|
||||
]).draw(false)
|
||||
});
|
||||
@ -1205,6 +1249,9 @@
|
||||
case 2:
|
||||
values['precio'] = $(this).children(":first").val()
|
||||
break
|
||||
case 3:
|
||||
values['margen'] = $(this).text()
|
||||
break
|
||||
}
|
||||
})
|
||||
if(Object.keys(values).length>0)
|
||||
|
||||
@ -75,7 +75,7 @@
|
||||
<td class="lp-td"><input id="lp_bn_precioPliego" name="lp_bn_precioPliego" class="lp-input lp-cell lp-cell-disabled lp-bn-input" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_bn_libro" name="lp_bn_libro" readonly class="lp-input lp-cell lp-cell-disabled lp-bn-input" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_bn_totalPapelPedido" name="lp_bn_totalPapelPedido" readonly class="lp-input lp-cell lp-cell-disabled lp-bn-input" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_bn_margenPapelPedido" name="lp_bn_margenPapelPedido" readonly class="lp-input lp-cell lp-cell-disabled lp-bn-input" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_bn_margenPapelPedido" name="lp_bn_margenPapelPedido" readonly class="lp-input lp-cell lp-cell-disabled lp-bn-input" type="text" value="0" style="display: none;"></td>
|
||||
<td class="lp-td"><input id="lp_bn_checkPapel" name="lp_bn_checkPapel_bn" class="update-totales" style="width: 15px; padding: 0; margin:0;" type="checkbox" checked></td>
|
||||
<td class="lp-td"><input id="lp_bn_lomo" name="lp_bn_lomo" readonly class="lp-input lp-cell lp-cell-disabled lp-bn-input" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_bn_peso" name="lp_bn_peso" readonly class="lp-input lp-cell lp-cell-disabled lp-bn-input" type="text" value="0"></td>
|
||||
@ -120,7 +120,7 @@
|
||||
<td class="lp-td"><input id="lp_bnhq_precioPliego" name="lp_bnhq_precioPliego" class="lp-input lp-cell lp-cell-disabled lp-bnhq-input" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_bnhq_libro" name="lp_bnhq_libro" readonly class="lp-input lp-cell lp-cell-disabled lp-bnhq-input" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_bnhq_totalPapelPedido" name="lp_bnhq_totalPapelPedido" readonly class="lp-input lp-cell lp-cell-disabled lp-bnhq-input" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_bnhq_margenPapelPedido" name="lp_bnhq_margenPapelPedido" readonly class="lp-input lp-cell lp-cell-disabled lp-bnhq-input" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_bnhq_margenPapelPedido" name="lp_bnhq_margenPapelPedido" readonly class="lp-input lp-cell lp-cell-disabled lp-bnhq-input" type="text" value="0" style="display: none;"></td>
|
||||
<td class="lp-td"><input id="lp_bnhq_checkPapel" name="lp_bnhq_checkPapel_bn"class="update-totales" style="width: 15px; padding: 0; margin:0;" type="checkbox" checked></td>
|
||||
<td class="lp-td"><input id="lp_bnhq_lomo" name="lp_bnhq_lomo" readonly class="lp-input lp-cell lp-cell-disabled lp-bnhq-input" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_bnhq_peso" name="lp_bnhq_peso" readonly class="lp-input lp-cell lp-cell-disabled lp-bnhq-input" type="text" value="0"></td>
|
||||
@ -165,7 +165,7 @@
|
||||
<td class="lp-td"><input id="lp_color_precioPliego" name="lp_color_precioPliego" class="lp-input lp-cell lp-cell-disabled lp-color-input" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_color_libro" name="lp_color_libro" readonly class="lp-input lp-cell lp-cell-disabled lp-color-input" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_color_totalPapelPedido" name="lp_color_totalPapelPedido" readonly class="lp-input lp-cell lp-cell-disabled lp-color-input" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_color_margenPapelPedido" name="lp_color_margenPapelPedido" readonly class="lp-input lp-cell lp-cell-disabled lp-color-input" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_color_margenPapelPedido" name="lp_color_margenPapelPedido" readonly class="lp-input lp-cell lp-cell-disabled lp-color-input" type="text" value="0" style="display: none;"></td>
|
||||
<td class="lp-td"><input id="lp_color_checkPapel" name="lp_color_checkPapel_bn"class="update-totales" style="width: 15px; padding: 0; margin:0;" type="checkbox" checked></td>
|
||||
<td class="lp-td"><input id="lp_color_lomo" name="lp_color_lomo" readonly class="lp-input lp-cell lp-cell-disabled lp-color-input" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_color_peso" name="lp_color_peso" readonly class="lp-input lp-cell lp-cell-disabled lp-color-input" type="text" value="0"></td>
|
||||
@ -211,7 +211,7 @@
|
||||
<td class="lp-td"><input id="lp_colorhq_precioPliego" name="lp_colorhq_precioPliego" class="lp-input lp-cell lp-cell-disabled lp-colorhq-input" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_colorhq_libro" name="lp_colorhq_libro" readonly class="lp-input lp-cell lp-cell-disabled lp-colorhq-input" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_colorhq_totalPapelPedido" name="lp_colorhq_totalPapelPedido" readonly class="lp-input lp-cell lp-cell-disabled lp-colorhq-input" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_colorhq_margenPapelPedido" name="lp_colorhq_margenPapelPedido" readonly class="lp-input lp-cell lp-cell-disabled lp-colorhq-input" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_colorhq_margenPapelPedido" name="lp_colorhq_margenPapelPedido" readonly class="lp-input lp-cell lp-cell-disabled lp-colorhq-input" type="text" value="0" style="display: none;"></td>
|
||||
<td class="lp-td"><input id="lp_colorhq_checkPapel" name="lp_colorhq_checkPapel_bn"class="update-totales" style="width: 15px; padding: 0; margin:0;" type="checkbox" checked></td>
|
||||
<td class="lp-td"><input id="lp_colorhq_lomo" name="lp_colorhq_lomo" readonly class="lp-input lp-cell lp-cell-disabled lp-colorhq-input" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_colorhq_peso" name="lp_colorhq_peso" readonly class="lp-input lp-cell lp-cell-disabled lp-colorhq-input" type="text" value="0"></td>
|
||||
@ -256,7 +256,7 @@
|
||||
<td class="lp-td"><input id="lp_rot_bn_precioPliego" name="lp_rot_bn_precioPliego" class="lp-input lp-cell lp-cell-disabled lp-rotbn-input" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_rot_bn_libro" name="lp_rot_bn_libro" readonly class="lp-input lp-cell lp-cell-disabled lp-rotbn-input" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_rot_bn_totalPapelPedido" name="lp_rot_bn_totalPapelPedido" readonly class="lp-input lp-cell lp-cell-disabled lp-rotbn-input" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_rot_bn_margenPapelPedido" name="lp_rot_bn_margenPapelPedido" readonly class="lp-input lp-cell lp-cell-disabled lp-rotbn-input" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_rot_bn_margenPapelPedido" name="lp_rot_bn_margenPapelPedido" readonly class="lp-input lp-cell lp-cell-disabled lp-rotbn-input" type="text" value="0" style="display: none;"></td>
|
||||
<td class="lp-td"><input id="lp_rot_bn_checkPapel" name="lp_rot_bn_checkPapel_bn"class="update-totales" style="width: 15px; padding: 0; margin:0;" type="checkbox" checked></td>
|
||||
<td class="lp-td"><input id="lp_rot_bn_lomo" name="lp_rot_bn_lomo" readonly class="lp-input lp-cell lp-cell-disabled lp-rotbn-input" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_rot_bn_peso" name="lp_rot_bn_peso" readonly class="lp-input lp-cell lp-cell-disabled lp-rotbn-input" type="text" value="0"></td>
|
||||
@ -508,7 +508,7 @@
|
||||
<td class="lp-td"><input id="lp_rot_color_precioPliego" name="lp_rot_color_precioPliego" class="lp-input lp-cell lp-cell-disabled lp-rotcolor-input" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_rot_color_libro" name="lp_rot_color_libro" readonly class="lp-input lp-cell lp-cell-disabled lp-rotcolor-input" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_rot_color_totalPapelPedido" name="lp_rot_color_totalPapelPedido" readonly class="lp-input lp-cell lp-cell-disabled lp-rotcolor-input" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_rot_color_margenPapelPedido" name="lp_rot_color_margenPapelPedido" readonly class="lp-input lp-cell lp-cell-disabled lp-rotcolor-input" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_rot_color_margenPapelPedido" name="lp_rot_color_margenPapelPedido" readonly class="lp-input lp-cell lp-cell-disabled lp-rotcolor-input" type="text" value="0" style="display: none;"></td>
|
||||
<td class="lp-td"><input id="lp_rot_color_checkPapel" name="lp_rot_color_checkPapel_bn"class="update-totales" style="width: 15px; padding: 0; margin:0;" type="checkbox" checked></td>
|
||||
<td class="lp-td"><input id="lp_rot_color_lomo" name="lp_rot_color_lomo" readonly class="lp-input lp-cell lp-cell-disabled lp-rotcolor-input" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_rot_color_peso" name="lp_rot_color_peso" readonly class="lp-input lp-cell lp-cell-disabled lp-rotcolor-input" type="text" value="0"></td>
|
||||
@ -768,7 +768,7 @@
|
||||
<td class="lp-td"><input id="lp_cubierta_precioPliego" name="lp_cubierta_precioPliego" class="lp-input lp-cell lp-cell-disabled lp-cubierta-input" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_cubierta_libro" name="lp_cubierta_libro" readonly class="lp-input lp-cell lp-cell-disabled lp-cubierta-input" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_cubierta_totalPapelPedido" name="lp_cubierta_totalPapelPedido" readonly class="lp-input lp-cell lp-cell-disabled lp-cubierta-input" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_cubierta_margenPapelPedido" name="lp_cubierta_margenPapelPedido" readonly class="lp-input lp-cell lp-cell-disabled lp-cubierta-input" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_cubierta_margenPapelPedido" name="lp_cubierta_margenPapelPedido" readonly class="lp-input lp-cell lp-cell-disabled lp-cubierta-input" type="text" value="0" style="display: none;"></td>
|
||||
<td class="lp-td"><input id="lp_cubierta_checkPapel" name="lp_cubierta_checkPapel_bn"class="update-totales" style="width: 15px; padding: 0; margin:0;" type="checkbox" checked></td>
|
||||
<td class="lp-td"><input id="lp_cubierta_lomo" name="lp_cubierta_lomo" readonly class="lp-input lp-cell lp-cell-disabled lp-cubierta-input" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_cubierta_peso" name="lp_cubierta_peso" readonly class="lp-input lp-cell lp-cell-disabled lp-cubierta-input" type="text" value="0"></td>
|
||||
@ -813,7 +813,7 @@
|
||||
<td class="lp-td"><input id="lp_sobrecubierta_precioPliego" name="lp_sobrecubierta_precioPliego" class="lp-input lp-cell lp-cell-disabled" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_sobrecubierta_libro" name="lp_sobrecubierta_libro" readonly class="lp-input lp-cell lp-cell-disabled" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_sobrecubierta_totalPapelPedido" name="lp_sobrecubierta_totalPapelPedido" readonly class="lp-input lp-cell lp-cell-disabled" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_sobrecubierta_margenPapelPedido" name="lp_sobrecubierta_margenPapelPedido" readonly class="lp-input lp-cell lp-cell-disabled" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_sobrecubierta_margenPapelPedido" name="lp_sobrecubierta_margenPapelPedido" readonly class="lp-input lp-cell lp-cell-disabled" type="text" value="0" style="display: none;"></td>
|
||||
<td class="lp-td"><input id="lp_sobrecubierta_checkPapel" name="lp_sobrecubierta_checkPapel_bn"class="update-totales" style="width: 15px; padding: 0; margin:0;" type="checkbox" checked></td>
|
||||
<td class="lp-td"><input id="lp_sobrecubierta_lomo" name="lp_sobrecubierta_lomo" readonly class="lp-input lp-cell lp-cell-disabled" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_sobrecubierta_peso" name="lp_sobrecubierta_peso" readonly class="lp-input lp-cell lp-cell-disabled" type="text" value="0"></td>
|
||||
@ -2698,13 +2698,6 @@ var tableLineasPresupuesto = new DataTable('#tableLineasPresupuesto',{
|
||||
language: {
|
||||
url: "//cdn.datatables.net/plug-ins/1.13.4/i18n/<?= config('Basics')->i18n ?>.json"
|
||||
},
|
||||
columnDefs: [
|
||||
{
|
||||
target: 12,
|
||||
visible: false
|
||||
}
|
||||
]
|
||||
|
||||
});
|
||||
|
||||
async function set_lp_cubierta_gramaje(){
|
||||
|
||||
@ -78,8 +78,6 @@
|
||||
|
||||
updateTotales()
|
||||
|
||||
$(".update-totales").on("change", updateTotales)
|
||||
|
||||
function updateTotales(){
|
||||
totalPapel = 0
|
||||
margenPapel = 0
|
||||
@ -89,14 +87,7 @@ function updateTotales(){
|
||||
totalServicios = 0
|
||||
margenServicios = 0
|
||||
|
||||
tableLineasPresupuesto.rows({filter: 'applied'}).every( function ( rowIdx, tableLoop, rowLoop ) {
|
||||
|
||||
/*totalServicios += parseFloat(tableServiciosEnc.cell(rowIdx, 4).node().lastChild.value)
|
||||
margenServicios += parseFloat(tableServiciosEnc.cell(rowIdx, 5).node().lastChild.innerText)
|
||||
*/
|
||||
});
|
||||
|
||||
/*$('#tableLineasPresupuesto tbody tr:visible ').each(function(){
|
||||
$('#tableLineasPresupuesto tbody tr:visible ').each(function(){
|
||||
if($('#' + this.id + '_checkPapel').prop('checked')){
|
||||
totalPapel += parseFloat($('#' + this.id + '_totalPapelPedido').val())
|
||||
margenPapel += parseFloat($('#' + this.id + '_margenPapelPedido').val())
|
||||
@ -104,36 +95,67 @@ function updateTotales(){
|
||||
if($('#' + this.id + '_checkClicks').prop('checked')){
|
||||
totalImpresion += parseFloat($('#' + this.id + '_totalClicks').val())
|
||||
}
|
||||
})*/
|
||||
})
|
||||
|
||||
$('#totalCostePapel').text(totalPapel.toFixed(2) + '€')
|
||||
$('#margenPapel').text(margenPapel.toFixed(2) + '€')
|
||||
|
||||
|
||||
$('#totalCosteImpresion').text(totalImpresion.toFixed(2) + '€')
|
||||
$('#margenImpresion').text((totalImpresion*$('#margenImpresionValue').val()/100.0).toFixed(2) + '€')
|
||||
|
||||
tableServiciosEnc.rows().every( function ( rowIdx, tableLoop, rowLoop ) {
|
||||
if ( typeof tableServiciosEnc !== 'undefined' && tableServiciosEnc.rows().count() > 0){
|
||||
$('#tableOfServiciosEncuadernacion tbody tr').each(function(){
|
||||
var currentRow = $(this).closest("tr");
|
||||
var subId = $('#tableOfServiciosEncuadernacion').DataTable().cell(currentRow,0).node().innerHTML;
|
||||
var total = parseFloat($('#precio_total_encuadernado_' + subId)[0].value)
|
||||
totalServicios += total
|
||||
margenServicios += (total*parseFloat($('#enc_margen_' + subId)[0].innerHTML)/100.0)
|
||||
})
|
||||
}
|
||||
|
||||
if ( typeof tableServiciosAcabado !== 'undefined' && tableServiciosAcabado.rows().count() > 0){
|
||||
$('#tableOfServiciosAcabado tbody tr').each(function(){
|
||||
var currentRow = $(this).closest("tr");
|
||||
var subId = $('#tableOfServiciosAcabado').DataTable().cell(currentRow,0).node().innerHTML;
|
||||
var total = parseFloat($('#precio_total_acabado_' + subId)[0].value)
|
||||
totalServicios += total
|
||||
margenServicios += (total*parseFloat($('#acabado_margen_' + subId)[0].innerHTML)/100.0)
|
||||
})
|
||||
}
|
||||
|
||||
totalServicios += parseFloat(tableServiciosEnc.cell(rowIdx, 4).node().lastChild.value)
|
||||
margenServicios += parseFloat(tableServiciosEnc.cell(rowIdx, 5).node().lastChild.innerText)
|
||||
if ( typeof tableServiciosPreimpresion !== 'undefined' && tableServiciosPreimpresion.rows().count() > 0){
|
||||
|
||||
$('#tableOfServiciosPreimpresion tbody tr').each(function(){
|
||||
var currentRow = $(this).closest("tr");
|
||||
var subId = $('#tableOfServiciosPreimpresion').DataTable().cell(currentRow,0).node().innerHTML;
|
||||
var total = parseFloat($('#precio_preimpresion_' + subId)[0].value)
|
||||
totalServicios += total
|
||||
margenServicios += (total*parseFloat($('#preimpresion_margen_' + subId)[0].innerHTML)/100.0)
|
||||
})
|
||||
}
|
||||
|
||||
});
|
||||
if ( typeof tableServiciosManipulado !== 'undefined' && tableServiciosManipulado.rows().count() > 0){
|
||||
|
||||
$('#tableOfServiciosManipulado tbody tr').each(function(){
|
||||
var currentRow = $(this).closest("tr");
|
||||
var subId = $('#tableOfServiciosManipulado').DataTable().cell(currentRow,0).node().innerHTML;
|
||||
var total = parseFloat($('#precio_total_manipulado_' + subId)[0].value)
|
||||
totalServicios += total
|
||||
margenServicios += (total*parseFloat($('#manipulado_margen_' + subId)[0].innerHTML)/100.0)
|
||||
})
|
||||
}
|
||||
|
||||
/*$('#tableOfServiciosEncuadernacion tbody tr').each(function(){
|
||||
console.log(this)
|
||||
var currentRow = $(this).closest("tr");
|
||||
var data = $('#myTable').DataTable().row(currentRow).data();
|
||||
console.log(data)
|
||||
//margenServicios += parseFloat(this.text())
|
||||
})*/
|
||||
/*$('#tableOfServiciosEncuadernacion tbody tr td:nth-child(4)').each(function(){
|
||||
totalServicios += parseFloat(this.text())
|
||||
})*/
|
||||
totalServicios -= margenServicios;
|
||||
$('#totalServicios').text(totalServicios.toFixed(2) + '€')
|
||||
$('#margenServicios').text(margenServicios.toFixed(2) + '€')
|
||||
|
||||
}
|
||||
|
||||
$(".update-totales").on("change", function(){
|
||||
updateTotales()
|
||||
})
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user