mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
trabajando
This commit is contained in:
@ -33,13 +33,61 @@ class PapelService extends BaseService
|
||||
* @param object $data
|
||||
* @return array
|
||||
*/
|
||||
public function getTiposPalelGenerico($data){
|
||||
public function getTiposPalelGenerico($data)
|
||||
{
|
||||
|
||||
if(!isset($data) || empty($data)){
|
||||
if (!isset($data) || empty($data)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return $this->papelGenericoModel->where('tipo_papel_generico_id !=', null)->findAll();
|
||||
$tirada = (int)$data->tirada ?? null;
|
||||
$POD = null;
|
||||
if ($tirada != null) {
|
||||
$POD_value = model('App\Models\Configuracion\ConfigVariableModel')->getVariable('POD')->value;
|
||||
if (intval($tirada) <= intval($POD_value)) {
|
||||
$POD = true;
|
||||
} else {
|
||||
$POD = false;
|
||||
}
|
||||
}
|
||||
$tipo = $data->tipo;
|
||||
$cubierta = $data->cubierta ?? 0;
|
||||
$tapa_dura = $data->tapa_dura ?? null;
|
||||
$sobrecubierta = $data->sobrecubierta ?? 0;
|
||||
$guardas = $data->guardas ?? 0;
|
||||
|
||||
$ancho = $data->ancho ?? 0;
|
||||
$alto = $data->alto ?? 0;
|
||||
$solapas = $data->solapas ?? 0;
|
||||
$lomo = $data->lomo ?? 0;
|
||||
|
||||
$anchoLibro = $ancho;
|
||||
|
||||
if (intval($cubierta) == 1 || intval($sobrecubierta) == 1) {
|
||||
$anchoLibro = 2 * $ancho + 2 * $solapas + $lomo;
|
||||
}
|
||||
|
||||
$data_output = (object)
|
||||
[
|
||||
'tipo' => $tipo,
|
||||
'cubierta' => $cubierta,
|
||||
'tapa_dura' => $tapa_dura,
|
||||
'sobrecubierta' => $sobrecubierta,
|
||||
'guardas' => $guardas,
|
||||
'ancho' => $anchoLibro,
|
||||
'alto' => $alto,
|
||||
'solapas' => $solapas,
|
||||
'lomo' => $lomo,
|
||||
'anchoLibro' => $anchoLibro,
|
||||
'tirada' => $tirada,
|
||||
'POD' => $POD
|
||||
];
|
||||
|
||||
$list = $this->tipoPapelGenericoModel->getTiposPapelCliente($data_output);
|
||||
|
||||
return $list;
|
||||
|
||||
|
||||
/*
|
||||
$values = $this->papelGenericoModel->where('uso', $uso)->findAll();
|
||||
$tipoPapelGenericoList = [];
|
||||
|
||||
Reference in New Issue
Block a user