mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
linea de presupuesto bn funcionando a falta de borrar
This commit is contained in:
@ -747,20 +747,78 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
|
||||
$datos = $reqData['datos'] ?? null;
|
||||
//$searchStr = goSanitize($this->request->getPost('searchTerm'))[0];
|
||||
|
||||
$newTokenHash = csrf_hash();
|
||||
$csrfTokenName = csrf_token();
|
||||
|
||||
if ($tipo == 'gramaje') {
|
||||
// En este caso contiene el nombre del papel generico
|
||||
$model = new PapelGenericoModel();
|
||||
$menu = $model->getGramajeComparador($datos, $uso );
|
||||
|
||||
$data = [
|
||||
'menu' => $menu,
|
||||
$csrfTokenName => $newTokenHash
|
||||
];
|
||||
}
|
||||
elseif ($tipo == 'gramajeLineasPresupuesto') {
|
||||
$tipoLinea = $reqData['tipoLinea'] ?? null;
|
||||
// En este caso contiene el id del papel generico
|
||||
$model = new PapelGenericoModel();
|
||||
$menu = $model->getGramajeLineasPresupuesto($datos, $tipoLinea, $uso );
|
||||
|
||||
$data = [
|
||||
'menu' => $menu,
|
||||
$csrfTokenName => $newTokenHash
|
||||
];
|
||||
}
|
||||
elseif ($tipo == 'papelImpresion') {
|
||||
$gramaje = $reqData['gramaje'] ?? null;
|
||||
$tipoLinea = $reqData['tipoLinea'] ?? null;
|
||||
// En este caso contiene el nombre del papel generico
|
||||
// Uso: negro, negrohq, color, colorhq, rot_bn, rot_color,
|
||||
$model = new PapelImpresionModel();
|
||||
$menu = $model->getPapelesImpresionForMenu($datos, $gramaje, $tipoLinea, $uso );
|
||||
|
||||
$data = [
|
||||
'menu' => $menu,
|
||||
$csrfTokenName => $newTokenHash
|
||||
];
|
||||
}
|
||||
|
||||
elseif ($tipo == 'maquina') {
|
||||
$is_rotativa = $reqData['is_rotativa'] ?? null;
|
||||
$papel_impresion = $reqData['papel_impresion'] ?? null;
|
||||
$tipo_linea = $reqData['tipoLinea'] ?? null;
|
||||
$ancho = $reqData['ancho'] ?? null;
|
||||
$alto = $reqData['alto'] ?? null;
|
||||
// Datos contiene la tirada
|
||||
// uso: negro, negrohq, color, colorhq,
|
||||
$model = new MaquinaModel();
|
||||
$maquinas = $model->getMaquinaImpresionForPresupuesto($is_rotativa, $uso, $datos, $papel_impresion );
|
||||
$menu = [];
|
||||
foreach ($maquinas as $maquina){
|
||||
|
||||
$formas = PresupuestoService::getNumFormasPlana($tipo_linea, $maquina, floatval($ancho), floatval($alto), true);
|
||||
|
||||
if($formas['num_formas'] != 'n/a'){
|
||||
array_push($menu, $maquina);
|
||||
}
|
||||
}
|
||||
|
||||
$newTokenHash = csrf_hash();
|
||||
$csrfTokenName = csrf_token();
|
||||
$data = [
|
||||
'menu' => $menu,
|
||||
$csrfTokenName => $newTokenHash
|
||||
];
|
||||
$data = [
|
||||
'menu' => $menu,
|
||||
$csrfTokenName => $newTokenHash
|
||||
];
|
||||
}
|
||||
|
||||
else{
|
||||
|
||||
$data = [
|
||||
'tipo' => $tipo,
|
||||
$csrfTokenName => $newTokenHash
|
||||
];
|
||||
}
|
||||
|
||||
return $this->respond($data);
|
||||
} else {
|
||||
return $this->failUnauthorized('Invalid request', 403);
|
||||
@ -912,391 +970,4 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
|
||||
|
||||
|
||||
|
||||
/*
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
protected function getUbicacionLibroListItems($selId = null)
|
||||
{
|
||||
$data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('LgUbicacionesLibros.ubicacionLibro'))])];
|
||||
if (!empty($selId)) :
|
||||
$ubicacionesLibroModel = model('App\Models\Configuracion\UbicacionesLibroModel');
|
||||
|
||||
$selOption = $ubicacionesLibroModel->where('id', $selId)->findColumn('nombre');
|
||||
if (!empty($selOption)) :
|
||||
$data[$selId] = $selOption[0];
|
||||
endif;
|
||||
endif;
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
protected function getFormaPagoListItems()
|
||||
{
|
||||
$formasPagoModel = model('App\Models\Configuracion\FormasPagoModel');
|
||||
$onlyActiveOnes = true;
|
||||
$data = $formasPagoModel->getAllForMenu('id, nombre', 'nombre', $onlyActiveOnes);
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
protected function getPapelImpresionListItems4($selId = null)
|
||||
{
|
||||
$data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('PapelImpresions.papelImpresion'))])];
|
||||
if (!empty($selId)) :
|
||||
$papelImpresionModel = model('App\Models\Presupuestos\PapelImpresionModel');
|
||||
|
||||
$selOption = $papelImpresionModel->where('id', $selId)->findColumn('nombre');
|
||||
if (!empty($selOption)) :
|
||||
$data[$selId] = $selOption[0];
|
||||
endif;
|
||||
endif;
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
protected function getPresupuestoEstadoListItems($selId = null)
|
||||
{
|
||||
$data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('PresupuestoEstados.presupuestoEstado'))])];
|
||||
if (!empty($selId)) :
|
||||
$presupuestoEstadoModel = model('App\Models\Presupuestos\PresupuestoEstadoModel');
|
||||
|
||||
$selOption = $presupuestoEstadoModel->where('id', $selId)->findColumn('estado');
|
||||
if (!empty($selOption)) :
|
||||
$data[$selId] = $selOption[0];
|
||||
endif;
|
||||
endif;
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
protected function getPapelGenericoListItems3($selId = null)
|
||||
{
|
||||
$data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('PapelGenericoes.papelGenerico'))])];
|
||||
if (!empty($selId)) :
|
||||
$papelGenericoModel = model('App\Models\Presupuestos\PapelGenericoModel');
|
||||
|
||||
$selOption = $papelGenericoModel->where('id', $selId)->findColumn('nombre');
|
||||
if (!empty($selOption)) :
|
||||
$data[$selId] = $selOption[0];
|
||||
endif;
|
||||
endif;
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
protected function getPapelImpresionListItems2($selId = null)
|
||||
{
|
||||
$data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('PapelImpresions.papelImpresion'))])];
|
||||
if (!empty($selId)) :
|
||||
$papelImpresionModel = model('App\Models\Presupuestos\PapelImpresionModel');
|
||||
|
||||
$selOption = $papelImpresionModel->where('id', $selId)->findColumn('nombre');
|
||||
if (!empty($selOption)) :
|
||||
$data[$selId] = $selOption[0];
|
||||
endif;
|
||||
endif;
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
protected function getMaquinaListItems3($selId = null)
|
||||
{
|
||||
$data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Maquinas.maquina'))])];
|
||||
if (!empty($selId)) :
|
||||
$maquinaModel = model('App\Models\Presupuestos\MaquinaModel');
|
||||
|
||||
$selOption = $maquinaModel->where('id', $selId)->findColumn('nombre');
|
||||
if (!empty($selOption)) :
|
||||
$data[$selId] = $selOption[0];
|
||||
endif;
|
||||
endif;
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
protected function getMaquinasTarifasImpresionListItems2($selId = null)
|
||||
{
|
||||
$data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('MaquinasTarifasImpresions.maquinasTarifasImpresion'))])];
|
||||
if (!empty($selId)) :
|
||||
$maquinasTarifasImpresionModel = model('App\Models\Presupuestos\MaquinasTarifasImpresionModel');
|
||||
|
||||
$selOption = $maquinasTarifasImpresionModel->where('id', $selId)->findColumn('precio');
|
||||
if (!empty($selOption)) :
|
||||
$data[$selId] = $selOption[0];
|
||||
endif;
|
||||
endif;
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
protected function getPapelGenericoListItems2($selId = null)
|
||||
{
|
||||
$data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('PapelGenericoes.papelGenerico'))])];
|
||||
if (!empty($selId)) :
|
||||
$papelGenericoModel = model('App\Models\Presupuestos\PapelGenericoModel');
|
||||
|
||||
$selOption = $papelGenericoModel->where('id', $selId)->findColumn('nombre');
|
||||
if (!empty($selOption)) :
|
||||
$data[$selId] = $selOption[0];
|
||||
endif;
|
||||
endif;
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
protected function getMaquinaListItems($selId = null)
|
||||
{
|
||||
$data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Maquinas.maquina'))])];
|
||||
if (!empty($selId)) :
|
||||
$maquinaModel = model('App\Models\Presupuestos\MaquinaModel');
|
||||
|
||||
$selOption = $maquinaModel->where('id', $selId)->findColumn('nombre');
|
||||
if (!empty($selOption)) :
|
||||
$data[$selId] = $selOption[0];
|
||||
endif;
|
||||
endif;
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
protected function getMaquinaListItems2($selId = null)
|
||||
{
|
||||
$data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Maquinas.maquina'))])];
|
||||
if (!empty($selId)) :
|
||||
$maquinaModel = model('App\Models\Presupuestos\MaquinaModel');
|
||||
|
||||
$selOption = $maquinaModel->where('id', $selId)->findColumn('nombre');
|
||||
if (!empty($selOption)) :
|
||||
$data[$selId] = $selOption[0];
|
||||
endif;
|
||||
endif;
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
protected function getTipologiasLibroListItems($selId = null)
|
||||
{
|
||||
$data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('TipologiasLibros.tipologiasLibro'))])];
|
||||
if (!empty($selId)) :
|
||||
$tipologiasLibroModel = model('App\Models\Presupuestos\TipologiasLibroModel');
|
||||
|
||||
$selOption = $tipologiasLibroModel->where('id', $selId)->findColumn('nombre');
|
||||
if (!empty($selOption)) :
|
||||
$data[$selId] = $selOption[0];
|
||||
endif;
|
||||
endif;
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
protected function getPapelImpresionListItems3($selId = null)
|
||||
{
|
||||
$data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('PapelImpresions.papelImpresion'))])];
|
||||
if (!empty($selId)) :
|
||||
$papelImpresionModel = model('App\Models\Presupuestos\PapelImpresionModel');
|
||||
|
||||
$selOption = $papelImpresionModel->where('id', $selId)->findColumn('nombre');
|
||||
if (!empty($selOption)) :
|
||||
$data[$selId] = $selOption[0];
|
||||
endif;
|
||||
endif;
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
protected function getMaquinasTarifasImpresionListItems4($selId = null)
|
||||
{
|
||||
$data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('MaquinasTarifasImpresions.maquinasTarifasImpresion'))])];
|
||||
if (!empty($selId)) :
|
||||
$maquinasTarifasImpresionModel = model('App\Models\Presupuestos\MaquinasTarifasImpresionModel');
|
||||
|
||||
$selOption = $maquinasTarifasImpresionModel->where('id', $selId)->findColumn('precio');
|
||||
if (!empty($selOption)) :
|
||||
$data[$selId] = $selOption[0];
|
||||
endif;
|
||||
endif;
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
protected function getUserListItems($selId = null)
|
||||
{
|
||||
$data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Users.user'))])];
|
||||
if (!empty($selId)) :
|
||||
$userModel = model('App\Models\Presupuestos\UserModel');
|
||||
|
||||
$selOption = $userModel->where('id_user', $selId)->findColumn('first_name');
|
||||
if (!empty($selOption)) :
|
||||
$data[$selId] = $selOption[0];
|
||||
endif;
|
||||
endif;
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
protected function getMaquinasTarifasImpresionListItems3($selId = null)
|
||||
{
|
||||
$data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('MaquinasTarifasImpresions.maquinasTarifasImpresion'))])];
|
||||
if (!empty($selId)) :
|
||||
$maquinasTarifasImpresionModel = model('App\Models\Presupuestos\MaquinasTarifasImpresionModel');
|
||||
|
||||
$selOption = $maquinasTarifasImpresionModel->where('id', $selId)->findColumn('id');
|
||||
if (!empty($selOption)) :
|
||||
$data[$selId] = $selOption[0];
|
||||
endif;
|
||||
endif;
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
protected function getUserListItems3($selId = null)
|
||||
{
|
||||
$data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Users.user'))])];
|
||||
if (!empty($selId)) :
|
||||
$userModel = model('App\Models\Presupuestos\UserModel');
|
||||
|
||||
$selOption = $userModel->where('id_user', $selId)->findColumn('first_name');
|
||||
if (!empty($selOption)) :
|
||||
$data[$selId] = $selOption[0];
|
||||
endif;
|
||||
endif;
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
protected function getPapelImpresionListItems($selId = null)
|
||||
{
|
||||
$data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('PapelImpresions.papelImpresion'))])];
|
||||
if (!empty($selId)) :
|
||||
$papelImpresionModel = model('App\Models\Presupuestos\PapelImpresionModel');
|
||||
|
||||
$selOption = $papelImpresionModel->where('id', $selId)->findColumn('nombre');
|
||||
if (!empty($selOption)) :
|
||||
$data[$selId] = $selOption[0];
|
||||
endif;
|
||||
endif;
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
protected function getTiposImpresionListItems($selId = null)
|
||||
{
|
||||
$data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('TiposImpresions.tiposImpresion'))])];
|
||||
if (!empty($selId)) :
|
||||
$tiposImpresionModel = model('App\Models\Presupuestos\TiposImpresionModel');
|
||||
|
||||
$selOption = $tiposImpresionModel->where('id', $selId)->findColumn('nombre');
|
||||
if (!empty($selOption)) :
|
||||
$data[$selId] = $selOption[0];
|
||||
endif;
|
||||
endif;
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
protected function getMaquinasTarifasImpresionListItems($selId = null)
|
||||
{
|
||||
$data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('MaquinasTarifasImpresions.maquinasTarifasImpresion'))])];
|
||||
if (!empty($selId)) :
|
||||
$maquinasTarifasImpresionModel = model('App\Models\Presupuestos\MaquinasTarifasImpresionModel');
|
||||
|
||||
$selOption = $maquinasTarifasImpresionModel->where('id', $selId)->findColumn('precio');
|
||||
if (!empty($selOption)) :
|
||||
$data[$selId] = $selOption[0];
|
||||
endif;
|
||||
endif;
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
protected function getPapelGenericoListItems4($selId = null)
|
||||
{
|
||||
$data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('PapelGenericoes.papelGenerico'))])];
|
||||
if (!empty($selId)) :
|
||||
$papelGenericoModel = model('App\Models\Presupuestos\PapelGenericoModel');
|
||||
|
||||
$selOption = $papelGenericoModel->where('id', $selId)->findColumn('nombre');
|
||||
if (!empty($selOption)) :
|
||||
$data[$selId] = $selOption[0];
|
||||
endif;
|
||||
endif;
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
|
||||
protected function getMaquinaListItems4($selId = null)
|
||||
{
|
||||
$data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Maquinas.maquina'))])];
|
||||
if (!empty($selId)) :
|
||||
$maquinaModel = model('App\Models\Presupuestos\MaquinaModel');
|
||||
|
||||
$selOption = $maquinaModel->where('id', $selId)->findColumn('nombre');
|
||||
if (!empty($selOption)) :
|
||||
$data[$selId] = $selOption[0];
|
||||
endif;
|
||||
endif;
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
protected function getUserListItems2($selId = null)
|
||||
{
|
||||
$data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Users.user'))])];
|
||||
if (!empty($selId)) :
|
||||
$userModel = model('App\Models\Presupuestos\UserModel');
|
||||
|
||||
$selOption = $userModel->where('id_user', $selId)->findColumn('first_name');
|
||||
if (!empty($selOption)) :
|
||||
$data[$selId] = $selOption[0];
|
||||
endif;
|
||||
endif;
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
protected function getPapelGenericoListItems($selId = null)
|
||||
{
|
||||
$data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('PapelGenericoes.papelGenerico'))])];
|
||||
if (!empty($selId)) :
|
||||
$papelGenericoModel = model('App\Models\Presupuestos\PapelGenericoModel');
|
||||
|
||||
$selOption = $papelGenericoModel->where('id', $selId)->findColumn('nombre');
|
||||
if (!empty($selOption)) :
|
||||
$data[$selId] = $selOption[0];
|
||||
endif;
|
||||
endif;
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
protected function getPaginasCubiertaOptions()
|
||||
{
|
||||
$paginasCubiertaOptions = [
|
||||
'' => lang('Basic.global.pleaseSelect'),
|
||||
'4x0' => '4x0',
|
||||
'4x4' => '4x4',
|
||||
];
|
||||
return $paginasCubiertaOptions;
|
||||
}
|
||||
|
||||
|
||||
|
||||
protected function getPaginasPortadaOptions()
|
||||
{
|
||||
$paginasPortadaOptions = [
|
||||
'' => lang('Basic.global.pleaseSelect'),
|
||||
'4x0' => '4x0',
|
||||
'4x4' => '4x4',
|
||||
];
|
||||
return $paginasPortadaOptions;
|
||||
}
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user