mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
trabajando en direcciones!
This commit is contained in:
@ -345,6 +345,53 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
||||
$lomo += floatval($linea['mano']);
|
||||
}
|
||||
}
|
||||
|
||||
//Guardas
|
||||
$guardas = $reqData['guardas'] ?? [];
|
||||
if ($guardas != "false" && $guardas != null) {
|
||||
$datos_guardas = [
|
||||
'papel' => $modelPapelGenerico->getIdFromCode($guardas['papel']),
|
||||
'gramaje' => intval($guardas['gramaje']),
|
||||
'caras' => intval($guardas['caras']),
|
||||
];
|
||||
} else
|
||||
$datos_guardas = false;
|
||||
$guardas = [];
|
||||
$peso_guardas = 0.0;
|
||||
$coste_guardas = 0.0;
|
||||
if ($datos_guardas != 0) {
|
||||
if (count($datos_guardas) != 0 && $datos_guardas) {
|
||||
|
||||
$guardas = $datos_guardas;
|
||||
$input_data['papel_generico'] = $datos_guardas['papel'] ?? 0;
|
||||
$input_data['gramaje'] = $datos_guardas['gramaje'] ?? 0;
|
||||
$input_data['datosPedido']->paginas = 8;
|
||||
$input_data['paginas_color'] = 8;
|
||||
$input_data['datosPedido']->paginas_impresion = $datos_guardas['caras'] ?? 0;
|
||||
$input_data['datosPedido']->solapas_ancho = 0;
|
||||
$input_data['datosPedido']->solapas = 0;
|
||||
$input_data['isColor'] = 1;
|
||||
$input_data['isHq'] = 1;
|
||||
$input_data['uso'] = 'guardas';
|
||||
|
||||
// Para el caso de Fresado y Cosido tapa dura, las guardas son un diptico
|
||||
// y hay que imprimirlas como "cosido" (dos hojas pegadas). En el caso de espiral
|
||||
// o wire-o tapa dura, las guardas se imprimen como hojas sueltas
|
||||
if ($tipo_impresion_id == 1 || $tipo_impresion_id == 3) {
|
||||
$input_data['datosPedido']->isCosido = true;
|
||||
} else if ($tipo_impresion_id == 5 || $tipo_impresion_id == 7) {
|
||||
$input_data['datosPedido']->isCosido = false;
|
||||
}
|
||||
|
||||
$guardas = PresupuestoClienteService::obtenerGuardas($input_data);
|
||||
|
||||
foreach ($guardas as $linea) {
|
||||
if (count($linea) > 0) {
|
||||
$lomo += floatval($linea['mano']);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$lomo = round($lomo, 2);
|
||||
$errors = [
|
||||
'status' => 0,
|
||||
@ -659,7 +706,21 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
||||
if ($interior == null) {
|
||||
return $this->failServerError('Error al calcular el interior');
|
||||
}
|
||||
$anchoTotal = $interior[0]['mano'];
|
||||
|
||||
$anchoTotal = 0;
|
||||
if(count($interior) == 2) {
|
||||
|
||||
if(count($interior[0]) > 0)
|
||||
$anchoTotal += $interior[0]['mano'];
|
||||
if(count($interior[1]) > 0)
|
||||
$anchoTotal += $interior[1]['mano'];
|
||||
}
|
||||
else{
|
||||
if(count($interior) > 0)
|
||||
$anchoTotal += $interior['mano'];
|
||||
}
|
||||
|
||||
|
||||
// le añadimos 2*ancho libro
|
||||
$anchoTotal += 2 * $datosPedido->ancho;
|
||||
// le añadimos los dobleces de las solapas
|
||||
|
||||
Reference in New Issue
Block a user