mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Merge branch 'main' into 'dev/delete-ui'
# Conflicts: # ci4/app/Controllers/Tarifas/Tarifaacabado.php # ci4/app/Views/themes/backend/vuexy/form/configuracion/maquinas/viewMaquinaList.php # ci4/app/Views/themes/backend/vuexy/form/tarifas/acabado/viewTarifaAcabadoList.php # ci4/app/Views/themes/backend/vuexy/form/tarifas/preimpresion/viewTarifapreimpresionList.php
This commit is contained in:
4
ci4/.env
4
ci4/.env
@ -114,9 +114,9 @@ database.default.dump =
|
||||
# SECURITY
|
||||
#--------------------------------------------------------------------
|
||||
|
||||
security.tokenName = 'webguard_token'
|
||||
security.tokenName = 'safekat_token'
|
||||
security.headerName = 'X-CSRF-TOKEN'
|
||||
security.cookieName = 'webguard_cookie'
|
||||
security.cookieName = 'safekat_cookie'
|
||||
security.expires = 7200
|
||||
security.regenerate = true
|
||||
security.redirect = true
|
||||
|
||||
@ -348,8 +348,35 @@ $routes->group('formas-pagos', ['namespace' => 'App\Controllers\Configuracion'],
|
||||
});
|
||||
$routes->resource('formas-pagos', ['namespace' => 'App\Controllers\Configuracion', 'controller' => 'Formaspagos', 'except' => 'show,new,create,update']);
|
||||
|
||||
$routes->group('tarifasencuadernacion', ['namespace' => 'App\Controllers\Tarifas'], function ($routes) {
|
||||
$routes->get('', 'Tarifasencuadernacion::index', ['as' => 'tarifaEncuadernacionList']);
|
||||
$routes->get('add', 'Tarifasencuadernacion::add', ['as' => 'newTarifaEncuadernacion']);
|
||||
$routes->post('add', 'Tarifasencuadernacion::add', ['as' => 'createTarifaEncuadernacion']);
|
||||
$routes->post('create', 'Tarifasencuadernacion::create', ['as' => 'ajaxCreateTarifaEncuadernacion']);
|
||||
$routes->put('(:num)/update', 'Tarifasencuadernacion::update/$1', ['as' => 'ajaxUpdateTarifaEncuadernacion']);
|
||||
$routes->post('edit/(:num)', 'Tarifasencuadernacion::edit/$1', ['as' => 'updateTarifaEncuadernacion']);
|
||||
$routes->get('delete/(:num)', 'Tarifasencuadernacion::delete/$1', ['as' => 'deleteTarifaEncuadernacion']);
|
||||
$routes->post('datatable', 'Tarifasencuadernacion::datatable', ['as' => 'dataTableOfTarifasEncuadernacion']);
|
||||
$routes->post('allmenuitems', 'Tarifasencuadernacion::allItemsSelect', ['as' => 'select2ItemsOfTarifasEncuadernacion']);
|
||||
$routes->post('menuitems', 'Tarifasencuadernacion::menuItems', ['as' => 'menuItemsOfTarifasEncuadernacion']);
|
||||
});
|
||||
$routes->resource('tarifasencuadernacion', ['namespace' => 'App\Controllers\Tarifas', 'controller' => 'Tarifasencuadernacion', 'except' => 'show,new,create,update']);
|
||||
|
||||
|
||||
$routes->group('tarifaencuadernacionlineas', ['namespace' => 'App\Controllers\Tarifas'], function ($routes) {
|
||||
$routes->get('', 'Tarifaencuadernacionlineas::index', ['as' => 'tarifaEncuadernacionLineaList']);
|
||||
$routes->get('add', 'Tarifaencuadernacionlineas::add', ['as' => 'newTarifaEncuadernacionLinea']);
|
||||
$routes->post('add', 'Tarifaencuadernacionlineas::add', ['as' => 'createTarifaEncuadernacionLinea']);
|
||||
$routes->post('create', 'Tarifaencuadernacionlineas::create', ['as' => 'ajaxCreateTarifaEncuadernacionLinea']);
|
||||
$routes->put('(:num)/update', 'Tarifaencuadernacionlineas::update/$1', ['as' => 'ajaxUpdateTarifaEncuadernacionLinea']);
|
||||
$routes->post('(:num)/edit', 'Tarifaencuadernacionlineas::edit/$1', ['as' => 'updateTarifaEncuadernacionLinea']);
|
||||
$routes->post('datatable', 'Tarifaencuadernacionlineas::datatable', ['as' => 'dataTableOfTarifaEncuadernacionLineas']);
|
||||
$routes->post('datatable_editor', 'Tarifaencuadernacionlineas::datatable_editor', ['as' => 'editorOfTarifaEncuadernacionLineas']);
|
||||
$routes->post('allmenuitems', 'Tarifaencuadernacionlineas::allItemsSelect', ['as' => 'select2ItemsOfTarifaEncuadernacionLineas']);
|
||||
$routes->post('menuitems', 'Tarifaencuadernacionlineas::menuItems', ['as' => 'menuItemsOfTarifaEncuadernacionLineas']);
|
||||
});
|
||||
$routes->resource('tarifaencuadernacionlineas', ['namespace' => 'App\Controllers\Tarifas', 'controller' => 'Tarifaencuadernacionlineas', 'except' => 'show,new,create,update']);
|
||||
|
||||
/*
|
||||
* --------------------------------------------------------------------
|
||||
* Additional Routing
|
||||
|
||||
@ -49,7 +49,7 @@ class Cliente extends \App\Controllers\GoBaseResourceController {
|
||||
|
||||
// Breadcrumbs (IMN)
|
||||
$this->viewData['breadcrumb'] = [
|
||||
['title' => lang("App.menu_clientes"), 'route' => "", 'active' => false],
|
||||
['title' => lang("App.menu_clientes"), 'route' => "javascript:void(0);", 'active' => false],
|
||||
['title' => lang("App.menu_cliente"), 'route' => site_url('clientes/cliente'), 'active' => true]
|
||||
];
|
||||
|
||||
|
||||
@ -40,7 +40,7 @@ class Maquinas extends \App\Controllers\GoBaseResourceController {
|
||||
|
||||
// Breadcrumbs (IMN)
|
||||
$this->viewData['breadcrumb'] = [
|
||||
['title' => lang("App.menu_configuration"), 'route' => "", 'active' => false],
|
||||
['title' => lang("App.menu_configuration"), 'route' => "javascript:void(0);", 'active' => false],
|
||||
['title' => lang("App.menu_maquina"), 'route' => site_url('configuracion/maquinas'), 'active' => true]
|
||||
];
|
||||
|
||||
@ -176,12 +176,26 @@ class Maquinas extends \App\Controllers\GoBaseResourceController {
|
||||
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
|
||||
|
||||
if ($this->canValidate()) :
|
||||
try {
|
||||
$successfulResult = $this->model->skipValidation(true)->update($id, $sanitizedData);
|
||||
} catch (\Exception $e) {
|
||||
$noException = false;
|
||||
$this->dealWithException($e);
|
||||
}
|
||||
//JJO: comprobar alto y ancho impresion < alto y ancho
|
||||
if($sanitizedData['alto'] < $sanitizedData['alto_impresion']){
|
||||
$successfulResult = false;
|
||||
$this->viewData['errorMessage'] = lang('Maquinas.validation.alto_menor_alto_impresion');;
|
||||
$this->session->setFlashdata('formErrors', $this->model->errors());
|
||||
}
|
||||
else if ($sanitizedData['ancho'] < $sanitizedData['ancho_impresion']){
|
||||
$successfulResult = false;
|
||||
$this->viewData['errorMessage'] = lang('Maquinas.validation.ancho_menor_ancho_impresion');;
|
||||
$this->session->setFlashdata('formErrors', $this->model->errors());
|
||||
}
|
||||
else{
|
||||
try {
|
||||
$successfulResult = $this->model->skipValidation(true)->update($id, $sanitizedData);
|
||||
} catch (\Exception $e) {
|
||||
$noException = false;
|
||||
$this->dealWithException($e);
|
||||
}
|
||||
}
|
||||
|
||||
else:
|
||||
$this->viewData['warningMessage'] = lang('Basic.global.formErr1', [mb_strtolower(lang('Maquinas.maquina'))]);
|
||||
$this->session->setFlashdata('formErrors', $this->model->errors());
|
||||
@ -190,7 +204,7 @@ class Maquinas extends \App\Controllers\GoBaseResourceController {
|
||||
|
||||
$maquina->fill($sanitizedData);
|
||||
|
||||
$thenRedirect = true;
|
||||
$thenRedirect = false;
|
||||
endif;
|
||||
if ($noException && $successfulResult) :
|
||||
$id = $maquina->id ?? $id;
|
||||
|
||||
@ -255,20 +255,19 @@ if ($this->request->getPost('predeterminado') == null ) {
|
||||
return lang('MaquinasTarifasImpresions.validation.cubierta_sobrecubierta_color');
|
||||
}
|
||||
|
||||
// No se pueden duplicar valores al crear
|
||||
if($action === Editor::ACTION_CREATE){
|
||||
$builder = $this->model->select('*')
|
||||
->where(array(
|
||||
'maquina_id'=> $values['maquina_id'],
|
||||
'tipo'=> $values['tipo'],
|
||||
'uso'=> $values['uso'],
|
||||
'is_deleted'=> 0));
|
||||
$builder = $this->model->select('*')
|
||||
->where(array(
|
||||
'maquina_id'=> $values['maquina_id'],
|
||||
'tipo'=> $values['tipo'],
|
||||
'uso'=> $values['uso'],
|
||||
'is_deleted'=> 0));
|
||||
|
||||
if ($builder->countAllResults() >= 1){
|
||||
if(($action === Editor::ACTION_EDIT && $builder->get()->getFirstRow()->id != $pkey)
|
||||
|| $action === Editor::ACTION_CREATE)
|
||||
return lang('MaquinasTarifasImpresions.validation.duplicated_uso_tipo');
|
||||
|
||||
// No se pueden duplicar valores al crear o al editar
|
||||
if ($builder->countAllResults() >= 1){
|
||||
if(($action === Editor::ACTION_EDIT && $builder->get()->getFirstRow()->id != $pkey)
|
||||
|| $action === Editor::ACTION_CREATE){
|
||||
|
||||
return lang('MaquinasTarifasImpresions.validation.duplicated_uso_tipo');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -42,7 +42,7 @@ class Papelesgenericos extends \App\Controllers\GoBaseResourceController
|
||||
|
||||
// Breadcrumbs (IMN)
|
||||
$this->viewData['breadcrumb'] = [
|
||||
['title' => lang("App.menu_configuration"), 'route' => "", 'active' => false],
|
||||
['title' => lang("App.menu_configuration"), 'route' => "javascript:void(0);", 'active' => false],
|
||||
['title' => lang("App.menu_papelgenerico"), 'route' => site_url('configuracion/papelesgenericos'), 'active' => true]
|
||||
];
|
||||
|
||||
|
||||
@ -65,7 +65,7 @@ class Papelesimpresion extends \App\Controllers\GoBaseResourceController
|
||||
|
||||
// Breadcrumbs
|
||||
$this->viewData['breadcrumb'] = [
|
||||
['title' => lang("App.menu_configuration"), 'route' => "", 'active' => false],
|
||||
['title' => lang("App.menu_configuration"), 'route' => "javascript:void(0);", 'active' => false],
|
||||
['title' => lang("App.menu_papelimpresion"), 'route' => site_url('configuracion/papelesimpresion'), 'active' => true]
|
||||
];
|
||||
|
||||
|
||||
@ -41,7 +41,7 @@ class Tarifaacabado extends \App\Controllers\GoBaseResourceController
|
||||
|
||||
// Breadcrumbs
|
||||
$this->viewData['breadcrumb'] = [
|
||||
['title' => lang("App.menu_tarifas"), 'route' => "", 'active' => false],
|
||||
['title' => lang("App.menu_tarifas"), 'route' => "javascript:void(0);", 'active' => false],
|
||||
['title' => lang("App.menu_tarifaacabado"), 'route' => site_url('tarifas/tarifaacabado'), 'active' => true]
|
||||
];
|
||||
|
||||
@ -114,13 +114,15 @@ class Tarifaacabado extends \App\Controllers\GoBaseResourceController
|
||||
|
||||
if ($thenRedirect) :
|
||||
if (!empty($this->indexRoute)) :
|
||||
return redirect()->to(site_url('tarifas/tarifaacabado/edit/' . $id))->with('sweet-success', $message);
|
||||
return redirect()->to(site_url('/tarifas/tarifaacabado/edit/' . $id))->with('sweet-success', $message);
|
||||
//return redirect()->to(route_to($this->indexRoute))->with('sweet-success', $message);
|
||||
else:
|
||||
return $this->redirect2listView('sweet-success', $message);
|
||||
endif;
|
||||
else:
|
||||
$this->session->setFlashData('sweet-success', $message);
|
||||
//JJO
|
||||
$this->viewData['successMessage'] = $message;
|
||||
//$this->session->setFlashData('sweet-success', $message);
|
||||
endif;
|
||||
|
||||
endif; // $noException && $successfulResult
|
||||
@ -187,14 +189,14 @@ class Tarifaacabado extends \App\Controllers\GoBaseResourceController
|
||||
|
||||
$tarifaacabadoEntity->fill($sanitizedData);
|
||||
|
||||
$thenRedirect = true;
|
||||
$thenRedirect = false;
|
||||
endif;
|
||||
|
||||
if ($noException && $successfulResult) :
|
||||
$id = $tarifaacabadoEntity->id ?? $id;
|
||||
$message = lang('Basic.global.updateSuccess', [mb_strtolower(lang('Tarifaacabado.tarifaacabado'))]) . '.';
|
||||
$message .= anchor("tarifasacabado/{$id}/edit", lang('Basic.global.continueEditing') . '?');
|
||||
$message = ucfirst(str_replace("'", "\'", $message));
|
||||
//$message .= anchor("tarifasacabado/{$id}/edit", lang('Basic.global.continueEditing') . '?');
|
||||
//$message = ucfirst(str_replace("'", "\'", $message));
|
||||
|
||||
if ($thenRedirect) :
|
||||
if (!empty($this->indexRoute)) :
|
||||
@ -203,7 +205,8 @@ class Tarifaacabado extends \App\Controllers\GoBaseResourceController
|
||||
return $this->redirect2listView('sweet-success', $message);
|
||||
endif;
|
||||
else:
|
||||
$this->session->setFlashData('sweet-success', $message);
|
||||
//JJO
|
||||
$this->viewData['successMessage'] = $message;
|
||||
endif;
|
||||
|
||||
endif; // $noException && $successfulResult
|
||||
|
||||
@ -22,6 +22,8 @@ use
|
||||
DataTables\Editor\Validate,
|
||||
DataTables\Editor\ValidateOptions;
|
||||
|
||||
use function PHPUnit\Framework\isEmpty;
|
||||
|
||||
class Tarifaacabadolineas extends \App\Controllers\GoBaseResourceController {
|
||||
|
||||
protected $modelName = TarifaAcabadoLineaModel::class;
|
||||
@ -248,19 +250,19 @@ class Tarifaacabadolineas extends \App\Controllers\GoBaseResourceController {
|
||||
// Build our Editor instance and process the data coming from _POST
|
||||
$response = Editor::inst( $db, 'tarifa_acabado_lineas' )
|
||||
->fields(
|
||||
Field::inst( 'tirada_min' )
|
||||
Field::inst( 'paginas_min' )
|
||||
->validator( 'Validate::numeric', array(
|
||||
'message' => lang('TarifaAcabadoLineas.validation.tirada_min.decimal') )
|
||||
'message' => lang('TarifaAcabadoLineas.validation.paginas_min.decimal') )
|
||||
)
|
||||
->validator( 'Validate::notEmpty',array(
|
||||
'message' => lang('TarifaAcabadoLineas.validation.tirada_min.required') )
|
||||
'message' => lang('TarifaAcabadoLineas.validation.paginas_min.required') )
|
||||
),
|
||||
Field::inst( 'tirada_max' )
|
||||
Field::inst( 'paginas_max' )
|
||||
->validator( 'Validate::numeric', array(
|
||||
'message' => lang('TarifaAcabadoLineas.validation.tirada_max.decimal') )
|
||||
'message' => lang('TarifaAcabadoLineas.validation.paginas_max.decimal') )
|
||||
)
|
||||
->validator( 'Validate::notEmpty',array(
|
||||
'message' => lang('TarifaAcabadoLineas.validation.tirada_max.required') )
|
||||
'message' => lang('TarifaAcabadoLineas.validation.paginas_max.required') )
|
||||
),
|
||||
Field::inst( 'precio_min' )
|
||||
->validator( 'Validate::numeric', array(
|
||||
@ -276,12 +278,12 @@ class Tarifaacabadolineas extends \App\Controllers\GoBaseResourceController {
|
||||
->validator( 'Validate::notEmpty',array(
|
||||
'message' => lang('TarifaAcabadoLineas.validation.precio_max.required') )
|
||||
),
|
||||
Field::inst( 'precio_unidad' )
|
||||
Field::inst( 'margen' )
|
||||
->validator( 'Validate::numeric', array(
|
||||
'message' => lang('TarifaAcabadoLineas.validation.precio_unidad.decimal') )
|
||||
'message' => lang('TarifaAcabadoLineas.validation.margen.decimal') )
|
||||
)
|
||||
->validator( 'Validate::notEmpty',array(
|
||||
'message' => lang('TarifaAcabadoLineas.validation.precio_unidad.required') )
|
||||
'message' => lang('TarifaAcabadoLineas.validation.margen.required') )
|
||||
),
|
||||
Field::inst( 'tarifa_acabado_id' ),
|
||||
Field::inst( 'user_created_id' ),
|
||||
@ -296,17 +298,14 @@ class Tarifaacabadolineas extends \App\Controllers\GoBaseResourceController {
|
||||
if ($action === Editor::ACTION_CREATE || $action === Editor::ACTION_EDIT){
|
||||
foreach ($data['data'] as $pkey => $values ){
|
||||
// Si no se quiere borrar...
|
||||
if($data['data'][$pkey]['is_deleted'] != 1)
|
||||
{
|
||||
$count = $this->model->select('*')
|
||||
->where(array( 'tarifa_acabado_id'=> $values['tarifa_acabado_id'],
|
||||
'tirada_min'=> $values['tirada_min'],
|
||||
'tirada_max'=> $values['tirada_max'],
|
||||
'is_deleted'=> 0
|
||||
))
|
||||
->countAllResults();
|
||||
if ($count >= 1){
|
||||
return lang('TarifaAcabadoLineas.validation.duplicated_tirada');
|
||||
if($data['data'][$pkey]['is_deleted'] != 1){
|
||||
|
||||
$process_data['paginas_min'] = $data['data'][$pkey]['paginas_min'];
|
||||
$process_data['paginas_max'] = $data['data'][$pkey]['paginas_max'];
|
||||
$response = $this->model->checkIntervals($process_data, $pkey, $data['data'][$pkey]['tarifa_acabado_id']);
|
||||
// No se pueden duplicar valores al crear o al editar
|
||||
if (!empty($response)){
|
||||
return $response;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -338,7 +337,7 @@ class Tarifaacabadolineas extends \App\Controllers\GoBaseResourceController {
|
||||
|
||||
// if unique key is set in DB
|
||||
/*if(isset($response['error'])){
|
||||
if(str_contains($response['error'], "tirada_min_tirada_max") &&
|
||||
if(str_contains($response['error'], "paginas_min_paginas_max") &&
|
||||
str_contains($response['error'], "Duplicate entry ")){
|
||||
$response['error'] = lang('TarifaAcabadoLineas.validation.duplicated_tirada');
|
||||
}
|
||||
|
||||
389
ci4/app/Controllers/Tarifas/Tarifaencuadernacionlineas.php
Normal file
389
ci4/app/Controllers/Tarifas/Tarifaencuadernacionlineas.php
Normal file
@ -0,0 +1,389 @@
|
||||
<?php namespace App\Controllers\Tarifas;
|
||||
|
||||
|
||||
use App\Controllers\GoBaseResourceController;
|
||||
|
||||
use App\Models\Collection;
|
||||
|
||||
use App\Entities\Tarifas\TarifaEncuadernacionLinea;
|
||||
|
||||
use App\Models\Tarifas\TarifaEncuadernacionLineaModel;
|
||||
|
||||
use
|
||||
DataTables\Editor,
|
||||
DataTables\Database,
|
||||
DataTables\Editor\Field,
|
||||
DataTables\Editor\Format,
|
||||
DataTables\Editor\Mjoin,
|
||||
DataTables\Editor\Options,
|
||||
DataTables\Editor\Upload,
|
||||
DataTables\Editor\Validate,
|
||||
DataTables\Editor\ValidateOptions;
|
||||
|
||||
|
||||
class Tarifaencuadernacionlineas extends \App\Controllers\GoBaseResourceController {
|
||||
|
||||
protected $modelName = TarifaEncuadernacionLineaModel::class;
|
||||
protected $format = 'json';
|
||||
|
||||
protected static $singularObjectName = 'Tarifa Encuadernacion Linea';
|
||||
protected static $singularObjectNameCc = 'tarifaEncuadernacionLinea';
|
||||
protected static $pluralObjectName = 'Tarifa Encuadernacion Lineas';
|
||||
protected static $pluralObjectNameCc = 'tarifaEncuadernacionLineas';
|
||||
|
||||
protected static $controllerSlug = 'tarifaencuadernacionlineas';
|
||||
|
||||
protected static $viewPath = 'themes/backend/vuexy/form/tarifas/encuadernacion/';
|
||||
|
||||
protected $indexRoute = 'tarifaEncuadernacionLineaList';
|
||||
|
||||
|
||||
|
||||
public function initController(\CodeIgniter\HTTP\RequestInterface $request, \CodeIgniter\HTTP\ResponseInterface $response, \Psr\Log\LoggerInterface $logger) {
|
||||
$this->viewData['pageTitle'] = lang('TarifaEncuadernacionLineas.moduleTitle');
|
||||
$this->viewData['usingSweetAlert'] = true;
|
||||
parent::initController($request, $response, $logger);
|
||||
}
|
||||
|
||||
|
||||
public function index() {
|
||||
|
||||
$viewData = [
|
||||
'currentModule' => static::$controllerSlug,
|
||||
'pageSubTitle' => lang('Basic.global.ManageAllRecords', [lang('TarifaEncuadernacionLineas.tarifaencuadernacionLinea')]),
|
||||
'tarifaEncuadernacionLinea' => new TarifaEncuadernacionLinea(),
|
||||
'usingServerSideDataTable' => true,
|
||||
|
||||
];
|
||||
|
||||
$viewData = array_merge($this->viewData, $viewData); // merge any possible values from the parent controller class
|
||||
|
||||
return view(static::$viewPath.'viewTarifaEncuadernacionLineaList', $viewData);
|
||||
}
|
||||
|
||||
|
||||
public function add() {
|
||||
|
||||
|
||||
|
||||
$requestMethod = $this->request->getMethod();
|
||||
|
||||
if ($requestMethod === 'post') :
|
||||
|
||||
$nullIfEmpty = true; // !(phpversion() >= '8.1');
|
||||
|
||||
$postData = $this->request->getPost();
|
||||
|
||||
$sanitizedData = $this->sanitized($postData, $nullIfEmpty);
|
||||
|
||||
|
||||
$noException = true;
|
||||
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
|
||||
|
||||
|
||||
if ($this->canValidate()) :
|
||||
try {
|
||||
$successfulResult = $this->model->skipValidation(true)->save($sanitizedData);
|
||||
} catch (\Exception $e) {
|
||||
$noException = false;
|
||||
$this->dealWithException($e);
|
||||
}
|
||||
else:
|
||||
$this->viewData['errorMessage'] = lang('Basic.global.formErr1', [mb_strtolower(lang('TarifaEncuadernacionLineas.tarifaencuadernacionLinea'))]);
|
||||
$this->session->setFlashdata('formErrors', $this->model->errors());
|
||||
endif;
|
||||
|
||||
$thenRedirect = true; // Change this to false if you want your user to stay on the form after submission
|
||||
endif;
|
||||
if ($noException && $successfulResult) :
|
||||
|
||||
$id = $this->model->db->insertID();
|
||||
|
||||
$message = lang('Basic.global.saveSuccess', [mb_strtolower(lang('TarifaEncuadernacionLineas.tarifaencuadernacionLinea'))]).'.';
|
||||
$message .= anchor( "tarifaencuadernacionlineas/{$id}/edit" , lang('Basic.global.continueEditing').'?');
|
||||
$message = ucfirst(str_replace("'", "\'", $message));
|
||||
|
||||
if ($thenRedirect) :
|
||||
if (!empty($this->indexRoute)) :
|
||||
return redirect()->to(route_to($this->indexRoute))->with('sweet-success', $message);
|
||||
else:
|
||||
return $this->redirect2listView('sweet-success', $message);
|
||||
endif;
|
||||
else:
|
||||
$this->session->setFlashData('sweet-success', $message);
|
||||
endif;
|
||||
|
||||
endif; // $noException && $successfulResult
|
||||
|
||||
endif; // ($requestMethod === 'post')
|
||||
|
||||
$this->viewData['tarifaEncuadernacionLinea'] = isset($sanitizedData) ? new TarifaEncuadernacionLinea($sanitizedData) : new TarifaEncuadernacionLinea();
|
||||
|
||||
$this->viewData['formAction'] = route_to('createTarifaEncuadernacionLinea');
|
||||
|
||||
$this->viewData['boxTitle'] = lang('Basic.global.addNew').' '.lang('TarifaEncuadernacionLineas.moduleTitle').' '.lang('Basic.global.addNewSuffix');
|
||||
|
||||
|
||||
return $this->displayForm(__METHOD__);
|
||||
} // end function add()
|
||||
|
||||
public function edit($requestedId = null) {
|
||||
|
||||
if ($requestedId == null) :
|
||||
return $this->redirect2listView();
|
||||
endif;
|
||||
$id = filter_var($requestedId, FILTER_SANITIZE_URL);
|
||||
$tarifaEncuadernacionLinea = $this->model->find($id);
|
||||
|
||||
if ($tarifaEncuadernacionLinea == false) :
|
||||
$message = lang('Basic.global.notFoundWithIdErr', [mb_strtolower(lang('TarifaEncuadernacionLineas.tarifaencuadernacionLinea')), $id]);
|
||||
return $this->redirect2listView('sweet-error', $message);
|
||||
endif;
|
||||
|
||||
$requestMethod = $this->request->getMethod();
|
||||
|
||||
if ($requestMethod === 'post') :
|
||||
|
||||
$nullIfEmpty = true; // !(phpversion() >= '8.1');
|
||||
|
||||
$postData = $this->request->getPost();
|
||||
|
||||
$sanitizedData = $this->sanitized($postData, $nullIfEmpty);
|
||||
|
||||
|
||||
|
||||
$noException = true;
|
||||
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
|
||||
|
||||
|
||||
|
||||
if ($this->canValidate()) :
|
||||
try {
|
||||
$successfulResult = $this->model->skipValidation(true)->update($id, $sanitizedData);
|
||||
} catch (\Exception $e) {
|
||||
$noException = false;
|
||||
$this->dealWithException($e);
|
||||
}
|
||||
else:
|
||||
$this->viewData['warningMessage'] = lang('Basic.global.formErr1', [mb_strtolower(lang('TarifaEncuadernacionLineas.tarifaencuadernacionLinea'))]);
|
||||
$this->session->setFlashdata('formErrors', $this->model->errors());
|
||||
|
||||
endif;
|
||||
|
||||
$tarifaEncuadernacionLinea->fill($sanitizedData);
|
||||
|
||||
$thenRedirect = true;
|
||||
endif;
|
||||
if ($noException && $successfulResult) :
|
||||
$id = $tarifaEncuadernacionLinea->id ?? $id;
|
||||
$message = lang('Basic.global.updateSuccess', [mb_strtolower(lang('TarifaEncuadernacionLineas.tarifaencuadernacionLinea'))]).'.';
|
||||
$message .= anchor( "tarifaencuadernacionlineas/{$id}/edit" , lang('Basic.global.continueEditing').'?');
|
||||
$message = ucfirst(str_replace("'", "\'", $message));
|
||||
|
||||
if ($thenRedirect) :
|
||||
if (!empty($this->indexRoute)) :
|
||||
return redirect()->to(route_to($this->indexRoute))->with('sweet-success', $message);
|
||||
else:
|
||||
return $this->redirect2listView('sweet-success', $message);
|
||||
endif;
|
||||
else:
|
||||
$this->session->setFlashData('sweet-success', $message);
|
||||
endif;
|
||||
|
||||
endif; // $noException && $successfulResult
|
||||
endif; // ($requestMethod === 'post')
|
||||
|
||||
$this->viewData['tarifaEncuadernacionLinea'] = $tarifaEncuadernacionLinea;
|
||||
|
||||
$this->viewData['formAction'] = route_to('updateTarifaEncuadernacionLinea', $id);
|
||||
|
||||
$this->viewData['boxTitle'] = lang('Basic.global.edit2').' '.lang('TarifaEncuadernacionLineas.moduleTitle').' '.lang('Basic.global.edit3');
|
||||
|
||||
|
||||
return $this->displayForm(__METHOD__, $id);
|
||||
} // end function edit(...)
|
||||
|
||||
|
||||
public function datatable_editor() {
|
||||
if ($this->request->isAJAX()) {
|
||||
|
||||
include(APPPATH . "ThirdParty/DatatablesEditor/DataTables.php");
|
||||
|
||||
// Build our Editor instance and process the data coming from _POST
|
||||
$response = Editor::inst( $db, 'tarifa_encuadernacion_lineas' )
|
||||
->fields(
|
||||
Field::inst( 'paginas_min' )
|
||||
->validator( 'Validate::numeric', array(
|
||||
'message' => lang('TarifaAcabadoLineas.validation.paginas_min.decimal') )
|
||||
)
|
||||
->validator( 'Validate::notEmpty',array(
|
||||
'message' => lang('TarifaAcabadoLineas.validation.paginas_min.required') )
|
||||
),
|
||||
Field::inst( 'paginas_max' )
|
||||
->validator( 'Validate::numeric', array(
|
||||
'message' => lang('TarifaAcabadoLineas.validation.paginas_max.decimal') )
|
||||
)
|
||||
->validator( 'Validate::notEmpty',array(
|
||||
'message' => lang('TarifaAcabadoLineas.validation.paginas_max.required') )
|
||||
),
|
||||
Field::inst( 'precio_min' )
|
||||
->validator( 'Validate::numeric', array(
|
||||
'message' => lang('TarifaAcabadoLineas.validation.precio_min.decimal') )
|
||||
)
|
||||
->validator( 'Validate::notEmpty',array(
|
||||
'message' => lang('TarifaAcabadoLineas.validation.precio_min.required') )
|
||||
),
|
||||
Field::inst( 'precio_max' )
|
||||
->validator( 'Validate::numeric', array(
|
||||
'message' => lang('TarifaAcabadoLineas.validation.precio_max.decimal') )
|
||||
)
|
||||
->validator( 'Validate::notEmpty',array(
|
||||
'message' => lang('TarifaAcabadoLineas.validation.precio_max.required') )
|
||||
),
|
||||
Field::inst( 'margen' )
|
||||
->validator( 'Validate::numeric', array(
|
||||
'message' => lang('TarifaAcabadoLineas.validation.margen.decimal') )
|
||||
)
|
||||
->validator( 'Validate::notEmpty',array(
|
||||
'message' => lang('TarifaAcabadoLineas.validation.margen.required') )
|
||||
),
|
||||
Field::inst( 'tarifa_encuadernacion_id' ),
|
||||
Field::inst( 'user_created_id' ),
|
||||
Field::inst( 'created_at' ),
|
||||
Field::inst( 'user_updated_id' ),
|
||||
Field::inst( 'updated_at' ),
|
||||
Field::inst( 'is_deleted' ),
|
||||
Field::inst( 'deleted_at' ),
|
||||
|
||||
)
|
||||
->validator( function($editor, $action, $data){
|
||||
if ($action === Editor::ACTION_CREATE || $action === Editor::ACTION_EDIT){
|
||||
foreach ($data['data'] as $pkey => $values ){
|
||||
// Si no se quiere borrar...
|
||||
if($data['data'][$pkey]['is_deleted'] != 1)
|
||||
{
|
||||
$process_data['paginas_min'] = $data['data'][$pkey]['paginas_min'];
|
||||
$process_data['paginas_max'] = $data['data'][$pkey]['paginas_max'];
|
||||
$response = $this->model->checkIntervals($process_data, $pkey, $data['data'][$pkey]['tarifa_encuadernacion_id']);
|
||||
// No se pueden duplicar valores al crear o al editar
|
||||
if (!empty($response)){
|
||||
return $response;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
->on( 'preCreate', function ( $editor, &$values ) {
|
||||
$session = session();
|
||||
$datetime = (new \CodeIgniter\I18n\Time("now"));
|
||||
$editor
|
||||
->field( 'user_created_id' )
|
||||
->setValue( $session->id_user );
|
||||
$editor
|
||||
->field( 'created_at' )
|
||||
->setValue( $datetime->format('Y-m-d H:i:s') );
|
||||
} )
|
||||
->on( 'preEdit', function ( $editor, &$values ) {
|
||||
$session = session();
|
||||
$datetime = (new \CodeIgniter\I18n\Time("now"));
|
||||
$editor
|
||||
->field( 'user_updated_id' )
|
||||
->setValue( $session->id_user );
|
||||
$editor
|
||||
->field( 'updated_at' )
|
||||
->setValue( $datetime->format('Y-m-d H:i:s') );
|
||||
} )
|
||||
->debug(true)
|
||||
->process( $_POST )
|
||||
->data();
|
||||
|
||||
$newTokenHash = csrf_hash();
|
||||
$csrfTokenName = csrf_token();
|
||||
|
||||
$response[$csrfTokenName] = $newTokenHash;
|
||||
|
||||
echo json_encode($response);
|
||||
|
||||
} else {
|
||||
return $this->failUnauthorized('Invalid request', 403);
|
||||
}
|
||||
}
|
||||
|
||||
public function datatable() {
|
||||
if ($this->request->isAJAX()) {
|
||||
$reqData = $this->request->getPost();
|
||||
if (!isset($reqData['draw']) || !isset($reqData['columns']) ) {
|
||||
$errstr = 'No data available in response to this specific request.';
|
||||
$response = $this->respond(Collection::datatable( [], 0, 0, $errstr ), 400, $errstr);
|
||||
return $response;
|
||||
}
|
||||
$start = $reqData['start'] ?? 0;
|
||||
$length = $reqData['length'] ?? 5;
|
||||
$search = $reqData['search']['value'];
|
||||
$requestedOrder = $reqData['order']['0']['column'] ?? 0;
|
||||
$order = TarifaEncuadernacionLineaModel::SORTABLE[$requestedOrder >= 0 ? $requestedOrder : 0];
|
||||
$dir = $reqData['order']['0']['dir'] ?? 'asc';
|
||||
|
||||
$id_TM = $reqData['id_tarifaencuadernacion'] ?? -1;
|
||||
|
||||
$resourceData = $this->model->getResource("", $id_TM)->orderBy($order, $dir)->limit($length, $start)->get()->getResultObject();
|
||||
|
||||
return $this->respond(Collection::datatable(
|
||||
$resourceData,
|
||||
$this->model->getResource()->countAllResults(),
|
||||
$this->model->getResource($search, $id_TM)->countAllResults()
|
||||
));
|
||||
} else {
|
||||
return $this->failUnauthorized('Invalid request', 403);
|
||||
}
|
||||
}
|
||||
|
||||
public function allItemsSelect() {
|
||||
if ($this->request->isAJAX()) {
|
||||
$onlyActiveOnes = true;
|
||||
$reqVal = $this->request->getPost('val') ?? 'id';
|
||||
$menu = $this->model->getAllForMenu($reqVal.', tarifa_encuadernacion_id', 'tarifa_encuadernacion_id', $onlyActiveOnes, false);
|
||||
$nonItem = new \stdClass;
|
||||
$nonItem->id = '';
|
||||
$nonItem->tarifa_encuadernacion_id = '- '.lang('Basic.global.None').' -';
|
||||
array_unshift($menu , $nonItem);
|
||||
|
||||
$newTokenHash = csrf_hash();
|
||||
$csrfTokenName = csrf_token();
|
||||
$data = [
|
||||
'menu' => $menu,
|
||||
$csrfTokenName => $newTokenHash
|
||||
];
|
||||
return $this->respond($data);
|
||||
} else {
|
||||
return $this->failUnauthorized('Invalid request', 403);
|
||||
}
|
||||
}
|
||||
|
||||
public function menuItems() {
|
||||
if ($this->request->isAJAX()) {
|
||||
$searchStr = goSanitize($this->request->getPost('searchTerm'))[0];
|
||||
$reqId = goSanitize($this->request->getPost('id'))[0];
|
||||
$reqText = goSanitize($this->request->getPost('text'))[0];
|
||||
$onlyActiveOnes = false;
|
||||
$columns2select = [$reqId ?? 'id', $reqText ?? 'tarifa_encuadernacion_id'];
|
||||
$onlyActiveOnes = false;
|
||||
$menu = $this->model->getSelect2MenuItems($columns2select, $columns2select[1], $onlyActiveOnes, $searchStr);
|
||||
$nonItem = new \stdClass;
|
||||
$nonItem->id = '';
|
||||
$nonItem->text = '- '.lang('Basic.global.None').' -';
|
||||
array_unshift($menu , $nonItem);
|
||||
|
||||
$newTokenHash = csrf_hash();
|
||||
$csrfTokenName = csrf_token();
|
||||
$data = [
|
||||
'menu' => $menu,
|
||||
$csrfTokenName => $newTokenHash
|
||||
];
|
||||
return $this->respond($data);
|
||||
} else {
|
||||
return $this->failUnauthorized('Invalid request', 403);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -212,19 +212,19 @@ class Tarifamanipuladolineas extends \App\Controllers\GoBaseResourceController {
|
||||
// Build our Editor instance and process the data coming from _POST
|
||||
$response = Editor::inst( $db, 'tarifa_manipulado_lineas' )
|
||||
->fields(
|
||||
Field::inst( 'tirada_min' )
|
||||
Field::inst( 'paginas_min' )
|
||||
->validator( 'Validate::numeric', array(
|
||||
'message' => lang('TarifaAcabadoLineas.validation.tirada_min.decimal') )
|
||||
'message' => lang('TarifaAcabadoLineas.validation.paginas_min.decimal') )
|
||||
)
|
||||
->validator( 'Validate::notEmpty',array(
|
||||
'message' => lang('TarifaAcabadoLineas.validation.tirada_min.required') )
|
||||
'message' => lang('TarifaAcabadoLineas.validation.paginas_min.required') )
|
||||
),
|
||||
Field::inst( 'tirada_max' )
|
||||
Field::inst( 'paginas_max' )
|
||||
->validator( 'Validate::numeric', array(
|
||||
'message' => lang('TarifaAcabadoLineas.validation.tirada_max.decimal') )
|
||||
'message' => lang('TarifaAcabadoLineas.validation.paginas_max.decimal') )
|
||||
)
|
||||
->validator( 'Validate::notEmpty',array(
|
||||
'message' => lang('TarifaAcabadoLineas.validation.tirada_max.required') )
|
||||
'message' => lang('TarifaAcabadoLineas.validation.paginas_max.required') )
|
||||
),
|
||||
Field::inst( 'precio_min' )
|
||||
->validator( 'Validate::numeric', array(
|
||||
@ -240,12 +240,12 @@ class Tarifamanipuladolineas extends \App\Controllers\GoBaseResourceController {
|
||||
->validator( 'Validate::notEmpty',array(
|
||||
'message' => lang('TarifaAcabadoLineas.validation.precio_max.required') )
|
||||
),
|
||||
Field::inst( 'precio_unidad' )
|
||||
Field::inst( 'margen' )
|
||||
->validator( 'Validate::numeric', array(
|
||||
'message' => lang('TarifaAcabadoLineas.validation.precio_unidad.decimal') )
|
||||
'message' => lang('TarifaAcabadoLineas.validation.margen.decimal') )
|
||||
)
|
||||
->validator( 'Validate::notEmpty',array(
|
||||
'message' => lang('TarifaAcabadoLineas.validation.precio_unidad.required') )
|
||||
'message' => lang('TarifaAcabadoLineas.validation.margen.required') )
|
||||
),
|
||||
Field::inst( 'tarifa_manipulado_id' ),
|
||||
Field::inst( 'user_created_id' ),
|
||||
@ -262,16 +262,12 @@ class Tarifamanipuladolineas extends \App\Controllers\GoBaseResourceController {
|
||||
// Si no se quiere borrar...
|
||||
if($data['data'][$pkey]['is_deleted'] != 1)
|
||||
{
|
||||
|
||||
$count = $this->model->select('*')
|
||||
->where(array(
|
||||
'tarifa_manipulado_id'=> $values['tarifa_manipulado_id'],
|
||||
'tirada_min'=> $values['tirada_min'],
|
||||
'tirada_max'=> $values['tirada_max'],
|
||||
'is_deleted'=> 0))
|
||||
->countAllResults();
|
||||
if ($count >= 1){
|
||||
return lang('TarifaAcabadoLineas.validation.duplicated_tirada');
|
||||
$process_data['paginas_min'] = $data['data'][$pkey]['paginas_min'];
|
||||
$process_data['paginas_max'] = $data['data'][$pkey]['paginas_max'];
|
||||
$response = $this->model->checkIntervals($process_data, $pkey, $data['data'][$pkey]['tarifa_manipulado_id']);
|
||||
// No se pueden duplicar valores al crear o al editar
|
||||
if (!empty($response)){
|
||||
return $response;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -301,14 +297,6 @@ class Tarifamanipuladolineas extends \App\Controllers\GoBaseResourceController {
|
||||
->process( $_POST )
|
||||
->data();
|
||||
|
||||
|
||||
/*// if unique key is set in DB
|
||||
if(isset($response['error'])){
|
||||
if(str_contains($response['error'], "tirada_min_tirada_max") &&
|
||||
str_contains($response['error'], "Duplicate entry ")){
|
||||
$response['error'] = lang('TarifaAcabadoLineas.validation.duplicated_tirada');
|
||||
}
|
||||
}*/
|
||||
$newTokenHash = csrf_hash();
|
||||
$csrfTokenName = csrf_token();
|
||||
|
||||
|
||||
@ -29,7 +29,7 @@ class Tarifapreimpresion extends \App\Controllers\GoBaseController {
|
||||
|
||||
// Breadcrumbs
|
||||
$this->viewData['breadcrumb'] = [
|
||||
['title' => lang("App.menu_tarifas"), 'route' => "", 'active' => false],
|
||||
['title' => lang("App.menu_tarifas"), 'route' => "javascript:void(0);", 'active' => false],
|
||||
['title' => lang("App.menu_tarifapreimpresion"), 'route' => site_url('tarifas/tarifapreimpresion'), 'active' => true]
|
||||
];
|
||||
|
||||
@ -142,9 +142,6 @@ class Tarifapreimpresion extends \App\Controllers\GoBaseController {
|
||||
|
||||
$noException = true;
|
||||
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
|
||||
|
||||
|
||||
|
||||
if ($this->canValidate()) :
|
||||
try {
|
||||
$successfulResult = $this->model->skipValidation(true)->update($id, $sanitizedData);
|
||||
@ -160,13 +157,13 @@ class Tarifapreimpresion extends \App\Controllers\GoBaseController {
|
||||
|
||||
$tarifapreimpresionEntity->fill($sanitizedData);
|
||||
|
||||
$thenRedirect = true;
|
||||
$thenRedirect = false;
|
||||
endif;
|
||||
if ($noException && $successfulResult) :
|
||||
$id = $tarifapreimpresionEntity->id ?? $id;
|
||||
$message = lang('Basic.global.updateSuccess', [mb_strtolower(lang('Tarifapreimpresion.tarifapreimpresion'))]).'.';
|
||||
$message .= anchor(route_to('editTarifapreimpresion', $id), lang('Basic.global.continueEditing').'?');
|
||||
$message = ucfirst(str_replace("'", "\'", $message));
|
||||
//$message .= anchor(route_to('editTarifapreimpresion', $id), lang('Basic.global.continueEditing').'?');
|
||||
//$message = ucfirst(str_replace("'", "\'", $message));
|
||||
|
||||
if ($thenRedirect) :
|
||||
if (!empty($this->indexRoute)) :
|
||||
@ -175,6 +172,7 @@ class Tarifapreimpresion extends \App\Controllers\GoBaseController {
|
||||
return $this->redirect2listView('successMessage', $message);
|
||||
endif;
|
||||
else:
|
||||
//JJO
|
||||
$this->viewData['successMessage'] = $message;
|
||||
endif;
|
||||
|
||||
|
||||
296
ci4/app/Controllers/Tarifas/Tarifasencuadernacion.php
Normal file
296
ci4/app/Controllers/Tarifas/Tarifasencuadernacion.php
Normal file
@ -0,0 +1,296 @@
|
||||
<?php namespace App\Controllers\Tarifas;
|
||||
|
||||
|
||||
use App\Controllers\GoBaseResourceController;
|
||||
|
||||
use App\Models\Collection;
|
||||
|
||||
use App\Entities\Tarifas\TarifaEncuadernacionEntity;
|
||||
|
||||
use App\Models\Tarifas\TarifaEncuadernacionModel;
|
||||
|
||||
class Tarifasencuadernacion extends \App\Controllers\GoBaseResourceController {
|
||||
|
||||
protected $modelName = TarifaEncuadernacionModel::class;
|
||||
protected $format = 'json';
|
||||
|
||||
protected static $singularObjectName = 'Tarifa Encuadernacion';
|
||||
protected static $singularObjectNameCc = 'tarifaEncuadernacion';
|
||||
protected static $pluralObjectName = 'Tarifas Encuadernacion';
|
||||
protected static $pluralObjectNameCc = 'tarifasEncuadernacion';
|
||||
|
||||
protected static $controllerSlug = 'tarifaencuadernacion';
|
||||
|
||||
protected static $viewPath = 'themes/backend/vuexy/form/tarifas/encuadernacion/';
|
||||
|
||||
protected $indexRoute = 'tarifaEncuadernacionList';
|
||||
|
||||
|
||||
|
||||
public function initController(\CodeIgniter\HTTP\RequestInterface $request, \CodeIgniter\HTTP\ResponseInterface $response, \Psr\Log\LoggerInterface $logger) {
|
||||
$this->viewData['pageTitle'] = lang('Tarifaencuadernacion.moduleTitle');
|
||||
$this->viewData['usingSweetAlert'] = true;
|
||||
|
||||
// Se indica que este controlador trabaja con soft_delete
|
||||
$this->soft_delete = true;
|
||||
// Se indica el flag para los ficheros borrados
|
||||
$this->delete_flag = 1;
|
||||
|
||||
$this->viewData = ['usingServerSideDataTable' => true]; // JJO
|
||||
|
||||
// Breadcrumbs
|
||||
$this->viewData['breadcrumb'] = [
|
||||
['title' => lang("App.menu_tarifas"), 'route' => "javascript:void(0);", 'active' => false],
|
||||
['title' => lang("App.menu_tarifaencuadernacion"), 'route' => site_url('tarifas/tarifasencuadernacion'), 'active' => true]
|
||||
];
|
||||
|
||||
parent::initController($request, $response, $logger);
|
||||
}
|
||||
|
||||
|
||||
public function index() {
|
||||
|
||||
$viewData = [
|
||||
'currentModule' => static::$controllerSlug,
|
||||
'pageSubTitle' => lang('Basic.global.ManageAllRecords', [lang('Tarifaencuadernacion.tarifaencuadernacion')]),
|
||||
'tarifaEncuadernacionEntity' => new TarifaEncuadernacionEntity(),
|
||||
'usingServerSideDataTable' => true,
|
||||
|
||||
];
|
||||
|
||||
$viewData = array_merge($this->viewData, $viewData); // merge any possible values from the parent controller class
|
||||
|
||||
return view(static::$viewPath.'viewTarifaEncuadernacionList', $viewData);
|
||||
}
|
||||
|
||||
|
||||
public function add() {
|
||||
|
||||
// JJO
|
||||
$session = session();
|
||||
|
||||
$requestMethod = $this->request->getMethod();
|
||||
|
||||
if ($requestMethod === 'post') :
|
||||
|
||||
$nullIfEmpty = true; // !(phpversion() >= '8.1');
|
||||
|
||||
$postData = $this->request->getPost();
|
||||
|
||||
$sanitizedData = $this->sanitized($postData, $nullIfEmpty);
|
||||
|
||||
// JJO
|
||||
if(isset($this->model->user_updated_id)){
|
||||
$sanitizedData['user_created_id'] = $session->id_user;
|
||||
}
|
||||
|
||||
$noException = true;
|
||||
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
|
||||
|
||||
|
||||
if ($this->canValidate()) :
|
||||
try {
|
||||
$successfulResult = $this->model->skipValidation(true)->save($sanitizedData);
|
||||
} catch (\Exception $e) {
|
||||
$noException = false;
|
||||
$this->dealWithException($e);
|
||||
}
|
||||
else:
|
||||
$this->viewData['errorMessage'] = lang('Basic.global.formErr1', [mb_strtolower(lang('Tarifaencuadernacion.tarifaencuadernacion'))]);
|
||||
$this->session->setFlashdata('formErrors', $this->model->errors());
|
||||
endif;
|
||||
|
||||
$thenRedirect = true; // Change this to false if you want your user to stay on the form after submission
|
||||
endif;
|
||||
if ($noException && $successfulResult) :
|
||||
|
||||
$id = $this->model->db->insertID();
|
||||
|
||||
$message = lang('Basic.global.saveSuccess', [mb_strtolower(lang('Tarifaencuadernacion.tarifaencuadernacion'))]).'.';
|
||||
//$message .= anchor( "tarifaencuadernacion/{$id}/edit" , lang('Basic.global.continueEditing').'?');
|
||||
//$message = ucfirst(str_replace("'", "\'", $message));
|
||||
|
||||
if ($thenRedirect) :
|
||||
if (!empty($this->indexRoute)) :
|
||||
return redirect()->to(site_url('tarifas/tarifasencuadernacion/edit/'.$id))->with('sweet-success', $message);
|
||||
//return redirect()->to(route_to($this->indexRoute))->with('sweet-success', $message);
|
||||
else:
|
||||
return $this->redirect2listView('sweet-success', $message);
|
||||
endif;
|
||||
else:
|
||||
//JJO
|
||||
$this->viewData['successMessage'] = $message;
|
||||
//$this->session->setFlashData('sweet-success', $message);
|
||||
endif;
|
||||
|
||||
endif; // $noException && $successfulResult
|
||||
|
||||
endif; // ($requestMethod === 'post')
|
||||
|
||||
$this->viewData['tarifaEncuadernacionEntity'] = isset($sanitizedData) ? new TarifaEncuadernacionEntity($sanitizedData) : new TarifaEncuadernacionEntity();
|
||||
|
||||
$this->viewData['formAction'] = site_url('tarifas/tarifasencuadernacion/add');//route_to('createTarifaEncuadernacion');
|
||||
|
||||
$this->viewData['boxTitle'] = lang('Basic.global.addNew').' '.lang('Tarifaencuadernacion.moduleTitle').' '.lang('Basic.global.addNewSuffix');
|
||||
|
||||
|
||||
return $this->displayForm(__METHOD__);
|
||||
} // end function add()
|
||||
|
||||
public function edit($requestedId = null) {
|
||||
|
||||
// JJO
|
||||
$session = session();
|
||||
|
||||
if ($requestedId == null) :
|
||||
return $this->redirect2listView();
|
||||
endif;
|
||||
$id = filter_var($requestedId, FILTER_SANITIZE_URL);
|
||||
$tarifaEncuadernacionEntity = $this->model->find($id);
|
||||
|
||||
if ($tarifaEncuadernacionEntity == false) :
|
||||
$message = lang('Basic.global.notFoundWithIdErr', [mb_strtolower(lang('Tarifaencuadernacion.tarifaencuadernacion')), $id]);
|
||||
return $this->redirect2listView('sweet-error', $message);
|
||||
endif;
|
||||
|
||||
$requestMethod = $this->request->getMethod();
|
||||
|
||||
if ($requestMethod === 'post') :
|
||||
|
||||
$nullIfEmpty = true; // !(phpversion() >= '8.1');
|
||||
|
||||
$postData = $this->request->getPost();
|
||||
|
||||
$sanitizedData = $this->sanitized($postData, $nullIfEmpty);
|
||||
|
||||
// JJO
|
||||
if(isset($this->model->user_updated_id)){
|
||||
$sanitizedData['user_updated_id'] = $session->id_user;
|
||||
}
|
||||
|
||||
$noException = true;
|
||||
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
|
||||
if ($this->canValidate()) :
|
||||
try {
|
||||
$successfulResult = $this->model->skipValidation(true)->update($id, $sanitizedData);
|
||||
} catch (\Exception $e) {
|
||||
$noException = false;
|
||||
$this->dealWithException($e);
|
||||
}
|
||||
else:
|
||||
$this->viewData['warningMessage'] = lang('Basic.global.formErr1', [mb_strtolower(lang('Tarifaencuadernacion.tarifaencuadernacion'))]);
|
||||
$this->session->setFlashdata('formErrors', $this->model->errors());
|
||||
|
||||
endif;
|
||||
|
||||
$tarifaEncuadernacionEntity->fill($sanitizedData);
|
||||
|
||||
$thenRedirect = false;
|
||||
endif;
|
||||
if ($noException && $successfulResult) :
|
||||
$id = $tarifaEncuadernacionEntity->id ?? $id;
|
||||
$message = lang('Basic.global.updateSuccess', [mb_strtolower(lang('Tarifaencuadernacion.tarifaencuadernacion'))]).'.';
|
||||
//$message .= anchor( "tarifa ulado/{$id}/edit" , lang('Basic.global.continueEditing').'?');
|
||||
//$message = ucfirst(str_replace("'", "\'", $message));
|
||||
|
||||
if ($thenRedirect) :
|
||||
if (!empty($this->indexRoute)) :
|
||||
return redirect()->to(route_to($this->indexRoute))->with('sweet-success', $message);
|
||||
else:
|
||||
return $this->redirect2listView('sweet-success', $message);
|
||||
endif;
|
||||
else:
|
||||
$this->viewData['successMessage'] = $message;
|
||||
endif;
|
||||
|
||||
endif; // $noException && $successfulResult
|
||||
endif; // ($requestMethod === 'post')
|
||||
|
||||
$this->viewData['tarifaEncuadernacionEntity'] = $tarifaEncuadernacionEntity;
|
||||
|
||||
$this->viewData['formAction'] = route_to('updateTarifaEncuadernacion', $id);
|
||||
|
||||
$this->viewData['boxTitle'] = lang('Basic.global.edit2').' '.lang('Tarifaencuadernacion.moduleTitle').' '.lang('Basic.global.edit3');
|
||||
|
||||
|
||||
return $this->displayForm(__METHOD__, $id);
|
||||
} // end function edit(...)
|
||||
|
||||
|
||||
|
||||
public function datatable() {
|
||||
if ($this->request->isAJAX()) {
|
||||
$reqData = $this->request->getPost();
|
||||
if (!isset($reqData['draw']) || !isset($reqData['columns']) ) {
|
||||
$errstr = 'No data available in response to this specific request.';
|
||||
$response = $this->respond(Collection::datatable( [], 0, 0, $errstr ), 400, $errstr);
|
||||
return $response;
|
||||
}
|
||||
$start = $reqData['start'] ?? 0;
|
||||
$length = $reqData['length'] ?? 5;
|
||||
$search = $reqData['search']['value'];
|
||||
$requestedOrder = $reqData['order']['0']['column'] ?? 1;
|
||||
$order = TarifaEncuadernacionModel::SORTABLE[$requestedOrder >= 0 ? $requestedOrder : 1];
|
||||
$dir = $reqData['order']['0']['dir'] ?? 'asc';
|
||||
|
||||
$resourceData = $this->model->getResource($search)->orderBy($order, $dir)->limit($length, $start)->get()->getResultObject();
|
||||
|
||||
return $this->respond(Collection::datatable(
|
||||
$resourceData,
|
||||
$this->model->getResource()->countAllResults(),
|
||||
$this->model->getResource($search)->countAllResults()
|
||||
));
|
||||
} else {
|
||||
return $this->failUnauthorized('Invalid request', 403);
|
||||
}
|
||||
}
|
||||
|
||||
public function allItemsSelect() {
|
||||
if ($this->request->isAJAX()) {
|
||||
$onlyActiveOnes = true;
|
||||
$reqVal = $this->request->getPost('val') ?? 'id';
|
||||
$menu = $this->model->getAllForMenu($reqVal.', nombre', 'nombre', $onlyActiveOnes, false);
|
||||
$nonItem = new \stdClass;
|
||||
$nonItem->id = '';
|
||||
$nonItem->nombre = '- '.lang('Basic.global.None').' -';
|
||||
array_unshift($menu , $nonItem);
|
||||
|
||||
$newTokenHash = csrf_hash();
|
||||
$csrfTokenName = csrf_token();
|
||||
$data = [
|
||||
'menu' => $menu,
|
||||
$csrfTokenName => $newTokenHash
|
||||
];
|
||||
return $this->respond($data);
|
||||
} else {
|
||||
return $this->failUnauthorized('Invalid request', 403);
|
||||
}
|
||||
}
|
||||
|
||||
public function menuItems() {
|
||||
if ($this->request->isAJAX()) {
|
||||
$searchStr = goSanitize($this->request->getPost('searchTerm'))[0];
|
||||
$reqId = goSanitize($this->request->getPost('id'))[0];
|
||||
$reqText = goSanitize($this->request->getPost('text'))[0];
|
||||
$onlyActiveOnes = false;
|
||||
$columns2select = [$reqId ?? 'id', $reqText ?? 'nombre'];
|
||||
$onlyActiveOnes = false;
|
||||
$menu = $this->model->getSelect2MenuItems($columns2select, $columns2select[1], $onlyActiveOnes, $searchStr);
|
||||
$nonItem = new \stdClass;
|
||||
$nonItem->id = '';
|
||||
$nonItem->text = '- '.lang('Basic.global.None').' -';
|
||||
array_unshift($menu , $nonItem);
|
||||
|
||||
$newTokenHash = csrf_hash();
|
||||
$csrfTokenName = csrf_token();
|
||||
$data = [
|
||||
'menu' => $menu,
|
||||
$csrfTokenName => $newTokenHash
|
||||
];
|
||||
return $this->respond($data);
|
||||
} else {
|
||||
return $this->failUnauthorized('Invalid request', 403);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -40,8 +40,8 @@ class Tarifasmanipulado extends \App\Controllers\GoBaseResourceController {
|
||||
|
||||
// Breadcrumbs
|
||||
$this->viewData['breadcrumb'] = [
|
||||
['title' => lang("App.menu_tarifas"), 'route' => "", 'active' => false],
|
||||
['title' => lang("App.menu_tarifamanipulado"), 'route' => site_url('tarifas/tarifamanipulado'), 'active' => true]
|
||||
['title' => lang("App.menu_tarifas"), 'route' => "javascript:void(0);", 'active' => false],
|
||||
['title' => lang("App.menu_tarifamanipulado"), 'route' => site_url('tarifas/tarifasmanipulado'), 'active' => true]
|
||||
];
|
||||
|
||||
parent::initController($request, $response, $logger);
|
||||
@ -118,7 +118,9 @@ class Tarifasmanipulado extends \App\Controllers\GoBaseResourceController {
|
||||
return $this->redirect2listView('sweet-success', $message);
|
||||
endif;
|
||||
else:
|
||||
$this->session->setFlashData('sweet-success', $message);
|
||||
//JJO
|
||||
$this->viewData['successMessage'] = $message;
|
||||
//$this->session->setFlashData('sweet-success', $message);
|
||||
endif;
|
||||
|
||||
endif; // $noException && $successfulResult
|
||||
@ -127,7 +129,7 @@ class Tarifasmanipulado extends \App\Controllers\GoBaseResourceController {
|
||||
|
||||
$this->viewData['tarifaManipuladoEntity'] = isset($sanitizedData) ? new TarifaManipuladoEntity($sanitizedData) : new TarifaManipuladoEntity();
|
||||
|
||||
$this->viewData['formAction'] = site_url('configuracion/maquinas/add');//route_to('createTarifaManipulado');
|
||||
$this->viewData['formAction'] = site_url('tarifas/tarifasmanipulado/add');//route_to('createTarifaManipulado');
|
||||
|
||||
$this->viewData['boxTitle'] = lang('Basic.global.addNew').' '.lang('Tarifamanipulado.moduleTitle').' '.lang('Basic.global.addNewSuffix');
|
||||
|
||||
@ -183,13 +185,13 @@ class Tarifasmanipulado extends \App\Controllers\GoBaseResourceController {
|
||||
|
||||
$tarifaManipuladoEntity->fill($sanitizedData);
|
||||
|
||||
$thenRedirect = true;
|
||||
$thenRedirect = false;
|
||||
endif;
|
||||
if ($noException && $successfulResult) :
|
||||
$id = $tarifaManipuladoEntity->id ?? $id;
|
||||
$message = lang('Basic.global.updateSuccess', [mb_strtolower(lang('Tarifamanipulado.tarifamanipulado'))]).'.';
|
||||
$message .= anchor( "tarifamanipulado/{$id}/edit" , lang('Basic.global.continueEditing').'?');
|
||||
$message = ucfirst(str_replace("'", "\'", $message));
|
||||
//$message .= anchor( "tarifamanipulado/{$id}/edit" , lang('Basic.global.continueEditing').'?');
|
||||
//$message = ucfirst(str_replace("'", "\'", $message));
|
||||
|
||||
if ($thenRedirect) :
|
||||
if (!empty($this->indexRoute)) :
|
||||
@ -198,7 +200,7 @@ class Tarifasmanipulado extends \App\Controllers\GoBaseResourceController {
|
||||
return $this->redirect2listView('sweet-success', $message);
|
||||
endif;
|
||||
else:
|
||||
$this->session->setFlashData('sweet-success', $message);
|
||||
$this->viewData['successMessage'] = $message;
|
||||
endif;
|
||||
|
||||
endif; // $noException && $successfulResult
|
||||
|
||||
@ -8,11 +8,11 @@ class TarifaAcabadoLinea extends \CodeIgniter\Entity\Entity
|
||||
protected $attributes = [
|
||||
"id" => null,
|
||||
"tarifa_acabado_id" => 0,
|
||||
"tirada_min" => 0,
|
||||
"tirada_max" => 0,
|
||||
"paginas_min" => 0,
|
||||
"paginas_max" => 0,
|
||||
"precio_min" => 0,
|
||||
"precio_max" => 0,
|
||||
"precio_unidad" => 0,
|
||||
"margen" => 0,
|
||||
"user_created_id" => 0,
|
||||
"user_updated_id" => 0,
|
||||
"is_deleted" => 0,
|
||||
@ -25,7 +25,7 @@ class TarifaAcabadoLinea extends \CodeIgniter\Entity\Entity
|
||||
"tirada_max" => "int",
|
||||
"precio_min" => "float",
|
||||
"precio_max" => "float",
|
||||
"precio_unidad" => "float",
|
||||
"margen" => "float",
|
||||
"user_created_id" => "int",
|
||||
"user_updated_id" => "int",
|
||||
"is_deleted" => "int",
|
||||
|
||||
28
ci4/app/Entities/Tarifas/TarifaEncuadernacionEntity.php
Normal file
28
ci4/app/Entities/Tarifas/TarifaEncuadernacionEntity.php
Normal file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entities\Tarifas;
|
||||
|
||||
use CodeIgniter\Entity;
|
||||
|
||||
class TarifaEncuadernacionEntity extends \CodeIgniter\Entity\Entity
|
||||
{
|
||||
protected $attributes = [
|
||||
"id" => null,
|
||||
"nombre" => null,
|
||||
"precio_min" => 0,
|
||||
"importe_fijo" => 0,
|
||||
"user_created_id" => 0,
|
||||
"user_updated_id" => 0,
|
||||
"is_deleted" => 0,
|
||||
"deleted_at" => null,
|
||||
"created_at" => null,
|
||||
"updated_at" => null,
|
||||
];
|
||||
protected $casts = [
|
||||
"precio_min" => "float",
|
||||
"importe_fijo" => "float",
|
||||
"user_created_id" => "int",
|
||||
"user_updated_id" => "int",
|
||||
"is_deleted" => "int",
|
||||
];
|
||||
}
|
||||
33
ci4/app/Entities/Tarifas/TarifaEncuadernacionLinea.php
Normal file
33
ci4/app/Entities/Tarifas/TarifaEncuadernacionLinea.php
Normal file
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
namespace App\Entities\Tarifas;
|
||||
|
||||
use CodeIgniter\Entity;
|
||||
|
||||
class TarifaEncuadernacionLinea extends \CodeIgniter\Entity\Entity
|
||||
{
|
||||
protected $attributes = [
|
||||
"id" => null,
|
||||
"tarifa_encuadernacion_id" => 0,
|
||||
"paginas_min" => 0,
|
||||
"paginas_max" => 0,
|
||||
"precio_min" => 0,
|
||||
"precio_max" => 0,
|
||||
"margen" => 0,
|
||||
"user_created_id" => 0,
|
||||
"user_updated_id" => 0,
|
||||
"is_deleted" => 0,
|
||||
"created_at" => null,
|
||||
"updated_at" => null,
|
||||
];
|
||||
protected $casts = [
|
||||
"tarifa_encuadernacion_id" => "int",
|
||||
"paginas_min" => "float",
|
||||
"paginas_max" => "float",
|
||||
"precio_min" => "float",
|
||||
"precio_max" => "float",
|
||||
"margen" => "float",
|
||||
"user_created_id" => "int",
|
||||
"user_updated_id" => "int",
|
||||
"is_deleted" => "int",
|
||||
];
|
||||
}
|
||||
@ -8,11 +8,11 @@ class TarifaManipuladoLinea extends \CodeIgniter\Entity\Entity
|
||||
protected $attributes = [
|
||||
"id" => null,
|
||||
"tarifa_manipulado_id" => 0,
|
||||
"tirada_min" => 0,
|
||||
"tirada_max" => 0,
|
||||
"paginas_min" => 0,
|
||||
"paginas_max" => 0,
|
||||
"precio_min" => 0,
|
||||
"precio_max" => 0,
|
||||
"precio_unidad" => 0,
|
||||
"margen" => 0,
|
||||
"user_created_id" => 0,
|
||||
"user_updated_id" => 0,
|
||||
"is_deleted" => 0,
|
||||
@ -21,11 +21,11 @@ class TarifaManipuladoLinea extends \CodeIgniter\Entity\Entity
|
||||
];
|
||||
protected $casts = [
|
||||
"tarifa_manipulado_id" => "int",
|
||||
"tirada_min" => "float",
|
||||
"tirada_max" => "float",
|
||||
"paginas_min" => "float",
|
||||
"paginas_max" => "float",
|
||||
"precio_min" => "float",
|
||||
"precio_max" => "float",
|
||||
"precio_unidad" => "float",
|
||||
"margen" => "float",
|
||||
"user_created_id" => "int",
|
||||
"user_updated_id" => "int",
|
||||
"is_deleted" => "int",
|
||||
|
||||
@ -8,9 +8,10 @@ class TarifapreimpresionEntity extends \CodeIgniter\Entity\Entity
|
||||
protected $attributes = [
|
||||
"id" => null,
|
||||
"nombre" => null,
|
||||
"precio" => null,
|
||||
"precio_pagina" => null,
|
||||
"precio_min" => 0,
|
||||
"importe_fijo" => 0,
|
||||
"margen" => 0,
|
||||
"user_created_id" => 1,
|
||||
"user_update_id" => 1,
|
||||
"is_deleted" => 0,
|
||||
@ -19,9 +20,10 @@ class TarifapreimpresionEntity extends \CodeIgniter\Entity\Entity
|
||||
"updated_at" => null,
|
||||
];
|
||||
protected $casts = [
|
||||
"precio" => "float",
|
||||
"precio_pagina" => "float",
|
||||
"precio_min" => "float",
|
||||
"importe_fijo" => "float",
|
||||
"margen" => "float",
|
||||
"user_created_id" => "int",
|
||||
"user_update_id" => "int",
|
||||
"is_deleted" => "int",
|
||||
|
||||
@ -641,6 +641,15 @@ function templateSelect($templates=[],$name='',$type='') {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Devuelve true si los intervalos (a1,a2) (b1,b2) se solapan
|
||||
// https://stackoverflow.com/questions/3269434/whats-the-most-efficient-way-to-test-if-two-ranges-overlap
|
||||
function check_overlap($a1, $a2, $b1, $b2){
|
||||
|
||||
if (max($a2, $b2) - min($a1, $b1) <= ($a2 - $a1) + ($b2 - $b1))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
function version() {
|
||||
return "1.2.1";
|
||||
}
|
||||
@ -752,6 +752,7 @@ return [
|
||||
"menu_tarifas" => "Rates",
|
||||
"menu_tarifapreimpresion" => "Preprinting",
|
||||
"menu_tarifamanipulado" => "Handling",
|
||||
"menu_tarifaencuadernacion" => "Binding",
|
||||
"menu_tarifapapelcompra" => "Paper",
|
||||
"menu_tarifaacabado" => "Finish",
|
||||
"menu_tarifapapeldefecto" => "Default paper",
|
||||
|
||||
@ -5,10 +5,10 @@
|
||||
return [
|
||||
'acabado' => 'finish',
|
||||
'alto' => 'Height',
|
||||
'altoClick' => 'Height Click',
|
||||
'altoImpresion' => 'Height Printing',
|
||||
'altoClick' => 'Click Height',
|
||||
'altoImpresion' => 'Printing Height',
|
||||
'ancho' => 'Width',
|
||||
'anchoImpresion' => 'Width Printing',
|
||||
'anchoImpresion' => 'Printing Width',
|
||||
'createdAt' => 'Created At',
|
||||
'deletedAt' => 'Deleted At',
|
||||
'duracionJornada' => 'Working day duration',
|
||||
@ -42,14 +42,16 @@ return [
|
||||
'velocidad' => 'Speed',
|
||||
'velocidadCorte' => 'Cut speed',
|
||||
'validation' => [
|
||||
'alto_menor_alto_impresion' => '\'Printing Height\' field must be lower than \'Height\'',
|
||||
'ancho_menor_ancho_impresion' => '\'Printing Width\' field must be lower than \'Width\'',
|
||||
'alto' => [
|
||||
'decimal' => 'The {field} field must contain a decimal number.',
|
||||
|
||||
'greater_than' => 'The field {field} must be greater than {param}',
|
||||
],
|
||||
|
||||
'ancho' => [
|
||||
'decimal' => 'The {field} field must contain a decimal number.',
|
||||
|
||||
'greater_than' => 'The field {field} must be greater than {param}',
|
||||
],
|
||||
|
||||
'forzar_num_formas_horizontales_portada' => [
|
||||
@ -65,19 +67,20 @@ return [
|
||||
'alto_click' => [
|
||||
'decimal' => 'The {field} field must contain a decimal number.',
|
||||
'required' => 'The {field} field is required.',
|
||||
'greater_than' => 'The field {field} must be greater than {param}',
|
||||
|
||||
],
|
||||
|
||||
'alto_impresion' => [
|
||||
'decimal' => 'The {field} field must contain a decimal number.',
|
||||
'required' => 'The {field} field is required.',
|
||||
|
||||
'greater_than' => 'The field {field} must be greater than {param}',
|
||||
],
|
||||
|
||||
'ancho_impresion' => [
|
||||
'decimal' => 'The {field} field must contain a decimal number.',
|
||||
'required' => 'The {field} field is required.',
|
||||
|
||||
'greater_than' => 'The field {field} must be greater than {param}',
|
||||
],
|
||||
|
||||
'duracion_jornada' => [
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
|
||||
|
||||
return [
|
||||
'papel_impresion_maquinas' => 'Printing papers',
|
||||
'activo' => 'Active',
|
||||
'gramaje_duplicado' => 'It can not be selected two pieces of paper with the same grammage',
|
||||
'sureToChangeRotativaTitle' => 'Are you sure to change this option?',
|
||||
|
||||
@ -9,10 +9,12 @@ return [
|
||||
'precioMax' => 'Max Price',
|
||||
'precioMin' => 'Min Price',
|
||||
'precioUnidad' => 'Price Unit',
|
||||
'tiradaMax' => 'Print Max',
|
||||
'tiradaMin' => 'Print Min',
|
||||
'paginasMax' => 'Max Pages',
|
||||
'paginasMin' => 'Min Pages',
|
||||
'margen' => 'Margin',
|
||||
'validation' => [
|
||||
'duplicated_tirada' => "Duplicated line (the couple 'Print Min' and 'Print Max' must be unique)",
|
||||
'error_paginas_overlap' => 'The range [Min Pages, Max Pages] is overlapped with another one for the selected type.',
|
||||
'error_paginas_range' => 'The field Min Pages must be lower than the field Max Pages',
|
||||
'precio_max' => [
|
||||
'decimal' => 'The field must contain a decimal number.',
|
||||
'required' => 'The field is required.',
|
||||
@ -25,24 +27,24 @@ return [
|
||||
|
||||
],
|
||||
|
||||
'precio_unidad' => [
|
||||
'decimal' => 'The field must contain a decimal number.',
|
||||
'required' => 'The field is required.',
|
||||
|
||||
],
|
||||
|
||||
'tirada_max' => [
|
||||
'paginas_max' => [
|
||||
'integer' => 'The field must contain an integer.',
|
||||
'required' => 'The field is required.',
|
||||
|
||||
],
|
||||
|
||||
'tirada_min' => [
|
||||
'paginas_min' => [
|
||||
'integer' => 'The field must contain an integer.',
|
||||
'required' => 'The field is required.',
|
||||
|
||||
],
|
||||
|
||||
'margen' => [
|
||||
'integer' => 'The field must contain a decimal number.',
|
||||
'required' => 'The field is required.',
|
||||
|
||||
],
|
||||
|
||||
|
||||
|
||||
],
|
||||
|
||||
50
ci4/app/Language/en/TarifaEncuadernacionLineas.php
Normal file
50
ci4/app/Language/en/TarifaEncuadernacionLineas.php
Normal file
@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
|
||||
|
||||
return [
|
||||
'id' => 'ID',
|
||||
'moduleTitle' => 'Binding rates Lines',
|
||||
'deleteLine' => 'the selected register',
|
||||
'precioMax' => 'Max Price',
|
||||
'precioMin' => 'Min Price',
|
||||
'precioUnidad' => 'Price Unit',
|
||||
'paginasMax' => 'Max Pages',
|
||||
'paginasMin' => 'Min Pages',
|
||||
'margen' => 'Margin',
|
||||
'validation' => [
|
||||
'error_paginas_overlap' => 'The range [Min Pages, Max Pages] is overlapped with another one for the selected type.',
|
||||
'error_paginas_range' => 'The field Min Pages must be lower than the field Max Pages',
|
||||
'precio_max' => [
|
||||
'decimal' => 'The {field} field must contain a decimal number.',
|
||||
'required' => 'The {field} field is required.',
|
||||
|
||||
],
|
||||
|
||||
'precio_min' => [
|
||||
'decimal' => 'The {field} field must contain a decimal number.',
|
||||
'required' => 'The {field} field is required.',
|
||||
|
||||
],
|
||||
|
||||
'paginas_max' => [
|
||||
'decimal' => 'The {field} field must contain a decimal number.',
|
||||
'required' => 'The {field} field is required.',
|
||||
|
||||
],
|
||||
|
||||
'paginas_min' => [
|
||||
'decimal' => 'The {field} field must contain a decimal number.',
|
||||
'required' => 'The {field} field is required.',
|
||||
|
||||
],
|
||||
'margen' => [
|
||||
'integer' => 'The field must contain a decimal number.',
|
||||
'required' => 'The field is required.',
|
||||
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
|
||||
];
|
||||
@ -9,9 +9,12 @@ return [
|
||||
'precioMax' => 'Max Price',
|
||||
'precioMin' => 'Min Price',
|
||||
'precioUnidad' => 'Price Unit',
|
||||
'tiradaMax' => 'Print Max',
|
||||
'tiradaMin' => 'Print Min',
|
||||
'paginasMax' => 'Max Pages',
|
||||
'paginasMin' => 'Min Pages',
|
||||
'margen' => 'Margin',
|
||||
'validation' => [
|
||||
'error_paginas_overlap' => 'The range [Min Pages, Max Pages] is overlapped with another one for the selected type.',
|
||||
'error_paginas_range' => 'The field Min Pages must be lower than the field Max Pages',
|
||||
'precio_max' => [
|
||||
'decimal' => 'The {field} field must contain a decimal number.',
|
||||
'required' => 'The {field} field is required.',
|
||||
@ -24,25 +27,23 @@ return [
|
||||
|
||||
],
|
||||
|
||||
'precio_unidad' => [
|
||||
'paginas_max' => [
|
||||
'decimal' => 'The {field} field must contain a decimal number.',
|
||||
'required' => 'The {field} field is required.',
|
||||
|
||||
],
|
||||
|
||||
'tirada_max' => [
|
||||
'paginas_min' => [
|
||||
'decimal' => 'The {field} field must contain a decimal number.',
|
||||
'required' => 'The {field} field is required.',
|
||||
|
||||
],
|
||||
|
||||
'tirada_min' => [
|
||||
'decimal' => 'The {field} field must contain a decimal number.',
|
||||
'required' => 'The {field} field is required.',
|
||||
'margen' => [
|
||||
'integer' => 'The field must contain a decimal number.',
|
||||
'required' => 'The field is required.',
|
||||
|
||||
],
|
||||
|
||||
|
||||
],
|
||||
|
||||
|
||||
|
||||
@ -12,6 +12,9 @@ return [
|
||||
'nombre' => 'Name',
|
||||
'precioMax' => 'Price Max',
|
||||
'precioMin' => 'Price Min',
|
||||
'precioMin' => 'Min Price',
|
||||
'importeFijo' => 'Fixed amount',
|
||||
'margen' => 'Margin',
|
||||
'tarifaacabado' => 'Finishing Rates',
|
||||
'tarifaacabadoList' => 'Finishing Rates List',
|
||||
'tarifasacabado' => 'Finishing Rates',
|
||||
|
||||
92
ci4/app/Language/en/Tarifaencuadernacion.php
Normal file
92
ci4/app/Language/en/Tarifaencuadernacion.php
Normal file
@ -0,0 +1,92 @@
|
||||
<?php
|
||||
|
||||
|
||||
|
||||
return [
|
||||
'ajuste' => 'Adjustment',
|
||||
'ajusteTotalPedido' => 'Order Total Adjustment',
|
||||
'createdAt' => 'Created At',
|
||||
'deletedAt' => 'Deleted At',
|
||||
'formulaPrice' => 'Formula Price',
|
||||
'id' => 'ID',
|
||||
'moduleTitle' => 'Binding rates',
|
||||
'nombre' => 'Name',
|
||||
'precioMax' => 'Price Max',
|
||||
'precioMin' => 'Price Min',
|
||||
'precioMin' => 'Min Price',
|
||||
'importeFijo' => 'Fixed amount',
|
||||
'margen' => 'Margin',
|
||||
'tarifaencuadernacion' => 'Binding rate',
|
||||
'tarifaencuadernacionList' => 'Binding rates List',
|
||||
'tarifasencuadernacion' => 'Binding rates',
|
||||
'tiradaMax' => 'Print Max',
|
||||
'tiradaMin' => 'Print Min',
|
||||
'updatedAt' => 'Updated At',
|
||||
'userCreatedId' => 'User Created ID',
|
||||
'userUpdateId' => 'User Update ID',
|
||||
'validation' => [
|
||||
'ajuste' => [
|
||||
'decimal' => 'The {field} field must contain a decimal number.',
|
||||
'required' => 'The {field} field is required.',
|
||||
|
||||
],
|
||||
|
||||
'ajuste_total_pedido' => [
|
||||
'decimal' => 'The {field} field must contain a decimal number.',
|
||||
'required' => 'The {field} field is required.',
|
||||
|
||||
],
|
||||
|
||||
'formula_price' => [
|
||||
'max_length' => 'The {field} field cannot exceed {param} characters in length.',
|
||||
'required' => 'The {field} field is required.',
|
||||
|
||||
],
|
||||
|
||||
'nombre' => [
|
||||
'max_length' => 'The {field} field cannot exceed {param} characters in length.',
|
||||
'required' => 'The {field} field is required.',
|
||||
|
||||
],
|
||||
|
||||
'precio_max' => [
|
||||
'decimal' => 'The {field} field must contain a decimal number.',
|
||||
'required' => 'The {field} field is required.',
|
||||
|
||||
],
|
||||
|
||||
'precio_min' => [
|
||||
'decimal' => 'The {field} field must contain a decimal number.',
|
||||
'required' => 'The {field} field is required.',
|
||||
|
||||
],
|
||||
|
||||
'tirada_max' => [
|
||||
'integer' => 'The {field} field must contain an integer.',
|
||||
'required' => 'The {field} field is required.',
|
||||
|
||||
],
|
||||
|
||||
'tirada_min' => [
|
||||
'integer' => 'The {field} field must contain an integer.',
|
||||
'required' => 'The {field} field is required.',
|
||||
|
||||
],
|
||||
|
||||
'user_created_id' => [
|
||||
'integer' => 'The {field} field must contain an integer.',
|
||||
'required' => 'The {field} field is required.',
|
||||
|
||||
],
|
||||
|
||||
'user_updated_id' => [
|
||||
'integer' => 'The {field} field must contain an integer.',
|
||||
'required' => 'The {field} field is required.',
|
||||
|
||||
],
|
||||
|
||||
|
||||
],
|
||||
|
||||
|
||||
];
|
||||
@ -13,6 +13,9 @@ return [
|
||||
'nombre' => 'Name',
|
||||
'precioMax' => 'Price Max',
|
||||
'precioMin' => 'Price Min',
|
||||
'precioMin' => 'Min Price',
|
||||
'importeFijo' => 'Fixed amount',
|
||||
'margen' => 'Margin',
|
||||
'tarifamanipulado' => 'Handling rate',
|
||||
'tarifamanipuladoList' => 'Handling rates List',
|
||||
'tarifasmanipulado' => 'Handling rates',
|
||||
|
||||
@ -8,7 +8,10 @@ return [
|
||||
'id' => 'ID',
|
||||
'moduleTitle' => 'Preprinting rates',
|
||||
'nombre' => 'Name',
|
||||
'precio' => 'Price',
|
||||
'precio' => 'Price per page',
|
||||
'precioMin' => 'Min Price',
|
||||
'importeFijo' => 'Fixed amount',
|
||||
'margen' => 'Margin',
|
||||
'tarifapreimpresion' => 'Preprinting rate',
|
||||
'tarifapreimpresionList' => 'Preprinting rates List',
|
||||
'tarifaspreimpresion' => 'Preprinting rates',
|
||||
|
||||
@ -759,11 +759,13 @@ return [
|
||||
"menu_tarifas" => "Tarifas",
|
||||
"menu_tarifapreimpresion" => "Preimpresión",
|
||||
"menu_tarifamanipulado" => "Manipulado",
|
||||
"menu_tarifaencuadernacion" => "Encuadernación",
|
||||
"menu_tarifapapelcompra" => "Papel compra",
|
||||
"menu_tarifaacabado" => "Acabado",
|
||||
"menu_tarifapapeldefecto" => "Papel defecto",
|
||||
"menu_tarifaenvio" => "Envío",
|
||||
"menu_tarifaimpresion" => "Impresión",
|
||||
"menu_encuadernacion" => "Encuadernación",
|
||||
|
||||
"menu_users" => "Usuarios",
|
||||
"menu_permission_group" => "Roles y permisos",
|
||||
|
||||
@ -42,14 +42,16 @@ return [
|
||||
'velocidad' => 'Velocidad',
|
||||
'velocidadCorte' => 'Velocidad Corte',
|
||||
'validation' => [
|
||||
'alto_menor_alto_impresion' => 'El campo \'Alto impresión\' debe ser menor que \'Alto\'',
|
||||
'ancho_menor_ancho_impresion' => '\'Ancho Impresión\' debe ser menor que \'Ancho\'',
|
||||
'alto' => [
|
||||
'decimal' => 'El campo {field} debe contener un número decimal.',
|
||||
|
||||
'greater_than' => 'El campo {field} debe ser mayor que {param}',
|
||||
],
|
||||
|
||||
'ancho' => [
|
||||
'decimal' => 'El campo {field} debe contener un número decimal.',
|
||||
|
||||
'greater_than' => 'El campo {field} debe ser mayor que {param}',
|
||||
],
|
||||
|
||||
'forzar_num_formas_horizontales_portada' => [
|
||||
@ -65,19 +67,19 @@ return [
|
||||
'alto_click' => [
|
||||
'decimal' => 'El campo {field} debe contener un número decimal.',
|
||||
'required' => 'El campo {field} es obligatorio.',
|
||||
|
||||
'greater_than' => 'El campo {field} debe ser mayor que {param}',
|
||||
],
|
||||
|
||||
'alto_impresion' => [
|
||||
'decimal' => 'El campo {field} debe contener un número decimal.',
|
||||
'required' => 'El campo {field} es obligatorio.',
|
||||
|
||||
'greater_than' => 'El campo {field} debe ser mayor que {param}',
|
||||
],
|
||||
|
||||
'ancho_impresion' => [
|
||||
'decimal' => 'El campo {field} debe contener un número decimal.',
|
||||
'required' => 'El campo {field} es obligatorio.',
|
||||
|
||||
'greater_than' => 'El campo {field} debe ser mayor que {param}',
|
||||
],
|
||||
|
||||
'duracion_jornada' => [
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
|
||||
|
||||
return [
|
||||
'papel_impresion_maquinas' => 'Papeles impresion',
|
||||
'activo' => 'Activo',
|
||||
'gramaje_duplicado' => 'No se pueden seleccionar dos papeles con el mismo gramaje',
|
||||
'sureToChangeRotativaTitle' => 'Está seguro de cambiar esta opción?',
|
||||
|
||||
@ -9,10 +9,12 @@ return [
|
||||
'precioMax' => 'Precio Max',
|
||||
'precioMin' => 'Precio Min',
|
||||
'precioUnidad' => 'Precio Unidad',
|
||||
'tiradaMax' => 'Tirada Max',
|
||||
'tiradaMin' => 'Tirada Min',
|
||||
'paginasMax' => 'Páginas Max',
|
||||
'paginasMin' => 'Páginas Min',
|
||||
'margen' => 'Margen',
|
||||
'validation' => [
|
||||
'duplicated_tirada' => "Línea duplicada (la pareja 'Tirada Min' y 'Tirada Max' debe de ser única)",
|
||||
'error_paginas_overlap' => 'El rango [Páginas Min, Páginas Max] se solapa con otro existente para el tipo seleccionado.',
|
||||
'error_paginas_range' => 'El campo Páginas Min debe ser menor que el campo Páginas Max',
|
||||
'precio_max' => [
|
||||
'decimal' => 'El campo debe contener un número decimal.',
|
||||
'required' => 'El campo es obligatorio.',
|
||||
@ -25,24 +27,24 @@ return [
|
||||
|
||||
],
|
||||
|
||||
'precio_unidad' => [
|
||||
'paginas_max' => [
|
||||
'integer' => 'El campo debe contener un número entero.',
|
||||
'required' => 'El campo es obligatorio.',
|
||||
|
||||
],
|
||||
|
||||
'paginas_min' => [
|
||||
'integer' => 'El campo debe contener un número entero.',
|
||||
'required' => 'El campo es obligatorio.',
|
||||
|
||||
],
|
||||
|
||||
'margen' => [
|
||||
'decimal' => 'El campo debe contener un número decimal.',
|
||||
'required' => 'El campo es obligatorio.',
|
||||
|
||||
],
|
||||
|
||||
'tirada_max' => [
|
||||
'integer' => 'El campo debe contener un número entero.',
|
||||
'required' => 'El campo es obligatorio.',
|
||||
|
||||
],
|
||||
|
||||
'tirada_min' => [
|
||||
'integer' => 'El campo debe contener un número entero.',
|
||||
'required' => 'El campo es obligatorio.',
|
||||
|
||||
],
|
||||
|
||||
|
||||
],
|
||||
|
||||
|
||||
50
ci4/app/Language/es/TarifaEncuadernacionLineas.php
Normal file
50
ci4/app/Language/es/TarifaEncuadernacionLineas.php
Normal file
@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
|
||||
|
||||
return [
|
||||
'id' => 'ID',
|
||||
'moduleTitle' => 'Tarifa Encuadernación Lineas',
|
||||
'deleteLine' => 'el registro seleccionado',
|
||||
'precioMax' => 'Precio Max',
|
||||
'precioMin' => 'Precio Min',
|
||||
'precioUnidad' => 'Precio Unidad',
|
||||
'paginasMax' => 'Páginas Max',
|
||||
'paginasMin' => 'Páginas Min',
|
||||
'margen' => 'Margen',
|
||||
'validation' => [
|
||||
'error_paginas_overlap' => 'El rango [Páginas Min, Páginas Max] se solapa con otro existente para el tipo seleccionado.',
|
||||
'error_paginas_range' => 'El campo Páginas Min debe ser menor que el campo Páginas Max',
|
||||
'precio_max' => [
|
||||
'decimal' => 'El campo {field} debe contener un número decimal.',
|
||||
'required' => 'The {field} field is required.',
|
||||
|
||||
],
|
||||
|
||||
'precio_min' => [
|
||||
'decimal' => 'El campo {field} debe contener un número decimal.',
|
||||
'required' => 'The {field} field is required.',
|
||||
|
||||
],
|
||||
|
||||
'paginas_max' => [
|
||||
'decimal' => 'El campo {field} debe contener un número decimal.',
|
||||
'required' => 'The {field} field is required.',
|
||||
|
||||
],
|
||||
|
||||
'paginas_min' => [
|
||||
'decimal' => 'El campo {field} debe contener un número decimal.',
|
||||
'required' => 'The {field} field is required.',
|
||||
|
||||
],
|
||||
'margen' => [
|
||||
'decimal' => 'El campo debe contener un número decimal.',
|
||||
'required' => 'El campo es obligatorio.',
|
||||
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
|
||||
];
|
||||
@ -9,9 +9,12 @@ return [
|
||||
'precioMax' => 'Precio Max',
|
||||
'precioMin' => 'Precio Min',
|
||||
'precioUnidad' => 'Precio Unidad',
|
||||
'tiradaMax' => 'Tirada Max',
|
||||
'tiradaMin' => 'Tirada Min',
|
||||
'paginasMax' => 'Páginas Max',
|
||||
'paginasMin' => 'Páginas Min',
|
||||
'margen' => 'Margen',
|
||||
'validation' => [
|
||||
'error_paginas_overlap' => 'El rango [Páginas Min, Páginas Max] se solapa con otro existente para el tipo seleccionado.',
|
||||
'error_paginas_range' => 'El campo Páginas Min debe ser menor que el campo Páginas Max',
|
||||
'precio_max' => [
|
||||
'decimal' => 'El campo {field} debe contener un número decimal.',
|
||||
'required' => 'The {field} field is required.',
|
||||
@ -24,25 +27,23 @@ return [
|
||||
|
||||
],
|
||||
|
||||
'precio_unidad' => [
|
||||
'paginas_max' => [
|
||||
'decimal' => 'El campo {field} debe contener un número decimal.',
|
||||
'required' => 'The {field} field is required.',
|
||||
|
||||
],
|
||||
|
||||
'tirada_max' => [
|
||||
'paginas_min' => [
|
||||
'decimal' => 'El campo {field} debe contener un número decimal.',
|
||||
'required' => 'The {field} field is required.',
|
||||
|
||||
],
|
||||
|
||||
'tirada_min' => [
|
||||
'decimal' => 'El campo {field} debe contener un número decimal.',
|
||||
'required' => 'The {field} field is required.',
|
||||
'margen' => [
|
||||
'decimal' => 'El campo debe contener un número decimal.',
|
||||
'required' => 'El campo es obligatorio.',
|
||||
|
||||
],
|
||||
|
||||
|
||||
],
|
||||
|
||||
|
||||
|
||||
89
ci4/app/Language/es/Tarifaencuadernacion.php
Normal file
89
ci4/app/Language/es/Tarifaencuadernacion.php
Normal file
@ -0,0 +1,89 @@
|
||||
<?php
|
||||
|
||||
|
||||
return [
|
||||
'ajuste' => 'Ajuste',
|
||||
'ajusteTotalPedido' => 'Ajuste Total Pedido',
|
||||
'createdAt' => 'Creado en',
|
||||
'deletedAt' => 'Borrado en',
|
||||
'formulaPrice' => 'Fórmula precio',
|
||||
'id' => 'ID',
|
||||
'moduleTitle' => 'Tarifas Encuadernación',
|
||||
'nombre' => 'Nombre',
|
||||
'precioMax' => 'Precio Max',
|
||||
'precioMin' => 'Precio Min',
|
||||
'importeFijo' => 'Importe Fijo',
|
||||
'tarifaencuadernacion' => 'Tarifa Encuadernación',
|
||||
'tarifaencuadernacionList' => 'Lista Tarifas Encuadernación',
|
||||
'tarifasencuadernacion' => 'Tarifas Encuadernación',
|
||||
'tiradaMax' => 'Tirada Max',
|
||||
'tiradaMin' => 'Tirada Min',
|
||||
'updatedAt' => 'Actualizado en',
|
||||
'userCreatedId' => 'ID Usuario \"Creado en\"',
|
||||
'userUpdateId' => 'ID Usuario \"Actualizado en\"',
|
||||
'validation' => [
|
||||
'ajuste' => [
|
||||
'decimal' => 'El campo {field} debe contener un número decimal.',
|
||||
'required' => 'El campo {field} es obligatorio.',
|
||||
|
||||
],
|
||||
|
||||
'ajuste_total_pedido' => [
|
||||
'decimal' => 'El campo {field} debe contener un número decimal.',
|
||||
'required' => 'El campo {field} es obligatorio.',
|
||||
|
||||
],
|
||||
|
||||
'formula_price' => [
|
||||
'max_length' => 'El campo {field} no puede exceder {param} caracteres en longitud.',
|
||||
'required' => 'El campo {field} es obligatorio.',
|
||||
|
||||
],
|
||||
|
||||
'nombre' => [
|
||||
'max_length' => 'El campo {field} no puede exceder {param} caracteres en longitud.',
|
||||
'required' => 'El campo {field} es obligatorio.',
|
||||
|
||||
],
|
||||
|
||||
'precio_max' => [
|
||||
'decimal' => 'El campo {field} debe contener un número decimal.',
|
||||
'required' => 'El campo {field} es obligatorio.',
|
||||
|
||||
],
|
||||
|
||||
'precio_min' => [
|
||||
'decimal' => 'El campo {field} debe contener un número decimal.',
|
||||
'required' => 'El campo {field} es obligatorio.',
|
||||
|
||||
],
|
||||
|
||||
'tirada_max' => [
|
||||
'integer' => 'El campo {field} debe contener un número entero.',
|
||||
'required' => 'El campo {field} es obligatorio.',
|
||||
|
||||
],
|
||||
|
||||
'tirada_min' => [
|
||||
'integer' => 'El campo {field} debe contener un número entero.',
|
||||
'required' => 'El campo {field} es obligatorio.',
|
||||
|
||||
],
|
||||
|
||||
'user_created_id' => [
|
||||
'integer' => 'El campo {field} debe contener un número entero.',
|
||||
'required' => 'El campo {field} es obligatorio.',
|
||||
|
||||
],
|
||||
|
||||
'user_update_id' => [
|
||||
'integer' => 'El campo {field} debe contener un número entero.',
|
||||
'required' => 'El campo {field} es obligatorio.',
|
||||
|
||||
],
|
||||
|
||||
|
||||
],
|
||||
|
||||
|
||||
];
|
||||
@ -7,9 +7,10 @@ return [
|
||||
'id' => 'ID',
|
||||
'moduleTitle' => 'Tarifas Preimpresión',
|
||||
'nombre' => 'Nombre',
|
||||
'precio' => 'Precio',
|
||||
'precio' => 'Precio/página',
|
||||
'precioMin' => 'Precio Mínimo',
|
||||
'importeFijo' => 'Importe Fijo',
|
||||
'margen' => 'Margen',
|
||||
'tarifapreimpresion' => 'Tarifa Preimpresión',
|
||||
'tarifapreimpresionList' => 'Lista Tarifas Preimpresión',
|
||||
'tarifaspreimpresion' => 'Tarifas Preimpresión',
|
||||
|
||||
@ -72,23 +72,23 @@ class MaquinaModel extends \App\Models\GoBaseModel
|
||||
protected $validationRules = [
|
||||
"alto" => [
|
||||
"label" => "Maquinas.alto",
|
||||
"rules" => "required|decimal",
|
||||
"rules" => "required|decimal|greater_than[0]",
|
||||
],
|
||||
"alto_click" => [
|
||||
"label" => "Maquinas.altoClick",
|
||||
"rules" => "required|decimal",
|
||||
"rules" => "required|decimal|greater_than[0]",
|
||||
],
|
||||
"alto_impresion" => [
|
||||
"label" => "Maquinas.altoImpresion",
|
||||
"rules" => "required|decimal",
|
||||
"rules" => "required|decimal|greater_than[0]",
|
||||
],
|
||||
"ancho" => [
|
||||
"label" => "Maquinas.ancho",
|
||||
"rules" => "required|decimal",
|
||||
"rules" => "required|decimal|greater_than[0]",
|
||||
],
|
||||
"ancho_impresion" => [
|
||||
"label" => "Maquinas.anchoImpresion",
|
||||
"rules" => "required|decimal",
|
||||
"rules" => "required|decimal|greater_than[0]",
|
||||
],
|
||||
"duracion_jornada" => [
|
||||
"label" => "Maquinas.duracionJornada",
|
||||
|
||||
@ -183,6 +183,8 @@ class MaquinasDefectoModel extends \App\Models\GoBaseModel
|
||||
|
||||
public function checkIntervals($data = [], $id = null){
|
||||
|
||||
helper('general');
|
||||
|
||||
if(floatval($data["ancho_min"])>= floatval($data["ancho_max"])){
|
||||
return lang('MaquinasPorDefecto.validation.error_ancho_range');
|
||||
}
|
||||
@ -209,17 +211,17 @@ class MaquinasDefectoModel extends \App\Models\GoBaseModel
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if($this->check_overlap(floatval($data["ancho_min"]), floatval($data["ancho_max"]),
|
||||
if(check_overlap(floatval($data["ancho_min"]), floatval($data["ancho_max"]),
|
||||
$row->ancho_min, $row->ancho_max)){
|
||||
return lang('MaquinasPorDefecto.validation.error_ancho_overlap');
|
||||
}
|
||||
if($this->check_overlap(floatval($data["alto_min"]), floatval($data["alto_max"]),
|
||||
if(check_overlap(floatval($data["alto_min"]), floatval($data["alto_max"]),
|
||||
$row->alto_min, $row->alto_max)){
|
||||
return lang('MaquinasPorDefecto.validation.error_alto_overlap');
|
||||
}
|
||||
if($this->check_overlap(floatval($data["tirada_min"]), floatval($data["tirada_max"]),
|
||||
if(check_overlap(floatval($data["tirada_min"]), floatval($data["tirada_max"]),
|
||||
$row->tirada_min, $row->tirada_max)){
|
||||
return lang('MaquinasPorDefecto.validation.error_ancho_overlap');
|
||||
return lang('MaquinasPorDefecto.validation.error_tirada_overlap');
|
||||
}
|
||||
}
|
||||
|
||||
@ -227,15 +229,6 @@ class MaquinasDefectoModel extends \App\Models\GoBaseModel
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
// Devuelve true si los intervalos (a1,a2) (b1,b2) se solapan
|
||||
// https://stackoverflow.com/questions/3269434/whats-the-most-efficient-way-to-test-if-two-ranges-overlap
|
||||
private function check_overlap($a1, $a2, $b1, $b2){
|
||||
|
||||
if (max($a2, $b2) - min($a1, $b1) < ($a2 - $a1) + ($b2 - $b1))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -13,19 +13,19 @@ class TarifaAcabadoLineaModel extends \App\Models\GoBaseModel
|
||||
protected $useAutoIncrement = true;
|
||||
|
||||
const SORTABLE = [
|
||||
0 => "t1.tirada_min",
|
||||
1 => "t1.tirada_max",
|
||||
0 => "t1.paginas_min",
|
||||
1 => "t1.paginas_max",
|
||||
2 => "t1.precio_min",
|
||||
3 => "t1.precio_max",
|
||||
4 => "t1.precio_unidad",
|
||||
4 => "t1.margen",
|
||||
];
|
||||
|
||||
protected $allowedFields = [
|
||||
"tirada_min",
|
||||
"tirada_max",
|
||||
"paginas_min",
|
||||
"paginas_max",
|
||||
"precio_min",
|
||||
"precio_max",
|
||||
"precio_unidad",
|
||||
"margen",
|
||||
"user_created_id",
|
||||
"is_deleted",
|
||||
];
|
||||
@ -53,15 +53,11 @@ class TarifaAcabadoLineaModel extends \App\Models\GoBaseModel
|
||||
"label" => "TarifaAcabadoLineas.precioMin",
|
||||
"rules" => "required|decimal",
|
||||
],
|
||||
"precio_unidad" => [
|
||||
"label" => "TarifaAcabadoLineas.precioUnidad",
|
||||
"rules" => "required|decimal",
|
||||
],
|
||||
"tirada_max" => [
|
||||
"paginas_max" => [
|
||||
"label" => "TarifaAcabadoLineas.tiradaMax",
|
||||
"rules" => "required|integer",
|
||||
],
|
||||
"tirada_min" => [
|
||||
"paginas_min" => [
|
||||
"label" => "TarifaAcabadoLineas.tiradaMin",
|
||||
"rules" => "required|integer",
|
||||
],
|
||||
@ -84,17 +80,17 @@ class TarifaAcabadoLineaModel extends \App\Models\GoBaseModel
|
||||
"decimal" => "TarifaAcabadoLineas.validation.precio_min.decimal",
|
||||
"required" => "TarifaAcabadoLineas.validation.precio_min.required",
|
||||
],
|
||||
"precio_unidad" => [
|
||||
"decimal" => "TarifaAcabadoLineas.validation.precio_unidad.decimal",
|
||||
"required" => "TarifaAcabadoLineas.validation.precio_unidad.required",
|
||||
"paginas_max" => [
|
||||
"integer" => "TarifaAcabadoLineas.validation.paginas_max.integer",
|
||||
"required" => "TarifaAcabadoLineas.validation.paginas_max.required",
|
||||
],
|
||||
"tirada_max" => [
|
||||
"integer" => "TarifaAcabadoLineas.validation.tirada_max.integer",
|
||||
"required" => "TarifaAcabadoLineas.validation.tirada_max.required",
|
||||
"paginas_min" => [
|
||||
"integer" => "TarifaAcabadoLineas.validation.paginas_min.integer",
|
||||
"required" => "TarifaAcabadoLineas.validation.paginas_min.required",
|
||||
],
|
||||
"tirada_min" => [
|
||||
"integer" => "TarifaAcabadoLineas.validation.tirada_min.integer",
|
||||
"required" => "TarifaAcabadoLineas.validation.tirada_min.required",
|
||||
"margen" => [
|
||||
"integer" => "TarifaAcabadoLineas.validation.margen.integer",
|
||||
"required" => "TarifaAcabadoLineas.validation.margen.required",
|
||||
],
|
||||
"user_created_id" => [
|
||||
"integer" => "TarifaAcabadoLineas.validation.user_created_id.integer",
|
||||
@ -135,7 +131,7 @@ class TarifaAcabadoLineaModel extends \App\Models\GoBaseModel
|
||||
$builder = $this->db
|
||||
->table($this->table . " t1")
|
||||
->select(
|
||||
"t1.id AS id, t1.tirada_min AS tirada_min, t1.tirada_max AS tirada_max, t1.precio_min AS precio_min, t1.precio_max AS precio_max, t1.precio_unidad AS precio_unidad, t1.user_created_id AS user_created_id, t1.user_updated_id AS user_updated_id, t1.is_deleted AS is_deleted, t1.created_at AS created_at, t1.updated_at AS updated_at, t2.id AS tarifa_acabado"
|
||||
"t1.id AS id, t1.paginas_min AS paginas_min, t1.paginas_max AS paginas_max, t1.precio_min AS precio_min, t1.precio_max AS precio_max, t1.margen AS margen, t2.id AS tarifa_acabado"
|
||||
);
|
||||
|
||||
//JJO
|
||||
@ -149,28 +145,14 @@ class TarifaAcabadoLineaModel extends \App\Models\GoBaseModel
|
||||
? $builder
|
||||
: $builder
|
||||
->groupStart()
|
||||
->like("t1.tirada_min", $search)
|
||||
->orLike("t1.tirada_max", $search)
|
||||
->like("t1.paginas_min", $search)
|
||||
->orLike("t1.paginas_max", $search)
|
||||
->orLike("t1.precio_min", $search)
|
||||
->orLike("t1.precio_max", $search)
|
||||
->orLike("t1.precio_unidad", $search)
|
||||
->orLike("t1.user_created_id", $search)
|
||||
->orLike("t1.user_updated_id", $search)
|
||||
->orLike("t1.is_deleted", $search)
|
||||
->orLike("t1.created_at", $search)
|
||||
->orLike("t1.updated_at", $search)
|
||||
->orLike("t2.id", $search)
|
||||
->orLike("t1.tirada_min", $search)
|
||||
->orLike("t1.tirada_max", $search)
|
||||
->orLike("t1.paginas_min", $search)
|
||||
->orLike("t1.paginas_max", $search)
|
||||
->orLike("t1.precio_min", $search)
|
||||
->orLike("t1.precio_max", $search)
|
||||
->orLike("t1.precio_unidad", $search)
|
||||
->orLike("t1.user_created_id", $search)
|
||||
->orLike("t1.user_updated_id", $search)
|
||||
->orLike("t1.is_deleted", $search)
|
||||
->orLike("t1.created_at", $search)
|
||||
->orLike("t1.updated_at", $search)
|
||||
->orLike("t2.id", $search)
|
||||
->groupEnd();
|
||||
}
|
||||
|
||||
@ -185,4 +167,35 @@ class TarifaAcabadoLineaModel extends \App\Models\GoBaseModel
|
||||
return $builder;
|
||||
|
||||
}
|
||||
|
||||
public function checkIntervals($data = [], $id_linea = null, $id_tarifa_acabado = null){
|
||||
|
||||
helper('general');
|
||||
|
||||
if(floatval($data["paginas_min"])>= floatval($data["paginas_max"])){
|
||||
return lang('TarifaAcabadoLineas.validation.error_paginas_range');
|
||||
}
|
||||
|
||||
$rows = $this->db
|
||||
->table($this->table)
|
||||
->select("id, paginas_min, paginas_max")
|
||||
->where("is_deleted", 0)
|
||||
->where("tarifa_acabado_id", $id_tarifa_acabado)
|
||||
->get()->getResultObject();
|
||||
|
||||
|
||||
foreach ($rows as $row) {
|
||||
if (!is_null($id_linea)){
|
||||
if($row->id == $id_linea){
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if(check_overlap(floatval($data["paginas_min"]), floatval($data["paginas_max"]),
|
||||
$row->paginas_min, $row->paginas_max)){
|
||||
return lang('TarifaAcabadoLineas.validation.error_paginas_overlap');
|
||||
}
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
159
ci4/app/Models/Tarifas/TarifaEncuadernacionLineaModel.php
Normal file
159
ci4/app/Models/Tarifas/TarifaEncuadernacionLineaModel.php
Normal file
@ -0,0 +1,159 @@
|
||||
<?php
|
||||
namespace App\Models\Tarifas;
|
||||
|
||||
class TarifaEncuadernacionLineaModel extends \App\Models\GoBaseModel
|
||||
{
|
||||
protected $table = "tarifa_encuadernacion_lineas";
|
||||
|
||||
/**
|
||||
* Whether primary key uses auto increment.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $useAutoIncrement = true;
|
||||
|
||||
const SORTABLE = [
|
||||
0 => "t1.paginas_min",
|
||||
1 => "t1.paginas_max",
|
||||
2 => "t1.precio_min",
|
||||
3 => "t1.precio_max",
|
||||
];
|
||||
|
||||
protected $allowedFields = [
|
||||
"tarifa_encuadernacion_id",
|
||||
"paginas_min",
|
||||
"paginas_max",
|
||||
"precio_min",
|
||||
"precio_max",
|
||||
"user_created_id",
|
||||
"is_deleted",
|
||||
|
||||
];
|
||||
protected $returnType = "App\Entities\Tarifas\TarifaManipuladoLinea";
|
||||
|
||||
protected $useTimestamps = true;
|
||||
protected $useSoftDeletes = false;
|
||||
|
||||
protected $createdField = "created_at";
|
||||
|
||||
protected $updatedField = "updated_at";
|
||||
|
||||
public static $labelField = "tarifa_encuadernacion_id";
|
||||
|
||||
protected $validationRules = [
|
||||
"precio_max" => [
|
||||
"label" => "TarifaManipuladoLineas.precioMax",
|
||||
"rules" => "required|decimal",
|
||||
],
|
||||
"precio_min" => [
|
||||
"label" => "TarifaManipuladoLineas.precioMin",
|
||||
"rules" => "required|decimal",
|
||||
],
|
||||
"paginas_max" => [
|
||||
"label" => "TarifaManipuladoLineas.paginasMax",
|
||||
"rules" => "required|decimal",
|
||||
],
|
||||
"paginas_min" => [
|
||||
"label" => "TarifaManipuladoLineas.paginasMin",
|
||||
"rules" => "required|decimal",
|
||||
],
|
||||
"margen" => [
|
||||
"label" => "TarifaManipuladoLineas.margen",
|
||||
"rules" => "required|decimal",
|
||||
],
|
||||
];
|
||||
|
||||
protected $validationMessages = [
|
||||
"precio_max" => [
|
||||
"decimal" => "TarifaManipuladoLineas.validation.precio_max.decimal",
|
||||
"required" => "TarifaManipuladoLineas.validation.precio_max.required",
|
||||
],
|
||||
"precio_min" => [
|
||||
"decimal" => "TarifaManipuladoLineas.validation.precio_min.decimal",
|
||||
"required" => "TarifaManipuladoLineas.validation.precio_min.required",
|
||||
],
|
||||
"paginas_max" => [
|
||||
"decimal" => "TarifaManipuladoLineas.validation.paginas_max.decimal",
|
||||
"required" => "TarifaManipuladoLineas.validation.paginas_max.required",
|
||||
],
|
||||
"paginas_min" => [
|
||||
"decimal" => "TarifaManipuladoLineas.validation.paginas_min.decimal",
|
||||
"required" => "TarifaManipuladoLineas.validation.paginas_min.required",
|
||||
],
|
||||
"margen" => [
|
||||
"decimal" => "TarifaManipuladoLineas.validation.margen.decimal",
|
||||
"required" => "TarifaManipuladoLineas.validation.margen.required",
|
||||
],
|
||||
];
|
||||
|
||||
/**
|
||||
* Get resource data.
|
||||
*
|
||||
* @param string $search
|
||||
*
|
||||
* @return \CodeIgniter\Database\BaseBuilder
|
||||
*/
|
||||
public function getResource(string $search = "", $tarifa_encuadernacion_id = -1)
|
||||
{
|
||||
$builder = $this->db
|
||||
->table($this->table . " t1")
|
||||
->select(
|
||||
"t1.id AS id, t1.tarifa_encuadernacion_id AS tarifa_encuadernacion_id, t1.paginas_min AS paginas_min, t1.paginas_max AS paginas_max, t1.precio_min AS precio_min, t1.precio_max AS precio_max, t1.margen AS margen, t2.id AS tarifa_encuadernacion"
|
||||
);
|
||||
//JJO
|
||||
$builder->where('tarifa_encuadernacion_id', $tarifa_encuadernacion_id);
|
||||
$builder->where("t1.is_deleted", 0);
|
||||
|
||||
$builder->join("tarifa_encuadernacion t2", "t1.tarifa_encuadernacion_id = t2.id", "left");
|
||||
|
||||
|
||||
return empty($search)
|
||||
? $builder
|
||||
: $builder
|
||||
->groupStart()
|
||||
->like("t1.id", $search)
|
||||
->orLike("t1.tarifa_encuadernacion_id", $search)
|
||||
->orLike("t1.paginas_min", $search)
|
||||
->orLike("t1.paginas_max", $search)
|
||||
->orLike("t1.precio_min", $search)
|
||||
->orLike("t1.precio_max", $search)
|
||||
->orLike("t1.id", $search)
|
||||
->orLike("t1.tarifa_encuadernacion_id", $search)
|
||||
->orLike("t1.paginas_min", $search)
|
||||
->orLike("t1.paginas_max", $search)
|
||||
->orLike("t1.precio_min", $search)
|
||||
->orLike("t1.precio_max", $search)
|
||||
->groupEnd();
|
||||
}
|
||||
|
||||
public function checkIntervals($data = [], $id_linea = null, $id_tarifa_encuadernacion = null){
|
||||
|
||||
helper('general');
|
||||
|
||||
if(floatval($data["paginas_min"])>= floatval($data["paginas_max"])){
|
||||
return lang('TarifaManipuladoLineas.validation.error_paginas_range');
|
||||
}
|
||||
|
||||
$rows = $this->db
|
||||
->table($this->table)
|
||||
->select("id, paginas_min, paginas_max")
|
||||
->where("is_deleted", 0)
|
||||
->where("tarifa_encuadernacion_id", $id_tarifa_encuadernacion)
|
||||
->get()->getResultObject();
|
||||
|
||||
|
||||
foreach ($rows as $row) {
|
||||
if (!is_null($id_linea)){
|
||||
if($row->id == $id_linea){
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if(check_overlap(floatval($data["paginas_min"]), floatval($data["paginas_max"]),
|
||||
$row->paginas_min, $row->paginas_max)){
|
||||
return lang('TarifaManipuladoLineas.validation.error_paginas_overlap');
|
||||
}
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
}
|
||||
91
ci4/app/Models/Tarifas/TarifaEncuadernacionModel.php
Normal file
91
ci4/app/Models/Tarifas/TarifaEncuadernacionModel.php
Normal file
@ -0,0 +1,91 @@
|
||||
<?php
|
||||
namespace App\Models\Tarifas;
|
||||
|
||||
class TarifaEncuadernacionModel extends \App\Models\GoBaseModel
|
||||
{
|
||||
protected $table = "tarifa_encuadernacion";
|
||||
|
||||
/**
|
||||
* Whether primary key uses auto increment.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $useAutoIncrement = true;
|
||||
|
||||
const SORTABLE = [
|
||||
0 => "t1.nombre",
|
||||
];
|
||||
|
||||
protected $allowedFields = [
|
||||
"nombre",
|
||||
"precio_min",
|
||||
"importe_fijo",
|
||||
"deleted_at",
|
||||
"is_deleted",
|
||||
"user_created_id",
|
||||
"user_updated_id"
|
||||
];
|
||||
protected $returnType = "App\Entities\Tarifas\TarifaEncuadernacionEntity";
|
||||
|
||||
protected $useTimestamps = true;
|
||||
protected $useSoftDeletes = false;
|
||||
|
||||
protected $createdField = "created_at";
|
||||
|
||||
protected $updatedField = "updated_at";
|
||||
|
||||
public static $labelField = "nombre";
|
||||
|
||||
protected $validationRules = [
|
||||
"nombre" => [
|
||||
"label" => "Tarifaencuadernacion.nombre",
|
||||
"rules" => "trim|required|max_length[255]",
|
||||
],
|
||||
|
||||
"precio_min" => [
|
||||
"label" => "Tarifaencuadernacion.precioMin",
|
||||
"rules" => "required|decimal",
|
||||
],
|
||||
"importe_fijo" => [
|
||||
"label" => "Tarifaencuadernacion.importeFijo",
|
||||
"rules" => "required|decimal",
|
||||
],
|
||||
];
|
||||
|
||||
protected $validationMessages = [
|
||||
"nombre" => [
|
||||
"max_length" => "Tarifaencuadernacion.validation.nombre.max_length",
|
||||
"required" => "Tarifaencuadernacion.validation.nombre.required",
|
||||
],
|
||||
"precio_min" => [
|
||||
"required" => "Tarifaencuadernacion.validation.precio_min.required",
|
||||
"decimal" => "Tarifaencuadernacion.validation.precio_min.decimal",
|
||||
],
|
||||
"importe_fijo" => [
|
||||
"required" => "Tarifaencuadernacion.validation.importe_fijo.required",
|
||||
"decimal" => "Tarifaencuadernacion.validation.importe_fijo.decimal",
|
||||
],
|
||||
];
|
||||
|
||||
/**
|
||||
* Get resource data.
|
||||
*
|
||||
* @param string $search
|
||||
*
|
||||
* @return \CodeIgniter\Database\BaseBuilder
|
||||
*/
|
||||
public function getResource(string $search = "")
|
||||
{
|
||||
$builder = $this->db->table($this->table . " t1")->select("t1.id AS id, t1.nombre AS nombre, t1.precio_min AS precio_min, t1.importe_fijo AS importe_fijo");
|
||||
|
||||
//JJO
|
||||
$builder->where("t1.is_deleted", 0);
|
||||
|
||||
return empty($search)
|
||||
? $builder
|
||||
: $builder
|
||||
->groupStart()
|
||||
->like("t1.nombre", $search)
|
||||
->groupEnd();
|
||||
}
|
||||
}
|
||||
@ -13,20 +13,18 @@ class TarifaManipuladoLineaModel extends \App\Models\GoBaseModel
|
||||
protected $useAutoIncrement = true;
|
||||
|
||||
const SORTABLE = [
|
||||
0 => "t1.tirada_min",
|
||||
1 => "t1.tirada_max",
|
||||
0 => "t1.paginas_min",
|
||||
1 => "t1.paginas_max",
|
||||
2 => "t1.precio_min",
|
||||
3 => "t1.precio_max",
|
||||
4 => "t1.precio_unidad",
|
||||
];
|
||||
|
||||
protected $allowedFields = [
|
||||
"tarifa_manipulado_id",
|
||||
"tirada_min",
|
||||
"tirada_max",
|
||||
"paginas_min",
|
||||
"paginas_max",
|
||||
"precio_min",
|
||||
"precio_max",
|
||||
"precio_unidad",
|
||||
"user_created_id",
|
||||
"is_deleted",
|
||||
|
||||
@ -51,16 +49,16 @@ class TarifaManipuladoLineaModel extends \App\Models\GoBaseModel
|
||||
"label" => "TarifaManipuladoLineas.precioMin",
|
||||
"rules" => "required|decimal",
|
||||
],
|
||||
"precio_unidad" => [
|
||||
"label" => "TarifaManipuladoLineas.precioUnidad",
|
||||
"paginas_max" => [
|
||||
"label" => "TarifaManipuladoLineas.paginasMax",
|
||||
"rules" => "required|decimal",
|
||||
],
|
||||
"tirada_max" => [
|
||||
"label" => "TarifaManipuladoLineas.tiradaMax",
|
||||
"paginas_min" => [
|
||||
"label" => "TarifaManipuladoLineas.paginasMin",
|
||||
"rules" => "required|decimal",
|
||||
],
|
||||
"tirada_min" => [
|
||||
"label" => "TarifaManipuladoLineas.tiradaMin",
|
||||
"margen" => [
|
||||
"label" => "TarifaManipuladoLineas.margen",
|
||||
"rules" => "required|decimal",
|
||||
],
|
||||
];
|
||||
@ -74,17 +72,17 @@ class TarifaManipuladoLineaModel extends \App\Models\GoBaseModel
|
||||
"decimal" => "TarifaManipuladoLineas.validation.precio_min.decimal",
|
||||
"required" => "TarifaManipuladoLineas.validation.precio_min.required",
|
||||
],
|
||||
"precio_unidad" => [
|
||||
"decimal" => "TarifaManipuladoLineas.validation.precio_unidad.decimal",
|
||||
"required" => "TarifaManipuladoLineas.validation.precio_unidad.required",
|
||||
"paginas_max" => [
|
||||
"decimal" => "TarifaManipuladoLineas.validation.paginas_max.decimal",
|
||||
"required" => "TarifaManipuladoLineas.validation.paginas_max.required",
|
||||
],
|
||||
"tirada_max" => [
|
||||
"decimal" => "TarifaManipuladoLineas.validation.tirada_max.decimal",
|
||||
"required" => "TarifaManipuladoLineas.validation.tirada_max.required",
|
||||
"paginas_min" => [
|
||||
"decimal" => "TarifaManipuladoLineas.validation.paginas_min.decimal",
|
||||
"required" => "TarifaManipuladoLineas.validation.paginas_min.required",
|
||||
],
|
||||
"tirada_min" => [
|
||||
"decimal" => "TarifaManipuladoLineas.validation.tirada_min.decimal",
|
||||
"required" => "TarifaManipuladoLineas.validation.tirada_min.required",
|
||||
"margen" => [
|
||||
"decimal" => "TarifaManipuladoLineas.validation.margen.decimal",
|
||||
"required" => "TarifaManipuladoLineas.validation.margen.required",
|
||||
],
|
||||
];
|
||||
|
||||
@ -100,7 +98,7 @@ class TarifaManipuladoLineaModel extends \App\Models\GoBaseModel
|
||||
$builder = $this->db
|
||||
->table($this->table . " t1")
|
||||
->select(
|
||||
"t1.id AS id, t1.tarifa_manipulado_id AS tarifa_manipulado_id, t1.tirada_min AS tirada_min, t1.tirada_max AS tirada_max, t1.precio_min AS precio_min, t1.precio_max AS precio_max, t1.precio_unidad AS precio_unidad, t2.id AS tarifa_manipulado"
|
||||
"t1.id AS id, t1.tarifa_manipulado_id AS tarifa_manipulado_id, t1.paginas_min AS paginas_min, t1.paginas_max AS paginas_max, t1.precio_min AS precio_min, t1.precio_max AS precio_max, t1.margen AS margen, t2.id AS tarifa_manipulado"
|
||||
);
|
||||
//JJO
|
||||
$builder->where('tarifa_manipulado_id', $tarifa_manipulado_id);
|
||||
@ -115,18 +113,47 @@ class TarifaManipuladoLineaModel extends \App\Models\GoBaseModel
|
||||
->groupStart()
|
||||
->like("t1.id", $search)
|
||||
->orLike("t1.tarifa_manipulado_id", $search)
|
||||
->orLike("t1.tirada_min", $search)
|
||||
->orLike("t1.tirada_max", $search)
|
||||
->orLike("t1.paginas_min", $search)
|
||||
->orLike("t1.paginas_max", $search)
|
||||
->orLike("t1.precio_min", $search)
|
||||
->orLike("t1.precio_max", $search)
|
||||
->orLike("t1.precio_unidad", $search)
|
||||
->orLike("t1.id", $search)
|
||||
->orLike("t1.tarifa_manipulado_id", $search)
|
||||
->orLike("t1.tirada_min", $search)
|
||||
->orLike("t1.tirada_max", $search)
|
||||
->orLike("t1.paginas_min", $search)
|
||||
->orLike("t1.paginas_max", $search)
|
||||
->orLike("t1.precio_min", $search)
|
||||
->orLike("t1.precio_max", $search)
|
||||
->orLike("t1.precio_unidad", $search)
|
||||
->groupEnd();
|
||||
}
|
||||
|
||||
public function checkIntervals($data = [], $id_linea = null, $id_tarifa_manipulado = null){
|
||||
|
||||
helper('general');
|
||||
|
||||
if(floatval($data["paginas_min"])>= floatval($data["paginas_max"])){
|
||||
return lang('TarifaManipuladoLineas.validation.error_paginas_range');
|
||||
}
|
||||
|
||||
$rows = $this->db
|
||||
->table($this->table)
|
||||
->select("id, paginas_min, paginas_max")
|
||||
->where("is_deleted", 0)
|
||||
->where("tarifa_manipulado_id", $id_tarifa_manipulado)
|
||||
->get()->getResultObject();
|
||||
|
||||
|
||||
foreach ($rows as $row) {
|
||||
if (!is_null($id_linea)){
|
||||
if($row->id == $id_linea){
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if(check_overlap(floatval($data["paginas_min"]), floatval($data["paginas_max"]),
|
||||
$row->paginas_min, $row->paginas_max)){
|
||||
return lang('TarifaManipuladoLineas.validation.error_paginas_overlap');
|
||||
}
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
@ -76,7 +76,7 @@ class TarifaManipuladoModel extends \App\Models\GoBaseModel
|
||||
*/
|
||||
public function getResource(string $search = "")
|
||||
{
|
||||
$builder = $this->db->table($this->table . " t1")->select("t1.id AS id, t1.nombre AS nombre");
|
||||
$builder = $this->db->table($this->table . " t1")->select("t1.id AS id, t1.nombre AS nombre, t1.precio_min AS precio_min, t1.importe_fijo AS importe_fijo");
|
||||
|
||||
//JJO
|
||||
$builder->where("t1.is_deleted", 0);
|
||||
|
||||
@ -14,6 +14,8 @@ class TarifaacabadoModel extends \App\Models\GoBaseModel
|
||||
|
||||
const SORTABLE = [
|
||||
0 => "t1.nombre",
|
||||
1 => "precio_min",
|
||||
2 => "importe_fijo",
|
||||
];
|
||||
|
||||
protected $allowedFields = [
|
||||
@ -77,7 +79,7 @@ class TarifaacabadoModel extends \App\Models\GoBaseModel
|
||||
public function getResource(string $search = "")
|
||||
{
|
||||
$builder = $this->db->table($this->table . " t1")->select(
|
||||
"t1.id AS id, t1.nombre AS nombre"
|
||||
"t1.id AS id, t1.nombre AS nombre, t1.precio_min AS precio_min, t1.importe_fijo AS importe_fijo"
|
||||
);
|
||||
|
||||
//JJO
|
||||
|
||||
@ -14,9 +14,10 @@ class TarifapreimpresionModel extends \App\Models\GoBaseModel
|
||||
|
||||
protected $allowedFields = [
|
||||
"nombre",
|
||||
"precio",
|
||||
"precio_pagina",
|
||||
"precio_min",
|
||||
"importe_fijo",
|
||||
"margen",
|
||||
"deleted_at",
|
||||
"is_deleted",
|
||||
"user_created_id",
|
||||
@ -49,6 +50,10 @@ class TarifapreimpresionModel extends \App\Models\GoBaseModel
|
||||
"label" => "Tarifapreimpresion.importeFijo",
|
||||
"rules" => "required|decimal",
|
||||
],
|
||||
"margen" => [
|
||||
"label" => "Tarifapreimpresion.margen",
|
||||
"rules" => "required|decimal",
|
||||
],
|
||||
];
|
||||
|
||||
protected $validationMessages = [
|
||||
@ -68,5 +73,9 @@ class TarifapreimpresionModel extends \App\Models\GoBaseModel
|
||||
"required" => "Tarifapreimpresion.validation.importe_fijo.required",
|
||||
"decimal" => "Tarifapreimpresion.validation.importe_fijo.decimal",
|
||||
],
|
||||
"margen" => [
|
||||
"required" => "Tarifapreimpresion.validation.margen.required",
|
||||
"decimal" => "Tarifapreimpresion.validation.margen.decimal",
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
@ -69,7 +69,7 @@
|
||||
<div class="card accordion-item active">
|
||||
<h2 class="accordion-header" id="headingOne">
|
||||
<button type="button" class="accordion-button" data-bs-toggle="collapse" data-bs-target="#accordionTip2" aria-expanded="false" aria-controls="accordionTip2">
|
||||
<h3><?= lang("MaquinasTarifasImpresions.moduleTitle") ?></h3>
|
||||
<h3><?= lang("MaquinasPapelImpresion.papel_impresion_maquinas") ?></h3>
|
||||
</button>
|
||||
</h2>
|
||||
|
||||
|
||||
@ -19,15 +19,9 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= lang('Maquinas.nombre') ?></th>
|
||||
<th><?= lang('Maquinas.padreId') ?></th>
|
||||
<th><?= lang('Maquinas.tipo') ?></th>
|
||||
<th><?= lang('Maquinas.velocidad') ?></th>
|
||||
<th><?= lang('Maquinas.duracionJornada') ?></th>
|
||||
<th><?= lang('Maquinas.ancho') ?></th>
|
||||
<th><?= lang('Maquinas.alto') ?></th>
|
||||
<th><?= lang('Maquinas.anchoImpresion') ?></th>
|
||||
<th><?= lang('Maquinas.anchoImpresion') ?></th>
|
||||
<th><?= lang('Maquinas.altoImpresion') ?></th>
|
||||
<th><?= lang('Maquinas.ordenPlanning') ?></th>
|
||||
<th><?= lang('Maquinas.min') ?></th>
|
||||
<th><?= lang('Maquinas.max') ?></th>
|
||||
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
||||
@ -77,40 +71,34 @@
|
||||
pageSize: 'A4'
|
||||
}
|
||||
],
|
||||
stateSave: true,
|
||||
order: [[0, 'asc']],
|
||||
language: {
|
||||
url: "//cdn.datatables.net/plug-ins/1.13.4/i18n/<?= config('Basics')->i18n ?>.json"
|
||||
},
|
||||
ajax : $.fn.dataTable.pipeline( {
|
||||
url: '<?= route_to('dataTableOfMaquinas') ?>',
|
||||
method: 'POST',
|
||||
headers: {'X-Requested-With': 'XMLHttpRequest'},
|
||||
async: true,
|
||||
}),
|
||||
columnDefs: [
|
||||
{
|
||||
orderable: false,
|
||||
searchable: false,
|
||||
targets: [lastColNr]
|
||||
}
|
||||
],
|
||||
columns : [
|
||||
{ 'data': 'nombre' },
|
||||
{ 'data': 'padre' },
|
||||
{ 'data': 'tipo' },
|
||||
{ 'data': 'velocidad' },
|
||||
{ 'data': 'duracion_jornada' },
|
||||
{ 'data': 'ancho' },
|
||||
{ 'data': 'alto' },
|
||||
{ 'data': 'ancho_impresion' },
|
||||
{ 'data': 'alto_impresion' },
|
||||
{ 'data': 'orden_planning' },
|
||||
{ 'data': 'min' },
|
||||
{ 'data': 'max' },
|
||||
{ 'data': actionBtns }
|
||||
]
|
||||
});
|
||||
stateSave: true,
|
||||
order: [[0, 'asc']],
|
||||
language: {
|
||||
url: "//cdn.datatables.net/plug-ins/1.13.4/i18n/<?= config('Basics')->i18n ?>.json"
|
||||
},
|
||||
ajax : $.fn.dataTable.pipeline( {
|
||||
url: '<?= route_to('dataTableOfMaquinas') ?>',
|
||||
method: 'POST',
|
||||
headers: {'X-Requested-With': 'XMLHttpRequest'},
|
||||
async: true,
|
||||
}),
|
||||
columnDefs: [
|
||||
{
|
||||
orderable: false,
|
||||
searchable: false,
|
||||
targets: [lastColNr]
|
||||
}
|
||||
],
|
||||
columns : [
|
||||
{ 'data': 'nombre' },
|
||||
{ 'data': 'tipo' },
|
||||
{ 'data': 'ancho_impresion' },
|
||||
{ 'data': 'alto_impresion' },
|
||||
{ 'data': 'min' },
|
||||
{ 'data': 'max' },
|
||||
{ 'data': actionBtns }
|
||||
]
|
||||
});
|
||||
|
||||
|
||||
theTable.on( 'draw.dt', function () {
|
||||
|
||||
@ -118,7 +118,7 @@
|
||||
});
|
||||
|
||||
$(document).on('click', '.btn-edit', function(e) {
|
||||
window.location.href = `configuracion/maquinasdefecto/edit/${$(this).attr('data-id')}`;
|
||||
window.location.href = `/configuracion/maquinasdefecto/edit/${$(this).attr('data-id')}`;
|
||||
});
|
||||
|
||||
$(document).on('click', '.btn-delete', function(e) {
|
||||
|
||||
@ -44,11 +44,11 @@
|
||||
<table id="tableOfTarifaacabadolineas" class="table table-striped table-hover" style="width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= lang('TarifaAcabadoLineas.tiradaMin') ?></th>
|
||||
<th><?= lang('TarifaAcabadoLineas.tiradaMax') ?></th>
|
||||
<th><?= lang('TarifaAcabadoLineas.precioMin') ?></th>
|
||||
<th><?= lang('TarifaAcabadoLineas.paginasMin') ?></th>
|
||||
<th><?= lang('TarifaAcabadoLineas.precioMax') ?></th>
|
||||
<th><?= lang('TarifaAcabadoLineas.precioUnidad') ?></th>
|
||||
<th><?= lang('TarifaAcabadoLineas.paginasMax') ?></th>
|
||||
<th><?= lang('TarifaAcabadoLineas.precioMin') ?></th>
|
||||
<th><?= lang('TarifaAcabadoLineas.margen') ?></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
@ -96,16 +96,16 @@
|
||||
table : "#tableOfTarifaacabadolineas",
|
||||
idSrc: 'id',
|
||||
fields: [ {
|
||||
name: "tirada_min"
|
||||
}, {
|
||||
name: "tirada_max"
|
||||
}, {
|
||||
name: "precio_min"
|
||||
name: "paginas_min"
|
||||
}, {
|
||||
name: "precio_max"
|
||||
}, {
|
||||
name: "precio_unidad"
|
||||
name: "paginas_max"
|
||||
}, {
|
||||
name: "precio_min"
|
||||
},{
|
||||
name: "margen"
|
||||
}, {
|
||||
"name": "tarifa_acabado_id",
|
||||
"type": "hidden"
|
||||
},{
|
||||
@ -165,11 +165,11 @@
|
||||
async: true,
|
||||
}),
|
||||
columns: [
|
||||
{ 'data': 'tirada_min' },
|
||||
{ 'data': 'tirada_max' },
|
||||
{ 'data': 'precio_min' },
|
||||
{ 'data': 'paginas_min' },
|
||||
{ 'data': 'precio_max' },
|
||||
{ 'data': 'precio_unidad' },
|
||||
{ 'data': 'paginas_max' },
|
||||
{ 'data': 'precio_min' },
|
||||
{ 'data': 'margen' },
|
||||
{
|
||||
data: actionBtns,
|
||||
className: 'row-edit dt-center'
|
||||
|
||||
@ -17,6 +17,8 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= lang('Tarifaacabado.nombre') ?></th>
|
||||
<th><?= lang('Tarifaacabado.precioMin') ?></th>
|
||||
<th><?= lang('Tarifaacabado.importeFijo') ?></th>
|
||||
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
@ -32,6 +34,7 @@
|
||||
</div><!--//.col -->
|
||||
</div><!--//.row -->
|
||||
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
|
||||
@ -85,6 +88,8 @@ const lastColNr = $('#tableOfTarifasacabado').find("tr:first th").length - 1;
|
||||
],
|
||||
columns : [
|
||||
{ 'data': 'nombre' },
|
||||
{ 'data': 'precio_min' },
|
||||
{ 'data': 'importe_fijo' },
|
||||
{ 'data': actionBtns }
|
||||
]
|
||||
});
|
||||
|
||||
@ -0,0 +1,26 @@
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-lg-12 px-4">
|
||||
<div class="mb-3">
|
||||
<label for="nombre" class="form-label">
|
||||
<?=lang('Tarifaencuadernacion.nombre') ?>*
|
||||
</label>
|
||||
<input type="text" id="nombre" name="nombre" required maxLength="255" class="form-control" value="<?=old('nombre', $tarifaEncuadernacionEntity->nombre) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="nombre" class="form-label">
|
||||
<?=lang('Tarifaencuadernacion.precioMin') ?>*
|
||||
</label>
|
||||
<input type="text" id="precio_min" name="precio_min" required class="form-control" value="<?=old('precio_min', $tarifaEncuadernacionEntity->precio_min) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="nombre" class="form-label">
|
||||
<?=lang('Tarifaencuadernacion.importeFijo') ?>*
|
||||
</label>
|
||||
<input type="text" id="importe_fijo" name="importe_fijo" required class="form-control" value="<?=old('importe_fijo', $tarifaEncuadernacionEntity->importe_fijo) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
</div><!--//.col -->
|
||||
|
||||
</div><!-- //.row -->
|
||||
@ -0,0 +1,263 @@
|
||||
<?= $this->include("themes/_commonPartialsBs/datatables") ?>
|
||||
<?= $this->include("themes/_commonPartialsBs/select2bs5") ?>
|
||||
<?= $this->include("themes/_commonPartialsBs/sweetalert") ?>
|
||||
<?= $this->extend('themes/backend/vuexy/main/defaultlayout') ?>
|
||||
|
||||
<?= $this->section("content") ?>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card card-info">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title"><?= $boxTitle ?? $pageTitle ?></h3>
|
||||
</div><!--//.card-header -->
|
||||
<form id="tarifaEncuadernacionForm" class="card-body" method="post" action="<?= $formAction ?>">
|
||||
<?= csrf_field() ?>
|
||||
<?= view("themes/_commonPartialsBs/_alertBoxes") ?>
|
||||
<?= !empty($validation->getErrors()) ? $validation->listErrors("bootstrap_style") : "" ?>
|
||||
<?= view("themes/backend/vuexy/form/tarifas/encuadernacion/_tarifaEncuadernacionFormItems") ?>
|
||||
<div class="pt-4">
|
||||
<input type="submit"
|
||||
class="btn btn-primary float-start me-sm-3 me-1"
|
||||
name="save"
|
||||
value="<?= lang("Basic.global.Save") ?>"
|
||||
/>
|
||||
<?= anchor(route_to("tarifaEncuadernacionList"), lang("Basic.global.Cancel"), ["class" => "btn btn-secondary float-start",]) ?>
|
||||
|
||||
</div><!-- /.card-footer -->
|
||||
</form>
|
||||
</div><!-- //.card -->
|
||||
</div><!--//.col -->
|
||||
|
||||
<?php if($formAction == site_url('tarifas/tarifasencuadernacion/add')): ?>
|
||||
<div class="accordion mt-3" id="accordionEncuadernacionLineas" style="visibility:hidden" >
|
||||
<?php else: ?>
|
||||
<div class="accordion mt-3" id="accordionEncuadernacionLineas" style="visibility:visible" >
|
||||
<?php endif; ?>
|
||||
<div class="card accordion-item active">
|
||||
<h2 class="accordion-header" id="headingOne">
|
||||
<button type="button" class="accordion-button" data-bs-toggle="collapse" data-bs-target="#accordionTip1" aria-expanded="false" aria-controls="accordionTip1">
|
||||
<h3><?= lang("TarifaEncuadernacionLineas.moduleTitle") ?></h3>
|
||||
</button>
|
||||
|
||||
</h2>
|
||||
|
||||
<div id="accordionTip1" class="accordion-collapse collapse show" data-bs-parent="#accordionEncuadernacionLineas">
|
||||
<div class="accordion-body">
|
||||
|
||||
<table id="tableOfTarifaencuadernacionlineas" class="table table-striped table-hover" style="width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= lang('TarifaEncuadernacionLineas.paginasMin') ?></th>
|
||||
<th><?= lang('TarifaEncuadernacionLineas.precioMax') ?></th>
|
||||
<th><?= lang('TarifaEncuadernacionLineas.paginasMax') ?></th>
|
||||
<th><?= lang('TarifaEncuadernacionLineas.precioMin') ?></th>
|
||||
<th><?= lang('TarifaEncuadernacionLineas.margen') ?></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> <!-- //.accordion -->
|
||||
</div><!--//.row -->
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
|
||||
<?= $this->section("additionalInlineJs") ?>
|
||||
|
||||
const lastColNr = $('#tableOfTarifaencuadernacionlineas').find("tr:first th").length - 1;
|
||||
const url = window.location.href;
|
||||
const url_parts = url.split('/');
|
||||
if(url_parts[url_parts.length-2] == 'edit'){
|
||||
id = url_parts[url_parts.length-1];
|
||||
}
|
||||
else{
|
||||
id = -1;
|
||||
}
|
||||
|
||||
const actionBtns = function(data) {
|
||||
return `
|
||||
<span class="edit"><i class="ti ti-pencil ti-sm btn-edit mx-2" data-id="${data.id}"></i></span>
|
||||
<span class="cancel"></span>
|
||||
<span class="remove"><i class="ti ti-trash ti-sm btn-delete mx-2" data-id="${data.id}"></i></span>
|
||||
`;
|
||||
};
|
||||
|
||||
|
||||
editor = new $.fn.dataTable.Editor( {
|
||||
ajax: {
|
||||
url: "<?= route_to('editorOfTarifaEncuadernacionLineas') ?>",
|
||||
headers: {
|
||||
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v,
|
||||
},
|
||||
},
|
||||
table : "#tableOfTarifaencuadernacionlineas",
|
||||
idSrc: 'id',
|
||||
fields: [ {
|
||||
name: "paginas_min"
|
||||
}, {
|
||||
name: "precio_max"
|
||||
}, {
|
||||
name: "paginas_max"
|
||||
}, {
|
||||
name: "precio_min"
|
||||
}, {
|
||||
name: "margen"
|
||||
}, {
|
||||
"name": "tarifa_encuadernacion_id",
|
||||
"type": "hidden"
|
||||
},{
|
||||
"name": "deleted_at",
|
||||
"type": "hidden"
|
||||
},{
|
||||
"name": "is_deleted",
|
||||
"type": "hidden"
|
||||
},
|
||||
]
|
||||
} );
|
||||
|
||||
editor.on( 'preSubmit', function ( e, d, type ) {
|
||||
if ( type === 'create'){
|
||||
d.data[0]['tarifa_encuadernacion_id'] = id;
|
||||
}
|
||||
else if(type === 'edit' ) {
|
||||
for (v in d.data){
|
||||
d.data[v]['tarifa_encuadernacion_id'] = id;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
editor.on( 'postSubmit', function ( e, json, data, action ) {
|
||||
|
||||
yeniden(json.<?= csrf_token() ?>);
|
||||
});
|
||||
|
||||
editor.on( 'submitSuccess', function ( e, json, data, action ) {
|
||||
|
||||
theTable.clearPipeline();
|
||||
theTable.draw();
|
||||
});
|
||||
|
||||
|
||||
var theTable = $('#tableOfTarifaencuadernacionlineas').DataTable( {
|
||||
serverSide: true,
|
||||
processing: true,
|
||||
autoWidth: true,
|
||||
responsive: true,
|
||||
lengthMenu: [ 5, 10, 25],
|
||||
order: [[ 0, "asc" ], [ 1, "asc" ]],
|
||||
pageLength: 10,
|
||||
lengthChange: true,
|
||||
searching: false,
|
||||
paging: true,
|
||||
info: false,
|
||||
dom: '<"mt-4"><"float-end"B><"float-start"l><t><"mt-4 mb-3"p>',
|
||||
ajax : $.fn.dataTable.pipeline( {
|
||||
url: '<?= route_to('dataTableOfTarifaEncuadernacionLineas') ?>',
|
||||
data: {
|
||||
id_tarifaencuadernacion: id,
|
||||
},
|
||||
method: 'POST',
|
||||
headers: {'X-Requested-With': 'XMLHttpRequest'},
|
||||
async: true,
|
||||
}),
|
||||
columns: [
|
||||
{ 'data': 'paginas_min' },
|
||||
{ 'data': 'precio_max' },
|
||||
{ 'data': 'paginas_max' },
|
||||
{ 'data': 'precio_min' },
|
||||
{ 'data': 'margen' },
|
||||
{
|
||||
data: actionBtns,
|
||||
className: 'row-edit dt-center'
|
||||
}
|
||||
],
|
||||
columnDefs: [
|
||||
{
|
||||
orderable: false,
|
||||
searchable: false,
|
||||
targets: [lastColNr]
|
||||
},
|
||||
{"orderData": [ 0, 1 ], "targets": 0 },
|
||||
|
||||
],
|
||||
language: {
|
||||
url: "//cdn.datatables.net/plug-ins/1.13.4/i18n/<?= config('Basics')->i18n ?>.json"
|
||||
},
|
||||
buttons: [ {
|
||||
className: 'btn btn-primary float-end me-sm-3 me-1',
|
||||
extend: "createInline",
|
||||
editor: editor,
|
||||
formOptions: {
|
||||
submitTrigger: -1,
|
||||
submitHtml: '<i class="ti ti-device-floppy"/>'
|
||||
}
|
||||
} ]
|
||||
} );
|
||||
|
||||
|
||||
|
||||
// Activate an inline edit on click of a table cell
|
||||
$('#tableOfTarifaencuadernacionlineas').on( 'click', 'tbody span.edit', function (e) {
|
||||
editor.inline(
|
||||
theTable.cells(this.parentNode.parentNode, '*').nodes(),
|
||||
{
|
||||
cancelHtml: '<i class="ti ti-x"></i>',
|
||||
cancelTrigger: 'span.cancel',
|
||||
submitHtml: '<i class="ti ti-device-floppy"></i>',
|
||||
submitTrigger: 'span.edit',
|
||||
submit: 'allIfChanged'
|
||||
}
|
||||
);
|
||||
} );
|
||||
|
||||
|
||||
// Delete row
|
||||
$('#tableOfTarifaencuadernacionlineas').on( 'click', 'tbody span.remove', function (e) {
|
||||
|
||||
Swal.fire({
|
||||
title: '<?= lang('Basic.global.sweet.sureToDeleteTitle', [mb_strtolower(lang('Basic.global.sweet.line'))]) ?>',
|
||||
text: '<?= lang('Basic.global.sweet.sureToDeleteText') ?>',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
confirmButtonText: '<?= lang('Basic.global.sweet.deleteConfirmationButton') ?>',
|
||||
cancelButtonText: '<?= lang('Basic.global.Cancel') ?>',
|
||||
cancelButtonColor: '#d33'
|
||||
})
|
||||
.then((result) => {
|
||||
const dataId = $(this).data('id');
|
||||
const row = $(this).closest('tr');
|
||||
if (result.value) {
|
||||
editor
|
||||
.create( false )
|
||||
.edit( this.parentNode, false)
|
||||
.set( 'deleted_at', new Date().toISOString().slice(0, 19).replace('T', ' ') )
|
||||
.set( 'is_deleted', 1 )
|
||||
.submit();
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
<?=$this->section('css') ?>
|
||||
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/2.2.3/css/buttons.bootstrap5.min.css">
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
|
||||
<?= $this->section('additionalExternalJs') ?>
|
||||
<script src="https://cdn.datatables.net/buttons/2.2.3/js/dataTables.buttons.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/buttons/2.2.3/js/buttons.bootstrap5.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/buttons/2.2.3/js/buttons.html5.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/buttons/2.2.3/js/buttons.print.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.0/jszip.min.js" integrity="sha512-xcHCGC5tQ0SHlRX8Anbz6oy/OullASJkEhb4gjkneVpGE3/QGYejf14CUO5n5q5paiHfRFTa9HKgByxzidw2Bw==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.5/pdfmake.min.js" integrity="sha512-rDbVu5s98lzXZsmJoMa0DjHNE+RwPJACogUCLyq3Xxm2kJO6qsQwjbE5NDk2DqmlKcxDirCnU1wAzVLe12IM3w==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.5/vfs_fonts.js" integrity="sha512-cktKDgjEiIkPVHYbn8bh/FEyYxmt4JDJJjOCu5/FQAkW4bc911XtKYValiyzBiJigjVEvrIAyQFEbRJZyDA1wQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||
<script src="<?= site_url('themes/vuexy/js/datatables-editor/dataTables.editor.min.js') ?>"></script>
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
@ -0,0 +1,157 @@
|
||||
<?=$this->include('themes/_commonPartialsBs/datatables') ?>
|
||||
<?=$this->include('themes/_commonPartialsBs/sweetalert') ?>
|
||||
<?=$this->extend('themes/backend/vuexy/main/defaultlayout') ?>
|
||||
<?=$this->section('content'); ?>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
<div class="card card-info">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title"><?=lang('Tarifaencuadernacion.tarifaencuadernacionList') ?></h3>
|
||||
<?=anchor(route_to('newTarifaEncuadernacion'), lang('Basic.global.addNew') . ' ' .lang('Tarifaencuadernacion.tarifaencuadernacion'), ['class'=>'btn btn-primary float-end']); ?>
|
||||
</div><!--//.card-header -->
|
||||
<div class="card-body">
|
||||
<?= view('themes/_commonPartialsBs/_alertBoxes'); ?>
|
||||
|
||||
<table id="tableOfTarifasencuadernacion" class="table table-striped table-hover" style="width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= lang('Tarifaencuadernacion.nombre') ?></th>
|
||||
<th><?= lang('Tarifaencuadernacion.precioMin') ?></th>
|
||||
<th><?= lang('Tarifaencuadernacion.importeFijo') ?></th>
|
||||
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div><!--//.card-body -->
|
||||
<div class="card-footer">
|
||||
|
||||
</div><!--//.card-footer -->
|
||||
</div><!--//.card -->
|
||||
</div><!--//.col -->
|
||||
</div><!--//.row -->
|
||||
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
|
||||
<?=$this->section('additionalInlineJs') ?>
|
||||
|
||||
const lastColNr = $('#tableOfTarifasencuadernacion').find("tr:first th").length - 1;
|
||||
const actionBtns = function(data) {
|
||||
return `<td class="text-right py-0 align-middle">
|
||||
<div class="btn-group btn-group-sm">
|
||||
<i class="ti ti-pencil ti-sm btn-edit mx-2" data-id="${data.id}"></i>
|
||||
<i class="ti ti-trash ti-sm btn-delete mx-2" data-id="${data.id}"></i>
|
||||
</div>
|
||||
</td>`;
|
||||
};
|
||||
|
||||
theTable = $('#tableOfTarifasencuadernacion').DataTable({
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
autoWidth: true,
|
||||
responsive: true,
|
||||
scrollX: true,
|
||||
lengthMenu: [ 5, 10, 25, 50, 75, 100, 250, 500, 1000, 2500 ],
|
||||
pageLength: 10,
|
||||
lengthChange: true,
|
||||
"dom": 'lfBrtip',
|
||||
"buttons": [
|
||||
'copy', 'csv', 'excel', 'print', {
|
||||
extend: 'pdfHtml5',
|
||||
orientation: 'landscape',
|
||||
pageSize: 'A4'
|
||||
}
|
||||
],
|
||||
stateSave: true,
|
||||
order: [[0, 'asc']],
|
||||
language: {
|
||||
url: "//cdn.datatables.net/plug-ins/1.13.4/i18n/<?= config('Basics')->i18n ?>.json"
|
||||
},
|
||||
ajax : $.fn.dataTable.pipeline( {
|
||||
url: '<?= route_to('dataTableOfTarifasEncuadernacion') ?>',
|
||||
method: 'POST',
|
||||
headers: {'X-Requested-With': 'XMLHttpRequest'},
|
||||
async: true,
|
||||
}),
|
||||
columnDefs: [
|
||||
{
|
||||
orderable: false,
|
||||
searchable: false,
|
||||
targets: [lastColNr]
|
||||
}
|
||||
],
|
||||
columns : [
|
||||
{ 'data': 'nombre' },
|
||||
{ 'data': 'precio_min' },
|
||||
{ 'data': 'importe_fijo' },
|
||||
{ 'data': actionBtns }
|
||||
]
|
||||
});
|
||||
|
||||
|
||||
$(document).on('click', '.btn-edit', function(e) {
|
||||
//window.location.href = `<?= route_to('tarifaEncuadernacionList') ?>/${$(this).attr('data-id')}/edit`;
|
||||
window.location.href = `/tarifas/tarifasencuadernacion/edit/${$(this).attr('data-id')}`;
|
||||
});
|
||||
|
||||
$(document).on('click', '.btn-delete', function(e) {
|
||||
Swal.fire({
|
||||
title: '<?= lang('Basic.global.sweet.sureToDeleteTitle', [mb_strtolower(lang('Tarifaencuadernacion.tarifa encuadernacion'))]) ?>',
|
||||
text: '<?= lang('Basic.global.sweet.sureToDeleteText') ?>',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
confirmButtonText: '<?= lang('Basic.global.sweet.deleteConfirmationButton') ?>',
|
||||
cancelButtonText: '<?= lang('Basic.global.Cancel') ?>',
|
||||
cancelButtonColor: '#d33'
|
||||
})
|
||||
.then((result) => {
|
||||
const dataId = $(this).data('id');
|
||||
const row = $(this).closest('tr');
|
||||
if (result.value) {
|
||||
$.ajax({
|
||||
//url: `<?= route_to('tarifaEncuadernacionList') ?>/${dataId}`,
|
||||
//method: 'DELETE',
|
||||
url: `/tarifas/tarifasencuadernacion/delete/${dataId}`,
|
||||
method: 'GET',
|
||||
}).done((data, textStatus, jqXHR) => {
|
||||
Toast.fire({
|
||||
icon: 'success',
|
||||
title: data.msg ?? jqXHR.statusText,
|
||||
});
|
||||
|
||||
theTable.clearPipeline();
|
||||
theTable.row($(row)).invalidate().draw();
|
||||
}).fail((jqXHR, textStatus, errorThrown) => {
|
||||
Toast.fire({
|
||||
icon: 'error',
|
||||
title: jqXHR.responseJSON.messages.error,
|
||||
});
|
||||
})
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
|
||||
<?=$this->section('css') ?>
|
||||
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/2.2.3/css/buttons.bootstrap5.min.css">
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
|
||||
<?= $this->section('additionalExternalJs') ?>
|
||||
<script src="https://cdn.datatables.net/buttons/2.2.3/js/dataTables.buttons.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/buttons/2.2.3/js/buttons.bootstrap5.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/buttons/2.2.3/js/buttons.html5.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/buttons/2.2.3/js/buttons.print.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.0/jszip.min.js" integrity="sha512-xcHCGC5tQ0SHlRX8Anbz6oy/OullASJkEhb4gjkneVpGE3/QGYejf14CUO5n5q5paiHfRFTa9HKgByxzidw2Bw==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.5/pdfmake.min.js" integrity="sha512-rDbVu5s98lzXZsmJoMa0DjHNE+RwPJACogUCLyq3Xxm2kJO6qsQwjbE5NDk2DqmlKcxDirCnU1wAzVLe12IM3w==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.5/vfs_fonts.js" integrity="sha512-cktKDgjEiIkPVHYbn8bh/FEyYxmt4JDJJjOCu5/FQAkW4bc911XtKYValiyzBiJigjVEvrIAyQFEbRJZyDA1wQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
@ -28,7 +28,7 @@
|
||||
</div><!-- //.card -->
|
||||
</div><!--//.col -->
|
||||
|
||||
<?php if($formAction == route_to('createTarifaManipulado')): ?>
|
||||
<?php if($formAction == site_url('tarifas/tarifasmanipulado/add')): ?>
|
||||
<div class="accordion mt-3" id="accordionManipuladoLineas" style="visibility:hidden" >
|
||||
<?php else: ?>
|
||||
<div class="accordion mt-3" id="accordionManipuladoLineas" style="visibility:visible" >
|
||||
@ -47,11 +47,11 @@
|
||||
<table id="tableOfTarifamanipuladolineas" class="table table-striped table-hover" style="width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= lang('TarifaManipuladoLineas.tiradaMin') ?></th>
|
||||
<th><?= lang('TarifaManipuladoLineas.tiradaMax') ?></th>
|
||||
<th><?= lang('TarifaManipuladoLineas.precioMin') ?></th>
|
||||
<th><?= lang('TarifaManipuladoLineas.paginasMin') ?></th>
|
||||
<th><?= lang('TarifaManipuladoLineas.precioMax') ?></th>
|
||||
<th><?= lang('TarifaManipuladoLineas.precioUnidad') ?></th>
|
||||
<th><?= lang('TarifaManipuladoLineas.paginasMax') ?></th>
|
||||
<th><?= lang('TarifaManipuladoLineas.precioMin') ?></th>
|
||||
<th><?= lang('TarifaManipuladoLineas.margen') ?></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
@ -97,16 +97,16 @@
|
||||
table : "#tableOfTarifamanipuladolineas",
|
||||
idSrc: 'id',
|
||||
fields: [ {
|
||||
name: "tirada_min"
|
||||
}, {
|
||||
name: "tirada_max"
|
||||
}, {
|
||||
name: "precio_min"
|
||||
name: "paginas_min"
|
||||
}, {
|
||||
name: "precio_max"
|
||||
}, {
|
||||
name: "precio_unidad"
|
||||
},{
|
||||
name: "paginas_max"
|
||||
}, {
|
||||
name: "precio_min"
|
||||
}, {
|
||||
name: "margen"
|
||||
}, {
|
||||
"name": "tarifa_manipulado_id",
|
||||
"type": "hidden"
|
||||
},{
|
||||
@ -166,11 +166,11 @@
|
||||
async: true,
|
||||
}),
|
||||
columns: [
|
||||
{ 'data': 'tirada_min' },
|
||||
{ 'data': 'tirada_max' },
|
||||
{ 'data': 'precio_min' },
|
||||
{ 'data': 'paginas_min' },
|
||||
{ 'data': 'precio_max' },
|
||||
{ 'data': 'precio_unidad' },
|
||||
{ 'data': 'paginas_max' },
|
||||
{ 'data': 'precio_min' },
|
||||
{ 'data': 'margen' },
|
||||
{
|
||||
data: actionBtns,
|
||||
className: 'row-edit dt-center'
|
||||
|
||||
@ -17,6 +17,8 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= lang('Tarifamanipulado.nombre') ?></th>
|
||||
<th><?= lang('Tarifamanipulado.precioMin') ?></th>
|
||||
<th><?= lang('Tarifamanipulado.importeFijo') ?></th>
|
||||
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
@ -84,6 +86,8 @@
|
||||
],
|
||||
columns : [
|
||||
{ 'data': 'nombre' },
|
||||
{ 'data': 'precio_min' },
|
||||
{ 'data': 'importe_fijo' },
|
||||
{ 'data': actionBtns }
|
||||
]
|
||||
});
|
||||
|
||||
@ -32,7 +32,7 @@
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="nombre" class="form-label">
|
||||
<label for="precio_min" class="form-label">
|
||||
<?= lang('Tarifapreimpresion.precioMin') ?>*
|
||||
</label>
|
||||
<input
|
||||
@ -46,7 +46,7 @@
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="nombre" class="form-label">
|
||||
<label for="importe_fijo" class="form-label">
|
||||
<?= lang('Tarifapreimpresion.importeFijo') ?>*
|
||||
</label>
|
||||
<input
|
||||
@ -59,6 +59,19 @@
|
||||
>
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="margen" class="form-label">
|
||||
<?= lang('Tarifapreimpresion.margen') ?>*
|
||||
</label>
|
||||
<input
|
||||
type="text"
|
||||
id="margen"
|
||||
name="margen"
|
||||
required
|
||||
class="form-control"
|
||||
value="<?= old('margen', $tarifapreimpresionEntity->margen) ?>"
|
||||
>
|
||||
</div><!--//.mb-3 -->
|
||||
</div><!--//.col -->
|
||||
|
||||
</div><!-- //.row -->
|
||||
@ -17,37 +17,30 @@
|
||||
<tr>
|
||||
<th><?= lang('Tarifapreimpresion.nombre') ?></th>
|
||||
<th><?= lang('Tarifapreimpresion.precio') ?></th>
|
||||
<th><?= lang('Tarifapreimpresion.precioMin') ?></th>
|
||||
<th><?= lang('Tarifapreimpresion.importeFijo') ?></th>
|
||||
<th><?= lang('Tarifapreimpresion.margen') ?></th>
|
||||
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($tarifapreimpresionList as $item ) : ?>
|
||||
<tr>
|
||||
<?php /*
|
||||
<td class="align-middle text-center">
|
||||
<?=$item->id ?>
|
||||
</td>
|
||||
*/ ?>
|
||||
<td class="align-middle">
|
||||
<?= empty($item->nombre) || strlen($item->nombre) < 51 ? esc($item->nombre) : character_limiter(esc($item->nombre), 50) ?>
|
||||
</td>
|
||||
<td class="align-middle">
|
||||
<?= esc($item->precio) ?>
|
||||
</td>
|
||||
<?php /*
|
||||
<td class="align-middle">
|
||||
<?= esc($item->user_created_id) ?>
|
||||
<?= esc($item->precio_pagina) ?>
|
||||
</td>
|
||||
<td class="align-middle">
|
||||
<?= esc($item->user_updated_id) ?>
|
||||
<?= esc($item->precio_min) ?>
|
||||
</td>
|
||||
<td class="align-middle text-nowrap">
|
||||
<?= empty($item->created_at) ? '' : date('d/m/Y H:m:s', strtotime($item->created_at)) ?>
|
||||
<td class="align-middle">
|
||||
<?= esc($item->importe_fijo) ?>
|
||||
</td>
|
||||
<td class="align-middle text-nowrap">
|
||||
<?= empty($item->updated_at) ? '' : date('d/m/Y H:m:s', strtotime($item->updated_at)) ?>
|
||||
<td class="align-middle">
|
||||
<?= esc($item->margen) ?>
|
||||
</td>
|
||||
*/ ?>
|
||||
<td class="align-middle text-center text-nowrap">
|
||||
<?=anchor(route_to('editTarifapreimpresion', $item->id), "<i class='ti ti-pencil ti-sm mx-2'></i>", ['class'=>'text-body', 'data-id'=>$item->id,]); ?>
|
||||
<?=anchor('#confirm2delete', "<i class='ti ti-trash ti-sm mx-2'></i>", ['class'=>'text-body', 'data-href'=>route_to('deleteTarifapreimpresion', $item->id), 'data-bs-toggle'=>'modal', 'data-bs-target'=>'#confirm2delete']); ?>
|
||||
|
||||
@ -230,7 +230,7 @@ if (!empty($token) && $tfa == false) {
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-grow-1">
|
||||
<span class="fw-semibold d-block"><?= $session->get('first_name') . ' ' . $session->get('first_name') ?></span>
|
||||
<span class="fw-semibold d-block"><?= $session->get('first_name') . ' ' . $session->get('last_name') ?></span>
|
||||
<small class="text-muted">Admin</small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -463,7 +463,7 @@ if (!empty($token) && $tfa == false) {
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-grow-1">
|
||||
<span class="fw-semibold d-block"><?= $session->get('first_name') . ' ' . $session->get('first_name') ?></span>
|
||||
<span class="fw-semibold d-block"><?= $session->get('first_name') . ' ' . $session->get('last_name') ?></span>
|
||||
<small class="text-muted">Admin</small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -233,7 +233,7 @@ if (!empty($token) && $tfa == false) {
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-grow-1">
|
||||
<span class="fw-semibold d-block"><?= $session->get('first_name') . ' ' . $session->get('first_name') ?></span>
|
||||
<span class="fw-semibold d-block"><?= $session->get('first_name') . ' ' . $session->get('last_name') ?></span>
|
||||
<small class="text-muted">Admin</small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -178,7 +178,7 @@ if (!empty($token) && $tfa == false) {
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-grow-1">
|
||||
<span class="fw-semibold d-block"><?= $session->get('first_name') . ' ' . $session->get('first_name') ?></span>
|
||||
<span class="fw-semibold d-block"><?= $session->get('first_name') . ' ' . $session->get('last_name') ?></span>
|
||||
<small class="text-muted">Admin</small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -233,7 +233,7 @@ if (!empty($token) && $tfa == false) {
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-grow-1">
|
||||
<span class="fw-semibold d-block"><?= $session->get('first_name') . ' ' . $session->get('first_name') ?></span>
|
||||
<span class="fw-semibold d-block"><?= $session->get('first_name') . ' ' . $session->get('last_name') ?></span>
|
||||
<small class="text-muted">Admin</small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -403,7 +403,7 @@
|
||||
* MENU TARIFAS
|
||||
*/
|
||||
if (allowMenuSection($menus,
|
||||
['Tarifaacabado', 'Tarifaenvio', 'Tarifaimpresion', 'Tarifamanipulado',
|
||||
['Tarifaacabado', 'Tarifaenvio', 'Tarifaimpresion', 'Tarifamanipulado', 'Tarifaencuadernacion',
|
||||
'Tarifapapelcompra', 'Tarifapapeldefecto', 'Tarifapreimpresion'
|
||||
], 'index')): ?>
|
||||
<!-- Prices -->
|
||||
@ -449,6 +449,15 @@
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
<?php if (count($temp = getArrayItem($menus, 'name', 'Tarifaencuadernacion')) > 0): ?>
|
||||
<?php if (count(getArrayItem($temp, 'methods', 'index', true)) > 0): ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("tarifas/tarifaencuadernacion") ?>" class="menu-link">
|
||||
<div data-i18n="<?= lang("App.menu_tarifaencuadernacion") ?>"><?= lang("App.menu_tarifaencuadernacion") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
<?php if (count($temp = getArrayItem($menus, 'name', 'Tarifapapelcompra')) > 0): ?>
|
||||
<?php if (count(getArrayItem($temp, 'methods', 'index', true)) > 0): ?>
|
||||
<li class="menu-item">
|
||||
|
||||
@ -344,7 +344,7 @@
|
||||
* MENU TARIFAS
|
||||
*/
|
||||
if (allowMenuSection($menus,
|
||||
['Tarifapreimpresion', 'Tarifamanipulado', 'Tarifaacabado', 'Tarifaenvio'], 'index')): ?>
|
||||
['Tarifapreimpresion', 'Tarifasmanipulado', 'Tarifaacabado', 'Tarifaenvio', 'Tarifasencuadernacion'], 'index')): ?>
|
||||
<!-- Prices -->
|
||||
<li class="menu-item">
|
||||
<a href="javascript:void(0);" class="menu-link menu-toggle">
|
||||
@ -379,6 +379,15 @@
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
<?php if (count($temp = getArrayItem($menus, 'name', 'Tarifasencuadernacion')) > 0): ?>
|
||||
<?php if (count(getArrayItem($temp, 'methods', 'index', true)) > 0): ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("tarifas/tarifasencuadernacion") ?>" class="menu-link">
|
||||
<div data-i18n="<?= lang("App.menu_encuadernacion") ?>"><?= lang("App.menu_encuadernacion") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
<?php if (count($temp = getArrayItem($menus, 'name', 'Tarifaenvio')) > 0): ?>
|
||||
<?php if (count(getArrayItem($temp, 'methods', 'index', true)) > 0): ?>
|
||||
<li class="menu-item">
|
||||
|
||||
@ -234,7 +234,7 @@ if (!empty($token) && $tfa == false) {
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-grow-1">
|
||||
<span class="fw-semibold d-block"><?= $session->get('first_name') . ' ' . $session->get('first_name') ?></span>
|
||||
<span class="fw-semibold d-block"><?= $session->get('first_name') . ' ' . $session->get('last_name') ?></span>
|
||||
<small class="text-muted">Admin</small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user