mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
falta añadir guardas
This commit is contained in:
@ -94,6 +94,58 @@ class PresupuestoClienteService extends BaseService
|
||||
return $lineas_cubierta;
|
||||
}
|
||||
|
||||
public static function obtenerSobrecubierta($data)
|
||||
{
|
||||
|
||||
$uso = $data['uso'];
|
||||
$tipo_impresion_id = $data['tipo_impresion_id'];
|
||||
$datosPedido = $data['datosPedido'];
|
||||
$papel_generico = $data['papel_generico'];
|
||||
$gramaje = $data['gramaje'];
|
||||
$isColor = $data['isColor'];
|
||||
$isHq = $data['isHq'];
|
||||
$cliente_id = $data['cliente_id'];
|
||||
$paginas_color = $data['paginas_color'];
|
||||
|
||||
$lineas_sobrecubierta = [];
|
||||
|
||||
for ($i = 0; $i < 2; $i++) {
|
||||
|
||||
$lineas = PresupuestoService::obtenerComparadorPlana([
|
||||
'uso' => $uso,
|
||||
'tipo_impresion_id' => $tipo_impresion_id,
|
||||
'datosPedido' => $datosPedido,
|
||||
'papel_generico' => $papel_generico,
|
||||
'gramaje' => $gramaje,
|
||||
'isColor' => $isColor,
|
||||
'isHq' => $isHq,
|
||||
'cliente_id' => $cliente_id,
|
||||
'a_favor_fibra' => $i
|
||||
]);
|
||||
|
||||
if (count($lineas) > 0) {
|
||||
$lineas_sobrecubierta = array_merge($lineas_sobrecubierta, $lineas);
|
||||
}
|
||||
}
|
||||
if (count($lineas_sobrecubierta) > 0) {
|
||||
|
||||
usort(
|
||||
$lineas_sobrecubierta,
|
||||
function ($a, $b) {
|
||||
$result = 0;
|
||||
if (floatval($a['fields']['total_impresion']) > floatval($b['fields']['total_impresion']))
|
||||
$result = 1;
|
||||
else if (floatval($a['fields']['total_impresion']) < floatval($b['fields']['total_impresion']))
|
||||
$result = -1;
|
||||
return $result;
|
||||
}
|
||||
);
|
||||
$lineas_sobrecubierta = $lineas_sobrecubierta[0]['fields'];
|
||||
$lineas_sobrecubierta['tipo_linea'] = 'lp_sobrecubierta';
|
||||
}
|
||||
return $lineas_sobrecubierta;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Obtiene las lineas de plana en el presupuesto de cliente
|
||||
|
||||
Reference in New Issue
Block a user