arreglado bug de tamanio personalizado y presupuesto solo a color

This commit is contained in:
2024-05-23 16:32:25 +02:00
parent ef2649c3fd
commit 84e1bc8d27
3 changed files with 3758 additions and 11 deletions

View File

@ -20,8 +20,12 @@ class PresupuestoClienteService extends BaseService
$rotativa = PresupuestoClienteService::obtenerPresupuestoClienteInteriorRotativa($data); $rotativa = PresupuestoClienteService::obtenerPresupuestoClienteInteriorRotativa($data);
$total_plana = -1; $total_plana = -1;
$hay_plana = false;
if($data['isColor']){ if($data['isColor']){
if (count($plana[0]) > 2 && count($plana[1]) > 2) { if ($data['datosPedido']->paginas == $data['paginas_color'])
$total_plana += floatval($plana[1]['total_impresion']);
elseif(count($plana[0]) > 2 && count($plana[1]) > 2) {
$total_plana = 0.0; $total_plana = 0.0;
foreach ($plana as $linea) { foreach ($plana as $linea) {
if (count($linea) > 0) if (count($linea) > 0)
@ -238,7 +242,7 @@ class PresupuestoClienteService extends BaseService
$gramaje = $data['gramaje']; $gramaje = $data['gramaje'];
$isColor = $data['isColor']; $isColor = $data['isColor'];
$isHq = $data['isHq']; $isHq = $data['isHq'];
$cliente_id = $data['cliente_id']; $cliente_id = $data['cliente_id'];
$paginas_color = $data['paginas_color']; $paginas_color = $data['paginas_color'];
$paginas_negro = $datosPedido->paginas - $paginas_color; $paginas_negro = $datosPedido->paginas - $paginas_color;

View File

@ -3,7 +3,7 @@ $('#papelFormatoPersonalizado').on('change', function () {
$('#tamanioLibroDiv').hide(); $('#tamanioLibroDiv').hide();
$('#anchoLibroDiv').show(); $('#anchoLibroDiv').show();
$('#altoLibroDiv').show(); $('#altoLibroDiv').show();
$('#papelFormatoId').val(''); $('#papelFormatoId').val('').trigger('change');
} else { } else {
$('#tamanioLibroDiv').show(); $('#tamanioLibroDiv').show();
$('#anchoLibroDiv').hide(); $('#anchoLibroDiv').hide();
@ -386,8 +386,8 @@ function checkValues() {
const gramajeInterior = $('#gramajeInterior option:selected').text(); const gramajeInterior = $('#gramajeInterior option:selected').text();
const papelCubierta = $('#papelCubierta option:selected').val(); const papelCubierta = $('#papelCubierta option:selected').val();
const gramajeCubierta = $('#gramajeCubierta option:selected').text(); const gramajeCubierta = $('#gramajeCubierta option:selected').text();
const papelFormatoAlto = $('#altoLibro').val(); const papelFormatoAlto = $('#papelFormatoAlto').val();
const papelFormatoAncho = $('#anchoLibro').val(); const papelFormatoAncho = $('#papelFormatoAncho').val();
const clienteId = $('#clienteId').val(); const clienteId = $('#clienteId').val();
if (paginas == '' || isNaN(paginas) || parseInt(paginas) <= 0) { if (paginas == '' || isNaN(paginas) || parseInt(paginas) <= 0) {
@ -409,16 +409,18 @@ function checkValues() {
if (papelInterior == '' || gramajeInterior == '') { if (papelInterior == '' || gramajeInterior == '') {
return false; return false;
} }
if (papelCubierta == '' || gramajeCubierta == '') { if (papelCubierta == '' || gramajeCubierta == '') {
return false; return false;
} }
if ($('#papelFormatoId').val() == '' || if ($('#papelFormatoId').val() == null && !$('#papelFormatoPersonalizado').is(':checked')){
($('#papelFormatoPersonalizado').is(':checked') &&
((papelFormatoAncho == '' || isNaN(papelFormatoAncho) || parseInt(papelFormatoAncho) <= 0) ||
(papelFormatoAlto == '' || isNaN(papelFormatoAlto) || parseInt(papelFormatoAlto) <= 0))
)) {
return false; return false;
}
if($('#papelFormatoPersonalizado').is(':checked')){
if(papelFormatoAncho == '' || parseInt(papelFormatoAncho) <= 0 ||
papelFormatoAlto == '' || parseInt(papelFormatoAlto) <= 0){
return false;
}
} }
return true; return true;

3741
xdebug.log

File diff suppressed because one or more lines are too long