mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
arreglado bug para cuando sólo hay una linea de plana
This commit is contained in:
@ -20,11 +20,23 @@ class PresupuestoClienteService extends BaseService
|
|||||||
$rotativa = PresupuestoClienteService::obtenerPresupuestoClienteInteriorRotativa($data);
|
$rotativa = PresupuestoClienteService::obtenerPresupuestoClienteInteriorRotativa($data);
|
||||||
|
|
||||||
$total_plana = -1;
|
$total_plana = -1;
|
||||||
if (count($plana[0]) > 0 || count($plana[1]) > 0) {
|
if($data['isColor']){
|
||||||
$total_plana = 0.0;
|
if (count($plana[0]) > 2 && count($plana[1]) > 2) {
|
||||||
|
$total_plana = 0.0;
|
||||||
|
foreach ($plana as $linea) {
|
||||||
|
if (count($linea) > 0)
|
||||||
|
$total_plana += floatval($linea['total_impresion']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
foreach ($plana as $linea) {
|
foreach ($plana as $linea) {
|
||||||
if (count($linea) > 0)
|
if (count($linea) > 0)
|
||||||
$total_plana += floatval($linea['total_impresion']);
|
if($linea['tipo_linea'] == 'lp_bn' || $linea['tipo_linea'] == 'lp_bnhq'){
|
||||||
|
$total_plana = 0.0;
|
||||||
|
$total_plana = floatval($linea['total_impresion']);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -338,7 +338,7 @@ $('#papelSobrecubierta').on('change', function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (valSobrecubierta != undefined)
|
if (valSobrecubierta != undefined)
|
||||||
$('#gramajeSobrecubierta option[value=' + valCubierta + ']').prop('selected', true).trigger('change');
|
$('#gramajeSobrecubierta option[value=' + valSobrecubierta + ']').prop('selected', true).trigger('change');
|
||||||
else
|
else
|
||||||
$('#gramajeSobrecubierta').val('').trigger('change');
|
$('#gramajeSobrecubierta').val('').trigger('change');
|
||||||
}
|
}
|
||||||
@ -377,6 +377,14 @@ function checkValues() {
|
|||||||
const papelFormatoAncho = $('#anchoLibro').val();
|
const papelFormatoAncho = $('#anchoLibro').val();
|
||||||
const clienteId = $('#clienteId').val();
|
const clienteId = $('#clienteId').val();
|
||||||
|
|
||||||
|
if (paginas == '' || isNaN(paginas) || parseInt(paginas) <= 0) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if(parseInt(paginas)%2!=0){
|
||||||
|
$('#paginas').val(parseInt(paginas)+1).trigger('change');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if(clienteId == '' || isNaN(clienteId) || parseInt(clienteId) <= 0){
|
if(clienteId == '' || isNaN(clienteId) || parseInt(clienteId) <= 0){
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -385,10 +393,6 @@ function checkValues() {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (paginas == '' || isNaN(paginas) || parseInt(paginas) <= 0) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (papelInterior == '' || gramajeInterior == '') {
|
if (papelInterior == '' || gramajeInterior == '') {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -598,7 +602,7 @@ async function calcularPresupuesto() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$('#errorTiradas').hide();
|
$('#errorTiradas').hide();
|
||||||
|
|
||||||
// se obtiene la propiedad serv_id de los checkboxes seleccionados de la clase .servicio-extra
|
// se obtiene la propiedad serv_id de los checkboxes seleccionados de la clase .servicio-extra
|
||||||
if (!checkValues()) {
|
if (!checkValues()) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
9122
xdebug.log
9122
xdebug.log
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user