mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
falta las lineas de sobrecubierta
This commit is contained in:
@ -18,7 +18,7 @@ class Test extends BaseController
|
||||
public function index()
|
||||
{
|
||||
echo '<pre>';
|
||||
($this->getPapelesSobrecubierta());
|
||||
($this->testLineasSobrecubierta());
|
||||
echo '</pre>';
|
||||
/*
|
||||
|
||||
@ -521,6 +521,99 @@ class Test extends BaseController
|
||||
echo '</pre>';
|
||||
|
||||
|
||||
}
|
||||
|
||||
public static function testLineasSobrecubierta()
|
||||
{
|
||||
$uso = 'sobrecubierta';
|
||||
$tipo = 'colorhq';
|
||||
|
||||
$datosPedido = (object)array(
|
||||
'paginas' => 240,
|
||||
'tirada' => 100,
|
||||
'merma' => 10,
|
||||
'merma_portada' => 10,
|
||||
'ancho' => 150,
|
||||
'alto' => 210,
|
||||
'isCosido' => true,
|
||||
'solapas' => false,
|
||||
);
|
||||
|
||||
$opciones_papel = array(
|
||||
'sobrecubierta' => 1,
|
||||
'rotativa' => 0,
|
||||
);
|
||||
|
||||
|
||||
// Se obtienen los papeles disponibles
|
||||
$papelimpresionmodel = new \App\Models\Configuracion\PapelImpresionModel();
|
||||
$papeles = $papelimpresionmodel->getIdPapelesImpresionForPresupuesto(
|
||||
papel_generico_id: 1, // Blanco offset
|
||||
gramaje: 200,
|
||||
options: $opciones_papel
|
||||
);
|
||||
|
||||
echo '<pre>';
|
||||
var_dump($papeles);
|
||||
echo '</pre>';
|
||||
|
||||
$lineas = array();
|
||||
// Para cada papel, se obtienen las maquinas disponibles
|
||||
foreach ($papeles as $papel) {
|
||||
|
||||
$maquinamodel = new \App\Models\Configuracion\MaquinaModel();
|
||||
$maquinas = $maquinamodel->getMaquinaImpresionForPresupuesto(
|
||||
is_rotativa: 0,
|
||||
tarifa_tipo: $tipo,
|
||||
uso_tarifa: 'sobrecubierta',
|
||||
tirada: $datosPedido->tirada + $datosPedido->merma,
|
||||
papel_impresion_id: $papel->id,
|
||||
);
|
||||
|
||||
echo '<pre>';
|
||||
echo '-------------------------------';
|
||||
echo '</pre>';
|
||||
|
||||
echo '<pre>';
|
||||
var_dump($maquinas);
|
||||
echo '</pre>';
|
||||
|
||||
// Se recorren las máquinas y se calcula el coste de linea por cada una
|
||||
foreach ($maquinas as $maquina) {
|
||||
|
||||
echo '<pre>';
|
||||
echo '$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$';
|
||||
echo '</pre>';
|
||||
|
||||
$tarifamodel = new \App\Models\Configuracion\MaquinasTarifasImpresionModel();
|
||||
$tarifa = $tarifamodel->getTarifa($maquina->maquina_id, $uso, $tipo);
|
||||
|
||||
echo '<pre>';
|
||||
var_dump($tarifa);
|
||||
echo '</pre>';
|
||||
|
||||
if(!is_float($tarifa)){
|
||||
continue;
|
||||
}
|
||||
$linea = PresupuestoService::getCostesLinea($uso, $datosPedido, $maquina, $papel, $opciones_papel, $tarifa);
|
||||
$linea['fields']['maquina'] = $maquina->maquina;
|
||||
$linea['fields']['maquina_id'] = $maquina->maquina_id;
|
||||
$linea['fields']['papel_impresion'] = $papel->nombre;
|
||||
$linea['fields']['papel_impresion_id'] = $papel->id;
|
||||
$linea['fields']['paginas'] = $datosPedido->paginas;
|
||||
$linea['fields']['gramaje'] = 100;
|
||||
$linea['fields']['papel_generico_id'] = 3;
|
||||
$linea['fields']['papel_generico'] = 'Blanco offset';
|
||||
|
||||
array_push($lineas, $linea);
|
||||
}
|
||||
}
|
||||
|
||||
echo '<pre>';
|
||||
var_dump($lineas);
|
||||
echo '</pre>';
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user