mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
trabajando en el edit
This commit is contained in:
@ -312,11 +312,16 @@ class Cliente extends \App\Controllers\GoBaseResourceController
|
|||||||
$onlyActiveOnes = false;
|
$onlyActiveOnes = false;
|
||||||
$columns2select = [$reqId ?? 'id', $reqText ?? 'nombre'];
|
$columns2select = [$reqId ?? 'id', $reqText ?? 'nombre'];
|
||||||
$onlyActiveOnes = false;
|
$onlyActiveOnes = false;
|
||||||
$menu = $this->model->getSelect2MenuItems($columns2select, $columns2select[1], $onlyActiveOnes, $searchStr);
|
try{
|
||||||
$nonItem = new \stdClass;
|
$menu = $this->model->getSelect2MenuItems($columns2select, $columns2select[1], $onlyActiveOnes, $searchStr);
|
||||||
$nonItem->id = '';
|
$nonItem = new \stdClass;
|
||||||
$nonItem->text = '- ' . lang('Basic.global.None') . ' -';
|
$nonItem->id = '';
|
||||||
array_unshift($menu, $nonItem);
|
$nonItem->text = '- ' . lang('Basic.global.None') . ' -';
|
||||||
|
array_unshift($menu, $nonItem);
|
||||||
|
}
|
||||||
|
catch(Exception $e){
|
||||||
|
$menu = [];
|
||||||
|
}
|
||||||
|
|
||||||
$newTokenHash = csrf_hash();
|
$newTokenHash = csrf_hash();
|
||||||
$csrfTokenName = csrf_token();
|
$csrfTokenName = csrf_token();
|
||||||
|
|||||||
@ -255,18 +255,28 @@ abstract class GoBaseResourceController extends \CodeIgniter\RESTful\ResourceCon
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Convenience method to validate form submission
|
* Convenience method to validate form submission
|
||||||
|
* JJO: Se le añade las reglas y los mensajes custom
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
protected function canValidate()
|
protected function canValidate($customValidationRules = null, $customValidationMessages = null)
|
||||||
{
|
{
|
||||||
|
|
||||||
$validationRules = $this->model->validationRules ?? $this->formValidationRules ?? null;
|
if($customValidationRules == null){
|
||||||
|
$validationRules = $this->model->validationRules ?? $this->formValidationRules ?? null;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$validationRules = $customValidationRules;
|
||||||
|
}
|
||||||
if ($validationRules == null) {
|
if ($validationRules == null) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
$validationErrorMessages = $this->model->validationMessages ?? $this->formValidationErrorMessagess ?? null;;
|
if($customValidationMessages == null){
|
||||||
|
$validationErrorMessages = $this->model->validationMessages ?? $this->formValidationErrorMessagess ?? null;;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$validationErrorMessages = $customValidationMessages;
|
||||||
|
}
|
||||||
|
|
||||||
if ($validationErrorMessages != null) {
|
if ($validationErrorMessages != null) {
|
||||||
$valid = $this->validate($validationRules, $validationErrorMessages);
|
$valid = $this->validate($validationRules, $validationErrorMessages);
|
||||||
|
|||||||
@ -96,10 +96,9 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
|
|||||||
$sanitizedData['user_created_id'] = $session->id_user;
|
$sanitizedData['user_created_id'] = $session->id_user;
|
||||||
|
|
||||||
$noException = true;
|
$noException = true;
|
||||||
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
|
if ($successfulResult = $this->canValidate($this->model->validationRulesAdd, $this->model->validationMessagesAdd)) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
|
||||||
|
|
||||||
|
if ($this->canValidate($this->model->validationRulesAdd, $this->model->validationMessagesAdd)) :
|
||||||
if ($this->canValidate()) :
|
|
||||||
try {
|
try {
|
||||||
$successfulResult = $this->model->skipValidation(true)->save($sanitizedData);
|
$successfulResult = $this->model->skipValidation(true)->save($sanitizedData);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
@ -153,14 +152,13 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
|
|||||||
$this->viewData['serviciosEncuadernacion'] = $this->getServiciosEncuadernacion();
|
$this->viewData['serviciosEncuadernacion'] = $this->getServiciosEncuadernacion();
|
||||||
$this->viewData['serviciosAcabado'] = $this->getServiciosAcabado();
|
$this->viewData['serviciosAcabado'] = $this->getServiciosAcabado();
|
||||||
$this->viewData['serviciosManipulado'] = $this->getServiciosManipulado();
|
$this->viewData['serviciosManipulado'] = $this->getServiciosManipulado();
|
||||||
|
|
||||||
|
$this->viewData['tipo_impresion_id'] = 4; // Cosido tapa blanda JJO
|
||||||
|
|
||||||
$this->viewData['formAction'] = route_to('createCosidotapablanda');
|
$this->viewData['formAction'] = route_to('createCosidotapablanda');
|
||||||
|
|
||||||
$this->viewData['boxTitle'] = lang('Basic.global.addNew') . ' ' . lang('Presupuestos.moduleTitleCosidoTB') . ' ' . lang('Basic.global.addNewSuffix');
|
$this->viewData['boxTitle'] = lang('Basic.global.addNew') . ' ' . lang('Presupuestos.moduleTitleCosidoTB') . ' ' . lang('Basic.global.addNewSuffix');
|
||||||
|
|
||||||
/* TEST JS LOADER */
|
|
||||||
//$this->viewData['global_js_variables'] = array('jsVarTest' => "'Hola Jaime'");
|
|
||||||
|
|
||||||
return $this->displayForm(__METHOD__);
|
return $this->displayForm(__METHOD__);
|
||||||
} // end function add()
|
} // end function add()
|
||||||
|
|
||||||
@ -312,19 +310,19 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
|
|||||||
|
|
||||||
$this->viewData['presupuestoEntity'] = $presupuestoEntity;
|
$this->viewData['presupuestoEntity'] = $presupuestoEntity;
|
||||||
$this->viewData['clienteList'] = $this->getClienteListItems($presupuestoEntity->cliente_id ?? null);
|
$this->viewData['clienteList'] = $this->getClienteListItems($presupuestoEntity->cliente_id ?? null);
|
||||||
$this->viewData['formaPagoList'] = $this->getFormaPagoListItems();
|
//$this->viewData['formaPagoList'] = $this->getFormaPagoListItems();
|
||||||
$this->viewData['tiposImpresionList'] = $this->getTiposImpresionListItems($presupuestoEntity->tipo_impresion_id ?? null);
|
//$this->viewData['tiposImpresionList'] = $this->getTiposImpresionListItems($presupuestoEntity->tipo_impresion_id ?? null);
|
||||||
$this->viewData['tipologiasLibroList'] = $this->getTipologiasLibroListItems($presupuestoEntity->tipologia_id ?? null);
|
//$this->viewData['tipologiasLibroList'] = $this->getTipologiasLibroListItems($presupuestoEntity->tipologia_id ?? null);
|
||||||
$this->viewData['paisList'] = $this->getPaisListItems();
|
$this->viewData['paisList'] = $this->getPaisListItems();
|
||||||
$this->viewData['ubicacionLibroList'] = $this->getUbicacionLibroListItems($presupuestoEntity->ubicacion_id ?? null);
|
//$this->viewData['ubicacionLibroList'] = $this->getUbicacionLibroListItems($presupuestoEntity->ubicacion_id ?? null);
|
||||||
$this->viewData['presupuestoEstadoList'] = $this->getPresupuestoEstadoListItems($presupuestoEntity->estado_id ?? null);
|
//$this->viewData['presupuestoEstadoList'] = $this->getPresupuestoEstadoListItems($presupuestoEntity->estado_id ?? null);
|
||||||
$this->viewData['papelFormatoList'] = $this->getPapelFormatoListItems($presupuestoEntity->papel_formato_id ?? null);
|
//$this->viewData['papelFormatoList'] = $this->getPapelFormatoListItems($presupuestoEntity->papel_formato_id ?? null);
|
||||||
$this->viewData['papelGenericoList'] = $this->getPapelGenericoListItems($presupuestoEntity->paginas_negro_papel_id ?? null);
|
//$this->viewData['papelGenericoList'] = $this->getPapelGenericoListItems($presupuestoEntity->paginas_negro_papel_id ?? null);
|
||||||
$this->viewData['papelImpresionList'] = $this->getPapelImpresionListItems($presupuestoEntity->paginas_negro_papel_impresion_id ?? null);
|
//$this->viewData['papelImpresionList'] = $this->getPapelImpresionListItems($presupuestoEntity->paginas_negro_papel_impresion_id ?? null);
|
||||||
$this->viewData['maquinaList'] = $this->getMaquinaListItems($presupuestoEntity->paginas_negro_maquina_id ?? null);
|
//$this->viewData['maquinaList'] = $this->getMaquinaListItems($presupuestoEntity->paginas_negro_maquina_id ?? null);
|
||||||
$this->viewData['maquinasTarifasImpresionList'] = $this->getMaquinasTarifasImpresionListItems($presupuestoEntity->paginas_negro_tarifa_impresion_id ?? null);
|
//$this->viewData['maquinasTarifasImpresionList'] = $this->getMaquinasTarifasImpresionListItems($presupuestoEntity->paginas_negro_tarifa_impresion_id ?? null);
|
||||||
$this->viewData['papelGenericoList2'] = $this->getPapelGenericoListItems2($presupuestoEntity->paginas_color_papel_id ?? null);
|
//$this->viewData['papelGenericoList2'] = $this->getPapelGenericoListItems2($presupuestoEntity->paginas_color_papel_id ?? null);
|
||||||
$this->viewData['papelImpresionList2'] = $this->getPapelImpresionListItems2($presupuestoEntity->paginas_color_papel_impresion_id ?? null);
|
/*$this->viewData['papelImpresionList2'] = $this->getPapelImpresionListItems2($presupuestoEntity->paginas_color_papel_impresion_id ?? null);
|
||||||
$this->viewData['maquinaList2'] = $this->getMaquinaListItems2($presupuestoEntity->paginas_color_maquina_id ?? null);
|
$this->viewData['maquinaList2'] = $this->getMaquinaListItems2($presupuestoEntity->paginas_color_maquina_id ?? null);
|
||||||
$this->viewData['maquinasTarifasImpresionList2'] = $this->getMaquinasTarifasImpresionListItems2($presupuestoEntity->paginas_color_tarifa_impresion_id ?? null);
|
$this->viewData['maquinasTarifasImpresionList2'] = $this->getMaquinasTarifasImpresionListItems2($presupuestoEntity->paginas_color_tarifa_impresion_id ?? null);
|
||||||
$this->viewData['papelGenericoList3'] = $this->getPapelGenericoListItems3($presupuestoEntity->paginas_portada_papel_id ?? null);
|
$this->viewData['papelGenericoList3'] = $this->getPapelGenericoListItems3($presupuestoEntity->paginas_portada_papel_id ?? null);
|
||||||
@ -339,16 +337,31 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
|
|||||||
$this->viewData['userList2'] = $this->getUserListItems2($presupuestoEntity->aprobado_user_id ?? null);
|
$this->viewData['userList2'] = $this->getUserListItems2($presupuestoEntity->aprobado_user_id ?? null);
|
||||||
$this->viewData['userList3'] = $this->getUserListItems3($presupuestoEntity->pedido_espera_user_id ?? null);
|
$this->viewData['userList3'] = $this->getUserListItems3($presupuestoEntity->pedido_espera_user_id ?? null);
|
||||||
$this->viewData['paginasCubiertaList'] = $this->getPaginasCubiertaOptions();
|
$this->viewData['paginasCubiertaList'] = $this->getPaginasCubiertaOptions();
|
||||||
$this->viewData['paginasPortadaList'] = $this->getPaginasPortadaOptions();
|
$this->viewData['paginasPortadaList'] = $this->getPaginasPortadaOptions();*/
|
||||||
|
|
||||||
|
$this->viewData['clienteList'] = $this->getClienteListItems($presupuestoEntity->cliente_id ?? null);
|
||||||
|
$this->viewData['incReiList'] = array('incidencia' => lang('Presupuestos.incidencia'), 'reimpresion' => lang('Presupuestos.reimpresion'), 'sin_cargo' => lang('Presupuestos.sinCargo'));
|
||||||
|
$this->viewData['paisList'] = $this->getPaisListItems();
|
||||||
|
$this->viewData['papelFormatoList'] = $this->getPapelFormatoListItems($presupuestoEntity->papel_formato_id ?? null);
|
||||||
$this->viewData['papelGenericoNegroList'] = $this->getPapelGenericoNegro();
|
$this->viewData['papelGenericoNegroList'] = $this->getPapelGenericoNegro();
|
||||||
$this->viewData['papelGenericoNegroHQList'] = $this->getPapelGenericoNegroHQ();
|
$this->viewData['papelGenericoNegroHQList'] = $this->getPapelGenericoNegroHQ();
|
||||||
$this->viewData['papelGenericoColorList'] = $this->getPapelGenericoColor();
|
$this->viewData['papelGenericoColorList'] = $this->getPapelGenericoColor();
|
||||||
$this->viewData['papelGenericoColorHQList'] = $this->getPapelGenericoColorHQ();
|
$this->viewData['papelGenericoColorHQList'] = $this->getPapelGenericoColorHQ();
|
||||||
$this->viewData['papelGenericoCubiertaList'] = $this->getPapelGenericoCubierta();
|
$this->viewData['papelGenericoCubiertaList'] = $this->getPapelGenericoCubierta();
|
||||||
$this->viewData['papelGenericoSobrecubiertaList'] = $this->getPapelGenericoSobreCubierta();
|
$this->viewData['papelGenericoSobrecubiertaList'] = $this->getPapelGenericoSobreCubierta();
|
||||||
|
$this->viewData['papelGenericoRotativaNegroList'] = $this->getPapelGenericoRotativaNegro();
|
||||||
|
$this->viewData['papelGenericoRotativaColorList'] = $this->getPapelGenericoRotativaColor();
|
||||||
|
|
||||||
$this->viewData['formAction'] = route_to('updatePresupuesto', $id);
|
// Tarifas
|
||||||
|
$this->viewData['serviciosPreimpresion'] = $this->getServiciosPreimpresion();
|
||||||
|
$this->viewData['serviciosEncuadernacion'] = $this->getServiciosEncuadernacion();
|
||||||
|
$this->viewData['serviciosAcabado'] = $this->getServiciosAcabado();
|
||||||
|
$this->viewData['serviciosManipulado'] = $this->getServiciosManipulado();
|
||||||
|
|
||||||
|
|
||||||
|
$this->viewData['tipo_impresion_id'] = 4; // Cosido tapa blanda JJO
|
||||||
|
|
||||||
|
$this->viewData['formAction'] = route_to('updateCosidotapablanda', $id);
|
||||||
|
|
||||||
$this->viewData['boxTitle'] = lang('Basic.global.edit2') . ' ' . lang('Presupuestos.moduleTitle') . ' ' . lang('Basic.global.edit3');
|
$this->viewData['boxTitle'] = lang('Basic.global.edit2') . ' ' . lang('Presupuestos.moduleTitle') . ' ' . lang('Basic.global.edit3');
|
||||||
|
|
||||||
@ -767,86 +780,96 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
|
|||||||
if ($this->request->isAJAX()) {
|
if ($this->request->isAJAX()) {
|
||||||
|
|
||||||
$reqData = $this->request->getPost();
|
$reqData = $this->request->getPost();
|
||||||
|
try{
|
||||||
|
|
||||||
$tipo = $reqData['tipo'] ?? null;
|
$tipo = $reqData['tipo'] ?? null;
|
||||||
$uso = $reqData['uso'] ?? null;
|
$uso = $reqData['uso'] ?? null;
|
||||||
$datos = $reqData['datos'] ?? null;
|
$datos = $reqData['datos'] ?? null;
|
||||||
//$searchStr = goSanitize($this->request->getPost('searchTerm'))[0];
|
//$searchStr = goSanitize($this->request->getPost('searchTerm'))[0];
|
||||||
|
|
||||||
$newTokenHash = csrf_hash();
|
$newTokenHash = csrf_hash();
|
||||||
$csrfTokenName = csrf_token();
|
$csrfTokenName = csrf_token();
|
||||||
|
|
||||||
if ($tipo == 'gramaje') {
|
if ($tipo == 'gramaje') {
|
||||||
// En este caso contiene el nombre del papel generico
|
// En este caso contiene el nombre del papel generico
|
||||||
$model = new PapelGenericoModel();
|
$model = new PapelGenericoModel();
|
||||||
$menu = $model->getGramajeComparador($datos, $uso );
|
$menu = $model->getGramajeComparador($datos, $uso );
|
||||||
|
|
||||||
$data = [
|
$data = [
|
||||||
'menu' => $menu,
|
'menu' => $menu,
|
||||||
$csrfTokenName => $newTokenHash
|
$csrfTokenName => $newTokenHash
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
elseif ($tipo == 'gramajeLineasPresupuesto') {
|
elseif ($tipo == 'gramajeLineasPresupuesto') {
|
||||||
$tipoLinea = $reqData['tipoLinea'] ?? null;
|
$tipoLinea = $reqData['tipoLinea'] ?? null;
|
||||||
// En este caso contiene el id del papel generico
|
// En este caso contiene el id del papel generico
|
||||||
$model = new PapelGenericoModel();
|
$model = new PapelGenericoModel();
|
||||||
$menu = $model->getGramajeLineasPresupuesto($datos, $tipoLinea, $uso );
|
$menu = $model->getGramajeLineasPresupuesto($datos, $tipoLinea, $uso );
|
||||||
|
|
||||||
$data = [
|
$data = [
|
||||||
'menu' => $menu,
|
'menu' => $menu,
|
||||||
$csrfTokenName => $newTokenHash
|
$csrfTokenName => $newTokenHash
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
elseif ($tipo == 'papelImpresion') {
|
elseif ($tipo == 'papelImpresion') {
|
||||||
$gramaje = $reqData['gramaje'] ?? null;
|
$gramaje = $reqData['gramaje'] ?? null;
|
||||||
$tipoLinea = $reqData['tipoLinea'] ?? null;
|
$tipoLinea = $reqData['tipoLinea'] ?? null;
|
||||||
// En este caso contiene el nombre del papel generico
|
// En este caso contiene el nombre del papel generico
|
||||||
// Uso: negro, negrohq, color, colorhq, rot_bn, rot_color,
|
// Uso: negro, negrohq, color, colorhq, rot_bn, rot_color,
|
||||||
$model = new PapelImpresionModel();
|
$model = new PapelImpresionModel();
|
||||||
$menu = $model->getPapelesImpresionForMenu($datos, $gramaje, $tipoLinea, $uso );
|
$menu = $model->getPapelesImpresionForMenu($datos, $gramaje, $tipoLinea, $uso );
|
||||||
|
|
||||||
$data = [
|
$data = [
|
||||||
'menu' => $menu,
|
'menu' => $menu,
|
||||||
$csrfTokenName => $newTokenHash
|
$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,
|
|
||||||
$uso_tarifa = $reqData['uso_tarifa'] ?? 'interior';
|
|
||||||
$model = new MaquinaModel();
|
|
||||||
$maquinas = $model->getMaquinaImpresionForPresupuesto($is_rotativa, $uso, $uso_tarifa ,$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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$data = [
|
elseif ($tipo == 'maquina') {
|
||||||
'menu' => $menu,
|
$is_rotativa = $reqData['is_rotativa'] ?? null;
|
||||||
$csrfTokenName => $newTokenHash
|
$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,
|
||||||
|
$uso_tarifa = $reqData['uso_tarifa'] ?? 'interior';
|
||||||
|
$model = new MaquinaModel();
|
||||||
|
$maquinas = $model->getMaquinaImpresionForPresupuesto($is_rotativa, $uso, $uso_tarifa ,$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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
else{
|
$data = [
|
||||||
|
'menu' => $menu,
|
||||||
|
$csrfTokenName => $newTokenHash
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
else{
|
||||||
|
|
||||||
|
$data = [
|
||||||
|
'tipo' => $tipo,
|
||||||
|
$csrfTokenName => $newTokenHash
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch(Exception $e){
|
||||||
$data = [
|
$data = [
|
||||||
'tipo' => $tipo,
|
'error' => $e,
|
||||||
$csrfTokenName => $newTokenHash
|
$csrfTokenName => $newTokenHash
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
finally{
|
||||||
return $this->respond($data);
|
return $this->respond($data);
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
return $this->failUnauthorized('Invalid request', 403);
|
return $this->failUnauthorized('Invalid request', 403);
|
||||||
}
|
}
|
||||||
@ -880,6 +903,7 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
|
|||||||
{
|
{
|
||||||
$papelFormatoModel = model('App\Models\Configuracion\PapelFormatoModel');
|
$papelFormatoModel = model('App\Models\Configuracion\PapelFormatoModel');
|
||||||
$data = $papelFormatoModel->getElementsForMenu();
|
$data = $papelFormatoModel->getElementsForMenu();
|
||||||
|
array_shift($data);
|
||||||
array_unshift($data, (object)['id' => '', 'tamanio' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Presupuestos.papelFormatoId'))])]);
|
array_unshift($data, (object)['id' => '', 'tamanio' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Presupuestos.papelFormatoId'))])]);
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -141,6 +141,13 @@ return [
|
|||||||
|
|
||||||
'addLineaPresupuesto' => 'Add line...',
|
'addLineaPresupuesto' => 'Add line...',
|
||||||
|
|
||||||
|
'validation' => [
|
||||||
|
'decimal' => 'The {field} field must contain a decimal number.',
|
||||||
|
'integer' => 'The {field} field must contain an integer.',
|
||||||
|
'requerido' => 'The {field} field is required.',
|
||||||
|
'max_length' => 'The {field} field cannot exceed {param} characters in length.',
|
||||||
|
],
|
||||||
|
|
||||||
'errores' => [
|
'errores' => [
|
||||||
'paginas' => 'The field pages must be greater than zero',
|
'paginas' => 'The field pages must be greater than zero',
|
||||||
'tiradas' => 'The field print must be greater than zero',
|
'tiradas' => 'The field print must be greater than zero',
|
||||||
@ -333,7 +340,9 @@ return [
|
|||||||
|
|
||||||
'catalogo_id' => [
|
'catalogo_id' => [
|
||||||
'integer' => 'The {field} field must contain an integer.',
|
'integer' => 'The {field} field must contain an integer.',
|
||||||
|
'decimal' => 'The {field} field must contain a decimal number.',
|
||||||
|
'max_length' => 'The {field} field cannot exceed {param} characters in length.',
|
||||||
|
'required' => 'The {field} field is required.',
|
||||||
],
|
],
|
||||||
|
|
||||||
'causa_cancelacion' => [
|
'causa_cancelacion' => [
|
||||||
|
|||||||
@ -166,7 +166,8 @@ return [
|
|||||||
|
|
||||||
'validation' => [
|
'validation' => [
|
||||||
'decimal' => 'El campo {field} debe contener un número decimal.',
|
'decimal' => 'El campo {field} debe contener un número decimal.',
|
||||||
'requerido' => 'El campo {field} esta requerido.',
|
'integer' => 'El campo {field} debe contener un número entero.',
|
||||||
|
'requerido' => 'El campo {field} es obligatorio.',
|
||||||
'max_length' => 'El campo {field} no puede exceder los {param} caracteres de longitud.',
|
'max_length' => 'El campo {field} no puede exceder los {param} caracteres de longitud.',
|
||||||
],
|
],
|
||||||
|
|
||||||
|
|||||||
@ -206,810 +206,76 @@ class PresupuestoModel extends \App\Models\GoBaseModel
|
|||||||
|
|
||||||
public static $labelField = "titulo";
|
public static $labelField = "titulo";
|
||||||
|
|
||||||
protected $validationRules = [
|
protected $validationRulesAdd = [
|
||||||
"aprobado_at" => [
|
|
||||||
"label" => "Presupuestos.aprobadoAt",
|
|
||||||
"rules" => "valid_date|permit_empty",
|
|
||||||
],
|
|
||||||
"aprobado_json_data" => [
|
|
||||||
"label" => "Presupuestos.aprobadoJsonData",
|
|
||||||
"rules" => "trim|max_length[16313]",
|
|
||||||
],
|
|
||||||
"autor" => [
|
"autor" => [
|
||||||
"label" => "Presupuestos.autor",
|
"label" => "Presupuestos.autor",
|
||||||
"rules" => "trim|required|max_length[150]",
|
"rules" => "trim|required|max_length[150]",
|
||||||
],
|
],
|
||||||
"base_imponible" => [
|
"titulo" => [
|
||||||
"label" => "Presupuestos.baseImponible",
|
"label" => "Presupuestos.titulo",
|
||||||
"rules" => "decimal|permit_empty",
|
"rules" => "trim|required|max_length[30]",
|
||||||
],
|
|
||||||
"catalogo_id" => [
|
|
||||||
"label" => "Presupuestos.catalogoId",
|
|
||||||
"rules" => "integer|permit_empty",
|
|
||||||
],
|
|
||||||
"causa_cancelacion" => [
|
|
||||||
"label" => "Presupuestos.causaCancelacion",
|
|
||||||
"rules" => "trim|max_length[16313]",
|
|
||||||
],
|
|
||||||
"coleccion" => [
|
|
||||||
"label" => "Presupuestos.coleccion",
|
|
||||||
"rules" => "trim|max_length[255]",
|
|
||||||
],
|
|
||||||
"comentarios_cliente" => [
|
|
||||||
"label" => "Presupuestos.comentarios_cliente",
|
|
||||||
"rules" => "trim|required|max_length[16313]",
|
|
||||||
],
|
|
||||||
"comentarios_pdf" => [
|
|
||||||
"label" => "Presupuestos.comentariosPdf",
|
|
||||||
"rules" => "trim|required|max_length[16313]",
|
|
||||||
],
|
|
||||||
"comentarios_safekat" => [
|
|
||||||
"label" => "Presupuestos.comentariosSafekat",
|
|
||||||
"rules" => "trim|required|max_length[16313]",
|
|
||||||
],
|
|
||||||
"comentarios_tarifa" => [
|
|
||||||
"label" => "Presupuestos.comentariosTarifa",
|
|
||||||
"rules" => "trim|required|max_length[16313]",
|
|
||||||
],
|
|
||||||
"comentarios_produccion" => [
|
|
||||||
"label" => "Presupuestos.comentariosProduccion",
|
|
||||||
"rules" => "trim|required|max_length[16313]",
|
|
||||||
],
|
|
||||||
"comparador_json_data" => [
|
|
||||||
"label" => "Presupuestos.comparadorJsonData",
|
|
||||||
"rules" => "trim|max_length[16313]",
|
|
||||||
],
|
|
||||||
"sobrecubiertas_ancho" => [
|
|
||||||
"label" => "Presupuestos.sobrecubiertasAncho",
|
|
||||||
"rules" => "required|decimal",
|
|
||||||
],
|
|
||||||
"descuento" => [
|
|
||||||
"label" => "Presupuestos.descuento",
|
|
||||||
"rules" => "required|decimal",
|
|
||||||
],
|
|
||||||
"fecha_encuardenado_at" => [
|
|
||||||
"label" => "Presupuestos.fechaEncuardenadoAt",
|
|
||||||
"rules" => "valid_date|permit_empty",
|
|
||||||
],
|
|
||||||
"fecha_entrega_real_at" => [
|
|
||||||
"label" => "Presupuestos.fechaEntregaRealAt",
|
|
||||||
"rules" => "valid_date|permit_empty",
|
|
||||||
],
|
|
||||||
"fecha_externo_at" => [
|
|
||||||
"label" => "Presupuestos.fechaExternoAt",
|
|
||||||
"rules" => "valid_date|permit_empty",
|
|
||||||
],
|
|
||||||
"fecha_ferro_subido_at" => [
|
|
||||||
"label" => "Presupuestos.fechaFerroSubidoAt",
|
|
||||||
"rules" => "valid_date|permit_empty",
|
|
||||||
],
|
|
||||||
"fecha_impresion_at" => [
|
|
||||||
"label" => "Presupuestos.fechaImpresionAt",
|
|
||||||
"rules" => "valid_date|permit_empty",
|
|
||||||
],
|
|
||||||
"forzar_total" => [
|
|
||||||
"label" => "Presupuestos.forzarTotal",
|
|
||||||
"rules" => "required|decimal",
|
|
||||||
],
|
],
|
||||||
"inc_rei" => [
|
"inc_rei" => [
|
||||||
"label" => "Presupuestos.incRei",
|
"label" => "Presupuestos.incRei",
|
||||||
"rules" => "integer|permit_empty",
|
"rules" => "integer|permit_empty",
|
||||||
],
|
],
|
||||||
"is_deleted" => [
|
"coleccion" => [
|
||||||
"label" => "Presupuestos.isDeleted",
|
"label" => "Presupuestos.incRei",
|
||||||
"rules" => "required|integer",
|
"rules" => "trim|max_length[255]",
|
||||||
],
|
|
||||||
"isbn" => [
|
|
||||||
"label" => "Presupuestos.isbn",
|
|
||||||
"rules" => "trim|max_length[50]",
|
|
||||||
],
|
|
||||||
"lomo" => [
|
|
||||||
"label" => "Presupuestos.lomo",
|
|
||||||
"rules" => "integer|permit_empty",
|
|
||||||
],
|
|
||||||
"margen" => [
|
|
||||||
"label" => "Presupuestos.margen",
|
|
||||||
"rules" => "decimal|permit_empty",
|
|
||||||
],
|
|
||||||
"margen_extra" => [
|
|
||||||
"label" => "Presupuestos.margenExtra",
|
|
||||||
"rules" => "required|decimal",
|
|
||||||
],
|
|
||||||
"margen_manual" => [
|
|
||||||
"label" => "Presupuestos.margenManual",
|
|
||||||
"rules" => "decimal|permit_empty",
|
|
||||||
],
|
|
||||||
"merma" => [
|
|
||||||
"label" => "Presupuestos.merma",
|
|
||||||
"rules" => "required|decimal",
|
|
||||||
],
|
|
||||||
"merma_portada" => [
|
|
||||||
"label" => "Presupuestos.mermaPortada",
|
|
||||||
"rules" => "required|decimal",
|
|
||||||
],
|
],
|
||||||
"numero_edicion" => [
|
"numero_edicion" => [
|
||||||
"label" => "Presupuestos.numeroEdicion",
|
"label" => "Presupuestos.numeroEdicion",
|
||||||
"rules" => "trim|max_length[50]",
|
"rules" => "trim|max_length[50]",
|
||||||
],
|
],
|
||||||
"paginas" => [
|
"isbn" => [
|
||||||
"label" => "Presupuestos.paginas",
|
"label" => "Presupuestos.isbn",
|
||||||
"rules" => "required|integer",
|
"rules" => "trim|max_length[50]",
|
||||||
],
|
],
|
||||||
"paginas_color" => [
|
"pais_id" => [
|
||||||
"label" => "Presupuestos.paginasColor",
|
"label" => "Presupuestos.paisId",
|
||||||
"rules" => "integer|permit_empty",
|
"rules" => "required|integer|greater_than[0]",
|
||||||
],
|
],
|
||||||
"paginas_color_click" => [
|
"cliente_id" => [
|
||||||
"label" => "Presupuestos.paginasColorClick",
|
"label" => "Presupuestos.clienteId",
|
||||||
"rules" => "decimal|permit_empty",
|
"rules" => "required|integer|greater_than[0]",
|
||||||
],
|
|
||||||
"paginas_color_forma_id" => [
|
|
||||||
"label" => "Presupuestos.paginasColorFormaId",
|
|
||||||
"rules" => "integer|permit_empty",
|
|
||||||
],
|
|
||||||
"paginas_color_gramaje" => [
|
|
||||||
"label" => "Presupuestos.paginasColorGramaje",
|
|
||||||
"rules" => "decimal|permit_empty",
|
|
||||||
],
|
|
||||||
"paginas_color_libro" => [
|
|
||||||
"label" => "Presupuestos.paginasColorLibro",
|
|
||||||
"rules" => "decimal|permit_empty",
|
|
||||||
],
|
|
||||||
"paginas_color_mano" => [
|
|
||||||
"label" => "Presupuestos.paginasColorMano",
|
|
||||||
"rules" => "decimal|permit_empty",
|
|
||||||
],
|
|
||||||
"paginas_color_pedido" => [
|
|
||||||
"label" => "Presupuestos.paginasColorPedido",
|
|
||||||
"rules" => "decimal|permit_empty",
|
|
||||||
],
|
|
||||||
"paginas_color_peso" => [
|
|
||||||
"label" => "Presupuestos.paginasColorPeso",
|
|
||||||
"rules" => "decimal|permit_empty",
|
|
||||||
],
|
|
||||||
"paginas_color_pliegos_libro" => [
|
|
||||||
"label" => "Presupuestos.paginasColorPliegosLibro",
|
|
||||||
"rules" => "decimal|permit_empty",
|
|
||||||
],
|
|
||||||
"paginas_color_pliegos_pedido" => [
|
|
||||||
"label" => "Presupuestos.paginasColorPliegosPedido",
|
|
||||||
"rules" => "decimal|permit_empty",
|
|
||||||
],
|
|
||||||
"paginas_color_pliegos_precio" => [
|
|
||||||
"label" => "Presupuestos.paginasColorPliegosPrecio",
|
|
||||||
"rules" => "decimal|permit_empty",
|
|
||||||
],
|
|
||||||
"paginas_color_posicion" => [
|
|
||||||
"label" => "Presupuestos.paginasColorPosicion",
|
|
||||||
"rules" => "trim|max_length[16313]",
|
|
||||||
],
|
|
||||||
"paginas_color_precio" => [
|
|
||||||
"label" => "Presupuestos.paginasColorPrecio",
|
|
||||||
"rules" => "decimal|permit_empty",
|
|
||||||
],
|
|
||||||
"paginas_sobrecubierta" => [
|
|
||||||
"label" => "Presupuestos.paginasCubierta",
|
|
||||||
"rules" => "required|in_list[4x0,4x4]",
|
|
||||||
],
|
|
||||||
"paginas_sobrecubierta_click" => [
|
|
||||||
"label" => "Presupuestos.paginasCubiertaClick",
|
|
||||||
"rules" => "decimal|permit_empty",
|
|
||||||
],
|
|
||||||
"paginas_sobrecubierta_forma_id" => [
|
|
||||||
"label" => "Presupuestos.paginasCubiertaFormaId",
|
|
||||||
"rules" => "integer|permit_empty",
|
|
||||||
],
|
|
||||||
"paginas_sobrecubierta_gramaje" => [
|
|
||||||
"label" => "Presupuestos.paginasCubiertaGramaje",
|
|
||||||
"rules" => "decimal|permit_empty",
|
|
||||||
],
|
|
||||||
"paginas_sobrecubierta_libro" => [
|
|
||||||
"label" => "Presupuestos.paginasCubiertaLibro",
|
|
||||||
"rules" => "decimal|permit_empty",
|
|
||||||
],
|
|
||||||
"paginas_sobrecubierta_mano" => [
|
|
||||||
"label" => "Presupuestos.paginasCubiertaMano",
|
|
||||||
"rules" => "decimal|permit_empty",
|
|
||||||
],
|
|
||||||
"paginas_sobrecubierta_pedido" => [
|
|
||||||
"label" => "Presupuestos.paginasCubiertaPedido",
|
|
||||||
"rules" => "decimal|permit_empty",
|
|
||||||
],
|
|
||||||
"paginas_sobrecubierta_peso" => [
|
|
||||||
"label" => "Presupuestos.paginasCubiertaPeso",
|
|
||||||
"rules" => "decimal|permit_empty",
|
|
||||||
],
|
|
||||||
"paginas_sobrecubierta_pliegos_libro" => [
|
|
||||||
"label" => "Presupuestos.paginasCubiertaPliegosLibro",
|
|
||||||
"rules" => "decimal|permit_empty",
|
|
||||||
],
|
|
||||||
"paginas_sobrecubierta_pliegos_pedido" => [
|
|
||||||
"label" => "Presupuestos.paginasCubiertaPliegosPedido",
|
|
||||||
"rules" => "decimal|permit_empty",
|
|
||||||
],
|
|
||||||
"paginas_sobrecubierta_pliegos_precio" => [
|
|
||||||
"label" => "Presupuestos.paginasCubiertaPliegosPrecio",
|
|
||||||
"rules" => "decimal|permit_empty",
|
|
||||||
],
|
|
||||||
"paginas_sobrecubierta_precio" => [
|
|
||||||
"label" => "Presupuestos.paginasCubiertaPrecio",
|
|
||||||
"rules" => "decimal|permit_empty",
|
|
||||||
],
|
|
||||||
"paginas_negro" => [
|
|
||||||
"label" => "Presupuestos.paginasNegro",
|
|
||||||
"rules" => "integer|permit_empty",
|
|
||||||
],
|
|
||||||
"paginas_negro_click" => [
|
|
||||||
"label" => "Presupuestos.paginasNegroClick",
|
|
||||||
"rules" => "decimal|permit_empty",
|
|
||||||
],
|
|
||||||
"paginas_negro_forma_id" => [
|
|
||||||
"label" => "Presupuestos.paginasNegroFormaId",
|
|
||||||
"rules" => "integer|permit_empty",
|
|
||||||
],
|
|
||||||
"paginas_negro_gramaje" => [
|
|
||||||
"label" => "Presupuestos.paginasNegroGramaje",
|
|
||||||
"rules" => "decimal|permit_empty",
|
|
||||||
],
|
|
||||||
"paginas_negro_libro" => [
|
|
||||||
"label" => "Presupuestos.paginasNegroLibro",
|
|
||||||
"rules" => "decimal|permit_empty",
|
|
||||||
],
|
|
||||||
"paginas_negro_mano" => [
|
|
||||||
"label" => "Presupuestos.paginasNegroMano",
|
|
||||||
"rules" => "decimal|permit_empty",
|
|
||||||
],
|
|
||||||
"paginas_negro_pedido" => [
|
|
||||||
"label" => "Presupuestos.paginasNegroPedido",
|
|
||||||
"rules" => "decimal|permit_empty",
|
|
||||||
],
|
|
||||||
"paginas_negro_peso" => [
|
|
||||||
"label" => "Presupuestos.paginasNegroPeso",
|
|
||||||
"rules" => "decimal|permit_empty",
|
|
||||||
],
|
|
||||||
"paginas_negro_pliegos_libro" => [
|
|
||||||
"label" => "Presupuestos.paginasNegroPliegosLibro",
|
|
||||||
"rules" => "decimal|permit_empty",
|
|
||||||
],
|
|
||||||
"paginas_negro_pliegos_pedido" => [
|
|
||||||
"label" => "Presupuestos.paginasNegroPliegosPedido",
|
|
||||||
"rules" => "decimal|permit_empty",
|
|
||||||
],
|
|
||||||
"paginas_negro_pliegos_precio" => [
|
|
||||||
"label" => "Presupuestos.paginasNegroPliegosPrecio",
|
|
||||||
"rules" => "decimal|permit_empty",
|
|
||||||
],
|
|
||||||
"paginas_negro_precio" => [
|
|
||||||
"label" => "Presupuestos.paginasNegroPrecio",
|
|
||||||
"rules" => "decimal|permit_empty",
|
|
||||||
],
|
|
||||||
"paginas_cubierta" => [
|
|
||||||
"label" => "Presupuestos.paginasPortada",
|
|
||||||
"rules" => "required|in_list[4x0,4x4]",
|
|
||||||
],
|
|
||||||
"paginas_cubierta_click" => [
|
|
||||||
"label" => "Presupuestos.paginasPortadaClick",
|
|
||||||
"rules" => "decimal|permit_empty",
|
|
||||||
],
|
|
||||||
"paginas_cubierta_forma_id" => [
|
|
||||||
"label" => "Presupuestos.paginasPortadaFormaId",
|
|
||||||
"rules" => "integer|permit_empty",
|
|
||||||
],
|
|
||||||
"paginas_cubierta_gramaje" => [
|
|
||||||
"label" => "Presupuestos.paginasPortadaGramaje",
|
|
||||||
"rules" => "decimal|permit_empty",
|
|
||||||
],
|
|
||||||
"paginas_cubierta_libro" => [
|
|
||||||
"label" => "Presupuestos.paginasPortadaLibro",
|
|
||||||
"rules" => "decimal|permit_empty",
|
|
||||||
],
|
|
||||||
"paginas_cubierta_mano" => [
|
|
||||||
"label" => "Presupuestos.paginasPortadaMano",
|
|
||||||
"rules" => "decimal|permit_empty",
|
|
||||||
],
|
|
||||||
"paginas_cubierta_pedido" => [
|
|
||||||
"label" => "Presupuestos.paginasPortadaPedido",
|
|
||||||
"rules" => "required|decimal",
|
|
||||||
],
|
|
||||||
"paginas_cubierta_peso" => [
|
|
||||||
"label" => "Presupuestos.paginasPortadaPeso",
|
|
||||||
"rules" => "decimal|permit_empty",
|
|
||||||
],
|
|
||||||
"paginas_cubierta_pliegos_libro" => [
|
|
||||||
"label" => "Presupuestos.paginasPortadaPliegosLibro",
|
|
||||||
"rules" => "decimal|permit_empty",
|
|
||||||
],
|
|
||||||
"paginas_cubierta_pliegos_pedido" => [
|
|
||||||
"label" => "Presupuestos.paginasPortadaPliegosPedido",
|
|
||||||
"rules" => "decimal|permit_empty",
|
|
||||||
],
|
|
||||||
"paginas_cubierta_pliegos_precio" => [
|
|
||||||
"label" => "Presupuestos.paginasPortadaPliegosPrecio",
|
|
||||||
"rules" => "decimal|permit_empty",
|
|
||||||
],
|
|
||||||
"paginas_cubierta_precio" => [
|
|
||||||
"label" => "Presupuestos.paginasPortadaPrecio",
|
|
||||||
"rules" => "decimal|permit_empty",
|
|
||||||
],
|
|
||||||
"papel_formato_alto" => [
|
|
||||||
"label" => "Presupuestos.papelFormatoAlto",
|
|
||||||
"rules" => "decimal|permit_empty",
|
|
||||||
],
|
|
||||||
"papel_formato_ancho" => [
|
|
||||||
"label" => "Presupuestos.papelFormatoAncho",
|
|
||||||
"rules" => "decimal|permit_empty",
|
|
||||||
],
|
|
||||||
"pedido_espera_fecha" => [
|
|
||||||
"label" => "Presupuestos.pedidoEsperaFecha",
|
|
||||||
"rules" => "valid_date|permit_empty",
|
|
||||||
],
|
],
|
||||||
"referencia_cliente" => [
|
"referencia_cliente" => [
|
||||||
"label" => "Presupuestos.referenciaCliente",
|
"label" => "Presupuestos.referenciaCliente",
|
||||||
"rules" => "trim|required|max_length[100]",
|
"rules" => "trim|max_length[100]",
|
||||||
],
|
|
||||||
"responsable" => [
|
|
||||||
"label" => "Presupuestos.responsable",
|
|
||||||
"rules" => "trim|max_length[32]",
|
|
||||||
],
|
|
||||||
"serie_id" => [
|
|
||||||
"label" => "Presupuestos.serieId",
|
|
||||||
"rules" => "integer|permit_empty",
|
|
||||||
],
|
|
||||||
"solapas_ancho" => [
|
|
||||||
"label" => "Presupuestos.solapasAncho",
|
|
||||||
"rules" => "required|decimal",
|
|
||||||
],
|
|
||||||
"tarifa_cliente_id" => [
|
|
||||||
"label" => "Presupuestos.tarifaClienteId",
|
|
||||||
"rules" => "integer|permit_empty",
|
|
||||||
],
|
|
||||||
"tirada" => [
|
|
||||||
"label" => "Presupuestos.tirada",
|
|
||||||
"rules" => "required|integer",
|
|
||||||
],
|
|
||||||
"tirada_alternativa_json_data" => [
|
|
||||||
"label" => "Presupuestos.tiradaAlternativaJsonData",
|
|
||||||
"rules" => "trim|max_length[16313]",
|
|
||||||
],
|
|
||||||
"titulo" => [
|
|
||||||
"label" => "Presupuestos.titulo",
|
|
||||||
"rules" => "trim|required|max_length[300]",
|
|
||||||
],
|
|
||||||
"total" => [
|
|
||||||
"label" => "Presupuestos.total",
|
|
||||||
"rules" => "decimal|permit_empty",
|
|
||||||
],
|
|
||||||
"total_acabado" => [
|
|
||||||
"label" => "Presupuestos.totalAcabado",
|
|
||||||
"rules" => "decimal|permit_empty",
|
|
||||||
],
|
|
||||||
"total_calculado" => [
|
|
||||||
"label" => "Presupuestos.totalCalculado",
|
|
||||||
"rules" => "decimal|permit_empty",
|
|
||||||
],
|
|
||||||
"total_click" => [
|
|
||||||
"label" => "Presupuestos.totalClick",
|
|
||||||
"rules" => "decimal|permit_empty",
|
|
||||||
],
|
|
||||||
"total_confirmado" => [
|
|
||||||
"label" => "Presupuestos.totalConfirmado",
|
|
||||||
"rules" => "decimal|permit_empty",
|
|
||||||
],
|
|
||||||
"total_confirmado_update_at" => [
|
|
||||||
"label" => "Presupuestos.totalConfirmadoUpdateAt",
|
|
||||||
"rules" => "valid_date|permit_empty",
|
|
||||||
],
|
|
||||||
"total_descuento" => [
|
|
||||||
"label" => "Presupuestos.totalDescuento",
|
|
||||||
"rules" => "decimal|permit_empty",
|
|
||||||
],
|
|
||||||
"total_envios" => [
|
|
||||||
"label" => "Presupuestos.totalEnvios",
|
|
||||||
"rules" => "decimal|permit_empty",
|
|
||||||
],
|
|
||||||
"total_manipulado" => [
|
|
||||||
"label" => "Presupuestos.totalManipulado",
|
|
||||||
"rules" => "decimal|permit_empty",
|
|
||||||
],
|
|
||||||
"total_margen" => [
|
|
||||||
"label" => "Presupuestos.totalMargen",
|
|
||||||
"rules" => "decimal|permit_empty",
|
|
||||||
],
|
|
||||||
"total_margen_extra" => [
|
|
||||||
"label" => "Presupuestos.totalMargenExtra",
|
|
||||||
"rules" => "decimal|permit_empty",
|
|
||||||
],
|
|
||||||
"total_pedido" => [
|
|
||||||
"label" => "Presupuestos.totalPedido",
|
|
||||||
"rules" => "decimal|permit_empty",
|
|
||||||
],
|
|
||||||
"total_peso" => [
|
|
||||||
"label" => "Presupuestos.totalPeso",
|
|
||||||
"rules" => "decimal|permit_empty",
|
|
||||||
],
|
|
||||||
"total_preimpresion" => [
|
|
||||||
"label" => "Presupuestos.totalPreimpresion",
|
|
||||||
"rules" => "decimal|permit_empty",
|
|
||||||
],
|
|
||||||
"total_preimpresion_margen" => [
|
|
||||||
"label" => "Presupuestos.totalPreimpresionMargen",
|
|
||||||
"rules" => "decimal|permit_empty",
|
|
||||||
],
|
|
||||||
"total_presupuesto" => [
|
|
||||||
"label" => "Presupuestos.totalPresupuesto",
|
|
||||||
"rules" => "decimal|permit_empty",
|
|
||||||
],
|
|
||||||
"user_created_id" => [
|
|
||||||
"label" => "Presupuestos.userCreatedId",
|
|
||||||
"rules" => "required|integer",
|
|
||||||
],
|
|
||||||
"user_update_id" => [
|
|
||||||
"label" => "Presupuestos.userUpdateId",
|
|
||||||
"rules" => "integer|permit_empty",
|
|
||||||
],
|
|
||||||
"version" => [
|
|
||||||
"label" => "Presupuestos.version",
|
|
||||||
"rules" => "required|integer",
|
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
protected $validationMessages = [
|
protected $validationMessagesAdd = [
|
||||||
"aprobado_at" => [
|
|
||||||
"valid_date" => "Presupuestos.validation.aprobado_at.valid_date",
|
|
||||||
],
|
|
||||||
"aprobado_json_data" => [
|
|
||||||
"max_length" => "Presupuestos.validation.aprobado_json_data.max_length",
|
|
||||||
],
|
|
||||||
"autor" => [
|
"autor" => [
|
||||||
"max_length" => "Presupuestos.validation.autor.max_length",
|
|
||||||
"required" => "Presupuestos.validation.autor.required",
|
|
||||||
],
|
|
||||||
"base_imponible" => [
|
|
||||||
"decimal" => "Presupuestos.validation.base_imponible.decimal",
|
|
||||||
],
|
|
||||||
"catalogo_id" => [
|
|
||||||
"integer" => "Presupuestos.validation.catalogo_id.integer",
|
|
||||||
],
|
|
||||||
"causa_cancelacion" => [
|
|
||||||
"max_length" => "Presupuestos.validation.causa_cancelacion.max_length",
|
|
||||||
],
|
|
||||||
"coleccion" => [
|
|
||||||
"max_length" => "Presupuestos.validation.coleccion.max_length",
|
|
||||||
],
|
|
||||||
"comentarios_cliente" => [
|
|
||||||
"max_length" => "Presupuestos.validation.max_length",
|
"max_length" => "Presupuestos.validation.max_length",
|
||||||
"required" => "Presupuestos.validation.required",
|
"required" => "Presupuestos.validation.requerido",
|
||||||
],
|
|
||||||
"comentarios_pdf" => [
|
|
||||||
"max_length" => "Presupuestos.validation.max_length",
|
|
||||||
"required" => "Presupuestos.validation.required",
|
|
||||||
],
|
|
||||||
"comentarios_safekat" => [
|
|
||||||
"max_length" => "Presupuestos.validation.max_length",
|
|
||||||
"required" => "Presupuestos.validation.required",
|
|
||||||
],
|
|
||||||
"comentarios_tarifa" => [
|
|
||||||
"max_length" => "Presupuestos.validation.max_length",
|
|
||||||
"required" => "Presupuestos.validation.required",
|
|
||||||
],
|
|
||||||
"comentarios_produccion" => [
|
|
||||||
"max_length" => "Presupuestos.validation.max_length",
|
|
||||||
"required" => "Presupuestos.validation.required",
|
|
||||||
],
|
|
||||||
"comparador_json_data" => [
|
|
||||||
"max_length" => "Presupuestos.validation.comparador_json_data.max_length",
|
|
||||||
],
|
|
||||||
"sobrecubiertas_ancho" => [
|
|
||||||
"decimal" => "Presupuestos.validation.sobrecubiertas_ancho.decimal",
|
|
||||||
"required" => "Presupuestos.validation.sobrecubiertas_ancho.required",
|
|
||||||
],
|
|
||||||
"descuento" => [
|
|
||||||
"decimal" => "Presupuestos.validation.descuento.decimal",
|
|
||||||
"required" => "Presupuestos.validation.descuento.required",
|
|
||||||
],
|
|
||||||
"fecha_encuardenado_at" => [
|
|
||||||
"valid_date" => "Presupuestos.validation.fecha_encuardenado_at.valid_date",
|
|
||||||
],
|
|
||||||
"fecha_entrega_real_at" => [
|
|
||||||
"valid_date" => "Presupuestos.validation.fecha_entrega_real_at.valid_date",
|
|
||||||
],
|
|
||||||
"fecha_externo_at" => [
|
|
||||||
"valid_date" => "Presupuestos.validation.fecha_externo_at.valid_date",
|
|
||||||
],
|
|
||||||
"fecha_ferro_subido_at" => [
|
|
||||||
"valid_date" => "Presupuestos.validation.fecha_ferro_subido_at.valid_date",
|
|
||||||
],
|
|
||||||
"fecha_impresion_at" => [
|
|
||||||
"valid_date" => "Presupuestos.validation.fecha_impresion_at.valid_date",
|
|
||||||
],
|
|
||||||
"forzar_total" => [
|
|
||||||
"decimal" => "Presupuestos.validation.forzar_total.decimal",
|
|
||||||
"required" => "Presupuestos.validation.forzar_total.required",
|
|
||||||
],
|
|
||||||
"inc_rei" => [
|
|
||||||
"integer" => "Presupuestos.validation.inc_rei.integer",
|
|
||||||
],
|
|
||||||
"is_deleted" => [
|
|
||||||
"integer" => "Presupuestos.validation.is_deleted.integer",
|
|
||||||
"required" => "Presupuestos.validation.is_deleted.required",
|
|
||||||
],
|
|
||||||
"isbn" => [
|
|
||||||
"max_length" => "Presupuestos.validation.isbn.max_length",
|
|
||||||
],
|
|
||||||
"lomo" => [
|
|
||||||
"integer" => "Presupuestos.validation.lomo.integer",
|
|
||||||
],
|
|
||||||
"margen" => [
|
|
||||||
"decimal" => "Presupuestos.validation.margen.decimal",
|
|
||||||
],
|
|
||||||
"margen_extra" => [
|
|
||||||
"decimal" => "Presupuestos.validation.margen_extra.decimal",
|
|
||||||
"required" => "Presupuestos.validation.margen_extra.required",
|
|
||||||
],
|
|
||||||
"margen_manual" => [
|
|
||||||
"decimal" => "Presupuestos.validation.margen_manual.decimal",
|
|
||||||
],
|
|
||||||
"merma" => [
|
|
||||||
"decimal" => "Presupuestos.validation.merma.decimal",
|
|
||||||
"required" => "Presupuestos.validation.merma.required",
|
|
||||||
],
|
|
||||||
"merma_portada" => [
|
|
||||||
"decimal" => "Presupuestos.validation.merma_portada.decimal",
|
|
||||||
"required" => "Presupuestos.validation.merma_portada.required",
|
|
||||||
],
|
|
||||||
"numero_edicion" => [
|
|
||||||
"max_length" => "Presupuestos.validation.numero_edicion.max_length",
|
|
||||||
],
|
|
||||||
"paginas" => [
|
|
||||||
"integer" => "Presupuestos.validation.paginas.integer",
|
|
||||||
"required" => "Presupuestos.validation.paginas.required",
|
|
||||||
],
|
|
||||||
"paginas_color" => [
|
|
||||||
"integer" => "Presupuestos.validation.paginas_color.integer",
|
|
||||||
],
|
|
||||||
"paginas_color_click" => [
|
|
||||||
"decimal" => "Presupuestos.validation.paginas_color_click.decimal",
|
|
||||||
],
|
|
||||||
"paginas_color_forma_id" => [
|
|
||||||
"integer" => "Presupuestos.validation.paginas_color_forma_id.integer",
|
|
||||||
],
|
|
||||||
"paginas_color_gramaje" => [
|
|
||||||
"decimal" => "Presupuestos.validation.paginas_color_gramaje.decimal",
|
|
||||||
],
|
|
||||||
"paginas_color_libro" => [
|
|
||||||
"decimal" => "Presupuestos.validation.paginas_color_libro.decimal",
|
|
||||||
],
|
|
||||||
"paginas_color_mano" => [
|
|
||||||
"decimal" => "Presupuestos.validation.paginas_color_mano.decimal",
|
|
||||||
],
|
|
||||||
"paginas_color_pedido" => [
|
|
||||||
"decimal" => "Presupuestos.validation.paginas_color_pedido.decimal",
|
|
||||||
],
|
|
||||||
"paginas_color_peso" => [
|
|
||||||
"decimal" => "Presupuestos.validation.paginas_color_peso.decimal",
|
|
||||||
],
|
|
||||||
"paginas_color_pliegos_libro" => [
|
|
||||||
"decimal" => "Presupuestos.validation.paginas_color_pliegos_libro.decimal",
|
|
||||||
],
|
|
||||||
"paginas_color_pliegos_pedido" => [
|
|
||||||
"decimal" => "Presupuestos.validation.paginas_color_pliegos_pedido.decimal",
|
|
||||||
],
|
|
||||||
"paginas_color_pliegos_precio" => [
|
|
||||||
"decimal" => "Presupuestos.validation.paginas_color_pliegos_precio.decimal",
|
|
||||||
],
|
|
||||||
"paginas_color_posicion" => [
|
|
||||||
"max_length" => "Presupuestos.validation.paginas_color_posicion.max_length",
|
|
||||||
],
|
|
||||||
"paginas_color_precio" => [
|
|
||||||
"decimal" => "Presupuestos.validation.paginas_color_precio.decimal",
|
|
||||||
],
|
|
||||||
"paginas_sobrecubierta" => [
|
|
||||||
"in_list" => "Presupuestos.validation.paginas_sobrecubierta.in_list",
|
|
||||||
"required" => "Presupuestos.validation.paginas_sobrecubierta.required",
|
|
||||||
],
|
|
||||||
"paginas_sobrecubierta_click" => [
|
|
||||||
"decimal" => "Presupuestos.validation.paginas_sobrecubierta_click.decimal",
|
|
||||||
],
|
|
||||||
"paginas_sobrecubierta_forma_id" => [
|
|
||||||
"integer" => "Presupuestos.validation.paginas_sobrecubierta_forma_id.integer",
|
|
||||||
],
|
|
||||||
"paginas_sobrecubierta_gramaje" => [
|
|
||||||
"decimal" => "Presupuestos.validation.paginas_sobrecubierta_gramaje.decimal",
|
|
||||||
],
|
|
||||||
"paginas_sobrecubierta_libro" => [
|
|
||||||
"decimal" => "Presupuestos.validation.paginas_sobrecubierta_libro.decimal",
|
|
||||||
],
|
|
||||||
"paginas_sobrecubierta_mano" => [
|
|
||||||
"decimal" => "Presupuestos.validation.paginas_sobrecubierta_mano.decimal",
|
|
||||||
],
|
|
||||||
"paginas_sobrecubierta_pedido" => [
|
|
||||||
"decimal" => "Presupuestos.validation.paginas_sobrecubierta_pedido.decimal",
|
|
||||||
],
|
|
||||||
"paginas_sobrecubierta_peso" => [
|
|
||||||
"decimal" => "Presupuestos.validation.paginas_sobrecubierta_peso.decimal",
|
|
||||||
],
|
|
||||||
"paginas_sobrecubierta_pliegos_libro" => [
|
|
||||||
"decimal" => "Presupuestos.validation.paginas_sobrecubierta_pliegos_libro.decimal",
|
|
||||||
],
|
|
||||||
"paginas_sobrecubierta_pliegos_pedido" => [
|
|
||||||
"decimal" => "Presupuestos.validation.paginas_sobrecubierta_pliegos_pedido.decimal",
|
|
||||||
],
|
|
||||||
"paginas_sobrecubierta_pliegos_precio" => [
|
|
||||||
"decimal" => "Presupuestos.validation.paginas_sobrecubierta_pliegos_precio.decimal",
|
|
||||||
],
|
|
||||||
"paginas_sobrecubierta_precio" => [
|
|
||||||
"decimal" => "Presupuestos.validation.paginas_sobrecubierta_precio.decimal",
|
|
||||||
],
|
|
||||||
"paginas_negro" => [
|
|
||||||
"integer" => "Presupuestos.validation.paginas_negro.integer",
|
|
||||||
],
|
|
||||||
"paginas_negro_click" => [
|
|
||||||
"decimal" => "Presupuestos.validation.paginas_negro_click.decimal",
|
|
||||||
],
|
|
||||||
"paginas_negro_forma_id" => [
|
|
||||||
"integer" => "Presupuestos.validation.paginas_negro_forma_id.integer",
|
|
||||||
],
|
|
||||||
"paginas_negro_gramaje" => [
|
|
||||||
"decimal" => "Presupuestos.validation.paginas_negro_gramaje.decimal",
|
|
||||||
],
|
|
||||||
"paginas_negro_libro" => [
|
|
||||||
"decimal" => "Presupuestos.validation.paginas_negro_libro.decimal",
|
|
||||||
],
|
|
||||||
"paginas_negro_mano" => [
|
|
||||||
"decimal" => "Presupuestos.validation.paginas_negro_mano.decimal",
|
|
||||||
],
|
|
||||||
"paginas_negro_pedido" => [
|
|
||||||
"decimal" => "Presupuestos.validation.paginas_negro_pedido.decimal",
|
|
||||||
],
|
|
||||||
"paginas_negro_peso" => [
|
|
||||||
"decimal" => "Presupuestos.validation.paginas_negro_peso.decimal",
|
|
||||||
],
|
|
||||||
"paginas_negro_pliegos_libro" => [
|
|
||||||
"decimal" => "Presupuestos.validation.paginas_negro_pliegos_libro.decimal",
|
|
||||||
],
|
|
||||||
"paginas_negro_pliegos_pedido" => [
|
|
||||||
"decimal" => "Presupuestos.validation.paginas_negro_pliegos_pedido.decimal",
|
|
||||||
],
|
|
||||||
"paginas_negro_pliegos_precio" => [
|
|
||||||
"decimal" => "Presupuestos.validation.paginas_negro_pliegos_precio.decimal",
|
|
||||||
],
|
|
||||||
"paginas_negro_precio" => [
|
|
||||||
"decimal" => "Presupuestos.validation.paginas_negro_precio.decimal",
|
|
||||||
],
|
|
||||||
"paginas_cubierta" => [
|
|
||||||
"in_list" => "Presupuestos.validation.paginas_cubierta.in_list",
|
|
||||||
"required" => "Presupuestos.validation.paginas_cubierta.required",
|
|
||||||
],
|
|
||||||
"paginas_cubierta_click" => [
|
|
||||||
"decimal" => "Presupuestos.validation.paginas_cubierta_click.decimal",
|
|
||||||
],
|
|
||||||
"paginas_cubierta_forma_id" => [
|
|
||||||
"integer" => "Presupuestos.validation.paginas_cubierta_forma_id.integer",
|
|
||||||
],
|
|
||||||
"paginas_cubierta_gramaje" => [
|
|
||||||
"decimal" => "Presupuestos.validation.paginas_cubierta_gramaje.decimal",
|
|
||||||
],
|
|
||||||
"paginas_cubierta_libro" => [
|
|
||||||
"decimal" => "Presupuestos.validation.paginas_cubierta_libro.decimal",
|
|
||||||
],
|
|
||||||
"paginas_cubierta_mano" => [
|
|
||||||
"decimal" => "Presupuestos.validation.paginas_cubierta_mano.decimal",
|
|
||||||
],
|
|
||||||
"paginas_cubierta_pedido" => [
|
|
||||||
"decimal" => "Presupuestos.validation.paginas_cubierta_pedido.decimal",
|
|
||||||
"required" => "Presupuestos.validation.paginas_cubierta_pedido.required",
|
|
||||||
],
|
|
||||||
"paginas_cubierta_peso" => [
|
|
||||||
"decimal" => "Presupuestos.validation.paginas_cubierta_peso.decimal",
|
|
||||||
],
|
|
||||||
"paginas_cubierta_pliegos_libro" => [
|
|
||||||
"decimal" => "Presupuestos.validation.paginas_cubierta_pliegos_libro.decimal",
|
|
||||||
],
|
|
||||||
"paginas_cubierta_pliegos_pedido" => [
|
|
||||||
"decimal" => "Presupuestos.validation.paginas_cubierta_pliegos_pedido.decimal",
|
|
||||||
],
|
|
||||||
"paginas_cubierta_pliegos_precio" => [
|
|
||||||
"decimal" => "Presupuestos.validation.paginas_cubierta_pliegos_precio.decimal",
|
|
||||||
],
|
|
||||||
"paginas_cubierta_precio" => [
|
|
||||||
"decimal" => "Presupuestos.validation.paginas_cubierta_precio.decimal",
|
|
||||||
],
|
|
||||||
"papel_formato_alto" => [
|
|
||||||
"decimal" => "Presupuestos.validation.papel_formato_alto.decimal",
|
|
||||||
],
|
|
||||||
"papel_formato_ancho" => [
|
|
||||||
"decimal" => "Presupuestos.validation.papel_formato_ancho.decimal",
|
|
||||||
],
|
|
||||||
"pedido_espera_fecha" => [
|
|
||||||
"valid_date" => "Presupuestos.validation.pedido_espera_fecha.valid_date",
|
|
||||||
],
|
|
||||||
"referencia_cliente" => [
|
|
||||||
"max_length" => "Presupuestos.validation.referencia_cliente.max_length",
|
|
||||||
"required" => "Presupuestos.validation.referencia_cliente.required",
|
|
||||||
],
|
|
||||||
"responsable" => [
|
|
||||||
"max_length" => "Presupuestos.validation.responsable.max_length",
|
|
||||||
],
|
|
||||||
"serie_id" => [
|
|
||||||
"integer" => "Presupuestos.validation.serie_id.integer",
|
|
||||||
],
|
|
||||||
"solapas_ancho" => [
|
|
||||||
"decimal" => "Presupuestos.validation.solapas_ancho.decimal",
|
|
||||||
"required" => "Presupuestos.validation.solapas_ancho.required",
|
|
||||||
],
|
|
||||||
"tarifa_cliente_id" => [
|
|
||||||
"integer" => "Presupuestos.validation.tarifa_cliente_id.integer",
|
|
||||||
],
|
|
||||||
"tirada" => [
|
|
||||||
"integer" => "Presupuestos.validation.tirada.integer",
|
|
||||||
"required" => "Presupuestos.validation.tirada.required",
|
|
||||||
],
|
|
||||||
"tirada_alternativa_json_data" => [
|
|
||||||
"max_length" => "Presupuestos.validation.tirada_alternativa_json_data.max_length",
|
|
||||||
],
|
],
|
||||||
"titulo" => [
|
"titulo" => [
|
||||||
"max_length" => "Presupuestos.validation.titulo.max_length",
|
"max_length" => "Presupuestos.validation.max_length",
|
||||||
"required" => "Presupuestos.validation.titulo.required",
|
"required" => "Presupuestos.validation.requerido",
|
||||||
],
|
],
|
||||||
"total" => [
|
"inc_rei" => [
|
||||||
"decimal" => "Presupuestos.validation.total.decimal",
|
"integer" => "Presupuestos.validation.integer",
|
||||||
|
|
||||||
],
|
],
|
||||||
"total_acabado" => [
|
"coleccion" => [
|
||||||
"decimal" => "Presupuestos.validation.total_acabado.decimal",
|
"max_length" => "Presupuestos.validation.max_length",
|
||||||
],
|
],
|
||||||
"total_calculado" => [
|
"numero_edicion" => [
|
||||||
"decimal" => "Presupuestos.validation.total_calculado.decimal",
|
"max_length" => "Presupuestos.validation.max_length",
|
||||||
],
|
],
|
||||||
"total_click" => [
|
"isbn" => [
|
||||||
"decimal" => "Presupuestos.validation.total_click.decimal",
|
"max_length" => "Presupuestos.validation.max_length",
|
||||||
],
|
],
|
||||||
"total_confirmado" => [
|
"pais_id" => [
|
||||||
"decimal" => "Presupuestos.validation.total_confirmado.decimal",
|
"required" => "Presupuestos.validation.requerido",
|
||||||
],
|
],
|
||||||
"total_confirmado_update_at" => [
|
"cliente_id" => [
|
||||||
"valid_date" => "Presupuestos.validation.total_confirmado_update_at.valid_date",
|
"required" => "Presupuestos.validation.requerido",
|
||||||
],
|
|
||||||
"total_descuento" => [
|
|
||||||
"decimal" => "Presupuestos.validation.total_descuento.decimal",
|
|
||||||
],
|
|
||||||
"total_envios" => [
|
|
||||||
"decimal" => "Presupuestos.validation.total_envios.decimal",
|
|
||||||
],
|
|
||||||
"total_manipulado" => [
|
|
||||||
"decimal" => "Presupuestos.validation.total_manipulado.decimal",
|
|
||||||
],
|
|
||||||
"total_margen" => [
|
|
||||||
"decimal" => "Presupuestos.validation.total_margen.decimal",
|
|
||||||
],
|
|
||||||
"total_margen_extra" => [
|
|
||||||
"decimal" => "Presupuestos.validation.total_margen_extra.decimal",
|
|
||||||
],
|
|
||||||
"total_pedido" => [
|
|
||||||
"decimal" => "Presupuestos.validation.total_pedido.decimal",
|
|
||||||
],
|
|
||||||
"total_peso" => [
|
|
||||||
"decimal" => "Presupuestos.validation.total_peso.decimal",
|
|
||||||
],
|
|
||||||
"total_preimpresion" => [
|
|
||||||
"decimal" => "Presupuestos.validation.total_preimpresion.decimal",
|
|
||||||
],
|
|
||||||
"total_preimpresion_margen" => [
|
|
||||||
"decimal" => "Presupuestos.validation.total_preimpresion_margen.decimal",
|
|
||||||
],
|
|
||||||
"total_presupuesto" => [
|
|
||||||
"decimal" => "Presupuestos.validation.total_presupuesto.decimal",
|
|
||||||
],
|
|
||||||
"user_created_id" => [
|
|
||||||
"integer" => "Presupuestos.validation.user_created_id.integer",
|
|
||||||
"required" => "Presupuestos.validation.user_created_id.required",
|
|
||||||
],
|
|
||||||
"user_update_id" => [
|
|
||||||
"integer" => "Presupuestos.validation.user_update_id.integer",
|
|
||||||
],
|
|
||||||
"version" => [
|
|
||||||
"integer" => "Presupuestos.validation.version.integer",
|
|
||||||
"required" => "Presupuestos.validation.version.required",
|
|
||||||
],
|
],
|
||||||
|
"referencia_cliente" => [
|
||||||
|
"max_length" => "Presupuestos.validation.max_length",
|
||||||
|
],
|
||||||
];
|
];
|
||||||
public function findAllWithAllRelations(string $selcols = "*", int $limit = null, int $offset = 0)
|
public function findAllWithAllRelations(string $selcols = "*", int $limit = null, int $offset = 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -259,4 +259,32 @@
|
|||||||
</div> <!-- //.accordion-body -->
|
</div> <!-- //.accordion-body -->
|
||||||
</div> <!-- //.accordion-collapse -->
|
</div> <!-- //.accordion-collapse -->
|
||||||
</div> <!-- //.accordion-item -->
|
</div> <!-- //.accordion-item -->
|
||||||
</div> <!-- //.accordion -->
|
</div> <!-- //.accordion -->
|
||||||
|
|
||||||
|
<!------------------------------------------->
|
||||||
|
<!-- Código JS comportamiento general pag. -->
|
||||||
|
<!------------------------------------------->
|
||||||
|
<?= $this->section("additionalInlineJs") ?>
|
||||||
|
$('#papelFormatoPersonalizado').on("click",function(){
|
||||||
|
var checkbox = document.getElementById('papelFormatoPersonalizado');
|
||||||
|
if(checkbox.checked == true){
|
||||||
|
document.getElementById("papelFormatoAncho").style.display = "block";
|
||||||
|
document.getElementById("papelFormatoAlto").style.display = "block";
|
||||||
|
$('#papelFormatoId').next(".select2-container").hide();
|
||||||
|
$('#papelFormatoId').val('').change();
|
||||||
|
document.getElementById("label_papelFormatoId").innerHTML =
|
||||||
|
"<?=lang('Presupuestos.papelFormatoId') ?> (" +
|
||||||
|
"<?=lang('Presupuestos.papelFormatoAncho') ?> x <?=lang('Presupuestos.papelFormatoAncho') ?>)*";
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
document.getElementById("papelFormatoAncho").value= "";
|
||||||
|
document.getElementById("papelFormatoAlto").value= "";
|
||||||
|
document.getElementById("papelFormatoAncho").style.display = "none";
|
||||||
|
document.getElementById("papelFormatoAlto").style.display = "none";
|
||||||
|
$('#papelFormatoId').next(".select2-container").show();
|
||||||
|
document.getElementById("label_papelFormatoId").innerHTML =
|
||||||
|
"<?=lang('Presupuestos.papelFormatoId') ?>*";
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
<?= $this->endSection() ?>
|
||||||
|
|||||||
@ -425,4 +425,888 @@
|
|||||||
</div> <!-- //.accordion-body -->
|
</div> <!-- //.accordion-body -->
|
||||||
</div> <!-- //.accordion-collapse -->
|
</div> <!-- //.accordion-collapse -->
|
||||||
</div> <!-- //.accordion-item -->
|
</div> <!-- //.accordion-item -->
|
||||||
</div> <!-- //.accordion -->
|
</div> <!-- //.accordion -->
|
||||||
|
|
||||||
|
|
||||||
|
<!------------------------------------------->
|
||||||
|
<!-- Código JS comportamiento general pag. -->
|
||||||
|
<!------------------------------------------->
|
||||||
|
<?= $this->section("additionalInlineJs") ?>
|
||||||
|
|
||||||
|
autosize($('#compCalPaginasColor'));
|
||||||
|
|
||||||
|
init_comparador();
|
||||||
|
|
||||||
|
var tableCompIntPlana = new DataTable('#tableCompIntPlana',{
|
||||||
|
scrollX: true,
|
||||||
|
searching: false,
|
||||||
|
paging: false,
|
||||||
|
info: false,
|
||||||
|
ordering: false,
|
||||||
|
responsive: true,
|
||||||
|
select: false,
|
||||||
|
language: {
|
||||||
|
url: "//cdn.datatables.net/plug-ins/1.13.4/i18n/<?= config('Basics')->i18n ?>.json"
|
||||||
|
},
|
||||||
|
columns: [
|
||||||
|
{ 'data': 'tipo',
|
||||||
|
'render': function ( data, type, row, meta ) {
|
||||||
|
if(data=='bn')
|
||||||
|
return '<?= lang('Presupuestos.bn') ?>';
|
||||||
|
else if(data=='bnhq')
|
||||||
|
return '<?= lang('Presupuestos.bnhq') ?>';
|
||||||
|
else if(data=='color')
|
||||||
|
return '<?= lang('Presupuestos.color') ?>';
|
||||||
|
else if(data=='colorhq')
|
||||||
|
return '<?= lang('Presupuestos.colorhq') ?>';
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ 'data': 'paginas' },
|
||||||
|
{ 'data': 'papel' },
|
||||||
|
{ 'data': 'gramaje' },
|
||||||
|
{ 'data': 'marca' },
|
||||||
|
{ 'data': 'maquina' },
|
||||||
|
{ 'data': 'numeroPliegos' },
|
||||||
|
{ 'data': 'pliegosPedido' },
|
||||||
|
{ 'data': 'precioPliego' },
|
||||||
|
{ 'data': 'libro' },
|
||||||
|
{ 'data': 'totalPapelPedido' },
|
||||||
|
{ 'data': 'lomo' },
|
||||||
|
{ 'data': 'peso' },
|
||||||
|
{ 'data': 'click' },
|
||||||
|
{ 'data': 'totalClicks' },
|
||||||
|
{ 'data': 'total' },
|
||||||
|
{ 'data': 'maquinaId'},
|
||||||
|
{ 'data': 'maquinaVelocidad'},
|
||||||
|
{ 'data': 'tiempoMaquina'},
|
||||||
|
{ 'data': 'papelGenericoId'},
|
||||||
|
{ 'data': 'papelImpresionId'}
|
||||||
|
],
|
||||||
|
columnDefs: [
|
||||||
|
{
|
||||||
|
target: [16,17,18,19,20],
|
||||||
|
visible: false,
|
||||||
|
searchable: false
|
||||||
|
},
|
||||||
|
]
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
var tableCompIntRotativa = new DataTable('#tableCompIntRotativa',{
|
||||||
|
scrollX: true,
|
||||||
|
searching: false,
|
||||||
|
paging: false,
|
||||||
|
info: false,
|
||||||
|
ordering: false,
|
||||||
|
responsive: true,
|
||||||
|
select: false,
|
||||||
|
language: {
|
||||||
|
url: "//cdn.datatables.net/plug-ins/1.13.4/i18n/<?= config('Basics')->i18n ?>.json"
|
||||||
|
},
|
||||||
|
columns: [
|
||||||
|
{ 'data': 'tipo',
|
||||||
|
'render': function ( data, type, row, meta ) {
|
||||||
|
if(data=='rotativa')
|
||||||
|
return '<?= lang('Presupuestos.rotativa') ?>';
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ 'data': 'paginas' },
|
||||||
|
{ 'data': 'papel' },
|
||||||
|
{ 'data': 'gramaje' },
|
||||||
|
{ 'data': 'marca' },
|
||||||
|
{ 'data': 'aFavorFibra',
|
||||||
|
'render': function(data, type, row, meta){
|
||||||
|
if(data=='si')
|
||||||
|
return '<?= lang('Presupuestos.si') ?>';
|
||||||
|
else if(data=='no')
|
||||||
|
return '<?= lang('Presupuestos.no') ?>';
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ 'data': 'maquina' },
|
||||||
|
{ 'data': 'numeroPliegos' },
|
||||||
|
{ 'data': 'pliegosPedido' },
|
||||||
|
{ 'data': 'precioPliego' },
|
||||||
|
{ 'data': 'libro' },
|
||||||
|
{ 'data': 'totalPapelPedido' },
|
||||||
|
{ 'data': 'lomo' },
|
||||||
|
{ 'data': 'peso' },
|
||||||
|
{ 'data': 'click' },
|
||||||
|
{ 'data': 'totalClicks' },
|
||||||
|
{ 'data': 'precioPagNegro' },
|
||||||
|
{ 'data': 'precioPagColor' },
|
||||||
|
{ 'data': 'totalTinta' },
|
||||||
|
{ 'data': 'totalCorte' },
|
||||||
|
{ 'data': 'total' },
|
||||||
|
{ 'data': 'maquinaId'},
|
||||||
|
{ 'data': 'maquinaVelocidad'},
|
||||||
|
{ 'data': 'tiempoMaquina'},
|
||||||
|
{ 'data': 'papelGenericoId'},
|
||||||
|
{ 'data': 'papelImpresionId'},
|
||||||
|
{ 'data': 'paginasColor'},
|
||||||
|
],
|
||||||
|
columnDefs: [
|
||||||
|
{
|
||||||
|
target: [21,22,23,24,25,26],
|
||||||
|
visible: false,
|
||||||
|
searchable: false
|
||||||
|
},
|
||||||
|
]
|
||||||
|
});
|
||||||
|
|
||||||
|
var tableCompCubierta = new DataTable('#tableCompCubierta',{
|
||||||
|
scrollX: true,
|
||||||
|
searching: false,
|
||||||
|
paging: false,
|
||||||
|
info: false,
|
||||||
|
ordering: false,
|
||||||
|
responsive: true,
|
||||||
|
select: false,
|
||||||
|
language: {
|
||||||
|
url: "//cdn.datatables.net/plug-ins/1.13.4/i18n/<?= config('Basics')->i18n ?>.json"
|
||||||
|
},
|
||||||
|
columns: [
|
||||||
|
{ 'data': 'tipo',
|
||||||
|
'render': function ( data, type, row, meta ) {
|
||||||
|
if(data=='cubierta')
|
||||||
|
return '<?= lang('Presupuestos.cubierta') ?>';
|
||||||
|
else if(data=='sobrecubierta')
|
||||||
|
return '<?= lang('Presupuestos.sobrecubierta') ?>';
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ 'data': 'paginas' },
|
||||||
|
{ 'data': 'papel' },
|
||||||
|
{ 'data': 'gramaje' },
|
||||||
|
{ 'data': 'marca' },
|
||||||
|
{ 'data': 'maquina' },
|
||||||
|
{ 'data': 'numeroPliegos' },
|
||||||
|
{ 'data': 'pliegosPedido' },
|
||||||
|
{ 'data': 'precioPliego' },
|
||||||
|
{ 'data': 'libro' },
|
||||||
|
{ 'data': 'totalPapelPedido' },
|
||||||
|
{ 'data': 'lomo' },
|
||||||
|
{ 'data': 'peso' },
|
||||||
|
{ 'data': 'click' },
|
||||||
|
{ 'data': 'totalClicks' },
|
||||||
|
{ 'data': 'total' },
|
||||||
|
{ 'data': 'maquinaId'},
|
||||||
|
{ 'data': 'maquinaVelocidad'},
|
||||||
|
{ 'data': 'tiempoMaquina'},
|
||||||
|
{ 'data': 'papelGenericoId'},
|
||||||
|
{ 'data': 'papelImpresionId'}
|
||||||
|
],
|
||||||
|
columnDefs: [
|
||||||
|
{
|
||||||
|
target: [16,17,18,19,20],
|
||||||
|
visible: false,
|
||||||
|
searchable: false
|
||||||
|
},
|
||||||
|
]
|
||||||
|
});
|
||||||
|
|
||||||
|
$('.comp_negro_items').on('change', function (e) {
|
||||||
|
|
||||||
|
checkComparadorInt(false,false);
|
||||||
|
});
|
||||||
|
|
||||||
|
$('.comp_negrohq_items').on('change', function (e) {
|
||||||
|
|
||||||
|
checkComparadorInt(false, true);
|
||||||
|
});
|
||||||
|
|
||||||
|
$('.comp_color_items').on('change', function (e) {
|
||||||
|
|
||||||
|
checkComparadorInt(true, false);
|
||||||
|
});
|
||||||
|
|
||||||
|
$('.comp_colorhq_items').on('change', function (e) {
|
||||||
|
checkComparadorInt(true, true);
|
||||||
|
});
|
||||||
|
|
||||||
|
async function getLineasIntPlana(is_color, is_hq){
|
||||||
|
|
||||||
|
const dimension = getDimensionLibro();
|
||||||
|
|
||||||
|
let datos = {
|
||||||
|
type: 'interior',
|
||||||
|
color: is_color?1:0,
|
||||||
|
hq: is_hq?1:0,
|
||||||
|
paginas: parseInt($(''+ elementos.paginas).val()),
|
||||||
|
tirada: parseInt($('#tirada').val()),
|
||||||
|
merma: parseInt($('#merma').val()),
|
||||||
|
ancho: dimension.ancho,
|
||||||
|
alto: dimension.alto,
|
||||||
|
papel_generico_id: $(''+ elementos.papel).select2('data')[0].id,
|
||||||
|
papel_generico: $(''+ elementos.papel).select2('data')[0].text.trim(),
|
||||||
|
gramaje: $(''+ elementos.gramaje).select2('data')[0].text.trim() ,
|
||||||
|
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
|
||||||
|
};
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
type: "POST",
|
||||||
|
url: "/cosidotapablanda/datatable",
|
||||||
|
data: datos,
|
||||||
|
success: function (data) {
|
||||||
|
|
||||||
|
clearIntLineas(is_color);
|
||||||
|
|
||||||
|
if(data.lineas.length >0){
|
||||||
|
|
||||||
|
fillIntPlana(data, is_color, is_hq);
|
||||||
|
selectIntLineas();
|
||||||
|
$('#title_int_plana').html('<?= lang("Presupuestos.compInteriorPlana") ?>' + ' (' + tableCompIntPlana.rows().count() + ')');
|
||||||
|
$('#insertarPlanaBtn').removeClass('d-none')
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$('#title_int_plana').html('<?= lang("Presupuestos.compInteriorPlana") ?>');
|
||||||
|
$('#insertarPlanaBtn').addClass('d-none')
|
||||||
|
$('#total_comp_plana').html('0.00');
|
||||||
|
}
|
||||||
|
yeniden(data.<?= csrf_token() ?>);
|
||||||
|
return true;
|
||||||
|
},
|
||||||
|
error: function(e){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
async function getLineasIntRot(is_hq){
|
||||||
|
|
||||||
|
const dimension = getDimensionLibro();
|
||||||
|
|
||||||
|
// Rotativa solo negro o color (no hq)
|
||||||
|
if ( is_hq==false){
|
||||||
|
|
||||||
|
if(checkInputsForRotativa()){
|
||||||
|
|
||||||
|
let datos = {
|
||||||
|
type: 'interior_rot',
|
||||||
|
paginas: parseInt($('#paginas').val()),
|
||||||
|
paginas_negro: parseInt($('#compPaginasNegro').val()),
|
||||||
|
paginas_color: parseInt($('#compPaginasColor').val()),
|
||||||
|
tirada: parseInt($('#tirada').val()),
|
||||||
|
merma: parseInt($('#merma').val()),
|
||||||
|
ancho: dimension.ancho,
|
||||||
|
alto: dimension.alto,
|
||||||
|
// el papel y el gramaje se coge del negro (siempre estará)
|
||||||
|
papel_generico_id: $('#compPapelNegro').select2('data')[0].id,
|
||||||
|
papel_generico: $('#compPapelNegro').select2('data')[0].text.trim(),
|
||||||
|
gramaje: $('#compGramajeNegro').select2('data')[0].text.trim() ,
|
||||||
|
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
|
||||||
|
};
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
type: "POST",
|
||||||
|
url: "/cosidotapablanda/datatable",
|
||||||
|
data: datos,
|
||||||
|
success: function (data) {
|
||||||
|
|
||||||
|
clearIntRot();
|
||||||
|
|
||||||
|
if(data.lineas.length >0){
|
||||||
|
|
||||||
|
fillIntRot(data);
|
||||||
|
selectIntRotLineas();
|
||||||
|
$('#title_int_rot').html('<?= lang("Presupuestos.compInteriorRotativa") ?>' + ' (' + tableCompIntRotativa.rows().count() + ')');
|
||||||
|
$('#insertarRotativaBtn').removeClass('d-none')
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$('#title_int_rot').html('<?= lang("Presupuestos.compInteriorRotativa") ?>');
|
||||||
|
$('#insertarRotativaBtn').addClass('d-none')
|
||||||
|
$('#total_comp_rot').html('0.00')
|
||||||
|
|
||||||
|
}
|
||||||
|
yeniden(data.<?= csrf_token() ?>);
|
||||||
|
return true;
|
||||||
|
},
|
||||||
|
error: function(e){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$('.comp_cubierta_items').on('change', function (){
|
||||||
|
|
||||||
|
if ($('#compCarasCubierta').select2('data').length > 0 &&
|
||||||
|
$('#compPapelCubierta').select2('data').length > 0 &&
|
||||||
|
$('#compGramajeCubierta').select2('data').length > 0 ){
|
||||||
|
|
||||||
|
const dimension = getDimensionLibro();
|
||||||
|
|
||||||
|
let datos = {
|
||||||
|
type: 'cubierta',
|
||||||
|
paginas: parseInt($('#compCarasCubierta').select2('data')[0].id),
|
||||||
|
tirada: parseInt($('#tirada').val()),
|
||||||
|
merma: parseInt($('#mermacubierta').val()),
|
||||||
|
color: 1,
|
||||||
|
ancho: dimension.ancho,
|
||||||
|
alto: dimension.alto,
|
||||||
|
solapas: $('#solapas').is(':checked')?1:0,
|
||||||
|
solapas_ancho: parseInt($('#solapas_ancho').val()),
|
||||||
|
papel_generico_id: $('#compPapelCubierta').select2('data')[0].id,
|
||||||
|
papel_generico: $('#compPapelCubierta').select2('data')[0].text.trim(),
|
||||||
|
gramaje: $('#compGramajeCubierta').select2('data')[0].text.trim() ,
|
||||||
|
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
|
||||||
|
};
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
type: "POST",
|
||||||
|
url: "/cosidotapablanda/datatable",
|
||||||
|
data: datos,
|
||||||
|
success: function (data) {
|
||||||
|
|
||||||
|
clearCubierta();
|
||||||
|
|
||||||
|
if(data.lineas.length >0){
|
||||||
|
|
||||||
|
fillCubierta(data);
|
||||||
|
selectCubiertaLineas();
|
||||||
|
$('#title_cubierta').html('<?= lang("Presupuestos.cubierta") ?>' + ' (' + tableCompCubierta.rows().count() + ')');
|
||||||
|
$('#insertarCubiertaBtn').removeClass('d-none')
|
||||||
|
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$('#title_cubierta').html('<?= lang("Presupuestos.cubierta") ?>');
|
||||||
|
$('#insertarCubiertaBtn').addClass('d-none')
|
||||||
|
$('#total_comp_cubierta').html('0.00')
|
||||||
|
|
||||||
|
}
|
||||||
|
yeniden(data.<?= csrf_token() ?>);
|
||||||
|
return true;
|
||||||
|
},
|
||||||
|
error: function(e){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
else{
|
||||||
|
clearCubierta();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
$('#tipoImpresion').on("change", function () {
|
||||||
|
updatePapelesComparador();
|
||||||
|
|
||||||
|
$('#title_int_rot').html('<?= lang("Presupuestos.compInteriorRotativa") ?>');
|
||||||
|
$('#title_int_plana').html('<?= lang("Presupuestos.compInteriorPlana") ?>');
|
||||||
|
$('#paginas').change();
|
||||||
|
|
||||||
|
$('#tableCompIntRotativa').DataTable().clear().draw();
|
||||||
|
$('#total_comp_rot').html("0.00");
|
||||||
|
|
||||||
|
$('#tableCompIntPlana').DataTable().clear().draw();
|
||||||
|
$('#total_comp_plana').html("0.00");
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
$('.comp_negro_items').on('change', function (e) {
|
||||||
|
|
||||||
|
checkComparadorInt(false,false);
|
||||||
|
});
|
||||||
|
|
||||||
|
$('.comp_negrohq_items').on('change', function (e) {
|
||||||
|
|
||||||
|
checkComparadorInt(false, true);
|
||||||
|
});
|
||||||
|
|
||||||
|
$('.comp_color_items').on('change', function (e) {
|
||||||
|
|
||||||
|
checkComparadorInt(true, false);
|
||||||
|
});
|
||||||
|
|
||||||
|
$('.comp_colorhq_items').on('change', function (e) {
|
||||||
|
checkComparadorInt(true, true);
|
||||||
|
});
|
||||||
|
|
||||||
|
async function getLineasIntPlana(is_color, is_hq){
|
||||||
|
|
||||||
|
const dimension = getDimensionLibro();
|
||||||
|
|
||||||
|
let datos = {
|
||||||
|
type: 'interior',
|
||||||
|
color: is_color?1:0,
|
||||||
|
hq: is_hq?1:0,
|
||||||
|
paginas: parseInt($(''+ elementos.paginas).val()),
|
||||||
|
tirada: parseInt($('#tirada').val()),
|
||||||
|
merma: parseInt($('#merma').val()),
|
||||||
|
ancho: dimension.ancho,
|
||||||
|
alto: dimension.alto,
|
||||||
|
papel_generico_id: $(''+ elementos.papel).select2('data')[0].id,
|
||||||
|
papel_generico: $(''+ elementos.papel).select2('data')[0].text.trim(),
|
||||||
|
gramaje: $(''+ elementos.gramaje).select2('data')[0].text.trim() ,
|
||||||
|
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
|
||||||
|
};
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
type: "POST",
|
||||||
|
url: "/cosidotapablanda/datatable",
|
||||||
|
data: datos,
|
||||||
|
success: function (data) {
|
||||||
|
|
||||||
|
clearIntLineas(is_color);
|
||||||
|
|
||||||
|
if(data.lineas.length >0){
|
||||||
|
|
||||||
|
fillIntPlana(data, is_color, is_hq);
|
||||||
|
selectIntLineas();
|
||||||
|
$('#title_int_plana').html('<?= lang("Presupuestos.compInteriorPlana") ?>' + ' (' + tableCompIntPlana.rows().count() + ')');
|
||||||
|
$('#insertarPlanaBtn').removeClass('d-none')
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$('#title_int_plana').html('<?= lang("Presupuestos.compInteriorPlana") ?>');
|
||||||
|
$('#insertarPlanaBtn').addClass('d-none')
|
||||||
|
$('#total_comp_plana').html('0.00');
|
||||||
|
}
|
||||||
|
yeniden(data.<?= csrf_token() ?>);
|
||||||
|
return true;
|
||||||
|
},
|
||||||
|
error: function(e){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
async function getLineasIntRot(is_hq){
|
||||||
|
|
||||||
|
const dimension = getDimensionLibro();
|
||||||
|
|
||||||
|
// Rotativa solo negro o color (no hq)
|
||||||
|
if ( is_hq==false){
|
||||||
|
|
||||||
|
if(checkInputsForRotativa()){
|
||||||
|
|
||||||
|
let datos = {
|
||||||
|
type: 'interior_rot',
|
||||||
|
paginas: parseInt($('#paginas').val()),
|
||||||
|
paginas_negro: parseInt($('#compPaginasNegro').val()),
|
||||||
|
paginas_color: parseInt($('#compPaginasColor').val()),
|
||||||
|
tirada: parseInt($('#tirada').val()),
|
||||||
|
merma: parseInt($('#merma').val()),
|
||||||
|
ancho: dimension.ancho,
|
||||||
|
alto: dimension.alto,
|
||||||
|
// el papel y el gramaje se coge del negro (siempre estará)
|
||||||
|
papel_generico_id: $('#compPapelNegro').select2('data')[0].id,
|
||||||
|
papel_generico: $('#compPapelNegro').select2('data')[0].text.trim(),
|
||||||
|
gramaje: $('#compGramajeNegro').select2('data')[0].text.trim() ,
|
||||||
|
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
|
||||||
|
};
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
type: "POST",
|
||||||
|
url: "/cosidotapablanda/datatable",
|
||||||
|
data: datos,
|
||||||
|
success: function (data) {
|
||||||
|
|
||||||
|
clearIntRot();
|
||||||
|
|
||||||
|
if(data.lineas.length >0){
|
||||||
|
|
||||||
|
fillIntRot(data);
|
||||||
|
selectIntRotLineas();
|
||||||
|
$('#title_int_rot').html('<?= lang("Presupuestos.compInteriorRotativa") ?>' + ' (' + tableCompIntRotativa.rows().count() + ')');
|
||||||
|
$('#insertarRotativaBtn').removeClass('d-none')
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$('#title_int_rot').html('<?= lang("Presupuestos.compInteriorRotativa") ?>');
|
||||||
|
$('#insertarRotativaBtn').addClass('d-none')
|
||||||
|
$('#total_comp_rot').html('0.00')
|
||||||
|
|
||||||
|
}
|
||||||
|
yeniden(data.<?= csrf_token() ?>);
|
||||||
|
return true;
|
||||||
|
},
|
||||||
|
error: function(e){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$('.comp_cubierta_items').on('change', function (){
|
||||||
|
|
||||||
|
if ($('#compCarasCubierta').select2('data').length > 0 &&
|
||||||
|
$('#compPapelCubierta').select2('data').length > 0 &&
|
||||||
|
$('#compGramajeCubierta').select2('data').length > 0 ){
|
||||||
|
|
||||||
|
const dimension = getDimensionLibro();
|
||||||
|
|
||||||
|
let datos = {
|
||||||
|
type: 'cubierta',
|
||||||
|
paginas: parseInt($('#compCarasCubierta').select2('data')[0].id),
|
||||||
|
tirada: parseInt($('#tirada').val()),
|
||||||
|
merma: parseInt($('#mermacubierta').val()),
|
||||||
|
color: 1,
|
||||||
|
ancho: dimension.ancho,
|
||||||
|
alto: dimension.alto,
|
||||||
|
solapas: $('#solapas').is(':checked')?1:0,
|
||||||
|
solapas_ancho: parseInt($('#solapas_ancho').val()),
|
||||||
|
papel_generico_id: $('#compPapelCubierta').select2('data')[0].id,
|
||||||
|
papel_generico: $('#compPapelCubierta').select2('data')[0].text.trim(),
|
||||||
|
gramaje: $('#compGramajeCubierta').select2('data')[0].text.trim() ,
|
||||||
|
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
|
||||||
|
};
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
type: "POST",
|
||||||
|
url: "/cosidotapablanda/datatable",
|
||||||
|
data: datos,
|
||||||
|
success: function (data) {
|
||||||
|
|
||||||
|
clearCubierta();
|
||||||
|
|
||||||
|
if(data.lineas.length >0){
|
||||||
|
|
||||||
|
fillCubierta(data);
|
||||||
|
selectCubiertaLineas();
|
||||||
|
$('#title_cubierta').html('<?= lang("Presupuestos.cubierta") ?>' + ' (' + tableCompCubierta.rows().count() + ')');
|
||||||
|
$('#insertarCubiertaBtn').removeClass('d-none')
|
||||||
|
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$('#title_cubierta').html('<?= lang("Presupuestos.cubierta") ?>');
|
||||||
|
$('#insertarCubiertaBtn').addClass('d-none')
|
||||||
|
$('#total_comp_cubierta').html('0.00')
|
||||||
|
|
||||||
|
}
|
||||||
|
yeniden(data.<?= csrf_token() ?>);
|
||||||
|
return true;
|
||||||
|
},
|
||||||
|
error: function(e){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
else{
|
||||||
|
clearCubierta();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
$('#tipoImpresion').on("change", function () {
|
||||||
|
updatePapelesComparador();
|
||||||
|
$('#title_int_rot').html('<?= lang("Presupuestos.compInteriorRotativa") ?>');
|
||||||
|
$('#title_int_plana').html('<?= lang("Presupuestos.compInteriorPlana") ?>');
|
||||||
|
$('#paginas').change();
|
||||||
|
|
||||||
|
|
||||||
|
if (($('#tipoImpresion').select2('data')[0].id == 'negro' ||
|
||||||
|
$('#tipoImpresion').select2('data')[0].id == 'color')){
|
||||||
|
|
||||||
|
$('#tableCompIntRotativa').DataTable().clear().draw();
|
||||||
|
$('#total_comp_rot').html("0.00");
|
||||||
|
|
||||||
|
if( $('#tableCompIntPlana').DataTable().rows().count() > 0 &&
|
||||||
|
$('#tableCompIntPlana').DataTable().cell(0, 0).data().includes('hq')) {
|
||||||
|
|
||||||
|
$('#tableCompIntPlana').DataTable().clear().draw();
|
||||||
|
$('#total_comp_plana').html("0.00");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
else if (($('#tipoImpresion').select2('data')[0].id == 'negrohq' ||
|
||||||
|
$('#tipoImpresion').select2('data')[0].id == 'colorhq')){
|
||||||
|
|
||||||
|
$('#tableCompIntRotativa').DataTable().clear().draw();
|
||||||
|
$('#total_comp_rot').html("0.00");
|
||||||
|
|
||||||
|
if($('#tableCompIntPlana').DataTable().rows().count() > 0 &&
|
||||||
|
!$('#tableCompIntPlana').DataTable().cell(0, 0).data().includes('hq')) {
|
||||||
|
|
||||||
|
$('#tableCompIntPlana').DataTable().clear().draw();
|
||||||
|
$('#total_comp_plana').html("0.00");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
function checkComparadorInt(is_color, is_hq) {
|
||||||
|
|
||||||
|
clearIntLineas(is_color);
|
||||||
|
clearIntRot();
|
||||||
|
$('#title_int_rot').html('<?= lang("Presupuestos.compInteriorRotativa") ?>');
|
||||||
|
$('#title_int_plana').html('<?= lang("Presupuestos.compInteriorPlana") ?>');
|
||||||
|
|
||||||
|
elementos = getIDsComparador(is_color, is_hq)
|
||||||
|
|
||||||
|
if ($(''+ elementos.papel).select2('data').length > 0 &&
|
||||||
|
$(''+ elementos.gramaje).select2('data').length > 0 &&
|
||||||
|
parseInt($(''+ elementos.paginas).val()) > 0 &&
|
||||||
|
checkDatosPedidoForComp()) {
|
||||||
|
|
||||||
|
getLineasIntPlana(is_color, is_hq).then((result) =>{
|
||||||
|
// Para rotativa, si es color el papel y el gramaje tiene que ser igual
|
||||||
|
if(!is_color)
|
||||||
|
{
|
||||||
|
getLineasIntRot(is_hq);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if(($('#compPapelNegro').select2('data')[0].id == $('#compPapelColor').select2('data')[0].id &&
|
||||||
|
$('#compGramajeNegro').select2('data')[0].text.trim() == $('#compGramajeColor').select2('data')[0].text.trim()))
|
||||||
|
{
|
||||||
|
getLineasIntRot(is_hq);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$('#errorComRot').html('<?= lang("Presupuestos.errores.errorRotColor") ?>');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$('#compPapelNegro').on('select2:select', function (e){
|
||||||
|
|
||||||
|
if($('#compPapelNegro').select2('data')[0].id=='0'){
|
||||||
|
$('#compGramajeNegro').val('').change();
|
||||||
|
$('#compGramajeNegro').prop('disabled', true);
|
||||||
|
}
|
||||||
|
|
||||||
|
else{
|
||||||
|
$('#insertarPlanaBtn').addClass('d-none')
|
||||||
|
$('#insertarRotativaBtn').addClass('d-none')
|
||||||
|
$('#total_comp_plana').html('0.00')
|
||||||
|
$('#total_comp_rot').html('0.00')
|
||||||
|
$('#compGramajeNegro').val('').change();
|
||||||
|
$('#compGramajeNegro').empty().trigger("change");
|
||||||
|
$('#compGramajeNegro').prop('disabled', false);
|
||||||
|
$('#compGramajeNegro').select2({
|
||||||
|
allowClear: false,
|
||||||
|
minimumResultsForSearch: Infinity,
|
||||||
|
ajax: {
|
||||||
|
url: '<?= route_to("menuItemsOfCosidotapablanda") ?>',
|
||||||
|
type: 'post',
|
||||||
|
dataType: 'json',
|
||||||
|
|
||||||
|
data: function (params) {
|
||||||
|
return {
|
||||||
|
tipo: 'gramaje',
|
||||||
|
uso: 'bn',
|
||||||
|
datos: $('#compPapelNegro').select2('data')[0].text.trim() ,
|
||||||
|
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
|
||||||
|
};
|
||||||
|
},
|
||||||
|
delay: 60,
|
||||||
|
processResults: function (response) {
|
||||||
|
yeniden(response.<?= csrf_token() ?>);
|
||||||
|
return {
|
||||||
|
results: response.menu
|
||||||
|
};
|
||||||
|
},
|
||||||
|
cache: true
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#compPapelNegrohq').on('select2:select', function (e){
|
||||||
|
|
||||||
|
if($('#compPapelNegrohq').select2('data')[0].id=='0'){
|
||||||
|
$('#compGramajeNegrohq').val('').change();
|
||||||
|
$('#compGramajeNegrohq').prop('disabled', true);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$('#insertarPlanaBtn').addClass('d-none')
|
||||||
|
$('#insertarRotativaBtn').addClass('d-none')
|
||||||
|
$('#total_comp_plana').html('0.00')
|
||||||
|
$('#total_comp_rot').html('0.00')
|
||||||
|
$('#compGramajeNegrohq').empty().trigger("change");
|
||||||
|
$('#compGramajeNegrohq').prop('disabled', false);
|
||||||
|
$('#compGramajeNegrohq').select2({
|
||||||
|
allowClear: false,
|
||||||
|
minimumResultsForSearch: Infinity,
|
||||||
|
ajax: {
|
||||||
|
url: '<?= route_to("menuItemsOfCosidotapablanda") ?>',
|
||||||
|
type: 'post',
|
||||||
|
dataType: 'json',
|
||||||
|
|
||||||
|
data: function (params) {
|
||||||
|
return {
|
||||||
|
tipo: 'gramaje',
|
||||||
|
uso: 'bnhq',
|
||||||
|
datos: $('#compPapelNegrohq').select2('data')[0].text.trim() ,
|
||||||
|
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
|
||||||
|
};
|
||||||
|
},
|
||||||
|
delay: 60,
|
||||||
|
processResults: function (response) {
|
||||||
|
yeniden(response.<?= csrf_token() ?>);
|
||||||
|
return {
|
||||||
|
results: response.menu
|
||||||
|
};
|
||||||
|
},
|
||||||
|
cache: true
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
$('#compPapelColor').on('select2:select', function (e){
|
||||||
|
|
||||||
|
if($('#compPapelColor').select2('data')[0].id=='0'){
|
||||||
|
$('#compGramajeColor').val('').change();
|
||||||
|
$('#compGramajeColor').prop('disabled', true);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$('#insertarPlanaBtn').addClass('d-none')
|
||||||
|
$('#insertarRotativaBtn').addClass('d-none')
|
||||||
|
$('#total_comp_plana').html('0.00')
|
||||||
|
$('#total_comp_rot').html('0.00')
|
||||||
|
$('#compGramajeColor').empty().trigger("change");
|
||||||
|
$('#compGramajeColor').prop('disabled', false);
|
||||||
|
$('#compPapelColor').find('option[value="0"]').remove();
|
||||||
|
$('#compGramajeColor').select2({
|
||||||
|
allowClear: false,
|
||||||
|
minimumResultsForSearch: Infinity,
|
||||||
|
ajax: {
|
||||||
|
url: '<?= route_to("menuItemsOfCosidotapablanda") ?>',
|
||||||
|
type: 'post',
|
||||||
|
dataType: 'json',
|
||||||
|
|
||||||
|
data: function (params) {
|
||||||
|
return {
|
||||||
|
tipo: 'gramaje',
|
||||||
|
uso: 'color',
|
||||||
|
datos: $('#compPapelColor').select2('data')[0].text.trim() ,
|
||||||
|
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
|
||||||
|
};
|
||||||
|
},
|
||||||
|
delay: 60,
|
||||||
|
processResults: function (response) {
|
||||||
|
yeniden(response.<?= csrf_token() ?>);
|
||||||
|
return {
|
||||||
|
results: response.menu
|
||||||
|
};
|
||||||
|
},
|
||||||
|
cache: true
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
$('#compPapelColorhq').on('select2:select', function (e){
|
||||||
|
|
||||||
|
if($('#compPapelColorhq').select2('data')[0].id=='0'){
|
||||||
|
$('#compGramajeColorhq').val('').change();
|
||||||
|
$('#compGramajeColorhq').prop('disabled', true);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$('#insertarPlanaBtn').addClass('d-none')
|
||||||
|
$('#insertarRotativaBtn').addClass('d-none')
|
||||||
|
$('#total_comp_plana').html('0.00')
|
||||||
|
$('#total_comp_rot').html('0.00')
|
||||||
|
$('#compGramajeColorhq').empty().trigger("change");
|
||||||
|
$('#compGramajeColorhq').prop('disabled', false);
|
||||||
|
$('#compPapelColorhq').find('option[value="0"]').remove();
|
||||||
|
$('#compGramajeColorhq').select2({
|
||||||
|
allowClear: false,
|
||||||
|
minimumResultsForSearch: Infinity,
|
||||||
|
ajax: {
|
||||||
|
url: '<?= route_to("menuItemsOfCosidotapablanda") ?>',
|
||||||
|
type: 'post',
|
||||||
|
dataType: 'json',
|
||||||
|
|
||||||
|
data: function (params) {
|
||||||
|
return {
|
||||||
|
tipo: 'gramaje',
|
||||||
|
uso: 'colorhq',
|
||||||
|
datos: $('#compPapelColorhq').select2('data')[0].text.trim() ,
|
||||||
|
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
|
||||||
|
};
|
||||||
|
},
|
||||||
|
delay: 60,
|
||||||
|
processResults: function (response) {
|
||||||
|
yeniden(response.<?= csrf_token() ?>);
|
||||||
|
return {
|
||||||
|
results: response.menu
|
||||||
|
};
|
||||||
|
},
|
||||||
|
cache: true
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#compPapelCubierta').on('select2:select', function (e){
|
||||||
|
if($('#compPapelCubierta').select2('data')[0].id=='0'){
|
||||||
|
$('#compGramajeCubierta').val('').change();
|
||||||
|
$('#compGramajeCubierta').prop('disabled', true);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$('#insertarCubiertaBtn').addClass('d-none')
|
||||||
|
$('#total_comp_cubierta').html('0.00')
|
||||||
|
$('#compGramajeCubierta').val('').trigger('change');
|
||||||
|
$('#compGramajeCubierta').prop('disabled', false);
|
||||||
|
$('#compPapelCubierta').find('option[value="0"]').remove();
|
||||||
|
$('#compGramajeCubierta').select2({
|
||||||
|
allowClear: false,
|
||||||
|
minimumResultsForSearch: Infinity,
|
||||||
|
ajax: {
|
||||||
|
url: '<?= route_to("menuItemsOfCosidotapablanda") ?>',
|
||||||
|
type: 'post',
|
||||||
|
dataType: 'json',
|
||||||
|
|
||||||
|
data: function (params) {
|
||||||
|
return {
|
||||||
|
tipo: 'gramaje',
|
||||||
|
uso: 'cubierta',
|
||||||
|
datos: $('#compPapelCubierta').select2('data')[0].text.trim() ,
|
||||||
|
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
|
||||||
|
};
|
||||||
|
},
|
||||||
|
delay: 60,
|
||||||
|
processResults: function (response) {
|
||||||
|
yeniden(response.<?= csrf_token() ?>);
|
||||||
|
return {
|
||||||
|
results: response.menu
|
||||||
|
};
|
||||||
|
},
|
||||||
|
cache: true
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
function checkDatosPedidoForComp() {
|
||||||
|
|
||||||
|
const dimension = getDimensionLibro();
|
||||||
|
|
||||||
|
if (parseInt($('#paginas').val()) <= 0){
|
||||||
|
popErrorAlert('<?=lang('Presupuestos.errores.paginas') ?>', 'divAlarmasComparador');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (parseInt($('#tirada').val()) <= 0){
|
||||||
|
popErrorAlert('<?=lang('Presupuestos.errores.tiradas') ?>', 'divAlarmasComparador');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if('ancho' in dimension && 'alto' in dimension){
|
||||||
|
|
||||||
|
if(dimension.alto < 60 || dimension.ancho < 60 || isNaN(dimension.alto) || isNaN(dimension.ancho) ){
|
||||||
|
popErrorAlert('<?=lang('Presupuestos.errores.dimension') ?>', 'divAlarmasComparador');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
popErrorAlert('<?=lang('Presupuestos.errores.dimension') ?>', 'divAlarmasComparador');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
<?= $this->endSection() ?>
|
||||||
@ -34,7 +34,10 @@
|
|||||||
<label for="estadoId" class="form-label">
|
<label for="estadoId" class="form-label">
|
||||||
<?= lang('Presupuestos.presupuestoEstado') ?>
|
<?= lang('Presupuestos.presupuestoEstado') ?>
|
||||||
</label>
|
</label>
|
||||||
<input readonly style="background: #E8E8E8 ;" id="estadoId" name="estado_id" maxLength="12" class="form-control" value="<?= old('estadoId', (isset($presupuestoEntity->estadoId)) ? $presupuestoEntity->estadoId : lang('Presupuestos.presupuestoEstadoBorrador')) ?>">
|
<select id="estadoId" name="estado_id" maxLength="11" class="form-control" value="<?= old(1, $presupuestoEntity->estado_id) ?>">
|
||||||
|
<option value=1><?=lang('Presupuestos.presupuestoEstadoBorrador') ?></option>
|
||||||
|
<option value=2><?=lang('Presupuestos.presupuestoEstadoAceptado') ?></option>
|
||||||
|
</select>
|
||||||
</div><!--//.mb-3 -->
|
</div><!--//.mb-3 -->
|
||||||
</div><!--//.col -->
|
</div><!--//.col -->
|
||||||
|
|
||||||
@ -47,7 +50,7 @@
|
|||||||
<?php if (isset($incReiList) && is_array($incReiList) && !empty($incReiList)) : ?>
|
<?php if (isset($incReiList) && is_array($incReiList) && !empty($incReiList)) : ?>
|
||||||
<option> </option>
|
<option> </option>
|
||||||
<?php foreach ($incReiList as $k => $v) : ?>
|
<?php foreach ($incReiList as $k => $v) : ?>
|
||||||
<option value="<?= $k ?>" <?= $k == $presupuestoEntity->estado_id ? ' selected' : '' ?>>
|
<option value="<?= $k ?>" <?= $k == $presupuestoEntity->inc_rei ? ' selected' : '' ?>>
|
||||||
<?= $v ?>
|
<?= $v ?>
|
||||||
</option>
|
</option>
|
||||||
<?php endforeach;
|
<?php endforeach;
|
||||||
|
|||||||
@ -2678,6 +2678,20 @@ function fill_lp_rot_color(row, fromComparador=false){
|
|||||||
<!-- Código JS para cubierta. -->
|
<!-- Código JS para cubierta. -->
|
||||||
<!------------------------------------------->
|
<!------------------------------------------->
|
||||||
<?= $this->section("additionalInlineJs") ?>
|
<?= $this->section("additionalInlineJs") ?>
|
||||||
|
var tableLineasPresupuesto = new DataTable('#tableLineasPresupuesto',{
|
||||||
|
scrollX: true,
|
||||||
|
searching: false,
|
||||||
|
paging: false,
|
||||||
|
info: false,
|
||||||
|
ordering: false,
|
||||||
|
responsive: true,
|
||||||
|
select: false,
|
||||||
|
language: {
|
||||||
|
url: "//cdn.datatables.net/plug-ins/1.13.4/i18n/<?= config('Basics')->i18n ?>.json"
|
||||||
|
},
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
async function set_lp_cubierta_gramaje(){
|
async function set_lp_cubierta_gramaje(){
|
||||||
|
|
||||||
await $.ajax({
|
await $.ajax({
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user