mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Merge branch 'dev/presu_cliente_v2_problema_merge' into 'main'
copiada la rama presu_cliente_v2 en esta para poder hacer el merge al main See merge request jjimenez/safekat!361
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
<?php
|
||||
|
||||
use CodeIgniter\Router\RouteCollection;
|
||||
|
||||
/**
|
||||
* @var RouteCollection $routes
|
||||
*/
|
||||
@ -8,6 +9,7 @@ use CodeIgniter\Router\RouteCollection;
|
||||
//service('auth')->routes($routes, ['except' => ['login', 'register']]);
|
||||
service('auth')->routes($routes);
|
||||
|
||||
|
||||
//WEB ROUTER ------------------------------------------------------
|
||||
//------------------------------------------------------------------
|
||||
$routes->get('/', 'Home::index', ['as' => 'home']);
|
||||
@ -50,7 +52,6 @@ $routes->group('tarifas', ['namespace' => 'App\Controllers\Tarifas'], function (
|
||||
$routes->get('delete/(:num)', 'TarifaAcabadosLineas::delete/$1', ['as' => 'tarifaAcabadoLineasDelete']);
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
/* Rutas para configuraciones */
|
||||
@ -64,7 +65,6 @@ $routes->group('configuracion', ['namespace' => 'App\Controllers\Configuracion']
|
||||
$routes->match(['get', 'post'], 'edit/(:num)', 'Ubicaciones::edit/$1', ['as' => 'ubicacionesEdit']);
|
||||
$routes->get('delete/(:num)', 'Ubicaciones::delete/$1', ['as' => 'ubicacionesDelete']);
|
||||
$routes->post('datatable', 'Ubicaciones::datatable', ['as' => 'ubicacionesDT']);
|
||||
|
||||
});
|
||||
|
||||
/* Series Factura */
|
||||
@ -85,14 +85,20 @@ $routes->group('configuracion', ['namespace' => 'App\Controllers\Configuracion']
|
||||
$routes->get('delete/(:num)', 'FormasPago::delete/$1', ['as' => 'formasPagoDelete']);
|
||||
$routes->post('datatable', 'FormasPago::datatable', ['as' => 'formasPagoDT']);
|
||||
});
|
||||
$routes->group("variables",["namespace" => 'App\Controllers\Configuracion'],function($routes){
|
||||
$routes->group("variables", ["namespace" => 'App\Controllers\Configuracion'], function ($routes) {
|
||||
$routes->get('', 'ConfigVariables::index', ['as' => 'variablesIndex']);
|
||||
$routes->get('find/(:num)', 'ConfigVariables::get/$1', ['as' => 'variablesFind']);
|
||||
$routes->post('edit/(:num)', 'ConfigVariables::updateVariable/$1', ['as' => 'updateVariable']);
|
||||
$routes->delete('delete/(:num)', 'ConfigVariables::delete/$1', ['as' => 'deleteVariable']);
|
||||
$routes->get('datatable', 'ConfigVariables::datatable', ['as' => 'datatableVariables']);
|
||||
});
|
||||
|
||||
$routes->group("errores-presupuesto", ["namespace" => 'App\Controllers\Configuracion'], function ($routes) {
|
||||
$routes->get('', 'ConfigErrores::index', ['as' => 'erroresPresupuestoIndex']);
|
||||
$routes->get('edit/(:num)', 'ConfigErrores::viewForm/$1', ['as' => 'erroresPresupuestoViewForm']);
|
||||
$routes->get('get/(:num)', 'ConfigErrores::get_error_presupuesto/$1', ['as' => 'erroresPresupuestoGetErrorPresupuesto']);
|
||||
$routes->get('datatable', 'ConfigErrores::datatable', ['as' => 'erroresPresupuestoDatatable']);
|
||||
$routes->post('edit/(:num)', 'ConfigErrores::update_error_presupuesto/$1', ['as' => 'erroresPresupuestoUpdate']);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@ -370,8 +376,8 @@ $routes->group('clientes', ['namespace' => 'App\Controllers\Clientes'], function
|
||||
$routes->get('delete/(:num)', 'Cliente::delete/$1', ['as' => 'clienteDelete']);
|
||||
$routes->post('datatable', 'Cliente::datatable', ['as' => 'clienteDT']);
|
||||
$routes->post('menuitems', 'Cliente::menuItems', ['as' => 'menuItemsOfClientes']);
|
||||
$routes->get('getSelect2', 'Cliente::getSelect2', ['as' => 'getListaSelect2']);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
@ -407,6 +413,10 @@ $routes->group('clienteusuarios', ['namespace' => 'App\Controllers\Clientes'], f
|
||||
|
||||
$routes->group('misdirecciones', ['namespace' => 'App\Controllers\Clientes'], function ($routes) {
|
||||
$routes->get('', 'Clientedirecciones::index', ['as' => 'clientedireccionesIndex']);
|
||||
$routes->get('get/(:num)', 'Clientedirecciones::get/$1', ['as' => 'get']);
|
||||
$routes->get('getDireccionPresupuesto/(:num)', 'Clientedirecciones::getDireccionPresupuesto/$1', ['as' => 'getDireccionPresupuesto']);
|
||||
$routes->post('add', 'Clientedirecciones::add', ['as' => 'newClientedirecciones']);
|
||||
$routes->get('getSelect2', 'Clientedirecciones::getSelect2', ['as' => 'listaClientedirecciones']);
|
||||
});
|
||||
|
||||
|
||||
@ -562,7 +572,7 @@ $routes->group('cosidotapablanda', ['namespace' => 'App\Controllers\Presupuestos
|
||||
$routes->resource('cosidotapablanda', ['namespace' => 'App\Controllers\Presupuestos', 'controller' => 'Cosidotapablanda', 'except' => 'show,new,create,update']);
|
||||
|
||||
$routes->group('presupuestocliente', ['namespace' => 'App\Controllers\Presupuestos'], function ($routes) {
|
||||
$routes->get('list', 'Presupuestocliente::list', ['as' => 'listaPresupuestos']);
|
||||
$routes->get('list', 'Presupuestocliente::list', ['as' => 'listaPresupuestos']);
|
||||
$routes->post('datatable', 'Presupuestocliente::datatable', ['as' => 'datatableOfPresupuestos']);
|
||||
$routes->get('add', 'Presupuestocliente::add', ['as' => 'nuevoPresupuestoCliente']);
|
||||
$routes->post('add', 'Presupuestocliente::add', ['as' => 'crearPresupuestoCliente']);
|
||||
@ -571,10 +581,11 @@ $routes->group('presupuestocliente', ['namespace' => 'App\Controllers\Presupuest
|
||||
$routes->post('getgramaje', 'Presupuestocliente::getGramaje', ['as' => 'obtenerGramaje']);
|
||||
$routes->post('presupuesto', 'Presupuestocliente::presupuesto', ['as' => 'presupuestoCliente']);
|
||||
$routes->post('getDireccionesCliente', 'Presupuestocliente::getDireccionesCliente', ['as' => 'getDirecciones']);
|
||||
$routes->post('getDatosDireccion', 'Presupuestocliente::getDatosDireccion', ['as' => 'getDatosDireccion']);
|
||||
$routes->post('getNuevaDireccion', 'Presupuestocliente::getNuevaDireccion', ['as' => 'nuevaDireccion']);
|
||||
$routes->post('guardarPresupuesto', 'Presupuestocliente::guardarPresupuesto', ['as' => 'guardarPresupuesto']);
|
||||
$routes->post('guardar', 'Presupuestocliente::guardar', ['as' => 'guardar']);
|
||||
$routes->get('cargar/(:num)', 'Presupuestocliente::cargar/$1', ['as' => 'cargarPresupuesto']);
|
||||
$routes->post('duplicarPresupuesto', 'Presupuestocliente::duplicarPresupuesto', ['as' => 'duplicarPresupuesto']);
|
||||
$routes->post('calcular', 'Presupuestocliente::calcular', ['as' => 'calcularPresupuesto']);
|
||||
});
|
||||
$routes->resource('presupuestocliente', ['namespace' => 'App\Controllers\Presupuestos', 'controller' => 'Presupuestocliente', 'except' => 'show,new,create,update']);
|
||||
|
||||
@ -589,7 +600,6 @@ $routes->group('serviciosencuadernaciones', ['namespace' => 'App\Controllers\Pre
|
||||
$routes->post('menuitems', 'Presupuestoencuadernaciones::menuItems', ['as' => 'menuItemsOfPresupuestoEncuadernaciones']);
|
||||
$routes->get('delete/(:num)', 'Presupuestoencuadernaciones::delete/$1', ['as' => 'deletePresupuestoencuadernaciones']);
|
||||
$routes->post('edit/(:num)', 'Presupuestoencuadernaciones::edit/$1', ['as' => 'updatePresupuestoencuadernaciones']);
|
||||
|
||||
});
|
||||
|
||||
$routes->group('serviciosmanipulados', ['namespace' => 'App\Controllers\Presupuestos'], function ($routes) {
|
||||
@ -615,13 +625,13 @@ $routes->group('presupuestodirecciones', ['namespace' => 'App\Controllers\Presup
|
||||
$routes->group('presupuestotiradasalternativas', ['namespace' => 'App\Controllers\Presupuestos'], function ($routes) {
|
||||
$routes->post('datatable', 'Presupuestotiradasalternativas::datatable', ['as' => 'dataTableOfPresupuestoTiradasAlternativas']);
|
||||
$routes->post('datatable_2', 'Presupuestotiradasalternativas::datatable_2', ['as' => 'getTiradaData']);
|
||||
});
|
||||
});
|
||||
|
||||
$routes->group('pedidos', ['namespace' => 'App\Controllers\Pedidos'], function ($routes) {
|
||||
$routes->get('list', 'Pedido::todos', ['as' => 'listaPresupuestos']);
|
||||
$routes->get('listActivos', 'Pedido::activos', ['as' => 'listaPresupuestosActivos']);
|
||||
$routes->get('listFinalizados', 'Pedido::finalizados', ['as' => 'listaFinalizados']);
|
||||
$routes->get('listCancelados', 'Pedido::cancelados', ['as' => 'listaCancelados']);
|
||||
$routes->get('listActivos', 'Pedido::activos', ['as' => 'listaPresupuestosActivos']);
|
||||
$routes->get('listFinalizados', 'Pedido::finalizados', ['as' => 'listaFinalizados']);
|
||||
$routes->get('listCancelados', 'Pedido::cancelados', ['as' => 'listaCancelados']);
|
||||
$routes->post('datatable', 'Pedido::datatable', ['as' => 'dataTableOfPedidos']);
|
||||
$routes->get('add', 'Pedido::add', ['as' => 'nuevoPedido']);
|
||||
$routes->post('add', 'Pedido::add', ['as' => 'crearPedido']);
|
||||
@ -629,9 +639,7 @@ $routes->group('pedidos', ['namespace' => 'App\Controllers\Pedidos'], function (
|
||||
$routes->post('getlineas', 'Pedido::getLineas', ['as' => 'tablaLineasPedido']);
|
||||
$routes->post('cambiarestado', 'Pedido::cambiarEstado', ['as' => 'cambiarEstadoPedido']);
|
||||
$routes->post('update/(:any)', 'Pedido::update/$1', ['as' => 'actualizarPedido']);
|
||||
$routes->get('xml/(:num)', 'Pedido::get_xml_pedido/$1',['as' => 'getXMLPedido']);
|
||||
|
||||
|
||||
$routes->get('xml/(:num)', 'Pedido::get_xml_pedido/$1', ['as' => 'getXMLPedido']);
|
||||
});
|
||||
$routes->resource('pedidos', ['namespace' => 'App\Controllers\Pedidos', 'controller' => 'Pedido', 'except' => 'show,new,create,update']);
|
||||
|
||||
@ -728,6 +736,19 @@ $routes->group(
|
||||
);
|
||||
$routes->resource('buscadorpresupuestos', ['namespace' => 'App\Controllers\Presupuestos', 'controller' => 'Buscador', 'except' => 'show,new,create,update']);
|
||||
|
||||
|
||||
$routes->group(
|
||||
'papel-formato',
|
||||
['namespace' => 'App\Controllers\Configuracion'],
|
||||
function ($routes) {
|
||||
$routes->post('menuitems', 'Papelformato::menuitems', ['as' => 'menuitems']);
|
||||
$routes->get('getSelect2', 'Papelformato::getSelect2', ['as' => 'getSelect2']);
|
||||
}
|
||||
);
|
||||
$routes->resource('papel-formato', ['namespace' => 'App\Controllers\Configuracion', 'controller' => 'Papelformato', 'except' => 'show,new,create,update']);
|
||||
|
||||
|
||||
|
||||
/* Rutas para mensajeria */
|
||||
$routes->group('mensajes', ['namespace' => 'App\Controllers\Mensajeria'], function ($routes) {
|
||||
|
||||
@ -740,9 +761,7 @@ $routes->group('mensajes', ['namespace' => 'App\Controllers\Mensajeria'], functi
|
||||
$routes->match(['get', 'post'], 'edit/(:num)', 'TarifaAcabados::edit/$1', ['as' => 'tarifaAcabadoEdit']);
|
||||
$routes->get('delete/(:num)', 'TarifaAcabados::delete/$1', ['as' => 'tarifaAcabadoDelete']);
|
||||
$routes->post('datatable', 'TarifaAcabados::datatable', ['as' => 'tarifaAcabadoDT']);*/
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
$routes->group('chat', ['namespace' => 'App\Controllers\Chat'], function ($routes) {
|
||||
$routes->get('departments', 'ChatController::get_chat_departments', ['as' => 'getChatDepartments']);
|
||||
@ -766,14 +785,9 @@ $routes->group('chat', ['namespace' => 'App\Controllers\Chat'], function ($route
|
||||
$routes->post('hebra/pedido', 'ChatController::store_hebra_pedido', ['as' => 'storeHebraPedido']);
|
||||
$routes->post('hebra/factura', 'ChatController::store_hebra_factura', ['as' => 'storeHebraFactura']);
|
||||
$routes->post('hebra/(:num)', 'ChatController::update_hebra/$1', ['as' => 'updateHebra']);
|
||||
$routes->get('hebra/presupuesto/(:num)',"ChatController::get_hebra_presupuesto/$1",["as" => "getHebraPresupuesto"]);
|
||||
$routes->get('hebra/pedido/(:num)',"ChatController::get_hebra_pedido/$1",["as" => "getHebraPedido"]);
|
||||
$routes->get('hebra/factura/(:num)',"ChatController::get_hebra_factura/$1",["as" => "getHebraFactura"]);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$routes->get('hebra/presupuesto/(:num)', "ChatController::get_hebra_presupuesto/$1", ["as" => "getHebraPresupuesto"]);
|
||||
$routes->get('hebra/pedido/(:num)', "ChatController::get_hebra_pedido/$1", ["as" => "getHebraPedido"]);
|
||||
$routes->get('hebra/factura/(:num)', "ChatController::get_hebra_factura/$1", ["as" => "getHebraFactura"]);
|
||||
});
|
||||
|
||||
|
||||
@ -789,6 +803,15 @@ $routes->group('api', ['filter' => 'jwt'], static function ($routes) {
|
||||
// ...
|
||||
});
|
||||
|
||||
/*
|
||||
* --------------------------------------------------------------------
|
||||
* Translation
|
||||
* --------------------------------------------------------------------
|
||||
*/
|
||||
$routes->group('translate', ['namespace' => 'App\Controllers'], function ($routes) {
|
||||
$routes->post('getTranslation', 'Language::getTranslation', ['as' => 'getKeys']);
|
||||
});
|
||||
$routes->resource('translate', ['namespace' => 'App\Controllers', 'controller' => 'Language', 'except' => '']);
|
||||
|
||||
|
||||
/*
|
||||
@ -806,4 +829,4 @@ $routes->group('api', ['filter' => 'jwt'], static function ($routes) {
|
||||
*/
|
||||
if (file_exists(APPPATH . 'Config/' . ENVIRONMENT . '/Routes.php')) {
|
||||
require APPPATH . 'Config/' . ENVIRONMENT . '/Routes.php';
|
||||
}
|
||||
}
|
||||
@ -1,4 +1,6 @@
|
||||
<?php namespace App\Controllers\Clientes;
|
||||
<?php
|
||||
|
||||
namespace App\Controllers\Clientes;
|
||||
|
||||
|
||||
|
||||
@ -152,7 +154,7 @@ class Cliente extends \App\Controllers\BaseResourceController
|
||||
return $this->redirect2listView('sweet-error', $message);
|
||||
endif;
|
||||
|
||||
|
||||
|
||||
|
||||
if ($this->request->getPost()) :
|
||||
|
||||
@ -310,10 +312,9 @@ class Cliente extends \App\Controllers\BaseResourceController
|
||||
$onlyActiveOnes = false;
|
||||
$columns2select = [$reqId ?? 'id', $reqText ?? 'nombre'];
|
||||
$onlyActiveOnes = false;
|
||||
try{
|
||||
try {
|
||||
$menu = $this->model->getSelect2MenuItems($columns2select, $columns2select[1], $onlyActiveOnes, $searchStr);
|
||||
}
|
||||
catch(Exception $e){
|
||||
} catch (Exception $e) {
|
||||
$menu = [];
|
||||
}
|
||||
|
||||
@ -330,6 +331,28 @@ class Cliente extends \App\Controllers\BaseResourceController
|
||||
}
|
||||
|
||||
|
||||
public function getSelect2()
|
||||
{
|
||||
if ($this->request->isAJAX()) {
|
||||
$query = $this->model->builder()->select(
|
||||
[
|
||||
"id",
|
||||
"nombre as name"
|
||||
]
|
||||
)->where("deleted_at", null);
|
||||
if ($this->request->getGet("q")) {
|
||||
$query->groupStart()
|
||||
->orLike("clientes.nombre", $this->request->getGet("q"))
|
||||
->groupEnd();
|
||||
}
|
||||
|
||||
return $this->response->setJSON($query->get()->getResultObject());
|
||||
} else {
|
||||
return $this->failUnauthorized('Invalid request', 403);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected function getPaisListItems($selId = null)
|
||||
{
|
||||
$paisModel = model('App\Models\Configuracion\PaisModel');
|
||||
@ -423,24 +446,23 @@ class Cliente extends \App\Controllers\BaseResourceController
|
||||
}
|
||||
|
||||
|
||||
protected function getPrecioTemplate($cliente_id){
|
||||
protected function getPrecioTemplate($cliente_id)
|
||||
{
|
||||
|
||||
$modelPreciosCliente = model('App\Models\Clientes\ClientePreciosModel');
|
||||
$plantilla_id = $modelPreciosCliente->get_plantilla_precios($cliente_id);
|
||||
if (is_null($plantilla_id)){
|
||||
if (is_null($plantilla_id)) {
|
||||
return null;
|
||||
}
|
||||
$modelPlantillaPreciosCliente = model('App\Models\Clientes\ClientePlantillaPreciosModel');
|
||||
$plantilla = $modelPlantillaPreciosCliente->where("id", $plantilla_id)->where("is_deleted", 0)->first();
|
||||
if ($plantilla == false){
|
||||
if ($plantilla == false) {
|
||||
return null;
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
return (object)array(
|
||||
"value" => $plantilla_id,
|
||||
"label" => $plantilla->nombre
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
<?php namespace App\Controllers\Clientes;
|
||||
<?php
|
||||
|
||||
namespace App\Controllers\Clientes;
|
||||
|
||||
use App\Models\Collection;
|
||||
|
||||
@ -38,7 +40,7 @@ class Clientedirecciones extends \App\Controllers\BaseResourceController
|
||||
// Breadcrumbs (IMN)
|
||||
$this->viewData['breadcrumb'] = [
|
||||
['title' => lang("Clientes.direccionesEnvio"), 'route' => "javascript:void(0);", 'active' => false],
|
||||
|
||||
|
||||
];
|
||||
|
||||
$this->viewData['comunidadAutonomaList'] = $this->getComunidadAutonomaListItems($clienteEntity->comunidad_autonoma_id ?? null);
|
||||
@ -71,21 +73,22 @@ class Clientedirecciones extends \App\Controllers\BaseResourceController
|
||||
return view(static::$viewPath . 'viewClienteDireccionesList', $viewData);
|
||||
}
|
||||
|
||||
public function add(){
|
||||
public function add()
|
||||
{
|
||||
if ($this->request->isAJAX()) {
|
||||
|
||||
|
||||
$reqData = $this->request->getPost();
|
||||
$cliente_id = $reqData['cliente_id'] ?? -1;
|
||||
$att = $reqData['att'] ?? "";
|
||||
$email = $reqData['email'] ?? "";
|
||||
$direccion = $reqData['direccion'] ?? "";
|
||||
$pais_id = $reqData['paisId'] ?? -1;
|
||||
$pais_id = $reqData['pais_id'] ?? -1;
|
||||
$provincia = $reqData['provincia'] ?? "";
|
||||
$municipio = $reqData['municipio'] ?? "";
|
||||
$cp = $reqData['cp'] ?? "";
|
||||
$telefono = $reqData['telefono'] ?? "";
|
||||
$alias = $reqData['alias'] ?? "";
|
||||
|
||||
|
||||
$data = [
|
||||
"cliente_id" => $cliente_id,
|
||||
"att" => $att,
|
||||
@ -99,15 +102,11 @@ class Clientedirecciones extends \App\Controllers\BaseResourceController
|
||||
"alias" => $alias,
|
||||
];
|
||||
$response = $this->model->insert($data);
|
||||
|
||||
$newTokenHash = csrf_hash();
|
||||
$csrfTokenName = csrf_token();
|
||||
|
||||
$data_ret = [
|
||||
'data' => $response,
|
||||
$csrfTokenName => $newTokenHash
|
||||
];
|
||||
return $this->respond($data_ret);
|
||||
|
||||
} else {
|
||||
return $this->failUnauthorized('Invalid request', 403);
|
||||
}
|
||||
@ -117,14 +116,14 @@ class Clientedirecciones extends \App\Controllers\BaseResourceController
|
||||
public function menuItems()
|
||||
{
|
||||
if ($this->request->isAJAX()) {
|
||||
|
||||
|
||||
$reqData = $this->request->getPost();
|
||||
$cliente_id = $reqData['cliente_id'] ?? -1;
|
||||
|
||||
|
||||
$clienteDireccionesModel = model('App\Models\Clientes\ClienteDireccionesModel');
|
||||
$menu = $clienteDireccionesModel->getMenuDirecciones($cliente_id);
|
||||
//$menu = $this->model->getMenuItems($cliente_id);
|
||||
|
||||
|
||||
$newTokenHash = csrf_hash();
|
||||
$csrfTokenName = csrf_token();
|
||||
$data = [
|
||||
@ -138,6 +137,34 @@ class Clientedirecciones extends \App\Controllers\BaseResourceController
|
||||
}
|
||||
|
||||
|
||||
public function getSelect2()
|
||||
{
|
||||
if ($this->request->isAJAX()) {
|
||||
|
||||
$cliente_id = $this->request->getGet('cliente_id');
|
||||
|
||||
|
||||
$query = $this->model->builder()->select(
|
||||
[
|
||||
"id",
|
||||
"alias as name"
|
||||
]
|
||||
)
|
||||
->where("cliente_id", $cliente_id)
|
||||
->orderBy("alias", "asc");
|
||||
if ($this->request->getGet("q")) {
|
||||
$query->groupStart()
|
||||
->orLike("clientes.nombre", $this->request->getGet("q"))
|
||||
->groupEnd();
|
||||
}
|
||||
|
||||
return $this->response->setJSON($query->get()->getResultObject());
|
||||
} else {
|
||||
return $this->failUnauthorized('Invalid request', 403);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function datatable()
|
||||
{
|
||||
if ($this->request->isAJAX()) {
|
||||
@ -145,7 +172,7 @@ class Clientedirecciones extends \App\Controllers\BaseResourceController
|
||||
|
||||
$tipo = $reqData['tipo'] ?? null;
|
||||
|
||||
if(is_null($tipo)){
|
||||
if (is_null($tipo)) {
|
||||
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);
|
||||
@ -160,22 +187,21 @@ class Clientedirecciones extends \App\Controllers\BaseResourceController
|
||||
|
||||
$id_C = $reqData['cliente_id'] ?? -1;
|
||||
|
||||
|
||||
|
||||
$resourceData = $this->model->getResource($search, $id_C)->orderBy($order, $dir)->limit($length, $start)->get()->getResultObject();
|
||||
|
||||
|
||||
|
||||
return $this->respond(Collection::datatable(
|
||||
$resourceData,
|
||||
$this->model->getResource()->countAllResults(),
|
||||
$this->model->getResource("", $id_C)->countAllResults()
|
||||
));
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
|
||||
$id = $reqData['id'] ?? -1;
|
||||
|
||||
$resourceData = $this->model->getDireccion($id);
|
||||
|
||||
|
||||
|
||||
return $this->respond($resourceData);
|
||||
}
|
||||
@ -184,6 +210,44 @@ class Clientedirecciones extends \App\Controllers\BaseResourceController
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function get($id)
|
||||
{
|
||||
try {
|
||||
$resourceData = $this->model->getDireccion($id);
|
||||
$response = (object)[
|
||||
'error' => false,
|
||||
'data' => $resourceData
|
||||
];
|
||||
return $this->respond($response);
|
||||
} catch (\Exception $e) {
|
||||
$response = (object)[
|
||||
'error' => true,
|
||||
'message' => $e->getMessage()
|
||||
];
|
||||
return $this->fail($response);
|
||||
}
|
||||
}
|
||||
|
||||
public function getDireccionPresupuesto($id)
|
||||
{
|
||||
try {
|
||||
$model = model('App\Models\Presupuestos\PresupuestoDireccionesModel');
|
||||
$resourceData = $model->getDireccion($id);
|
||||
$response = (object)[
|
||||
'error' => false,
|
||||
'data' => $resourceData
|
||||
];
|
||||
return $this->respond($response);
|
||||
} catch (\Exception $e) {
|
||||
$response = (object)[
|
||||
'error' => true,
|
||||
'message' => $e->getMessage()
|
||||
];
|
||||
return $this->fail($response);
|
||||
}
|
||||
}
|
||||
|
||||
public function datatable_editor()
|
||||
{
|
||||
if ($this->request->isAJAX()) {
|
||||
@ -194,72 +258,116 @@ class Clientedirecciones extends \App\Controllers\BaseResourceController
|
||||
$response = Editor::inst($db, 'cliente_direcciones')
|
||||
->fields(
|
||||
Field::inst('att')
|
||||
->validator('Validate::notEmpty', array(
|
||||
'message' => lang('ClienteDirecciones.validation.required'))
|
||||
->validator(
|
||||
'Validate::notEmpty',
|
||||
array(
|
||||
'message' => lang('ClienteDirecciones.validation.required')
|
||||
)
|
||||
)
|
||||
->validator( Validate::maxLen( 100 ) , array(
|
||||
'message' => lang('ClienteDirecciones.validation.max_length'))
|
||||
),
|
||||
->validator(
|
||||
Validate::maxLen(100),
|
||||
array(
|
||||
'message' => lang('ClienteDirecciones.validation.max_length')
|
||||
)
|
||||
),
|
||||
Field::inst('alias')
|
||||
->validator('Validate::notEmpty', array(
|
||||
'message' => lang('ClienteDirecciones.validation.required'))
|
||||
->validator(
|
||||
'Validate::notEmpty',
|
||||
array(
|
||||
'message' => lang('ClienteDirecciones.validation.required')
|
||||
)
|
||||
)
|
||||
->validator( Validate::maxLen( 100 ) , array(
|
||||
'message' => lang('ClienteDirecciones.validation.max_length'))
|
||||
),
|
||||
->validator(
|
||||
Validate::maxLen(100),
|
||||
array(
|
||||
'message' => lang('ClienteDirecciones.validation.max_length')
|
||||
)
|
||||
),
|
||||
Field::inst('email')
|
||||
->validator('Validate::notEmpty', array(
|
||||
'message' => lang('ClienteDirecciones.validation.required'))
|
||||
->validator(
|
||||
'Validate::notEmpty',
|
||||
array(
|
||||
'message' => lang('ClienteDirecciones.validation.required')
|
||||
)
|
||||
)
|
||||
->validator( Validate::maxLen( 100 ) , array(
|
||||
'message' => lang('ClienteDirecciones.validation.max_length'))
|
||||
),
|
||||
->validator(
|
||||
Validate::maxLen(100),
|
||||
array(
|
||||
'message' => lang('ClienteDirecciones.validation.max_length')
|
||||
)
|
||||
),
|
||||
Field::inst('direccion')
|
||||
->validator('Validate::notEmpty', array(
|
||||
'message' => lang('ClienteDirecciones.validation.required'))
|
||||
->validator(
|
||||
'Validate::notEmpty',
|
||||
array(
|
||||
'message' => lang('ClienteDirecciones.validation.required')
|
||||
)
|
||||
)
|
||||
->validator( Validate::maxLen( 255 ) , array(
|
||||
'message' => lang('ClienteDirecciones.validation.max_length'))
|
||||
),
|
||||
->validator(
|
||||
Validate::maxLen(255),
|
||||
array(
|
||||
'message' => lang('ClienteDirecciones.validation.max_length')
|
||||
)
|
||||
),
|
||||
Field::inst('municipio')
|
||||
->validator('Validate::notEmpty', array(
|
||||
'message' => lang('ClienteDirecciones.validation.required'))
|
||||
->validator(
|
||||
'Validate::notEmpty',
|
||||
array(
|
||||
'message' => lang('ClienteDirecciones.validation.required')
|
||||
)
|
||||
)
|
||||
->validator( Validate::maxLen( 100 ) , array(
|
||||
'message' => lang('ClienteDirecciones.validation.max_length'))
|
||||
),
|
||||
->validator(
|
||||
Validate::maxLen(100),
|
||||
array(
|
||||
'message' => lang('ClienteDirecciones.validation.max_length')
|
||||
)
|
||||
),
|
||||
Field::inst('cp')
|
||||
->validator('Validate::notEmpty', array(
|
||||
'message' => lang('ClienteDirecciones.validation.required'))
|
||||
->validator(
|
||||
'Validate::notEmpty',
|
||||
array(
|
||||
'message' => lang('ClienteDirecciones.validation.required')
|
||||
)
|
||||
)
|
||||
->validator( Validate::maxLen( 20 ) , array(
|
||||
'message' => lang('ClienteDirecciones.validation.max_length'))
|
||||
),
|
||||
->validator(
|
||||
Validate::maxLen(20),
|
||||
array(
|
||||
'message' => lang('ClienteDirecciones.validation.max_length')
|
||||
)
|
||||
),
|
||||
Field::inst('telefono')
|
||||
->validator('Validate::notEmpty', array(
|
||||
'message' => lang('ClienteDirecciones.validation.required'))
|
||||
->validator(
|
||||
'Validate::notEmpty',
|
||||
array(
|
||||
'message' => lang('ClienteDirecciones.validation.required')
|
||||
)
|
||||
)
|
||||
->validator( Validate::maxLen( 40 ) , array(
|
||||
'message' => lang('ClienteDirecciones.validation.max_length'))
|
||||
),
|
||||
->validator(
|
||||
Validate::maxLen(40),
|
||||
array(
|
||||
'message' => lang('ClienteDirecciones.validation.max_length')
|
||||
)
|
||||
),
|
||||
Field::inst('provincia')
|
||||
->validator( function ( $val, $data, $field, $host ) {
|
||||
if ($data['pais_id'] == 1) { // Si es españa provincia y CCAA es obligatorio
|
||||
if (strlen( $val ) > 100)
|
||||
return lang('ClienteDirecciones.validation.max_length');
|
||||
else if (strlen( $val ) == 0)
|
||||
lang('ClienteDirecciones.validation.required');
|
||||
else
|
||||
return true;
|
||||
->validator(
|
||||
function ($val, $data, $field, $host) {
|
||||
if ($data['pais_id'] == 1) { // Si es españa provincia y CCAA es obligatorio
|
||||
if (strlen($val) > 100)
|
||||
return lang('ClienteDirecciones.validation.max_length');
|
||||
else if (strlen($val) == 0)
|
||||
lang('ClienteDirecciones.validation.required');
|
||||
else
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
),
|
||||
),
|
||||
Field::inst('pais_id')->validator('Validate::notEmpty', array(
|
||||
'message' => lang('ClienteDirecciones.validation.required'))),
|
||||
'message' => lang('ClienteDirecciones.validation.required')
|
||||
)),
|
||||
Field::inst('cliente_id'),
|
||||
)
|
||||
|
||||
|
||||
->debug(true)
|
||||
->process($_POST)
|
||||
->data();
|
||||
@ -270,7 +378,6 @@ class Clientedirecciones extends \App\Controllers\BaseResourceController
|
||||
$response[$csrfTokenName] = $newTokenHash;
|
||||
|
||||
echo json_encode($response);
|
||||
|
||||
} else {
|
||||
return $this->failUnauthorized('Invalid request', 403);
|
||||
}
|
||||
|
||||
@ -33,7 +33,6 @@ class ConfigVariables extends BaseResourceController
|
||||
|
||||
parent::initController($request, $response, $logger);
|
||||
$this->configVariableModel = model(ConfigVariableModel::class);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -48,45 +47,46 @@ class ConfigVariables extends BaseResourceController
|
||||
|
||||
return view(static::$viewPath . $this->indexRoute, $viewData);
|
||||
}
|
||||
public function store(){
|
||||
public function store()
|
||||
{
|
||||
$data = [];
|
||||
$variableCreated = $this->configVariableModel->store($data);
|
||||
return $this->response->setJSON($variableCreated);
|
||||
}
|
||||
public function get(int $config_variable_id){
|
||||
public function get(int $config_variable_id)
|
||||
{
|
||||
$data = $this->configVariableModel->find($config_variable_id);
|
||||
return $this->response->setJSON($data);
|
||||
}
|
||||
public function updateVariable(int $config_variable_id){
|
||||
public function updateVariable(int $config_variable_id)
|
||||
{
|
||||
$reqData = [];
|
||||
if ($this->request->isAJAX()) {
|
||||
$reqData = $this->request->getPost();
|
||||
$status = $this->configVariableModel->update($config_variable_id,$reqData);
|
||||
$status = $this->configVariableModel->update($config_variable_id, $reqData);
|
||||
return $this->response->setJSON([
|
||||
"message" => "Variable actualizada correctamente",
|
||||
"status" => $status
|
||||
]);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
return $this->failUnauthorized('Invalid request', 403);
|
||||
}
|
||||
}
|
||||
public function deleteVariable(int $config_variable_id): Response
|
||||
{
|
||||
return $this->response->setJSON([]);
|
||||
|
||||
}
|
||||
public function datatable(){
|
||||
public function datatable()
|
||||
{
|
||||
|
||||
$query = $this->configVariableModel->builder()->select([
|
||||
"id",
|
||||
"name",
|
||||
"value",
|
||||
"description"])->orderBy("name","asc");
|
||||
"description"
|
||||
])->orderBy("name", "asc");
|
||||
return DataTable::of($query)
|
||||
->add("action",fn($q) => $q->id)
|
||||
->toJson(true);
|
||||
->add("action", fn($q) => $q->id)
|
||||
->toJson(true);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -1,4 +1,5 @@
|
||||
<?php namespace App\Controllers\Configuracion;
|
||||
<?php
|
||||
namespace App\Controllers\Configuracion;
|
||||
|
||||
|
||||
use App\Controllers\BaseResourceController;
|
||||
@ -12,8 +13,8 @@ use App\Models\Configuracion\MaquinasTarifasImpresionModel;
|
||||
use App\Models\Configuracion\MaquinaModel;
|
||||
|
||||
use
|
||||
DataTables\Editor,
|
||||
DataTables\Editor\Field;
|
||||
DataTables\Editor,
|
||||
DataTables\Editor\Field;
|
||||
|
||||
class Maquinastarifasimpresion extends \App\Controllers\BaseResourceController
|
||||
{
|
||||
@ -69,9 +70,9 @@ class Maquinastarifasimpresion extends \App\Controllers\BaseResourceController
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
if ($this->request->getPost()) :
|
||||
|
||||
if ($this->request->getPost()):
|
||||
|
||||
$nullIfEmpty = true; // !(phpversion() >= '8.1');
|
||||
|
||||
@ -81,10 +82,10 @@ class Maquinastarifasimpresion extends \App\Controllers\BaseResourceController
|
||||
|
||||
|
||||
$noException = true;
|
||||
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
|
||||
if ($successfulResult = $this->canValidate()): // if ($successfulResult = $this->validate($this->formValidationRules) ) :
|
||||
|
||||
|
||||
if ($this->canValidate()) :
|
||||
if ($this->canValidate()):
|
||||
try {
|
||||
$successfulResult = $this->model->skipValidation(true)->save($sanitizedData);
|
||||
} catch (\Exception $e) {
|
||||
@ -98,14 +99,14 @@ class Maquinastarifasimpresion extends \App\Controllers\BaseResourceController
|
||||
|
||||
$thenRedirect = true; // Change this to false if you want your user to stay on the form after submission
|
||||
endif;
|
||||
if ($noException && $successfulResult) :
|
||||
if ($noException && $successfulResult):
|
||||
|
||||
$id = $this->model->db->insertID();
|
||||
|
||||
$message = lang('Basic.global.saveSuccess', [lang('Basic.global.record')]) . '.';
|
||||
|
||||
if ($thenRedirect) :
|
||||
if (!empty($this->indexRoute)) :
|
||||
if ($thenRedirect):
|
||||
if (!empty($this->indexRoute)):
|
||||
return redirect()->to(route_to($this->indexRoute))->with('sweet-success', $message);
|
||||
else:
|
||||
return $this->redirect2listView('sweet-success', $message);
|
||||
@ -129,25 +130,25 @@ class Maquinastarifasimpresion extends \App\Controllers\BaseResourceController
|
||||
|
||||
return $this->displayForm(__METHOD__);
|
||||
} // end function add()
|
||||
|
||||
|
||||
|
||||
public function edit($requestedId = null)
|
||||
{
|
||||
|
||||
if ($requestedId == null) :
|
||||
if ($requestedId == null):
|
||||
return $this->redirect2listView();
|
||||
endif;
|
||||
$id = filter_var($requestedId, FILTER_SANITIZE_URL);
|
||||
$maquinasTarifasImpresion = $this->model->find($id);
|
||||
|
||||
if ($maquinasTarifasImpresion == false) :
|
||||
if ($maquinasTarifasImpresion == false):
|
||||
$message = lang('Basic.global.notFoundWithIdErr', [mb_strtolower(lang('MaquinasTarifasImpresions.maquinasTarifaImpresion')), $id]);
|
||||
return $this->redirect2listView('sweet-error', $message);
|
||||
endif;
|
||||
|
||||
|
||||
|
||||
if ($this->request->getPost()) :
|
||||
|
||||
if ($this->request->getPost()):
|
||||
|
||||
$nullIfEmpty = true; // !(phpversion() >= '8.1');
|
||||
|
||||
@ -160,10 +161,10 @@ class Maquinastarifasimpresion extends \App\Controllers\BaseResourceController
|
||||
|
||||
|
||||
$noException = true;
|
||||
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
|
||||
if ($successfulResult = $this->canValidate()): // if ($successfulResult = $this->validate($this->formValidationRules) ) :
|
||||
|
||||
|
||||
if ($this->canValidate()) :
|
||||
if ($this->canValidate()):
|
||||
try {
|
||||
$successfulResult = $this->model->skipValidation(true)->update($id, $sanitizedData);
|
||||
} catch (\Exception $e) {
|
||||
@ -180,12 +181,12 @@ class Maquinastarifasimpresion extends \App\Controllers\BaseResourceController
|
||||
|
||||
$thenRedirect = false;
|
||||
endif;
|
||||
if ($noException && $successfulResult) :
|
||||
if ($noException && $successfulResult):
|
||||
$id = $maquinasTarifasImpresion->id ?? $id;
|
||||
$message = lang('Basic.global.updateSuccess', [lang('Basic.global.record')]) . '.';
|
||||
|
||||
if ($thenRedirect) :
|
||||
if (!empty($this->indexRoute)) :
|
||||
if ($thenRedirect):
|
||||
if (!empty($this->indexRoute)):
|
||||
return redirect()->to(route_to($this->indexRoute))->with('sweet-success', $message);
|
||||
else:
|
||||
return $this->redirect2listView('sweet-success', $message);
|
||||
@ -220,30 +221,48 @@ class Maquinastarifasimpresion extends \App\Controllers\BaseResourceController
|
||||
$response = Editor::inst($db, 'lg_maquinas_tarifas_impresion')
|
||||
->fields(
|
||||
Field::inst('uso')
|
||||
->validator('Validate::notEmpty', array(
|
||||
'message' => lang('MaquinasTarifasImpresions.validation.uso.required'))
|
||||
->validator(
|
||||
'Validate::notEmpty',
|
||||
array(
|
||||
'message' => lang('MaquinasTarifasImpresions.validation.uso.required')
|
||||
)
|
||||
),
|
||||
Field::inst('tipo')
|
||||
->validator('Validate::notEmpty', array(
|
||||
'message' => lang('MaquinasTarifasImpresions.validation.tipo.required'))
|
||||
->validator(
|
||||
'Validate::notEmpty',
|
||||
array(
|
||||
'message' => lang('MaquinasTarifasImpresions.validation.tipo.required')
|
||||
)
|
||||
),
|
||||
Field::inst('precio')
|
||||
->getFormatter( 'Format::toDecimalChar')->setFormatter( 'Format::fromDecimalChar')
|
||||
->validator('Validate::numeric', array(
|
||||
->getFormatter('Format::toDecimalChar')->setFormatter('Format::fromDecimalChar')
|
||||
->validator(
|
||||
'Validate::numeric',
|
||||
array(
|
||||
"decimal" => ',',
|
||||
'message' => lang('MaquinasTarifasImpresions.validation.precio.decimal'))
|
||||
'message' => lang('MaquinasTarifasImpresions.validation.precio.decimal')
|
||||
)
|
||||
)
|
||||
->validator('Validate::notEmpty', array(
|
||||
'message' => lang('MaquinasTarifasImpresions.validation.tipo.required'))
|
||||
->validator(
|
||||
'Validate::notEmpty',
|
||||
array(
|
||||
'message' => lang('MaquinasTarifasImpresions.validation.tipo.required')
|
||||
)
|
||||
),
|
||||
Field::inst('margen')
|
||||
->getFormatter( 'Format::toDecimalChar')->setFormatter( 'Format::fromDecimalChar')
|
||||
->validator('Validate::numeric', array(
|
||||
->getFormatter('Format::toDecimalChar')->setFormatter('Format::fromDecimalChar')
|
||||
->validator(
|
||||
'Validate::numeric',
|
||||
array(
|
||||
"decimal" => ',',
|
||||
'message' => lang('MaquinasTarifasImpresions.validation.precio.decimal'))
|
||||
'message' => lang('MaquinasTarifasImpresions.validation.precio.decimal')
|
||||
)
|
||||
)
|
||||
->validator('Validate::notEmpty', array(
|
||||
'message' => lang('MaquinasTarifasImpresions.validation.tipo.required'))
|
||||
->validator(
|
||||
'Validate::notEmpty',
|
||||
array(
|
||||
'message' => lang('MaquinasTarifasImpresions.validation.tipo.required')
|
||||
)
|
||||
),
|
||||
Field::inst('maquina_id'),
|
||||
Field::inst('user_created_id'),
|
||||
@ -269,16 +288,21 @@ class Maquinastarifasimpresion extends \App\Controllers\BaseResourceController
|
||||
'maquina_id' => $values['maquina_id'],
|
||||
'tipo' => $values['tipo'],
|
||||
'uso' => $values['uso'],
|
||||
'is_deleted' => 0));
|
||||
'is_deleted' => 0
|
||||
));
|
||||
|
||||
$id = $builder->get()->getFirstRow()->id;
|
||||
$id = $builder->get()->getFirstRow();
|
||||
if ($id) {
|
||||
$id = $id->id;
|
||||
// No se pueden duplicar valores al crear o al editar
|
||||
if ($builder->countAllResults() >= 1) {
|
||||
if (
|
||||
($action === Editor::ACTION_EDIT && $id != $pkey)
|
||||
|| $action === Editor::ACTION_CREATE
|
||||
) {
|
||||
|
||||
// No se pueden duplicar valores al crear o al editar
|
||||
if ($builder->countAllResults() >= 1) {
|
||||
if (($action === Editor::ACTION_EDIT && $id != $pkey)
|
||||
|| $action === Editor::ACTION_CREATE) {
|
||||
|
||||
return lang('MaquinasTarifasImpresions.validation.duplicated_uso_tipo');
|
||||
return lang('MaquinasTarifasImpresions.validation.duplicated_uso_tipo');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -413,11 +437,11 @@ class Maquinastarifasimpresion extends \App\Controllers\BaseResourceController
|
||||
protected function getMaquinaListItems($selId = null)
|
||||
{
|
||||
$data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Maquinas.maquina'))])];
|
||||
if (!empty($selId)) :
|
||||
if (!empty($selId)):
|
||||
$maquinaModel = model('App\Models\Configuracion\MaquinaModel');
|
||||
|
||||
$selOption = $maquinaModel->where('id', $selId)->findColumn('nombre');
|
||||
if (!empty($selOption)) :
|
||||
if (!empty($selOption)):
|
||||
$data[$selId] = $selOption[0];
|
||||
endif;
|
||||
endif;
|
||||
|
||||
@ -244,23 +244,15 @@ class Papelformato extends \App\Controllers\BaseResourceController {
|
||||
|
||||
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 ?? 'ancho'];
|
||||
$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();
|
||||
$papelFormatoModel = model('App\Models\Configuracion\PapelFormatoModel');
|
||||
$searchStr = goSanitize($this->request->getPfgost('searchTerm'))[0];
|
||||
$menu = $papelFormatoModel->getElementsForMenu2($searchStr);
|
||||
if(empty(($searchStr)))
|
||||
array_shift($menu);
|
||||
|
||||
$data = [
|
||||
'menu' => $menu,
|
||||
$csrfTokenName => $newTokenHash
|
||||
|
||||
];
|
||||
return $this->respond($data);
|
||||
} else {
|
||||
@ -268,4 +260,15 @@ class Papelformato extends \App\Controllers\BaseResourceController {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function getSelect2()
|
||||
{
|
||||
if ($this->request->isAJAX()) {
|
||||
$data = $this->model->getElementsForMenu2($this->request->getGet("q"));
|
||||
|
||||
return $this->response->setJSON($data);
|
||||
} else {
|
||||
return $this->failUnauthorized('Invalid request', 403);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -15,4 +15,15 @@ class Language extends BaseController
|
||||
$url = previous_url();
|
||||
return redirect()->to($url);
|
||||
}
|
||||
|
||||
|
||||
// Function to get the translation of the language file from a AJAX request
|
||||
public function getTranslation()
|
||||
{
|
||||
$translationFile = $this->request->getPost('translationFile');
|
||||
$locale = $this->request->getPost('locale');
|
||||
$path = "Language/{$locale}/$translationFile.php";
|
||||
$lang = require APPPATH.$path;
|
||||
return json_encode($lang);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1278,8 +1278,8 @@ class Cosidotapablanda extends \App\Controllers\BaseResourceController
|
||||
$input_data['is_duplicado'] = $presupuestoEntity->is_duplicado;
|
||||
|
||||
if($presupuestoEntity->papel_formato_personalizado){
|
||||
$input_data['ancho'] = $presupuestoEntity->ancho;
|
||||
$input_data['alto'] = $presupuestoEntity->alto;
|
||||
$input_data['ancho'] = $presupuestoEntity->papel_formato_ancho ;
|
||||
$input_data['alto'] = $presupuestoEntity->papel_formato_alto ;
|
||||
}
|
||||
else{
|
||||
$model = model("App\Models\Configuracion\PapelFormatoModel");
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -39,10 +39,10 @@ class TarifaAcabados extends BaseResourceController
|
||||
|
||||
$this->viewData = ['usingServerSideDataTable' => true];
|
||||
|
||||
// Breadcrumbs
|
||||
// Breadcrumbs
|
||||
$this->viewData['breadcrumb'] = [
|
||||
['title' => lang("App.menu_tarifas"), 'route' => "javascript:void(0);", 'active' => false],
|
||||
['title' => lang("App.menu_tarifaacabado"), 'route' => site_url('tarifas/tarifaacabado'), 'active' => true]
|
||||
['title' => lang("App.menu_tarifaacabado"), 'route' => site_url('tarifas/acabados'), 'active' => true]
|
||||
];
|
||||
|
||||
parent::initController($request, $response, $logger);
|
||||
@ -133,6 +133,8 @@ class TarifaAcabados extends BaseResourceController
|
||||
|
||||
endif; // ($requestMethod === 'post')
|
||||
|
||||
$this->viewData['proveedores'] = $this->getProveedores();
|
||||
|
||||
$this->viewData['tarifaacabadoEntity'] = isset($sanitizedData) ? new TarifaAcabadoEntity($sanitizedData) : new TarifaAcabadoEntity();
|
||||
$this->viewData['formAction'] = route_to('tarifaAcabadoAdd');
|
||||
$this->viewData['boxTitle'] = lang('Basic.global.addNew') . ' ' . lang('Tarifaacabado.moduleTitle') . ' ' . lang('Basic.global.addNewSuffix');
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
<?php namespace App\Controllers\Tarifas;
|
||||
<?php
|
||||
namespace App\Controllers\Tarifas;
|
||||
|
||||
|
||||
use App\Controllers\BaseResourceController;
|
||||
@ -10,15 +11,15 @@ 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;
|
||||
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\BaseResourceController
|
||||
@ -73,9 +74,9 @@ class Tarifaencuadernacionlineas extends \App\Controllers\BaseResourceController
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
if ($this->request->getPost()) :
|
||||
|
||||
if ($this->request->getPost()):
|
||||
|
||||
$nullIfEmpty = true; // !(phpversion() >= '8.1');
|
||||
|
||||
@ -84,10 +85,10 @@ class Tarifaencuadernacionlineas extends \App\Controllers\BaseResourceController
|
||||
$sanitizedData = $this->sanitized($postData, $nullIfEmpty);
|
||||
|
||||
$noException = true;
|
||||
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
|
||||
if ($successfulResult = $this->canValidate()): // if ($successfulResult = $this->validate($this->formValidationRules) ) :
|
||||
|
||||
|
||||
if ($this->canValidate()) :
|
||||
if ($this->canValidate()):
|
||||
try {
|
||||
$successfulResult = $this->model->skipValidation(true)->save($sanitizedData);
|
||||
} catch (\Exception $e) {
|
||||
@ -101,14 +102,14 @@ class Tarifaencuadernacionlineas extends \App\Controllers\BaseResourceController
|
||||
|
||||
$thenRedirect = true; // Change this to false if you want your user to stay on the form after submission
|
||||
endif;
|
||||
if ($noException && $successfulResult) :
|
||||
if ($noException && $successfulResult):
|
||||
|
||||
$id = $this->model->db->insertID();
|
||||
|
||||
$message = lang('Basic.global.saveSuccess', [lang('Basic.global.record')]) . '.';
|
||||
|
||||
if ($thenRedirect) :
|
||||
if (!empty($this->indexRoute)) :
|
||||
if ($thenRedirect):
|
||||
if (!empty($this->indexRoute)):
|
||||
return redirect()->to(route_to($this->indexRoute))->with('sweet-success', $message);
|
||||
else:
|
||||
return $this->redirect2listView('sweet-success', $message);
|
||||
@ -134,20 +135,20 @@ class Tarifaencuadernacionlineas extends \App\Controllers\BaseResourceController
|
||||
public function edit($requestedId = null)
|
||||
{
|
||||
|
||||
if ($requestedId == null) :
|
||||
if ($requestedId == null):
|
||||
return $this->redirect2listView();
|
||||
endif;
|
||||
$id = filter_var($requestedId, FILTER_SANITIZE_URL);
|
||||
$tarifaEncuadernacionLinea = $this->model->find($id);
|
||||
|
||||
if ($tarifaEncuadernacionLinea == false) :
|
||||
if ($tarifaEncuadernacionLinea == false):
|
||||
$message = lang('Basic.global.notFoundWithIdErr', [mb_strtolower(lang('TarifaEncuadernacionLineas.tarifaencuadernacionLinea')), $id]);
|
||||
return $this->redirect2listView('sweet-error', $message);
|
||||
endif;
|
||||
|
||||
|
||||
|
||||
if ($this->request->getPost()) :
|
||||
|
||||
if ($this->request->getPost()):
|
||||
|
||||
$nullIfEmpty = true; // !(phpversion() >= '8.1');
|
||||
|
||||
@ -156,10 +157,10 @@ class Tarifaencuadernacionlineas extends \App\Controllers\BaseResourceController
|
||||
$sanitizedData = $this->sanitized($postData, $nullIfEmpty);
|
||||
|
||||
$noException = true;
|
||||
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
|
||||
if ($successfulResult = $this->canValidate()): // if ($successfulResult = $this->validate($this->formValidationRules) ) :
|
||||
|
||||
|
||||
if ($this->canValidate()) :
|
||||
if ($this->canValidate()):
|
||||
try {
|
||||
$successfulResult = $this->model->skipValidation(true)->update($id, $sanitizedData);
|
||||
} catch (\Exception $e) {
|
||||
@ -176,12 +177,12 @@ class Tarifaencuadernacionlineas extends \App\Controllers\BaseResourceController
|
||||
|
||||
$thenRedirect = false;
|
||||
endif;
|
||||
if ($noException && $successfulResult) :
|
||||
if ($noException && $successfulResult):
|
||||
$id = $tarifaEncuadernacionLinea->id ?? $id;
|
||||
$message = lang('Basic.global.updateSuccess', [lang('Basic.global.record')]) . '.';
|
||||
|
||||
if ($thenRedirect) :
|
||||
if (!empty($this->indexRoute)) :
|
||||
if ($thenRedirect):
|
||||
if (!empty($this->indexRoute)):
|
||||
return redirect()->to(route_to($this->indexRoute))->with('sweet-success', $message);
|
||||
else:
|
||||
return $this->redirect2listView('sweet-success', $message);
|
||||
@ -214,45 +215,90 @@ class Tarifaencuadernacionlineas extends \App\Controllers\BaseResourceController
|
||||
$response = Editor::inst($db, 'tarifa_encuadernacion_lineas')
|
||||
->fields(
|
||||
Field::inst('paginas_libro_min')
|
||||
->validator('Validate::numeric', array(
|
||||
'message' => lang('TarifaAcabadoLineas.validation.paginas_libro_min.decimal'))
|
||||
->validator(
|
||||
'Validate::numeric',
|
||||
array(
|
||||
'message' => lang('TarifaAcabadoLineas.validation.paginas_libro_min.decimal')
|
||||
)
|
||||
)
|
||||
->validator('Validate::notEmpty', array(
|
||||
'message' => lang('TarifaAcabadoLineas.validation.paginas_libro_min.required'))
|
||||
->validator(
|
||||
'Validate::notEmpty',
|
||||
array(
|
||||
'message' => lang('TarifaAcabadoLineas.validation.paginas_libro_min.required')
|
||||
)
|
||||
),
|
||||
Field::inst('paginas_libro_max')
|
||||
->validator('Validate::numeric', array(
|
||||
'message' => lang('TarifaAcabadoLineas.validation.paginas_libro_max.decimal'))
|
||||
->validator(
|
||||
'Validate::numeric',
|
||||
array(
|
||||
'message' => lang('TarifaAcabadoLineas.validation.paginas_libro_max.decimal')
|
||||
)
|
||||
)
|
||||
->validator('Validate::notEmpty', array(
|
||||
'message' => lang('TarifaAcabadoLineas.validation.paginas_libro_max.required'))
|
||||
->validator(
|
||||
'Validate::notEmpty',
|
||||
array(
|
||||
'message' => lang('TarifaAcabadoLineas.validation.paginas_libro_max.required')
|
||||
)
|
||||
),
|
||||
Field::inst('precio_min')
|
||||
->getFormatter( 'Format::toDecimalChar')->setFormatter( 'Format::fromDecimalChar')
|
||||
->validator('Validate::numeric', array(
|
||||
->getFormatter('Format::toDecimalChar')->setFormatter('Format::fromDecimalChar')
|
||||
->validator(
|
||||
'Validate::numeric',
|
||||
array(
|
||||
"decimal" => ',',
|
||||
'message' => lang('TarifaAcabadoLineas.validation.precio_min.decimal'))
|
||||
'message' => lang('TarifaAcabadoLineas.validation.precio_min.decimal')
|
||||
)
|
||||
)
|
||||
->validator('Validate::notEmpty', array(
|
||||
'message' => lang('TarifaAcabadoLineas.validation.precio_min.required'))
|
||||
->validator(
|
||||
'Validate::notEmpty',
|
||||
array(
|
||||
'message' => lang('TarifaAcabadoLineas.validation.precio_min.required')
|
||||
)
|
||||
),
|
||||
Field::inst('precio_max')
|
||||
->getFormatter( 'Format::toDecimalChar')->setFormatter( 'Format::fromDecimalChar')
|
||||
->validator('Validate::numeric', array(
|
||||
->getFormatter('Format::toDecimalChar')->setFormatter('Format::fromDecimalChar')
|
||||
->validator(
|
||||
'Validate::numeric',
|
||||
array(
|
||||
"decimal" => ',',
|
||||
'message' => lang('TarifaAcabadoLineas.validation.precio_max.decimal'))
|
||||
'message' => lang('TarifaAcabadoLineas.validation.precio_max.decimal')
|
||||
)
|
||||
)
|
||||
->validator('Validate::notEmpty', array(
|
||||
'message' => lang('TarifaAcabadoLineas.validation.precio_max.required'))
|
||||
->validator(
|
||||
'Validate::notEmpty',
|
||||
array(
|
||||
'message' => lang('TarifaAcabadoLineas.validation.precio_max.required')
|
||||
)
|
||||
),
|
||||
Field::inst('total_min')
|
||||
->getFormatter('Format::toDecimalChar')->setFormatter('Format::fromDecimalChar')
|
||||
->validator(
|
||||
'Validate::numeric',
|
||||
array(
|
||||
"decimal" => ',',
|
||||
'message' => lang('TarifaEncuadernacionTiradas.validation.tirada_min.decimal')
|
||||
)
|
||||
)
|
||||
->validator(
|
||||
'Validate::notEmpty',
|
||||
array(
|
||||
'message' => lang('TarifaEncuadernacionTiradas.validation.tirada_min.required')
|
||||
)
|
||||
),
|
||||
Field::inst('margen')
|
||||
->getFormatter( 'Format::toDecimalChar')->setFormatter( 'Format::fromDecimalChar')
|
||||
->validator('Validate::numeric', array(
|
||||
->getFormatter('Format::toDecimalChar')->setFormatter('Format::fromDecimalChar')
|
||||
->validator(
|
||||
'Validate::numeric',
|
||||
array(
|
||||
"decimal" => ',',
|
||||
'message' => lang('TarifaAcabadoLineas.validation.margen.decimal'))
|
||||
'message' => lang('TarifaAcabadoLineas.validation.margen.decimal')
|
||||
)
|
||||
)
|
||||
->validator('Validate::notEmpty', array(
|
||||
'message' => lang('TarifaAcabadoLineas.validation.margen.required'))
|
||||
->validator(
|
||||
'Validate::notEmpty',
|
||||
array(
|
||||
'message' => lang('TarifaAcabadoLineas.validation.margen.required')
|
||||
)
|
||||
),
|
||||
Field::inst('tirada_encuadernacion_id'),
|
||||
Field::inst('user_created_id'),
|
||||
@ -322,10 +368,10 @@ class Tarifaencuadernacionlineas extends \App\Controllers\BaseResourceController
|
||||
if ($this->request->isAJAX()) {
|
||||
|
||||
$reqData = $this->request->getPost();
|
||||
|
||||
|
||||
$cleandatatable = $reqData['cleandatatable'] ?? 0;
|
||||
|
||||
if($cleandatatable){
|
||||
|
||||
if ($cleandatatable) {
|
||||
|
||||
$tarifa_encuadernacion_id = $reqData['tarifa_encuadernacion_id'] ?? -1;
|
||||
|
||||
@ -338,11 +384,9 @@ class Tarifaencuadernacionlineas extends \App\Controllers\BaseResourceController
|
||||
$csrfTokenName => $newTokenHash
|
||||
];
|
||||
return $this->respond($data);
|
||||
|
||||
}
|
||||
|
||||
else{
|
||||
|
||||
} else {
|
||||
|
||||
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);
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
<?php namespace App\Controllers\Tarifas;
|
||||
<?php
|
||||
namespace App\Controllers\Tarifas;
|
||||
|
||||
|
||||
use App\Controllers\BaseResourceController;
|
||||
@ -10,15 +11,15 @@ use App\Entities\Tarifas\TarifaEncuadernacionLinea;
|
||||
use App\Models\Tarifas\TarifaEncuadernacionLineaHorasModel;
|
||||
|
||||
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;
|
||||
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 Tarifaencuadernacionlineashoras extends \App\Controllers\BaseResourceController
|
||||
@ -71,9 +72,9 @@ class Tarifaencuadernacionlineashoras extends \App\Controllers\BaseResourceContr
|
||||
|
||||
public function add()
|
||||
{
|
||||
|
||||
|
||||
if ($this->request->getPost()) :
|
||||
|
||||
if ($this->request->getPost()):
|
||||
|
||||
$nullIfEmpty = true; // !(phpversion() >= '8.1');
|
||||
|
||||
@ -82,10 +83,10 @@ class Tarifaencuadernacionlineashoras extends \App\Controllers\BaseResourceContr
|
||||
$sanitizedData = $this->sanitized($postData, $nullIfEmpty);
|
||||
|
||||
$noException = true;
|
||||
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
|
||||
if ($successfulResult = $this->canValidate()): // if ($successfulResult = $this->validate($this->formValidationRules) ) :
|
||||
|
||||
|
||||
if ($this->canValidate()) :
|
||||
if ($this->canValidate()):
|
||||
try {
|
||||
$successfulResult = $this->model->skipValidation(true)->save($sanitizedData);
|
||||
} catch (\Exception $e) {
|
||||
@ -99,14 +100,14 @@ class Tarifaencuadernacionlineashoras extends \App\Controllers\BaseResourceContr
|
||||
|
||||
$thenRedirect = true; // Change this to false if you want your user to stay on the form after submission
|
||||
endif;
|
||||
if ($noException && $successfulResult) :
|
||||
if ($noException && $successfulResult):
|
||||
|
||||
$id = $this->model->db->insertID();
|
||||
|
||||
$message = lang('Basic.global.saveSuccess', [lang('Basic.global.record')]) . '.';
|
||||
|
||||
if ($thenRedirect) :
|
||||
if (!empty($this->indexRoute)) :
|
||||
if ($thenRedirect):
|
||||
if (!empty($this->indexRoute)):
|
||||
return redirect()->to(route_to($this->indexRoute))->with('sweet-success', $message);
|
||||
else:
|
||||
return $this->redirect2listView('sweet-success', $message);
|
||||
@ -134,20 +135,20 @@ class Tarifaencuadernacionlineashoras extends \App\Controllers\BaseResourceContr
|
||||
public function edit($requestedId = null)
|
||||
{
|
||||
|
||||
if ($requestedId == null) :
|
||||
if ($requestedId == null):
|
||||
return $this->redirect2listView();
|
||||
endif;
|
||||
$id = filter_var($requestedId, FILTER_SANITIZE_URL);
|
||||
$tarifaEncuadernacionLinea = $this->model->find($id);
|
||||
|
||||
if ($tarifaEncuadernacionLinea == false) :
|
||||
if ($tarifaEncuadernacionLinea == false):
|
||||
$message = lang('Basic.global.notFoundWithIdErr', [mb_strtolower(lang('TarifaEncuadernacionLineas.tarifaencuadernacionLinea')), $id]);
|
||||
return $this->redirect2listView('sweet-error', $message);
|
||||
endif;
|
||||
|
||||
|
||||
|
||||
if ($this->request->getPost()) :
|
||||
|
||||
if ($this->request->getPost()):
|
||||
|
||||
$nullIfEmpty = true; // !(phpversion() >= '8.1');
|
||||
|
||||
@ -156,10 +157,10 @@ class Tarifaencuadernacionlineashoras extends \App\Controllers\BaseResourceContr
|
||||
$sanitizedData = $this->sanitized($postData, $nullIfEmpty);
|
||||
|
||||
$noException = true;
|
||||
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
|
||||
if ($successfulResult = $this->canValidate()): // if ($successfulResult = $this->validate($this->formValidationRules) ) :
|
||||
|
||||
|
||||
if ($this->canValidate()) :
|
||||
if ($this->canValidate()):
|
||||
try {
|
||||
$successfulResult = $this->model->skipValidation(true)->update($id, $sanitizedData);
|
||||
} catch (\Exception $e) {
|
||||
@ -176,12 +177,12 @@ class Tarifaencuadernacionlineashoras extends \App\Controllers\BaseResourceContr
|
||||
|
||||
$thenRedirect = false;
|
||||
endif;
|
||||
if ($noException && $successfulResult) :
|
||||
if ($noException && $successfulResult):
|
||||
$id = $tarifaEncuadernacionLinea->id ?? $id;
|
||||
$message = lang('Basic.global.updateSuccess', [lang('Basic.global.record')]) . '.';
|
||||
|
||||
if ($thenRedirect) :
|
||||
if (!empty($this->indexRoute)) :
|
||||
if ($thenRedirect):
|
||||
if (!empty($this->indexRoute)):
|
||||
return redirect()->to(route_to($this->indexRoute))->with('sweet-success', $message);
|
||||
else:
|
||||
return $this->redirect2listView('sweet-success', $message);
|
||||
@ -214,40 +215,79 @@ class Tarifaencuadernacionlineashoras extends \App\Controllers\BaseResourceContr
|
||||
$response = Editor::inst($db, 'tarifa_encuadernacion_lineas_horas')
|
||||
->fields(
|
||||
Field::inst('tiempo_min')
|
||||
->getFormatter( 'Format::toDecimalChar')->setFormatter( 'Format::fromDecimalChar')
|
||||
->validator('Validate::numeric', array(
|
||||
->getFormatter('Format::toDecimalChar')->setFormatter('Format::fromDecimalChar')
|
||||
->validator(
|
||||
'Validate::numeric',
|
||||
array(
|
||||
"decimal" => ',',
|
||||
'message' => lang('TarifaAcabadoLineas.validation.paginas_libro_min.decimal'))
|
||||
'message' => lang('TarifaAcabadoLineas.validation.paginas_libro_min.decimal')
|
||||
)
|
||||
)
|
||||
->validator('Validate::notEmpty', array(
|
||||
'message' => lang('TarifaAcabadoLineas.validation.paginas_libro_min.required'))
|
||||
->validator(
|
||||
'Validate::notEmpty',
|
||||
array(
|
||||
'message' => lang('TarifaAcabadoLineas.validation.paginas_libro_min.required')
|
||||
)
|
||||
),
|
||||
Field::inst('tiempo_max')
|
||||
->getFormatter( 'Format::toDecimalChar')->setFormatter( 'Format::fromDecimalChar')
|
||||
->validator('Validate::numeric', array(
|
||||
->getFormatter('Format::toDecimalChar')->setFormatter('Format::fromDecimalChar')
|
||||
->validator(
|
||||
'Validate::numeric',
|
||||
array(
|
||||
"decimal" => ',',
|
||||
'message' => lang('TarifaAcabadoLineas.validation.paginas_libro_max.decimal'))
|
||||
'message' => lang('TarifaAcabadoLineas.validation.paginas_libro_max.decimal')
|
||||
)
|
||||
)
|
||||
->validator('Validate::notEmpty', array(
|
||||
'message' => lang('TarifaAcabadoLineas.validation.paginas_libro_max.required'))
|
||||
->validator(
|
||||
'Validate::notEmpty',
|
||||
array(
|
||||
'message' => lang('TarifaAcabadoLineas.validation.paginas_libro_max.required')
|
||||
)
|
||||
),
|
||||
Field::inst('precio_hora')
|
||||
->getFormatter( 'Format::toDecimalChar')->setFormatter( 'Format::fromDecimalChar')
|
||||
->validator('Validate::numeric', array(
|
||||
->getFormatter('Format::toDecimalChar')->setFormatter('Format::fromDecimalChar')
|
||||
->validator(
|
||||
'Validate::numeric',
|
||||
array(
|
||||
"decimal" => ',',
|
||||
'message' => lang('TarifaAcabadoLineas.validation.precio_min.decimal'))
|
||||
'message' => lang('TarifaAcabadoLineas.validation.precio_min.decimal')
|
||||
)
|
||||
)
|
||||
->validator('Validate::notEmpty', array(
|
||||
'message' => lang('TarifaAcabadoLineas.validation.precio_min.required'))
|
||||
->validator(
|
||||
'Validate::notEmpty',
|
||||
array(
|
||||
'message' => lang('TarifaAcabadoLineas.validation.precio_min.required')
|
||||
)
|
||||
),
|
||||
Field::inst('total_min')
|
||||
->getFormatter('Format::toDecimalChar')->setFormatter('Format::fromDecimalChar')
|
||||
->validator(
|
||||
'Validate::numeric',
|
||||
array(
|
||||
"decimal" => ',',
|
||||
'message' => lang('TarifaEncuadernacionTiradas.validation.tirada_min.decimal')
|
||||
)
|
||||
)
|
||||
->validator(
|
||||
'Validate::notEmpty',
|
||||
array(
|
||||
'message' => lang('TarifaEncuadernacionTiradas.validation.tirada_min.required')
|
||||
)
|
||||
),
|
||||
Field::inst('margen')
|
||||
->getFormatter( 'Format::toDecimalChar')->setFormatter( 'Format::fromDecimalChar')
|
||||
->validator('Validate::numeric', array(
|
||||
->getFormatter('Format::toDecimalChar')->setFormatter('Format::fromDecimalChar')
|
||||
->validator(
|
||||
'Validate::numeric',
|
||||
array(
|
||||
"decimal" => ',',
|
||||
'message' => lang('TarifaAcabadoLineas.validation.margen.decimal'))
|
||||
'message' => lang('TarifaAcabadoLineas.validation.margen.decimal')
|
||||
)
|
||||
)
|
||||
->validator('Validate::notEmpty', array(
|
||||
'message' => lang('TarifaAcabadoLineas.validation.margen.required'))
|
||||
->validator(
|
||||
'Validate::notEmpty',
|
||||
array(
|
||||
'message' => lang('TarifaAcabadoLineas.validation.margen.required')
|
||||
)
|
||||
),
|
||||
Field::inst('tirada_encuadernacion_id'),
|
||||
Field::inst('user_created_id'),
|
||||
@ -314,10 +354,10 @@ class Tarifaencuadernacionlineashoras extends \App\Controllers\BaseResourceContr
|
||||
{
|
||||
if ($this->request->isAJAX()) {
|
||||
$reqData = $this->request->getPost();
|
||||
|
||||
|
||||
$cleandatatable = $reqData['cleandatatable'] ?? 0;
|
||||
|
||||
if($cleandatatable){
|
||||
|
||||
if ($cleandatatable) {
|
||||
|
||||
$tarifa_encuadernacion_id = $reqData['tarifa_encuadernacion_id'] ?? -1;
|
||||
|
||||
@ -330,9 +370,8 @@ class Tarifaencuadernacionlineashoras extends \App\Controllers\BaseResourceContr
|
||||
$csrfTokenName => $newTokenHash
|
||||
];
|
||||
return $this->respond($data);
|
||||
|
||||
}
|
||||
else{
|
||||
|
||||
} else {
|
||||
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);
|
||||
|
||||
@ -126,15 +126,6 @@ class Tarifaencuadernaciontiradas extends \App\Controllers\BaseResourceControlle
|
||||
->validator('Validate::notEmpty', array(
|
||||
'message' => lang('TarifaEncuadernacionTiradas.validation.tirada_min.required'))
|
||||
),
|
||||
Field::inst('precio_min')
|
||||
->getFormatter( 'Format::toDecimalChar')->setFormatter( 'Format::fromDecimalChar')
|
||||
->validator('Validate::numeric', array(
|
||||
"decimal" => ',',
|
||||
'message' => lang('TarifaEncuadernacionTiradas.validation.tirada_min.decimal'))
|
||||
)
|
||||
->validator('Validate::notEmpty', array(
|
||||
'message' => lang('TarifaEncuadernacionTiradas.validation.tirada_min.required'))
|
||||
),
|
||||
Field::inst('proveedor_id')
|
||||
->validator('Validate::notEmpty', array(
|
||||
'message' => lang('TarifaEncuadernacionTiradas.validation.tirada_max.required'))
|
||||
|
||||
@ -64,7 +64,7 @@ class PresupuestoEntity extends \CodeIgniter\Entity\Entity
|
||||
"created_at" => null,
|
||||
"updated_at" => null,
|
||||
"comp_tipo_impresion" => null,
|
||||
"comp_pos_paginas_color" => null,
|
||||
"pos_paginas_color" => null,
|
||||
"total_coste_papel" => null,
|
||||
"total_margen_papel" => null,
|
||||
"total_margenPercent_papel" => null,
|
||||
@ -90,6 +90,11 @@ class PresupuestoEntity extends \CodeIgniter\Entity\Entity
|
||||
"acabado_cubierta_id" => null,
|
||||
"acabado_sobrecubierta_id" => null,
|
||||
"is_duplicado" => false,
|
||||
'paginas_color_consecutivas' => null,
|
||||
'papel_interior_diferente' => null,
|
||||
'paginasCuadernillo' => null,
|
||||
'lomo_redondo' => null,
|
||||
'cabezada' => null,
|
||||
];
|
||||
protected $casts = [
|
||||
"cliente_id" => "int",
|
||||
@ -155,5 +160,9 @@ class PresupuestoEntity extends \CodeIgniter\Entity\Entity
|
||||
"acabado_cubierta_id" => "int",
|
||||
"acabado_sobrecubierta_id" => "int",
|
||||
"is_duplicado" => "boolean",
|
||||
'paginas_color_consecutivas' => "boolean",
|
||||
'papel_interior_diferente' => "boolean",
|
||||
'paginasCuadernillo' => "int",
|
||||
'lomo_redondo' => "boolean",
|
||||
];
|
||||
}
|
||||
|
||||
@ -8,6 +8,8 @@ class TarifaAcabadoEntity extends \CodeIgniter\Entity\Entity
|
||||
protected $attributes = [
|
||||
"id" => null,
|
||||
"nombre" => null,
|
||||
"code" => null,
|
||||
"comment" => null,
|
||||
"precio_min" => 0,
|
||||
"importe_fijo" => 0,
|
||||
"mostrar_en_presupuesto" => 1,
|
||||
@ -22,6 +24,8 @@ class TarifaAcabadoEntity extends \CodeIgniter\Entity\Entity
|
||||
];
|
||||
protected $casts = [
|
||||
"precio_min" => "float",
|
||||
"comment" => "string",
|
||||
"code" => "string",
|
||||
"importe_fijo" => "float",
|
||||
"user_created_id" => "int",
|
||||
"user_updated_id" => "int",
|
||||
|
||||
@ -9,6 +9,7 @@ class TarifaEncuadernacionEntity extends \CodeIgniter\Entity\Entity
|
||||
protected $attributes = [
|
||||
"id" => null,
|
||||
"nombre" => null,
|
||||
"code" => null,
|
||||
"mostrar_en_presupuesto" => 1,
|
||||
"tipo_encuadernacion" => 0,
|
||||
"servicio_encuadernacion" => 0,
|
||||
@ -22,6 +23,7 @@ class TarifaEncuadernacionEntity extends \CodeIgniter\Entity\Entity
|
||||
];
|
||||
protected $casts = [
|
||||
"mostrar_en_presupuesto" => "int",
|
||||
"code" => "string",
|
||||
"tipo_encuadernacion" => "int",
|
||||
"servicio_encuadernacion" => "int",
|
||||
"por_horas" => "int",
|
||||
|
||||
@ -15,6 +15,7 @@ class TarifaEncuadernacionLinea extends \CodeIgniter\Entity\Entity
|
||||
"precio_max" => 0,
|
||||
"tirada_min" => 0,
|
||||
"tirada_max" => 0,
|
||||
"total_min" => 0,
|
||||
"margen" => 0,
|
||||
"user_created_id" => 0,
|
||||
"user_updated_id" => 0,
|
||||
@ -31,6 +32,7 @@ class TarifaEncuadernacionLinea extends \CodeIgniter\Entity\Entity
|
||||
"precio_max" => "float",
|
||||
"tirada_min" => "float",
|
||||
"tirada_max" => "float",
|
||||
"total_min" => "float",
|
||||
"margen" => "float",
|
||||
"user_created_id" => "int",
|
||||
"user_updated_id" => "int",
|
||||
|
||||
@ -11,6 +11,7 @@ class TarifaEncuadernacionLineaHoras extends \CodeIgniter\Entity\Entity
|
||||
"tiempo_min" => 0,
|
||||
"tiempo_max" => 0,
|
||||
"precio_hora" => 0,
|
||||
"total_min" => 0,
|
||||
"margen" => 0,
|
||||
"user_created_id" => 0,
|
||||
"user_updated_id" => 0,
|
||||
@ -22,6 +23,7 @@ class TarifaEncuadernacionLineaHoras extends \CodeIgniter\Entity\Entity
|
||||
"tirada_encuadernacion_id" => "int",
|
||||
"tiempo_min" => "float",
|
||||
"tiempo_max" => "float",
|
||||
"total_min" => "float",
|
||||
"precio_hora" => "float",
|
||||
"margen" => "float",
|
||||
"user_created_id" => "int",
|
||||
|
||||
@ -11,7 +11,6 @@ class TarifaEncuadernacionTirada extends \CodeIgniter\Entity\Entity
|
||||
"tirada_min" => 0,
|
||||
"tirada_max" => 0,
|
||||
"proveedor_id" => 0,
|
||||
"precio_min" => 0,
|
||||
"importe_fijo" => 0,
|
||||
"user_created_id" => 0,
|
||||
"user_updated_id" => 0,
|
||||
@ -24,7 +23,6 @@ class TarifaEncuadernacionTirada extends \CodeIgniter\Entity\Entity
|
||||
"tirada_min" => "float",
|
||||
"tirada_max" => "float",
|
||||
"proveedor_id" => "int",
|
||||
"precio_min" => "float",
|
||||
"importe_fijo" => "float",
|
||||
"user_created_id" => "int",
|
||||
"user_updated_id" => "int",
|
||||
|
||||
@ -9,6 +9,8 @@ class TarifaEnvioEntity extends \CodeIgniter\Entity\Entity
|
||||
"id" => null,
|
||||
"pais_id" => null,
|
||||
"nombre" => null,
|
||||
"code" => null,
|
||||
"comment" => null,
|
||||
"user_created_id" => 0,
|
||||
"user_updated_id" => 0,
|
||||
"is_deleted" => 0,
|
||||
@ -17,6 +19,8 @@ class TarifaEnvioEntity extends \CodeIgniter\Entity\Entity
|
||||
];
|
||||
protected $casts = [
|
||||
"pais_id" => "?int",
|
||||
"code" => "string",
|
||||
"comment" => "string",
|
||||
"user_created_id" => "int",
|
||||
"user_updated_id" => "int",
|
||||
"is_deleted" => "int",
|
||||
|
||||
@ -9,6 +9,8 @@ class TarifaManipuladoEntity extends \CodeIgniter\Entity\Entity
|
||||
protected $attributes = [
|
||||
"id" => null,
|
||||
"nombre" => null,
|
||||
"code" => null,
|
||||
"comment" => null,
|
||||
"precio_min" => 0,
|
||||
"importe_fijo" => 0,
|
||||
"mostrar_en_presupuesto" => 1,
|
||||
@ -22,6 +24,8 @@ class TarifaManipuladoEntity extends \CodeIgniter\Entity\Entity
|
||||
protected $casts = [
|
||||
"precio_min" => "float",
|
||||
"importe_fijo" => "float",
|
||||
"code" => "string",
|
||||
"comment" => "string",
|
||||
"mostrar_en_presupuesto" => "int",
|
||||
"user_created_id" => "int",
|
||||
"user_updated_id" => "int",
|
||||
|
||||
@ -8,6 +8,8 @@ class TarifaextraEntity extends \CodeIgniter\Entity\Entity
|
||||
protected $attributes = [
|
||||
"id" => null,
|
||||
"nombre" => null,
|
||||
"code" => null,
|
||||
"comment" => null,
|
||||
"precio" => null,
|
||||
"margen" => 0,
|
||||
"mostrar_en_presupuesto" => 1,
|
||||
@ -20,6 +22,8 @@ class TarifaextraEntity extends \CodeIgniter\Entity\Entity
|
||||
];
|
||||
protected $casts = [
|
||||
"precio" => "float",
|
||||
"code" => "string",
|
||||
"comment" => "string",
|
||||
"margen" => "float",
|
||||
"mostrar_en_presupuesto" => "int",
|
||||
"user_created_id" => "int",
|
||||
|
||||
@ -8,6 +8,8 @@ class TarifapreimpresionEntity extends \CodeIgniter\Entity\Entity
|
||||
protected $attributes = [
|
||||
"id" => null,
|
||||
"nombre" => null,
|
||||
"code" => null,
|
||||
"comment" => null,
|
||||
"precio" => null,
|
||||
"margen" => 0,
|
||||
"mostrar_en_presupuesto" => 1,
|
||||
@ -21,6 +23,8 @@ class TarifapreimpresionEntity extends \CodeIgniter\Entity\Entity
|
||||
protected $casts = [
|
||||
"precio" => "float",
|
||||
"margen" => "float",
|
||||
"code" => "string",
|
||||
"comment" => "string",
|
||||
"mostrar_en_presupuesto" => "int",
|
||||
"user_created_id" => "int",
|
||||
"user_update_id" => "int",
|
||||
|
||||
@ -31,12 +31,12 @@ return [
|
||||
'presupuestoEstadoAceptado' => 'Acepted',
|
||||
'incidencia' => 'Incident',
|
||||
'reimpresion' => 'Reprint',
|
||||
'reimpresion' => 'Free of charge',
|
||||
'autor' => 'Author',
|
||||
'coleccion' => 'Collection',
|
||||
'numeroEdicion' => 'Edition number',
|
||||
'isbn' => 'ISBN',
|
||||
'referenciaCliente' => 'Customer reference',
|
||||
'formatoLibro' => "Book format",
|
||||
'papelFormatoId' => "Size",
|
||||
'papelFormatoPersonalizado' => 'Custom size',
|
||||
'papelFormatoAncho' => 'Width',
|
||||
|
||||
@ -10,6 +10,9 @@ return [
|
||||
'id' => 'ID',
|
||||
'moduleTitle' => 'Finishing Rates',
|
||||
'nombre' => 'Name',
|
||||
'code' => 'Código',
|
||||
'comment' => 'Comentario',
|
||||
'comment_placeholder' => 'Inserte un comentario',
|
||||
'precioMax' => 'Price Max',
|
||||
'precioMin' => 'Price Min',
|
||||
'precioMin' => 'Min Price',
|
||||
|
||||
@ -26,8 +26,12 @@ return [
|
||||
"global_inactive" => "Inactivo",
|
||||
"global_copy" => "Dupdo",
|
||||
"global_print" => "Impresión",
|
||||
"global_print2" => "Imprimir",
|
||||
"global_confirm" => "Confirmar",
|
||||
"global_excel" => "Excel",
|
||||
"global_pdf" => "PDF",
|
||||
"global_prev" => "Anterior",
|
||||
"global_next" => "Siguiente",
|
||||
|
||||
// LOGIN - Index
|
||||
"login_title" => "Iniciar sesión en su cuenta",
|
||||
@ -680,6 +684,7 @@ return [
|
||||
|
||||
"menu_configuration" => "Configuración",
|
||||
"menu_variables" => "Variables sistema",
|
||||
"menu_error_presupuesto" => "Errores presupuesto",
|
||||
"menu_calendario" => "Calendario",
|
||||
"menu_paises" => "Paises",
|
||||
"menu_correo" => "Correo",
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
|
||||
return [
|
||||
"chat" => "Mensajería",
|
||||
"messages" => "Mensajes",
|
||||
"modal" => [
|
||||
"new_hebra" => "Nueva hebra",
|
||||
"title" => "Título",
|
||||
|
||||
@ -44,7 +44,10 @@ return [
|
||||
'titulo' => 'Título',
|
||||
'paisId' => 'País',
|
||||
'incRei' => 'Incidencia \ Reimpresión',
|
||||
'paginas' => 'Paginas',
|
||||
'paginas' => 'Páginas',
|
||||
'paginasNegro' => 'Páginas Negro',
|
||||
'paginasColor' => 'Páginas Color',
|
||||
'totalPaginas' => 'Total páginas',
|
||||
'tirada' => 'Tirada',
|
||||
'totalPedido' => 'Total Pedido',
|
||||
'totalPresupuesto' => 'Total Presupuesto',
|
||||
@ -79,6 +82,8 @@ return [
|
||||
'tipoImpresion' => 'Tipo de impresión',
|
||||
'papelesComparadorCosidoTapaBlanda' => 'Papeles interior y cubierta',
|
||||
'posicionPagColor' => 'Posición páginas a color',
|
||||
'papelDiferente' => 'Papel color y negro diferente',
|
||||
'paginasColorConsecutivas' => 'Páginas color consecutivas',
|
||||
'colorPageInstructions' => 'Introduzca la posición de las páginas a color dentro del libro. Ej: 3,5,7 ó 4-10,20,155',
|
||||
'numeroPaginas' => 'Nº Páginas',
|
||||
'papel' => 'Papel',
|
||||
@ -87,7 +92,43 @@ return [
|
||||
'retractilado' => 'Retractilado individual',
|
||||
'retractilado5' => 'Retractilado de 5',
|
||||
'Guardas' => 'Guardas',
|
||||
'papelGuardas' => 'Papel de guardas',
|
||||
'offsetBlancoGuardas' => 'Offset blanco 170 gr',
|
||||
'offsetAhuesadoGuardas' => 'Offset ahuesado 170 gr',
|
||||
'guardasImpresas' => "Guardas impresas",
|
||||
'imprimir_guardas' => 'Imprimir guardas',
|
||||
'cabezada' => 'Cabezada',
|
||||
'blanca' => 'Blanca',
|
||||
'verde' => 'Verde',
|
||||
'azul' => 'Azul',
|
||||
'rojaAmarilla' => 'Roja-Amarilla',
|
||||
'plastificado' => 'Plastificado',
|
||||
'brillo' => 'Brillo',
|
||||
'mate' => 'Mate',
|
||||
'antirrayado' => 'Anti-rayado',
|
||||
'rugoso' => 'Sandy (rugoso)',
|
||||
'sinPlastificar' => 'Sin plastificar',
|
||||
'barniz' => 'Barniz UVI',
|
||||
'relieve2D' => 'Relieve 2D',
|
||||
'relieve3D' => 'Relieve 3D',
|
||||
'barnizDescription' => 'Barnizado selectivo en zonas de la cubierta',
|
||||
'estampado' => 'Estampado',
|
||||
'oro' => 'Oro',
|
||||
'plata' => 'Plata',
|
||||
'cobre' => 'Cobre',
|
||||
'bronce' => 'Bronce',
|
||||
'retractiladoTitle' => 'Retractilado',
|
||||
'papelSobrecubierta' => 'Papel sobrecubierta',
|
||||
'tamanioSolapasSobrecubierta' => 'Tamaño solapas sobrecubierta',
|
||||
'plastificadoSobrecubierta' => 'Plastificado sobrecubierta',
|
||||
'faja' => 'Faja',
|
||||
'altoFaja' => 'Alto faja',
|
||||
'papelFaja' => 'Papel faja',
|
||||
'tamanioSolapasFaja' => 'Tamaño solapas faja',
|
||||
'plastificadoFaja' => 'Plastificado faja',
|
||||
'estucadoMate170gr' => 'Estucado mate 170 gr',
|
||||
'estucadoMate200gr' => 'Estucado mate 200 gr',
|
||||
|
||||
'fajaColor' => 'Imprimir faja a color',
|
||||
'compInteriorPlana' => 'Interior en plana',
|
||||
'compInteriorRotativa' => 'Interior en rotativa',
|
||||
@ -212,6 +253,11 @@ return [
|
||||
|
||||
'totalAceptado' => 'Total aceptado',
|
||||
|
||||
// Placeholders
|
||||
'formatoLibro' => "Formato libro",
|
||||
'selectCliente' => "Seleccione cliente",
|
||||
|
||||
|
||||
// Preview
|
||||
'preview' => 'Previsualización de configuraciones',
|
||||
'preview-conf-bn' => 'Configuración Blanco y Negro',
|
||||
@ -302,10 +348,19 @@ return [
|
||||
'no_lp_for_merma' => 'Inserte líneas de presupuesto para calcular la merma',
|
||||
'ejemplares_envio' => 'El número de ejemplares enviados no coincide con la tirada',
|
||||
'cliente' => 'Debe seleccionar un cliente',
|
||||
'papelFormato' => 'Seleccione un formato',
|
||||
'tipo_libro' => 'Seleccione un tipo de libro',
|
||||
'disenio_interior' => 'Seleccione el diseño del interior',
|
||||
'papel_interior' => 'Seleccione el tipo de papel',
|
||||
'gramaje_interior' => 'Seleccione el gramaje',
|
||||
'pais' => 'Debe seleccionar un país',
|
||||
'integer_greatherThan_0' => 'Número entero > 0 requerido',
|
||||
'tirada_no_valida' => "Tirada no valida",
|
||||
'sin_gramaje' => "Seleccione gramaje",
|
||||
'tipo_cubierta' => 'Seleccione tipo de cubierta',
|
||||
'opcion_solapas' => 'Seleccione la opción para las solapas',
|
||||
'paginas_cosido' => 'El número de páginas para <b>cosido</b> debe ser múltiplo de 4',
|
||||
'paginas_pares' => 'El número de páginas debe ser par',
|
||||
],
|
||||
|
||||
'errores' => [
|
||||
|
||||
@ -10,6 +10,9 @@ return [
|
||||
'id' => 'ID',
|
||||
'moduleTitle' => 'Tarifas Encuadernación',
|
||||
'nombre' => 'Nombre',
|
||||
'code' => 'Código',
|
||||
'comment' => 'Comentario',
|
||||
'comment_placeholder' => 'Inserte un comentario',
|
||||
'precioMax' => 'Precio T. Mín',
|
||||
'precioMin' => 'Precio T. Máx',
|
||||
'importeFijo' => 'Importe Fijo',
|
||||
|
||||
@ -7,6 +7,9 @@ return [
|
||||
'id' => 'ID',
|
||||
'moduleTitle' => 'Tarifas Servicios Extra',
|
||||
'nombre' => 'Nombre',
|
||||
'code' => 'Código',
|
||||
'comment' => 'Comentario',
|
||||
'comment_placeholder' => 'Inserte un comentario',
|
||||
'precio' => 'Precio',
|
||||
'precioMin' => 'Precio Mínimo',
|
||||
'importeFijo' => 'Importe Fijo',
|
||||
|
||||
@ -10,6 +10,9 @@ return [
|
||||
'id' => 'ID',
|
||||
'moduleTitle' => 'Tarifas Manipulado',
|
||||
'nombre' => 'Nombre',
|
||||
'code' => 'Código',
|
||||
'comment' => 'Comentario',
|
||||
'comment_placeholder' => 'Inserte un comentario',
|
||||
'importeMinimo' => 'Importe mínimo',
|
||||
'precioMax' => 'Precio T. Mín',
|
||||
'precioMin' => 'Precio T. Máx',
|
||||
|
||||
@ -7,6 +7,9 @@ return [
|
||||
'id' => 'ID',
|
||||
'moduleTitle' => 'Tarifas Preimpresión',
|
||||
'nombre' => 'Nombre',
|
||||
'code' => 'Código',
|
||||
'comment' => 'Comentario',
|
||||
'comment_placeholder' => 'Inserte un comentario',
|
||||
'precio' => 'Precio',
|
||||
'precioMin' => 'Precio Mínimo',
|
||||
'importeFijo' => 'Importe Fijo',
|
||||
@ -25,7 +28,16 @@ return [
|
||||
'required' => 'El campo {field} es obligatorio.',
|
||||
|
||||
],
|
||||
'code' => [
|
||||
'max_length' => 'El campo {field} no puede exceder {param} caracteres en longitud.',
|
||||
'required' => 'El campo {field} es obligatorio.',
|
||||
|
||||
],
|
||||
'comment' => [
|
||||
'max_length' => 'El campo {field} no puede exceder {param} caracteres en longitud.',
|
||||
'required' => 'El campo {field} es obligatorio.',
|
||||
|
||||
],
|
||||
'precio' => [
|
||||
'decimal' => 'El campo {field} debe contener un número decimal.',
|
||||
'required' => 'El campo {field} es obligatorio.',
|
||||
|
||||
@ -9,6 +9,9 @@ return [
|
||||
'isDeleted' => 'Is Deleted',
|
||||
'moduleTitle' => 'Tarifas Envíos',
|
||||
'nombre' => 'Nombre',
|
||||
'code' => 'Código',
|
||||
'comment' => 'Comentario',
|
||||
'comment_placeholder' => 'Inserte un comentario',
|
||||
'paisId' => 'Pais',
|
||||
'tarifaEnvio' => 'Tarifa Envío',
|
||||
'tarifaEnvioList' => 'Lista Tarifas Envío',
|
||||
|
||||
@ -199,7 +199,7 @@ class ChatModel extends Model
|
||||
}
|
||||
public function getClienteChatPedidos(array $pedidos) : array
|
||||
{
|
||||
$results = $this->db->table("chats")
|
||||
$q = $this->db->table("chats")
|
||||
->select([
|
||||
"chats.id as chatId",
|
||||
"chats.pedido_id as pedidoId",
|
||||
@ -209,8 +209,13 @@ class ChatModel extends Model
|
||||
])
|
||||
->join("chat_departments","chat_departments.id = chats.chat_department_id","left")
|
||||
->join("pedidos","pedidos.id = chats.pedido_id","left")
|
||||
->whereIn("pedidos.id",$pedidos)
|
||||
->get()->getResultObject();
|
||||
->where('chats.chat_department_id is NOT NULL', NULL, FALSE);
|
||||
if(count($pedidos)>0){
|
||||
$q->whereIn("pedidos.id",$pedidos);
|
||||
}else{
|
||||
return [];
|
||||
}
|
||||
$results = $q->get()->getResultObject();
|
||||
$chatMessageModel = model(ChatMessageModel::class);
|
||||
$count = 0;
|
||||
foreach ($results as $row) {
|
||||
@ -220,13 +225,14 @@ class ChatModel extends Model
|
||||
$count++;
|
||||
}
|
||||
}
|
||||
$row->uri = "/pedidos/edit/".$row->pedidoId;
|
||||
$row->unreadMessages=$count;
|
||||
}
|
||||
return $results;
|
||||
}
|
||||
public function getClienteChatFacturas(array $facturas) : array
|
||||
{
|
||||
$results = $this->db->table("chats")
|
||||
$q = $this->db->table("chats")
|
||||
->select([
|
||||
"chats.id as chatId",
|
||||
"chats.factura_id as facturaId",
|
||||
@ -236,8 +242,14 @@ class ChatModel extends Model
|
||||
])
|
||||
->join("chat_departments","chat_departments.id = chats.chat_department_id","left")
|
||||
->join("facturas","facturas.id = chats.factura_id","left")
|
||||
->whereIn("facturas.id",$facturas)
|
||||
->get()->getResultObject();
|
||||
->where('chats.chat_department_id is NOT NULL', NULL, FALSE);
|
||||
|
||||
if(count($facturas)>0){
|
||||
$q->whereIn("facturas.id",$facturas);
|
||||
}else{
|
||||
return [];
|
||||
}
|
||||
$results = $q->get()->getResultObject();
|
||||
$chatMessageModel = model(ChatMessageModel::class);
|
||||
$count = 0;
|
||||
foreach ($results as $row) {
|
||||
@ -247,13 +259,14 @@ class ChatModel extends Model
|
||||
$count++;
|
||||
}
|
||||
}
|
||||
$row->uri = "/facturas/edit/".$row->facturaId;
|
||||
$row->unreadMessages=$count;
|
||||
}
|
||||
return $results;
|
||||
}
|
||||
public function getClienteChatPresupuestos(array $presupuestos) : array
|
||||
{
|
||||
$results = $this->db->table("chats")
|
||||
$q = $this->db->table("chats")
|
||||
->select([
|
||||
"chats.id as chatId",
|
||||
"chats.presupuesto_id as presupuestoId",
|
||||
@ -263,8 +276,14 @@ class ChatModel extends Model
|
||||
])
|
||||
->join("chat_departments","chat_departments.id = chats.chat_department_id","left")
|
||||
->join("presupuestos","presupuestos.id = chats.presupuesto_id","left")
|
||||
->whereIn("presupuestos.id",$presupuestos)
|
||||
->get()->getResultObject();
|
||||
->where('chats.chat_department_id is NOT NULL', NULL, FALSE);
|
||||
|
||||
if(count($presupuestos)>0){
|
||||
$q->whereIn("presupuestos.id",$presupuestos);
|
||||
}else{
|
||||
return [];
|
||||
}
|
||||
$results = $q->get()->getResultObject();
|
||||
$chatMessageModel = model(ChatMessageModel::class);
|
||||
$count = 0;
|
||||
foreach ($results as $row) {
|
||||
@ -274,6 +293,7 @@ class ChatModel extends Model
|
||||
$count++;
|
||||
}
|
||||
}
|
||||
$row->uri = "/presupuestos/presupuestocliente/edit/".$row->presupuestoId;
|
||||
$row->unreadMessages=$count;
|
||||
}
|
||||
|
||||
|
||||
@ -54,7 +54,7 @@ class ClienteDireccionesModel extends \App\Models\BaseModel
|
||||
],
|
||||
"email" => [
|
||||
"label" => "ClienteDirecciones.email",
|
||||
"rules" => "trim|max_length[100]|valid_email",
|
||||
"rules" => "trim|max_length[100]",
|
||||
],
|
||||
"cp" => [
|
||||
"label" => "ClienteDirecciones.cp",
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Clientes;
|
||||
|
||||
class ClienteModel extends \App\Models\BaseModel
|
||||
@ -293,30 +294,32 @@ class ClienteModel extends \App\Models\BaseModel
|
||||
return empty($search)
|
||||
? $builder
|
||||
: $builder
|
||||
->groupStart()
|
||||
->like("t1.nombre", $search)
|
||||
->orLike("t1.alias", $search)
|
||||
->orLike("t1.cif", $search)
|
||||
->orLike("t1.email", $search)
|
||||
->orLike("t1.soporte_id", $search)
|
||||
->orLike("t1.forma_pago_id", $search)
|
||||
->orLike("t1.vencimiento", $search)
|
||||
->orLike("t5.id", $search)
|
||||
->orLike("t5.first_name", $search)
|
||||
->orLike("t5.last_name", $search)
|
||||
->orLike("t7.id", $search)
|
||||
->orLike("t7.nombre", $search)
|
||||
->groupEnd();
|
||||
->groupStart()
|
||||
->like("t1.nombre", $search)
|
||||
->orLike("t1.alias", $search)
|
||||
->orLike("t1.cif", $search)
|
||||
->orLike("t1.email", $search)
|
||||
->orLike("t1.soporte_id", $search)
|
||||
->orLike("t1.forma_pago_id", $search)
|
||||
->orLike("t1.vencimiento", $search)
|
||||
->orLike("t5.id", $search)
|
||||
->orLike("t5.first_name", $search)
|
||||
->orLike("t5.last_name", $search)
|
||||
->orLike("t7.id", $search)
|
||||
->orLike("t7.nombre", $search)
|
||||
->groupEnd();
|
||||
}
|
||||
|
||||
/*
|
||||
TO-DO: Implementar la lógica de negocio para el crédito disponible
|
||||
*/
|
||||
public function creditoDisponible($cliente_id){
|
||||
public function creditoDisponible($cliente_id)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function getClienteDataFacturas($cliente_id){
|
||||
public function getClienteDataFacturas($cliente_id)
|
||||
{
|
||||
$builder = $this->db
|
||||
->table($this->table . " t1")
|
||||
->select(
|
||||
@ -329,27 +332,27 @@ class ClienteModel extends \App\Models\BaseModel
|
||||
->where("t1.id", $cliente_id);
|
||||
$builder->join("lg_paises t2", "t1.pais_id = t2.id", "left");
|
||||
$builder->join("lg_provincias t3", "t1.provincia_id = t3.id", "left");
|
||||
|
||||
|
||||
return $builder->get()->getResultArray();
|
||||
}
|
||||
public function getClienteDataPresupuestoPedidoFactura(int $cliente_id) : array
|
||||
public function getClienteDataPresupuestoPedidoFactura(int $cliente_id): array
|
||||
{
|
||||
$query = $this->db
|
||||
->table($this->table." t1")
|
||||
->select([
|
||||
"t1.id as clienteId",
|
||||
"presupuestos.id as presupuestoId",
|
||||
"pedidos.id as pedidoId",
|
||||
"presupuesto_estados.estado as presupuestoEstado",
|
||||
"facturas_pedidos_lineas.factura_id as facturaId",
|
||||
->table($this->table . " t1")
|
||||
->select([
|
||||
"t1.id as clienteId",
|
||||
"presupuestos.id as presupuestoId",
|
||||
"pedidos.id as pedidoId",
|
||||
"presupuesto_estados.estado as presupuestoEstado",
|
||||
"facturas_pedidos_lineas.factura_id as facturaId",
|
||||
|
||||
])
|
||||
->join("presupuestos","t1.id = presupuestos.cliente_id","left")
|
||||
->join("presupuesto_estados","presupuestos.estado_id = presupuesto_estados.id","left")
|
||||
->join("pedidos_linea","presupuestos.id = pedidos_linea.presupuesto_id","left")
|
||||
->join("pedidos","pedidos.id = pedidos_linea.pedido_id","left")
|
||||
->join("facturas_pedidos_lineas","facturas_pedidos_lineas.pedido_linea_id = pedidos_linea.id","left")
|
||||
->where("t1.id",$cliente_id);
|
||||
->join("presupuestos", "t1.id = presupuestos.cliente_id", "left")
|
||||
->join("presupuesto_estados", "presupuestos.estado_id = presupuesto_estados.id", "left")
|
||||
->join("pedidos_linea", "presupuestos.id = pedidos_linea.presupuesto_id", "left")
|
||||
->join("pedidos", "pedidos.id = pedidos_linea.pedido_id", "left")
|
||||
->join("facturas_pedidos_lineas", "facturas_pedidos_lineas.pedido_linea_id = pedidos_linea.id", "left")
|
||||
->where("t1.id", $cliente_id);
|
||||
$data = $query->get()->getResultObject();
|
||||
$facturas = [];
|
||||
$presupuestos = [];
|
||||
@ -367,4 +370,23 @@ class ClienteModel extends \App\Models\BaseModel
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
public function getNombre($id = -1)
|
||||
{
|
||||
|
||||
try {
|
||||
|
||||
$builder = $this->db
|
||||
->table($this->table . " t1")
|
||||
->select(
|
||||
"t1.nombre AS nombre"
|
||||
)
|
||||
->where("id", $id)
|
||||
->where("is_deleted", 0);
|
||||
|
||||
return $builder->get()->getResultObject()[0]->nombre;
|
||||
} catch (\Exception $e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Configuracion;
|
||||
|
||||
class PapelFormatoModel extends \App\Models\BaseModel
|
||||
@ -72,25 +73,64 @@ class PapelFormatoModel extends \App\Models\BaseModel
|
||||
return empty($search)
|
||||
? $builder
|
||||
: $builder
|
||||
->groupStart()
|
||||
->like("t1.id", $search)
|
||||
->orLike("t1.ancho", $search)
|
||||
->orLike("t1.alto", $search)
|
||||
->orLike("t1.created_at", $search)
|
||||
->orLike("t1.updated_at", $search)
|
||||
->orLike("t1.id", $search)
|
||||
->orLike("t1.ancho", $search)
|
||||
->orLike("t1.alto", $search)
|
||||
->orLike("t1.created_at", $search)
|
||||
->orLike("t1.updated_at", $search)
|
||||
->groupEnd();
|
||||
->groupStart()
|
||||
->like("t1.id", $search)
|
||||
->orLike("t1.ancho", $search)
|
||||
->orLike("t1.alto", $search)
|
||||
->orLike("t1.created_at", $search)
|
||||
->orLike("t1.updated_at", $search)
|
||||
->orLike("t1.id", $search)
|
||||
->orLike("t1.ancho", $search)
|
||||
->orLike("t1.alto", $search)
|
||||
->orLike("t1.created_at", $search)
|
||||
->orLike("t1.updated_at", $search)
|
||||
->groupEnd();
|
||||
}
|
||||
|
||||
public function getElementsForMenu(){
|
||||
public function getElementsForMenu()
|
||||
{
|
||||
return $this->db
|
||||
->table($this->table . " t1")
|
||||
->select(
|
||||
"t1.id AS id, CONCAT(t1.ancho, ' x ', t1.alto) AS tamanio"
|
||||
)->where('is_deleted', 0)->orderBy('orden_select', 'asc')->get()->getResultObject();
|
||||
}
|
||||
|
||||
public function getElementsForMenu2($search = "")
|
||||
{
|
||||
$builder = $this->db
|
||||
->table($this->table . " t1")
|
||||
->select(
|
||||
"t1.id AS id, CONCAT(t1.ancho, ' x ', t1.alto) AS name"
|
||||
)
|
||||
->where('is_deleted', 0)
|
||||
->where('id>', 0)
|
||||
->orderBy('orden_select', 'asc');
|
||||
|
||||
|
||||
return empty($search)
|
||||
? $builder->get()->getResultObject()
|
||||
: $builder
|
||||
->groupStart()
|
||||
->like('t1.ancho', $search)
|
||||
->orLike('t1.alto', $search)
|
||||
->groupEnd()->get()->getResultObject();
|
||||
}
|
||||
|
||||
|
||||
public function getNombre($id = -1)
|
||||
{
|
||||
try {
|
||||
$builder = $this->db
|
||||
->table($this->table . " t1")
|
||||
->select(
|
||||
"CONCAT(t1.ancho, ' x ', t1.alto) AS name"
|
||||
)
|
||||
->where('t1.id', $id);
|
||||
|
||||
return $builder->get()->getResultObject()[0]->name;
|
||||
} catch (\Exception $e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -61,6 +61,37 @@ class PapelGenericoModel extends \App\Models\BaseModel
|
||||
],
|
||||
];
|
||||
|
||||
|
||||
public function getIdFromCode(string $code=""){
|
||||
$builder = $this->db
|
||||
->table($this->table . " t1")
|
||||
->select(
|
||||
"t1.id AS id, t1.nombre AS nombre"
|
||||
)
|
||||
->where("t1.code", $code)
|
||||
->where("t1.is_deleted", 0);
|
||||
$data = $builder->get()->getFirstRow();
|
||||
// se convierte a de stdClass a array
|
||||
$data = json_decode(json_encode($data), true);
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
public function getCodeFromId($id=0){
|
||||
$builder = $this->db
|
||||
->table($this->table . " t1")
|
||||
->select(
|
||||
"t1.code AS code"
|
||||
)
|
||||
->where("t1.id", $id)
|
||||
->where("t1.is_deleted", 0);
|
||||
$data = $builder->get()->getFirstRow();
|
||||
// se convierte a de stdClass a array
|
||||
$data = json_decode(json_encode($data), true);
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get resource data.
|
||||
*
|
||||
|
||||
@ -322,4 +322,22 @@ class PapelImpresionModel extends \App\Models\BaseModel
|
||||
|
||||
return $builder->orderBy("t1.id", "asc")->get()->getResultObject();
|
||||
}
|
||||
|
||||
public function getPapelGenericoCode($papel_id = 0){
|
||||
$builder = $this->db
|
||||
->table($this->table . " t1")
|
||||
->select("t2.code AS code")
|
||||
->join("lg_papel_generico t2", "t1.papel_generico_id = t2.id", "left")
|
||||
->where("t1.id", $papel_id)
|
||||
->where("t1.is_deleted", 0)
|
||||
->where("t1.isActivo", 1)
|
||||
->where("t2.is_deleted", 0);
|
||||
|
||||
$result = $builder->get()->getResultObject();
|
||||
if(count($result) > 0){
|
||||
return $result[0]->code;
|
||||
}
|
||||
else
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
@ -80,7 +80,7 @@ class BuscadorModel extends \App\Models\BaseModel
|
||||
"comparador_json_data",
|
||||
"is_deleted",
|
||||
"comp_tipo_impresion",
|
||||
"comp_pos_paginas_color",
|
||||
"pos_paginas_color",
|
||||
"total_coste_papel",
|
||||
"total_margen_papel",
|
||||
"total_margenPercent_papel",
|
||||
|
||||
@ -123,4 +123,21 @@ class PresupuestoDireccionesModel extends \App\Models\BaseModel
|
||||
return $builder;
|
||||
}
|
||||
|
||||
public function getDireccion($id = -1)
|
||||
{
|
||||
$builder = $this->db
|
||||
->table($this->table . " t1")
|
||||
->select(
|
||||
"t1.id AS id, t1.att AS att,
|
||||
t1.email AS email, t1.direccion AS direccion, t1.pais_id AS pais_id, t3.nombre AS pais,
|
||||
t1.municipio AS municipio, t1.provincia AS provincia, t1.cp AS cp, t1.telefono AS telefono"
|
||||
);
|
||||
|
||||
$builder->where('t1.id', $id);
|
||||
$builder->join("lg_paises t3", "t1.pais_id = t3.id", "left");
|
||||
|
||||
|
||||
return $builder->get()->getResultObject();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -267,7 +267,15 @@ class PresupuestoEncuadernacionesModel extends \App\Models\BaseModel
|
||||
$precio_total = floatval(1.0* $tarifa_proveedor->precio_hora* $tiempo) * (1+$tarifa_value[0]->margen/100.0);
|
||||
if (!$POD){
|
||||
$precio_total += floatval($tarifa_proveedor->tarifa_importe_fijo);
|
||||
}
|
||||
}
|
||||
|
||||
$tarifa_precio_min = floatval($tarifa_proveedor->tarifa_precio_min);
|
||||
|
||||
if($tarifa_precio_min > $precio_total){
|
||||
$total = $total-($total * $margen/100.0);
|
||||
$margen = round(100.0 * (floatval($$tarifa_precio_min) - $total) / floatval($$tarifa_precio_min), 0);
|
||||
$total = floatval($$tarifa_precio_min);
|
||||
}
|
||||
|
||||
$result_data[0] = floatval($precio_total / $tirada); // Precio/unidad
|
||||
$result_data[1] = $precio_total;
|
||||
@ -323,11 +331,12 @@ class PresupuestoEncuadernacionesModel extends \App\Models\BaseModel
|
||||
|
||||
$total = $precio_unidad * $ejemplares;
|
||||
$margen = floatval($tarifa->margen);
|
||||
$tarifa_precio_min = floatval($tarifa->tarifa_precio_min);
|
||||
|
||||
if($tarifa->tarifa_precio_min > $total){
|
||||
if($tarifa_precio_min > $total){
|
||||
$total = $total-($total * $margen/100.0);
|
||||
$margen = round(100.0 * (floatval($tarifa->tarifa_precio_min) - $total) / floatval($tarifa->tarifa_precio_min), 0);
|
||||
$total = floatval($tarifa->tarifa_precio_min);
|
||||
$margen = round(100.0 * (floatval($tarifa_precio_min) - $total) / floatval($tarifa_precio_min), 0);
|
||||
$total = floatval($tarifa_precio_min);
|
||||
$precio_unidad = round(floatval($total / $ejemplares), 2);
|
||||
}
|
||||
|
||||
|
||||
@ -96,7 +96,9 @@ class PresupuestoModel extends \App\Models\BaseModel
|
||||
"comparador_json_data",
|
||||
"is_deleted",
|
||||
"comp_tipo_impresion",
|
||||
"comp_pos_paginas_color",
|
||||
"pos_paginas_color",
|
||||
"paginas_color_consecutivas",
|
||||
"papel_interior_diferente",
|
||||
"total_coste_papel",
|
||||
"total_margen_papel",
|
||||
"total_margenPercent_papel",
|
||||
@ -121,8 +123,15 @@ class PresupuestoModel extends \App\Models\BaseModel
|
||||
'iva_reducido',
|
||||
'excluir_rotativa',
|
||||
"acabado_cubierta_id",
|
||||
"barniz_cubierta_id",
|
||||
"estampado_cubierta_id",
|
||||
"acabado_sobrecubierta_id",
|
||||
"is_duplicado"
|
||||
"is_duplicado",
|
||||
'paginas_color_consecutivas',
|
||||
'papel_interior_diferente',
|
||||
'paginasCuadernillo',
|
||||
'lomo_redondo',
|
||||
'cabezada',
|
||||
];
|
||||
protected $returnType = "App\Entities\Presupuestos\PresupuestoEntity";
|
||||
|
||||
@ -395,35 +404,47 @@ class PresupuestoModel extends \App\Models\BaseModel
|
||||
'cliente_id' => $data['clienteId'],
|
||||
'tipo_impresion_id' => $data['tipo_impresion_id'],
|
||||
'pais_id' => 1,
|
||||
'retractilado' => in_array(3, $data['servicios']) ? 1 : 0,
|
||||
'retractilado' => in_array("RETR", $data['cubierta']['acabadosCubierta']) ? 1 : 0,
|
||||
'retractilado5' => in_array(5, $data['servicios']) ? 1 : 0,
|
||||
'guardas' => in_array(62, $data['servicios']) ? 1 : 0,
|
||||
'faja_color' => in_array(16, $data['servicios']) ? 1 : 0,
|
||||
'ferro' => in_array(24, $data['servicios']) ? 1 : 0,
|
||||
'prototipo' => in_array(9, $data['servicios']) ? 1 : 0,
|
||||
'prototipo' => $data['prototipo'] ? 1 : 0,
|
||||
'papel_formato_id' => is_null($papel_formato_id) ? 0 : $papel_formato_id->id,
|
||||
'papel_formato_personalizado' => !$papel_formato_id ? 1 : 0,
|
||||
'papel_formato_ancho' => !$papel_formato_id ? $data['tamanio']['ancho'] : null,
|
||||
'papel_formato_alto' => !$papel_formato_id ? $data['tamanio']['alto'] : null,
|
||||
'titulo' => $data_cabecera['titulo'],
|
||||
'autor' => $data_cabecera['autor'],
|
||||
'ISBN' => $data_cabecera['isbn'],
|
||||
'coleccion' => $data_cabecera['coleccion'],
|
||||
'referencia_cliente' => $data_cabecera['referenciaCliente'],
|
||||
'paginas' => $data['interior']['paginas'],
|
||||
'tirada' => $tirada,
|
||||
'solapas' => $data['cubierta']['solapasCubierta'] > 0 ? 1 : 0,
|
||||
'solapas_ancho' => $data['cubierta']['solapasCubierta'] > 0 ? $data['cubierta']['solapasCubierta'] : 0,
|
||||
'solapas_sobrecubierta' => is_null($data['sobrecubierta']) ? 0 : 1,
|
||||
'solapas_ancho_sobrecubierta' => is_null($data['sobrecubierta']) ? 0 : $data['sobrecubierta']['solapas'],
|
||||
'solapas' => $data['cubierta']['solapasCubierta'] == 0 ? 0 : 1,
|
||||
'lomo_redondo' => $data['cubierta']['lomoRedondo'] == 0 ? 0 : 1,
|
||||
'cabezada' => $data['cubierta']['cabezada'] == 0 ? 0 : 1,
|
||||
'solapas_ancho' => $data['cubierta']['solapasCubierta'] == 0 ? $data['cubierta']['solapasCubierta'] : 0,
|
||||
'solapas_sobrecubierta' => !$data['sobrecubierta'] ? 0 : 1,
|
||||
'solapas_ancho_sobrecubierta' => !$data['sobrecubierta'] ? 0 : $data['sobrecubierta']['solapas'],
|
||||
'cosido' => $is_cosido,
|
||||
'merma' => $extra_info['merma'],
|
||||
'merma_cubierta' => $extra_info['merma'],
|
||||
'paginasCuadernillo' => $data['paginasCuadernillo'],
|
||||
|
||||
'comp_pos_paginas_color' => $data['interior']['pos_paginas_color'],
|
||||
'paginas_color_consecutivas' => $data['interior']['paginas_color_consecutivas'],
|
||||
'papel_interior_diferente' => $data['interior']['papelInteriorDiferente'],
|
||||
|
||||
'lomo_cubierta' => $extra_info['lomo_cubierta'],
|
||||
'lomo_sobrecubierta' => $extra_info['lomo_sobrecubierta'],
|
||||
|
||||
'comparador_json_data' => $this->generateJson($data),
|
||||
|
||||
'acabado_cubierta_id' => $data['acabadoCubierta'],
|
||||
'acabado_sobrecubierta_id' => is_null($data['sobrecubierta']) ? 0 : $data['sobrecubierta']['acabado'],
|
||||
'acabado_cubierta_id' => $data['cubierta']['acabadosCubierta']['plastificado'],
|
||||
'barniz_cubierta_id' => $data['cubierta']['acabadosCubierta']['barniz'],
|
||||
'estampado_cubierta_id' => $data['cubierta']['acabadosCubierta']['estampado'],
|
||||
'acabado_sobrecubierta_id' => !$data['sobrecubierta'] ? 0 : $data['sobrecubierta']['acabados'],
|
||||
|
||||
'comp_tipo_impresion' => $data['isHq'] ? ($data['isColor'] ? 'colorhq' : 'negrohq') : ($data['isColor'] ? 'color' : 'negro'),
|
||||
|
||||
@ -444,7 +465,7 @@ class PresupuestoModel extends \App\Models\BaseModel
|
||||
'total_margenPercent_servicios' => round($resumen_totales['porcentajeMargenServicios'], 2),
|
||||
'total_coste_envios' => round($resumen_totales['coste_envio'], 2),
|
||||
'total_margen_envios' => round($resumen_totales['margen_envio'], 2),
|
||||
'total_costes' => round($totalCostes, 2),
|
||||
'total_costes' => round($totalCostes, 2),
|
||||
'total_margenes' => round($totalMargenes, 2),
|
||||
|
||||
'total_antes_descuento' => round($totalCostes + $totalMargenes, 2),
|
||||
@ -482,29 +503,45 @@ class PresupuestoModel extends \App\Models\BaseModel
|
||||
if (is_array($data)) {
|
||||
// -- INTERIOR --
|
||||
// Si hay negro
|
||||
if ($data['interior']['paginas'] > $data['interior']['paginas_color']) {
|
||||
if (intval($data['interior']['paginas']) > intval($data['interior']['paginas_color'])) {
|
||||
|
||||
if ($data['isHq'])
|
||||
$key = 'bnhq';
|
||||
else
|
||||
$key = 'bn';
|
||||
if (array_key_exists('id', $data['interior']['papel_generico'])) {
|
||||
$papel_id = intval($data['interior']['papel_generico']['id']);
|
||||
$gramaje = intval($data['interior']['gramaje']);
|
||||
} else {
|
||||
$papel_id = intval($data['interior']['papel_generico']['negro']['id']);
|
||||
$gramaje = intval($data['interior']['gramaje']['negro']);
|
||||
}
|
||||
|
||||
|
||||
$values[$key] = array(
|
||||
'paginas' => intval($data['interior']['paginas']) - intval($data['interior']['paginas_color']),
|
||||
'papel_id' => intval($data['interior']['papel_generico']['id']),
|
||||
'gramaje' => intval($data['interior']['gramaje']),
|
||||
'paginas' => intval($data['interior']['paginas']) - intval(intval($data['interior']['paginas_color'])),
|
||||
'papel_id' => $papel_id,
|
||||
'gramaje' => $gramaje,
|
||||
);
|
||||
}
|
||||
// Si hay color
|
||||
if ($data['interior']['paginas_color'] > 0) {
|
||||
if (intval($data['interior']['paginas_color']) > 0) {
|
||||
|
||||
if ($data['isHq'])
|
||||
$key = 'colorhq';
|
||||
else
|
||||
$key = 'color';
|
||||
if (array_key_exists('id', $data['interior']['papel_generico'])) {
|
||||
$papel_id = intval($data['interior']['papel_generico']['id']);
|
||||
$gramaje = intval($data['interior']['gramaje']);
|
||||
} else {
|
||||
$papel_id = intval($data['interior']['papel_generico']['color']['id']);
|
||||
$gramaje = intval($data['interior']['gramaje']['color']);
|
||||
}
|
||||
$values[$key] = array(
|
||||
'paginas' => intval($data['interior']['paginas_color']),
|
||||
'papel_id' => intval($data['interior']['papel_generico']['id']),
|
||||
'gramaje' => intval($data['interior']['gramaje']),
|
||||
'paginas' => intval(intval($data['interior']['paginas_color'])),
|
||||
'papel_id' => $papel_id,
|
||||
'gramaje' => $gramaje,
|
||||
);
|
||||
}
|
||||
|
||||
@ -516,7 +553,7 @@ class PresupuestoModel extends \App\Models\BaseModel
|
||||
);
|
||||
|
||||
// -- SOBRECUBIERTA --
|
||||
if (!is_null($data['sobrecubierta'])) {
|
||||
if ($data['sobrecubierta']) {
|
||||
$values['sobrecubierta'] = array(
|
||||
'papel_id' => intval($data['sobrecubierta']['papel']),
|
||||
'gramaje' => intval($data['sobrecubierta']['gramaje']),
|
||||
@ -542,7 +579,7 @@ class PresupuestoModel extends \App\Models\BaseModel
|
||||
$builder = $this->db
|
||||
->table($this->table . " t1")
|
||||
->select(
|
||||
"t1.id AS numero, t1.tipo_impresion_id as tipo, t1.tirada AS unidades, t1.total_aceptado as total, t1.paginas AS paginas,
|
||||
"t1.id AS numero, t1.tipo_impresion_id as tipo, t1.tirada AS unidades, t1.total_aceptado as total, t1.paginas AS paginas,
|
||||
t1.titulo AS titulo, t1.autor AS autor, t1.isbn AS isbn,
|
||||
t1.papel_formato_id AS papel_formato_id, t1.papel_formato_personalizado AS papel_formato_personalizado,
|
||||
t1.papel_formato_ancho AS papel_formato_ancho, t1.papel_formato_alto AS papel_formato_alto,
|
||||
@ -550,7 +587,7 @@ class PresupuestoModel extends \App\Models\BaseModel
|
||||
t3.codigo AS codigo_encuadernacion,
|
||||
t1.solapas AS solapas_cubierta, CAST(t1.solapas_ancho AS INT) AS solapas_ancho_cubierta,
|
||||
t1.solapas_sobrecubierta AS solapas_sobrecubierta, CAST(t1.solapas_ancho_sobrecubierta AS INT) AS solapas_ancho_sobrecubierta,"
|
||||
);
|
||||
);
|
||||
$builder->join("lg_papel_formato t2", "t1.papel_formato_id = t2.id", "left");
|
||||
$builder->join("tipos_presupuestos t3", "t1.tipo_impresion_id = t3.id", "left");
|
||||
$builder->where("t1.is_deleted", 0);
|
||||
@ -585,7 +622,7 @@ class PresupuestoModel extends \App\Models\BaseModel
|
||||
);
|
||||
$presupuesto->concepto .= $this->generarConceptoLineasPresupuestoLibro($lineas, $presupuesto);
|
||||
|
||||
$presupuesto = (object)[
|
||||
$presupuesto = (object) [
|
||||
'numero' => $presupuesto->numero,
|
||||
'unidades' => $presupuesto->unidades,
|
||||
'total' => $presupuesto->total,
|
||||
@ -634,8 +671,8 @@ class PresupuestoModel extends \App\Models\BaseModel
|
||||
->join('presupuesto_manipulados', 'presupuesto_manipulados.presupuesto_id = presupuestos.id', 'left')
|
||||
->join('lg_tarifa_manipulado', 'lg_tarifa_manipulado.id = presupuesto_manipulados.tarifa_manipulado_id', 'left')
|
||||
->where('presupuestos.id', $presupuesto_id);
|
||||
|
||||
$queryExtras = $this->db->table($this->table)
|
||||
|
||||
$queryExtras = $this->db->table($this->table)
|
||||
->select(
|
||||
[
|
||||
'lg_tarifa_preimpresion.id',
|
||||
@ -645,7 +682,7 @@ class PresupuestoModel extends \App\Models\BaseModel
|
||||
)
|
||||
->join('presupuesto_serviciosExtra', 'presupuesto_serviciosExtra.presupuesto_id = presupuestos.id', 'left')
|
||||
->join('lg_tarifa_preimpresion', 'lg_tarifa_preimpresion.id = presupuesto_serviciosExtra.tarifa_extra_id', 'left')
|
||||
->where('presupuestos.id', $presupuesto_id);
|
||||
->where('presupuestos.id', $presupuesto_id);
|
||||
|
||||
$servicios['acabado'] = $queryAcabado->get()->getResultObject();
|
||||
$servicios['manipulado'] = $queryManipulado->get()->getResultObject();
|
||||
@ -783,5 +820,5 @@ class PresupuestoModel extends \App\Models\BaseModel
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -15,11 +15,10 @@ class PresupuestoServiciosExtraModel extends \App\Models\BaseModel
|
||||
|
||||
const SORTABLE = [
|
||||
0 => "t2.nombre",
|
||||
1 => "t1.precio_unidad",
|
||||
2 => "t1.precio_total"
|
||||
1 => "t1.precio",
|
||||
];
|
||||
|
||||
protected $allowedFields = ["presupuesto_id", "tarifa_extra_id", "precio_total", "precio_unidad", "margen"];
|
||||
protected $allowedFields = ["presupuesto_id", "tarifa_extra_id", "precio", "margen"];
|
||||
protected $returnType = "App\Entities\Presupuestos\PresupuestoServiciosExtraEntity";
|
||||
|
||||
protected $useTimestamps = true;
|
||||
|
||||
@ -21,6 +21,8 @@ class TarifaAcabadoModel extends \App\Models\BaseModel
|
||||
|
||||
protected $allowedFields = [
|
||||
"nombre",
|
||||
"code",
|
||||
"comment",
|
||||
"precio_min",
|
||||
"importe_fijo",
|
||||
"mostrar_en_presupuesto",
|
||||
@ -83,13 +85,13 @@ class TarifaAcabadoModel extends \App\Models\BaseModel
|
||||
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,
|
||||
"t1.id AS id, t1.nombre AS nombre,t1.code AS code, t1.precio_min AS precio_min, t1.importe_fijo AS importe_fijo,
|
||||
t1.mostrar_en_presupuesto AS mostrar_en_presupuesto, t1.acabado_cubierta AS acabado_cubierta, t1.acabado_sobrecubierta AS acabado_sobrecubierta"
|
||||
);
|
||||
|
||||
//JJO
|
||||
$builder->where("t1.is_deleted", 0);
|
||||
|
||||
|
||||
return empty($search)
|
||||
? $builder
|
||||
: $builder
|
||||
@ -114,8 +116,9 @@ class TarifaAcabadoModel extends \App\Models\BaseModel
|
||||
return $builder->orderBy("t1.nombre", "asc")->get()->getResultObject();
|
||||
}
|
||||
|
||||
public function getTarifaPresupuestoAcabado($tarifa_id, $tirada, $proveedor_id = -1){
|
||||
|
||||
public function getTarifaPresupuestoAcabado($tarifa_id, $tirada, $proveedor_id = -1)
|
||||
{
|
||||
|
||||
$builder = $this->db
|
||||
->table($this->table . " t1")
|
||||
->select(
|
||||
@ -128,18 +131,18 @@ class TarifaAcabadoModel extends \App\Models\BaseModel
|
||||
->where("t1.is_deleted", 0)
|
||||
//->where("t1.mostrar_en_presupuesto", 1)
|
||||
->where("t2.is_deleted", 0);
|
||||
|
||||
|
||||
$builder->where('t1.id =', $tarifa_id);
|
||||
$builder->where('t2.tirada_min <=', $tirada);
|
||||
$builder->where('t2.tirada_max >=', $tirada);
|
||||
|
||||
if($proveedor_id != -1){
|
||||
|
||||
if ($proveedor_id != -1) {
|
||||
$builder->where('t2.proveedor_id', $proveedor_id);
|
||||
}
|
||||
return $builder->get()->getResultObject();
|
||||
}
|
||||
|
||||
public function getNombreTarifaAcabado($id=-1)
|
||||
public function getNombreTarifaAcabado($id = -1)
|
||||
{
|
||||
/*
|
||||
Todos los servicios de encuadernacion activas que se pueden usar en presupuestos
|
||||
@ -184,4 +187,23 @@ class TarifaAcabadoModel extends \App\Models\BaseModel
|
||||
|
||||
return $builder->orderBy("t1.id", "asc")->get()->getResultObject();
|
||||
}
|
||||
|
||||
public function getCodeFromId($id = 0)
|
||||
{
|
||||
|
||||
$builder = $this->db
|
||||
->table($this->table . " t1")
|
||||
->select(
|
||||
"t1.code AS code"
|
||||
)
|
||||
->where("t1.id", $id)
|
||||
->where("t1.is_deleted", 0);
|
||||
|
||||
$data = $builder->get()->getResultObject();
|
||||
if (count($data) > 0) {
|
||||
return $data[0]->code;
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -17,7 +17,8 @@ class TarifaEncuadernacionLineaHorasModel extends \App\Models\BaseModel
|
||||
1 => "t1.tiempo_min",
|
||||
2 => "t1.tiempo_max",
|
||||
3 => "t1.precio_hora",
|
||||
4 => "t1.margen",
|
||||
4 => "t1.total_min",
|
||||
5 => "t1.margen",
|
||||
];
|
||||
|
||||
protected $allowedFields = [
|
||||
@ -25,6 +26,7 @@ class TarifaEncuadernacionLineaHorasModel extends \App\Models\BaseModel
|
||||
"tiempo_min",
|
||||
"tiempo_max",
|
||||
"precio_hora",
|
||||
"total_min",
|
||||
"margen",
|
||||
"user_created_id",
|
||||
"is_deleted",
|
||||
@ -54,6 +56,10 @@ class TarifaEncuadernacionLineaHorasModel extends \App\Models\BaseModel
|
||||
"label" => "TarifaEncuadernacionLineas.precioHora",
|
||||
"rules" => "required|decimal",
|
||||
],
|
||||
"total_min" => [
|
||||
"label" => "TarifaEncuadernacionLineas.precioHora",
|
||||
"rules" => "required|decimal",
|
||||
],
|
||||
"margen" => [
|
||||
"label" => "TarifaEncuadernacionLineas.margen",
|
||||
"rules" => "required|decimal",
|
||||
@ -73,6 +79,10 @@ class TarifaEncuadernacionLineaHorasModel extends \App\Models\BaseModel
|
||||
"decimal" => "TarifaEncuadernacionLineas.validation.tirada_max.decimal",
|
||||
"required" => "TarifaEncuadernacionLineas.validation.tirada_max.required",
|
||||
],
|
||||
"total_min" => [
|
||||
"decimal" => "TarifaEncuadernacionLineas.validation.tirada_max.decimal",
|
||||
"required" => "TarifaEncuadernacionLineas.validation.tirada_max.required",
|
||||
],
|
||||
"margen" => [
|
||||
"decimal" => "TarifaEncuadernacionLineas.validation.margen.decimal",
|
||||
"required" => "TarifaEncuadernacionLineas.validation.margen.required",
|
||||
@ -92,7 +102,7 @@ class TarifaEncuadernacionLineaHorasModel extends \App\Models\BaseModel
|
||||
->table($this->table . " t1")
|
||||
->select(
|
||||
"t1.id AS id, t1.tirada_encuadernacion_id AS tirada_encuadernacion_id, t1.tiempo_min AS tiempo_min,
|
||||
t1.tiempo_max AS tiempo_max, t1.precio_hora AS precio_hora, t1.margen AS margen,
|
||||
t1.tiempo_max AS tiempo_max, t1.precio_hora AS precio_hora, t1.total_min AS total_min, t1.margen AS margen,
|
||||
t2.id AS tarifa_encuadernacion"
|
||||
);
|
||||
//JJO
|
||||
|
||||
@ -19,6 +19,8 @@ class TarifaEncuadernacionLineaModel extends \App\Models\BaseModel
|
||||
3 => "t1.paginas_libro_max",
|
||||
4 => "t1.precio_min",
|
||||
5 => "t1.precio_max",
|
||||
6 => "t1.total_min",
|
||||
7 => "t1.margen",
|
||||
];
|
||||
|
||||
protected $allowedFields = [
|
||||
@ -30,6 +32,8 @@ class TarifaEncuadernacionLineaModel extends \App\Models\BaseModel
|
||||
"precio_max",
|
||||
"tirada_min",
|
||||
"tirada_max",
|
||||
"margen",
|
||||
"total_min",
|
||||
"user_created_id",
|
||||
"is_deleted",
|
||||
|
||||
@ -62,6 +66,10 @@ class TarifaEncuadernacionLineaModel extends \App\Models\BaseModel
|
||||
"label" => "TarifaEncuadernacionLineas.tiradaMin",
|
||||
"rules" => "required|decimal",
|
||||
],
|
||||
"total_min" => [
|
||||
"label" => "TarifaEncuadernacionLineas.precioMin",
|
||||
"rules" => "required|decimal",
|
||||
],
|
||||
"paginas_libro_max" => [
|
||||
"label" => "TarifaEncuadernacionLineas.paginasMax",
|
||||
"rules" => "required|decimal",
|
||||
@ -93,6 +101,10 @@ class TarifaEncuadernacionLineaModel extends \App\Models\BaseModel
|
||||
"decimal" => "TarifaEncuadernacionLineas.validation.tirada_min.decimal",
|
||||
"required" => "TarifaEncuadernacionLineas.validation.tirada_min.required",
|
||||
],
|
||||
"total_min" => [
|
||||
"decimal" => "TarifaEncuadernacionLineas.validation.precio_min.decimal",
|
||||
"required" => "TarifaEncuadernacionLineas.validation.precio_min.required",
|
||||
],
|
||||
"paginas_libro_max" => [
|
||||
"decimal" => "TarifaEncuadernacionLineas.validation.paginas_libro_max.decimal",
|
||||
"required" => "TarifaEncuadernacionLineas.validation.paginas_libro_max.required",
|
||||
@ -120,7 +132,7 @@ class TarifaEncuadernacionLineaModel extends \App\Models\BaseModel
|
||||
->table($this->table . " t1")
|
||||
->select(
|
||||
"t1.id AS id, t1.tirada_encuadernacion_id AS tirada_encuadernacion_id, t1.paginas_libro_min AS paginas_libro_min, t1.paginas_libro_max AS paginas_libro_max, t1.precio_min AS precio_min, t1.precio_max AS precio_max, t1.tirada_min AS tirada_min,
|
||||
t1.tirada_max AS tirada_max, t1.margen AS margen, t2.id AS tarifa_encuadernacion, t3.id AS dimensiones_id, t3.ancho_min, t3.ancho_max, , t3.alto_min, t3.alto_max, t3.descripcion as descripcion"
|
||||
t1.tirada_max AS tirada_max, t1.total_min as total_min, t1.margen AS margen, t2.id AS tarifa_encuadernacion, t3.id AS dimensiones_id, t3.ancho_min, t3.ancho_max, , t3.alto_min, t3.alto_max, t3.descripcion as descripcion"
|
||||
);
|
||||
//JJO
|
||||
$builder->where('tirada_encuadernacion_id', $tirada_encuadernacion_id);
|
||||
@ -190,6 +202,7 @@ class TarifaEncuadernacionLineaModel extends \App\Models\BaseModel
|
||||
|
||||
return $builder;
|
||||
}
|
||||
|
||||
|
||||
public function removeAllEncuadernacionLineasForTarifa($tarifaId = -1, $datetime = null, $delete_flag=1){
|
||||
|
||||
|
||||
@ -22,6 +22,8 @@ class TarifaEncuadernacionModel extends \App\Models\BaseModel
|
||||
|
||||
protected $allowedFields = [
|
||||
"nombre",
|
||||
"code",
|
||||
"comment",
|
||||
"mostrar_en_presupuesto",
|
||||
"tipo_encuadernacion",
|
||||
"servicio_encuadernacion",
|
||||
@ -65,7 +67,7 @@ class TarifaEncuadernacionModel extends \App\Models\BaseModel
|
||||
*/
|
||||
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.code AS code,
|
||||
t1.mostrar_en_presupuesto AS mostrar_en_presupuesto,
|
||||
t1.tipo_encuadernacion AS tipo_encuadernacion, t1.servicio_encuadernacion AS servicio_encuadernacion,
|
||||
t1.por_horas AS por_horas");
|
||||
@ -123,7 +125,7 @@ class TarifaEncuadernacionModel extends \App\Models\BaseModel
|
||||
$builder = $this->db
|
||||
->table($this->table . " t1")
|
||||
->select(
|
||||
"t1.id AS tarifa_enc_id, t1.nombre AS tarifa_enc_nombre, t2.precio_min AS tarifa_precio_min, t2.importe_fijo AS tarifa_importe_fijo,
|
||||
"t1.id AS tarifa_enc_id, t1.nombre AS tarifa_enc_nombre, t3.total_min AS tarifa_precio_min, t2.importe_fijo AS tarifa_importe_fijo,
|
||||
t2.id AS tarifa_tirada_id, t2.proveedor_id AS proveedor_id, t5.nombre AS proveedor_nombre, t2.tirada_min AS tirada_min, t2.tirada_max AS tirada_max,
|
||||
t3.id AS tarifa_linea_id, t3.paginas_libro_min AS paginas_min, t3.paginas_libro_max AS paginas_max, t3.precio_min AS precio_min, t3.precio_max AS precio_max, t3.margen AS margen,
|
||||
t4.ancho_min AS ancho_min, t4.ancho_max AS ancho_max, t4.alto_min AS alto_min, t4.alto_max AS alto_max"
|
||||
@ -159,7 +161,7 @@ class TarifaEncuadernacionModel extends \App\Models\BaseModel
|
||||
$builder = $this->db
|
||||
->table($this->table . " t1")
|
||||
->select(
|
||||
"t1.id AS tarifa_enc_id, t1.nombre AS tarifa_enc_nombre, t2.precio_min AS tarifa_precio_min, t2.importe_fijo AS tarifa_importe_fijo,
|
||||
"t1.id AS tarifa_enc_id, t1.nombre AS tarifa_enc_nombre, t3.total_min AS tarifa_precio_min, t2.importe_fijo AS tarifa_importe_fijo,
|
||||
t2.id AS tarifa_tirada_id, t2.proveedor_id AS proveedor_id, t5.nombre AS proveedor_nombre, t2.tirada_min AS tirada_min, t2.tirada_max AS tirada_max,
|
||||
t3.id AS tarifa_linea_id, t3.tiempo_min AS tiempo_min, t3.tiempo_max AS tiempo_max, t3.precio_hora AS precio_hora, t3.margen AS margen"
|
||||
)
|
||||
|
||||
@ -16,7 +16,6 @@ class TarifaEncuadernacionTiradaModel extends \App\Models\BaseModel
|
||||
0 => "t3.nombre",
|
||||
1 => "t1.tirada_min",
|
||||
2 => "t1.tirada_max",
|
||||
3 => "t1.precio_min",
|
||||
4 => "t1.importe_fijo",
|
||||
];
|
||||
|
||||
@ -25,7 +24,6 @@ class TarifaEncuadernacionTiradaModel extends \App\Models\BaseModel
|
||||
"tirada_min",
|
||||
"tirada_max",
|
||||
"proveedor_id",
|
||||
"precio_min",
|
||||
"importe_fijo",
|
||||
"user_created_id",
|
||||
"user_updated_id",
|
||||
@ -53,10 +51,6 @@ class TarifaEncuadernacionTiradaModel extends \App\Models\BaseModel
|
||||
"label" => "TarifaEncuadernacionTiradas.tiradaMin",
|
||||
"rules" => "required|integer",
|
||||
],
|
||||
"precio_min" => [
|
||||
"label" => "Tarifaencuadernacion.precioMin",
|
||||
"rules" => "required|decimal",
|
||||
],
|
||||
"importe_fijo" => [
|
||||
"label" => "Tarifaencuadernacion.importeFijo",
|
||||
"rules" => "required|decimal",
|
||||
@ -72,10 +66,6 @@ class TarifaEncuadernacionTiradaModel extends \App\Models\BaseModel
|
||||
"integer" => "TarifaEncuadernacionTiradas.validation.tirada_min.integer",
|
||||
"required" => "TarifaEncuadernacionTiradas.validation.tirada_min.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",
|
||||
@ -95,7 +85,7 @@ class TarifaEncuadernacionTiradaModel extends \App\Models\BaseModel
|
||||
->table($this->table . " t1")
|
||||
->select(
|
||||
"t1.id AS id, t1.tarifa_encuadernacion_id AS tarifa_encuadernacion_id,
|
||||
t1.precio_min AS precio_min, t1.importe_fijo AS importe_fijo,
|
||||
t1.importe_fijo AS importe_fijo,
|
||||
t1.tirada_min AS tirada_min, t1.tirada_max AS tirada_max,
|
||||
t3.nombre AS proveedor, t3.id AS proveedor_id, t2.id AS tarifa_encuadernacion"
|
||||
);
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Tarifas;
|
||||
|
||||
class TarifaEnvioModel extends \App\Models\BaseModel
|
||||
@ -17,7 +18,7 @@ class TarifaEnvioModel extends \App\Models\BaseModel
|
||||
1 => "t2.nombre",
|
||||
];
|
||||
|
||||
protected $allowedFields = ["pais_id", "nombre","deleted_at","is_deleted"];
|
||||
protected $allowedFields = ["pais_id", "nombre", "code", "comment", "deleted_at", "is_deleted"];
|
||||
protected $returnType = "App\Entities\Tarifas\TarifaEnvioEntity";
|
||||
|
||||
protected $useTimestamps = true;
|
||||
@ -73,7 +74,7 @@ class TarifaEnvioModel extends \App\Models\BaseModel
|
||||
*/
|
||||
public function getResource(string $search = "")
|
||||
{
|
||||
$builder = $this->db->table($this->table . " t1")->select("t1.id as id, t1.nombre AS nombre, t2.nombre AS pais_id");
|
||||
$builder = $this->db->table($this->table . " t1")->select("t1.id as id, t1.nombre AS nombre,t1.code AS code, t2.nombre AS pais_id");
|
||||
$builder->join("lg_paises t2", "t1.pais_id = t2.id", "left");
|
||||
|
||||
//JJO
|
||||
@ -82,43 +83,44 @@ class TarifaEnvioModel extends \App\Models\BaseModel
|
||||
return empty($search)
|
||||
? $builder
|
||||
: $builder
|
||||
->groupStart()
|
||||
->like("t1.nombre", $search)
|
||||
->orLike("t2.id", $search)
|
||||
->orLike("t1.pais_id", $search)
|
||||
->orLike("t1.nombre", $search)
|
||||
->orLike("t2.nombre", $search)
|
||||
->groupEnd();
|
||||
->groupStart()
|
||||
->like("t1.nombre", $search)
|
||||
->orLike("t2.code", $search)
|
||||
->orLike("t2.id", $search)
|
||||
->orLike("t1.pais_id", $search)
|
||||
->orLike("t1.nombre", $search)
|
||||
->orLike("t2.nombre", $search)
|
||||
->groupEnd();
|
||||
}
|
||||
|
||||
public function getTarifaEnvio($paisId, string $cp, $peso, $tipo_envio){
|
||||
public function getTarifaEnvio($paisId, string $cp, $peso, $tipo_envio)
|
||||
{
|
||||
// Si el pais es españa se tienen que tener en cuenta los postales
|
||||
// Se busca primero la tarifa a la que corresponde
|
||||
$builder = $this->db->table($this->table . " t1")
|
||||
->select("t1.id AS tarifa_envio_id, t2.importe_fijo as importe_fijo")
|
||||
->join("tarifas_envios_zonas t2", "t1.id = t2.tarifa_envio_id")
|
||||
->where("t1.pais_id", $paisId)
|
||||
->where("t1.is_deleted", 0)
|
||||
->where("t2.is_deleted", 0);
|
||||
|
||||
if($paisId == 1) {// España
|
||||
->select("t1.id AS tarifa_envio_id, t2.importe_fijo as importe_fijo")
|
||||
->join("tarifas_envios_zonas t2", "t1.id = t2.tarifa_envio_id")
|
||||
->where("t1.pais_id", $paisId)
|
||||
->where("t1.is_deleted", 0)
|
||||
->where("t2.is_deleted", 0);
|
||||
|
||||
if ($paisId == 1) { // España
|
||||
$builder->where("CAST(t2.cp_inicial AS UNSIGNED)<=", intval($cp))
|
||||
->where("CAST(t2.cp_final AS UNSIGNED) >=", intval($cp));
|
||||
->where("CAST(t2.cp_final AS UNSIGNED) >=", intval($cp));
|
||||
}
|
||||
$tarifas = $builder->get()->getResultObject();
|
||||
|
||||
$resultado = [];
|
||||
|
||||
|
||||
$model = model('App\Models\Tarifas\TarifaEnvioPrecioModel');
|
||||
foreach($tarifas as $tarifa){
|
||||
foreach ($tarifas as $tarifa) {
|
||||
$precio_tarifas = $model->getEnvioPrecio($tarifa->tarifa_envio_id, $peso, $tipo_envio);
|
||||
foreach($precio_tarifas as $precio_tarifa){
|
||||
foreach ($precio_tarifas as $precio_tarifa) {
|
||||
$precio_tarifa->importe_fijo = $tarifa->importe_fijo;
|
||||
array_push($resultado, $precio_tarifa);
|
||||
}
|
||||
}
|
||||
|
||||
return $resultado;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -22,6 +22,8 @@ class TarifaManipuladoModel extends \App\Models\BaseModel
|
||||
protected $allowedFields = [
|
||||
"nombre",
|
||||
"precio_min",
|
||||
"code",
|
||||
"comment",
|
||||
"importe_fijo",
|
||||
"mostrar_en_presupuesto",
|
||||
"deleted_at",
|
||||
@ -80,7 +82,7 @@ class TarifaManipuladoModel extends \App\Models\BaseModel
|
||||
*/
|
||||
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
|
||||
$builder = $this->db->table($this->table . " t1")->select("t1.id AS id,t1.code AS code, t1.nombre AS nombre, t1.precio_min AS precio_min, t1.importe_fijo AS importe_fijo
|
||||
,t1.mostrar_en_presupuesto AS mostrar_en_presupuesto");
|
||||
|
||||
//JJO
|
||||
|
||||
@ -13,7 +13,9 @@ class TarifaextraModel extends \App\Models\BaseModel
|
||||
protected $useAutoIncrement = true;
|
||||
|
||||
protected $allowedFields = [
|
||||
"nombre",
|
||||
"nombre",
|
||||
"code",
|
||||
"comment",
|
||||
"precio",
|
||||
"margen",
|
||||
"mostrar_en_presupuesto",
|
||||
|
||||
@ -13,7 +13,9 @@ class TarifapreimpresionModel extends \App\Models\BaseModel
|
||||
protected $useAutoIncrement = true;
|
||||
|
||||
protected $allowedFields = [
|
||||
"nombre",
|
||||
"nombre",
|
||||
"code",
|
||||
"comment",
|
||||
"precio",
|
||||
"margen",
|
||||
"mostrar_en_presupuesto",
|
||||
@ -37,6 +39,14 @@ class TarifapreimpresionModel extends \App\Models\BaseModel
|
||||
"label" => "Tarifapreimpresion.nombre",
|
||||
"rules" => "trim|required|max_length[255]",
|
||||
],
|
||||
"code" => [
|
||||
"label" => "Tarifapreimpresion.code",
|
||||
"rules" => "trim|required|max_length[5]",
|
||||
],
|
||||
"comment" => [
|
||||
"label" => "Tarifapreimpresion.comment",
|
||||
"rules" => "trim|max_length[255]",
|
||||
],
|
||||
"precio" => [
|
||||
"label" => "Tarifapreimpresion.precio",
|
||||
"rules" => "required|decimal",
|
||||
@ -52,6 +62,14 @@ class TarifapreimpresionModel extends \App\Models\BaseModel
|
||||
"max_length" => "Tarifapreimpresion.validation.nombre.max_length",
|
||||
"required" => "Tarifapreimpresion.validation.nombre.required",
|
||||
],
|
||||
"code" => [
|
||||
"max_length" => "Tarifapreimpresion.validation.code.max_length",
|
||||
"required" => "Tarifapreimpresion.validation.code.required",
|
||||
],
|
||||
"comment" => [
|
||||
"max_length" => "Tarifapreimpresion.validation.comment.max_length",
|
||||
"required" => "Tarifapreimpresion.validation.comment.required",
|
||||
],
|
||||
"precio" => [
|
||||
"decimal" => "Tarifapreimpresion.validation.precio.decimal",
|
||||
"required" => "Tarifapreimpresion.validation.precio.required",
|
||||
|
||||
@ -15,37 +15,44 @@ class PresupuestoClienteService extends BaseService
|
||||
{
|
||||
|
||||
$rotativa = [];
|
||||
$plana = PresupuestoClienteService::obtenerPresupuestoClienteInterior($data);
|
||||
$plana = [];
|
||||
// no se busca en plana cuando es estándar (no Premium)
|
||||
if ($data['isHq'])
|
||||
$plana = PresupuestoClienteService::obtenerPresupuestoClienteInterior($data);
|
||||
if (!$data['excluirRotativa'] && !$data['isHq'])
|
||||
$rotativa = PresupuestoClienteService::obtenerPresupuestoClienteInteriorRotativa($data);
|
||||
|
||||
$total_plana = -1;
|
||||
$hay_plana = false;
|
||||
if($data['isColor']){
|
||||
if ($data['datosPedido']->paginas == $data['paginas_color'])
|
||||
$total_plana += floatval($plana[1]['total_impresion']);
|
||||
|
||||
elseif(count($plana[0]) > 2 && count($plana[1]) > 2) {
|
||||
$total_plana = 0.0;
|
||||
foreach ($plana as $linea) {
|
||||
if (count($linea) > 0)
|
||||
$total_plana += floatval($linea['total_impresion']);
|
||||
if ($data['isColor']) {
|
||||
if ($data['datosPedido']->paginas == $data['paginas_color']){
|
||||
if(count($plana[1]) > 2)
|
||||
$total_plana += floatval($plana[1]['total_impresion']);
|
||||
else
|
||||
return -1;
|
||||
}
|
||||
|
||||
elseif (count($plana) > 0) {
|
||||
if (count($plana[0]) > 2 && count($plana[1]) > 2) {
|
||||
$total_plana = 0.0;
|
||||
foreach ($plana as $linea) {
|
||||
if (count($linea) > 0)
|
||||
$total_plana += floatval($linea['total_impresion']);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
foreach ($plana as $linea) {
|
||||
if (count($linea) > 0)
|
||||
if($linea['tipo_linea'] == 'lp_bn' || $linea['tipo_linea'] == 'lp_bnhq'){
|
||||
if ($linea['tipo_linea'] == 'lp_bn' || $linea['tipo_linea'] == 'lp_bnhq') {
|
||||
$total_plana = 0.0;
|
||||
$total_plana = floatval($linea['total_impresion']);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
$total_rotativa = -1;
|
||||
if (!$data['excluirRotativa'] && count($rotativa) > 0 && $rotativa['num_formas']['posicion_formas'] != 'n/a') {
|
||||
if (!$data['excluirRotativa'] && count($rotativa) > 0 && $rotativa['num_formas']['posicion_formas'] != 'n/a') {
|
||||
$total_rotativa = floatval($rotativa['total_impresion']);
|
||||
}
|
||||
if ($total_plana < 0 && $total_rotativa < 0)
|
||||
@ -70,9 +77,10 @@ class PresupuestoClienteService extends BaseService
|
||||
$isHq = $data['isHq'];
|
||||
$cliente_id = $data['cliente_id'];
|
||||
$paginas_color = $data['paginas_color'];
|
||||
$lomoRedondo = $data['lomoRedondo'];
|
||||
|
||||
$lineas_cubierta = [];
|
||||
|
||||
|
||||
for ($i = 0; $i < 2; $i++) {
|
||||
|
||||
$lineas = PresupuestoService::obtenerComparadorPlana([
|
||||
@ -84,7 +92,8 @@ class PresupuestoClienteService extends BaseService
|
||||
'isColor' => $isColor,
|
||||
'isHq' => $isHq,
|
||||
'cliente_id' => $cliente_id,
|
||||
'a_favor_fibra' => $i
|
||||
'a_favor_fibra' => $i,
|
||||
'lomoRedondo' => $lomoRedondo
|
||||
]);
|
||||
|
||||
if (count($lineas) > 0) {
|
||||
@ -124,7 +133,7 @@ class PresupuestoClienteService extends BaseService
|
||||
$paginas_color = $data['paginas_color'];
|
||||
|
||||
$lineas_sobrecubierta = [];
|
||||
|
||||
|
||||
for ($i = 0; $i < 2; $i++) {
|
||||
|
||||
$lineas = PresupuestoService::obtenerComparadorPlana([
|
||||
@ -175,7 +184,7 @@ class PresupuestoClienteService extends BaseService
|
||||
$cliente_id = $data['cliente_id'];
|
||||
|
||||
$lineas_guardas = [];
|
||||
|
||||
|
||||
for ($i = 0; $i < 2; $i++) {
|
||||
|
||||
$lineas = PresupuestoService::obtenerComparadorPlana([
|
||||
@ -238,11 +247,21 @@ class PresupuestoClienteService extends BaseService
|
||||
$uso = $data['uso'];
|
||||
$tipo_impresion_id = $data['tipo_impresion_id'];
|
||||
$datosPedido = $data['datosPedido'];
|
||||
$papel_generico = $data['papel_generico'];
|
||||
$gramaje = $data['gramaje'];
|
||||
if ($data['papelInteriorDiferente'] == false)
|
||||
$papel_generico = $data['papel_generico'];
|
||||
else {
|
||||
$papel_generico = $data['papel_generico']['negro'];
|
||||
$papel_generico_color = $data['papel_generico']['color'];
|
||||
}
|
||||
if ($data['papelInteriorDiferente'] == false)
|
||||
$gramaje = $data['gramaje'];
|
||||
else {
|
||||
$gramaje = $data['gramaje']['negro'];
|
||||
$gramaje_color = $data['gramaje']['color'];
|
||||
}
|
||||
$isColor = $data['isColor'];
|
||||
$isHq = $data['isHq'];
|
||||
$cliente_id = $data['cliente_id'];
|
||||
$cliente_id = $data['cliente_id'];
|
||||
$paginas_color = $data['paginas_color'];
|
||||
|
||||
$paginas_negro = $datosPedido->paginas - $paginas_color;
|
||||
@ -285,8 +304,6 @@ class PresupuestoClienteService extends BaseService
|
||||
return $result;
|
||||
}
|
||||
);
|
||||
$linea_negro_plana = $linea_negro_plana[0]['fields'];
|
||||
$linea_negro_plana['tipo_linea'] = $isHq ? 'lp_bnhq' : 'lp_bn';
|
||||
}
|
||||
}
|
||||
|
||||
@ -296,6 +313,10 @@ class PresupuestoClienteService extends BaseService
|
||||
$datosPedido->paginas = $paginas_color;
|
||||
for ($i = 0; $i < 2; $i++) {
|
||||
|
||||
if ($data['papelInteriorDiferente'] == true) {
|
||||
$papel_generico = $papel_generico_color;
|
||||
$gramaje = $gramaje_color;
|
||||
}
|
||||
$lineas = PresupuestoService::obtenerComparadorPlana([
|
||||
'uso' => $uso,
|
||||
'tipo_impresion_id' => $tipo_impresion_id,
|
||||
@ -325,14 +346,61 @@ class PresupuestoClienteService extends BaseService
|
||||
return $result;
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Si hay negro y color, y se hace con el mismo papel, hay que buscar la combinación
|
||||
// más económica con la misma máquna
|
||||
if (
|
||||
$paginas_negro > 0 && $paginas_color > 0 && $data['papelInteriorDiferente'] == 0 &&
|
||||
count($linea_negro_plana) > 0 && count($linea_color_plana) > 0
|
||||
) {
|
||||
$mejor_combinacion = null;
|
||||
$coste_menor = PHP_INT_MAX;
|
||||
// Iteramos ambos arrays
|
||||
foreach ($linea_color_plana as $color_item) {
|
||||
foreach ($linea_negro_plana as $negro_item) {
|
||||
// Comparar si tienen el mismo 'maquina_id'
|
||||
if ($color_item['fields']['maquina_id'] == $negro_item['fields']['maquina_id']) {
|
||||
// Sumar los 'total_impresion' de ambas líneas
|
||||
$costo_total = $color_item['fields']['total_impresion'] + $negro_item['fields']['total_impresion'];
|
||||
|
||||
// Verificar si es la combinación más barata hasta ahora
|
||||
if ($costo_total < $coste_menor) {
|
||||
$coste_menor = $costo_total;
|
||||
$mejor_combinacion = [
|
||||
'maquina_id' => $color_item['fields']['maquina_id'],
|
||||
'costo_total' => $costo_total,
|
||||
'color_item' => $color_item,
|
||||
'negro_item' => $negro_item,
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Retornar la mejor combinación encontrada
|
||||
if ($mejor_combinacion !== null) {
|
||||
return [$mejor_combinacion['negro_item']['fields'], $mejor_combinacion['color_item']['fields']];
|
||||
} else {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (count($linea_negro_plana) > 0) {
|
||||
$linea_negro_plana = $linea_negro_plana[0]['fields'];
|
||||
$linea_negro_plana['tipo_linea'] = $isHq ? 'lp_bnhq' : 'lp_bn';
|
||||
}
|
||||
if (count($linea_color_plana) > 0) {
|
||||
$linea_color_plana = $linea_color_plana[0]['fields'];
|
||||
$linea_color_plana['tipo_linea'] = $isHq ? 'lp_colorhq' : 'lp_color';
|
||||
}
|
||||
}
|
||||
|
||||
return [$linea_negro_plana, $linea_color_plana];
|
||||
}
|
||||
|
||||
public static function getServiciosEncuadernacionDefault($data){
|
||||
public static function getServiciosEncuadernacionDefault($data)
|
||||
{
|
||||
|
||||
$tipo_impresion_id = $data['tipo_impresion_id'] ?? -1;
|
||||
$tirada = $data['tirada'] ?? -1;
|
||||
@ -348,42 +416,46 @@ class PresupuestoClienteService extends BaseService
|
||||
return $values;
|
||||
}
|
||||
|
||||
public static function getServiciosManipulado($data){
|
||||
public static function getServiciosManipulado($data)
|
||||
{
|
||||
|
||||
$tarifa_id = $data['tarifa_id'] ?? -1;
|
||||
$tirada = $data['tirada'] ?? -1;
|
||||
$POD = $data['POD'] ?? -1;
|
||||
|
||||
|
||||
$model = model('App\Models\Presupuestos\PresupuestoManipuladosModel');
|
||||
$values = $model->getPrecioTarifa($tarifa_id, $tirada, $POD);
|
||||
return $values;
|
||||
}
|
||||
|
||||
public static function getServiciosPreimpresion($data){
|
||||
public static function getServiciosPreimpresion($data)
|
||||
{
|
||||
|
||||
$tarifa_id = $data['tarifa_id'] ?? -1;
|
||||
|
||||
|
||||
$model = model('App\Models\Presupuestos\PresupuestoPreimpresionesModel');
|
||||
$values = $model->getPrecioTarifa($tarifa_id);
|
||||
return $values;
|
||||
}
|
||||
|
||||
|
||||
public static function getServiciosExtra($data){
|
||||
public static function getServiciosExtra($data)
|
||||
{
|
||||
|
||||
$tarifa_id = $data['tarifa_id'] ?? -1;
|
||||
|
||||
|
||||
$model = model('App\Models\Presupuestos\PresupuestoServiciosExtraModel');
|
||||
$values = $model->getPrecioTarifa($tarifa_id);
|
||||
return $values;
|
||||
}
|
||||
|
||||
public static function getServiciosAcabados($data){
|
||||
public static function getServiciosAcabados($data)
|
||||
{
|
||||
|
||||
$tarifa_id = $data['tarifa_id'] ?? -1;
|
||||
$tirada = $data['tirada'] ?? -1;
|
||||
$POD = $data['POD'] ?? -1;
|
||||
|
||||
|
||||
$model = model('App\Models\Presupuestos\PresupuestoAcabadosModel');
|
||||
$values = $model->getPrecioTarifa($tarifa_id, $tirada, -1, $POD); // proveedor más barato
|
||||
return $values;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -21,10 +21,13 @@ if (session()->has('error')) {
|
||||
<div id="sk-alert">
|
||||
</div>
|
||||
|
||||
<div id="sk-alert-2">
|
||||
</div>
|
||||
|
||||
|
||||
<?= $this->section('globalJsFunctions') ?>
|
||||
|
||||
function popAlert(message, alertClass, alertIcon, containerId = 'sk-alert'){
|
||||
function popAlert(message, alertClass, alertIcon, containerId = 'sk-alert', fade = true){
|
||||
var htmlString = `
|
||||
<div class="alert ${alertClass} d-flex align-items-baseline" role="alert">
|
||||
<span class="alert-icon alert-icon-lg text-primary me-2">
|
||||
@ -37,25 +40,39 @@ function popAlert(message, alertClass, alertIcon, containerId = 'sk-alert'){
|
||||
if(containerId == 'sk-alert'){
|
||||
$(window).scrollTop(0);
|
||||
}
|
||||
$('#' + containerId).hide().empty().html(htmlString).fadeIn("slow", function(){
|
||||
if(fade){
|
||||
$('#' + containerId).hide().empty().html(htmlString).fadeIn("slow", function(){
|
||||
setTimeout(function(){
|
||||
$('#' + containerId).fadeOut("slow");
|
||||
}, 5000);
|
||||
});
|
||||
}
|
||||
else{
|
||||
$('#' + containerId).hide().empty().html(htmlString).fadeIn("slow");
|
||||
$('html, body').animate({ scrollTop: 0 }, 500);
|
||||
}
|
||||
}
|
||||
|
||||
function popSuccessAlert(successMsg, containerId = 'sk-alert', fade = true){
|
||||
popAlert(successMsg, "alert-success", "ti-check", containerId, fade);
|
||||
}
|
||||
|
||||
function popWarningAlert(warningMsg, containerId = 'sk-alert', fade = true){
|
||||
popAlert(warningMsg, "alert-warning", "ti-bell", containerId, fade);
|
||||
}
|
||||
|
||||
function popErrorAlert(errorMsg, containerId = 'sk-alert', fade = true){
|
||||
popAlert(errorMsg, "alert-danger", "ti-ban", containerId, fade);
|
||||
}
|
||||
|
||||
function popAlert2Hide(containerId = 'sk-alert-2'){
|
||||
$('#' + containerId).hide().empty().fadeIn("slow", function(){
|
||||
setTimeout(function(){
|
||||
$('#' + containerId).fadeOut("slow");
|
||||
}, 5000);
|
||||
}, 2000);
|
||||
});
|
||||
}
|
||||
|
||||
function popSuccessAlert(successMsg, containerId = 'sk-alert'){
|
||||
popAlert(successMsg, "alert-success", "ti-check", containerId);
|
||||
}
|
||||
|
||||
function popWarningAlert(warningMsg, containerId = 'sk-alert'){
|
||||
popAlert(warningMsg, "alert-warning", "ti-bell", containerId);
|
||||
}
|
||||
|
||||
function popErrorAlert(errorMsg, containerId = 'sk-alert'){
|
||||
popAlert(errorMsg, "alert-danger", "ti-ban", containerId);
|
||||
}
|
||||
|
||||
<?php if (isset($successMessage) && $successMessage){ ?>
|
||||
popSuccessAlert(`<?= $successMessage ?>`);
|
||||
<?php } ?>
|
||||
|
||||
@ -15,17 +15,21 @@
|
||||
<li class="nav-item">
|
||||
<button type="button" class="nav-link active" role="tab" data-bs-toggle="tab" data-bs-target="#navs-pills-top-chat" aria-controls="navs-pills-top-internal-chat" aria-selected="false">Chat</button>
|
||||
</li>
|
||||
<?php if (auth()->user()->inGroup('admin') || auth()->user()->inGroup('beta')) { ?>
|
||||
<li class="nav-item">
|
||||
<button type="button" class="nav-link" role="tab" data-bs-toggle="tab" data-bs-target="#navs-pills-top-internal-messages" aria-controls="navs-pills-top-internal-messages" aria-selected="false">Mensajes internos</button>
|
||||
</li>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane fade show active" id="navs-pills-top-chat" role="tabpanel">
|
||||
<?= view("themes/vuexy/components/chat_factura", data: ["modelId" => $modelId,"type" => "factura"]) ?>
|
||||
</div>
|
||||
<?php if (auth()->user()->inGroup('admin') || auth()->user()->inGroup('beta')) { ?>
|
||||
<div class="tab-pane fade" id="navs-pills-top-internal-messages" role="tabpanel">
|
||||
<?= view("themes/vuexy/components/internal_messages", data: ["modelId" => $modelId,"type" => "factura"]) ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -15,17 +15,21 @@
|
||||
<li class="nav-item">
|
||||
<button type="button" class="nav-link active" role="tab" data-bs-toggle="tab" data-bs-target="#navs-pills-top-chat" aria-controls="navs-pills-top-internal-chat" aria-selected="false">Chat</button>
|
||||
</li>
|
||||
<?php if (auth()->user()->inGroup('admin') || auth()->user()->inGroup('beta')) { ?>
|
||||
<li class="nav-item">
|
||||
<button type="button" class="nav-link" role="tab" data-bs-toggle="tab" data-bs-target="#navs-pills-top-internal-messages" aria-controls="navs-pills-top-internal-messages" aria-selected="false">Mensajes internos</button>
|
||||
</li>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane fade show active" id="navs-pills-top-chat" role="tabpanel">
|
||||
<?= view("themes/vuexy/components/chat_pedido", data: ["modelId" => $modelId, "type" => "pedido"]) ?>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="navs-pills-top-internal-messages" role="tabpanel">
|
||||
<?= view("themes/vuexy/components/internal_messages", data: ["modelId" => $modelId, "type" => "pedido"]) ?>
|
||||
</div>
|
||||
<?php if (auth()->user()->inGroup('admin') || auth()->user()->inGroup('beta')) { ?>
|
||||
<div class="tab-pane fade" id="navs-pills-top-internal-messages" role="tabpanel">
|
||||
<?= view("themes/vuexy/components/internal_messages", data: ["modelId" => $modelId, "type" => "pedido"]) ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -15,17 +15,21 @@
|
||||
<li class="nav-item">
|
||||
<button type="button" class="nav-link active" role="tab" data-bs-toggle="tab" data-bs-target="#navs-pills-top-chat" aria-controls="navs-pills-top-internal-chat" aria-selected="false">Chat</button>
|
||||
</li>
|
||||
<?php if (auth()->user()->inGroup('admin') || auth()->user()->inGroup('beta')) { ?>
|
||||
<li class="nav-item">
|
||||
<button type="button" class="nav-link" role="tab" data-bs-toggle="tab" data-bs-target="#navs-pills-top-internal-messages" aria-controls="navs-pills-top-internal-messages" aria-selected="false">Mensajes internos</button>
|
||||
</li>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane fade show active" id="navs-pills-top-chat" role="tabpanel">
|
||||
<?= view("themes/vuexy/components/chat_presupuesto", data: ["modelId" => $modelId, "type" => "presupuesto"]) ?>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="navs-pills-top-internal-messages" role="tabpanel">
|
||||
<?= view("themes/vuexy/components/internal_messages", data: ["modelId" => $modelId, "type" => "presupuesto"]) ?>
|
||||
</div>
|
||||
<?php if (auth()->user()->inGroup('admin') || auth()->user()->inGroup('beta')) { ?>
|
||||
<div class="tab-pane fade" id="navs-pills-top-internal-messages" role="tabpanel">
|
||||
<?= view("themes/vuexy/components/internal_messages", data: ["modelId" => $modelId, "type" => "presupuesto"]) ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -37,16 +37,6 @@
|
||||
<!-- CHAT LIST -->
|
||||
|
||||
</ul>
|
||||
<!-- Contacts -->
|
||||
<ul class="list-unstyled chat-contact-list mb-0" id="contact-list">
|
||||
<li class="chat-contact-list-item chat-contact-list-item-title">
|
||||
<h5 class="text-primary mb-0">Contactos</h5>
|
||||
</li>
|
||||
<li class="chat-contact-list-item contact-list-item-0 d-none">
|
||||
<h6 class="text-muted mb-0">No Contacts Found</h6>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /Chat contacts -->
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
<div class="container-xl flex-grow-1 container-p-y" id="chat-presupuesto" data-id="<?= $modelId ?>">
|
||||
<div id="chat-presupuesto" data-id="<?= $modelId ?>">
|
||||
<div class="app-chat card overflow-hidden">
|
||||
<div class="row g-0">
|
||||
|
||||
|
||||
@ -31,7 +31,7 @@
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-label-secondary" data-bs-dismiss="modal"><?= lang('App.come_back') ?></button>
|
||||
<button type="button" class="btn btn-label-secondary" data-bs-dismiss="modal"><?= lang('App.global_come_back') ?></button>
|
||||
<button type="button" id="submit_new_hebra" class="btn btn-primary d-none"><?= lang('Chat.modal.btn_send') ?></button>
|
||||
<button type="button" id="submit_update_hebra" class="btn btn-primary d-none"><?= lang('Chat.modal.btn_send_update') ?></button>
|
||||
</div>
|
||||
|
||||
@ -1,5 +1,18 @@
|
||||
<div id="loader" style="display: none; position: fixed; left: 0; top: 0; width: 100%; height: 100%; z-index: 9999;">
|
||||
<div style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);">
|
||||
<img src="<?= site_url("assets/img/loader.gif") ?>" alt="Loading..."/>
|
||||
<div id="loader" class="modal modal-transparent" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="staticBackdropLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-body">
|
||||
<div class="loader">
|
||||
<div class="book">
|
||||
<div class="book__pg-shadow"></div>
|
||||
<div class="book__pg"></div>
|
||||
<div class="book__pg book__pg--2"></div>
|
||||
<div class="book__pg book__pg--3"></div>
|
||||
<div class="book__pg book__pg--4"></div>
|
||||
<div class="book__pg book__pg--5"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -1,259 +1,144 @@
|
||||
<?= $this->include('themes/_commonPartialsBs/datatables') ?>
|
||||
<?= $this->include("themes/_commonPartialsBs/select2bs5") ?>
|
||||
<?= $this->include("themes/_commonPartialsBs/sweetalert") ?>
|
||||
|
||||
<?= $this->extend('themes/vuexy/main/defaultlayout') ?>
|
||||
|
||||
|
||||
<?= $this->section("content") ?>
|
||||
|
||||
<?= view("themes/vuexy/form/clientes/cliente/_clienteDireccionesForm") ?>
|
||||
<?= view("themes/_commonPartialsBs/_modalInput") ?>
|
||||
<?= view("themes/vuexy/components/modals/modalDireccion") ?>
|
||||
|
||||
<div class="container-xxl flex-grow-1 container-p-y">
|
||||
|
||||
<div class="col-12">
|
||||
<h3 class="card-title"><?= $boxTitle ?? $pageTitle ?></h3>
|
||||
<?= csrf_field() ?>
|
||||
<?= view("themes/_commonPartialsBs/_alertBoxes") ?>
|
||||
<?= view("themes/vuexy/form/presupuestos/cliente/loader") ?>
|
||||
<?= !empty($validation->getErrors()) ? $validation->listErrors("bootstrap_style") : "" ?>
|
||||
|
||||
<input hidden id="lc" value=""></input>
|
||||
<input hidden id="lsc" value=""></input>
|
||||
<input readonly hidden id="pod" value="<?= $POD ?>"></input>
|
||||
<input readonly hidden id="c" value="<?= $clienteId ?>"></input>
|
||||
|
||||
<!-- Create Deal Wizard -->
|
||||
<div id="wizard-presupuesto-cliente" class="bs-stepper vertical mt-2 linear">
|
||||
|
||||
<?php if ($presupuestoEntity->estado_id == 1) : ?>
|
||||
|
||||
<div class="bs-stepper-header">
|
||||
|
||||
<div class="step active" data-target="#tipo-libro">
|
||||
<button type="button" class="step-trigger" aria-selected="false" disabled="disabled">
|
||||
<span class="bs-stepper-circle"><i class="ti ti-book ti-sm"></i></span>
|
||||
<span class="bs-stepper-label">
|
||||
<span class="bs-stepper-title">Tipo de libro</span>
|
||||
<span class="bs-stepper-subtitle">Cosido, Fresado, ...</span>
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="line"></div>
|
||||
|
||||
<div class="step" data-target="#disenio-libro">
|
||||
<button type="button" class="step-trigger" aria-selected="false" disabled="disabled">
|
||||
<span class="bs-stepper-circle"><i class="ti ti-book ti-sm"></i></span>
|
||||
<span class="bs-stepper-label">
|
||||
<span class="bs-stepper-title">Diseño del libro</span>
|
||||
<span class="bs-stepper-subtitle">Detalles técnicos del libro</span>
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="line"></div>
|
||||
|
||||
<div class="step" data-target="#direcciones-libro">
|
||||
<button type="button" class="step-trigger" aria-selected="false" disabled="disabled">
|
||||
<span class="bs-stepper-circle"><i class="ti ti-map-pins ti-sm"></i></span>
|
||||
<span class="bs-stepper-label">
|
||||
<span class="bs-stepper-title">Direcciones</span>
|
||||
<span class="bs-stepper-subtitle">Dirección envío, facturación</span>
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="line"></div>
|
||||
|
||||
<div class="step" data-target="#resumen-libro">
|
||||
<button type="button" class="step-trigger" aria-selected="false" disabled="disabled">
|
||||
<span class="bs-stepper-circle"><i class="ti ti-checkbox ti-sm"></i></span>
|
||||
<span class="bs-stepper-label">
|
||||
<span class="bs-stepper-title">Resumen del presupuesto</span>
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div id="errorGeneral" class="fv-plugins-message-container invalid-feedback" style="display: none;">
|
||||
<p>Se ha producido un error <br>
|
||||
al calcular el presupuesto. <br>
|
||||
Póngase en contacto con el <br>
|
||||
administrador.</p>
|
||||
</div>
|
||||
|
||||
<div id='divTiradasPrecio'>
|
||||
|
||||
</div>
|
||||
<div class="bs-stepper-header">
|
||||
|
||||
<div <?= ($state == 2)? 'hidden': '' ?> class="step active titulos-menu" data-target="#datos-generales">
|
||||
<button type="button" class="step-trigger" aria-selected="false" disabled="disabled">
|
||||
<span class="bs-stepper-circle"><i class="ti ti-info-circle ti-sm"></i></span>
|
||||
<span class="bs-stepper-label">
|
||||
<span class="bs-stepper-title">Datos generales</span>
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="bs-stepper-content">
|
||||
<form id="presupuesto-cliente-form" onsubmit="return false">
|
||||
|
||||
|
||||
<!-- Tipo Libro -->
|
||||
<div id="tipo-libro" class="content active" dstepper-block fv-plugins-bootstrap5 fv-plugins-framework">
|
||||
|
||||
<div class="row g-3">
|
||||
|
||||
<?= view("themes/vuexy/form/presupuestos/cliente/_tipoLibroItems") ?>
|
||||
|
||||
<div class="col-12 d-flex justify-content-between mt-4">
|
||||
<button class="btn btn-primary btn-prev waves-effect waves-light">
|
||||
<i class="ti ti-arrow-left ti-xs me-sm-1 me-0"></i>
|
||||
<span class="align-middle d-sm-inline-block d-none me-sm-1">Volver</span>
|
||||
</button>
|
||||
<button class="btn btn-primary btn-next waves-effect waves-light">
|
||||
<span class="align-middle d-sm-inline-block d-none me-sm-1">Siguiente</span>
|
||||
<i class="ti ti-arrow-right ti-xs"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Diseño Libro -->
|
||||
<div id="disenio-libro" class="content dstepper-block fv-plugins-bootstrap5 fv-plugins-framework">
|
||||
<div class="row g-3">
|
||||
|
||||
<?= view("themes/vuexy/form/presupuestos/cliente/_disenioLibroItems") ?>
|
||||
|
||||
<div class="col-12 d-flex justify-content-between mt-4">
|
||||
<button class="btn btn-primary btn-prev waves-effect waves-light">
|
||||
<i class="ti ti-arrow-left ti-xs me-sm-1 me-0"></i>
|
||||
<span class="align-middle d-sm-inline-block d-none me-sm-1">Anterior</span>
|
||||
</button>
|
||||
<button class="btn btn-primary btn-next waves-effect waves-light">
|
||||
<span class="align-middle d-sm-inline-block d-none me-sm-1">Siguiente</span>
|
||||
<i class="ti ti-arrow-right ti-xs"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Direcciones -->
|
||||
<div id="direcciones-libro" class="content fv-plugins-bootstrap5 fv-plugins-framework">
|
||||
<div class="row g-3">
|
||||
|
||||
<?= view("themes/vuexy/form/presupuestos/cliente/_direccionesItems") ?>
|
||||
|
||||
<div class="col-12 d-flex justify-content-between mt-4">
|
||||
<button class="btn btn-primary btn-prev waves-effect waves-light">
|
||||
<i class="ti ti-arrow-left ti-xs me-sm-1 me-0"></i>
|
||||
<span class="align-middle d-sm-inline-block d-none me-sm-1">Anterior</span>
|
||||
</button>
|
||||
<button id="toReview" class="btn btn-primary btn-next waves-effect waves-light">
|
||||
<span class="align-middle d-sm-inline-block d-none me-sm-1">Siguiente</span>
|
||||
<i class="ti ti-arrow-right ti-xs"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Review & Complete -->
|
||||
<div id="resumen-libro" class="content fv-plugins-bootstrap5 fv-plugins-framework">
|
||||
<div class="row g-3">
|
||||
|
||||
<?= view("themes/vuexy/form/presupuestos/cliente/_resumenItems") ?>
|
||||
|
||||
</div>
|
||||
<div class="col-12 d-flex justify-content-between mt-4">
|
||||
<div class="col-6 d-flex flex-row">
|
||||
<?php if ($presupuestoEntity->estado_id == 1) : ?>
|
||||
<button class="btn btn-primary btn-prev waves-effect waves-light">
|
||||
<i class="ti ti-arrow-left ti-xs me-sm-1 me-0"></i>
|
||||
<span class="align-middle d-sm-inline-block d-none me-sm-1">Anterior</span>
|
||||
</button>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div class="col-6 d-flex flex-row-reverse">
|
||||
<?php if ($presupuestoEntity->estado_id == 1) : ?>
|
||||
<button id="btnSave" class="btn btn-primary btn-submit waves-effect waves-light ml-2">
|
||||
<span class="align-middle d-sm-inline-block d-none me-sm-1">Guardar</span>
|
||||
<i class="ti ti-arrow-right ti-xs"></i>
|
||||
</button>
|
||||
<button id="btnConfirm" class="btn btn-success btn-submit btn-next mx-2 waves-effect waves-light ml-2">
|
||||
<span class="align-middle d-sm-inline-block d-none me-sm-1">Confirmar</span><i class="ti ti-check ti-xs"></i>
|
||||
</button>
|
||||
<?php else: ?>
|
||||
<button id="btnBack" class="btn btn-success btn-submit btn-next mx-2 waves-effect waves-light">
|
||||
<span class="align-middle d-sm-inline-block d-none me-sm-1">Volver</span><i class="ti ti-check ti-xs"></i>
|
||||
</button>
|
||||
<?php endif; ?>
|
||||
<button id="btnDuplicar" class="btn btn-primary btn-submit waves-effect waves-light ml-2">
|
||||
<span class="align-middle d-sm-inline-block d-none me-sm-1">Duplicar</span>
|
||||
<i class="ti ti-copy ti-xs"></i>
|
||||
</button>
|
||||
<?php
|
||||
// Mostrar boton de impresion solo en presupuestos guardados (no add!)
|
||||
if ($formAction == "edit") {
|
||||
echo anchor(
|
||||
route_to("presupuestoToPdf", $presupuestoEntity->id),
|
||||
lang("Basic.global.Print"),
|
||||
[
|
||||
"class" => "btn btn-dark float-start me-sm-3 ml-2",
|
||||
"target" => "_blank"
|
||||
]
|
||||
);
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<div <?= ($state == 2)? 'hidden': '' ?> class="step titulos-menu" data-target="#interior-libro">
|
||||
<button type="button" class="step-trigger" aria-selected="false" disabled="disabled">
|
||||
<span class="bs-stepper-circle"><i class="ti ti-book ti-sm"></i></span>
|
||||
<span class="bs-stepper-label">
|
||||
<span class="bs-stepper-title">Interior</span>
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<?php else: ?>
|
||||
<div <?= ($state == 2)? 'hidden': '' ?> class="step titulos-menu" data-target="#cubierta-libro">
|
||||
<button type="button" class="step-trigger" aria-selected="false" disabled="disabled">
|
||||
<span class="bs-stepper-circle"><i class="ti ti-books ti-sm"></i></span>
|
||||
<span class="bs-stepper-label">
|
||||
<span class="bs-stepper-title">Cubierta</span>
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<form id="presupuesto-cliente-form" onsubmit="return false">
|
||||
<div class="row g-3">
|
||||
<div <?= ($state == 2)? 'hidden': '' ?> class="step titulos-menu" data-target="#direcciones-libro">
|
||||
<button type="button" class="step-trigger" aria-selected="false" disabled="disabled">
|
||||
<span class="bs-stepper-circle"><i class="ti ti-map-pins ti-sm"></i></span>
|
||||
<span class="bs-stepper-label">
|
||||
<span class="bs-stepper-title">Direcciones</span>
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<?= view("themes/vuexy/form/presupuestos/cliente/_resumenItems") ?>
|
||||
<div id="menu_resumen_button" class="step titulos-menu" data-target="#resumen-libro">
|
||||
<button type="button" class="step-trigger" aria-selected="false" disabled="disabled">
|
||||
<span class="bs-stepper-circle"><i class="ti ti-checkbox ti-sm"></i></span>
|
||||
<span class="bs-stepper-label">
|
||||
<span class="bs-stepper-title">Resumen del presupuesto</span>
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="col-12 d-flex justify-content-between mt-4">
|
||||
<div class="col-6 d-flex flex-row">
|
||||
<?php if ($presupuestoEntity->estado_id == 1) : ?>
|
||||
<button class="btn btn-primary btn-prev waves-effect waves-light">
|
||||
<i class="ti ti-arrow-left ti-xs me-sm-1 me-0"></i>
|
||||
<span class="align-middle d-sm-inline-block d-none me-sm-1">Anterior</span>
|
||||
</button>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div class="col-6 d-flex flex-row-reverse">
|
||||
<?php if ($presupuestoEntity->estado_id == 1) : ?>
|
||||
<button id="btnSave" class="btn btn-primary btn-submit waves-effect waves-light ml-2">
|
||||
<span class="align-middle d-sm-inline-block d-none me-sm-1">Guardar</span>
|
||||
<i class="ti ti-arrow-right ti-xs"></i>
|
||||
</button>
|
||||
<button id="btnConfirm" class="btn btn-success btn-submit btn-next mx-2 waves-effect waves-light ml-2">
|
||||
<span class="align-middle d-sm-inline-block d-none me-sm-1">Confirmar</span><i class="ti ti-check ti-xs"></i>
|
||||
</button>
|
||||
<?php else: ?>
|
||||
<button id="btnBack" class="btn btn-success btn-submit btn-next mx-2 waves-effect waves-light">
|
||||
<span class="align-middle d-sm-inline-block d-none me-sm-1">Volver</span><i class="ti ti-check ti-xs"></i>
|
||||
</button>
|
||||
<?php endif; ?>
|
||||
<button id="btnDuplicar" class="btn btn-primary btn-submit waves-effect waves-light ml-2">
|
||||
<span class="align-middle d-sm-inline-block d-none me-sm-1">Duplicar</span>
|
||||
<i class="ti ti-copy ti-xs"></i>
|
||||
</button>
|
||||
<?php
|
||||
// Si esta confirmado siempre es un presupuesto guardado
|
||||
echo anchor(
|
||||
route_to("presupuestoToPdf", $presupuestoEntity->id),
|
||||
lang("Basic.global.Print"),
|
||||
[
|
||||
"class" => "btn btn-dark float-start me-sm-3 ml-2",
|
||||
"target" => "_blank"
|
||||
]
|
||||
);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<div class="line"></div>
|
||||
|
||||
<div id='divTiradasPrecio'></div>
|
||||
|
||||
|
||||
</div> <!--//.bs-stepper-header -->
|
||||
|
||||
<div class="bs-stepper-content" style="position: relative;">
|
||||
|
||||
<?= view("themes/vuexy/form/presupuestos/cliente/loader") ?>
|
||||
|
||||
<form id="presupuesto-cliente-form" onsubmit="return false">
|
||||
|
||||
<div <?= ($state == 2) ? 'hidden' : '' ?> id="datos-generales"
|
||||
class="content active dstepper-block fv-plugins-bootstrap5 fv-plugins-framework">
|
||||
|
||||
<div class="row g-3">
|
||||
<?= view("themes/vuexy/form/presupuestos/cliente/items/_datosGenerales") ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div <?= ($state == 2) ? 'hidden' : '' ?> id="interior-libro"
|
||||
class="content fv-plugins-bootstrap5 fv-plugins-framework">
|
||||
<div class="row g-3">
|
||||
<?= view("themes/vuexy/form/presupuestos/cliente/items/_disenioInterior") ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div <?= ($state == 2) ? 'hidden' : '' ?> id="cubierta-libro"
|
||||
class="content fv-plugins-bootstrap5 fv-plugins-framework">
|
||||
<div class="row g-3">
|
||||
<?= view("themes/vuexy/form/presupuestos/cliente/items/_disenioCubierta") ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div <?= ($state == 2) ? 'hidden' : '' ?> id="direcciones-libro"
|
||||
class="content fv-plugins-bootstrap5 fv-plugins-framework">
|
||||
<div class="row g-3">
|
||||
<?= view("themes/vuexy/form/presupuestos/cliente/items/_direcciones") ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="resumen-libro" class="content fv-plugins-bootstrap5 fv-plugins-framework">
|
||||
<div class="row g-3">
|
||||
<?= view("themes/vuexy/form/presupuestos/cliente/items/_resumen") ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<?= view("themes/vuexy/form/presupuestos/cliente/items/_buttons") ?>
|
||||
|
||||
<?php endif; ?>
|
||||
</form>
|
||||
|
||||
</div><!--//.col -->
|
||||
<?= view("themes/vuexy/components/chat_presupuesto",data:["modelId" => $presupuestoEntity->id]) ?>
|
||||
</div>
|
||||
|
||||
|
||||
</div><!--//.wizard -->
|
||||
|
||||
|
||||
<div id="form_buttons" class="row col-sm-12 justify-content-center" style="display: none;">
|
||||
|
||||
</div>
|
||||
<?php if ($formAction == 'edit'): ?>
|
||||
<?= view("themes/vuexy/components/chat_internal_presupuesto", data: ["modelId" => $presupuestoId, "type" => "presupuesto"]) ?>
|
||||
<?php endif; ?>
|
||||
</div><!--//.row -->
|
||||
<?= view("themes/_commonPartialsBs/_modalConfirmDialog") ?>
|
||||
<?= view("themes/_commonPartialsBs/_modalMessageDialog") ?>
|
||||
@ -262,81 +147,28 @@
|
||||
|
||||
|
||||
|
||||
|
||||
<?= $this->section("additionalInlineJs") ?>
|
||||
|
||||
window.datosPresupuesto = <?= json_encode($datosPresupuesto) ?>;
|
||||
window.token_ajax= {<?= csrf_token() ?? "token" ?>: <?= csrf_token() ?>v};
|
||||
|
||||
<?php if ($presupuestoEntity->estado_id == 1) : ?>
|
||||
$('#clienteId').select2({
|
||||
allowClear: false,
|
||||
ajax: {
|
||||
url: '<?= route_to("menuItemsOfClientes") ?>',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
|
||||
data: function(params) {
|
||||
return {
|
||||
id: 'id',
|
||||
text: 'nombre',
|
||||
searchTerm: params.term,
|
||||
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
|
||||
};
|
||||
},
|
||||
delay: 60,
|
||||
processResults: function(response) {
|
||||
yeniden(response.<?= csrf_token() ?>);
|
||||
return {
|
||||
results: response.menu
|
||||
};
|
||||
},
|
||||
cache: true
|
||||
}
|
||||
});
|
||||
|
||||
initDisenioLibro();
|
||||
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
|
||||
<?= $this->section('css') ?>
|
||||
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/libs/bs-stepper/bs-stepper.css') ?>" />
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/libs/formvalidation/dist/css/formValidation.min.css') ?>" />
|
||||
<link rel="stylesheet"
|
||||
href="<?= site_url('themes/vuexy/vendor/libs/formvalidation/dist/css/formValidation.min.css') ?>" />
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/libs/dropzone/dropzone.css') ?>" />
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/css/pages/app-chat.css') ?>">
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/css/presupuestoCliente.css') ?>">
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
<?= $this->section('additionalExternalJs') ?>
|
||||
<script src="<?= site_url("themes/vuexy/vendor/libs/dropzone/dropzone.js") ?>"></script>
|
||||
<script src="<?= site_url("themes/vuexy/vendor/libs/bs-stepper/bs-stepper.js") ?>"></script>
|
||||
<script src="<?= site_url("themes/vuexy/vendor/libs/formvalidation/dist/js/FormValidation.min.js") ?>"></script>
|
||||
<script src="<?= site_url("themes/vuexy/vendor/libs/formvalidation/dist/js/FormValidation.js") ?>"></script>
|
||||
<script src="<?= site_url("themes/vuexy/vendor/libs/formvalidation/dist/js/plugins/Bootstrap5.min.js") ?>"></script>
|
||||
<script src="<?= site_url("themes/vuexy/vendor/libs/formvalidation/dist/js/plugins/AutoFocus.min.js") ?>"></script>
|
||||
<script src="<?= site_url("themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/dataTables.buttons.min.js") ?>"></script>
|
||||
<script src="<?= site_url("themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.bootstrap5.min.js") ?>"></script>
|
||||
<script src="<?= site_url("themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.html5.min.js") ?>"></script>
|
||||
<script src="<?= site_url("themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.print.min.js") ?>"></script>
|
||||
<script src="<?= site_url("themes/vuexy/vendor/libs/datatables-sk/plugins/select/dataTables.select.min.js") ?>"></script>
|
||||
<script src="<?= site_url('themes/vuexy/js/datatables-editor/dataTables.editor.min.js') ?>"></script>
|
||||
<script src="<?= site_url('themes/vuexy/vendor/libs/autosize/autosize.js') ?>"></script>
|
||||
<script src="<?= site_url('themes/vuexy/vendor/libs/two/two.js') ?>"></script>
|
||||
<script src="<?= site_url('js_loader/translate_js/Presupuestos') ?>"></script>
|
||||
<script src="<?= site_url('js_loader/presupuestoClienteResumen_js') ?>"></script>
|
||||
<script src="<?= site_url('themes/vuexy/vendor/libs/perfect-scrollbar/perfect-scrollbar.js') ?>"></script>
|
||||
|
||||
<?php if ($presupuestoEntity->estado_id == 1) : ?>
|
||||
<script src="<?= site_url('js_loader/presupuestoCliente_js') ?>"></script>
|
||||
<?php endif; ?>
|
||||
<script src="<?= site_url('js_loader/presupuestoClienteTipoLibro_js') ?>"></script>
|
||||
<script src="<?= site_url('js_loader/presupuestoClienteDisenioLibro_js') ?>"></script>
|
||||
<script src="<?= site_url('js_loader/presupuestoClienteDirecciones_js') ?>"></script>
|
||||
<script src="<?= site_url('js_loader/presupuestoClientePreview_js') ?>"></script>
|
||||
<script type="module"
|
||||
src="<?= site_url('assets/js/safekat/pages/presupuestoCliente/presupuestoCliente.js') ?>"></script>
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
@ -121,11 +121,11 @@ function calcular_mermas(){
|
||||
|
||||
|
||||
$('#papelFormatoPersonalizado').on("click",function(){
|
||||
var checkbox = document.getElementById('papelFormatoPersonalizado');
|
||||
if(checkbox.checked == true){
|
||||
|
||||
if($('#papelFormatoPersonalizado').is(':checked')){
|
||||
document.getElementById("papelFormatoAncho").style.display = "block";
|
||||
document.getElementById("papelFormatoAlto").style.display = "block";
|
||||
$('#papelFormatoId').next(".select2-container").hide();
|
||||
$('#papelFormatoId').hide();
|
||||
$('#papelFormatoId').val(0).change();
|
||||
document.getElementById("label_papelFormatoId").innerHTML =
|
||||
window.Presupuestos.papelFormatoId + " (" +
|
||||
@ -136,7 +136,7 @@ $('#papelFormatoPersonalizado').on("click",function(){
|
||||
document.getElementById("papelFormatoAlto").value= "";
|
||||
document.getElementById("papelFormatoAncho").style.display = "none";
|
||||
document.getElementById("papelFormatoAlto").style.display = "none";
|
||||
$('#papelFormatoId').next(".select2-container").show();
|
||||
$('#papelFormatoId').show();
|
||||
document.getElementById("label_papelFormatoId").innerHTML =
|
||||
window.Presupuestos.papelFormatoId + '*';
|
||||
}
|
||||
|
||||
@ -42,7 +42,7 @@
|
||||
<?= lang('Presupuestos.papelFormatoId') ?>*
|
||||
</label>
|
||||
|
||||
<select id="papelFormatoId" name="papel_formato_id" tabindex="3" class="form-control select2bs2" style="width: 100%;">
|
||||
<select id="papelFormatoId" <?= $presupuestoEntity->papel_formato_personalizado == false ? '' : 'style="display: none"'; ?> name="papel_formato_id" tabindex="3" class="form-control select2bs2" style="width: 100%;">
|
||||
|
||||
<?php if (isset($papelFormatoList) && is_array($papelFormatoList) && !empty($papelFormatoList)) :
|
||||
foreach ($papelFormatoList as $formato) : ?>
|
||||
|
||||
@ -305,7 +305,7 @@
|
||||
<label for="compPosPaginasColor" class="form-label">
|
||||
<?= lang('Presupuestos.posicionPagColor') ?>
|
||||
</label>
|
||||
<input type="text" id="compPosPaginasColor" name="comp_pos_paginas_color" maxLength="20" class="form-control" value="<?= isset($presupuestoEntity->comp_pos_paginas_color) ? (old('', $presupuestoEntity->comp_pos_paginas_color)) : '' ?>">
|
||||
<input type="text" id="compPosPaginasColor" name="pos_paginas_color" maxLength="20" class="form-control" value="<?= isset($presupuestoEntity->pos_paginas_color) ? (old('', $presupuestoEntity->pos_paginas_color)) : '' ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
</div><!--//.col -->
|
||||
<div class="col-md-12 col-lg-8 px-4">
|
||||
|
||||
@ -5,15 +5,26 @@
|
||||
<?= lang('Tarifaacabado.nombre') ?>*
|
||||
</label>
|
||||
<input type="text" id="nombre" name="nombre" maxLength="255" class="form-control"
|
||||
value="<?= old('nombre', $tarifaacabadoEntity->nombre) ?>">
|
||||
value="<?= old('nombre', $tarifaacabadoEntity->nombre) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
<div class="mb-3">
|
||||
<label for="code" class="form-label">
|
||||
<?= lang('Tarifaacabado.code') ?>
|
||||
</label>
|
||||
<input
|
||||
type="text"
|
||||
id="code"
|
||||
name="code"
|
||||
maxLength="5"
|
||||
class="form-control"
|
||||
value="<?= old('code', $tarifaacabadoEntity->code) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="nombre" class="form-label">
|
||||
<?= lang('Tarifaacabado.precioMin') ?>*
|
||||
</label>
|
||||
<input type="text" id="precio_min" name="precio_min" class="form-control"
|
||||
value="<?= old('precio_min', $tarifaacabadoEntity->precio_min) ?>">
|
||||
value="<?= old('precio_min', $tarifaacabadoEntity->precio_min) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
@ -21,9 +32,21 @@
|
||||
<?= lang('Tarifaacabado.importeFijo') ?>*
|
||||
</label>
|
||||
<input type="text" id="importe_fijo" name="importe_fijo" class="form-control"
|
||||
value="<?= old('importe_fijo', $tarifaacabadoEntity->importe_fijo) ?>">
|
||||
value="<?= old('importe_fijo', $tarifaacabadoEntity->importe_fijo) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="comment" class="form-label">
|
||||
<?= lang('Tarifaacabado.comment') ?>
|
||||
</label>
|
||||
<textarea
|
||||
id="comment"
|
||||
name="comment"
|
||||
rows="5"
|
||||
cols="10"
|
||||
placeholder="<?= lang('Tarifaacabado.comment_placeholder') ?>"
|
||||
class="form-control"><?= old('comment', $tarifaacabadoEntity->comment) ?></textarea>
|
||||
</div><!--//.mb-3 -->
|
||||
<div class="mb-3">
|
||||
<div class="form-check">
|
||||
<label for="mostrar_en_presupuesto" class="form-check-label">
|
||||
@ -32,7 +55,6 @@
|
||||
</label>
|
||||
</div><!--//.form-check -->
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<div class="form-check">
|
||||
<label for="acabado_cubierta" class="form-check-label">
|
||||
|
||||
@ -17,6 +17,7 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= lang('Tarifaacabado.nombre') ?></th>
|
||||
<th><?= lang('Tarifaacabado.code') ?></th>
|
||||
<th><?= lang('Tarifaacabado.precioMin') ?></th>
|
||||
<th><?= lang('Tarifaacabado.importeFijo') ?></th>
|
||||
<th><?= lang('Tarifaacabado.mostrar_en_presupuesto') ?></th>
|
||||
@ -90,6 +91,7 @@
|
||||
],
|
||||
columns : [
|
||||
{ 'data': 'nombre' },
|
||||
{ 'data': 'code' },
|
||||
{ 'data': 'precio_min' },
|
||||
{ 'data': 'importe_fijo' },
|
||||
{ 'data': 'mostrar_en_presupuesto' },
|
||||
|
||||
@ -7,13 +7,37 @@
|
||||
</label>
|
||||
<input type="text" id="nombre" name="nombre" maxLength="255" class="form-control" value="<?=old('nombre', $tarifaEncuadernacionEntity->nombre) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="code" class="form-label">
|
||||
<?= lang('Tarifaencuadernacion.code') ?>
|
||||
</label>
|
||||
<input
|
||||
type="text"
|
||||
id="code"
|
||||
name="code"
|
||||
maxLength="5"
|
||||
class="form-control"
|
||||
value="<?= old('code', $tarifaEncuadernacionEntity->code) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
<div class="mb-3">
|
||||
<label for="comment" class="form-label">
|
||||
<?= lang('Tarifaencuadernacion.comment') ?>
|
||||
</label>
|
||||
<textarea
|
||||
id="comment"
|
||||
name="comment"
|
||||
rows="5"
|
||||
cols="10"
|
||||
placeholder="<?= lang('Tarifaencuadernacion.comment_placeholder') ?>"
|
||||
class="form-control"><?= old('comment', $tarifaEncuadernacionEntity->comment) ?></textarea>
|
||||
</div><!--//.mb-3 -->
|
||||
</div><!--//.col -->
|
||||
</div><!-- //.row -->
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-12 col-lg-4 px-4">
|
||||
|
||||
<div class="mb-3">
|
||||
<div class="form-check">
|
||||
<label for="mostrar_en_presupuesto" class="form-check-label">
|
||||
|
||||
@ -49,7 +49,6 @@
|
||||
<th><?= lang('TarifaEncuadernacionTiradas.proveedor') ?></th>
|
||||
<th><?= lang('TarifaEncuadernacionTiradas.tiradaMin') ?></th>
|
||||
<th><?= lang('TarifaEncuadernacionTiradas.tiradaMax') ?></th>
|
||||
<th><?= lang('Tarifaencuadernacion.importeMin') ?></th>
|
||||
<th><?= lang('Tarifaencuadernacion.importeFijo') ?></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
@ -83,6 +82,7 @@
|
||||
<th><?= lang('TarifaEncuadernacionLineas.precioMin') ?></th>
|
||||
<th><?= lang('TarifaEncuadernacionLineas.paginasMax') ?></th>
|
||||
<th><?= lang('TarifaEncuadernacionLineas.precioMax') ?></th>
|
||||
<th><?= lang('Tarifaencuadernacion.importeMin') ?></th>
|
||||
<th><?= lang('TarifaEncuadernacionLineas.margen') ?></th>
|
||||
<th style="min-width:100px"></th>
|
||||
</tr>
|
||||
@ -112,6 +112,7 @@
|
||||
<th><?= lang('TarifaEncuadernacionLineas.tiempoMin') ?></th>
|
||||
<th><?= lang('TarifaEncuadernacionLineas.tiempoMax') ?></th>
|
||||
<th><?= lang('TarifaEncuadernacionLineas.precioHora') ?></th>
|
||||
<th><?= lang('Tarifaencuadernacion.importeMin') ?></th>
|
||||
<th><?= lang('TarifaEncuadernacionLineas.margen') ?></th>
|
||||
<th style="min-width:100px"></th>
|
||||
</tr>
|
||||
@ -298,6 +299,8 @@
|
||||
name: "tiempo_max"
|
||||
}, {
|
||||
name: "precio_hora"
|
||||
}, {
|
||||
name: "total_min"
|
||||
}, {
|
||||
name: "margen"
|
||||
}, {
|
||||
@ -366,6 +369,7 @@
|
||||
{ 'data': 'tiempo_min' },
|
||||
{ 'data': 'tiempo_max' },
|
||||
{ 'data': 'precio_hora' },
|
||||
{ 'data': 'total_min' },
|
||||
{ 'data': 'margen' },
|
||||
{
|
||||
data: actionBtns,
|
||||
@ -477,6 +481,8 @@
|
||||
name: "paginas_libro_max"
|
||||
}, {
|
||||
name: "precio_max"
|
||||
}, {
|
||||
name: "total_min"
|
||||
}, {
|
||||
name: "margen"
|
||||
}, {
|
||||
@ -556,6 +562,7 @@
|
||||
{ 'data': 'precio_max' },
|
||||
{ 'data': 'paginas_libro_max' },
|
||||
{ 'data': 'precio_min' },
|
||||
{ 'data': 'total_min' },
|
||||
{ 'data': 'margen' },
|
||||
{
|
||||
data: actionBtns,
|
||||
@ -661,8 +668,6 @@
|
||||
name: "tirada_min"
|
||||
}, {
|
||||
name: "tirada_max"
|
||||
}, {
|
||||
name: "precio_min"
|
||||
}, {
|
||||
name: "importe_fijo"
|
||||
}, {
|
||||
@ -746,7 +751,6 @@
|
||||
},
|
||||
{ 'data': 'tirada_min' },
|
||||
{ 'data': 'tirada_max' },
|
||||
{ 'data': 'precio_min' },
|
||||
{ 'data': 'importe_fijo' },
|
||||
{
|
||||
data: actionBtns,
|
||||
|
||||
@ -17,6 +17,7 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= lang('Tarifaencuadernacion.nombre') ?></th>
|
||||
<th><?= lang('Tarifaencuadernacion.code') ?></th>
|
||||
<th><?= lang('Tarifaencuadernacion.mostrar_en_presupuesto') ?></th>
|
||||
<th><?= lang('Tarifaencuadernacion.tipo_encuadernacion') ?></th>
|
||||
<th><?= lang('Tarifaencuadernacion.servicio_encuadernacion') ?></th>
|
||||
@ -88,6 +89,7 @@
|
||||
],
|
||||
columns : [
|
||||
{ 'data': 'nombre' },
|
||||
{ 'data': 'code' },
|
||||
{ 'data': 'mostrar_en_presupuesto' },
|
||||
{ 'data': 'tipo_encuadernacion' },
|
||||
{ 'data': 'servicio_encuadernacion' },
|
||||
@ -96,7 +98,7 @@
|
||||
});
|
||||
|
||||
theTable.on( 'draw.dt', function () {
|
||||
const boolCols = [1,2,3];
|
||||
const boolCols = [1,2,3, 4];
|
||||
for (let coln of boolCols) {
|
||||
theTable.column(coln, { page: 'current' }).nodes().each( function (cell, i) {
|
||||
cell.innerHTML = cell.innerHTML == '1' ? '<i class="ti ti-check"></i>' : '';
|
||||
|
||||
@ -1,28 +1,51 @@
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-lg-12 px-4">
|
||||
|
||||
<div class="col-md-12 col-lg-12 px-4">
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="nombre" class="form-label">
|
||||
<?= lang('TarifasEnvios.nombre') ?>*
|
||||
</label>
|
||||
<input type="text" id="nombre" name="nombre" required maxLength="255" class="form-control" value="<?= old('nombre', $tarifaEnvioEntity->nombre) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
<div class="mb-3">
|
||||
<label for="code" class="form-label">
|
||||
<?= lang('TarifasEnvios.code') ?>
|
||||
</label>
|
||||
<input
|
||||
type="text"
|
||||
id="code"
|
||||
name="code"
|
||||
maxLength="5"
|
||||
class="form-control"
|
||||
value="<?= old('code', $tarifaEnvioEntity->code) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
<div class="mb-3">
|
||||
<label for="paisId" class="form-label">
|
||||
<?= lang('TarifasEnvios.paisId') ?>*
|
||||
</label>
|
||||
<select id="paisId" name="pais_id" class="form-control select2bs" style="width: 100%;">
|
||||
<option value=""><?= lang('Basic.global.pleaseSelectA', [lang('TarifasEnvios.paisId')]) ?></option>
|
||||
|
||||
<?php foreach ($paisList as $item) : ?>
|
||||
<option value="<?= $item->id ?>" <?= $item->id == $tarifaEnvioEntity->pais_id ? ' selected' : '' ?>>
|
||||
<?= $item->nombre ?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div><!--//.mb-3 -->
|
||||
<div class="mb-3">
|
||||
<label for="nombre" class="form-label">
|
||||
<?=lang('TarifasEnvios.nombre') ?>*
|
||||
</label>
|
||||
<input type="text" id="nombre" name="nombre" required maxLength="255" class="form-control" value="<?=old('nombre', $tarifaEnvioEntity->nombre) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
<label for="comment" class="form-label">
|
||||
<?= lang('TarifasEnvios.comment') ?>
|
||||
</label>
|
||||
<textarea
|
||||
id="comment"
|
||||
name="comment"
|
||||
rows="5"
|
||||
cols="10"
|
||||
placeholder="<?= lang('TarifasEnvios.comment_placeholder') ?>"
|
||||
class="form-control"><?= old('comment', $tarifaEnvioEntity->comment) ?></textarea>
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="paisId" class="form-label">
|
||||
<?=lang('TarifasEnvios.paisId') ?>*
|
||||
</label>
|
||||
<select id="paisId" name="pais_id" class="form-control select2bs" style="width: 100%;" >
|
||||
<option value=""><?=lang('Basic.global.pleaseSelectA', [lang('TarifasEnvios.paisId')]) ?></option>
|
||||
|
||||
<?php foreach ($paisList as $item) : ?>
|
||||
<option value="<?=$item->id ?>"<?=$item->id==$tarifaEnvioEntity->pais_id ? ' selected':'' ?>>
|
||||
<?=$item->nombre ?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
</div><!--//.col -->
|
||||
</div><!--//.col -->
|
||||
|
||||
</div><!-- //.row -->
|
||||
@ -176,7 +176,8 @@
|
||||
idSrc: 'id',
|
||||
fields: [ {
|
||||
name: "nombre"
|
||||
}, {
|
||||
},
|
||||
{
|
||||
name: "cp_inicial"
|
||||
}, {
|
||||
name: "cp_final"
|
||||
|
||||
@ -18,6 +18,7 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= lang('TarifasEnvios.nombre') ?></th>
|
||||
<th><?= lang('TarifasEnvios.code') ?></th>
|
||||
<th><?= lang('Paises.pais') ?></th>
|
||||
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
||||
</tr>
|
||||
@ -87,6 +88,7 @@
|
||||
],
|
||||
columns : [
|
||||
{ 'data': 'nombre' },
|
||||
{ 'data': 'code' },
|
||||
{ 'data': 'pais_id' },
|
||||
{ 'data': actionBtns }
|
||||
]
|
||||
|
||||
@ -14,7 +14,18 @@
|
||||
value="<?= old('nombre', $tarifaextraEntity->nombre) ?>"
|
||||
>
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="code" class="form-label">
|
||||
<?= lang('Tarifaextra.code') ?>
|
||||
</label>
|
||||
<input
|
||||
type="text"
|
||||
id="code"
|
||||
name="code"
|
||||
maxLength="5"
|
||||
class="form-control"
|
||||
value="<?= old('code', $tarifaextraEntity->code) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
<div class="mb-3">
|
||||
<label for="precio" class="form-label">
|
||||
<?= lang('Tarifaextra.precio') ?>*
|
||||
@ -45,7 +56,18 @@
|
||||
>
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="comment" class="form-label">
|
||||
<?= lang('Tarifaextra.comment') ?>
|
||||
</label>
|
||||
<textarea
|
||||
id="comment"
|
||||
name="comment"
|
||||
rows="5"
|
||||
cols="10"
|
||||
placeholder="<?= lang('Tarifaextra.comment_placeholder') ?>"
|
||||
class="form-control"><?= old('comment', $tarifaextraEntity->comment) ?></textarea>
|
||||
</div><!--//.mb-3 -->
|
||||
<div class="mb-3">
|
||||
<div class="form-check form-check-inline">
|
||||
<input type="checkbox"
|
||||
|
||||
@ -16,6 +16,7 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= lang('Tarifaextra.nombre') ?></th>
|
||||
<th><?= lang('Tarifaextra.code') ?></th>
|
||||
<th><?= lang('Tarifaextra.precio') ?></th>
|
||||
<th><?= lang('Tarifaextra.margen') ?></th>
|
||||
<th><?= lang('Tarifaextra.mostrar_en_presupuesto') ?></th>
|
||||
@ -28,6 +29,9 @@
|
||||
<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->code) ?>
|
||||
</td>
|
||||
<td class="align-middle">
|
||||
<?= esc($item->precio) ?>
|
||||
</td>
|
||||
|
||||
@ -1,35 +1,57 @@
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-lg-12 px-4">
|
||||
<div class="mb-3">
|
||||
<label for="nombre" class="form-label">
|
||||
<?=lang('Tarifamanipulado.nombre') ?>*
|
||||
</label>
|
||||
<input type="text" id="nombre" name="nombre" maxLength="255" class="form-control" value="<?=old('nombre', $tarifaManipuladoEntity->nombre) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="nombre" class="form-label">
|
||||
<?=lang('Tarifamanipulado.importeMinimo') ?>*
|
||||
<?= lang('Tarifamanipulado.nombre') ?>*
|
||||
</label>
|
||||
<input type="text" id="precio_min" name="precio_min" class="form-control" value="<?=old('precio_min', $tarifaManipuladoEntity->precio_min) ?>">
|
||||
<input type="text" id="nombre" name="nombre" maxLength="255" class="form-control" value="<?= old('nombre', $tarifaManipuladoEntity->nombre) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
<div class="mb-3">
|
||||
<label for="code" class="form-label">
|
||||
<?= lang('Tarifamanipulado.code') ?>
|
||||
</label>
|
||||
<input
|
||||
type="text"
|
||||
id="code"
|
||||
name="code"
|
||||
maxLength="5"
|
||||
class="form-control"
|
||||
value="<?= old('code', $tarifaManipuladoEntity->code) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
<div class="mb-3">
|
||||
<label for="nombre" class="form-label">
|
||||
<?= lang('Tarifamanipulado.importeMinimo') ?>*
|
||||
</label>
|
||||
<input type="text" id="precio_min" name="precio_min" class="form-control" value="<?= old('precio_min', $tarifaManipuladoEntity->precio_min) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="nombre" class="form-label">
|
||||
<?=lang('Tarifamanipulado.importeFijo') ?>*
|
||||
<?= lang('Tarifamanipulado.importeFijo') ?>*
|
||||
</label>
|
||||
<input type="text" id="importe_fijo" name="importe_fijo" class="form-control" value="<?=old('importe_fijo', $tarifaManipuladoEntity->importe_fijo) ?>">
|
||||
<input type="text" id="importe_fijo" name="importe_fijo" class="form-control" value="<?= old('importe_fijo', $tarifaManipuladoEntity->importe_fijo) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<div class="form-check">
|
||||
<label for="comment" class="form-label">
|
||||
<?= lang('Tarifamanipulado.comment') ?>
|
||||
</label>
|
||||
<textarea
|
||||
id="comment"
|
||||
name="comment"
|
||||
rows="5"
|
||||
cols="10"
|
||||
placeholder="<?= lang('Tarifamanipulado.comment_placeholder') ?>"
|
||||
class="form-control"><?= old('comment', $tarifaManipuladoEntity->comment) ?></textarea>
|
||||
</div><!--//.mb-3 -->
|
||||
<div class="mb-3">
|
||||
<div class="form-check">
|
||||
|
||||
<label for="mostrar_en_presupuesto" class="form-check-label">
|
||||
<input type="checkbox" id="mostrar_en_presupuesto" name="mostrar_en_presupuesto" value="1" class="form-check-input" <?= $tarifaManipuladoEntity->mostrar_en_presupuesto == true ? 'checked' : ''; ?>>
|
||||
<?= lang('Tarifamanipulado.mostrar_en_presupuesto') ?>
|
||||
</label>
|
||||
</div><!--//.form-check -->
|
||||
</div><!--//.mb-3 -->
|
||||
<label for="mostrar_en_presupuesto" class="form-check-label">
|
||||
<input type="checkbox" id="mostrar_en_presupuesto" name="mostrar_en_presupuesto" value="1" class="form-check-input" <?= $tarifaManipuladoEntity->mostrar_en_presupuesto == true ? 'checked' : ''; ?>>
|
||||
<?= lang('Tarifamanipulado.mostrar_en_presupuesto') ?>
|
||||
</label>
|
||||
</div><!--//.form-check -->
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
</div><!--//.col -->
|
||||
|
||||
|
||||
@ -17,6 +17,7 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= lang('Tarifamanipulado.nombre') ?></th>
|
||||
<th><?= lang('Tarifamanipulado.code') ?></th>
|
||||
<th><?= lang('Tarifamanipulado.importeMinimo') ?></th>
|
||||
<th><?= lang('Tarifamanipulado.importeFijo') ?></th>
|
||||
<th><?= lang('Tarifamanipulado.mostrar_en_presupuesto') ?></th>
|
||||
@ -87,6 +88,7 @@
|
||||
],
|
||||
columns : [
|
||||
{ 'data': 'nombre' },
|
||||
{ 'data': 'code' },
|
||||
{ 'data': 'precio_min' },
|
||||
{ 'data': 'importe_fijo' },
|
||||
{ 'data': 'mostrar_en_presupuesto' },
|
||||
|
||||
@ -5,62 +5,82 @@
|
||||
<?= lang('Tarifapreimpresion.nombre') ?>*
|
||||
</label>
|
||||
<input
|
||||
type="text"
|
||||
id="nombre"
|
||||
name="nombre"
|
||||
required
|
||||
maxLength="255"
|
||||
class="form-control"
|
||||
value="<?= old('nombre', $tarifapreimpresionEntity->nombre) ?>"
|
||||
>
|
||||
type="text"
|
||||
id="nombre"
|
||||
name="nombre"
|
||||
required
|
||||
maxLength="255"
|
||||
class="form-control"
|
||||
value="<?= old('nombre', $tarifapreimpresionEntity->nombre) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
<div class="mb-3">
|
||||
<label for="code" class="form-label">
|
||||
<?= lang('Tarifapreimpresion.code') ?>
|
||||
</label>
|
||||
<input
|
||||
type="text"
|
||||
id="code"
|
||||
name="code"
|
||||
maxLength="5"
|
||||
class="form-control"
|
||||
value="<?= old('code', $tarifapreimpresionEntity->code) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="precio" class="form-label">
|
||||
<?= lang('Tarifapreimpresion.precio') ?>*
|
||||
</label>
|
||||
<input
|
||||
type="number"
|
||||
id="precio"
|
||||
name="precio"
|
||||
required
|
||||
maxLength="31"
|
||||
step="0.01"
|
||||
class="form-control"
|
||||
value="<?= old('precio', $tarifapreimpresionEntity->precio) ?>"
|
||||
>
|
||||
type="number"
|
||||
id="precio"
|
||||
name="precio"
|
||||
required
|
||||
maxLength="31"
|
||||
step="0.01"
|
||||
class="form-control"
|
||||
value="<?= old('precio', $tarifapreimpresionEntity->precio) ?>">
|
||||
</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) ?>"
|
||||
>
|
||||
type="text"
|
||||
id="margen"
|
||||
name="margen"
|
||||
required
|
||||
class="form-control"
|
||||
value="<?= old('margen', $tarifapreimpresionEntity->margen) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="comment" class="form-label">
|
||||
<?= lang('Tarifapreimpresion.comment') ?>
|
||||
</label>
|
||||
<textarea
|
||||
id="comment"
|
||||
name="comment"
|
||||
rows="5"
|
||||
cols="10"
|
||||
placeholder="<?= lang('Tarifapreimpresion.comment_placeholder') ?>"
|
||||
class="form-control"><?= old('comment', $tarifapreimpresionEntity->comment) ?></textarea>
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<div class="form-check form-check-inline">
|
||||
<input type="checkbox"
|
||||
id="mostrar_en_presupuesto"
|
||||
name="mostrar_en_presupuesto"
|
||||
value="1"
|
||||
class="form-check-input"<?= $tarifapreimpresionEntity->mostrar_en_presupuesto == true ? 'checked' : ''; ?>
|
||||
>
|
||||
class="form-check-input" <?= $tarifapreimpresionEntity->mostrar_en_presupuesto == true ? 'checked' : ''; ?>>
|
||||
<label for="mostrar_en_presupuesto" class="form-check-label">
|
||||
<?= lang('Tarifapreimpresion.mostrar_en_presupuesto') ?>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div><!--//.col -->
|
||||
|
||||
</div><!-- //.row -->
|
||||
@ -16,6 +16,7 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= lang('Tarifapreimpresion.nombre') ?></th>
|
||||
<th><?= lang('Tarifapreimpresion.code') ?></th>
|
||||
<th><?= lang('Tarifapreimpresion.precio') ?></th>
|
||||
<th><?= lang('Tarifapreimpresion.margen') ?></th>
|
||||
<th><?= lang('Tarifapreimpresion.mostrar_en_presupuesto') ?></th>
|
||||
@ -28,6 +29,9 @@
|
||||
<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->code) ?>
|
||||
</td>
|
||||
<td class="align-middle">
|
||||
<?= esc($item->precio) ?>
|
||||
</td>
|
||||
|
||||
@ -20,6 +20,8 @@ $picture = "/assets/img/default-user.png";
|
||||
name="viewport"
|
||||
content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0" />
|
||||
|
||||
<meta name="locale" content="<?= $session->get("lang") ?>">
|
||||
|
||||
<title><?= config('Safekat')->appName ?></title>
|
||||
|
||||
<meta name="description" content="" />
|
||||
@ -122,7 +124,7 @@ $picture = "/assets/img/default-user.png";
|
||||
<div class="dropdown-menu dropdown-menu-end py-0">
|
||||
<div class="dropdown-menu-header border-bottom">
|
||||
<div class="dropdown-header d-flex align-items-center py-3">
|
||||
<h5 class="text-body mb-0 me-auto">Chats</h5>
|
||||
<h5 class="text-body mb-0 me-auto"><?= lang("Chat.messages") ?></h5>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@ -14,97 +14,104 @@ if (
|
||||
auth()->user()->can('roles-permisos.menu')
|
||||
) {
|
||||
?>
|
||||
<li class="menu-item">
|
||||
<a href="javascript:void(0);" class="menu-link menu-toggle">
|
||||
<i class="menu-icon tf-icons ti ti-adjustments-horizontal"></i>
|
||||
<?= lang("App.menu_configuration") ?>
|
||||
</a>
|
||||
<ul class="menu-sub">
|
||||
<li class="menu-item">
|
||||
<a href="javascript:void(0);" class="menu-link menu-toggle">
|
||||
<i class="menu-icon tf-icons ti ti-adjustments-horizontal"></i>
|
||||
<?= lang("App.menu_configuration") ?>
|
||||
</a>
|
||||
<ul class="menu-sub">
|
||||
|
||||
<?php if (auth()->user()->can('paises.menu')) { ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= route_to('paisList') ?>" class="menu-link">
|
||||
<?= lang("App.menu_paises") ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
<?php if (auth()->user()->can('formas-pago.menu')) { ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= route_to('formasPagoList') ?>" class="menu-link">
|
||||
<?= lang("App.menu_formas_pago") ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
<?php if (auth()->user()->can('papel-generico.menu')) { ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("configuracion/papelesgenericos") ?>" class="menu-link">
|
||||
<?= lang("App.menu_papelgenerico") ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
<?php if (auth()->user()->can('papel-impresion.menu')) { ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("configuracion/papelesimpresion") ?>" class="menu-link">
|
||||
<?= lang("App.menu_papelimpresion") ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
<?php if (auth()->user()->can('maquinas.menu')) { ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("configuracion/maquinas") ?>" class="menu-link">
|
||||
<?= lang("App.menu_maquina") ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
<?php if (auth()->user()->can('maquinas-defecto.menu')) { ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("configuracion/maquinasdefecto") ?>" class="menu-link">
|
||||
<?= lang("App.menu_maquina_defecto") ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
<?php if (auth()->user()->can('usuarios.menu')) { ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("configuracion/users") ?>" class="menu-link">
|
||||
<?= lang("App.menu_users") ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
<?php if (auth()->user()->can('roles-permisos.menu')) { ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("configuracion/group") ?>" class="menu-link">
|
||||
<?= lang("App.menu_permission_group") ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
<?php if (auth()->user()->can('proveedores.menu')) { ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= route_to("proveedorList") ?>" class="menu-link">
|
||||
<?= lang("App.menu_proveedores") ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
<?php if (auth()->user()->can('ubicaciones.menu')) { ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= route_to("ubicacionesList") ?>" class="menu-link">
|
||||
<?= lang("App.menu_ubicaciones") ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
<?php if (auth()->user()->can('series-facturas.menu')) { ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= route_to("seriesFacturasList") ?>" class="menu-link">
|
||||
<?= lang("App.menu_series_facturas") ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
<?php if (auth()->user()->inGroup('admin') || auth()->user()->inGroup('beta')) { ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= route_to('variablesIndex') ?>" class="menu-link">
|
||||
<?= lang("App.menu_variables") ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php if (auth()->user()->can('paises.menu')) { ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= route_to('paisList') ?>" class="menu-link">
|
||||
<?= lang("App.menu_paises") ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
<?php if (auth()->user()->can('formas-pago.menu')) { ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= route_to('formasPagoList') ?>" class="menu-link">
|
||||
<?= lang("App.menu_formas_pago") ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
<?php if (auth()->user()->can('papel-generico.menu')) { ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("configuracion/papelesgenericos") ?>" class="menu-link">
|
||||
<?= lang("App.menu_papelgenerico") ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
<?php if (auth()->user()->can('papel-impresion.menu')) { ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("configuracion/papelesimpresion") ?>" class="menu-link">
|
||||
<?= lang("App.menu_papelimpresion") ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
<?php if (auth()->user()->can('maquinas.menu')) { ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("configuracion/maquinas") ?>" class="menu-link">
|
||||
<?= lang("App.menu_maquina") ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
<?php if (auth()->user()->can('maquinas-defecto.menu')) { ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("configuracion/maquinasdefecto") ?>" class="menu-link">
|
||||
<?= lang("App.menu_maquina_defecto") ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
<?php if (auth()->user()->can('usuarios.menu')) { ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("configuracion/users") ?>" class="menu-link">
|
||||
<?= lang("App.menu_users") ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
<?php if (auth()->user()->can('roles-permisos.menu')) { ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("configuracion/group") ?>" class="menu-link">
|
||||
<?= lang("App.menu_permission_group") ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
<?php if (auth()->user()->can('proveedores.menu')) { ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= route_to("proveedorList") ?>" class="menu-link">
|
||||
<?= lang("App.menu_proveedores") ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
<?php if (auth()->user()->can('ubicaciones.menu')) { ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= route_to("ubicacionesList") ?>" class="menu-link">
|
||||
<?= lang("App.menu_ubicaciones") ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
<?php if (auth()->user()->can('series-facturas.menu')) { ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= route_to("seriesFacturasList") ?>" class="menu-link">
|
||||
<?= lang("App.menu_series_facturas") ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
<?php if (auth()->user()->inGroup('admin') || auth()->user()->inGroup('beta')) { ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= route_to('erroresPresupuestoIndex') ?>" class="menu-link">
|
||||
<?= lang("App.menu_error_presupuesto") ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
<?php if (auth()->user()->inGroup('admin') || auth()->user()->inGroup('beta')) { ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= route_to('variablesIndex') ?>" class="menu-link">
|
||||
<?= lang("App.menu_variables") ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php } ?>
|
||||
@ -48,30 +48,30 @@ if (auth()->user()->can('presupuesto.menu')) {
|
||||
</a>
|
||||
</li>
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("presupuestos/grapados") ?>" class="menu-link">
|
||||
<a href="<?= site_url("presupuestos/cosidotapablanda/list/21") ?>" class="menu-link">
|
||||
<?= lang("App.menu_libros_grapados") ?>
|
||||
</a>
|
||||
</li>
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("presupuestos/espiraltapadura") ?>" class="menu-link">
|
||||
<a href="<?= site_url("presupuestos/cosidotapablanda/list/5") ?>" class="menu-link">
|
||||
<?= lang("App.menu_libros_espiral_tapa_dura") ?>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("presupuestos/espiraltapablanda") ?>"
|
||||
<a href="<?= site_url("presupuestos/cosidotapablanda/list/6") ?>"
|
||||
class="menu-link">
|
||||
<?= lang("App.menu_libros_espiral_tapa_blanda") ?>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("presupuestos/wireotapadura") ?>" class="menu-link">
|
||||
<a href="<?= site_url("presupuestos/cosidotapablanda/list/7") ?>" class="menu-link">
|
||||
<?= lang("App.menu_libros_wireo_tapa_dura") ?>
|
||||
</a>
|
||||
</li>
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("presupuestos/wireotapablanda") ?>" class="menu-link">
|
||||
<a href="<?= site_url("presupuestos/cosidotapablanda/list/8") ?>" class="menu-link">
|
||||
<?= lang("App.menu_libros_wireo_tapa_blanda") ?>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
Reference in New Issue
Block a user