mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Merge branch 'mod/presupuesto_admin' of https://git.imnavajas.es/jjimenez/safekat into mod/presupuesto_admin
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,4 +1,4 @@
|
||||
ci4/.env
|
||||
.vscode/
|
||||
|
||||
launch.json
|
||||
*xdebug*.log*
|
||||
@ -80,5 +80,6 @@ class Filters extends BaseConfig
|
||||
/*'jwt' => [
|
||||
'before' => ['api', 'api/*']
|
||||
],*/
|
||||
|
||||
];
|
||||
}
|
||||
|
||||
31
ci4/app/Config/LogoImpresion.php
Normal file
31
ci4/app/Config/LogoImpresion.php
Normal file
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace Config;
|
||||
|
||||
use CodeIgniter\Config\BaseConfig;
|
||||
|
||||
class LogoImpresion extends BaseConfig
|
||||
{
|
||||
|
||||
public array $TIPO_IMPRESION_MAPPING = [
|
||||
"lp_bn" => "icon_bn",
|
||||
"lp_bnhq" => "icon_bnhq",
|
||||
"lp_color" => "icon_color",
|
||||
"lp_colorhq" => "icon_colorhq",
|
||||
"lp_cubierta" => "icon_cubierta",
|
||||
"lp_sobrecubierta" => "icon_sobrecubierta",
|
||||
"lp_rot_bn" => "icon_rotativa_bn",
|
||||
"lp_rot_color" => "icon_rotativa_color",
|
||||
"lp_guardas" => "icon_cuardas"
|
||||
|
||||
];
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
public function get_logo_path(string $tipo): string
|
||||
{
|
||||
return "themes/vuexy/img/safekat/presupuestos/" . $this->TIPO_IMPRESION_MAPPING[$tipo] . ".png";
|
||||
}
|
||||
}
|
||||
@ -142,10 +142,14 @@ const SK_PERMISSION_MATRIX = [
|
||||
"presupuesto.edit",
|
||||
"presupuesto.delete",
|
||||
"presupuesto.menu",
|
||||
"presupuesto-cliente.create",
|
||||
"presupuesto-cliente.edit",
|
||||
"presupuesto-cliente.delete",
|
||||
"presupuesto-cliente.menu",
|
||||
"pedidos-activos.view",
|
||||
"pedidos-activos.menu",
|
||||
"pedidos-finalizados.view",
|
||||
"pedidos-finalizados.menu",
|
||||
"pedidos-cancelados.view",
|
||||
"pedidos-cancelados.menu",
|
||||
"pedidos-todos.view",
|
||||
"pedidos-todos.menu",
|
||||
"tarifa-preimpresion.create",
|
||||
"tarifa-preimpresion.edit",
|
||||
"tarifa-preimpresion.delete",
|
||||
|
||||
@ -37,6 +37,34 @@ $routes->group('settings', ['namespace' => 'App\Controllers\Sistema'], function
|
||||
/* Rutas para tarifas */
|
||||
$routes->group('tarifas', ['namespace' => 'App\Controllers\Tarifas'], function ($routes) {
|
||||
|
||||
/* Maquinas */
|
||||
$routes->group('maquinas', ['namespace' => 'App\Controllers\Tarifas\Maquinas'], function ($routes) {
|
||||
|
||||
$routes->post('acabado', 'TarifaMaquinas::add_tarifa_acabado_maquina_with_tarea');
|
||||
$routes->post('manipulado', 'TarifaMaquinas::add_tarifa_manipulado_maquina_with_tarea');
|
||||
$routes->post('preimpresion', 'TarifaMaquinas::add_tarifa_preimpresion_maquina_with_tarea');
|
||||
$routes->post('encuadernacion', 'TarifaMaquinas::add_tarifa_encuadernacion_maquina_with_tarea');
|
||||
$routes->post('extra', 'TarifaMaquinas::add_tarifa_extra_maquina_with_tarea');
|
||||
|
||||
$routes->delete('acabado/(:num)', 'TarifaMaquinas::delete_tarifa_acabado_maquina_with_tarea/$1');
|
||||
$routes->delete('manipulado/(:num)', 'TarifaMaquinas::delete_tarifa_manipulado_maquina_with_tarea/$1');
|
||||
$routes->delete('preimpresion/(:num)', 'TarifaMaquinas::delete_tarifa_preimpresion_maquina_with_tarea/$1');
|
||||
$routes->delete('encuadernacion/(:num)', 'TarifaMaquinas::delete_tarifa_encuadernacion_maquina_with_tarea/$1');
|
||||
$routes->delete('extra/(:num)', 'TarifaMaquinas::delete_tarifa_extra_maquina_with_tarea/$1');
|
||||
|
||||
$routes->get('acabado/select', 'TarifaMaquinas::get_select_maquina_acabado');
|
||||
$routes->get('manipulado/select', 'TarifaMaquinas::get_select_maquina_manipulado');
|
||||
$routes->get('impresion/select', 'TarifaMaquinas::get_select_maquina_impresion');
|
||||
$routes->get('tareas/select', 'TarifaMaquinas::get_select_maquina_tareas');
|
||||
|
||||
|
||||
|
||||
$routes->get('acabado/datatable/(:num)', 'TarifaMaquinas::get_datatable_tarifa_acabado_maquina/$1');
|
||||
$routes->get('manipulado/datatable/(:num)', 'TarifaMaquinas::get_datatable_tarifa_manipulado_maquina/$1');
|
||||
$routes->get('preimpresion/datatable/(:num)', 'TarifaMaquinas::get_datatable_tarifa_preimpresion_maquina/$1');
|
||||
$routes->get('encuadernacion/datatable/(:num)', 'TarifaMaquinas::get_datatable_tarifa_encuadernacion_maquina/$1');
|
||||
$routes->get('extra/datatable/(:num)', 'TarifaMaquinas::get_datatable_tarifa_extra_maquina/$1');
|
||||
});
|
||||
/* Cliente */
|
||||
$routes->group('acabados', ['namespace' => 'App\Controllers\Tarifas\Acabados'], function ($routes) {
|
||||
|
||||
@ -45,7 +73,7 @@ $routes->group('tarifas', ['namespace' => 'App\Controllers\Tarifas'], function (
|
||||
$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->get('select', 'TarifaAcabados::show_select', ["as" => "showSelectTarifaAcabado"]);
|
||||
$routes->group('lineas', ['namespace' => 'App\Controllers\Tarifas\Acabados'], function ($routes) {
|
||||
$routes->post('datatable', 'TarifaAcabadosLineas::datatable', ['as' => 'tarifaAcabadoLineasDT']);
|
||||
$routes->post('datatable_editor', 'TarifaAcabadosLineas::datatable_editor', ['as' => 'tarifaAcabadoLineasDTE']);
|
||||
@ -77,7 +105,7 @@ $routes->group('configuracion', ['namespace' => 'App\Controllers\Configuracion']
|
||||
$routes->post('menuitemsFacturas', 'SeriesFacturas::menuItemsFacturas', ['as' => 'menuItemsOfSeriesFacturas']);
|
||||
});
|
||||
|
||||
|
||||
|
||||
$routes->group("variables", ["namespace" => 'App\Controllers\Configuracion'], function ($routes) {
|
||||
$routes->get('', 'ConfigVariables::index', ['as' => 'variablesIndex']);
|
||||
$routes->get('find/(:num)', 'ConfigVariables::get/$1', ['as' => 'variablesFind']);
|
||||
@ -92,6 +120,14 @@ $routes->group('configuracion', ['namespace' => 'App\Controllers\Configuracion']
|
||||
$routes->get('datatable', 'ConfigErrores::datatable', ['as' => 'erroresPresupuestoDatatable']);
|
||||
$routes->post('edit/(:num)', 'ConfigErrores::update_error_presupuesto/$1', ['as' => 'erroresPresupuestoUpdate']);
|
||||
});
|
||||
$routes->group("servicios", ["namespace" => 'App\Controllers\Configuracion'], function ($routes) {
|
||||
$routes->get('', 'ServicioCliente::index', ['as' => 'servicioClienteList']);
|
||||
$routes->get('(:num)', 'ServicioCliente::show/$1', ['as' => 'servicioClienteShow']);
|
||||
$routes->post('(:num)', 'ServicioCliente::store/$1', ['as' => 'servicioClienteStore']);
|
||||
$routes->post('update/(:num)', 'ServicioCliente::update_servicio_cliente/$1', ['as' => 'updateServicioCliente']);
|
||||
$routes->get('edit/(:num)', 'ServicioCliente::viewForm/$1', ['as' => 'servicioClienteViewForm']);
|
||||
$routes->get('datatable', 'ServicioCliente::datatable', ['as' => 'servicioClienteDatatable']);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@ -160,6 +196,7 @@ $routes->group('tarifasmanipulado', ['namespace' => 'App\Controllers\Tarifas'],
|
||||
$routes->post('datatable', 'Tarifasmanipulado::datatable', ['as' => 'dataTableOfTarifasManipulado']);
|
||||
$routes->post('allmenuitems', 'Tarifasmanipulado::allItemsSelect', ['as' => 'select2ItemsOfTarifasManipulado']);
|
||||
$routes->post('menuitems', 'Tarifasmanipulado::menuItems', ['as' => 'menuItemsOfTarifasManipulado']);
|
||||
$routes->get('select', 'Tarifasmanipulado::show_select', ["as" => "showSelectTarifaManipulado"]);
|
||||
});
|
||||
$routes->resource('tarifasmanipulado', ['namespace' => 'App\Controllers\Tarifas', 'controller' => 'Tarifasmanipulado', 'except' => 'show,new,create,update']);
|
||||
|
||||
@ -263,6 +300,7 @@ $routes->group('maquinas', ['namespace' => 'App\Controllers\Configuracion'], fun
|
||||
$routes->post('datatable', 'Maquinas::datatable', ['as' => 'dataTableOfMaquinas']);
|
||||
$routes->post('allmenuitems', 'Maquinas::allItemsSelect', ['as' => 'select2ItemsOfMaquinas']);
|
||||
$routes->post('menuitems', 'Maquinas::menuItems', ['as' => 'menuItemsOfMaquinas']);
|
||||
$routes->get('select', 'Maquinas::select', ['as' => 'selectMaquinas']);
|
||||
});
|
||||
$routes->resource('maquinas', ['namespace' => 'App\Controllers\Configuracion', 'controller' => 'Maquinas', 'except' => 'show,new,create,update']);
|
||||
|
||||
@ -663,6 +701,7 @@ $routes->group('pedidos', ['namespace' => 'App\Controllers\Pedidos'], function (
|
||||
$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->post('produccion/(:num)', 'Pedido::to_produccion/$1', ['as' => 'toProduccion']);
|
||||
});
|
||||
$routes->resource('pedidos', ['namespace' => 'App\Controllers\Pedidos', 'controller' => 'Pedido', 'except' => 'show,new,create,update']);
|
||||
|
||||
@ -794,11 +833,9 @@ $routes->group('messages', ['namespace' => 'App\Controllers\Chat'], function ($r
|
||||
|
||||
$routes->post('direct', 'ChatController::store_new_direct_message', ['as' => 'storeNewDirectMessage']);
|
||||
$routes->post('direct/client', 'ChatController::store_new_direct_message_client', ['as' => 'storeNewDirectMessageClient']);
|
||||
|
||||
|
||||
});
|
||||
$routes->group('chat', ['namespace' => 'App\Controllers\Chat'], function ($routes) {
|
||||
|
||||
|
||||
$routes->get('direct/(:num)', 'ChatController::get_chat_direct_view/$1', ['as' => 'getChatDirectView']);
|
||||
$routes->get('presupuesto/(:num)', 'ChatController::get_chat_presupuesto_view/$1', ['as' => 'getChatPresupuestoView']);
|
||||
$routes->get('pedido/(:num)', 'ChatController::get_chat_pedido_view/$1', ['as' => 'getChatPedidoView']);
|
||||
@ -806,7 +843,7 @@ $routes->group('chat', ['namespace' => 'App\Controllers\Chat'], function ($route
|
||||
|
||||
$routes->get('direct/conversation/(:num)', 'ChatController::get_chat_direct/$1', ['as' => 'getChatDirect']);
|
||||
$routes->get('direct/users/select/(:num)', 'ChatController::get_chat_direct_select_users/$1', ['as' => 'getChatDirectSelectUsers']);
|
||||
|
||||
|
||||
$routes->get('direct/client/users/select/presupuesto/(:num)', 'ChatController::get_presupuesto_client_users/$1/$2', ['as' => 'getPresupuestoClientUsers']);
|
||||
$routes->get('direct/client/users/select/pedido/(:num)', 'ChatController::get_pedido_client_users/$1/$2', ['as' => 'getPedidoClientUsers']);
|
||||
$routes->get('direct/client/users/select/factura/(:num)', 'ChatController::get_factura_client_users/$1/$2', ['as' => 'getFacturaClientUsers']);
|
||||
@ -848,6 +885,40 @@ $routes->group('chat', ['namespace' => 'App\Controllers\Chat'], function ($route
|
||||
});
|
||||
|
||||
|
||||
|
||||
$routes->group('produccion', ['namespace' => 'App\Controllers\Produccion'], function ($routes) {
|
||||
$routes->group('ordentrabajo', ['namespace' => 'App\Controllers\Produccion'], function ($routes) {
|
||||
$routes->get('', 'Ordentrabajo::index', ['as' => 'viewOrdenTrabajoIndex']);
|
||||
$routes->get('edit/(:num)', 'Ordentrabajo::edit/$1', ['as' => 'viewOrdenTrabajoEdit']);
|
||||
$routes->delete('reset/tareas/(:num)', 'Ordentrabajo::reset_tareas/$1');
|
||||
$routes->delete('tareas/(:num)', 'Ordentrabajo::delete_tarea/$1');
|
||||
$routes->get('summary/(:num)', 'Ordentrabajo::get_orden_trabajo_summary/$1', ['as' => 'getOrdenTrabajoSumary']);
|
||||
$routes->get('datatable', 'Ordentrabajo::datatable');
|
||||
$routes->get('datatable_pendientes', 'Ordentrabajo::datatable_pendientes');
|
||||
$routes->get('datatable_ferro_pendiente', 'Ordentrabajo::datatable_ferro_pendiente');
|
||||
$routes->get('datatable_ferro_ok', 'Ordentrabajo::datatable_ferro_ok');
|
||||
$routes->get('tareas/datatable/(:num)', 'Ordentrabajo::tareas_datatable/$1', ['as' => 'datatableTareasOrdenTrabajo']);
|
||||
/**======================
|
||||
* UPDATES
|
||||
*========================**/
|
||||
$routes->post("update/tarea", 'Ordentrabajo::update_orden_trabajo_tarea');
|
||||
$routes->post("update/date", 'Ordentrabajo::update_orden_trabajo_date');
|
||||
$routes->post("update/user", 'Ordentrabajo::update_orden_trabajo_user');
|
||||
$routes->post("update", 'Ordentrabajo::update_orden_trabajo');
|
||||
$routes->post("upload/portada", 'Ordentrabajo::upload_orden_trabajo_portada');
|
||||
|
||||
/**======================
|
||||
* PDF
|
||||
*========================**/
|
||||
$routes->get('pdf/(:num)', 'Ordentrabajo::get_pdf/$1');
|
||||
$routes->get('portada/(:num)', 'Ordentrabajo::get_portada_img/$1');
|
||||
$routes->group('planning', ['namespace' => 'App\Controllers\Produccion'], function ($routes) {
|
||||
$routes->get('rotativa', 'Ordentrabajo::index_planning_rotativa');
|
||||
$routes->get('papel/datatable', 'Ordentrabajo::papel_gramaje_datatable');
|
||||
$routes->get('rotativa/datatable', 'Ordentrabajo::planning_rotativa_datatable');
|
||||
});
|
||||
});
|
||||
});
|
||||
/*
|
||||
* --------------------------------------------------------------------
|
||||
* APIs Route Definitions
|
||||
@ -886,4 +957,4 @@ $routes->resource('translate', ['namespace' => 'App\Controllers', 'controller' =
|
||||
*/
|
||||
if (file_exists(APPPATH . 'Config/' . ENVIRONMENT . '/Routes.php')) {
|
||||
require APPPATH . 'Config/' . ENVIRONMENT . '/Routes.php';
|
||||
}
|
||||
}
|
||||
|
||||
@ -4,6 +4,8 @@ namespace Config;
|
||||
|
||||
use App\Services\FTPService;
|
||||
use CodeIgniter\Config\BaseService;
|
||||
use App\Services\ProductionService;
|
||||
use App\Services\TarifaMaquinaService;
|
||||
|
||||
/**
|
||||
* Services Configuration file.
|
||||
@ -30,4 +32,10 @@ class Services extends BaseService
|
||||
* return new \CodeIgniter\Example();
|
||||
* }
|
||||
*/
|
||||
public static function production(){
|
||||
return new ProductionService();
|
||||
}
|
||||
public static function tarifa_maquina(){
|
||||
return new TarifaMaquinaService();
|
||||
}
|
||||
}
|
||||
|
||||
@ -43,5 +43,108 @@ class Validation extends BaseConfig
|
||||
// Rules
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
/**========================================================================
|
||||
* TARIFA MAQUINA ACABADO
|
||||
*========================================================================**/
|
||||
public array $tarifa_maquina_acabado =
|
||||
[
|
||||
"tarifa_acabado_id" => [
|
||||
"rules" => "required|integer",
|
||||
"label" => "tarifa acabado",
|
||||
],
|
||||
"maquina_id" => [
|
||||
"rules" => "required|integer",
|
||||
"label" => "maquina",
|
||||
],
|
||||
"maquina_tarea_id" => [
|
||||
"rules" => "required|integer",
|
||||
"label" => "tarea",
|
||||
],
|
||||
];
|
||||
public array $tarifa_maquina_manipulado =
|
||||
[
|
||||
"tarifa_manipulado_id" => [
|
||||
"rules" => "required|integer",
|
||||
"label" => "tarifa acabado",
|
||||
],
|
||||
"maquina_id" => [
|
||||
"rules" => "required|integer",
|
||||
"label" => "maquina",
|
||||
],
|
||||
"maquina_tarea_id" => [
|
||||
"rules" => "required|integer",
|
||||
"label" => "tarea",
|
||||
],
|
||||
];
|
||||
public array $tarifa_maquina_preimpresion =
|
||||
[
|
||||
"tarifa_preimpresion_id" => [
|
||||
"rules" => "required|integer",
|
||||
"label" => "tarifa acabado",
|
||||
],
|
||||
"maquina_id" => [
|
||||
"rules" => "required|integer",
|
||||
"label" => "maquina",
|
||||
],
|
||||
"maquina_tarea_id" => [
|
||||
"rules" => "required|integer",
|
||||
"label" => "tarea",
|
||||
],
|
||||
];
|
||||
public array $tarifa_maquina_encuadernacion =
|
||||
[
|
||||
"tarifa_encuadernacion_id" => [
|
||||
"rules" => "required|integer",
|
||||
"label" => "tarifa acabado",
|
||||
],
|
||||
"maquina_id" => [
|
||||
"rules" => "required|integer",
|
||||
"label" => "maquina",
|
||||
],
|
||||
"maquina_tarea_id" => [
|
||||
"rules" => "required|integer",
|
||||
"label" => "tarea",
|
||||
],
|
||||
];
|
||||
public array $tarifa_maquina_extra =
|
||||
[
|
||||
"tarifa_extra_id" => [
|
||||
"rules" => "required|integer",
|
||||
"label" => "tarifa acabado",
|
||||
],
|
||||
"maquina_id" => [
|
||||
"rules" => "required|integer",
|
||||
"label" => "maquina",
|
||||
],
|
||||
"maquina_tarea_id" => [
|
||||
"rules" => "required|integer",
|
||||
"label" => "tarea",
|
||||
],
|
||||
];
|
||||
|
||||
public array $orden_trabajo_tarea = [
|
||||
|
||||
"orden_trabajo_tarea_id" => [
|
||||
"rules" => "required|integer",
|
||||
"label" => "tarea"
|
||||
],
|
||||
// "tiempo_real" => [
|
||||
// "rules" => "required|float",
|
||||
// "label" => "tiempo real"
|
||||
// ]
|
||||
];
|
||||
public array $orden_trabajo_date = [
|
||||
"orden_trabajo_id" => [
|
||||
"rules" => "required|integer",
|
||||
"label" => "tarea"
|
||||
],
|
||||
|
||||
];
|
||||
public array $orden_trabajo = [
|
||||
"orden_trabajo_id" => [
|
||||
"rules" => "required|integer",
|
||||
"label" => "Orden trabajo"
|
||||
],
|
||||
|
||||
];
|
||||
}
|
||||
|
||||
@ -356,7 +356,10 @@ class Maquinas extends \App\Controllers\BaseResourceController
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function select(){
|
||||
$r = $this->model->getSelectQuery($this->request->getGet("q"));
|
||||
return $this->response->setJSON($r);
|
||||
}
|
||||
protected function getMaquinaListItems($selId = null)
|
||||
{
|
||||
$data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Maquinas.maquina'))])];
|
||||
|
||||
89
ci4/app/Controllers/Configuracion/ServicioCliente.php
Normal file
89
ci4/app/Controllers/Configuracion/ServicioCliente.php
Normal file
@ -0,0 +1,89 @@
|
||||
<?php
|
||||
|
||||
namespace App\Controllers\Configuracion;
|
||||
|
||||
use App\Controllers\BaseController;
|
||||
use App\Models\Configuracion\ServicioClienteModel;
|
||||
use CodeIgniter\HTTP\Response;
|
||||
use Hermawan\DataTables\DataTable;
|
||||
use CodeIgniter\I18n\Time;
|
||||
|
||||
class ServicioCliente extends BaseController
|
||||
{
|
||||
|
||||
protected ServicioClienteModel $servicioClienteModel;
|
||||
protected $format = 'json';
|
||||
protected array $viewData = [];
|
||||
|
||||
|
||||
protected static $viewPath = 'themes/vuexy/form/configuracion/servicios_cliente/';
|
||||
protected static $controllerSlug = "servicios";
|
||||
protected $indexRoute = 'viewServicioCliente';
|
||||
protected $editRoute = 'ServicioClienteEdit';
|
||||
|
||||
|
||||
|
||||
public function initController(\CodeIgniter\HTTP\RequestInterface $request, \CodeIgniter\HTTP\ResponseInterface $response, \Psr\Log\LoggerInterface $logger)
|
||||
{
|
||||
parent::initController($request, $response, $logger);
|
||||
$this->servicioClienteModel = model(ServicioClienteModel::class);
|
||||
}
|
||||
|
||||
|
||||
public function index()
|
||||
{
|
||||
$this->viewData['breadcrumb'] = [
|
||||
['title' => lang("App.menu_configuration"), 'route' => "javascript:void(0);", 'active' => false],
|
||||
['title' => lang("App.menu_servicios_cliente"), 'route' => site_url('configuracion/servicios'), 'active' => true]
|
||||
];
|
||||
return view(static::$viewPath . $this->indexRoute, $this->viewData);
|
||||
}
|
||||
public function viewForm(int $servicio_cliente_id)
|
||||
{
|
||||
$servicioCliente = $this->servicioClienteModel->find($servicio_cliente_id);
|
||||
$this->viewData['breadcrumb'] = [
|
||||
['title' => lang("App.menu_configuration"), 'route' => "javascript:void(0);", 'active' => false],
|
||||
['title' => lang("App.menu_servicios_cliente"), 'route' => site_url('configuracion/servicios'), 'active' => false],
|
||||
['title' => $servicioCliente->nombre, 'route' => site_url('configuracion/servicios/edit/' . $servicio_cliente_id), 'active' => true]
|
||||
];
|
||||
$this->viewData["model"] = $servicioCliente;
|
||||
|
||||
return view(static::$viewPath . 'ServicioClienteEdit', $this->viewData);
|
||||
}
|
||||
public function show(int $id)
|
||||
{
|
||||
$data = $this->servicioClienteModel->find($id)->withAllTarifas();
|
||||
return $this->response->setJSON($data);
|
||||
}
|
||||
public function update_servicio_cliente(int $id)
|
||||
{
|
||||
$data = $this->request->getPost();
|
||||
$status = $this->servicioClienteModel->update($id, [
|
||||
"nombre" => $data["nombre"],
|
||||
"code" => $data["code"]
|
||||
]);
|
||||
if (isset($data["tarifa_manipulado_id"])) {
|
||||
$this->servicioClienteModel->upsertTarifaManipulado($id, $data["tarifa_manipulado_id"]);
|
||||
}else if(isset($data["tarifa_acabado_id"])) {
|
||||
|
||||
$this->servicioClienteModel->upsertTarifaAcabado($id, $data["tarifa_acabado_id"]);
|
||||
}else{
|
||||
$this->servicioClienteModel->detachTarifas($id);
|
||||
}
|
||||
|
||||
return $this->response->setJSON(["message" => lang("App.global_success"), "status" => $status]);
|
||||
}
|
||||
public function store()
|
||||
{
|
||||
// $this->servicioClienteModel->update($id,[$this->request->getPost()]);
|
||||
return $this->response->setJSON([]);
|
||||
}
|
||||
public function datatable()
|
||||
{
|
||||
$query = $this->servicioClienteModel->getQueryDatatable()->orderBy("created_at", "DESC");
|
||||
return DataTable::of($query)
|
||||
->edit('created_at', fn($q) => $q->created_at ? Time::createFromFormat('Y-m-d H:i:s', $q->created_at)->format("d/m/Y H:i") : "")
|
||||
->add("action", fn($q) => $q->id)
|
||||
->toJson(true);
|
||||
}
|
||||
}
|
||||
@ -6,6 +6,7 @@ use App\Entities\Pedidos\PedidoEntity;
|
||||
use App\Models\Collection;
|
||||
use App\Models\Pedidos\PedidoModel;
|
||||
use App\Services\PedidoXMLService;
|
||||
use App\Services\ProductionService;
|
||||
|
||||
class Pedido extends \App\Controllers\BaseResourceController
|
||||
{
|
||||
@ -388,5 +389,20 @@ class Pedido extends \App\Controllers\BaseResourceController
|
||||
// $xml_service = new PedidoXMLService($this->model);
|
||||
return $this->respond($data);
|
||||
}
|
||||
|
||||
public function to_produccion($pedido_id)
|
||||
{
|
||||
$serviceProduction = service('production');
|
||||
$pedido = $this->model->find($pedido_id);
|
||||
$serviceProduction->setPedido($pedido);
|
||||
if($pedido->orden_trabajo()){
|
||||
return $this->response->setJSON(["data"=>$pedido->orden_trabajo(),"message" => "Ya existe una orden de trabajo para este pedido"]);
|
||||
|
||||
}else{
|
||||
$r = $serviceProduction->createOrdenTrabajo();
|
||||
return $this->response->setJSON(["data"=>$r,"message" => "Orden trabajo creada correctamente"]);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,50 +1,268 @@
|
||||
<?php
|
||||
|
||||
namespace App\Controllers\Produccion;
|
||||
use App\Controllers\BaseController;
|
||||
|
||||
use App\Controllers\BaseController;
|
||||
use App\Models\OrdenTrabajo\OrdenTrabajoModel;
|
||||
use App\Models\OrdenTrabajo\OrdenTrabajoTarea;
|
||||
use App\Models\OrdenTrabajo\OrdenTrabajoUser;
|
||||
use App\Models\Presupuestos\PresupuestoModel;
|
||||
use App\Models\Usuarios\UserModel;
|
||||
use App\Services\ProductionService;
|
||||
use CodeIgniter\Files\File;
|
||||
use CodeIgniter\HTTP\RequestInterface;
|
||||
use CodeIgniter\HTTP\ResponseInterface;
|
||||
use CodeIgniter\I18n\Time;
|
||||
use CodeIgniter\Validation\Validation;
|
||||
use Config\LogoImpresion;
|
||||
use Hermawan\DataTables\DataTable;
|
||||
use Psr\Log\LoggerInterface;
|
||||
|
||||
class Ordentrabajo extends BaseController
|
||||
{
|
||||
function __construct()
|
||||
{
|
||||
|
||||
{
|
||||
protected $format = 'json';
|
||||
protected array $viewData = [];
|
||||
protected ProductionService $produccionService;
|
||||
protected OrdenTrabajoModel $otModel;
|
||||
protected OrdenTrabajoUser $otUserModel;
|
||||
protected OrdenTrabajoTarea $otTarea;
|
||||
protected UserModel $userModel;
|
||||
protected Validation $validation;
|
||||
protected static $viewPath = 'themes/vuexy/form/produccion/';
|
||||
protected static $controllerSlug = "orden-trabajo";
|
||||
protected $indexRoute = 'viewOrdenTrabajoList';
|
||||
protected $indexRoutePlanning = 'ot/viewPlanningRotativa';
|
||||
protected $editRoute = 'viewOrdenTrabajoEdit';
|
||||
|
||||
|
||||
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
|
||||
{
|
||||
$this->otModel = model(OrdenTrabajoModel::class);
|
||||
$this->userModel = model(UserModel::class);
|
||||
$this->produccionService = new ProductionService();
|
||||
$this->otTarea = model(OrdenTrabajoTarea::class);
|
||||
$this->validation = service("validation");
|
||||
helper("time");
|
||||
parent::initController($request, $response, $logger);
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
echo 'Orden trabajo';
|
||||
// Breadcrumbs
|
||||
$this->viewData['breadcrumb'] = [
|
||||
['title' => lang("Produccion.ot"), 'route' => "javascript:void(0);", 'active' => false],
|
||||
['title' => lang("Produccion.ots"), 'route' => site_url('produccion/ordentrabajo'), 'active' => true]
|
||||
];
|
||||
return view(static::$viewPath . $this->indexRoute, $this->viewData);
|
||||
}
|
||||
public function index_planning_rotativa()
|
||||
{
|
||||
// Breadcrumbs
|
||||
$this->viewData['breadcrumb'] = [
|
||||
['title' => lang("Produccion.ots"), 'route' => "javascript:void(0);", 'active' => false],
|
||||
['title' => lang("Produccion.ots"), 'route' => site_url('produccion/ordentrabajo/planning/rotativa'), 'active' => true]
|
||||
];
|
||||
return view(static::$viewPath . $this->indexRoutePlanning, $this->viewData);
|
||||
}
|
||||
|
||||
public function delete()
|
||||
|
||||
public function get_orden_trabajo_summary($orden_trabajo_id)
|
||||
{
|
||||
$summary = $this->produccionService->init($orden_trabajo_id)->getSummary();
|
||||
return $this->response->setJSON($summary);
|
||||
}
|
||||
public function add() {}
|
||||
|
||||
/**========================================================================
|
||||
* UPDATES
|
||||
*========================================================================**/
|
||||
public function update_orden_trabajo()
|
||||
{
|
||||
$bodyData = $this->request->getPost();
|
||||
// return $this->response->setJSON(["message" => lang("App.global_alert_save_success"), "data" => $bodyData]);
|
||||
$validated = $this->validation->run($bodyData, "orden_trabajo");
|
||||
if ($validated) {
|
||||
$r = $this->produccionService->init($bodyData["orden_trabajo_id"])->updateOrdenTrabajo($bodyData);
|
||||
return $this->response->setJSON(["message" => lang("App.global_alert_save_success"), "status" => $r, "data" => $bodyData]);
|
||||
} else {
|
||||
return $this->response->setJSON(["errors" => $this->validation->getErrors()])->setStatusCode(400);
|
||||
}
|
||||
}
|
||||
public function update_orden_trabajo_tarea()
|
||||
{
|
||||
$bodyData = $this->request->getPost();
|
||||
// return $this->response->setJSON(["message" => lang("App.global_alert_save_success"), "data" => $bodyData]);
|
||||
$validated = $this->validation->run($bodyData, "orden_trabajo_tarea");
|
||||
if ($validated) {
|
||||
$r = $this->produccionService->updateOrdenTrabajoTarea($bodyData["orden_trabajo_tarea_id"], $bodyData);
|
||||
return $this->response->setJSON(["message" => lang("App.global_alert_save_success"), "status" => $r, "data" => $bodyData]);
|
||||
} else {
|
||||
return $this->response->setJSON(["errors" => $this->validation->getErrors()])->setStatusCode(400);
|
||||
}
|
||||
}
|
||||
public function update_orden_trabajo_date()
|
||||
{
|
||||
$bodyData = $this->request->getPost();
|
||||
// return $this->response->setJSON(["message" => lang("App.global_alert_save_success"), "data" => $bodyData]);
|
||||
$validated = $this->validation->run($bodyData, "orden_trabajo_date");
|
||||
if ($validated) {
|
||||
$r = $this->produccionService->init($bodyData["orden_trabajo_id"])->updateOrdenTrabajoDate($bodyData);
|
||||
return $this->response->setJSON(["message" => lang("App.global_alert_save_success"), "status" => $r["status"], "user" => $r["user"], "data" => $bodyData]);
|
||||
} else {
|
||||
return $this->response->setJSON(["errors" => $this->validation->getErrors()])->setStatusCode(400);
|
||||
}
|
||||
}
|
||||
|
||||
public function edit($orden_trabajo_id)
|
||||
{
|
||||
// Breadcrumbs
|
||||
$this->viewData['breadcrumb'] = [
|
||||
['title' => lang("Produccion.ot"), 'route' => site_url('produccion/ordentrabajo'), 'active' => false],
|
||||
['title' => $this->otModel->find($orden_trabajo_id)->pedido()->presupuesto()->titulo, 'route' => site_url('produccion/ordentrabajo/edit/' . $orden_trabajo_id), 'active' => true]
|
||||
];
|
||||
$this->viewData["modelId"] = $orden_trabajo_id;
|
||||
$this->produccionService->init($orden_trabajo_id);
|
||||
$this->viewData["presupuesto"] = $this->produccionService->getPresupuesto();
|
||||
$this->viewData["cliente"] = $this->produccionService->getCliente();
|
||||
$this->viewData["ot"] = $this->produccionService->getOrdenTrabajo();
|
||||
return view(static::$viewPath . $this->editRoute, $this->viewData);
|
||||
}
|
||||
|
||||
public function datatable()
|
||||
{
|
||||
$logo = config(LogoImpresion::class);
|
||||
|
||||
$q = $this->otModel->getDatatableQuery()->where("ordenes_trabajo.estado","F");
|
||||
// return $this->response->setJSON($q->get()->getResultArray());
|
||||
return DataTable::of($q)
|
||||
->add("logo",fn($q) => site_url($logo->get_logo_path($q->presupuesto_linea_tipo)))
|
||||
->edit(
|
||||
"fecha_encuadernado_at",
|
||||
fn($q) => Time::createFromFormat("Y-m-d",$q->fecha_encuadernado_at)->format("d/m/Y")
|
||||
)
|
||||
->add("action", fn($q) => $q->id)
|
||||
->toJson(true);
|
||||
}
|
||||
public function datatable_pendientes()
|
||||
{
|
||||
$logo = config(LogoImpresion::class);
|
||||
|
||||
$q = $this->otModel->getDatatableQuery()->whereIn("ordenes_trabajo.estado",["I","PM"]);
|
||||
// return $this->response->setJSON($q->get()->getResultArray());
|
||||
return DataTable::of($q)
|
||||
->add("logo",fn($q) => site_url($logo->get_logo_path($q->presupuesto_linea_tipo)))
|
||||
->edit(
|
||||
"fecha_encuadernado_at",
|
||||
fn($q) => Time::createFromFormat("Y-m-d",$q->fecha_encuadernado_at)->format("d/m/Y")
|
||||
)
|
||||
->add("action", fn($q) => $q->id)
|
||||
->toJson(true);
|
||||
}
|
||||
public function datatable_ferro_pendiente()
|
||||
{
|
||||
$logo = config(LogoImpresion::class);
|
||||
|
||||
$q = $this->otModel->getDatatableQuery()->where("ferro_ok_at",null);
|
||||
// return $this->response->setJSON($q->get()->getResultArray());
|
||||
return DataTable::of($q)
|
||||
->add("logo",fn($q) => site_url($logo->get_logo_path($q->presupuesto_linea_tipo)))
|
||||
->edit(
|
||||
"fecha_encuadernado_at",
|
||||
fn($q) => Time::createFromFormat("Y-m-d",$q->fecha_encuadernado_at)->format("d/m/Y")
|
||||
)
|
||||
->add("action", fn($q) => $q->id)
|
||||
->toJson(true);
|
||||
}
|
||||
public function datatable_ferro_ok()
|
||||
{
|
||||
$logo = config(LogoImpresion::class);
|
||||
|
||||
$q = $this->otModel->getDatatableQuery()->where("ferro_ok_at is NOT NULL",NULL,FALSE);
|
||||
// return $this->response->setJSON($q->get()->getResultArray());
|
||||
return DataTable::of($q)
|
||||
->add("logo",fn($q) => site_url($logo->get_logo_path($q->presupuesto_linea_tipo)))
|
||||
->edit(
|
||||
"fecha_encuadernado_at",
|
||||
fn($q) => Time::createFromFormat("Y-m-d",$q->fecha_encuadernado_at)->format("d/m/Y")
|
||||
)
|
||||
->add("action", fn($q) => $q->id)
|
||||
->toJson(true);
|
||||
}
|
||||
public function papel_gramaje_datatable()
|
||||
{
|
||||
|
||||
$q = $this->produccionService->papelGramajeDatatableQuery();
|
||||
return DataTable::of($q)
|
||||
->edit("tiempoReal", fn($q) => float_seconds_to_hhmm_string($q->tiempoReal * 3600))
|
||||
->toJson(true);
|
||||
}
|
||||
|
||||
public function add()
|
||||
public function reset_tareas(int $orden_trabajo_id)
|
||||
{
|
||||
|
||||
$r = $this->produccionService->init($orden_trabajo_id)->resetAllTareas();
|
||||
return $this->response->setJSON(["message" => "Tareas reseteadas", "status" => $r]);
|
||||
}
|
||||
|
||||
public function edit()
|
||||
public function delete_tarea(int $orden_trabajo_tarea_id)
|
||||
{
|
||||
|
||||
$r = $this->otTarea->delete($orden_trabajo_tarea_id);
|
||||
return $this->response->setJSON(["message" => "Tarea eliminada", "states" => $r]);
|
||||
}
|
||||
|
||||
public function cien()
|
||||
public function tareas_datatable(int $orden_trabajo_id)
|
||||
{
|
||||
echo 'Orden trabajo 100%';
|
||||
$q = $this->produccionService->init($orden_trabajo_id)->taskDatatableQuery($orden_trabajo_id);
|
||||
// return $this->response->setJSON($q->get()->getResultArray());
|
||||
return DataTable::of($q)
|
||||
->add("action", fn($q) => $q)
|
||||
->edit("orden", fn($q) => ["id" => $q->id, "orden" => $q->orden])
|
||||
->edit("tiempo_estimado", fn($q) => float_seconds_to_hhmm_string($q->tiempo_estimado))
|
||||
->edit("tiempo_real", fn($q) => float_seconds_to_hhmm_string($q->tiempo_real))
|
||||
->edit("maquina_tarea", fn($q) => ["id" => $q->id, "maquina_id" => $q->maquina_tarea, "maquina_name" => $q->maquina_nombre])
|
||||
->toJson(true);
|
||||
}
|
||||
|
||||
public function finalizado()
|
||||
public function get_pdf($orden_trabajo_id)
|
||||
{
|
||||
echo 'Orden trabajo finalizado';
|
||||
return $this->produccionService->init($orden_trabajo_id)->getPdf();
|
||||
}
|
||||
|
||||
public function pendiente()
|
||||
public function upload_orden_trabajo_portada()
|
||||
{
|
||||
echo 'Orden trabajo pendiente';
|
||||
try {
|
||||
//code...
|
||||
$file = $this->request->getFile("portada_file");
|
||||
$bodyData = $this->request->getPost();
|
||||
$id = $bodyData["orden_trabajo_id"];
|
||||
$r = null;
|
||||
$fullpath = null;
|
||||
if ($file->isValid() && !$file->hasMoved()) {
|
||||
$fullpath = $file->store('ordenes_trabajo_portadas');
|
||||
$r = $this->otModel->update($id, ["portada_path" => $fullpath]);
|
||||
}
|
||||
return $this->response->setJSON(["message" => "Portada subida", "data" => $r]);
|
||||
} catch (\Throwable $th) {
|
||||
if ($fullpath) {
|
||||
delete_files($fullpath);
|
||||
}
|
||||
return $this->response->setJSON(["message" => "Portada error", "error" => $th->getMessage()])->setStatusCode($th->getCode());
|
||||
}
|
||||
}
|
||||
public function get_portada_img($orden_trabajo_id)
|
||||
{
|
||||
$ot = $this->otModel->find($orden_trabajo_id);
|
||||
if ($ot->portada_path) {
|
||||
$filePath = WRITEPATH . 'uploads/' . $ot->portada_path;
|
||||
$mimeType = mime_content_type($filePath);
|
||||
return $this->response
|
||||
->setHeader('Content-Type', $mimeType)
|
||||
->setHeader('Content-Length', filesize($filePath))
|
||||
->setBody(file_get_contents($filePath));
|
||||
} else {
|
||||
return $this->response->setJSON(["message" => "Portada error", "error" => "No hay portada"])->setStatusCode(400);
|
||||
}
|
||||
}
|
||||
public function planning_rotativa_datatable()
|
||||
{
|
||||
$q = $this->produccionService->planningRotativaQueryDatatable();
|
||||
return DataTable::of($q)
|
||||
->edit("fecha_entrega_real_at", fn($q) => $q->fecha_entrega_real_at ? Time::createFromFormat("Y-m-d", $q->fecha_entrega_real_at)->format("d/m/Y") : "")
|
||||
->add("action", fn($q) => $q)
|
||||
->toJson(true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
<?php namespace App\Controllers\Tarifas\Acabados;
|
||||
<?php
|
||||
|
||||
namespace App\Controllers\Tarifas\Acabados;
|
||||
|
||||
use App\Controllers\BaseResourceController;
|
||||
use App\Entities\Tarifas\Acabados\TarifaAcabadoEntity;
|
||||
@ -22,7 +24,7 @@ class TarifaAcabados extends BaseResourceController
|
||||
|
||||
protected static $controllerSlug = 'tarifasacabado';
|
||||
|
||||
protected static $viewPath = 'themes/vuexy/form/tarifas/acabado/';
|
||||
protected static $viewPath = 'themes/vuexy/form/tarifas/acabado/';
|
||||
|
||||
protected $indexRoute = 'tarifaAcabadoList';
|
||||
|
||||
@ -133,7 +135,7 @@ class TarifaAcabados extends BaseResourceController
|
||||
|
||||
endif; // ($requestMethod === 'post')
|
||||
|
||||
$this->viewData['proveedores'] = $this->getProveedores();
|
||||
$this->viewData['proveedores'] = $this->getProveedores();
|
||||
|
||||
$this->viewData['tarifaacabadoEntity'] = isset($sanitizedData) ? new TarifaAcabadoEntity($sanitizedData) : new TarifaAcabadoEntity();
|
||||
$this->viewData['formAction'] = route_to('tarifaAcabadoAdd');
|
||||
@ -169,7 +171,7 @@ class TarifaAcabados extends BaseResourceController
|
||||
|
||||
// JJO
|
||||
$sanitizedData['user_updated_id'] = auth()->user()->id;
|
||||
|
||||
|
||||
if ($this->request->getPost('mostrar_en_presupuesto') == null) {
|
||||
$sanitizedData['mostrar_en_presupuesto'] = false;
|
||||
}
|
||||
@ -181,7 +183,7 @@ class TarifaAcabados extends BaseResourceController
|
||||
if ($this->request->getPost('acabado_sobrecubierta') == null) {
|
||||
$sanitizedData['acabado_sobrecubierta'] = false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
$noException = true;
|
||||
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
|
||||
@ -207,7 +209,7 @@ class TarifaAcabados extends BaseResourceController
|
||||
|
||||
if ($noException && $successfulResult) :
|
||||
$id = $tarifaacabadoEntity->id ?? $id;
|
||||
$message = lang('Basic.global.updateSuccess', [lang('Basic.global.record')]) .'.';
|
||||
$message = lang('Basic.global.updateSuccess', [lang('Basic.global.record')]) . '.';
|
||||
|
||||
if ($thenRedirect) :
|
||||
if (!empty($this->indexRoute)) :
|
||||
@ -312,12 +314,26 @@ class TarifaAcabados extends BaseResourceController
|
||||
}
|
||||
}
|
||||
|
||||
private function getProveedores(){
|
||||
private function getProveedores()
|
||||
{
|
||||
$provTipoModel = new ProveedorTipoModel();
|
||||
$provModel = new ProveedorModel();
|
||||
|
||||
$tipoId = $provTipoModel->getTipoId("Acabados");
|
||||
return $provModel->getProvList($tipoId);
|
||||
}
|
||||
|
||||
public function show_select()
|
||||
{
|
||||
$query = $this->model->builder()
|
||||
->select(
|
||||
["id", "nombre as name", "code as description"]
|
||||
)
|
||||
->where("deleted_at",null);
|
||||
if ($this->request->getGet("q")) {
|
||||
$query->groupStart()
|
||||
->orLike("nombre", $this->request->getGet("q"))
|
||||
->groupEnd();
|
||||
}
|
||||
return $this->response->setJSON($query->get()->getResultObject());
|
||||
}
|
||||
}
|
||||
|
||||
205
ci4/app/Controllers/Tarifas/Maquinas/TarifaMaquinas.php
Normal file
205
ci4/app/Controllers/Tarifas/Maquinas/TarifaMaquinas.php
Normal file
@ -0,0 +1,205 @@
|
||||
<?php
|
||||
|
||||
namespace App\Controllers\Tarifas\Maquinas;
|
||||
|
||||
use App\Controllers\BaseController;
|
||||
use App\Models\Configuracion\MaquinaModel;
|
||||
use App\Models\Configuracion\MaquinaTareaModel;
|
||||
use App\Models\Tarifas\Maquinas\TarifaAcabadoMaquinaModel;
|
||||
use App\Models\Tarifas\Maquinas\TarifaManipuladoMaquinaModel;
|
||||
use App\Models\Tarifas\Maquinas\TarifaEncuadernacionMaquinaModel;
|
||||
use App\Models\Tarifas\Maquinas\TarifaPreimpresionMaquinaModel;
|
||||
use App\Models\Tarifas\Maquinas\TarifaExtraMaquinaModel;
|
||||
|
||||
use App\Services\TarifaMaquinaService;
|
||||
use CodeIgniter\HTTP\RequestInterface;
|
||||
use CodeIgniter\HTTP\ResponseInterface;
|
||||
use CodeIgniter\Validation\Validation;
|
||||
use Hermawan\DataTables\DataTable;
|
||||
use Psr\Log\LoggerInterface;
|
||||
|
||||
|
||||
class TarifaMaquinas extends BaseController
|
||||
{
|
||||
protected $format = 'json';
|
||||
protected array $viewData = [];
|
||||
protected MaquinaModel $maquinaModel;
|
||||
protected MaquinaTareaModel $maquinaTareaModel;
|
||||
protected TarifaMaquinaService $tarifaMaquinaService;
|
||||
protected Validation $validation;
|
||||
protected static $controllerSlug = "tarifa-maquinas";
|
||||
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
|
||||
{
|
||||
$this->maquinaModel = model(MaquinaModel::class);
|
||||
$this->maquinaTareaModel = model(MaquinaTareaModel::class);
|
||||
$this->tarifaMaquinaService = service("tarifa_maquina");
|
||||
$this->validation = service("validation");
|
||||
parent::initController($request, $response, $logger);
|
||||
}
|
||||
/**========================================================================
|
||||
* CREATE
|
||||
*========================================================================**/
|
||||
|
||||
public function add_tarifa_acabado_maquina_with_tarea()
|
||||
{
|
||||
$bodyData = $this->request->getPost();
|
||||
$validated = $this->validation->run($bodyData, "tarifa_maquina_acabado");
|
||||
if ($validated) {
|
||||
$r = $this->tarifaMaquinaService->attachAcabadoToMaquina(...$bodyData);
|
||||
return $this->response->setJSON(["message" => lang("App.global_alert_save_success"), "status" => true, "data" => $r]);
|
||||
} else {
|
||||
return $this->response->setJSON($this->validation->getErrors())->setStatusCode(400);
|
||||
}
|
||||
}
|
||||
public function add_tarifa_manipulado_maquina_with_tarea()
|
||||
{
|
||||
$bodyData = $this->request->getPost();
|
||||
$validated = $this->validation->run($bodyData, "tarifa_maquina_manipulado");
|
||||
if ($validated) {
|
||||
$r = $this->tarifaMaquinaService->attachManipuladoToMaquina(...$bodyData);
|
||||
return $this->response->setJSON(["message" => lang("App.global_alert_save_success"), "status" => true, "data" => $r]);
|
||||
} else {
|
||||
return $this->response->setJSON(["errors" => $this->validation->getErrors()])->setStatusCode(400);
|
||||
}
|
||||
}
|
||||
public function add_tarifa_preimpresion_maquina_with_tarea()
|
||||
{
|
||||
$bodyData = $this->request->getPost();
|
||||
$validated = $this->validation->run($bodyData, "tarifa_maquina_preimpresion");
|
||||
if ($validated) {
|
||||
|
||||
$r = $this->tarifaMaquinaService->attachPreimpresionToMaquina(...$bodyData);
|
||||
return $this->response->setJSON(["message" => lang("App.global_alert_save_success"), "status" => true, "data" => $r]);
|
||||
} else {
|
||||
return $this->response->setJSON(["errors" => $this->validation->getErrors()])->setStatusCode(400);
|
||||
}
|
||||
}
|
||||
public function add_tarifa_encuadernacion_maquina_with_tarea()
|
||||
{
|
||||
$bodyData = $this->request->getPost();
|
||||
$validated = $this->validation->run($bodyData, "tarifa_maquina_encuadernacion");
|
||||
if ($validated) {
|
||||
|
||||
$r = $this->tarifaMaquinaService->attachEncuadernacionToMaquina(...$bodyData);
|
||||
return $this->response->setJSON(["message" => lang("App.global_alert_save_success"), "status" => true, "data" => $r]);
|
||||
} else {
|
||||
return $this->response->setJSON(["errors" => $this->validation->getErrors()])->setStatusCode(400);
|
||||
}
|
||||
}
|
||||
public function add_tarifa_extra_maquina_with_tarea()
|
||||
{
|
||||
$bodyData = $this->request->getPost();
|
||||
$validated = $this->validation->run($bodyData, "tarifa_maquina_encuadernacion");
|
||||
if ($validated) {
|
||||
$r = $this->tarifaMaquinaService->attachExtraToMaquina(...$bodyData);
|
||||
return $this->response->setJSON(["message" => lang("App.global_alert_save_success"), "status" => true, "data" => $r]);
|
||||
} else {
|
||||
return $this->response->setJSON(["errors" => $this->validation->getErrors()])->setStatusCode(400);
|
||||
}
|
||||
}
|
||||
/**========================================================================
|
||||
* DELETES
|
||||
*========================================================================**/
|
||||
public function delete_tarifa_acabado_maquina_with_tarea($tarifa_acabado_maquina_id)
|
||||
{
|
||||
$m = model(TarifaAcabadoMaquinaModel::class);
|
||||
$r = $m->delete($tarifa_acabado_maquina_id);
|
||||
return $this->response->setJSON(["message" => lang("App.user_alert_delete"), "status" => true, "data" => $r]);
|
||||
|
||||
}
|
||||
public function delete_tarifa_manipulado_maquina_with_tarea($tarifa_manipulado_maquina_id)
|
||||
{
|
||||
$m = model(TarifaManipuladoMaquinaModel::class);
|
||||
$r = $m->delete($tarifa_manipulado_maquina_id);
|
||||
return $this->response->setJSON(["message" => lang("App.user_alert_delete"), "status" => true, "data" => $r]);
|
||||
|
||||
}
|
||||
public function delete_tarifa_encuadernacion_maquina_with_tarea($tarifa_encuadernacion_maquina_id)
|
||||
{
|
||||
$m = model(TarifaEncuadernacionMaquinaModel::class);
|
||||
$r = $m->delete($tarifa_encuadernacion_maquina_id);
|
||||
return $this->response->setJSON(["message" => lang("App.user_alert_delete"), "status" => true, "data" => $r]);
|
||||
|
||||
}
|
||||
public function delete_tarifa_preimpresion_maquina_with_tarea($tarifa_preimpresion_maquina_id)
|
||||
{
|
||||
$m = model(TarifaPreimpresionMaquinaModel::class);
|
||||
$r = $m->delete($tarifa_preimpresion_maquina_id);
|
||||
return $this->response->setJSON(["message" => lang("App.user_alert_delete"), "status" => true, "data" => $r]);
|
||||
|
||||
}
|
||||
public function delete_tarifa_extra_maquina_with_tarea($tarifa_extra_maquina_id)
|
||||
{
|
||||
$m = model(TarifaExtraMaquinaModel::class);
|
||||
$r = $m->delete($tarifa_extra_maquina_id);
|
||||
return $this->response->setJSON(["message" => lang("App.user_alert_delete"), "status" => true, "data" => $r]);
|
||||
|
||||
}
|
||||
|
||||
/**========================================================================
|
||||
* SELECTS
|
||||
*========================================================================**/
|
||||
public function get_select_maquina_acabado()
|
||||
{
|
||||
$r = $this->maquinaModel->getSelectQuery(q: $this->request->getGet("q"), type: 'acabado');
|
||||
return $this->response->setJSON($r);
|
||||
}
|
||||
public function get_select_maquina_impresion()
|
||||
{
|
||||
$r = $this->maquinaModel->getSelectQuery(q: $this->request->getGet("q"), type: 'impresion');
|
||||
return $this->response->setJSON($r);
|
||||
}
|
||||
public function get_select_maquina_manipulado()
|
||||
{
|
||||
$r = $this->maquinaModel->getSelectQuery(q: $this->request->getGet("q"), type: 'manipulado');
|
||||
return $this->response->setJSON($r);
|
||||
}
|
||||
public function get_select_maquina_tareas()
|
||||
{
|
||||
$r = $this->maquinaTareaModel->getSelectQuery(q: $this->request->getGet("q"));
|
||||
return $this->response->setJSON($r);
|
||||
}
|
||||
/**========================================================================
|
||||
* DATATABLES
|
||||
*========================================================================**/
|
||||
public function get_datatable_tarifa_acabado_maquina(int $tarifa_acabado_id)
|
||||
{
|
||||
$m = model(TarifaAcabadoMaquinaModel::class);
|
||||
$q = $m->queryDatatable($tarifa_acabado_id);
|
||||
return DataTable::of($q)
|
||||
->add("action", fn($q) => $q->id)
|
||||
->toJson(true);
|
||||
}
|
||||
public function get_datatable_tarifa_manipulado_maquina(int $tarifa_manipulado_id)
|
||||
{
|
||||
$m = model(TarifaManipuladoMaquinaModel::class);
|
||||
$q = $m->queryDatatable($tarifa_manipulado_id);
|
||||
return DataTable::of($q)
|
||||
->add("action", fn($q) => $q->id)
|
||||
->toJson(true);
|
||||
}
|
||||
public function get_datatable_tarifa_preimpresion_maquina(int $tarifa_preimpresion_id)
|
||||
{
|
||||
$m = model(TarifaPreimpresionMaquinaModel::class);
|
||||
$q = $m->queryDatatable($tarifa_preimpresion_id);
|
||||
return DataTable::of($q)
|
||||
->add("action", fn($q) => $q->id)
|
||||
->toJson(true);
|
||||
}
|
||||
public function get_datatable_tarifa_encuadernacion_maquina(int $tarifa_encuadernacion_id)
|
||||
{
|
||||
$m = model(TarifaEncuadernacionMaquinaModel::class);
|
||||
$q = $m->queryDatatable($tarifa_encuadernacion_id);
|
||||
return DataTable::of($q)
|
||||
->add("action", fn($q) => $q->id)
|
||||
->toJson(true);
|
||||
}
|
||||
public function get_datatable_tarifa_extra_maquina(int $tarifa_extra_id)
|
||||
{
|
||||
$m = model(TarifaExtraMaquinaModel::class);
|
||||
$q = $m->queryDatatable($tarifa_extra_id);
|
||||
return DataTable::of($q)
|
||||
->add("action", fn($q) => $q->id)
|
||||
->toJson(true);
|
||||
}
|
||||
}
|
||||
@ -1,4 +1,6 @@
|
||||
<?php namespace App\Controllers\Tarifas;
|
||||
<?php
|
||||
|
||||
namespace App\Controllers\Tarifas;
|
||||
|
||||
|
||||
use App\Controllers\BaseResourceController;
|
||||
@ -130,7 +132,7 @@ class Tarifasmanipulado extends \App\Controllers\BaseResourceController
|
||||
|
||||
$this->viewData['tarifaManipuladoEntity'] = isset($sanitizedData) ? new TarifaManipuladoEntity($sanitizedData) : new TarifaManipuladoEntity();
|
||||
|
||||
$this->viewData['formAction'] = site_url('tarifas/tarifasmanipulado/add');//route_to('createTarifaManipulado');
|
||||
$this->viewData['formAction'] = site_url('tarifas/tarifasmanipulado/add'); //route_to('createTarifaManipulado');
|
||||
|
||||
$this->viewData['boxTitle'] = lang('Basic.global.addNew') . ' ' . lang('Tarifamanipulado.moduleTitle') . ' ' . lang('Basic.global.addNewSuffix');
|
||||
|
||||
@ -153,7 +155,7 @@ class Tarifasmanipulado extends \App\Controllers\BaseResourceController
|
||||
$message = lang('Basic.global.notFoundWithIdErr', [mb_strtolower(lang('Tarifamanipulado.tarifamanipulado')), $id]);
|
||||
return $this->redirect2listView('sweet-error', $message);
|
||||
endif;
|
||||
|
||||
|
||||
|
||||
if ($this->request->getPost()) :
|
||||
|
||||
@ -293,5 +295,19 @@ class Tarifasmanipulado extends \App\Controllers\BaseResourceController
|
||||
return $this->failUnauthorized('Invalid request', 403);
|
||||
}
|
||||
}
|
||||
public function show_select()
|
||||
{
|
||||
$query = $this->model->builder()
|
||||
->select(
|
||||
["id", "nombre as name", "code as description"]
|
||||
)
|
||||
->where("deleted_at", null);
|
||||
|
||||
if ($this->request->getGet("q")) {
|
||||
$query->groupStart()
|
||||
->orLike("nombre", $this->request->getGet("q"))
|
||||
->groupEnd();
|
||||
}
|
||||
return $this->response->setJSON($query->get()->getResultObject());
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,68 @@
|
||||
<?php
|
||||
|
||||
namespace App\Database\Migrations;
|
||||
|
||||
use CodeIgniter\Database\Migration;
|
||||
use CodeIgniter\Database\RawSql;
|
||||
|
||||
class ServicioClienteTareas extends Migration
|
||||
{
|
||||
protected array $COLUMNS = [
|
||||
"id" => [
|
||||
"type" => "INT",
|
||||
"unsigned" => true,
|
||||
"auto_increment" => true
|
||||
],
|
||||
"servicio_cliente_id" => [
|
||||
"type" => "INT",
|
||||
"unsigned" => true,
|
||||
"comment" => "Servicio cliente asociado"
|
||||
],
|
||||
"tarifa_acabado_id" => [
|
||||
"type" => "INT",
|
||||
"unsigned" => true,
|
||||
"null" => true,
|
||||
"comment" => "Tarifa de acabado asociada a servicio"
|
||||
],
|
||||
"tarifa_manipulado_id" => [
|
||||
"type" => "INT",
|
||||
"unsigned" => true,
|
||||
"null" => true,
|
||||
"comment" => "Tarifa de manipulado asociada a servicio",
|
||||
|
||||
]
|
||||
];
|
||||
public function up()
|
||||
{
|
||||
$this->forge->addField($this->COLUMNS);
|
||||
$currenttime = new RawSql("CURRENT_TIMESTAMP");
|
||||
$this->forge->addField([
|
||||
"created_at" => [
|
||||
"type" => "TIMESTAMP",
|
||||
"default" => $currenttime,
|
||||
|
||||
],
|
||||
"updated_at" => [
|
||||
"type" => "TIMESTAMP",
|
||||
"null" => true,
|
||||
|
||||
],
|
||||
"deleted_at" => [
|
||||
"type" => "TIMESTAMP",
|
||||
"null" => true,
|
||||
|
||||
],
|
||||
]);
|
||||
$this->forge->addPrimaryKey("id");
|
||||
$this->forge->addForeignKey('servicio_cliente_id','servicios_cliente','id');
|
||||
$this->forge->addForeignKey('tarifa_acabado_id','lg_tarifa_acabado','id');
|
||||
$this->forge->addForeignKey('tarifa_manipulado_id','lg_tarifa_manipulado','id');
|
||||
|
||||
$this->forge->createTable("servicio_cliente_tareas", true);
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->forge->dropTable("servicio_cliente_tareas");
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,161 @@
|
||||
<?php
|
||||
|
||||
namespace App\Database\Migrations;
|
||||
|
||||
use CodeIgniter\Database\Migration;
|
||||
use CodeIgniter\Database\RawSql;
|
||||
|
||||
class OrdenTrabajoTable extends Migration
|
||||
{
|
||||
protected array $COLUMNS = [
|
||||
"id" => [
|
||||
"type" => "INT",
|
||||
"unsigned" => true,
|
||||
"auto_increment" => true
|
||||
],
|
||||
"pedido_id" => [
|
||||
"type" => "INT",
|
||||
"unsigned" => true,
|
||||
"constraint" => 16,
|
||||
"comment" => "Pedido original asociado",
|
||||
],
|
||||
"user_created_id" => [
|
||||
"type" => "INT",
|
||||
"unsigned" => true,
|
||||
"constraint" => 10,
|
||||
"comment" => "Usuario que ha pasado el pedido a producción",
|
||||
],
|
||||
|
||||
"user_updated_id" => [
|
||||
"type" => "INT",
|
||||
"unsigned" => true,
|
||||
"constraint" => 10,
|
||||
"comment" => "Usuario que ha actualizado la orden de trabajo",
|
||||
|
||||
],
|
||||
"fecha_entrega_warning" => [
|
||||
"type" => "BOOLEAN",
|
||||
"default" => false
|
||||
],
|
||||
"fecha_entrega_warning_revised" => [
|
||||
"type" => "BOOLEAN",
|
||||
"default" => false
|
||||
],
|
||||
"total_tirada" => [
|
||||
"type" => "DOUBLE",
|
||||
"null" => true
|
||||
],
|
||||
"total_precio" => [
|
||||
"type" => "DOUBLE",
|
||||
"null" => true
|
||||
],
|
||||
"tipo_entrada" => [
|
||||
"type" => "ENUM",
|
||||
"constraint" => ["in", "out"],
|
||||
"default" => "out",
|
||||
"comment" => "Tipo de entrada"
|
||||
],
|
||||
|
||||
"progreso" => [
|
||||
"type" => "DOUBLE",
|
||||
"default" => 0.00,
|
||||
"comment" => "Progreso de 0 a 100"
|
||||
],
|
||||
|
||||
"estado" => [
|
||||
"type" => "ENUM",
|
||||
"constraint" => ["I", "F", "E","PM"],
|
||||
"default" => "I",
|
||||
"comment" => "I => INICIADO, F => FINALIZADO, P => PENDIENTE , PM=> PENDIENTE_MATERIAL , E => ERROR"
|
||||
],
|
||||
/**============================================
|
||||
* PREIMPRESION
|
||||
*=============================================**/
|
||||
"revisar_formato" => [
|
||||
"type" => "BOOLEAN",
|
||||
"default" => false,
|
||||
"comment" => "Realizar revision del formato"
|
||||
],
|
||||
"revisar_lomo" => [
|
||||
"type" => "BOOLEAN",
|
||||
"default" => false,
|
||||
"comment" => "Realizar revision del lomo"
|
||||
],
|
||||
"revisar_solapa" => [
|
||||
"type" => "BOOLEAN",
|
||||
"default" => false,
|
||||
"comment" => "Realizar revision de la solapa"
|
||||
|
||||
],
|
||||
"revisar_isbn" => [
|
||||
"type" => "BOOLEAN",
|
||||
"default" => false,
|
||||
"comment" => "Realizar revision del ISBN"
|
||||
|
||||
],
|
||||
"revisar_codigo_barras" => [
|
||||
"type" => "BOOLEAN",
|
||||
"default" => false,
|
||||
"comment" => "Realizar revision del codigo de barras"
|
||||
|
||||
],
|
||||
"realizar_imposicion" => [
|
||||
"type" => "BOOLEAN",
|
||||
"default" => false,
|
||||
"comment" => "Realizar revision imposicion"
|
||||
|
||||
],
|
||||
"enviar_impresion" => [
|
||||
"type" => "BOOLEAN",
|
||||
"default" => false,
|
||||
"comment" => "Realizar revision impresion"
|
||||
|
||||
],
|
||||
"portada_path" => [
|
||||
"type" => "TEXT",
|
||||
"default" => null,
|
||||
"null" => true,
|
||||
"comment" => "Path al archivo de portada"
|
||||
|
||||
],
|
||||
"comentarios" => [
|
||||
"type" => "TEXT",
|
||||
"null" => true,
|
||||
"default" => null,
|
||||
"comment" => "Comentarios orden de trabajo"
|
||||
]
|
||||
];
|
||||
public function up()
|
||||
{
|
||||
$this->forge->addField($this->COLUMNS);
|
||||
$currenttime = new RawSql("CURRENT_TIMESTAMP");
|
||||
$this->forge->addField([
|
||||
"created_at" => [
|
||||
"type" => "TIMESTAMP",
|
||||
"default" => $currenttime,
|
||||
|
||||
],
|
||||
"updated_at" => [
|
||||
"type" => "TIMESTAMP",
|
||||
"null" => true,
|
||||
|
||||
],
|
||||
"deleted_at" => [
|
||||
"type" => "TIMESTAMP",
|
||||
"null" => true,
|
||||
|
||||
],
|
||||
]);
|
||||
$this->forge->addPrimaryKey("id");
|
||||
$this->forge->addForeignKey("pedido_id", "pedidos", "id");
|
||||
$this->forge->addForeignKey("user_created_id", "users", "id");
|
||||
$this->forge->addForeignKey("user_updated_id", "users", "id");
|
||||
|
||||
$this->forge->createTable("ordenes_trabajo", true);
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->forge->dropTable("ordenes_trabajo");
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,147 @@
|
||||
<?php
|
||||
|
||||
namespace App\Database\Migrations;
|
||||
|
||||
use CodeIgniter\Database\Migration;
|
||||
use CodeIgniter\Database\RawSql;
|
||||
|
||||
class OrdenTrabajoTareasTable extends Migration
|
||||
{
|
||||
protected array $COLUMNS = [
|
||||
"id" => [
|
||||
"type" => "INT",
|
||||
"unsigned" => true,
|
||||
"auto_increment" => true
|
||||
],
|
||||
"orden_trabajo_id" => [
|
||||
"type" => "INT",
|
||||
"unsigned" => true,
|
||||
"constraint" => 10,
|
||||
"comment" => "Orden de trabajo a la que pertenece esta tarea",
|
||||
|
||||
],
|
||||
"presupuesto_linea_id" => [
|
||||
"type" => "INT",
|
||||
"unsigned" => true,
|
||||
"constraint" => 10,
|
||||
"null" => true,
|
||||
"comment" => "Presupuesto linea asociada a esta tarea. Puede ser NULL porque se podría añadir una tarea manual",
|
||||
],
|
||||
"presupuesto_acabado_id" => [
|
||||
"type" => "INT",
|
||||
"unsigned" => true,
|
||||
"constraint" => 10,
|
||||
"null" => true,
|
||||
"comment" => "Presupuesto linea asociada a esta tarea. Puede ser NULL porque se podría añadir una tarea manual",
|
||||
],
|
||||
"presupuesto_preimpresion_id" => [
|
||||
"type" => "INT",
|
||||
"unsigned" => true,
|
||||
"constraint" => 10,
|
||||
"null" => true,
|
||||
"comment" => "Presupuesto linea asociada a esta tarea. Puede ser NULL porque se podría añadir una tarea manual",
|
||||
],
|
||||
"presupuesto_encuadernado_id" => [
|
||||
"type" => "INT",
|
||||
"unsigned" => true,
|
||||
"constraint" => 10,
|
||||
"null" => true,
|
||||
"comment" => "Presupuesto linea asociada a esta tarea. Puede ser NULL porque se podría añadir una tarea manual",
|
||||
],
|
||||
"presupuesto_manipulado_id" => [
|
||||
"type" => "INT",
|
||||
"unsigned" => true,
|
||||
"constraint" => 10,
|
||||
"null" => true,
|
||||
"comment" => "Presupuesto linea asociada a esta tarea. Puede ser NULL porque se podría añadir una tarea manual",
|
||||
],
|
||||
"presupuesto_extra_id" => [
|
||||
"type" => "INT",
|
||||
"unsigned" => true,
|
||||
"constraint" => 10,
|
||||
"null" => true,
|
||||
"comment" => "Presupuesto linea asociada a esta tarea. Puede ser NULL porque se podría añadir una tarea manual",
|
||||
],
|
||||
"nombre" => [
|
||||
"type" => "VARCHAR",
|
||||
"constraint" => 255,
|
||||
"comment" => "Nombre de la tarea",
|
||||
],
|
||||
"orden" => [
|
||||
"type" => "INT",
|
||||
"unsigned" => true,
|
||||
"comment" => "Orden de ejecución del tarea. Por defecto el orden será la de la máquina asociada a la línea de presupuesto."
|
||||
],
|
||||
"maquina_id" =>
|
||||
[
|
||||
"type" => "INT",
|
||||
"unsigned" => true,
|
||||
"constraint" => 10,
|
||||
"null" => true,
|
||||
"comment" => "Máquina asociada a la tarea. Por defecto será la asociada a la linea de presupuesto"
|
||||
],
|
||||
"imposicion_id" => [
|
||||
"type" => "INT",
|
||||
"null" => true,
|
||||
"constraint" => 11,
|
||||
"default" => null,
|
||||
"comment" => "Imposicion aplicada a la tarea. Default null"
|
||||
|
||||
],
|
||||
"tiempo_estimado" => [
|
||||
"type" => "DOUBLE",
|
||||
"default" => 0.00,
|
||||
"null" => true,
|
||||
"comment" => "Tiempo ejecución estimado de la tarea en minutos",
|
||||
],
|
||||
"tiempo_real" => [
|
||||
"type" => "DOUBLE",
|
||||
"default" => 0.00,
|
||||
"null" => true,
|
||||
"comment" => "Tiempo ejecución real de la tarea",
|
||||
],
|
||||
"comment" => [
|
||||
"type" => "TEXT",
|
||||
"null" => true,
|
||||
"comment" => "Comentario sobre la tarea",
|
||||
]
|
||||
];
|
||||
public function up()
|
||||
{
|
||||
$this->forge->addField($this->COLUMNS);
|
||||
$currenttime = new RawSql("CURRENT_TIMESTAMP");
|
||||
$this->forge->addField([
|
||||
"created_at" => [
|
||||
"type" => "TIMESTAMP",
|
||||
"default" => $currenttime,
|
||||
|
||||
],
|
||||
"updated_at" => [
|
||||
"type" => "TIMESTAMP",
|
||||
"null" => true,
|
||||
|
||||
],
|
||||
"deleted_at" => [
|
||||
"type" => "TIMESTAMP",
|
||||
"null" => true,
|
||||
],
|
||||
]);
|
||||
$this->forge->addPrimaryKey("id");
|
||||
$this->forge->addForeignKey("orden_trabajo_id","ordenes_trabajo","id","CASCADE","CASCADE");
|
||||
$this->forge->addForeignKey("presupuesto_linea_id","presupuesto_linea","id");
|
||||
$this->forge->addForeignKey("presupuesto_acabado_id","presupuesto_acabados","id");
|
||||
$this->forge->addForeignKey("presupuesto_encuadernado_id","presupuesto_encuadernaciones","id");
|
||||
$this->forge->addForeignKey("presupuesto_manipulado_id","presupuesto_manipulados","id");
|
||||
$this->forge->addForeignKey("presupuesto_preimpresion_id","presupuesto_preimpresiones","id");
|
||||
$this->forge->addForeignKey("presupuesto_extra_id","presupuesto_serviciosExtra","id");
|
||||
$this->forge->addForeignKey("imposicion_id","lg_imposiciones","id");
|
||||
$this->forge->addForeignKey("maquina_id","lg_maquinas","id");
|
||||
$this->forge->createTable("orden_trabajo_tareas");
|
||||
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->forge->dropTable("orden_trabajo_tareas",true);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,166 @@
|
||||
<?php
|
||||
|
||||
namespace App\Database\Migrations;
|
||||
|
||||
use CodeIgniter\Database\Migration;
|
||||
use CodeIgniter\Database\RawSql;
|
||||
|
||||
class OrdenTrabajoDatesTable extends Migration
|
||||
{
|
||||
protected array $COLUMNS = [
|
||||
"orden_trabajo_id" => [
|
||||
"type" => "INT",
|
||||
"unsigned" => true,
|
||||
],
|
||||
"fecha_entrada_at" => [
|
||||
"type" => "DATE",
|
||||
"null" => true,
|
||||
],
|
||||
"fecha_entrega_at" => [
|
||||
"type" => "DATE",
|
||||
"null" => true,
|
||||
],
|
||||
"fecha_entrega_change_at" => [
|
||||
"type" => "DATE",
|
||||
"null" => true,
|
||||
],
|
||||
|
||||
"fecha_entrega_real_at" => [
|
||||
"type" => "DATE",
|
||||
"null" => true,
|
||||
],
|
||||
|
||||
"fecha_impresion_at" => [
|
||||
"type" => "DATE",
|
||||
"null" => true,
|
||||
],
|
||||
"fecha_encuadernado_at" => [
|
||||
"type" => "DATE",
|
||||
"null" => true,
|
||||
],
|
||||
"fecha_entrega_externo" => [
|
||||
"type" => "DATE",
|
||||
"null" => true,
|
||||
],
|
||||
|
||||
"pendiente_ferro_at" => [
|
||||
"type" => "DATE",
|
||||
"null" => true,
|
||||
],
|
||||
"ferro_en_cliente_at" => [
|
||||
"type" => "DATE",
|
||||
"null" => true,
|
||||
],
|
||||
"ferro_ok_at" => [
|
||||
"type" => "DATE",
|
||||
"null" => true,
|
||||
],
|
||||
"interior_bn_at" => [
|
||||
"type" => "DATE",
|
||||
"null" => true,
|
||||
],
|
||||
"interior_color_at" => [
|
||||
"type" => "DATE",
|
||||
"null" => true,
|
||||
],
|
||||
"preparacion_interiores_at" => [
|
||||
"type" => "DATE",
|
||||
"null" => true,
|
||||
],
|
||||
"cubierta_at" => [
|
||||
"type" => "DATE",
|
||||
"null" => true,
|
||||
],
|
||||
"plastificado_at" => [
|
||||
"type" => "DATE",
|
||||
"null" => true,
|
||||
],
|
||||
"encuadernacion_at" => [
|
||||
"type" => "DATE",
|
||||
"null" => true,
|
||||
],
|
||||
"corte_at" => [
|
||||
"type" => "DATE",
|
||||
"null" => true,
|
||||
],
|
||||
"embalaje_at" => [
|
||||
"type" => "DATE",
|
||||
"null" => true,
|
||||
],
|
||||
"envio_at" => [
|
||||
"type" => "DATE",
|
||||
"null" => true,
|
||||
],
|
||||
"entrada_manipulado_at" => [
|
||||
"type" => "DATE",
|
||||
"null" => true,
|
||||
],
|
||||
|
||||
|
||||
"ferro_disponible_hecho_at" => [
|
||||
"type" => "DATE",
|
||||
"null" => true,
|
||||
],
|
||||
|
||||
"ferro_disponible_ok_at" => [
|
||||
"type" => "DATE",
|
||||
"null" => true,
|
||||
],
|
||||
|
||||
"ferro_entregado_at" => [
|
||||
"type" => "DATE",
|
||||
"null" => true,
|
||||
],
|
||||
"pre_formato_at" => [
|
||||
"type" => "DATE",
|
||||
"null" => true,
|
||||
],
|
||||
|
||||
"pre_lomo_at" => [
|
||||
"type" => "DATE",
|
||||
"null" => true,
|
||||
],
|
||||
|
||||
"pre_solapa_at" => [
|
||||
"type" => "DATE",
|
||||
"null" => true,
|
||||
],
|
||||
|
||||
"pre_codbarras_at" => [
|
||||
"type" => "DATE",
|
||||
"null" => true,
|
||||
],
|
||||
|
||||
"pre_imposicion_at" => [
|
||||
"type" => "DATE",
|
||||
"null" => true,
|
||||
],
|
||||
];
|
||||
public function up()
|
||||
{
|
||||
$this->forge->addField($this->COLUMNS);
|
||||
$currenttime = new RawSql("CURRENT_TIMESTAMP");
|
||||
$this->forge->addField([
|
||||
"created_at" => [
|
||||
"type" => "TIMESTAMP",
|
||||
"default" => $currenttime,
|
||||
],
|
||||
"updated_at" => [
|
||||
"type" => "TIMESTAMP",
|
||||
"null" => true,
|
||||
],
|
||||
"deleted_at" => [
|
||||
"type" => "TIMESTAMP",
|
||||
"null" => true,
|
||||
],
|
||||
]);
|
||||
$this->forge->addPrimaryKey('orden_trabajo_id');
|
||||
$this->forge->addForeignKey("orden_trabajo_id","ordenes_trabajo","id","CASCADE","CASCADE");
|
||||
$this->forge->createTable("orden_trabajo_dates", true);
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->forge->dropTable("orden_trabajo_dates");
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,223 @@
|
||||
<?php
|
||||
|
||||
namespace App\Database\Migrations;
|
||||
|
||||
use CodeIgniter\Database\Migration;
|
||||
use CodeIgniter\Database\RawSql;
|
||||
|
||||
class OrdenTrabajoUsers extends Migration
|
||||
{
|
||||
protected array $COLUMNS = [
|
||||
|
||||
"orden_trabajo_id" => [
|
||||
"type" => "INT",
|
||||
"unsigned" => true,
|
||||
],
|
||||
|
||||
"user_created_id" => [
|
||||
"type" => "INT",
|
||||
"unsigned" => true,
|
||||
"constraint" => 10,
|
||||
"null" => true,
|
||||
],
|
||||
"user_update_id" => [
|
||||
"type" => "INT",
|
||||
"unsigned" => true,
|
||||
"constraint" => 10,
|
||||
"null" => true,
|
||||
],
|
||||
"inaplazable_revised_change_user_id" => [
|
||||
"type" => "INT",
|
||||
"unsigned" => true,
|
||||
"constraint" => 10,
|
||||
"null" => true,
|
||||
],
|
||||
|
||||
|
||||
"ferro_disponible_hecho_user_id" => [
|
||||
"type" => "INT",
|
||||
"unsigned" => true,
|
||||
"constraint" => 10,
|
||||
"null" => true,
|
||||
],
|
||||
|
||||
"ferro_disponible_ok_user_id" => [
|
||||
"type" => "INT",
|
||||
"unsigned" => true,
|
||||
"constraint" => 10,
|
||||
"null" => true,
|
||||
],
|
||||
"ferro_entregado_user_id" => [
|
||||
"type" => "INT",
|
||||
"unsigned" => true,
|
||||
"constraint" => 10,
|
||||
"null" => true,
|
||||
],
|
||||
|
||||
"pendiente_ferro_user_id" => [
|
||||
"type" => "INT",
|
||||
"unsigned" => true,
|
||||
"constraint" => 10,
|
||||
"null" => true,
|
||||
],
|
||||
"ferro_en_cliente_user_id" => [
|
||||
"type" => "INT",
|
||||
"unsigned" => true,
|
||||
"constraint" => 10,
|
||||
"null" => true,
|
||||
],
|
||||
"ferro_ok_user_id" => [
|
||||
"type" => "INT",
|
||||
"unsigned" => true,
|
||||
"constraint" => 10,
|
||||
"null" => true,
|
||||
],
|
||||
|
||||
|
||||
|
||||
"interior_bn_user_id" => [
|
||||
"type" => "INT",
|
||||
"unsigned" => true,
|
||||
"constraint" => 10,
|
||||
"null" => true,
|
||||
],
|
||||
"interior_color_user_id" => [
|
||||
"type" => "INT",
|
||||
"unsigned" => true,
|
||||
"constraint" => 10,
|
||||
"null" => true,
|
||||
],
|
||||
"preparacion_interior_user_id" => [
|
||||
"type" => "INT",
|
||||
"unsigned" => true,
|
||||
"constraint" => 10,
|
||||
"null" => true,
|
||||
],
|
||||
"cubierta_user_id" => [
|
||||
"type" => "INT",
|
||||
"unsigned" => true,
|
||||
"constraint" => 10,
|
||||
"null" => true,
|
||||
],
|
||||
"plastificado_user_id" => [
|
||||
"type" => "INT",
|
||||
"unsigned" => true,
|
||||
"constraint" => 10,
|
||||
"null" => true,
|
||||
],
|
||||
"encuadernacion_user_id" => [
|
||||
"type" => "INT",
|
||||
"unsigned" => true,
|
||||
"constraint" => 10,
|
||||
"null" => true,
|
||||
],
|
||||
"corte_user_id" => [
|
||||
"type" => "INT",
|
||||
"unsigned" => true,
|
||||
"constraint" => 10,
|
||||
"null" => true,
|
||||
],
|
||||
"embalaje_user_id" => [
|
||||
"type" => "INT",
|
||||
"unsigned" => true,
|
||||
"constraint" => 10,
|
||||
"null" => true,
|
||||
],
|
||||
"envio_user_id" => [
|
||||
"type" => "INT",
|
||||
"unsigned" => true,
|
||||
"constraint" => 10,
|
||||
"null" => true,
|
||||
],
|
||||
"entrada_manipulado_user_id" => [
|
||||
"type" => "INT",
|
||||
"unsigned" => true,
|
||||
"constraint" => 10,
|
||||
"null" => true,
|
||||
],
|
||||
|
||||
|
||||
"pre_formato_user_id" => [
|
||||
"type" => "INT",
|
||||
"unsigned" => true,
|
||||
"constraint" => 10,
|
||||
"null" => true,
|
||||
],
|
||||
|
||||
|
||||
"pre_lomo_user_id" => [
|
||||
"type" => "INT",
|
||||
"unsigned" => true,
|
||||
"constraint" => 10,
|
||||
"null" => true,
|
||||
],
|
||||
|
||||
"pre_solapa_user_id" => [
|
||||
"type" => "INT",
|
||||
"unsigned" => true,
|
||||
"constraint" => 10,
|
||||
"null" => true,
|
||||
],
|
||||
|
||||
|
||||
"pre_codbarras_user_id" => [
|
||||
"type" => "INT",
|
||||
"unsigned" => true,
|
||||
"constraint" => 10,
|
||||
"null" => true,
|
||||
],
|
||||
|
||||
"pre_imposicion_user_id" => [
|
||||
"type" => "INT",
|
||||
"unsigned" => true,
|
||||
"constraint" => 10,
|
||||
"null" => true,
|
||||
],
|
||||
"pre_imprimir_user_id" => [
|
||||
"type" => "INT",
|
||||
"unsigned" => true,
|
||||
"constraint" => 10,
|
||||
"null" => true,
|
||||
],
|
||||
"pre_imprimir_user_id" => [
|
||||
"type" => "INT",
|
||||
"unsigned" => true,
|
||||
"constraint" => 10,
|
||||
"null" => true,
|
||||
],
|
||||
];
|
||||
public function up()
|
||||
{
|
||||
$this->forge->addField($this->COLUMNS);
|
||||
$currenttime = new RawSql("CURRENT_TIMESTAMP");
|
||||
$this->forge->addField([
|
||||
"created_at" => [
|
||||
"type" => "TIMESTAMP",
|
||||
"default" => $currenttime,
|
||||
|
||||
],
|
||||
"updated_at" => [
|
||||
"type" => "TIMESTAMP",
|
||||
"null" => true,
|
||||
|
||||
],
|
||||
"deleted_at" => [
|
||||
"type" => "TIMESTAMP",
|
||||
"null" => true,
|
||||
|
||||
],
|
||||
]);
|
||||
foreach ($this->COLUMNS as $key => $value) {
|
||||
$this->forge->addForeignKey([$key],"users",["id"]);
|
||||
}
|
||||
$this->forge->addPrimaryKey("orden_trabajo_id");
|
||||
// $this->forge->addForeignKey(["ordenes_trabajo_id"],"ordenes_trabajo",["id"]);
|
||||
$this->forge->createTable("orden_trabajo_users", true);
|
||||
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->forge->dropTable("orden_trabajo_users");
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,77 @@
|
||||
<?php
|
||||
|
||||
namespace App\Database\Migrations;
|
||||
|
||||
use CodeIgniter\Database\Migration;
|
||||
use CodeIgniter\Database\RawSql;
|
||||
|
||||
class OrdenTrabajoMaquetacionesTable extends Migration
|
||||
{
|
||||
protected array $COLUMNS = [
|
||||
"id" => [
|
||||
"type" => "INT",
|
||||
"unsigned" => true,
|
||||
"auto_increment" => true
|
||||
],
|
||||
"pedido_maquetacion_id" => [
|
||||
"type" => "INT",
|
||||
"unsigned" => true,
|
||||
"constraint" => 10,
|
||||
],
|
||||
"user_created_id" => [
|
||||
"type" => "INT",
|
||||
"unsigned" => true,
|
||||
"constraint" => 10,
|
||||
],
|
||||
"user_update_id" => [
|
||||
"type" => "INT",
|
||||
"unsigned" => true,
|
||||
"constraint" => 10,
|
||||
],
|
||||
"entrada_at" => [
|
||||
"type" => "DATETIME",
|
||||
"default" => null
|
||||
],
|
||||
"salida_at" => [
|
||||
"type" => "DATETIME",
|
||||
"default" => null
|
||||
],
|
||||
"progreso" => [
|
||||
"type" => "DOUBLE",
|
||||
"default" => 0
|
||||
],
|
||||
"finalizado" => [
|
||||
"type" => "BOOLEAN",
|
||||
"default" => 0
|
||||
]
|
||||
];
|
||||
public function up()
|
||||
{
|
||||
$this->forge->addField($this->COLUMNS);
|
||||
$currenttime = new RawSql("CURRENT_TIMESTAMP");
|
||||
$this->forge->addField([
|
||||
"created_at" => [
|
||||
"type" => "TIMESTAMP",
|
||||
"default" => $currenttime,
|
||||
|
||||
],
|
||||
"updated_at" => [
|
||||
"type" => "TIMESTAMP",
|
||||
"null" => true,
|
||||
|
||||
],
|
||||
"deleted_at" => [
|
||||
"type" => "TIMESTAMP",
|
||||
"null" => true,
|
||||
|
||||
],
|
||||
]);
|
||||
$this->forge->addPrimaryKey("id");
|
||||
$this->forge->createTable("orden_trabajo_maquetaciones", true);
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->forge->dropTable("orden_trabajo_maquetaciones");
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,63 @@
|
||||
<?php
|
||||
|
||||
namespace App\Database\Migrations;
|
||||
|
||||
use CodeIgniter\Database\Migration;
|
||||
use CodeIgniter\Database\RawSql;
|
||||
|
||||
class OrdenTrabajoMaquetacionMovimientosTable extends Migration
|
||||
{
|
||||
protected array $COLUMNS = [
|
||||
"id" => [
|
||||
"type" => "INT",
|
||||
"unsigned" => true,
|
||||
"auto_increment" => true
|
||||
],
|
||||
"orden_trabajo_maquetacion_id" => [
|
||||
"type" => "INT",
|
||||
"unsigned" => true,
|
||||
"null" => true,
|
||||
|
||||
],
|
||||
"orden_trabajo_maquetacion_id" => [
|
||||
"type" => "INT",
|
||||
"unsigned" => true,
|
||||
"null" => true,
|
||||
|
||||
],
|
||||
"file_id" => [
|
||||
"type" => "INT",
|
||||
"unsigned" => true,
|
||||
"null" => true,
|
||||
],
|
||||
];
|
||||
public function up()
|
||||
{
|
||||
$this->forge->addField($this->COLUMNS);
|
||||
$currenttime = new RawSql("CURRENT_TIMESTAMP");
|
||||
$this->forge->addField([
|
||||
"created_at" => [
|
||||
"type" => "TIMESTAMP",
|
||||
"default" => $currenttime,
|
||||
|
||||
],
|
||||
"updated_at" => [
|
||||
"type" => "TIMESTAMP",
|
||||
"null" => true,
|
||||
|
||||
],
|
||||
"deleted_at" => [
|
||||
"type" => "TIMESTAMP",
|
||||
"null" => true,
|
||||
|
||||
],
|
||||
]);
|
||||
$this->forge->addPrimaryKey("id");
|
||||
$this->forge->createTable("orden_trabajo_maquetacion_movimientos", true);
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->forge->dropTable("orden_trabajo_maquetacion_movimientos");
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace App\Database\Migrations;
|
||||
|
||||
use CodeIgniter\Database\Migration;
|
||||
|
||||
class AlterColumnServiciosCliente extends Migration
|
||||
{
|
||||
protected array $ALTER_COLUMNS = [
|
||||
"deleted_at" => [
|
||||
"name" => "deleted_at",
|
||||
"type" => "datetime",
|
||||
"default" => null,
|
||||
"null" => true,
|
||||
],
|
||||
"updated_at" => [
|
||||
"name" => "updated_at",
|
||||
"type" => "datetime",
|
||||
"default" => null,
|
||||
"null" => true,
|
||||
],
|
||||
];
|
||||
public function up()
|
||||
{
|
||||
$this->forge->modifyColumn("servicios_cliente", $this->ALTER_COLUMNS);
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->forge->addField([
|
||||
"is_deleted" => [
|
||||
"type" => "boolean",
|
||||
"default" => false,
|
||||
"null" => false,
|
||||
]
|
||||
]);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
namespace App\Database\Migrations;
|
||||
|
||||
use CodeIgniter\Database\Migration;
|
||||
use CodeIgniter\Database\RawSql;
|
||||
|
||||
class MaquinaTareasTable extends Migration
|
||||
{
|
||||
protected array $COLUMNS = [
|
||||
'id' => [
|
||||
'type' => 'INT',
|
||||
'unsigned' => true,
|
||||
'auto_increment' => true,
|
||||
],
|
||||
'name' => [
|
||||
'type' => 'VARCHAR',
|
||||
'constraint' => 255,
|
||||
],
|
||||
'description' => [
|
||||
'type' => 'LONGTEXT',
|
||||
'default' => null,
|
||||
'null' => true
|
||||
]
|
||||
];
|
||||
public function up()
|
||||
{
|
||||
$this->forge->addField($this->COLUMNS);
|
||||
$currenttime = new RawSql('CURRENT_TIMESTAMP');
|
||||
$this->forge->addField([
|
||||
'created_at' => [
|
||||
'type' => 'TIMESTAMP',
|
||||
'default' => $currenttime,
|
||||
|
||||
],
|
||||
'updated_at' => [
|
||||
'type' => 'TIMESTAMP',
|
||||
'null' => true,
|
||||
|
||||
],
|
||||
'deleted_at' => [
|
||||
'type' => 'TIMESTAMP',
|
||||
'null' => true,
|
||||
|
||||
],
|
||||
]);
|
||||
$this->forge->addPrimaryKey('id');
|
||||
$this->forge->createTable("maquina_tareas");
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->forge->dropTable("maquina_tareas");
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,64 @@
|
||||
<?php
|
||||
|
||||
namespace App\Database\Migrations;
|
||||
|
||||
use CodeIgniter\Database\Migration;
|
||||
use CodeIgniter\Database\RawSql;
|
||||
|
||||
class TarifaAcabadoMaquinaTable extends Migration
|
||||
{
|
||||
protected array $COLUMNS = [
|
||||
'id' => [
|
||||
'type' => 'INT',
|
||||
'unsigned' => true,
|
||||
'auto_increment' => true,
|
||||
],
|
||||
'tarifa_acabado_id' => [
|
||||
'type' => 'INT',
|
||||
'unsigned' => true,
|
||||
'constraint' => 10,
|
||||
],
|
||||
'maquina_id' => [
|
||||
'type' => 'INT',
|
||||
'unsigned' => true,
|
||||
'constraint' => 10,
|
||||
],
|
||||
'maquina_tarea_id' => [
|
||||
'type' => 'INT',
|
||||
'unsigned' => true,
|
||||
'constraint' => 10,
|
||||
]
|
||||
|
||||
];
|
||||
public function up()
|
||||
{
|
||||
$this->forge->addField($this->COLUMNS);
|
||||
$currenttime = new RawSql('CURRENT_TIMESTAMP');
|
||||
$this->forge->addField([
|
||||
'created_at' => [
|
||||
'type' => 'TIMESTAMP',
|
||||
'default' => $currenttime,
|
||||
|
||||
],
|
||||
'updated_at' => [
|
||||
'type' => 'TIMESTAMP',
|
||||
'null' => true,
|
||||
|
||||
],
|
||||
'deleted_at' => [
|
||||
'type' => 'TIMESTAMP',
|
||||
'null' => true,
|
||||
|
||||
],
|
||||
]);
|
||||
$this->forge->addPrimaryKey('id');
|
||||
$this->forge->addForeignKey('tarifa_acabado_id','lg_tarifa_acabado','id');
|
||||
$this->forge->addForeignKey('maquina_tarea_id','maquina_tareas','id');
|
||||
$this->forge->createTable("tarifa_acabado_maquinas");
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->forge->dropTable("tarifa_acabado_maquinas");
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,64 @@
|
||||
<?php
|
||||
|
||||
namespace App\Database\Migrations;
|
||||
|
||||
use CodeIgniter\Database\Migration;
|
||||
use CodeIgniter\Database\RawSql;
|
||||
|
||||
class TarifaManipuladoMaquinaTable extends Migration
|
||||
{
|
||||
protected array $COLUMNS = [
|
||||
'id' => [
|
||||
'type' => 'INT',
|
||||
'unsigned' => true,
|
||||
'auto_increment' => true,
|
||||
],
|
||||
'tarifa_manipulado_id' => [
|
||||
'type' => 'INT',
|
||||
'unsigned' => true,
|
||||
'constraint' => 10,
|
||||
],
|
||||
'maquina_id' => [
|
||||
'type' => 'INT',
|
||||
'unsigned' => true,
|
||||
'constraint' => 10,
|
||||
],
|
||||
'maquina_tarea_id' => [
|
||||
'type' => 'INT',
|
||||
'unsigned' => true,
|
||||
'constraint' => 10,
|
||||
]
|
||||
|
||||
];
|
||||
public function up()
|
||||
{
|
||||
$this->forge->addField($this->COLUMNS);
|
||||
$currenttime = new RawSql('CURRENT_TIMESTAMP');
|
||||
$this->forge->addField([
|
||||
'created_at' => [
|
||||
'type' => 'TIMESTAMP',
|
||||
'default' => $currenttime,
|
||||
|
||||
],
|
||||
'updated_at' => [
|
||||
'type' => 'TIMESTAMP',
|
||||
'null' => true,
|
||||
|
||||
],
|
||||
'deleted_at' => [
|
||||
'type' => 'TIMESTAMP',
|
||||
'null' => true,
|
||||
|
||||
],
|
||||
]);
|
||||
$this->forge->addPrimaryKey('id');
|
||||
$this->forge->addForeignKey('tarifa_manipulado_id','lg_tarifa_manipulado','id');
|
||||
$this->forge->addForeignKey('maquina_tarea_id','maquina_tareas','id');
|
||||
$this->forge->createTable("tarifa_manipulado_maquinas");
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->forge->dropTable("tarifa_manipulado_maquinas");
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,65 @@
|
||||
<?php
|
||||
|
||||
namespace App\Database\Migrations;
|
||||
|
||||
use CodeIgniter\Database\Migration;
|
||||
use CodeIgniter\Database\RawSql;
|
||||
|
||||
class TarifaPreimpresionMaquinaTable extends Migration
|
||||
{
|
||||
protected array $COLUMNS = [
|
||||
|
||||
'id' => [
|
||||
'type' => 'INT',
|
||||
'unsigned' => true,
|
||||
'auto_increment' => true,
|
||||
],
|
||||
'tarifa_preimpresion_id' => [
|
||||
'type' => 'INT',
|
||||
'unsigned' => true,
|
||||
'constraint' => 10,
|
||||
],
|
||||
'maquina_id' => [
|
||||
'type' => 'INT',
|
||||
'unsigned' => true,
|
||||
'constraint' => 10,
|
||||
],
|
||||
'maquina_tarea_id' => [
|
||||
'type' => 'INT',
|
||||
'unsigned' => true,
|
||||
'constraint' => 10,
|
||||
]
|
||||
|
||||
];
|
||||
public function up()
|
||||
{
|
||||
$this->forge->addField($this->COLUMNS);
|
||||
$currenttime = new RawSql('CURRENT_TIMESTAMP');
|
||||
$this->forge->addField([
|
||||
'created_at' => [
|
||||
'type' => 'TIMESTAMP',
|
||||
'default' => $currenttime,
|
||||
|
||||
],
|
||||
'updated_at' => [
|
||||
'type' => 'TIMESTAMP',
|
||||
'null' => true,
|
||||
|
||||
],
|
||||
'deleted_at' => [
|
||||
'type' => 'TIMESTAMP',
|
||||
'null' => true,
|
||||
|
||||
],
|
||||
]);
|
||||
$this->forge->addPrimaryKey('id');
|
||||
$this->forge->addForeignKey('tarifa_preimpresion_id','lg_tarifa_preimpresion','id');
|
||||
$this->forge->addForeignKey('maquina_tarea_id','maquina_tareas','id');
|
||||
$this->forge->createTable("tarifa_preimpresion_maquinas");
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->forge->dropTable("tarifa_preimpresion_maquinas");
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,65 @@
|
||||
<?php
|
||||
|
||||
namespace App\Database\Migrations;
|
||||
|
||||
use CodeIgniter\Database\Migration;
|
||||
use CodeIgniter\Database\RawSql;
|
||||
|
||||
class TarifaEncuadernacionMaquinaTable extends Migration
|
||||
{
|
||||
protected array $COLUMNS = [
|
||||
|
||||
'id' => [
|
||||
'type' => 'INT',
|
||||
'unsigned' => true,
|
||||
'auto_increment' => true,
|
||||
],
|
||||
'tarifa_encuadernacion_id' => [
|
||||
'type' => 'INT',
|
||||
'unsigned' => true,
|
||||
'constraint' => 10,
|
||||
],
|
||||
'maquina_id' => [
|
||||
'type' => 'INT',
|
||||
'unsigned' => true,
|
||||
'constraint' => 10,
|
||||
],
|
||||
'maquina_tarea_id' => [
|
||||
'type' => 'INT',
|
||||
'unsigned' => true,
|
||||
'constraint' => 10,
|
||||
]
|
||||
|
||||
];
|
||||
public function up()
|
||||
{
|
||||
$this->forge->addField($this->COLUMNS);
|
||||
$currenttime = new RawSql('CURRENT_TIMESTAMP');
|
||||
$this->forge->addField([
|
||||
'created_at' => [
|
||||
'type' => 'TIMESTAMP',
|
||||
'default' => $currenttime,
|
||||
|
||||
],
|
||||
'updated_at' => [
|
||||
'type' => 'TIMESTAMP',
|
||||
'null' => true,
|
||||
|
||||
],
|
||||
'deleted_at' => [
|
||||
'type' => 'TIMESTAMP',
|
||||
'null' => true,
|
||||
|
||||
],
|
||||
]);
|
||||
$this->forge->addPrimaryKey('id');
|
||||
$this->forge->addForeignKey('tarifa_encuadernacion_id','tarifa_encuadernacion','id');
|
||||
$this->forge->addForeignKey('maquina_tarea_id','maquina_tareas','id');
|
||||
$this->forge->createTable("tarifa_encuadernacion_maquinas");
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->forge->dropTable("tarifa_encuadernacion_maquinas");
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,65 @@
|
||||
<?php
|
||||
|
||||
namespace App\Database\Migrations;
|
||||
|
||||
use CodeIgniter\Database\Migration;
|
||||
use CodeIgniter\Database\RawSql;
|
||||
|
||||
class TarifaExtraMaquinaTable extends Migration
|
||||
{
|
||||
protected array $COLUMNS = [
|
||||
|
||||
'id' => [
|
||||
'type' => 'INT',
|
||||
'unsigned' => true,
|
||||
'auto_increment' => true,
|
||||
],
|
||||
'tarifa_extra_id' => [
|
||||
'type' => 'INT',
|
||||
'unsigned' => true,
|
||||
'constraint' => 10,
|
||||
],
|
||||
'maquina_id' => [
|
||||
'type' => 'INT',
|
||||
'unsigned' => true,
|
||||
'constraint' => 10,
|
||||
],
|
||||
'maquina_tarea_id' => [
|
||||
'type' => 'INT',
|
||||
'unsigned' => true,
|
||||
'constraint' => 10,
|
||||
]
|
||||
|
||||
];
|
||||
public function up()
|
||||
{
|
||||
$this->forge->addField($this->COLUMNS);
|
||||
$currenttime = new RawSql('CURRENT_TIMESTAMP');
|
||||
$this->forge->addField([
|
||||
'created_at' => [
|
||||
'type' => 'TIMESTAMP',
|
||||
'default' => $currenttime,
|
||||
|
||||
],
|
||||
'updated_at' => [
|
||||
'type' => 'TIMESTAMP',
|
||||
'null' => true,
|
||||
|
||||
],
|
||||
'deleted_at' => [
|
||||
'type' => 'TIMESTAMP',
|
||||
'null' => true,
|
||||
|
||||
],
|
||||
]);
|
||||
$this->forge->addPrimaryKey('id');
|
||||
$this->forge->addForeignKey('tarifa_extra_id','tarifa_extra','id');
|
||||
$this->forge->addForeignKey('maquina_tarea_id','maquina_tareas','id');
|
||||
$this->forge->createTable("tarifa_extra_maquinas");
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->forge->dropTable("tarifa_extra_maquinas");
|
||||
}
|
||||
}
|
||||
49
ci4/app/Database/Seeds/MaquinaTareaSeeder.php
Normal file
49
ci4/app/Database/Seeds/MaquinaTareaSeeder.php
Normal file
@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
namespace App\Database\Seeds;
|
||||
|
||||
use App\Models\Configuracion\MaquinaTareaModel;
|
||||
use CodeIgniter\Database\Seeder;
|
||||
|
||||
class MaquinaTareaSeeder extends Seeder
|
||||
{
|
||||
public function run()
|
||||
{
|
||||
$m = model(MaquinaTareaModel::class);
|
||||
$data = [
|
||||
[
|
||||
"name" => "Grapar",
|
||||
"description" => "Grapar (acabado)"
|
||||
],
|
||||
[
|
||||
"name" => "Preparación en guillotina",
|
||||
"description" => "Guillotina (manipulado)"
|
||||
],
|
||||
[
|
||||
"name" => "Espiral",
|
||||
"description" => "Perforadora Wire-o/Espiral (manipulado)"
|
||||
],
|
||||
[
|
||||
"name" => "Plegar",
|
||||
"description" => "Plegadora-Grapadora (manipulado)"
|
||||
],
|
||||
[
|
||||
"name" => "Coser",
|
||||
"description" => "Cosedora hilo (manipulado)"
|
||||
],
|
||||
[
|
||||
"name" => "Cubrir",
|
||||
"description" => "Encuadernadora cola caliente (manipulado)"
|
||||
],
|
||||
[
|
||||
"name" => "Corte",
|
||||
"description" => "Manipulado"
|
||||
],
|
||||
[
|
||||
"name" => "Marcapáginas",
|
||||
"description" => "Acabado"
|
||||
],
|
||||
];
|
||||
$m->insertBatch($data);
|
||||
}
|
||||
}
|
||||
@ -1,6 +1,8 @@
|
||||
<?php
|
||||
namespace App\Entities\Clientes;
|
||||
|
||||
use App\Entities\Usuarios\UserEntity;
|
||||
use App\Models\Usuarios\UserModel;
|
||||
use CodeIgniter\Entity;
|
||||
|
||||
class ClienteEntity extends \CodeIgniter\Entity\Entity
|
||||
@ -68,4 +70,10 @@ class ClienteEntity extends \CodeIgniter\Entity\Entity
|
||||
"user_created_id" => "int",
|
||||
"user_update_id" => "int",
|
||||
];
|
||||
|
||||
public function comercial() : UserEntity
|
||||
{
|
||||
$m = model(UserModel::class);
|
||||
return $m->find($this->attributes["comercial_id"]);
|
||||
}
|
||||
}
|
||||
|
||||
59
ci4/app/Entities/Configuracion/ServicioClienteEntity.php
Normal file
59
ci4/app/Entities/Configuracion/ServicioClienteEntity.php
Normal file
@ -0,0 +1,59 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entities\Configuracion;
|
||||
|
||||
use CodeIgniter\Entity\Entity;
|
||||
use App\Entities\Tarifas\Acabados\TarifaAcabadoEntity;
|
||||
use App\Entities\Tarifas\TarifaManipuladoEntity;
|
||||
use App\Models\Configuracion\ServicioClienteModel;
|
||||
use CodeIgniter\Database\MySQLi\Result;
|
||||
|
||||
class ServicioClienteEntity extends Entity
|
||||
{
|
||||
protected $attributes = [
|
||||
"nombre" => null,
|
||||
"code" => null,
|
||||
];
|
||||
protected $casts = [
|
||||
"nombre" => "string",
|
||||
"code" => "string",
|
||||
];
|
||||
|
||||
public function withManipuladoTarifas()
|
||||
{
|
||||
$this->attributes["tarifas_manipulado"] = $this->getManipuladoTarifas();
|
||||
return $this;
|
||||
}
|
||||
public function withAcabadoTarifas()
|
||||
{
|
||||
$this->attributes["tarifas_acabado"] = $this->getAcabadoTarifas();
|
||||
return $this;
|
||||
}
|
||||
public function withAllTarifas(){
|
||||
$this->withManipuladoTarifas();
|
||||
$this->withAcabadoTarifas();
|
||||
return $this;
|
||||
}
|
||||
public function getManipuladoTarifas(): ?object
|
||||
{
|
||||
$model = model(ServicioClienteModel::class);
|
||||
return $model->builder()->select("lg_tarifa_manipulado.*")
|
||||
->join("servicio_cliente_tareas","servicio_cliente_tareas.servicio_cliente_id = servicios_cliente.id",'left')
|
||||
->join("lg_tarifa_manipulado","lg_tarifa_manipulado.id = servicio_cliente_tareas.tarifa_manipulado_id",'left')
|
||||
->where("servicio_cliente_tareas.servicio_cliente_id",$this->attributes["id"])
|
||||
->where("lg_tarifa_manipulado.id IS NOT NULL",NULL,FALSE)
|
||||
->where("servicio_cliente_tareas.deleted_at", NULL) // Exclude soft-deleted rows
|
||||
->get()->getFirstRow();
|
||||
}
|
||||
public function getAcabadoTarifas(): ?object
|
||||
{
|
||||
$model = model(ServicioClienteModel::class);
|
||||
return $model->builder()->select("lg_tarifa_acabado.*")
|
||||
->join("servicio_cliente_tareas","servicio_cliente_tareas.servicio_cliente_id = servicios_cliente.id",'left')
|
||||
->join("lg_tarifa_acabado","lg_tarifa_acabado.id = servicio_cliente_tareas.tarifa_acabado_id",'left')
|
||||
->where("servicio_cliente_tareas.servicio_cliente_id",$this->attributes["id"])
|
||||
->where("servicio_cliente_tareas.deleted_at", NULL) // Exclude soft-deleted rows
|
||||
->where("lg_tarifa_acabado.id IS NOT NULL",NULL,FALSE)
|
||||
->get()->getFirstRow();
|
||||
}
|
||||
}
|
||||
20
ci4/app/Entities/Configuracion/TareaMaquinaEntity.php
Normal file
20
ci4/app/Entities/Configuracion/TareaMaquinaEntity.php
Normal file
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
namespace App\Entities\Tarifas\Maquinas;
|
||||
|
||||
use CodeIgniter\Entity\Entity;
|
||||
|
||||
|
||||
class TareaMaquinaEntity extends Entity
|
||||
{
|
||||
protected $attributes = [
|
||||
"id" => null,
|
||||
"name" => null,
|
||||
"description" => null,
|
||||
];
|
||||
protected $casts = [
|
||||
"id" => "integer",
|
||||
"name" => "string",
|
||||
"description" => "?string",
|
||||
];
|
||||
|
||||
}
|
||||
@ -1,7 +1,11 @@
|
||||
<?php
|
||||
namespace App\Entities\Pedidos;
|
||||
|
||||
use App\Entities\Presupuestos\PresupuestoEntity;
|
||||
use App\Entities\Produccion\OrdenTrabajoEntity;
|
||||
use App\Models\OrdenTrabajo\OrdenTrabajoModel;
|
||||
use App\Entities\Clientes\ClienteEntity;
|
||||
use App\Entities\Configuracion\UbicacionesEntity;
|
||||
use App\Models\Clientes\ClienteModel;
|
||||
use App\Models\Pedidos\PedidoLineaModel;
|
||||
use App\Models\Presupuestos\PresupuestoModel;
|
||||
@ -31,6 +35,46 @@ class PedidoEntity extends \CodeIgniter\Entity\Entity
|
||||
"total_precio" => "float",
|
||||
"total_tirada" => "float",
|
||||
];
|
||||
/**
|
||||
* Devuelve la entidad `PedidoEntity` con sus relaciones
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function withAllRelations() : self
|
||||
{
|
||||
$this->attributes["pedido_lineas"] = $this->lineas();
|
||||
$this->attributes["presupuesto"] = $this->presupuesto();
|
||||
|
||||
return $this;
|
||||
}
|
||||
public function lineas(): array
|
||||
{
|
||||
$q = model(PedidoLineaModel::class);
|
||||
$q->where("pedido_id",$this->attributes["id"]);
|
||||
return $q->findAll();
|
||||
}
|
||||
public function ubicacion(): ?UbicacionesEntity
|
||||
{
|
||||
$lineas = $this->lineas();
|
||||
$ubicacion = null;
|
||||
foreach ($lineas as $key => $linea) {
|
||||
$ubicacion = $linea->ubicacion();
|
||||
}
|
||||
return $ubicacion;
|
||||
}
|
||||
public function presupuesto() : PresupuestoEntity
|
||||
{
|
||||
$q = model(PedidoLineaModel::class);
|
||||
$p = model(PresupuestoModel::class);
|
||||
$presupuesto_id = $q->where("pedido_id",$this->attributes["id"])->first()->presupuesto_id;
|
||||
return $p->find($presupuesto_id);
|
||||
}
|
||||
public function orden_trabajo() : ?OrdenTrabajoEntity
|
||||
{
|
||||
$m = model(OrdenTrabajoModel::class);
|
||||
return $m->where("pedido_id",$this->attributes["id"])->first();
|
||||
}
|
||||
|
||||
|
||||
public function cliente() : ?ClienteEntity
|
||||
{
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
<?php
|
||||
namespace App\Entities\Pedidos;
|
||||
|
||||
use App\Entities\Configuracion\UbicacionesEntity;
|
||||
use App\Models\Configuracion\UbicacionesModel;
|
||||
use CodeIgniter\Entity;
|
||||
|
||||
class PedidoLineaEntity extends \CodeIgniter\Entity\Entity
|
||||
@ -22,4 +24,9 @@ class PedidoLineaEntity extends \CodeIgniter\Entity\Entity
|
||||
"presupuesto_id" => "int",
|
||||
"ubicacion_id" => "int",
|
||||
];
|
||||
public function ubicacion() : UbicacionesEntity
|
||||
{
|
||||
$m = model(UbicacionesModel::class);
|
||||
return $m->find($this->attributes["ubicacion_id"]);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,6 +1,10 @@
|
||||
<?php
|
||||
namespace App\Entities\Presupuestos;
|
||||
|
||||
use App\Entities\Tarifas\Acabados\TarifaAcabadoEntity;
|
||||
use App\Models\Configuracion\MaquinaModel;
|
||||
use App\Models\Tarifas\Acabados\TarifaAcabadoModel;
|
||||
use App\Models\Tarifas\Maquinas\TarifaAcabadoMaquinaModel;
|
||||
use CodeIgniter\Entity;
|
||||
|
||||
class PresupuestoAcabadosEntity extends \CodeIgniter\Entity\Entity
|
||||
@ -28,4 +32,21 @@ class PresupuestoAcabadosEntity extends \CodeIgniter\Entity\Entity
|
||||
"cubierta" => "int",
|
||||
"sobrecubierta" => "int",
|
||||
];
|
||||
|
||||
public function maquinas() : array
|
||||
{
|
||||
$m = model(TarifaAcabadoMaquinaModel::class);
|
||||
$tarifa_maquinas = $m->where("tarifa_acabado_id",$this->attributes["tarifa_acabado_id"])->findAll();
|
||||
$maquinaModel = model(MaquinaModel::class);
|
||||
$maquinas = [];
|
||||
foreach ($tarifa_maquinas as $key => $tarifa_maquina) {
|
||||
$maquinas[] = $maquinaModel->find($tarifa_maquina->maquina_id);
|
||||
}
|
||||
return $maquinas;
|
||||
}
|
||||
public function tarifa() : TarifaAcabadoEntity
|
||||
{
|
||||
$m = model(TarifaAcabadoModel::class);
|
||||
return $m->find($this->attributes["tarifa_acabado_id"]);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,6 +1,9 @@
|
||||
<?php
|
||||
namespace App\Entities\Presupuestos;
|
||||
|
||||
use App\Entities\Tarifas\TarifaEncuadernacionEntity;
|
||||
use App\Models\Tarifas\Maquinas\TarifaEncuadernacionMaquinaModel;
|
||||
use App\Models\Tarifas\TarifaEncuadernacionModel;
|
||||
use CodeIgniter\Entity;
|
||||
|
||||
class PresupuestoEncuadernacionesEntity extends \CodeIgniter\Entity\Entity
|
||||
@ -28,4 +31,14 @@ class PresupuestoEncuadernacionesEntity extends \CodeIgniter\Entity\Entity
|
||||
"precio_total" => "float",
|
||||
"margen" => "float",
|
||||
];
|
||||
public function maquinas() : array
|
||||
{
|
||||
$m = model(TarifaEncuadernacionMaquinaModel::class);
|
||||
return $m->where("tarifa_encuadernacion_id",$this->attributes["tarifa_encuadernado_id"])->findAll();
|
||||
}
|
||||
public function tarifa() : TarifaEncuadernacionEntity
|
||||
{
|
||||
$m = model(TarifaEncuadernacionModel::class);
|
||||
return $m->find($this->attributes["tarifa_encuadernado_id"]);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,6 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entities\Presupuestos;
|
||||
|
||||
use App\Entities\Clientes\ClienteEntity;
|
||||
use App\Entities\Configuracion\PapelFormatoEntity;
|
||||
use App\Models\Clientes\ClienteModel;
|
||||
use App\Models\Configuracion\PapelFormatoModel;
|
||||
use App\Models\Presupuestos\PresupuestoAcabadosModel;
|
||||
use App\Models\Presupuestos\PresupuestoEncuadernacionesModel;
|
||||
use App\Models\Presupuestos\PresupuestoLineaModel;
|
||||
use App\Models\Presupuestos\PresupuestoManipuladosModel;
|
||||
use App\Models\Presupuestos\PresupuestoModel;
|
||||
use App\Models\Presupuestos\PresupuestoPreimpresionesModel;
|
||||
use App\Models\Presupuestos\PresupuestoServiciosExtraModel;
|
||||
use CodeIgniter\Entity;
|
||||
|
||||
class PresupuestoEntity extends \CodeIgniter\Entity\Entity
|
||||
@ -78,7 +90,7 @@ class PresupuestoEntity extends \CodeIgniter\Entity\Entity
|
||||
"total_margen_envios" => null,
|
||||
"total_costes" => null,
|
||||
"total_margenes" => null,
|
||||
"total_antes_descuento" => null,
|
||||
"total_antes_descuento" => null,
|
||||
"total_descuento" => null,
|
||||
"total_descuentoPercent" => null,
|
||||
"total_precio_unidad" => null,
|
||||
@ -165,4 +177,111 @@ class PresupuestoEntity extends \CodeIgniter\Entity\Entity
|
||||
'paginasCuadernillo' => "int",
|
||||
'lomo_redondo' => "boolean",
|
||||
];
|
||||
/**
|
||||
* Devuelve la entity con un campo `presupuesto_lineas` con las lineas de presupuesto asociadas
|
||||
*
|
||||
* @return this
|
||||
*/
|
||||
public function withPresupuestoLineas()
|
||||
{
|
||||
$this->attributes["presupuesto_lineas"] = $this->presupuestoLineas();
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Obtiene las lineas de presupuesto del actual presupuesto
|
||||
*
|
||||
* @return array<PresupuestoLineaEntity>
|
||||
*/
|
||||
public function presupuestoLineas(): array
|
||||
{
|
||||
$model = model(PresupuestoLineaModel::class);
|
||||
|
||||
$q = $model->where('presupuesto_id', $this->attributes["id"])->findAll();
|
||||
|
||||
return $q;
|
||||
}
|
||||
/**
|
||||
* Obtiene las lineas de presupuesto del actual presupuesto
|
||||
*
|
||||
* @return PresupuestoLineaEntity
|
||||
*/
|
||||
public function presupuestoLineaImpresion(): PresupuestoLineaEntity
|
||||
{
|
||||
$model = model(PresupuestoLineaModel::class);
|
||||
|
||||
$q = $model->where('presupuesto_id', $this->attributes["id"])->whereIn("tipo",["lp_rot_bn","lp_rot_color","lp_color","lp_colorhq","lp_bn","lp_bnhq"])->first();
|
||||
|
||||
return $q;
|
||||
}
|
||||
/**
|
||||
* Obtiene las lineas de presupuesto del actual presupuesto
|
||||
*
|
||||
* @return PresupuestoLineaEntity
|
||||
*/
|
||||
public function presupuestoLineaCubierta(): PresupuestoLineaEntity
|
||||
{
|
||||
$model = model(PresupuestoLineaModel::class);
|
||||
|
||||
$q = $model->where('presupuesto_id', $this->attributes["id"])->whereIn("tipo",["lp_cubierta"])->first();
|
||||
|
||||
return $q;
|
||||
}
|
||||
/**
|
||||
* Obtiene las lineas de presupuesto del actual presupuesto
|
||||
*
|
||||
* @return PresupuestoLineaEntity
|
||||
*/
|
||||
public function presupuestoLineaSobreCubierta(): ?PresupuestoLineaEntity
|
||||
{
|
||||
$model = model(PresupuestoLineaModel::class);
|
||||
|
||||
$q = $model->where('presupuesto_id', $this->attributes["id"])->whereIn("tipo",["lp_sobrecubierta"])->first();
|
||||
|
||||
return $q;
|
||||
}
|
||||
public function hasSobrecubierta() : bool
|
||||
{
|
||||
$hasSobrecubierta = false;
|
||||
$model = model(PresupuestoLineaModel::class);
|
||||
$q = $model->where('presupuesto_id', $this->attributes["id"])->whereIn("tipo",["lp_sobrecubierta"])->countAllResults();
|
||||
if($q > 0){
|
||||
$hasSobrecubierta = true;
|
||||
}
|
||||
return $hasSobrecubierta;
|
||||
}
|
||||
public function cliente() : ClienteEntity
|
||||
{
|
||||
$m = model(ClienteModel::class);
|
||||
return $m->find($this->attributes["cliente_id"]);
|
||||
}
|
||||
public function encuadernaciones(): array
|
||||
{
|
||||
$m = model(PresupuestoEncuadernacionesModel::class);
|
||||
return $m->where("presupuesto_id",$this->attributes["id"])->findAll();
|
||||
}
|
||||
public function acabados(): array
|
||||
{
|
||||
$m = model(PresupuestoAcabadosModel::class);
|
||||
return $m->where("presupuesto_id",$this->attributes["id"])->findAll();
|
||||
}
|
||||
public function preimpresiones(): array
|
||||
{
|
||||
$m = model(PresupuestoPreimpresionesModel::class);
|
||||
return $m->where("presupuesto_id",$this->attributes["id"])->findAll();
|
||||
}
|
||||
public function manipulados(): array
|
||||
{
|
||||
$m = model(PresupuestoManipuladosModel::class);
|
||||
return $m->where("presupuesto_id",$this->attributes["id"])->findAll();
|
||||
}
|
||||
public function extras(): array
|
||||
{
|
||||
$m = model(PresupuestoServiciosExtraModel::class);
|
||||
return $m->where("presupuesto_id",$this->attributes["id"])->findAll();
|
||||
}
|
||||
public function papel_formato() : PapelFormatoEntity
|
||||
{
|
||||
$m = model(PapelFormatoModel::class);
|
||||
return $m->find($this->attributes["papel_formato_id"]);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,7 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entities\Presupuestos;
|
||||
|
||||
use App\Models\Configuracion\MaquinaModel;
|
||||
use CodeIgniter\Entity;
|
||||
use App\Entities\Configuracion\Maquina as MaquinaEntity;
|
||||
use App\Entities\Configuracion\MaquinasTarifasImpresionEntity;
|
||||
use App\Entities\Configuracion\PapelGenerico;
|
||||
use App\Entities\Configuracion\PapelImpresion;
|
||||
use App\Entities\Tarifas\TarifapreimpresionEntity;
|
||||
use App\Models\Configuracion\MaquinasTarifasImpresionModel;
|
||||
use App\Models\Configuracion\PapelGenericoModel;
|
||||
use App\Models\Configuracion\PapelImpresionModel;
|
||||
use Config\LogoImpresion;
|
||||
|
||||
class PresupuestoLineaEntity extends \CodeIgniter\Entity\Entity
|
||||
{
|
||||
@ -141,5 +152,73 @@ class PresupuestoLineaEntity extends \CodeIgniter\Entity\Entity
|
||||
"precio_impresion" => "double",
|
||||
"total_linea" => "double",
|
||||
];
|
||||
|
||||
/**
|
||||
* Devuelve la entity MaquinaEntity asociada a esta linea de presupuesto
|
||||
*
|
||||
* @return MaquinaEntity
|
||||
*/
|
||||
public function maquina(): MaquinaEntity
|
||||
{
|
||||
$m = model(MaquinaModel::class);
|
||||
return $m->find($this->attributes["maquina_id"]);
|
||||
}
|
||||
/**
|
||||
* Devuelve la entity PapelImpresion asociada a esta linea de presupuesto.
|
||||
*
|
||||
* @return PapelImpresion
|
||||
*/
|
||||
public function papel_impresion(): PapelImpresion
|
||||
{
|
||||
$m = model(PapelImpresionModel::class);
|
||||
return $m->find($this->attributes['papel_impresion_id']);
|
||||
}
|
||||
/**
|
||||
* Devuelve la entity PapelGenerico asociada a esta linea de presupuesto.
|
||||
*
|
||||
* @return PapelGenerico
|
||||
*/
|
||||
public function papel_generico(): PapelGenerico
|
||||
{
|
||||
$m = model(PapelGenericoModel::class);
|
||||
return $m->find($this->attributes['papel_id']);
|
||||
}
|
||||
/**
|
||||
* Devuelve la entity MaquinasTarifasImpresionEntity asociada a esta linea de presupuesto.
|
||||
*
|
||||
* @return MaquinasTarifasImpresionEntity
|
||||
*/
|
||||
public function tarifa_impresion(): MaquinasTarifasImpresionEntity
|
||||
{
|
||||
$m = model(MaquinasTarifasImpresionModel::class);
|
||||
return $m->find($this->attributes['tarifa_impresion_id']);
|
||||
}
|
||||
|
||||
public function get_impresion_logo(){
|
||||
$logo = config(LogoImpresion::class);
|
||||
return $logo->get_logo_path($this->attributes["tipo"]);
|
||||
}
|
||||
public function get_nombre_tarea() : ?string
|
||||
{
|
||||
$nombre = null;
|
||||
$impresion_bn = ["lp_bn","lp_bnhq","lp_rot_bn"];
|
||||
$impresion_color = ["lp_color","lp_colorhq","lp_rot_color"];
|
||||
$impresion_cubierta = ["lp_cubierta"];
|
||||
$impresion_guardas = ["lp_guardas"];
|
||||
$impresion_sobrecubierta = ["lp_sobrecubierta"];
|
||||
|
||||
$is_bn = in_array($this->attributes["tipo"],$impresion_bn);
|
||||
$is_color = in_array($this->attributes["tipo"],$impresion_color);
|
||||
$is_impresion_cubierta = in_array($this->attributes["tipo"],$impresion_cubierta);
|
||||
$is_impresion_guarda = in_array($this->attributes["tipo"],$impresion_guardas);
|
||||
$is_impresion_sobrecubierta = in_array($this->attributes["tipo"],$impresion_sobrecubierta);
|
||||
|
||||
if($is_bn) $nombre ="Impresión B/N";
|
||||
if($is_color) $nombre ="Impresión color";
|
||||
if($is_impresion_cubierta) $nombre ="Impresión cubierta";
|
||||
if($is_impresion_guarda) $nombre ="Impresión guarda";
|
||||
if($is_impresion_sobrecubierta) $nombre ="Impresión sobrecubierta";
|
||||
|
||||
return $nombre;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,6 +1,9 @@
|
||||
<?php
|
||||
namespace App\Entities\Presupuestos;
|
||||
|
||||
use App\Entities\Tarifas\TarifaManipuladoEntity;
|
||||
use App\Models\Tarifas\Maquinas\TarifaManipuladoMaquinaModel;
|
||||
use App\Models\Tarifas\TarifaManipuladoModel;
|
||||
use CodeIgniter\Entity;
|
||||
|
||||
class PresupuestoManipuladosEntity extends \CodeIgniter\Entity\Entity
|
||||
@ -22,4 +25,14 @@ class PresupuestoManipuladosEntity extends \CodeIgniter\Entity\Entity
|
||||
"precio_total" => "float",
|
||||
"margen" => "float",
|
||||
];
|
||||
public function maquinas() : array
|
||||
{
|
||||
$m = model(TarifaManipuladoMaquinaModel::class);
|
||||
return $m->where("tarifa_manipulado_id",$this->attributes["tarifa_manipulado_id"])->findAll();
|
||||
}
|
||||
public function tarifa() : TarifaManipuladoEntity
|
||||
{
|
||||
$m = model(TarifaManipuladoModel::class);
|
||||
return $m->find($this->attributes["tarifa_manipulado_id"]);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,6 +1,9 @@
|
||||
<?php
|
||||
namespace App\Entities\Presupuestos;
|
||||
|
||||
use App\Entities\Tarifas\TarifapreimpresionEntity;
|
||||
use App\Models\Tarifas\Maquinas\TarifaPreimpresionMaquinaModel;
|
||||
use App\Models\Tarifas\TarifapreimpresionModel;
|
||||
use CodeIgniter\Entity;
|
||||
|
||||
class PresupuestoPreimpresionesEntity extends \CodeIgniter\Entity\Entity
|
||||
@ -20,4 +23,14 @@ class PresupuestoPreimpresionesEntity extends \CodeIgniter\Entity\Entity
|
||||
"precio_total" => "float",
|
||||
"margen" => "float",
|
||||
];
|
||||
public function maquinas() : array
|
||||
{
|
||||
$m = model(TarifaPreimpresionMaquinaModel::class);
|
||||
return $m->where("tarifa_preimpresion_id",$this->attributes["tarifa_preimpresion_id"])->findAll();
|
||||
}
|
||||
public function tarifa() : TarifapreimpresionEntity
|
||||
{
|
||||
$m = model(TarifapreimpresionModel::class);
|
||||
return $m->find($this->attributes["tarifa_preimpresion_id"]);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,6 +1,9 @@
|
||||
<?php
|
||||
namespace App\Entities\Presupuestos;
|
||||
|
||||
use App\Entities\Tarifas\TarifaextraEntity;
|
||||
use App\Models\Tarifas\Maquinas\TarifaExtraMaquinaModel;
|
||||
use App\Models\Tarifas\TarifaextraModel;
|
||||
use CodeIgniter\Entity;
|
||||
|
||||
class PresupuestoServiciosExtraEntity extends \CodeIgniter\Entity\Entity
|
||||
@ -20,4 +23,15 @@ class PresupuestoServiciosExtraEntity extends \CodeIgniter\Entity\Entity
|
||||
"precio_total" => "float",
|
||||
"margen" => "float",
|
||||
];
|
||||
|
||||
public function maquinas() : array
|
||||
{
|
||||
$m = model(TarifaExtraMaquinaModel::class);
|
||||
return $m->where("tarifa_extra_id",$this->attributes["tarifa_extra_id"])->findAll();
|
||||
}
|
||||
public function tarifa() : TarifaextraEntity
|
||||
{
|
||||
$m = model(TarifaextraModel::class);
|
||||
return $m->find($this->attributes["tarifa_extra_id"]);
|
||||
}
|
||||
}
|
||||
|
||||
62
ci4/app/Entities/Produccion/OrdenTrabajoDateEntity.php
Normal file
62
ci4/app/Entities/Produccion/OrdenTrabajoDateEntity.php
Normal file
@ -0,0 +1,62 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entities\Produccion;
|
||||
|
||||
use CodeIgniter\Entity\Entity;
|
||||
|
||||
class OrdenTrabajoDateEntity extends Entity
|
||||
{
|
||||
protected $attributes = [
|
||||
"fecha_entrada_at" => null,
|
||||
"fecha_entrega_at" => null,
|
||||
"fecha_entrega_change_at" => null,
|
||||
"fecha_entrega_real_at" => null,
|
||||
"fecha_entrega_real_warning" => null,
|
||||
"fecha_impresion_at" => null,
|
||||
"fecha_encuadernado_at" => null,
|
||||
"fecha_externo_at" => null,
|
||||
"fecha_entrega_warning" => null,
|
||||
"fecha_entrega_warning_revised" => null,
|
||||
"pendiente_ferro_at" => null,
|
||||
"ferro_en_cliente_at" => null,
|
||||
"ferro_ok_at" => null,
|
||||
"interior_bn_at" => null,
|
||||
"interior_color_at" => null,
|
||||
"preparacion_interiores_at" => null,
|
||||
"cubierta_at" => null,
|
||||
"plastificado_at" => null,
|
||||
"encuadernacion_at" => null,
|
||||
"corte_at" => null,
|
||||
"embalaje_at" => null,
|
||||
"envio_at" => null,
|
||||
"entrada_manipulado_at" => null
|
||||
|
||||
];
|
||||
protected $datamap = [];
|
||||
protected $dates = ['created_at', 'updated_at', 'deleted_at'];
|
||||
protected $casts = [
|
||||
// "fecha_entrada_at" => "?datetime",
|
||||
// "fecha_entrega_at" => "?datetime",
|
||||
// "fecha_entrega_change_at" => "?datetime",
|
||||
// "fecha_entrega_real_at" => "?datetime",
|
||||
// "fecha_entrega_real_warning" => "?bool",
|
||||
// "fecha_impresion_at" => "?datetime",
|
||||
// "fecha_encuadernado_at" => "?datetime",
|
||||
// "fecha_externo_at" => "?datetime",
|
||||
// "fecha_entrega_warning" => "?bool",
|
||||
// "fecha_entrega_warning_revised" => "?bool",
|
||||
// "pendiente_ferro_at" => "?datetime",
|
||||
// "ferro_en_cliente_at" => "?datetime",
|
||||
// "ferro_ok_at" => "?datetime",
|
||||
// "interior_bn_at" => "?datetime",
|
||||
// "interior_color_at" => "?datetime",
|
||||
// "preparacion_interiores_at" => "?datetime",
|
||||
// "cubierta_at" => "?datetime",
|
||||
// "plastificado_at" => "?datetime",
|
||||
// "encuadernacion_at" => "?datetime",
|
||||
// "corte_at" => "?datetime",
|
||||
// "embalaje_at" => "?datetime",
|
||||
// "envio_at" => "?datetime",
|
||||
// "entrada_manipulado_at" => "?datetime"
|
||||
];
|
||||
}
|
||||
104
ci4/app/Entities/Produccion/OrdenTrabajoEntity.php
Normal file
104
ci4/app/Entities/Produccion/OrdenTrabajoEntity.php
Normal file
@ -0,0 +1,104 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entities\Produccion;
|
||||
|
||||
use App\Controllers\Produccion\Ordentrabajo;
|
||||
use App\Database\Migrations\OrdenTrabajoDatesTable;
|
||||
use App\Entities\Pedidos\PedidoEntity;
|
||||
use App\Models\OrdenTrabajo\OrdenTrabajoDate;
|
||||
use App\Models\OrdenTrabajo\OrdenTrabajoTarea;
|
||||
use App\Models\OrdenTrabajo\OrdenTrabajoUser;
|
||||
use App\Models\Pedidos\PedidoModel;
|
||||
use CodeIgniter\Entity\Entity;
|
||||
|
||||
|
||||
class OrdenTrabajoEntity extends Entity
|
||||
{
|
||||
protected $attributes = [
|
||||
"pedido_id" => null,
|
||||
"user_created_id" => null,
|
||||
"user_updated_id" => null,
|
||||
"fecha_entrega_warning" => false,
|
||||
"fecha_entrega_warning_revised" => false,
|
||||
"total_tirada" => null,
|
||||
"total_precio" => null,
|
||||
"tipo_entrada" => "out",
|
||||
"progreso" => 0.00,
|
||||
"estado" => "I",
|
||||
"comentarios" => null,
|
||||
"revisar_formato" => false,
|
||||
"revisar_lomo" => false,
|
||||
"revisar_solapa" => false,
|
||||
"revisar_isbn" => false,
|
||||
"revisar_codigo_barras" => false,
|
||||
"realizar_imposicion" => false,
|
||||
"enviar_impresion" => false,
|
||||
];
|
||||
protected $casts = [
|
||||
"pedido_id" => "integer",
|
||||
"user_created_id" => "integer",
|
||||
"user_updated_id" => "?integer",
|
||||
"fecha_entrega_warning" => "bool",
|
||||
"fecha_entrega_warning_revised" => "bool",
|
||||
"total_tirada" => "float",
|
||||
"total_precio" => "float",
|
||||
"tipo_entrada" => "string",
|
||||
"progreso" => "float",
|
||||
"estado" => "string",
|
||||
"comentarios" => "string",
|
||||
"revisar_formato" => "bool",
|
||||
"revisar_lomo" => "bool",
|
||||
"revisar_solapa" => "bool",
|
||||
"revisar_isbn" => "bool",
|
||||
"revisar_codigo_barras" => "bool",
|
||||
"realizar_imposicion" => "bool",
|
||||
"enviar_impresion" => "bool",
|
||||
];
|
||||
|
||||
|
||||
/**
|
||||
* Devuelve las tareas de la orden de trabajo.
|
||||
*
|
||||
* @return array<OrdenTrabajoTarea>
|
||||
*/
|
||||
public function tareas(): array
|
||||
{
|
||||
$m = model(OrdenTrabajoTarea::class);
|
||||
return $m->where("orden_trabajo_id", $this->attributes["id"])->findAll();
|
||||
}
|
||||
/**
|
||||
* Devuelve el pedido de la orden de trabajo
|
||||
*
|
||||
* @return PedidoEntity
|
||||
*/
|
||||
public function pedido(): ?PedidoEntity
|
||||
{
|
||||
$m = model(PedidoModel::class);
|
||||
return $m->find($this->attributes["pedido_id"]);
|
||||
}
|
||||
public function dates(): ?OrdenTrabajoDateEntity
|
||||
{
|
||||
$m = model(OrdenTrabajoDate::class);
|
||||
return $m->find($this->attributes["id"]);
|
||||
}
|
||||
public function users(): ?OrdenTrabajoUserEntity
|
||||
{
|
||||
$m = model(OrdenTrabajoUser::class);
|
||||
return $m->find($this->attributes["id"]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Almacena en la tabla `orden_trabajo_dates` las fechas correspondientes del pedido.
|
||||
* Se almacenan en una tabla externa porque puede haber modificaciones de estas fechas
|
||||
* en la orden del trabajo, pero en el pedido quedarán fijas.
|
||||
*
|
||||
* @todo Falta implementacion
|
||||
* @return boolean
|
||||
*/
|
||||
public function storeDates($data): self
|
||||
{
|
||||
$ot_dates = new OrdenTrabajoDateEntity();
|
||||
$this->attributes["dates"] = $ot_dates->fill($data);
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entities\Produccion;
|
||||
|
||||
use CodeIgniter\Entity\Entity;
|
||||
|
||||
class OrdenTrabajoMaquetacionEntity extends Entity
|
||||
{
|
||||
protected $datamap = [];
|
||||
protected $dates = ['created_at', 'updated_at', 'deleted_at'];
|
||||
protected $casts = [];
|
||||
}
|
||||
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entities\Produccion;
|
||||
|
||||
use CodeIgniter\Entity\Entity;
|
||||
|
||||
class OrdenTrabajoMaquetacionMovimientoEntity extends Entity
|
||||
{
|
||||
protected $datamap = [];
|
||||
protected $dates = ['created_at', 'updated_at', 'deleted_at'];
|
||||
protected $casts = [];
|
||||
}
|
||||
105
ci4/app/Entities/Produccion/OrdenTrabajoTareaEntity.php
Normal file
105
ci4/app/Entities/Produccion/OrdenTrabajoTareaEntity.php
Normal file
@ -0,0 +1,105 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entities\Produccion;
|
||||
|
||||
use App\Entities\Configuracion\Maquina;
|
||||
use App\Entities\Presupuestos\PresupuestoAcabadosEntity;
|
||||
use App\Entities\Presupuestos\PresupuestoLineaEntity;
|
||||
use App\Entities\Presupuestos\PresupuestoManipuladosEntity;
|
||||
use App\Models\Configuracion\MaquinaModel;
|
||||
use App\Models\OrdenTrabajo\OrdenTrabajoModel;
|
||||
use App\Models\Presupuestos\PresupuestoAcabadosModel;
|
||||
use App\Models\Presupuestos\PresupuestoLineaModel;
|
||||
use App\Models\Presupuestos\PresupuestoManipuladosModel;
|
||||
use CodeIgniter\Entity\Entity;
|
||||
|
||||
class OrdenTrabajoTareaEntity extends Entity
|
||||
{
|
||||
protected $attributes = [
|
||||
"id" => null,
|
||||
"orden_trabajo_id" => null,
|
||||
"presupuesto_linea_id" => null,
|
||||
"nombre" => null,
|
||||
"orden" => null,
|
||||
"maquina_id" => null,
|
||||
"imposicion_id" => null,
|
||||
"tiempo_estimado" => null,
|
||||
"tiempo_real" => null,
|
||||
"comment" => null,
|
||||
];
|
||||
protected $datamap = [];
|
||||
protected $dates = ['created_at', 'updated_at', 'deleted_at'];
|
||||
protected $casts = [
|
||||
"id" => "integer",
|
||||
"orden_trabajo_id" => "integer",
|
||||
"presupuesto_linea_id" => "?integer",
|
||||
"nombre" => "string",
|
||||
"orden" => "integer",
|
||||
"maquina_id" => "?integer",
|
||||
"imposicion_id" => "?integer",
|
||||
"tiempo_estimado" => "?float",
|
||||
"tiempo_real" => "?float",
|
||||
"comment" => "?string"
|
||||
];
|
||||
|
||||
/**
|
||||
* Orden de trabajo de la tarea
|
||||
*
|
||||
* @return OrdenTrabajoEntity
|
||||
*/
|
||||
public function orden_trabajo() : OrdenTrabajoEntity
|
||||
{
|
||||
$m = model(OrdenTrabajoModel::class);
|
||||
return $m->find($this->attributes["orden_trabajo_id"]);
|
||||
}
|
||||
/**
|
||||
* Tarea orden de trabajo con orden de trabajo
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function withOrdenTrabajo() : self
|
||||
{
|
||||
$this->attributes["orden_trabajo"] = $this->orden_trabajo();
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Devuelve la maquina actual de esta tarea
|
||||
*
|
||||
* @return Maquina
|
||||
*/
|
||||
public function maquina_actual() : Maquina
|
||||
{
|
||||
$m = model(MaquinaModel::class);
|
||||
return $m->find($this->attributes["maquina_id"]);
|
||||
}
|
||||
/**
|
||||
* Devuelve el presupuesto linea origen de esta tarea
|
||||
*
|
||||
* @return PresupuestoLineaEntity
|
||||
*/
|
||||
public function presupuesto_linea() : PresupuestoLineaEntity
|
||||
{
|
||||
$m = model(PresupuestoLineaModel::class);
|
||||
return $m->find($this->attributes["presupuesto_linea_id"]);
|
||||
}
|
||||
/**
|
||||
* Devuelve la maquina original del presupuesto linea
|
||||
*
|
||||
* @return Maquina
|
||||
*/
|
||||
public function maquina_presupuesto_linea() : Maquina
|
||||
{
|
||||
return $this->presupuesto_linea()->maquina();
|
||||
}
|
||||
/**
|
||||
* Devuelve el presupuesto acabado origen de esta tarea
|
||||
*
|
||||
* @return PresupuestoAcabadosEntity
|
||||
*/
|
||||
public function presupuesto_acabado() : PresupuestoAcabadosEntity
|
||||
{
|
||||
$m = model(PresupuestoAcabadosModel::class);
|
||||
return $m->find($this->attributes["presupuesto_linea_id"]);
|
||||
}
|
||||
|
||||
}
|
||||
39
ci4/app/Entities/Produccion/OrdenTrabajoUserEntity.php
Normal file
39
ci4/app/Entities/Produccion/OrdenTrabajoUserEntity.php
Normal file
@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entities\Produccion;
|
||||
|
||||
use CodeIgniter\Entity\Entity;
|
||||
|
||||
class OrdenTrabajoUserEntity extends Entity
|
||||
{
|
||||
protected $datamap = [];
|
||||
protected $dates = ['created_at', 'updated_at', 'deleted_at'];
|
||||
protected $casts = [];
|
||||
protected $attributes = [
|
||||
"orden_trabajo_id"=> null,
|
||||
"user_created_id"=> null,
|
||||
"user_update_id"=> null,
|
||||
"inaplazable_revised_change_user_id"=> null,
|
||||
"ferro_disponible_hecho_user_id"=> null,
|
||||
"ferro_disponible_ok_user_id"=> null,
|
||||
"ferro_entregado_user_id"=> null,
|
||||
"pendiente_ferro_user_id"=> null,
|
||||
"ferro_en_cliente_user_id"=> null,
|
||||
"ferro_ok_user_id"=> null,
|
||||
"interior_bn_user_id"=> null,
|
||||
"interior_color_user_id"=> null,
|
||||
"preparacion_interior_user_id"=> null,
|
||||
"cubierta_user_id"=> null,
|
||||
"plastificado_user_id"=> null,
|
||||
"encuadernacion_user_id"=> null,
|
||||
"corte_user_id"=> null,
|
||||
"embalaje_user_id"=> null,
|
||||
"entrada_manipulado_user_id"=> null,
|
||||
"pre_formato_user_id"=> null,
|
||||
"pre_lomo_user_id"=> null,
|
||||
"pre_solapa_user_id"=> null,
|
||||
"pre_codbarras_user_id"=> null,
|
||||
"pre_imposicion_user_id"=> null,
|
||||
"pre_imprimir_user_id" => null
|
||||
];
|
||||
}
|
||||
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
namespace App\Entities\Tarifas\Maquinas;
|
||||
|
||||
use App\Entities\Tarifas\Acabados\TarifaAcabadoEntity;
|
||||
use App\Models\Tarifas\Acabados\TarifaAcabadoModel;
|
||||
use CodeIgniter\Entity\Entity;
|
||||
|
||||
|
||||
class TarifaAcabadoMaquinaEntity extends Entity
|
||||
{
|
||||
protected $attributes = [
|
||||
"id" => null,
|
||||
"tarifa_acabado_id" => null,
|
||||
"maquina_id" => null,
|
||||
"maquina_tarea_id" => null,
|
||||
];
|
||||
protected $casts = [
|
||||
"id" => "integer",
|
||||
"tarifa_acabado_id" => "integer",
|
||||
"maquina_id" => "integer",
|
||||
"maquina_tarea_id" => "?integer",
|
||||
|
||||
];
|
||||
|
||||
public function tarifa_acabado(): TarifaAcabadoEntity
|
||||
{
|
||||
$m = model(TarifaAcabadoModel::class);
|
||||
return $m->find($this->attributes["tarifa_acabado_id"]);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entities\Tarifas\Maquinas;
|
||||
|
||||
use App\Entities\Tarifas\TarifaEncuadernacionEntity;
|
||||
use App\Models\Tarifas\TarifaEncuadernacionModel;
|
||||
use CodeIgniter\Entity\Entity;
|
||||
|
||||
|
||||
class TarifaEncuadernacionMaquinaEntity extends Entity
|
||||
{
|
||||
protected $attributes = [
|
||||
"id" => null,
|
||||
"tarifa_encuadernacion_id" => null,
|
||||
"maquina_id" => null,
|
||||
"maquina_tarea_id" => null,
|
||||
|
||||
|
||||
];
|
||||
protected $casts = [
|
||||
"id" => "integer",
|
||||
"tarifa_encuadernacion_id" => "integer",
|
||||
"maquina_id" => "integer",
|
||||
"maquina_tarea_id" => "?integer",
|
||||
|
||||
|
||||
];
|
||||
|
||||
public function tarifa_encuadernacion(): TarifaEncuadernacionEntity
|
||||
{
|
||||
$m = model(TarifaEncuadernacionModel::class);
|
||||
return $m->find($this->attributes["tarifa_encuadernacion_id"]);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
namespace App\Entities\Tarifas\Maquinas;
|
||||
|
||||
use App\Entities\Tarifas\Acabados\TarifaAcabadoEntity;
|
||||
use App\Entities\Tarifas\TarifaextraEntity;
|
||||
use App\Models\Tarifas\Acabados\TarifaAcabadoModel;
|
||||
use App\Models\Tarifas\TarifaextraModel;
|
||||
use CodeIgniter\Entity\Entity;
|
||||
|
||||
|
||||
class TarifaExtraMaquinaEntity extends Entity
|
||||
{
|
||||
protected $attributes = [
|
||||
"id" => null,
|
||||
"tarifa_extra_id" => null,
|
||||
"maquina_id" => null,
|
||||
"maquina_tarea_id" => null,
|
||||
];
|
||||
protected $casts = [
|
||||
"id" => "integer",
|
||||
"tarifa_extra_id" => "integer",
|
||||
"maquina_id" => "integer",
|
||||
"maquina_tarea_id" => "?integer",
|
||||
|
||||
];
|
||||
|
||||
public function tarifa_extra(): TarifaextraEntity
|
||||
{
|
||||
$m = model(TarifaextraModel::class);
|
||||
return $m->find($this->attributes["tarifa_extra_id"]);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
namespace App\Entities\Tarifas\Maquinas;
|
||||
|
||||
use App\Entities\Tarifas\TarifaManipuladoEntity;
|
||||
use App\Models\Tarifas\TarifaManipuladoModel;
|
||||
use CodeIgniter\Entity\Entity;
|
||||
|
||||
|
||||
class TarifaManipuladoMaquinaEntity extends Entity
|
||||
{
|
||||
protected $attributes = [
|
||||
"id" => null,
|
||||
"tarifa_manipulado_id" => null,
|
||||
"maquina_id" => null,
|
||||
"maquina_tarea_id" => null,
|
||||
|
||||
];
|
||||
protected $casts = [
|
||||
"id" => "integer",
|
||||
"tarifa_manipulado_id" => "integer",
|
||||
"maquina_id" => "integer",
|
||||
"maquina_tarea_id" => "?integer",
|
||||
|
||||
];
|
||||
|
||||
public function tarifa_manipulado(): TarifaManipuladoEntity
|
||||
{
|
||||
$m = model(TarifaManipuladoModel::class);
|
||||
return $m->find($this->attributes["tarifa_manipulado_id"]);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
namespace App\Entities\Tarifas\Maquinas;
|
||||
|
||||
use App\Entities\Tarifas\TarifapreimpresionEntity;
|
||||
use App\Models\Tarifas\TarifapreimpresionModel;
|
||||
use CodeIgniter\Entity\Entity;
|
||||
|
||||
|
||||
class TarifaPreimpresionMaquinaEntity extends Entity
|
||||
{
|
||||
protected $attributes = [
|
||||
"id" => null,
|
||||
"tarifa_preimpresion_id" => null,
|
||||
"maquina_id" => null,
|
||||
"maquina_tarea_id" => null,
|
||||
|
||||
];
|
||||
protected $casts = [
|
||||
"id" => "integer",
|
||||
"tarifa_preimpresion_id" => "integer",
|
||||
"maquina_id" => "integer",
|
||||
"maquina_tarea_id" => "?integer",
|
||||
|
||||
];
|
||||
|
||||
public function tarifa_acabado(): TarifapreimpresionEntity
|
||||
{
|
||||
$m = model(TarifapreimpresionModel::class);
|
||||
return $m->find($this->attributes["tarifa_preimpresion_id"]);
|
||||
}
|
||||
}
|
||||
@ -31,4 +31,6 @@ class TarifaEncuadernacionEntity extends \CodeIgniter\Entity\Entity
|
||||
"user_updated_id" => "int",
|
||||
"is_deleted" => "int",
|
||||
];
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
<?php
|
||||
namespace App\Entities\Tarifas;
|
||||
|
||||
use CodeIgniter\Entity;
|
||||
use CodeIgniter\Entity\Entity;
|
||||
|
||||
class TarifaEncuadernacionLinea extends \CodeIgniter\Entity\Entity
|
||||
class TarifaEncuadernacionLinea extends Entity
|
||||
{
|
||||
protected $attributes = [
|
||||
"id" => null,
|
||||
@ -38,4 +38,6 @@ class TarifaEncuadernacionLinea extends \CodeIgniter\Entity\Entity
|
||||
"user_updated_id" => "int",
|
||||
"is_deleted" => "int",
|
||||
];
|
||||
|
||||
|
||||
}
|
||||
|
||||
25
ci4/app/Helpers/time_helper.php
Normal file
25
ci4/app/Helpers/time_helper.php
Normal file
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
// app/Helpers/info_helper.php
|
||||
use CodeIgniter\CodeIgniter;
|
||||
|
||||
function float_seconds_to_hhmm_string(?float $time):?string
|
||||
{
|
||||
$time_str = null;
|
||||
if($time){
|
||||
$time_str = sprintf("%02d:%02d",$time/3600,floor($time/60)%60);
|
||||
}
|
||||
return $time_str;
|
||||
}
|
||||
|
||||
function week_day_humanize(int $week_day,bool $upper = false) : string
|
||||
{
|
||||
$week_days = ["Lunes","Martes","Miércoles","Jueves","Viernes","Sábado","Domingo"];
|
||||
$week_day_string = "";
|
||||
if(in_array($week_day,range(0,6))){
|
||||
$week_day_string = $week_days[$week_day];
|
||||
}
|
||||
if($upper){
|
||||
$week_day_string = strtoupper($week_day_string);
|
||||
}
|
||||
return $week_day_string;
|
||||
}
|
||||
16
ci4/app/Language/en/Produccion.php
Normal file
16
ci4/app/Language/en/Produccion.php
Normal file
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
"ot" => "Orden de trabajo",
|
||||
"ots" => "Órdenes de trabajo",
|
||||
"btn_pedido_produccion_accion" => "Pasar a producción",
|
||||
"datatable" => [
|
||||
"pedido_id"=> "Order ID",
|
||||
"fecha_encuadernacion"=> "Bookbinding date",
|
||||
"cliente"=> "Client",
|
||||
"titulo"=> "Title",
|
||||
"ubicacion"=> "Location",
|
||||
"tirada"=> "Runs",
|
||||
"impresion"=> "Printing",
|
||||
]
|
||||
];
|
||||
@ -589,13 +589,13 @@ return [
|
||||
|
||||
// v1.2.1
|
||||
"global_select" => "Selecciona un artículo",
|
||||
|
||||
/**
|
||||
*
|
||||
* SAFEKAT
|
||||
*
|
||||
*/
|
||||
|
||||
*/
|
||||
|
||||
"progress" => "Progreso",
|
||||
// NOMBRES DE LOS PERMISOS
|
||||
"permisos_index" => "Listar",
|
||||
"permisos_view" => "Ver",
|
||||
@ -695,6 +695,7 @@ return [
|
||||
"menu_papelgenerico" => "Papel generico",
|
||||
"menu_papelimpresion" => "Papel impresión",
|
||||
"menu_series_facturas" => "Series facturas",
|
||||
"menu_servicios_cliente" => "Servicios cliente",
|
||||
"menu_ubicaciones" => "Ubicaciones",
|
||||
"menu_serviciocliente" => "Servicio cliente",
|
||||
"menu_tamanioformatos" => "Tamaño formatos",
|
||||
@ -782,6 +783,7 @@ return [
|
||||
"menu_orden_trabajo_100" => "OTs 100%",
|
||||
"menu_orden_trabajo_finalizados" => "OTs finalizados",
|
||||
"menu_orden_trabajo_pendientes" => "OTs pendientes",
|
||||
"menu_planning_rotativa" => "Planning rotativa",
|
||||
|
||||
"menu_ordentrabajomaquetacion" => "Orden de trabajo maquetación",
|
||||
"menu_ordenmaquina" => "Orden máquina",
|
||||
|
||||
@ -42,6 +42,7 @@ return [
|
||||
'userUpdatedId' => 'User Updated ID',
|
||||
'velocidad' => 'Velocidad',
|
||||
'velocidadCorte' => 'Velocidad Corte',
|
||||
'maquina_tarea' => 'Máquina tarea',
|
||||
'validation' => [
|
||||
'alto_menor_alto_impresion' => 'El campo \'Alto impresión\' debe ser menor que \'Alto\'',
|
||||
'ancho_menor_ancho_impresion' => '\'Ancho Impresión\' debe ser menor que \'Ancho\'',
|
||||
|
||||
74
ci4/app/Language/es/Produccion.php
Normal file
74
ci4/app/Language/es/Produccion.php
Normal file
@ -0,0 +1,74 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
"datatable" => [
|
||||
"pedido_id"=> "Pedido ID",
|
||||
"fecha_encuadernacion"=> "Fecha encuadernación",
|
||||
"cliente"=> "Cliente",
|
||||
"titulo"=> "Título",
|
||||
"ubicacion"=> "Ubicación",
|
||||
"tirada"=> "Tirada",
|
||||
"impresion"=> "Impresión",
|
||||
"fecha_entrega_at" => "Fecha entrega prevista",
|
||||
"maquina" => "Máquina",
|
||||
"ancho" => "Ancho",
|
||||
"alto" => "Alto",
|
||||
"papel" => "Papel",
|
||||
"gramaje" => "Gramaje",
|
||||
"corte" => "Corte",
|
||||
"metros_sel" => "Metros_sel",
|
||||
"metros_papel" => "Metros papel",
|
||||
"tareas" => "Tareas",
|
||||
"tiradas" => "Tiradas",
|
||||
"tiempo" => "Tiempo",
|
||||
"progreso" => "Progreso",
|
||||
"logo" => "Logo impresion",
|
||||
|
||||
],
|
||||
"task" => [
|
||||
"order" => "Orden",
|
||||
"task" => "Tarea",
|
||||
"note" => "Nota",
|
||||
"maquina_presupuesto" => "Máquina presupuesto",
|
||||
"maquina_actual" => "Máquina actual",
|
||||
"tiempo_estimado" => "Tiempo estimado",
|
||||
"tiempo" => "Tiempo"
|
||||
],
|
||||
"finalizadas" => "Finalizadas",
|
||||
"pendiente_ferro" => "Ferro pendiente",
|
||||
"pendientes" => "Pendientes",
|
||||
"ferro_ok" => "Ferro ok",
|
||||
"envio" => "Envío",
|
||||
"ot" => "Orden trabajo",
|
||||
"ots" => "Órdenes trabajo",
|
||||
"tiempo_procesamiento" => "Tiempo procesamiento",
|
||||
"fecha_impresion" => "Fecha impresión",
|
||||
"fecha_encuadernado" => "Fecha encuadernado",
|
||||
"fecha_entrega_externo" => "Fecha entrega externo",
|
||||
"fecha_entrega_real" => "Fecha entrega real",
|
||||
"fecha_entrega_estimada" => "Fecha entrega estimada",
|
||||
"formato" => "Formato",
|
||||
"paginas" => "Páginas",
|
||||
"guillotina" => "Guillotina",
|
||||
"tirada" => "Tirada",
|
||||
"merma" => "Merma",
|
||||
"pendiente_ferro" => "Pendiente ferro",
|
||||
"ferro_cliente" => "Ferro cliente",
|
||||
"impresion_color" => "Impresión color",
|
||||
"portada" => "portada",
|
||||
"plakene_traslucido" => "Plakene traslúcido",
|
||||
"plastificado_mate" => "Plastificado mate",
|
||||
"espiral" => "Espiral",
|
||||
"embalaje" => "Embalaje",
|
||||
"tiempo_consumido" => "Tiempo consumido",
|
||||
"tiempo_estimado" => "Tiempo estimado",
|
||||
"finalizar_orden" => "Finalizar orden",
|
||||
"comments" => "Comentarios orden trabajo",
|
||||
"preview_pdf" => "Previsualizar PDF",
|
||||
"imprimir_codigo_safekat" => "Imprimir código SAFEKAT",
|
||||
"imprimir_ferro" => "Imprimir ferro",
|
||||
"planning_rotativa" => "Planning rotativa",
|
||||
"solapa" => "Solapa",
|
||||
"papel_gramajes" => "Papel y gramajes"
|
||||
|
||||
];
|
||||
14
ci4/app/Language/es/ServicioCliente.php
Normal file
14
ci4/app/Language/es/ServicioCliente.php
Normal file
@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
|
||||
return [
|
||||
"cardTitle" => "Servicios cliente",
|
||||
"infoTarifaManipulado" => "La tarifa seleccionada estará asociada al servicio.",
|
||||
"infoTarifaAcabado" => "La tarifa seleccionada estará asociada al servicio.",
|
||||
|
||||
"datatable" => [
|
||||
"nombre" => "Nombre",
|
||||
"code" => "Código",
|
||||
"created_at" => "Fecha creación",
|
||||
]
|
||||
];
|
||||
@ -375,4 +375,24 @@ class MaquinaModel extends \App\Models\BaseModel
|
||||
|
||||
return $builder->orderBy("t1.id", "asc")->get()->getResultObject();
|
||||
}
|
||||
|
||||
/**
|
||||
* Query for select2
|
||||
*
|
||||
* @param string|null $q Query param from select2 ajax request
|
||||
* @param string|null $type Tipo de maquina impresion,manipulado,acabado
|
||||
* @return array
|
||||
*/
|
||||
public function getSelectQuery(?string $q = null, ?string $type = null) : array
|
||||
{
|
||||
$query = $this->builder()->select(["id","nombre","tipo as description"])
|
||||
->where("deleted_at",null);
|
||||
if($q){
|
||||
$query->like("nombre",$q);
|
||||
}
|
||||
if($type){
|
||||
$query->where("tipo",$type);
|
||||
}
|
||||
return $query->get()->getResultArray();
|
||||
}
|
||||
}
|
||||
|
||||
68
ci4/app/Models/Configuracion/MaquinaTareaModel.php
Normal file
68
ci4/app/Models/Configuracion/MaquinaTareaModel.php
Normal file
@ -0,0 +1,68 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Configuracion;
|
||||
|
||||
use App\Entities\Tarifas\Maquinas\TareaMaquinaEntity;
|
||||
use CodeIgniter\Model;
|
||||
|
||||
class MaquinaTareaModel extends Model
|
||||
{
|
||||
protected $table = 'maquina_tareas';
|
||||
protected $primaryKey = 'id';
|
||||
protected $useAutoIncrement = true;
|
||||
protected $returnType = TareaMaquinaEntity::class;
|
||||
protected $useSoftDeletes = true;
|
||||
protected $protectFields = true;
|
||||
protected $allowedFields = [
|
||||
"name",
|
||||
"description",
|
||||
];
|
||||
|
||||
protected bool $allowEmptyInserts = false;
|
||||
protected bool $updateOnlyChanged = true;
|
||||
|
||||
protected array $casts = [];
|
||||
protected array $castHandlers = [];
|
||||
|
||||
// Dates
|
||||
protected $useTimestamps = true;
|
||||
protected $dateFormat = 'datetime';
|
||||
protected $createdField = 'created_at';
|
||||
protected $updatedField = 'updated_at';
|
||||
protected $deletedField = 'deleted_at';
|
||||
|
||||
// Validation
|
||||
protected $validationRules = [];
|
||||
protected $validationMessages = [];
|
||||
protected $skipValidation = false;
|
||||
protected $cleanValidationRules = true;
|
||||
|
||||
// Callbacks
|
||||
protected $allowCallbacks = true;
|
||||
protected $beforeInsert = [];
|
||||
protected $afterInsert = [];
|
||||
protected $beforeUpdate = [];
|
||||
protected $afterUpdate = [];
|
||||
protected $beforeFind = [];
|
||||
protected $afterFind = [];
|
||||
protected $beforeDelete = [];
|
||||
protected $afterDelete = [];
|
||||
|
||||
/**
|
||||
* Query for select2
|
||||
*
|
||||
* @param string|null $q Query param from select2 ajax request
|
||||
* @return array
|
||||
*
|
||||
*/
|
||||
public function getSelectQuery(?string $q = null) : array
|
||||
{
|
||||
$query = $this->builder()->select(["id","name","description"])
|
||||
->where("deleted_at",null);
|
||||
if($q){
|
||||
$query->like("nombre",$q);
|
||||
}
|
||||
|
||||
return $query->get()->getResultArray();
|
||||
}
|
||||
}
|
||||
143
ci4/app/Models/Configuracion/ServicioClienteModel.php
Normal file
143
ci4/app/Models/Configuracion/ServicioClienteModel.php
Normal file
@ -0,0 +1,143 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Configuracion;
|
||||
|
||||
use App\Entities\Configuracion\ServicioClienteEntity;
|
||||
use CodeIgniter\Database\BaseBuilder;
|
||||
use CodeIgniter\Model;
|
||||
|
||||
class ServicioClienteModel extends Model
|
||||
{
|
||||
|
||||
protected $table = 'servicios_cliente';
|
||||
protected $primaryKey = 'id';
|
||||
protected $useAutoIncrement = true;
|
||||
protected $returnType = ServicioClienteEntity::class;
|
||||
protected $useSoftDeletes = true;
|
||||
protected $protectFields = true;
|
||||
protected $allowedFields = [
|
||||
"nombre",
|
||||
"code",
|
||||
];
|
||||
|
||||
protected bool $allowEmptyInserts = false;
|
||||
protected bool $updateOnlyChanged = true;
|
||||
|
||||
protected array $casts = [];
|
||||
protected array $castHandlers = [];
|
||||
|
||||
// Dates
|
||||
protected $useTimestamps = true;
|
||||
protected $dateFormat = 'datetime';
|
||||
protected $createdField = 'created_at';
|
||||
protected $updatedField = 'updated_at';
|
||||
protected $deletedField = 'deleted_at';
|
||||
|
||||
// Validation
|
||||
protected $validationRules = [];
|
||||
protected $validationMessages = [];
|
||||
protected $skipValidation = false;
|
||||
protected $cleanValidationRules = true;
|
||||
|
||||
// Callbacks
|
||||
protected $allowCallbacks = true;
|
||||
protected $beforeInsert = [];
|
||||
protected $afterInsert = [];
|
||||
protected $beforeUpdate = [];
|
||||
protected $afterUpdate = [];
|
||||
protected $beforeFind = [];
|
||||
protected $afterFind = [];
|
||||
protected $beforeDelete = [];
|
||||
protected $afterDelete = [];
|
||||
|
||||
/**
|
||||
* Query para datatable
|
||||
*
|
||||
* @return BaseBuilder
|
||||
*/
|
||||
public function getQueryDatatable(): BaseBuilder
|
||||
{
|
||||
$q = $this->builder()->select(["id", "nombre", "code", "created_at"])->where("deleted_at", null);
|
||||
return $q;
|
||||
}
|
||||
/**
|
||||
* Actualiza la tarifa de acabado `lg_tarifas_acabado` si ya existe una asociada o inserta si ya no existe.
|
||||
*
|
||||
* @param integer $servicio_cliente_id
|
||||
* @param integer $tarifa_acabado_id
|
||||
* @return boolean
|
||||
*/
|
||||
public function upsertTarifaAcabado(int $servicio_cliente_id, int $tarifa_acabado_id): bool
|
||||
{
|
||||
$servicioClienteTareaModel = model(ServicioClienteTareaModel::class);
|
||||
$q = $servicioClienteTareaModel
|
||||
->where("servicio_cliente_id", $servicio_cliente_id);
|
||||
if ($q->countAllResults() > 0) {
|
||||
$this->detachTarifas($servicio_cliente_id);
|
||||
}
|
||||
$r = $this->attachTarifaAcabado($servicio_cliente_id, $tarifa_acabado_id);
|
||||
return $r;
|
||||
}
|
||||
/**
|
||||
* Actualiza la tarifa de manipulado `lg_tarifas_manipulado` si ya existe una asociada o inserta si ya no existe.
|
||||
*
|
||||
* @param integer $servicio_cliente_id
|
||||
* @param integer $tarifa_manipulado_id
|
||||
* @return boolean
|
||||
*/
|
||||
public function upsertTarifaManipulado(int $servicio_cliente_id, int $tarifa_manipulado_id): bool
|
||||
{
|
||||
$servicioClienteTareaModel = model(ServicioClienteTareaModel::class);
|
||||
$q = $servicioClienteTareaModel
|
||||
->where("servicio_cliente_id", $servicio_cliente_id);
|
||||
if ($q->countAllResults() > 0) {
|
||||
$this->detachTarifas($servicio_cliente_id);
|
||||
}
|
||||
$r = $this->attachTarifaManipulado($servicio_cliente_id, $tarifa_manipulado_id);
|
||||
return $r;
|
||||
}
|
||||
/**
|
||||
* Asocia tarifa de acabado a servicio cliente
|
||||
*
|
||||
* @param integer $servicio_cliente_id
|
||||
* @param integer $tarifa_acabado_id
|
||||
* @return integer
|
||||
*/
|
||||
public function attachTarifaAcabado(int $servicio_cliente_id, int $tarifa_acabado_id): int
|
||||
{
|
||||
$servicioClienteTareaModel = model(ServicioClienteTareaModel::class);
|
||||
$id = $servicioClienteTareaModel->insert([
|
||||
"servicio_cliente_id" => $servicio_cliente_id,
|
||||
"tarifa_acabado_id" => $tarifa_acabado_id
|
||||
]);
|
||||
return $id;
|
||||
}
|
||||
/**
|
||||
* Asocia tarifa de manipulado a servicio cliente
|
||||
*
|
||||
* @param integer $servicio_cliente_id
|
||||
* @param integer $tarifa_manipulado_id
|
||||
* @return integer
|
||||
*/
|
||||
public function attachTarifaManipulado(int $servicio_cliente_id, int $tarifa_manipulado_id): int
|
||||
{
|
||||
$servicioClienteTareaModel = model(ServicioClienteTareaModel::class);
|
||||
$id = $servicioClienteTareaModel->insert([
|
||||
"servicio_cliente_id" => $servicio_cliente_id,
|
||||
"tarifa_manipulado_id" => $tarifa_manipulado_id
|
||||
]);
|
||||
return $id;
|
||||
}
|
||||
/**
|
||||
* Elimina todas las tarifas asociadas a un servicio cliente
|
||||
*
|
||||
* @param integer $servicio_cliente_id
|
||||
* @return bool
|
||||
*/
|
||||
public function detachTarifas(int $servicio_cliente_id): bool
|
||||
{
|
||||
$servicioClienteTareaModel = model(ServicioClienteTareaModel::class);
|
||||
$s = $servicioClienteTareaModel->where("servicio_cliente_id", $servicio_cliente_id)->delete();
|
||||
return $s;
|
||||
}
|
||||
}
|
||||
53
ci4/app/Models/Configuracion/ServicioClienteTareaModel.php
Normal file
53
ci4/app/Models/Configuracion/ServicioClienteTareaModel.php
Normal file
@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Configuracion;
|
||||
|
||||
use CodeIgniter\Database\BaseBuilder;
|
||||
use CodeIgniter\Model;
|
||||
|
||||
class ServicioClienteTareaModel extends Model
|
||||
{
|
||||
protected $table = 'servicio_cliente_tareas';
|
||||
protected $primaryKey = 'id';
|
||||
protected $useAutoIncrement = true;
|
||||
protected $returnType = 'array';
|
||||
protected $useSoftDeletes = true;
|
||||
protected $protectFields = true;
|
||||
protected $allowedFields = [
|
||||
"servicio_cliente_id",
|
||||
"tarifa_acabado_id",
|
||||
"tarifa_manipulado_id",
|
||||
];
|
||||
|
||||
protected bool $allowEmptyInserts = false;
|
||||
protected bool $updateOnlyChanged = true;
|
||||
|
||||
protected array $casts = [];
|
||||
protected array $castHandlers = [];
|
||||
|
||||
// Dates
|
||||
protected $useTimestamps = true;
|
||||
protected $dateFormat = 'datetime';
|
||||
protected $createdField = 'created_at';
|
||||
protected $updatedField = 'updated_at';
|
||||
protected $deletedField = 'deleted_at';
|
||||
|
||||
// Validation
|
||||
protected $validationRules = [];
|
||||
protected $validationMessages = [];
|
||||
protected $skipValidation = false;
|
||||
protected $cleanValidationRules = true;
|
||||
|
||||
// Callbacks
|
||||
protected $allowCallbacks = true;
|
||||
protected $beforeInsert = [];
|
||||
protected $afterInsert = [];
|
||||
protected $beforeUpdate = [];
|
||||
protected $afterUpdate = [];
|
||||
protected $beforeFind = [];
|
||||
protected $afterFind = [];
|
||||
protected $beforeDelete = [];
|
||||
protected $afterDelete = [];
|
||||
|
||||
|
||||
}
|
||||
132
ci4/app/Models/OrdenTrabajo/OrdenTrabajoDate.php
Normal file
132
ci4/app/Models/OrdenTrabajo/OrdenTrabajoDate.php
Normal file
@ -0,0 +1,132 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\OrdenTrabajo;
|
||||
|
||||
use App\Entities\Produccion\OrdenTrabajoDateEntity;
|
||||
use CodeIgniter\Database\MySQLi\Builder;
|
||||
use CodeIgniter\Model;
|
||||
|
||||
class OrdenTrabajoDate extends Model
|
||||
{
|
||||
protected $table = 'orden_trabajo_dates';
|
||||
protected $primaryKey = 'orden_trabajo_id';
|
||||
protected $useAutoIncrement = false;
|
||||
protected $returnType = OrdenTrabajoDateEntity::class;
|
||||
protected $useSoftDeletes = true;
|
||||
protected $protectFields = true;
|
||||
protected $allowedFields = [
|
||||
"orden_trabajo_id",
|
||||
"fecha_entrada_at",
|
||||
"fecha_entrega_at",
|
||||
"fecha_entrega_real_at",
|
||||
"fecha_entrega_change_at",
|
||||
"fecha_impresion_at",
|
||||
"fecha_encuadernado_at",
|
||||
"fecha_externo_at",
|
||||
"pendiente_ferro_at",
|
||||
"ferro_en_cliente_at",
|
||||
"ferro_ok_at",
|
||||
"interior_bn_at",
|
||||
"interior_color_at",
|
||||
"preparacion_interiores_at",
|
||||
"cubierta_at",
|
||||
"plastificado_at",
|
||||
"encuadernacion_at",
|
||||
"corte_at",
|
||||
"embalaje_at",
|
||||
"envio_at",
|
||||
"entrada_manipulado_at"
|
||||
];
|
||||
|
||||
protected bool $allowEmptyInserts = false;
|
||||
protected bool $updateOnlyChanged = true;
|
||||
|
||||
protected array $casts = [
|
||||
];
|
||||
protected array $castHandlers = [];
|
||||
|
||||
// Dates
|
||||
protected $useTimestamps = true;
|
||||
protected $dateFormat = 'datetime';
|
||||
protected $createdField = 'created_at';
|
||||
protected $updatedField = 'updated_at';
|
||||
protected $deletedField = 'deleted_at';
|
||||
|
||||
// Validation
|
||||
protected $validationRules = [];
|
||||
protected $validationMessages = [];
|
||||
protected $skipValidation = false;
|
||||
protected $cleanValidationRules = true;
|
||||
|
||||
// Callbacks
|
||||
protected $allowCallbacks = true;
|
||||
protected $beforeInsert = [];
|
||||
protected $afterInsert = ["updateOrdenTrabajoUser"];
|
||||
protected $beforeUpdate = ["updateOrdenTrabajoUser"];
|
||||
protected $afterUpdate = [];
|
||||
protected $beforeFind = [];
|
||||
protected $afterFind = [];
|
||||
protected $beforeDelete = [];
|
||||
protected $afterDelete = [];
|
||||
|
||||
/**
|
||||
* Query datatable
|
||||
*
|
||||
* @return Builder
|
||||
*/
|
||||
protected function getQueryDatatable(): Builder
|
||||
{
|
||||
$q = $this->builder()
|
||||
->select([
|
||||
"orden_trabajo_tareas.orden",
|
||||
"mp.nombre as maquina_presupuesto",
|
||||
"m.nombre as maquina_tarea",
|
||||
"orden_trabajo_tareas.tiempo_estimado",
|
||||
"orden_trabajo_tareas.tiempo_real"
|
||||
])
|
||||
->join("presupuesto_linea", "presupuesto_linea.id = orden_trabajo_tareas.presupuesto_linea_id", "left")
|
||||
->join("lg_maquinas m", "lg_maquinas.id = orden_trabajo_tareas.maquina_id", "left")
|
||||
->join("lg_maquinas mp", "lg_maquinas.id = presupuesto_linea.maquina_id", "left")
|
||||
->join("lg_imposiciones", "lg_imposiciones.id = orden_trabajo_tareas.imposicion_id", "left")
|
||||
->where("orden_trabajo_tareas.deleted_at", NULL);
|
||||
|
||||
return $q;
|
||||
}
|
||||
|
||||
protected function updateOrdenTrabajoUser(array $data) : array
|
||||
{
|
||||
if(!isset($data["data"])){
|
||||
return $data;
|
||||
}else{
|
||||
$this->updateUserDateMap($data["data"]);
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
protected function updateUserDateMap($data){
|
||||
$mapping = [
|
||||
"fecha_encuadernado_at" => "encuadernacion_user_id",
|
||||
// "fecha_externo_at" => "null",
|
||||
"fecha_impresion_at" => "null",
|
||||
"pendiente_ferro_at" => "pendiente_ferro_user_id",
|
||||
"ferro_en_cliente_at" => "ferro_en_cliente_user_id",
|
||||
"ferro_ok_at" => "ferro_ok_user_id",
|
||||
"interior_bn_at" => "interior_bn_user_id",
|
||||
"interior_color_at" => "interior_color_user_id",
|
||||
"preparacion_interiores_at" => "preparacion_interior_user_id",
|
||||
"cubierta_at" => "cubierta_user_id",
|
||||
"plastificado_at" => "plastificado_user_id",
|
||||
"corte_at" => "corte_user_id",
|
||||
"embalaje_at" => "embalaje_user_id",
|
||||
"entrada_manipulado_at" => "entrada_manipulado_user_id"
|
||||
];
|
||||
$otUser = model(OrdenTrabajoUser::class);
|
||||
$auth_user_id = auth()->user()->id;
|
||||
foreach ($data as $key => $value) {
|
||||
if(isset($mapping[$key])){
|
||||
if($value){
|
||||
$otUser->update($data["orden_trabajo_id"],[$mapping[$key] => $auth_user_id]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
120
ci4/app/Models/OrdenTrabajo/OrdenTrabajoModel.php
Normal file
120
ci4/app/Models/OrdenTrabajo/OrdenTrabajoModel.php
Normal file
@ -0,0 +1,120 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\OrdenTrabajo;
|
||||
|
||||
use App\Entities\Produccion\OrdenTrabajoEntity;
|
||||
use CodeIgniter\Database\BaseBuilder;
|
||||
use CodeIgniter\Model;
|
||||
class OrdenTrabajoModel extends Model
|
||||
{
|
||||
protected $table = 'ordenes_trabajo';
|
||||
protected $primaryKey = 'id';
|
||||
protected $useAutoIncrement = true;
|
||||
protected $returnType = OrdenTrabajoEntity::class;
|
||||
protected $useSoftDeletes = true;
|
||||
protected $protectFields = true;
|
||||
protected $allowedFields = [
|
||||
"pedido_id",
|
||||
"user_created_id",
|
||||
"user_updated_id",
|
||||
"fecha_entrega_warning",
|
||||
"fecha_entrega_warning_revised",
|
||||
"total_tirada",
|
||||
"total_precio",
|
||||
"tipo_entrada",
|
||||
"progreso",
|
||||
"estado",
|
||||
"comentarios",
|
||||
"revisar_formato",
|
||||
"revisar_lomo",
|
||||
"revisar_solapa",
|
||||
"revisar_isbn",
|
||||
"revisar_codigo_barras",
|
||||
"realizar_imposicion",
|
||||
"enviar_impresion",
|
||||
"portada_path",
|
||||
];
|
||||
|
||||
protected bool $allowEmptyInserts = false;
|
||||
protected bool $updateOnlyChanged = true;
|
||||
|
||||
protected array $casts = [
|
||||
"pedido_id" => "integer",
|
||||
"user_created_id" => "?integer",
|
||||
"user_updated_id" => "?integer",
|
||||
"fecha_entrega_warning" => "bool",
|
||||
"fecha_entrega_warning_revised" => "bool",
|
||||
"total_tirada" => "?integer",
|
||||
"total_precio" => "?integer",
|
||||
"tipo_entrada" => "?integer",
|
||||
"progreso" => "float",
|
||||
"revisar_formato" => "bool",
|
||||
"revisar_lomo" => "bool",
|
||||
"revisar_solapa" => "bool",
|
||||
"revisar_isbn" => "bool",
|
||||
"revisar_codigo_barras" => "bool",
|
||||
"realizar_imposicion" => "bool",
|
||||
"enviar_impresion" => "bool"
|
||||
];
|
||||
protected array $castHandlers = [];
|
||||
|
||||
// Dates
|
||||
protected $useTimestamps = true;
|
||||
protected $dateFormat = 'datetime';
|
||||
protected $createdField = 'created_at';
|
||||
protected $updatedField = 'updated_at';
|
||||
protected $deletedField = 'deleted_at';
|
||||
|
||||
// Validation
|
||||
protected $validationRules = [];
|
||||
protected $validationMessages = [];
|
||||
protected $skipValidation = false;
|
||||
protected $cleanValidationRules = true;
|
||||
|
||||
// Callbacks
|
||||
protected $allowCallbacks = true;
|
||||
protected $beforeInsert = [];
|
||||
protected $afterInsert = [];
|
||||
protected $beforeUpdate = [];
|
||||
protected $afterUpdate = [];
|
||||
protected $beforeFind = [];
|
||||
protected $afterFind = [];
|
||||
protected $beforeDelete = [];
|
||||
protected $afterDelete = [];
|
||||
|
||||
public function getDatatableQuery() : BaseBuilder
|
||||
{
|
||||
$q = $this->builder()
|
||||
->select([
|
||||
"ordenes_trabajo.id",
|
||||
"ordenes_trabajo.pedido_id",
|
||||
"orden_trabajo_dates.fecha_encuadernado_at",
|
||||
"clientes.nombre as cliente_nombre",
|
||||
"presupuestos.titulo as presupuesto_titulo",
|
||||
"ordenes_trabajo.estado",
|
||||
"ubicaciones.nombre as ubicacion_nombre",
|
||||
"pedidos.total_tirada",
|
||||
"tipos_presupuestos.codigo as tipo_presupuesto_impresion",
|
||||
"ordenes_trabajo.progreso",
|
||||
"presupuesto_linea.tipo as presupuesto_linea_tipo",
|
||||
"orden_trabajo_dates.ferro_ok_at"
|
||||
])
|
||||
->join("orden_trabajo_dates","orden_trabajo_dates.orden_trabajo_id = ordenes_trabajo.id","left")
|
||||
->join("pedidos","pedidos.id = ordenes_trabajo.pedido_id","left")
|
||||
->join("pedidos_linea","pedidos.id = pedidos_linea.pedido_id","left")
|
||||
->join("presupuestos","presupuestos.id = pedidos_linea.presupuesto_id","left")
|
||||
->join("presupuesto_linea","presupuestos.id = presupuesto_linea.presupuesto_id","left")
|
||||
->join("clientes","clientes.id = presupuestos.cliente_id","left")
|
||||
->join("tipos_presupuestos","presupuestos.tipo_impresion_id = tipos_presupuestos.id","left")
|
||||
->join("ubicaciones","ubicaciones.id = pedidos_linea.ubicacion_id","left")
|
||||
->whereIn("presupuesto_linea.tipo",["lp_bn","lp_bnhq","lp_rot_bn","lp_color","lp_colorhq","lp_rot_color"])
|
||||
->where("ordenes_trabajo.deleted_at",null)
|
||||
->groupBy("ordenes_trabajo.id");
|
||||
return $q;
|
||||
}
|
||||
|
||||
public function updateMaquinas(OrdenTrabajoEntity $ot)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
90
ci4/app/Models/OrdenTrabajo/OrdenTrabajoTarea.php
Normal file
90
ci4/app/Models/OrdenTrabajo/OrdenTrabajoTarea.php
Normal file
@ -0,0 +1,90 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\OrdenTrabajo;
|
||||
|
||||
use App\Entities\Produccion\OrdenTrabajoTareaEntity;
|
||||
use CodeIgniter\Database\MySQLi\Builder;
|
||||
use CodeIgniter\Model;
|
||||
|
||||
class OrdenTrabajoTarea extends Model
|
||||
{
|
||||
protected $table = 'orden_trabajo_tareas';
|
||||
protected $primaryKey = 'id';
|
||||
protected $useAutoIncrement = true;
|
||||
protected $returnType = OrdenTrabajoTareaEntity::class;
|
||||
protected $useSoftDeletes = true;
|
||||
protected $protectFields = true;
|
||||
protected $allowedFields = [
|
||||
"orden_trabajo_id",
|
||||
"presupuesto_linea_id",
|
||||
"presupuesto_acabado_id",
|
||||
"presupuesto_preimpresion_id",
|
||||
"presupuesto_encuadernado_id",
|
||||
"presupuesto_extra_id",
|
||||
"presupuesto_manipulado_id",
|
||||
"nombre",
|
||||
"orden",
|
||||
"maquina_id",
|
||||
"imposicion_id",
|
||||
"tiempo_estimado",
|
||||
"tiempo_real",
|
||||
"comment"
|
||||
];
|
||||
|
||||
protected bool $allowEmptyInserts = false;
|
||||
protected bool $updateOnlyChanged = true;
|
||||
|
||||
protected array $casts = [];
|
||||
protected array $castHandlers = [];
|
||||
|
||||
// Dates
|
||||
protected $useTimestamps = true;
|
||||
protected $dateFormat = 'datetime';
|
||||
protected $createdField = 'created_at';
|
||||
protected $updatedField = 'updated_at';
|
||||
protected $deletedField = 'deleted_at';
|
||||
|
||||
// Validation
|
||||
protected $validationRules = [];
|
||||
protected $validationMessages = [];
|
||||
protected $skipValidation = false;
|
||||
protected $cleanValidationRules = true;
|
||||
|
||||
// Callbacks
|
||||
protected $allowCallbacks = true;
|
||||
protected $beforeInsert = [];
|
||||
protected $afterInsert = [];
|
||||
protected $beforeUpdate = [];
|
||||
protected $afterUpdate = [];
|
||||
protected $beforeFind = [];
|
||||
protected $afterFind = [];
|
||||
protected $beforeDelete = [];
|
||||
protected $afterDelete = [];
|
||||
|
||||
/**
|
||||
* Query datatable
|
||||
*
|
||||
* @return Builder
|
||||
*/
|
||||
protected function getQueryDatatable() : Builder
|
||||
{
|
||||
$q = $this->builder()
|
||||
->select([
|
||||
"orden_trabajo_tareas.orden",
|
||||
"mp.nombre as maquina_presupuesto",
|
||||
"m.nombre as maquina_tarea",
|
||||
"orden_trabajo_tareas.tiempo_estimado",
|
||||
"orden_trabajo_tareas.tiempo_real"
|
||||
])
|
||||
->join("presupuesto_linea","presupuesto_linea.id = orden_trabajo_tareas.presupuesto_linea_id","left")
|
||||
->join("lg_maquinas m","lg_maquinas.id = orden_trabajo_tareas.maquina_id","left")
|
||||
->join("lg_maquinas mp","lg_maquinas.id = presupuesto_linea.maquina_id","left")
|
||||
->join("lg_imposiciones", "lg_imposiciones.id = orden_trabajo_tareas.imposicion_id" , "left")
|
||||
->where("orden_trabajo_tareas.deleted_at" , NULL);
|
||||
|
||||
return $q;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
103
ci4/app/Models/OrdenTrabajo/OrdenTrabajoUser.php
Normal file
103
ci4/app/Models/OrdenTrabajo/OrdenTrabajoUser.php
Normal file
@ -0,0 +1,103 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\OrdenTrabajo;
|
||||
|
||||
use App\Entities\Produccion\OrdenTrabajoUserEntity;
|
||||
use CodeIgniter\Database\MySQLi\Builder;
|
||||
use CodeIgniter\Model;
|
||||
|
||||
class OrdenTrabajoUser extends Model
|
||||
{
|
||||
protected $table = 'orden_trabajo_users';
|
||||
protected $primaryKey = 'orden_trabajo_id';
|
||||
protected $useAutoIncrement = false;
|
||||
protected $returnType = OrdenTrabajoUserEntity::class;
|
||||
protected $useSoftDeletes = true;
|
||||
protected $protectFields = true;
|
||||
protected $allowedFields = [
|
||||
"orden_trabajo_id",
|
||||
"user_created_id",
|
||||
"user_update_id",
|
||||
"inaplazable_revised_change_user_id",
|
||||
"ferro_disponible_hecho_user_id",
|
||||
"ferro_disponible_ok_user_id",
|
||||
"ferro_entregado_user_id",
|
||||
"pendiente_ferro_user_id",
|
||||
"ferro_en_cliente_user_id",
|
||||
"ferro_ok_user_id",
|
||||
"interior_bn_user_id",
|
||||
"interior_color_user_id",
|
||||
"preparacion_interior_user_id",
|
||||
"cubierta_user_id",
|
||||
"plastificado_user_id",
|
||||
"encuadernacion_user_id",
|
||||
"corte_user_id",
|
||||
"embalaje_user_id",
|
||||
"entrada_manipulado_user_id",
|
||||
"pre_formato_user_id",
|
||||
"pre_lomo_user_id",
|
||||
"pre_solapa_user_id",
|
||||
"pre_codbarras_user_id",
|
||||
"pre_imposicion_user_id",
|
||||
"pre_imprimir_user_id"
|
||||
];
|
||||
|
||||
protected bool $allowEmptyInserts = false;
|
||||
protected bool $updateOnlyChanged = true;
|
||||
|
||||
protected array $casts = [
|
||||
"orden_trabajo_id" => "integer",
|
||||
"user_created_id" => "?integer",
|
||||
"user_update_id" => "?integer",
|
||||
"inaplazable_revised_change_user_id" => "?integer",
|
||||
"ferro_disponible_hecho_user_id" => "?integer",
|
||||
"ferro_disponible_ok_user_id" => "?integer",
|
||||
"ferro_entregado_user_id" => "?integer",
|
||||
"pendiente_ferro_user_id" => "?integer",
|
||||
"ferro_en_cliente_user_id" => "?integer",
|
||||
"ferro_ok_user_id" => "?integer",
|
||||
"interior_bn_user_id" => "?integer",
|
||||
"interior_color_user_id" => "?integer",
|
||||
"preparacion_interior_user_id" => "?integer",
|
||||
"cubierta_user_id" => "?integer",
|
||||
"plastificado_user_id" => "?integer",
|
||||
"encuadernacion_user_id" => "?integer",
|
||||
"corte_user_id" => "?integer",
|
||||
"embalaje_user_id" => "?integer",
|
||||
"entrada_manipulado_user_id" => "?integer",
|
||||
"pre_formato_user_id" => "?integer",
|
||||
"pre_lomo_user_id" => "?integer",
|
||||
"pre_solapa_user_id" => "?integer",
|
||||
"pre_codbarras_user_id" => "?integer",
|
||||
"pre_imposicion_user_id" => "?integer",
|
||||
"pre_imprimir_user_id" => "?integer"
|
||||
];
|
||||
protected array $castHandlers = [];
|
||||
|
||||
// Dates
|
||||
protected $useTimestamps = true;
|
||||
protected $dateFormat = 'datetime';
|
||||
protected $createdField = 'created_at';
|
||||
protected $updatedField = 'updated_at';
|
||||
protected $deletedField = 'deleted_at';
|
||||
|
||||
// Validation
|
||||
protected $validationRules = [];
|
||||
protected $validationMessages = [];
|
||||
protected $skipValidation = false;
|
||||
protected $cleanValidationRules = true;
|
||||
|
||||
// Callbacks
|
||||
protected $allowCallbacks = true;
|
||||
protected $beforeInsert = [];
|
||||
protected $afterInsert = [];
|
||||
protected $beforeUpdate = [];
|
||||
protected $afterUpdate = [];
|
||||
protected $beforeFind = [];
|
||||
protected $afterFind = [];
|
||||
protected $beforeDelete = [];
|
||||
protected $afterDelete = [];
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -2,6 +2,9 @@
|
||||
|
||||
namespace App\Models\Pedidos;
|
||||
|
||||
use App\Entities\Presupuestos\OrdenTrabajoEntity;
|
||||
use App\Models\OrdenTrabajo\OrdenTrabajoModel;
|
||||
|
||||
use function PHPSTORM_META\map;
|
||||
|
||||
class PedidoModel extends \App\Models\BaseModel
|
||||
@ -90,7 +93,7 @@ class PedidoModel extends \App\Models\BaseModel
|
||||
|
||||
return $lineasPresupuesto;
|
||||
}
|
||||
public function getPedidoPresupuestoTipoImpresion(int $presupuesto_id) : array|object|null
|
||||
public function getPedidoPresupuestoTipoImpresion(int $presupuesto_id): array|object|null
|
||||
{
|
||||
$q = $this->db->table($this->table)
|
||||
->select(
|
||||
@ -185,15 +188,51 @@ class PedidoModel extends \App\Models\BaseModel
|
||||
public function getPedidoPresupuestoFicheros($pedido_id)
|
||||
{
|
||||
$query = $this->db->table($this->table)
|
||||
->select([
|
||||
'presupuesto_ficheros.nombre as fileName',
|
||||
'presupuesto_ficheros.file_path as filePath'
|
||||
])
|
||||
->join('pedidos_linea', 'pedidos_linea.id = pedidos.id', 'left')
|
||||
->join('presupuestos', 'presupuestos.id = pedidos_linea.presupuesto_id', 'left')
|
||||
->join('presupuesto_ficheros', 'presupuesto_ficheros.presupuesto_id = presupuestos.id', 'left')
|
||||
->where('pedidos.id', $pedido_id);
|
||||
$presupuesto_ficheros = $query->get()->getFirstRow();
|
||||
return $presupuesto_ficheros;
|
||||
->select([
|
||||
'presupuesto_ficheros.nombre as fileName',
|
||||
'presupuesto_ficheros.file_path as filePath'
|
||||
])
|
||||
->join('pedidos_linea', 'pedidos_linea.id = pedidos.id', 'left')
|
||||
->join('presupuestos', 'presupuestos.id = pedidos_linea.presupuesto_id', 'left')
|
||||
->join('presupuesto_ficheros', 'presupuesto_ficheros.presupuesto_id = presupuestos.id', 'left')
|
||||
->where('pedidos.id', $pedido_id);
|
||||
$presupuesto_ficheros = $query->get()->getFirstRow();
|
||||
return $presupuesto_ficheros;
|
||||
}
|
||||
|
||||
/**
|
||||
* Crea una orden de trabajo asociada al pedido
|
||||
*
|
||||
* @param integer $pedido_id
|
||||
* @return void
|
||||
*/
|
||||
public function createOrdenTrabajo(int $pedido_id)
|
||||
{
|
||||
$otModel = model(OrdenTrabajoModel::class);
|
||||
$ot = new OrdenTrabajoEntity(["pedido_id" => $pedido_id]);
|
||||
$existOt = $this->hasOrdenTrabajo($pedido_id);
|
||||
if ($existOt) {
|
||||
$ot = $otModel->find($pedido_id);
|
||||
return $ot;
|
||||
}
|
||||
$otModel->updateMaquinas($ot);
|
||||
}
|
||||
|
||||
/**
|
||||
* Comprueba si el pedido tiene ya una orden de trabajo asociada
|
||||
*
|
||||
* @param integer $pedido_id
|
||||
* @return boolean
|
||||
*/
|
||||
public function hasOrdenTrabajo(int $pedido_id): bool
|
||||
{
|
||||
$hasOrdenTrabajo = false;
|
||||
$q = $this->builder()->select("orden_trabajo.pedido_id")
|
||||
->join("ordenes_trabajo", "ordenes_trabajo.pedido_id = pedidos.id", "left")
|
||||
->where("ordenes_trabajo.pedido_id", $pedido_id)->countAllResults();
|
||||
if ($q > 0) {
|
||||
$hasOrdenTrabajo = true;
|
||||
}
|
||||
return $hasOrdenTrabajo;
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,75 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Tarifas\Maquinas;
|
||||
|
||||
use App\Entities\Tarifas\Maquinas\TarifaAcabadoMaquinaEntity;
|
||||
use CodeIgniter\Database\BaseBuilder;
|
||||
use CodeIgniter\Model;
|
||||
|
||||
class TarifaAcabadoMaquinaModel extends Model
|
||||
{
|
||||
protected $table = 'tarifa_acabado_maquinas';
|
||||
protected $primaryKey = 'id';
|
||||
protected $useAutoIncrement = true;
|
||||
protected $returnType = TarifaAcabadoMaquinaEntity::class;
|
||||
protected $useSoftDeletes = true;
|
||||
protected $protectFields = true;
|
||||
protected $allowedFields = [
|
||||
"tarifa_acabado_id",
|
||||
"maquina_id",
|
||||
"maquina_tarea_id"
|
||||
];
|
||||
|
||||
protected bool $allowEmptyInserts = false;
|
||||
protected bool $updateOnlyChanged = true;
|
||||
|
||||
protected array $casts = [];
|
||||
protected array $castHandlers = [];
|
||||
|
||||
// Dates
|
||||
protected $useTimestamps = true;
|
||||
protected $dateFormat = 'datetime';
|
||||
protected $createdField = 'created_at';
|
||||
protected $updatedField = 'updated_at';
|
||||
protected $deletedField = 'deleted_at';
|
||||
|
||||
// Validation
|
||||
protected $validationRules = [];
|
||||
protected $validationMessages = [];
|
||||
protected $skipValidation = false;
|
||||
protected $cleanValidationRules = true;
|
||||
|
||||
// Callbacks
|
||||
protected $allowCallbacks = true;
|
||||
protected $beforeInsert = [];
|
||||
protected $afterInsert = [];
|
||||
protected $beforeUpdate = [];
|
||||
protected $afterUpdate = [];
|
||||
protected $beforeFind = [];
|
||||
protected $afterFind = [];
|
||||
protected $beforeDelete = [];
|
||||
protected $afterDelete = [];
|
||||
|
||||
/**
|
||||
* Query for datatable
|
||||
*
|
||||
* @param integer|null $tarifa_acabado_id
|
||||
* @return BaseBuilder
|
||||
*/
|
||||
public function queryDatatable(?int $tarifa_acabado_id = null) : BaseBuilder
|
||||
{
|
||||
$query = $this->builder()->select(
|
||||
[
|
||||
"tarifa_acabado_maquinas.id",
|
||||
"lg_maquinas.nombre as maquinaNombre",
|
||||
"maquina_tareas.name as tareaNombre"
|
||||
]
|
||||
)->join("lg_maquinas","lg_maquinas.id = tarifa_acabado_maquinas.maquina_id","left")
|
||||
->join("maquina_tareas","maquina_tareas.id = tarifa_acabado_maquinas.maquina_tarea_id","left")
|
||||
->where("tarifa_acabado_maquinas.deleted_at",null);
|
||||
if ($tarifa_acabado_id)
|
||||
$query->where("tarifa_acabado_maquinas.tarifa_acabado_id", $tarifa_acabado_id);
|
||||
return $query;
|
||||
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,74 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Tarifas\Maquinas;
|
||||
|
||||
|
||||
use App\Entities\Tarifas\Maquinas\TarifaEncuadernacionMaquinaEntity;
|
||||
use CodeIgniter\Database\BaseBuilder;
|
||||
use CodeIgniter\Model;
|
||||
|
||||
class TarifaEncuadernacionMaquinaModel extends Model
|
||||
{
|
||||
protected $table = 'tarifa_encuadernacion_maquinas';
|
||||
protected $primaryKey = 'id';
|
||||
protected $useAutoIncrement = true;
|
||||
protected $returnType = TarifaEncuadernacionMaquinaEntity::class;
|
||||
protected $useSoftDeletes = true;
|
||||
protected $protectFields = true;
|
||||
protected $allowedFields = [
|
||||
"tarifa_encuadernacion_id",
|
||||
"maquina_id",
|
||||
"maquina_tarea_id"
|
||||
];
|
||||
|
||||
protected bool $allowEmptyInserts = false;
|
||||
protected bool $updateOnlyChanged = true;
|
||||
|
||||
protected array $casts = [];
|
||||
protected array $castHandlers = [];
|
||||
|
||||
// Dates
|
||||
protected $useTimestamps = true;
|
||||
protected $dateFormat = 'datetime';
|
||||
protected $createdField = 'created_at';
|
||||
protected $updatedField = 'updated_at';
|
||||
protected $deletedField = 'deleted_at';
|
||||
|
||||
// Validation
|
||||
protected $validationRules = [];
|
||||
protected $validationMessages = [];
|
||||
protected $skipValidation = false;
|
||||
protected $cleanValidationRules = true;
|
||||
|
||||
// Callbacks
|
||||
protected $allowCallbacks = true;
|
||||
protected $beforeInsert = [];
|
||||
protected $afterInsert = [];
|
||||
protected $beforeUpdate = [];
|
||||
protected $afterUpdate = [];
|
||||
protected $beforeFind = [];
|
||||
protected $afterFind = [];
|
||||
protected $beforeDelete = [];
|
||||
protected $afterDelete = [];
|
||||
/**
|
||||
* Query for datatable
|
||||
*
|
||||
* @param integer|null $tarifa_encuadernacion_id
|
||||
* @return BaseBuilder
|
||||
*/
|
||||
public function queryDatatable(?int $tarifa_encuadernacion_id = null): BaseBuilder
|
||||
{
|
||||
$query = $this->builder()->select(
|
||||
[
|
||||
"tarifa_encuadernacion_maquinas.id",
|
||||
"lg_maquinas.nombre as maquinaNombre",
|
||||
"maquina_tareas.name as tareaNombre"
|
||||
]
|
||||
)->join("lg_maquinas","lg_maquinas.id = tarifa_encuadernacion_maquinas.maquina_id","left")
|
||||
->join("maquina_tareas","maquina_tareas.id = tarifa_encuadernacion_maquinas.maquina_tarea_id","left")
|
||||
->where("tarifa_encuadernacion_maquinas.deleted_at",null);
|
||||
if ($tarifa_encuadernacion_id)
|
||||
$query->where("tarifa_encuadernacion_maquinas.tarifa_encuadernacion_id", $tarifa_encuadernacion_id);
|
||||
return $query;
|
||||
}
|
||||
}
|
||||
75
ci4/app/Models/Tarifas/Maquinas/TarifaExtraMaquinaModel.php
Normal file
75
ci4/app/Models/Tarifas/Maquinas/TarifaExtraMaquinaModel.php
Normal file
@ -0,0 +1,75 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Tarifas\Maquinas;
|
||||
|
||||
|
||||
use App\Entities\Tarifas\Maquinas\TarifaExtraMaquinaEntity;
|
||||
use CodeIgniter\Database\BaseBuilder;
|
||||
use CodeIgniter\Model;
|
||||
|
||||
class TarifaExtraMaquinaModel extends Model
|
||||
{
|
||||
protected $table = 'tarifa_acabado_maquinas';
|
||||
protected $primaryKey = 'id';
|
||||
protected $useAutoIncrement = true;
|
||||
protected $returnType = TarifaExtraMaquinaEntity::class;
|
||||
protected $useSoftDeletes = true;
|
||||
protected $protectFields = true;
|
||||
protected $allowedFields = [
|
||||
"tarifa_extra_id",
|
||||
"maquina_id",
|
||||
"maquina_tarea_id"
|
||||
];
|
||||
|
||||
protected bool $allowEmptyInserts = false;
|
||||
protected bool $updateOnlyChanged = true;
|
||||
|
||||
protected array $casts = [];
|
||||
protected array $castHandlers = [];
|
||||
|
||||
// Dates
|
||||
protected $useTimestamps = true;
|
||||
protected $dateFormat = 'datetime';
|
||||
protected $createdField = 'created_at';
|
||||
protected $updatedField = 'updated_at';
|
||||
protected $deletedField = 'deleted_at';
|
||||
|
||||
// Validation
|
||||
protected $validationRules = [];
|
||||
protected $validationMessages = [];
|
||||
protected $skipValidation = false;
|
||||
protected $cleanValidationRules = true;
|
||||
|
||||
// Callbacks
|
||||
protected $allowCallbacks = true;
|
||||
protected $beforeInsert = [];
|
||||
protected $afterInsert = [];
|
||||
protected $beforeUpdate = [];
|
||||
protected $afterUpdate = [];
|
||||
protected $beforeFind = [];
|
||||
protected $afterFind = [];
|
||||
protected $beforeDelete = [];
|
||||
protected $afterDelete = [];
|
||||
|
||||
/**
|
||||
* Query for datatable
|
||||
*
|
||||
* @param integer|null $tarifa_extra_id
|
||||
* @return BaseBuilder
|
||||
*/
|
||||
public function queryDatatable(?int $tarifa_extra_id = null): BaseBuilder
|
||||
{
|
||||
$query = $this->builder()->select(
|
||||
[
|
||||
"tarifa_extra_maquinas.id",
|
||||
"lg_maquinas.nombre as maquinaNombre",
|
||||
"maquina_tareas.name as tareaNombre"
|
||||
]
|
||||
)->join("lg_maquinas", "lg_maquinas.id = tarifa_extra_maquinas.maquina_id", "left")
|
||||
->join("maquina_tareas", "maquina_tareas.id = tarifa_extra_maquinas.maquina_tarea_id", "left")
|
||||
->where("tarifa_extra_maquinas.deleted_at", null);
|
||||
if ($tarifa_extra_id)
|
||||
$query->where("tarifa_extra_maquinas.tarifa_extra_id", $tarifa_extra_id);
|
||||
return $query;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,75 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Tarifas\Maquinas;
|
||||
|
||||
|
||||
use App\Entities\Tarifas\Maquinas\TarifaManipuladoMaquinaEntity;
|
||||
use CodeIgniter\Database\BaseBuilder;
|
||||
use CodeIgniter\Model;
|
||||
|
||||
class TarifaManipuladoMaquinaModel extends Model
|
||||
{
|
||||
protected $table = 'tarifa_manipulado_maquinas';
|
||||
protected $primaryKey = 'id';
|
||||
protected $useAutoIncrement = true;
|
||||
protected $returnType = TarifaManipuladoMaquinaEntity::class;
|
||||
protected $useSoftDeletes = true;
|
||||
protected $protectFields = true;
|
||||
protected $allowedFields = [
|
||||
"tarifa_manipulado_id",
|
||||
"maquina_id",
|
||||
"maquina_tarea_id"
|
||||
];
|
||||
|
||||
protected bool $allowEmptyInserts = false;
|
||||
protected bool $updateOnlyChanged = true;
|
||||
|
||||
protected array $casts = [];
|
||||
protected array $castHandlers = [];
|
||||
|
||||
// Dates
|
||||
protected $useTimestamps = true;
|
||||
protected $dateFormat = 'datetime';
|
||||
protected $createdField = 'created_at';
|
||||
protected $updatedField = 'updated_at';
|
||||
protected $deletedField = 'deleted_at';
|
||||
|
||||
// Validation
|
||||
protected $validationRules = [];
|
||||
protected $validationMessages = [];
|
||||
protected $skipValidation = false;
|
||||
protected $cleanValidationRules = true;
|
||||
|
||||
// Callbacks
|
||||
protected $allowCallbacks = true;
|
||||
protected $beforeInsert = [];
|
||||
protected $afterInsert = [];
|
||||
protected $beforeUpdate = [];
|
||||
protected $afterUpdate = [];
|
||||
protected $beforeFind = [];
|
||||
protected $afterFind = [];
|
||||
protected $beforeDelete = [];
|
||||
protected $afterDelete = [];
|
||||
|
||||
/**
|
||||
* Query for datatable
|
||||
*
|
||||
* @param integer|null $tarifa_manipulado_id
|
||||
* @return BaseBuilder
|
||||
*/
|
||||
public function queryDatatable(?int $tarifa_manipulado_id = null): BaseBuilder
|
||||
{
|
||||
$query = $this->builder()->select(
|
||||
[
|
||||
"tarifa_manipulado_maquinas.id",
|
||||
"lg_maquinas.nombre as maquinaNombre",
|
||||
"maquina_tareas.name as tareaNombre"
|
||||
]
|
||||
)->join("lg_maquinas", "lg_maquinas.id = tarifa_manipulado_maquinas.maquina_id", "left")
|
||||
->join("maquina_tareas", "maquina_tareas.id = tarifa_manipulado_maquinas.maquina_tarea_id", "left")
|
||||
->where("tarifa_manipulado_maquinas.deleted_at", null);
|
||||
if ($tarifa_manipulado_id)
|
||||
$query->where("tarifa_manipulado_maquinas.tarifa_manipulado_id", $tarifa_manipulado_id);
|
||||
return $query;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,75 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Tarifas\Maquinas;
|
||||
|
||||
|
||||
use App\Entities\Tarifas\Maquinas\TarifaPreimpresionMaquinaEntity;
|
||||
use CodeIgniter\Database\BaseBuilder;
|
||||
use CodeIgniter\Model;
|
||||
|
||||
class TarifaPreimpresionMaquinaModel extends Model
|
||||
{
|
||||
protected $table = 'tarifa_acabado_maquinas';
|
||||
protected $primaryKey = 'id';
|
||||
protected $useAutoIncrement = true;
|
||||
protected $returnType = TarifaPreimpresionMaquinaEntity::class;
|
||||
protected $useSoftDeletes = true;
|
||||
protected $protectFields = true;
|
||||
protected $allowedFields = [
|
||||
"tarifa_preimpresion_id",
|
||||
"maquina_id",
|
||||
"maquina_tarea_id"
|
||||
];
|
||||
|
||||
protected bool $allowEmptyInserts = false;
|
||||
protected bool $updateOnlyChanged = true;
|
||||
|
||||
protected array $casts = [];
|
||||
protected array $castHandlers = [];
|
||||
|
||||
// Dates
|
||||
protected $useTimestamps = true;
|
||||
protected $dateFormat = 'datetime';
|
||||
protected $createdField = 'created_at';
|
||||
protected $updatedField = 'updated_at';
|
||||
protected $deletedField = 'deleted_at';
|
||||
|
||||
// Validation
|
||||
protected $validationRules = [];
|
||||
protected $validationMessages = [];
|
||||
protected $skipValidation = false;
|
||||
protected $cleanValidationRules = true;
|
||||
|
||||
// Callbacks
|
||||
protected $allowCallbacks = true;
|
||||
protected $beforeInsert = [];
|
||||
protected $afterInsert = [];
|
||||
protected $beforeUpdate = [];
|
||||
protected $afterUpdate = [];
|
||||
protected $beforeFind = [];
|
||||
protected $afterFind = [];
|
||||
protected $beforeDelete = [];
|
||||
protected $afterDelete = [];
|
||||
|
||||
/**
|
||||
* Query for datatable
|
||||
*
|
||||
* @param integer|null $tarifa_preimpresion_id
|
||||
* @return BaseBuilder
|
||||
*/
|
||||
public function queryDatatable(?int $tarifa_preimpresion_id = null): BaseBuilder
|
||||
{
|
||||
$query = $this->builder()->select(
|
||||
[
|
||||
"tarifa_preimpresion_maquinas.id",
|
||||
"lg_maquinas.nombre as maquinaNombre",
|
||||
"maquina_tareas.name as tareaNombre"
|
||||
]
|
||||
)->join("lg_maquinas", "lg_maquinas.id = tarifa_preimpresion_maquinas.maquina_id", "left")
|
||||
->join("maquina_tareas", "maquina_tareas.id = tarifa_preimpresion_maquinas.maquina_tarea_id", "left")
|
||||
->where("tarifa_preimpresion_maquinas.deleted_at", null);
|
||||
if ($tarifa_preimpresion_id)
|
||||
$query->where("tarifa_preimpresion_maquinas.tarifa_preimpresion_id", $tarifa_preimpresion_id);
|
||||
return $query;
|
||||
}
|
||||
}
|
||||
@ -5,10 +5,13 @@ declare(strict_types=1);
|
||||
namespace App\Models;
|
||||
|
||||
use App\Entities\Usuarios\UsersEntity;
|
||||
use CodeIgniter\Shield\Authentication\Traits\HasAccessTokens;
|
||||
use CodeIgniter\Shield\Models\UserModel as ShieldUserModel;
|
||||
|
||||
class UserModel extends ShieldUserModel
|
||||
{
|
||||
use HasAccessTokens;
|
||||
|
||||
protected function initialize(): void
|
||||
{
|
||||
parent::initialize();
|
||||
|
||||
@ -1,14 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services;
|
||||
|
||||
use App\Models\Presupuestos\PresupuestoModel;
|
||||
use CodeIgniter\Config\BaseService;
|
||||
|
||||
class MessageService extends BaseService
|
||||
{
|
||||
public static function get_chat_title_from_presupuesto(int $presuesto_id,?string $department_name = null) : string
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
696
ci4/app/Services/ProductionService.php
Normal file
696
ci4/app/Services/ProductionService.php
Normal file
@ -0,0 +1,696 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services;
|
||||
|
||||
use App\Entities\Clientes\ClienteEntity;
|
||||
use App\Entities\Pedidos\PedidoEntity;
|
||||
use App\Entities\Presupuestos\PresupuestoEntity;
|
||||
use App\Entities\Presupuestos\PresupuestoLineaEntity;
|
||||
use App\Entities\Produccion\OrdenTrabajoEntity;
|
||||
use App\Models\OrdenTrabajo\OrdenTrabajoDate;
|
||||
use App\Models\OrdenTrabajo\OrdenTrabajoModel;
|
||||
use App\Models\OrdenTrabajo\OrdenTrabajoTarea;
|
||||
use App\Models\OrdenTrabajo\OrdenTrabajoUser;
|
||||
use App\Models\Usuarios\UserModel;
|
||||
use CodeIgniter\Config\BaseService;
|
||||
use CodeIgniter\Database\BaseBuilder;
|
||||
use CodeIgniter\Database\BaseResult;
|
||||
use CodeIgniter\Database\Exceptions\DatabaseException;
|
||||
use CodeIgniter\I18n\Time;
|
||||
use Dompdf\Dompdf;
|
||||
|
||||
/**
|
||||
* Clase con las funcionalidades necesarias trabajar con las ordenes de trabajo.
|
||||
*/
|
||||
class ProductionService extends BaseService
|
||||
{
|
||||
protected OrdenTrabajoModel $otModel;
|
||||
protected OrdenTrabajoTarea $otTarea;
|
||||
protected OrdenTrabajoDate $otDate;
|
||||
protected OrdenTrabajoUser $otUser;
|
||||
protected OrdenTrabajoEntity $ot;
|
||||
protected UserModel $userModel;
|
||||
protected array $MAPPING_DATE_USER = [
|
||||
"fecha_encuadernado_at" => "encuadernacion_user_id",
|
||||
// "fecha_externo_at" => "null",
|
||||
"fecha_impresion_at" => "null",
|
||||
"pendiente_ferro_at" => "pendiente_ferro_user_id",
|
||||
"ferro_en_cliente_at" => "ferro_en_cliente_user_id",
|
||||
"ferro_ok_at" => "ferro_ok_user_id",
|
||||
"interior_bn_at" => "interior_bn_user_id",
|
||||
"interior_color_at" => "interior_color_user_id",
|
||||
"preparacion_interiores_at" => "preparacion_interior_user_id",
|
||||
"cubierta_at" => "cubierta_user_id",
|
||||
"plastificado_at" => "plastificado_user_id",
|
||||
"corte_at" => "corte_user_id",
|
||||
"embalaje_at" => "embalaje_user_id",
|
||||
"entrada_manipulado_at" => "entrada_manipulado_user_id"
|
||||
];
|
||||
|
||||
/**
|
||||
* Pedido Entity
|
||||
*
|
||||
* @var PedidoEntity
|
||||
*/
|
||||
protected PedidoEntity $pedido;
|
||||
/**
|
||||
* Presupuesto Entity
|
||||
*
|
||||
* @var PresupuestoEntity
|
||||
*/
|
||||
protected PresupuestoEntity $presupuesto;
|
||||
|
||||
public function __construct() {
|
||||
$this->otModel = model(OrdenTrabajoModel::class);
|
||||
$this->otDate = model(OrdenTrabajoDate::class);
|
||||
$this->otTarea = model(OrdenTrabajoTarea::class);
|
||||
$this->otUser = model(OrdenTrabajoUser::class);
|
||||
$this->userModel = model(UserModel::class);
|
||||
|
||||
}
|
||||
public function init(int $orden_trabajo_id): self
|
||||
{
|
||||
$this->otModel = model(OrdenTrabajoModel::class);
|
||||
$this->ot = $this->otModel->find($orden_trabajo_id);
|
||||
$pedido = $this->ot->pedido();
|
||||
$this->setPedido($pedido);
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Establece el pedido sobre el que se va a trabajar
|
||||
*
|
||||
* @param PedidoEntity $pedido
|
||||
* @return self
|
||||
*/
|
||||
public function setPedido(PedidoEntity $pedido): self
|
||||
{
|
||||
$this->pedido = $pedido;
|
||||
$this->presupuesto = $this->pedido->presupuesto();
|
||||
$this->otModel = model(OrdenTrabajoModel::class);
|
||||
$this->otDate = model(OrdenTrabajoDate::class);
|
||||
$this->otTarea = model(OrdenTrabajoTarea::class);
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Devuelve la orden de trabajo.
|
||||
*
|
||||
* @return OrdenTrabajoEntity
|
||||
*/
|
||||
public function getOrdenTrabajo(): OrdenTrabajoEntity
|
||||
{
|
||||
return $this->ot;
|
||||
}
|
||||
|
||||
/**
|
||||
* Crea una instancia de la orden de trabajo
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function createOrdenTrabajo(): OrdenTrabajoEntity|DatabaseException
|
||||
{
|
||||
|
||||
$auth_user = auth()->user();
|
||||
$ot = new OrdenTrabajoEntity();
|
||||
$ot_exists = $this->pedido->orden_trabajo();
|
||||
if ($ot_exists) {
|
||||
return $ot_exists;
|
||||
}
|
||||
$data = [
|
||||
"pedido_id" => $this->pedido->id,
|
||||
"user_created_id" => $auth_user->id,
|
||||
"user_updated_id" => $auth_user->id,
|
||||
"total_tirada" => $this->pedido->total_tirada,
|
||||
"total_precio" => $this->pedido->total_precio
|
||||
];
|
||||
$ot->fill($data);
|
||||
$this->otModel->save($ot);
|
||||
$ot_id = $this->otModel->getInsertID();
|
||||
$ot->id = $ot_id;
|
||||
$this->init($ot_id);
|
||||
$this->storeOrdenTrabajoUsers();
|
||||
$this->storeOrdenTrabajoDates();
|
||||
$this->storeAllTareas();
|
||||
return $this->ot;
|
||||
}
|
||||
|
||||
/**
|
||||
* Inserta las fechas del pedido asociado a la orden de trabajo en `orden_trabajo_tareas`
|
||||
*
|
||||
* @param OrdenTrabajoEntity $ot
|
||||
* @return integer|boolean|string ID
|
||||
*/
|
||||
protected function storeOrdenTrabajoDates() : int|bool|string
|
||||
{
|
||||
$fecha_encuadernado = Time::now()->addDays(2)->format("Y-m-d");
|
||||
$fecha_entrega_real = Time::now()->addDays(5)->format("Y-m-d");
|
||||
$fecha_embalaje_at = Time::now()->addDays(4)->format("Y-m-d");
|
||||
return $this->otDate->insert([
|
||||
"orden_trabajo_id" => $this->ot->id,
|
||||
"fecha_encuadernado_at" => $fecha_encuadernado,
|
||||
"fecha_entrega_real_at" => $fecha_entrega_real,
|
||||
"fecha_impresion_at" => Time::now()->format("Y-m-d"),
|
||||
"embalaje_at" => $fecha_embalaje_at,
|
||||
"fecha_entrega_externo" => $this->pedido->fecha_entrega_externo,
|
||||
]);
|
||||
}
|
||||
protected function storeOrdenTrabajoUsers() : int|bool|string
|
||||
{
|
||||
return $this->otUser->insert([
|
||||
"orden_trabajo_id" => $this->ot->id,
|
||||
]);
|
||||
}
|
||||
protected function storeAllTareas()
|
||||
{
|
||||
$this->storeOrdenTrabajoTareas();
|
||||
$this->storeOrdenTrabajoAcabadoTareas();
|
||||
$this->storeOrdenTrabajoManipuladoTareas();
|
||||
$this->storeOrdenTrabajoPreimpresionTareas();
|
||||
$this->storeOrdenTrabajoEncuadernacionTareas();
|
||||
$this->storeOrdenTrabajoExtraTareas();
|
||||
}
|
||||
public function resetAllTareas(): BaseResult|bool
|
||||
{
|
||||
$r = $this->otTarea->where("orden_trabajo_id", $this->ot->id)->delete(purge: true);
|
||||
$this->storeAllTareas();
|
||||
return $r;
|
||||
}
|
||||
/**
|
||||
* Inserta las tareas de la orden de trabajo.
|
||||
* Acepta como argumento una entidad de la orden de trabajo OrdenTrabajoEntity
|
||||
*
|
||||
*
|
||||
* @return integer|boolean Numero de registro insertados o `FALSE` si error
|
||||
*/
|
||||
protected function storeOrdenTrabajoTareas(): int|bool
|
||||
{
|
||||
|
||||
$p_lineas = $this->presupuesto->presupuestoLineas();
|
||||
$ot_tareas = [];
|
||||
|
||||
foreach ($p_lineas as $key => $p_linea) {
|
||||
$p_linea_maquina = $p_linea->maquina();
|
||||
$nombre = $p_linea->get_nombre_tarea();
|
||||
$ot_tareas["orden_trabajo_id"] = $this->ot->id;
|
||||
$ot_tareas["presupuesto_linea_id"] = $p_linea->id;
|
||||
$ot_tareas["nombre"] = $nombre;
|
||||
$ot_tareas["orden"] = $p_linea_maquina->orden_planning ?? 0;
|
||||
$ot_tareas["maquina_id"] = $p_linea_maquina->id;
|
||||
$ot_tareas["imposicion_id"] = null;
|
||||
$ot_tareas["tiempo_estimado"] = $p_linea->horas_maquina;
|
||||
$ot_tareas["tiempo_real"] = $p_linea->horas_maquina; //? Tiempo real se inserta manual?
|
||||
$insert_query_result = $this->otTarea->insert($ot_tareas);
|
||||
$ot_tareas = [];
|
||||
}
|
||||
return $insert_query_result;
|
||||
}
|
||||
protected function storeOrdenTrabajoAcabadoTareas(): bool
|
||||
{
|
||||
$p_lineas = $this->presupuesto_lineas_acabado();
|
||||
foreach ($p_lineas as $key => $p_linea) {
|
||||
$p_linea_maquinas = $p_linea->maquinas();
|
||||
$ot_tareas = [];
|
||||
if (count($p_linea_maquinas) > 0) {
|
||||
foreach ($p_linea_maquinas as $key => $linea) {
|
||||
$ot_tareas["orden_trabajo_id"] = $this->ot->id;
|
||||
$ot_tareas["presupuesto_acabado_id"] = $p_linea->id;
|
||||
$ot_tareas["nombre"] = $p_linea->tarifa()->nombre;
|
||||
$ot_tareas["orden"] = $linea->orden_planning ?? 0;
|
||||
$ot_tareas["maquina_id"] = $linea->id;
|
||||
$ot_tareas["imposicion_id"] = null;
|
||||
$this->otTarea->insert($ot_tareas);
|
||||
$ot_tareas = [];
|
||||
}
|
||||
} else {
|
||||
$ot_tareas["orden_trabajo_id"] = $this->ot->id;
|
||||
$ot_tareas["presupuesto_acabado_id"] = $p_linea->id;
|
||||
$ot_tareas["nombre"] = $p_linea->tarifa()->nombre ?? "";
|
||||
$this->otTarea->insert($ot_tareas);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
protected function storeOrdenTrabajoManipuladoTareas(): bool
|
||||
{
|
||||
$p_lineas = $this->presupuesto_lineas_manipulado();
|
||||
foreach ($p_lineas as $key => $p_linea) {
|
||||
$p_linea_maquinas = $p_linea->maquinas();
|
||||
$ot_tareas = [];
|
||||
if (count($p_linea_maquinas) > 0) {
|
||||
foreach ($p_linea_maquinas as $key => $linea) {
|
||||
$ot_tareas["orden_trabajo_id"] = $this->ot->id;
|
||||
$ot_tareas["presupuesto_manipulado_id"] = $p_linea->id;
|
||||
$ot_tareas["nombre"] = $p_linea->tarifa()->nombre;
|
||||
$ot_tareas["orden"] = $linea->orden_planning ?? 0;
|
||||
$ot_tareas["maquina_id"] = $linea->id;
|
||||
$ot_tareas["imposicion_id"] = null;
|
||||
$this->otTarea->insert($ot_tareas);
|
||||
$ot_tareas = [];
|
||||
}
|
||||
} else {
|
||||
$ot_tareas["orden_trabajo_id"] = $this->ot->id;
|
||||
$ot_tareas["presupuesto_manipulado_id"] = $p_linea->id;
|
||||
$ot_tareas["nombre"] = $p_linea->tarifa()->nombre ?? "";
|
||||
$this->otTarea->insert($ot_tareas);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
protected function storeOrdenTrabajoPreimpresionTareas(): bool
|
||||
{
|
||||
$p_lineas = $this->presupuesto_lineas_preimpresion();
|
||||
foreach ($p_lineas as $key => $p_linea) {
|
||||
$p_linea_maquinas = $p_linea->maquinas();
|
||||
$ot_tareas = [];
|
||||
if (count($p_linea_maquinas) > 0) {
|
||||
foreach ($p_linea_maquinas as $key => $linea) {
|
||||
$ot_tareas["orden_trabajo_id"] = $this->ot->id;
|
||||
$ot_tareas["presupuesto_preimpresion_id"] = $p_linea->id;
|
||||
$ot_tareas["nombre"] = $p_linea->tarifa()->nombre;
|
||||
$ot_tareas["orden"] = $linea->orden_planning ?? 0;
|
||||
$ot_tareas["maquina_id"] = $linea->id;
|
||||
$ot_tareas["imposicion_id"] = null;
|
||||
$this->otTarea->insert($ot_tareas);
|
||||
$ot_tareas = [];
|
||||
}
|
||||
} else {
|
||||
$ot_tareas["orden_trabajo_id"] = $this->ot->id;
|
||||
$ot_tareas["presupuesto_preimpresion_id"] = $p_linea->id;
|
||||
$ot_tareas["nombre"] = $p_linea->tarifa()->nombre ?? "";
|
||||
$this->otTarea->insert($ot_tareas);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
protected function storeOrdenTrabajoEncuadernacionTareas(): bool
|
||||
{
|
||||
$p_lineas = $this->presupuesto_lineas_encuadernaciones();
|
||||
foreach ($p_lineas as $key => $p_linea) {
|
||||
$p_linea_maquinas = $p_linea->maquinas();
|
||||
$ot_tareas = [];
|
||||
if (count($p_linea_maquinas) > 0) {
|
||||
foreach ($p_linea_maquinas as $key => $linea) {
|
||||
$ot_tareas["orden_trabajo_id"] = $this->ot->id;
|
||||
$ot_tareas["presupuesto_encuadernado_id"] = $p_linea->id;
|
||||
$ot_tareas["nombre"] = $p_linea->tarifa()->nombre;
|
||||
$ot_tareas["orden"] = $linea->orden_planning ?? 0;
|
||||
$ot_tareas["maquina_id"] = $linea->id;
|
||||
$ot_tareas["imposicion_id"] = null;
|
||||
$this->otTarea->insert($ot_tareas);
|
||||
$ot_tareas = [];
|
||||
}
|
||||
} else {
|
||||
$ot_tareas["orden_trabajo_id"] = $this->ot->id;
|
||||
$ot_tareas["presupuesto_encuadernado_id"] = $p_linea->id;
|
||||
$ot_tareas["nombre"] = $p_linea->tarifa()->nombre ?? "";
|
||||
$this->otTarea->insert($ot_tareas);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
protected function storeOrdenTrabajoExtraTareas(): bool
|
||||
{
|
||||
$p_lineas = $this->presupuesto_lineas_extras();
|
||||
foreach ($p_lineas as $key => $p_linea) {
|
||||
$p_linea_maquinas = $p_linea->maquinas();
|
||||
$ot_tareas = [];
|
||||
if (count($p_linea_maquinas) > 0) {
|
||||
foreach ($p_linea_maquinas as $key => $linea) {
|
||||
$ot_tareas["orden_trabajo_id"] = $this->ot->id;
|
||||
$ot_tareas["presupuesto_extra_id"] = $p_linea->id;
|
||||
$ot_tareas["nombre"] = $p_linea->tarifa()->nombre;
|
||||
$ot_tareas["orden"] = $linea->orden_planning;
|
||||
$ot_tareas["maquina_id"] = $linea->id;
|
||||
$ot_tareas["imposicion_id"] = null;
|
||||
$this->otTarea->insert($ot_tareas);
|
||||
$ot_tareas = [];
|
||||
}
|
||||
} else {
|
||||
$ot_tareas["orden_trabajo_id"] = $this->ot->id;
|
||||
$ot_tareas["presupuesto_extra_id"] = $p_linea->id;
|
||||
$ot_tareas["nombre"] = $p_linea->tarifa()->nombre ?? "";
|
||||
|
||||
$this->otTarea->insert($ot_tareas);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function getTareas(): array
|
||||
{
|
||||
$p_lineas_with_maquina = $this->getPresupuestoLineasWithMaquina();
|
||||
$tareas = [];
|
||||
$tarea = [];
|
||||
foreach ($p_lineas_with_maquina as $key => $linea) {
|
||||
$tarea["orden"] = $linea->maquina->orden_planning;
|
||||
$tarea["maquina_tipo"] = $linea->maquina->tipo;
|
||||
$tarea["maquina_nombre"] = $linea->maquina->nombre;
|
||||
$tarea["nota"] = null;
|
||||
$tareas[] = $tarea;
|
||||
$tarea = [];
|
||||
}
|
||||
return ["tareas" => $tareas];
|
||||
}
|
||||
|
||||
public function getPdf()
|
||||
{
|
||||
return view("themes/vuexy/pdfs/orden_trabajo",$this->getDataPdf());
|
||||
}
|
||||
/**
|
||||
* Query para mostrar en datatable
|
||||
*
|
||||
* @return BaseBuilder
|
||||
*/
|
||||
public function taskDatatableQuery(): BaseBuilder
|
||||
{
|
||||
$q = $this->otModel->builder()->select([
|
||||
"orden_trabajo_tareas.id",
|
||||
"orden_trabajo_tareas.orden",
|
||||
"orden_trabajo_tareas.nombre",
|
||||
"lgmp.nombre as maquina_presupuesto_linea",
|
||||
"orden_trabajo_tareas.maquina_id as maquina_tarea",
|
||||
"lg_maquinas.nombre as maquina_nombre",
|
||||
"lg_imposiciones.id as imposicion_id",
|
||||
"orden_trabajo_tareas.tiempo_estimado",
|
||||
"orden_trabajo_tareas.tiempo_real",
|
||||
"orden_trabajo_tareas.comment",
|
||||
|
||||
])
|
||||
->join("orden_trabajo_tareas", "orden_trabajo_tareas.orden_trabajo_id = ordenes_trabajo.id", "left")
|
||||
->join("presupuesto_linea", "presupuesto_linea.id = orden_trabajo_tareas.presupuesto_linea_id", "left")
|
||||
->join("presupuesto_acabados", "presupuesto_acabados.id = orden_trabajo_tareas.presupuesto_acabado_id", "left")
|
||||
->join("presupuesto_manipulados", "presupuesto_manipulados.id = orden_trabajo_tareas.presupuesto_manipulado_id", "left")
|
||||
->join("presupuesto_preimpresiones", "presupuesto_preimpresiones.id = orden_trabajo_tareas.presupuesto_preimpresion_id", "left")
|
||||
->join("presupuesto_encuadernaciones", "presupuesto_encuadernaciones.id = orden_trabajo_tareas.presupuesto_encuadernado_id", "left")
|
||||
->join("presupuesto_serviciosExtra", "presupuesto_serviciosExtra.id = orden_trabajo_tareas.presupuesto_extra_id", "left")
|
||||
->join("lg_maquinas", "lg_maquinas.id = orden_trabajo_tareas.maquina_id", "left")
|
||||
->join("lg_maquinas as lgmp", "lgmp.id = presupuesto_linea.maquina_id", "left")
|
||||
->join("lg_imposiciones", "lg_imposiciones.id = orden_trabajo_tareas.imposicion_id", "left")
|
||||
->where("orden_trabajo_tareas.orden_trabajo_id", $this->ot->id)
|
||||
->where("orden_trabajo_tareas.deleted_at", null)
|
||||
->orderBy("orden_trabajo_tareas.orden", "ASC");
|
||||
return $q;
|
||||
}
|
||||
/**
|
||||
* Query para mostrar en datatable
|
||||
*
|
||||
* @return BaseBuilder
|
||||
*/
|
||||
public function planningRotativaQueryDatatable(): BaseBuilder
|
||||
{
|
||||
$q = $this->otModel->builder()->select([
|
||||
"ordenes_trabajo.id as otId",
|
||||
"orden_trabajo_dates.fecha_entrega_real_at",
|
||||
"presupuestos.titulo as presupuesto_titulo",
|
||||
"orden_trabajo_tareas.maquina_id",
|
||||
"lg_maquinas.nombre as maquina_planning_nombre",
|
||||
"ordenes_trabajo.total_tirada as ot_tirada",
|
||||
"lg_papel_formato.ancho as maquina_ancho",
|
||||
"lg_papel_formato.alto as maquina_alto",
|
||||
// "JSON_EXTRACT(presupuesto_linea.formas,'$.maquina_ancho') as maquina_ancho",
|
||||
// "JSON_EXTRACT(presupuesto_linea.formas,'$.maquina_alto') as maquina_alto",
|
||||
"lg_papel_impresion.nombre as papel_impresion",
|
||||
"presupuesto_linea.gramaje as papel_gramaje",
|
||||
|
||||
|
||||
|
||||
])
|
||||
->join("orden_trabajo_tareas", "orden_trabajo_tareas.orden_trabajo_id = ordenes_trabajo.id", "left")
|
||||
->join("orden_trabajo_dates", "orden_trabajo_dates.orden_trabajo_id = ordenes_trabajo.id", "left")
|
||||
->join("presupuesto_linea", "presupuesto_linea.id = orden_trabajo_tareas.presupuesto_linea_id", "left")
|
||||
->join("presupuestos", "presupuestos.id = presupuesto_linea.presupuesto_id", "right")
|
||||
->join("lg_papel_formato", "lg_papel_formato.id = presupuestos.papel_formato_id", "left")
|
||||
->join("lg_maquinas", "lg_maquinas.id = orden_trabajo_tareas.maquina_id", "left")
|
||||
->join("lg_papel_impresion", "lg_papel_impresion.id = presupuesto_linea.papel_impresion_id", "left")
|
||||
->join("lg_maquinas as lgmp", "lgmp.id = presupuesto_linea.maquina_id", "left")
|
||||
->join("lg_imposiciones", "lg_imposiciones.id = orden_trabajo_tareas.imposicion_id", "left")
|
||||
// ->where("orden_trabajo_tareas.orden_trabajo_id", $this->ot->id)
|
||||
->whereIn("presupuesto_linea.tipo", ["lp_rot_bn","lp_rot_color"])
|
||||
->where("orden_trabajo_tareas.deleted_at", null)
|
||||
->orderBy("orden_trabajo_tareas.orden", "ASC");
|
||||
return $q;
|
||||
}
|
||||
/**
|
||||
* Query para mostrar en datatable
|
||||
*
|
||||
* @return BaseBuilder
|
||||
*/
|
||||
public function costDatatableQuery(): BaseBuilder
|
||||
{
|
||||
$q = $this->otModel->builder()->select([
|
||||
"orden_trabajo_tareas.id",
|
||||
"orden_trabajo_tareas.orden",
|
||||
"orden_trabajo_tareas.nombre",
|
||||
"lgmp.nombre as maquina_presupuesto_linea",
|
||||
"orden_trabajo_tareas.maquina_id as maquina_tarea",
|
||||
"lg_maquinas.nombre as maquina_nombre",
|
||||
"lg_imposiciones.id as imposicion_id",
|
||||
"orden_trabajo_tareas.tiempo_estimado",
|
||||
"orden_trabajo_tareas.tiempo_real"
|
||||
])
|
||||
->join("orden_trabajo_tareas", "orden_trabajo_tareas.orden_trabajo_id = ordenes_trabajo.id", "left")
|
||||
->join("presupuesto_linea", "presupuesto_linea.id = orden_trabajo_tareas.presupuesto_linea_id", "left")
|
||||
->join("presupuesto_acabados", "presupuesto_acabados.id = orden_trabajo_tareas.presupuesto_acabado_id", "left")
|
||||
->join("presupuesto_manipulados", "presupuesto_manipulados.id = orden_trabajo_tareas.presupuesto_manipulado_id", "left")
|
||||
->join("presupuesto_preimpresiones", "presupuesto_preimpresiones.id = orden_trabajo_tareas.presupuesto_preimpresion_id", "left")
|
||||
->join("presupuesto_encuadernaciones", "presupuesto_encuadernaciones.id = orden_trabajo_tareas.presupuesto_encuadernado_id", "left")
|
||||
->join("presupuesto_serviciosExtra", "presupuesto_serviciosExtra.id = orden_trabajo_tareas.presupuesto_extra_id", "left")
|
||||
->join("lg_maquinas", "lg_maquinas.id = orden_trabajo_tareas.maquina_id", "left")
|
||||
->join("lg_maquinas as lgmp", "lgmp.id = presupuesto_linea.maquina_id", "left")
|
||||
->join("lg_imposiciones", "lg_imposiciones.id = orden_trabajo_tareas.imposicion_id", "left")
|
||||
->where("orden_trabajo_tareas.orden_trabajo_id", $this->ot->id)
|
||||
->where("orden_trabajo_tareas.deleted_at", null)
|
||||
->orderBy("orden_trabajo_tareas.orden", "ASC");
|
||||
return $q;
|
||||
}
|
||||
public function papelGramajeDatatableQuery() : BaseBuilder
|
||||
{
|
||||
$q = $this->otModel->builder()->select([
|
||||
"lg_papel_impresion.nombre as papelImpresionNombre",
|
||||
"lg_papel_impresion.gramaje as papelImpresionGramaje",
|
||||
"COUNT(orden_trabajo_tareas.id) as tareasCount",
|
||||
"SUM(ordenes_trabajo.total_tirada) as totalTirada",
|
||||
"SUM(orden_trabajo_tareas.tiempo_real) as tiempoReal"
|
||||
])
|
||||
->join("orden_trabajo_tareas", "orden_trabajo_tareas.orden_trabajo_id = ordenes_trabajo.id", "left")
|
||||
->join("presupuesto_linea", "presupuesto_linea.id = orden_trabajo_tareas.presupuesto_linea_id", "left")
|
||||
->join("lg_papel_impresion","presupuesto_linea.papel_impresion_id = lg_papel_impresion.id","left")
|
||||
->where("orden_trabajo_tareas.deleted_at", null)
|
||||
->where("orden_trabajo_tareas.presupuesto_linea_id IS NOT NULL", NULL,FALSE);
|
||||
|
||||
|
||||
|
||||
return $q;
|
||||
}
|
||||
/**
|
||||
* Get a summary from ot with the following structure
|
||||
*
|
||||
* @return array
|
||||
* ```php
|
||||
* [
|
||||
* "ot" => OrdenTrabajoEntity
|
||||
* "dates" => OrdenTrabajoDateEntity
|
||||
* "tasks" => array<OrdenTrabajoTareaEntity>
|
||||
* ];
|
||||
* ```
|
||||
*/
|
||||
public function getSummary(): array
|
||||
{
|
||||
|
||||
$summary = [
|
||||
"ot" => $this->ot,
|
||||
"pedido" => $this->pedido,
|
||||
"presupuesto" => $this->presupuesto,
|
||||
"dates" => $this->ot->dates(),
|
||||
"tasks" => $this->ot->tareas(),
|
||||
"acabados" => $this->presupuesto->acabados(),
|
||||
"preimpresiones" => $this->presupuesto->preimpresiones(),
|
||||
"manipulados" => $this->presupuesto->manipulados(),
|
||||
"encuadernaciones" => $this->presupuesto->encuadernaciones(),
|
||||
"impresion_interior_bn" => $this->getTareaImpresionInteriorBn(),
|
||||
"impresion_interior_color" => $this->getTareaImpresionInteriorColor(),
|
||||
"tareas_acabado" => $this->tareas_acabado(),
|
||||
"tareas_manipulado" => $this->tareas_manipulado(),
|
||||
"tareas_encuadernacion" => $this->tareas_encuadernacion(),
|
||||
"tareas_preimpresion" => $this->tareas_preimpresion(),
|
||||
"tareas_impresion" => $this->tareas_impresion(),
|
||||
];
|
||||
return $summary;
|
||||
}
|
||||
public function getDataPdf(){
|
||||
$logistica_data = $this->logistica_data();
|
||||
return [
|
||||
"ot" => $this->ot,
|
||||
"pedido" => $this->pedido,
|
||||
"presupuesto" => $this->presupuesto,
|
||||
"cliente" => $this->presupuesto->cliente(),
|
||||
"ubicacion" => $this->pedido->ubicacion()->nombre,
|
||||
"dates" => $this->ot->dates(),
|
||||
"tasks" => $this->ot->tareas(),
|
||||
"papel_formato" => $this->presupuesto->papel_formato(),
|
||||
"acabados" => $this->presupuesto->acabados(),
|
||||
"preimpresiones" => $this->presupuesto->preimpresiones(),
|
||||
"manipulados" => $this->presupuesto->manipulados(),
|
||||
"encuadernaciones" => $this->presupuesto->encuadernaciones(),
|
||||
"linea_impresion" => $this->presupuesto->presupuestoLineaImpresion(),
|
||||
"linea_cubierta" => $this->presupuesto->presupuestoLineaCubierta(),
|
||||
"peso_unidad" => $logistica_data["peso_unidad"],
|
||||
"peso_pedido" => $logistica_data["peso_pedido"]
|
||||
];
|
||||
}
|
||||
public function getTareaImpresionSobreCubierta() : array
|
||||
{
|
||||
$q = $this->otTarea->select('orden_trabajo_tareas.*')
|
||||
->join("presupuesto_linea","presupuesto_linea.id = orden_trabajo_tareas.presupuesto_linea_id","left")
|
||||
->where("orden_trabajo_tareas.orden_trabajo_id",$this->ot->id)
|
||||
->whereIn("presupuesto_linea.tipo",["lp_sobrecubierta"])->findAll();
|
||||
return $q;
|
||||
}
|
||||
public function getTareaImpresionCubierta() : array
|
||||
{
|
||||
$q = $this->otTarea->select('orden_trabajo_tareas.*')
|
||||
->join("presupuesto_linea","presupuesto_linea.id = orden_trabajo_tareas.presupuesto_linea_id","left")
|
||||
->where("orden_trabajo_tareas.orden_trabajo_id",$this->ot->id)
|
||||
->whereIn("presupuesto_linea.tipo",["lp_cubierta"])->findAll();
|
||||
return $q;
|
||||
}
|
||||
public function getTareaImpresionInteriorBn() : array
|
||||
{
|
||||
$q = $this->otTarea->select('orden_trabajo_tareas.*')
|
||||
->join("presupuesto_linea","presupuesto_linea.id = orden_trabajo_tareas.presupuesto_linea_id","left")
|
||||
->where("orden_trabajo_tareas.orden_trabajo_id",$this->ot->id)
|
||||
->whereIn("presupuesto_linea.tipo",["lp_rot_bn","lp_bn","lp_bnhq"])->findAll();
|
||||
return $q;
|
||||
}
|
||||
public function getTareaImpresionInteriorColor() : array
|
||||
{
|
||||
$q = $this->otTarea->select('orden_trabajo_tareas.*')
|
||||
->join("presupuesto_linea","presupuesto_linea.id = orden_trabajo_tareas.presupuesto_linea_id","left")
|
||||
->where("orden_trabajo_tareas.orden_trabajo_id",$this->ot->id)
|
||||
->whereIn("presupuesto_linea.tipo",["lp_rot_color","lp_color","lp_colorhq"])->findAll();
|
||||
return $q;
|
||||
}
|
||||
public function getPresupuestoLineaImpresion(){
|
||||
}
|
||||
public function tareas_acabado(): array
|
||||
{
|
||||
$q = $this->otTarea->where("presupuesto_acabado_id IS NOT NULL",NULL,FALSE)->findAll();
|
||||
return $q;
|
||||
}
|
||||
public function tareas_impresion(): array
|
||||
{
|
||||
$q = $this->otTarea->where("presupuesto_linea_id IS NOT NULL",NULL,FALSE)->findAll();
|
||||
return $q;
|
||||
}
|
||||
public function tareas_encuadernacion(): array
|
||||
{
|
||||
$q = $this->otTarea->where("presupuesto_encuadernado_id IS NOT NULL",NULL,FALSE)->findAll();
|
||||
return $q;
|
||||
}
|
||||
public function tareas_preimpresion(): array
|
||||
{
|
||||
$q = $this->otTarea->where("presupuesto_preimpresion_id IS NOT NULL",NULL,FALSE)->findAll();
|
||||
return $q;
|
||||
}
|
||||
public function tareas_manipulado(): array
|
||||
{
|
||||
$q = $this->otTarea->where("presupuesto_manipulado_id IS NOT NULL",NULL,FALSE)->findAll();
|
||||
return $q;
|
||||
}
|
||||
/**========================================================================
|
||||
* UPDATES
|
||||
*========================================================================**/
|
||||
|
||||
public function updateOrdenTrabajoTarea($tarea_id,$data) : bool
|
||||
{
|
||||
return $this->otTarea->update($tarea_id,$data);
|
||||
}
|
||||
|
||||
public function updateOrdenTrabajoDate($data)
|
||||
{
|
||||
// return $this->otDate->find($this->ot->id);
|
||||
$r = $this->otDate->update($this->ot->id,$data);
|
||||
$ot_users = $this->ot->users();
|
||||
$ot_users = $ot_users->toArray();
|
||||
$user_id = $ot_users[$this->MAPPING_DATE_USER[$data["name"]]];
|
||||
$user = $this->userModel->find($user_id);
|
||||
return ["user" => $user,"status" => $r];
|
||||
}
|
||||
|
||||
public function updateOrdenTrabajo($data) : bool
|
||||
{
|
||||
return $this->otModel->update($this->ot->id,$data);
|
||||
}
|
||||
/**========================================================================
|
||||
* RELATION METHODS
|
||||
*========================================================================**/
|
||||
/**
|
||||
* Obtiene el pedido asociado a esta clase
|
||||
*
|
||||
* @return PedidoEntity
|
||||
*/
|
||||
public function getPedido(): PedidoEntity
|
||||
{
|
||||
return $this->pedido;
|
||||
}
|
||||
|
||||
public function getCliente(): ClienteEntity
|
||||
{
|
||||
return $this->presupuesto->cliente();
|
||||
}
|
||||
|
||||
|
||||
public function getPresupuesto(): PresupuestoEntity
|
||||
{
|
||||
return $this->presupuesto;
|
||||
}
|
||||
/**
|
||||
* Devuelve las lineas de presupuesto con la máquina asociada a cada una
|
||||
*
|
||||
* @return array<PresupuestoLineaEntity>
|
||||
*/
|
||||
protected function getPresupuestoLineasWithMaquina(): array
|
||||
{
|
||||
$presupuesto_lineas = $this->presupuesto->presupuestoLineas();
|
||||
foreach ($presupuesto_lineas as $key => $linea) {
|
||||
$linea->maquina = $linea->maquina();
|
||||
}
|
||||
return $presupuesto_lineas;
|
||||
}
|
||||
protected function presupuesto_lineas_acabado(): array
|
||||
{
|
||||
return $this->presupuesto->acabados();
|
||||
}
|
||||
protected function presupuesto_lineas_manipulado(): array
|
||||
{
|
||||
return $this->presupuesto->manipulados();
|
||||
}
|
||||
protected function presupuesto_lineas_preimpresion(): array
|
||||
{
|
||||
return $this->presupuesto->preimpresiones();
|
||||
}
|
||||
protected function presupuesto_lineas_encuadernaciones(): array
|
||||
{
|
||||
return $this->presupuesto->encuadernaciones();
|
||||
}
|
||||
protected function presupuesto_lineas_extras(): array
|
||||
{
|
||||
return $this->presupuesto->extras();
|
||||
}
|
||||
protected function logistica_data() : array
|
||||
{
|
||||
$presupuesto_lineas = $this->presupuesto->presupuestoLineas();
|
||||
$peso = 0;
|
||||
foreach ($presupuesto_lineas as $key => $linea) {
|
||||
$peso += $linea->peso;
|
||||
}
|
||||
return [
|
||||
"peso_unidad" => $peso,
|
||||
"peso_pedido" => $peso*$this->ot->total_tirada
|
||||
];
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
58
ci4/app/Services/TarifaMaquinaService.php
Normal file
58
ci4/app/Services/TarifaMaquinaService.php
Normal file
@ -0,0 +1,58 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services;
|
||||
|
||||
use App\Models\Configuracion\MaquinaTareaModel;
|
||||
use App\Models\Tarifas\Maquinas\TarifaAcabadoMaquinaModel;
|
||||
use App\Models\Tarifas\Maquinas\TarifaManipuladoMaquinaModel;
|
||||
use App\Models\Tarifas\Maquinas\TarifaEncuadernacionMaquinaModel;
|
||||
use App\Models\Tarifas\Maquinas\TarifaPreimpresionMaquinaModel;
|
||||
use App\Models\Tarifas\Maquinas\TarifaExtraMaquinaModel;
|
||||
use CodeIgniter\Config\BaseService;
|
||||
use CodeIgniter\Database\BaseBuilder;
|
||||
use CodeIgniter\Database\Exceptions\DatabaseException;
|
||||
|
||||
/**
|
||||
* Clase con las funcionalidades necesarias trabajar con tarifas maquinas
|
||||
*/
|
||||
|
||||
class TarifaMaquinaService extends BaseService
|
||||
{
|
||||
protected TarifaAcabadoMaquinaModel $tarifaAcabadoMaquina;
|
||||
protected TarifaManipuladoMaquinaModel $tarifaManipuladoMaquina;
|
||||
protected TarifaPreimpresionMaquinaModel $tarifaPreimpresionMaquina;
|
||||
protected TarifaEncuadernacionMaquinaModel $tarifaEncuadernacionMaquina;
|
||||
protected TarifaExtraMaquinaModel $tarifaExtraMaquina;
|
||||
protected MaquinaTareaModel $maquinaTarea;
|
||||
|
||||
public function __construct() {
|
||||
$this->tarifaAcabadoMaquina = model(TarifaAcabadoMaquinaModel::class);
|
||||
$this->tarifaManipuladoMaquina = model(TarifaManipuladoMaquinaModel::class);
|
||||
$this->tarifaEncuadernacionMaquina = model(TarifaEncuadernacionMaquinaModel::class);
|
||||
$this->tarifaPreimpresionMaquina = model(TarifaPreimpresionMaquinaModel::class);
|
||||
$this->tarifaExtraMaquina = model(TarifaExtraMaquinaModel::class);
|
||||
|
||||
}
|
||||
|
||||
public function attachAcabadoToMaquina(int $tarifa_acabado_id, int $maquina_id, int $maquina_tarea_id): bool|int|string
|
||||
{
|
||||
return $this->tarifaAcabadoMaquina->insert(["tarifa_acabado_id" => $tarifa_acabado_id, "maquina_id" => $maquina_id, "maquina_tarea_id" => $maquina_tarea_id]);
|
||||
}
|
||||
public function attachManipuladoToMaquina(int $tarifa_manipulado_id, int $maquina_id, int $maquina_tarea_id): bool|int|string
|
||||
{
|
||||
return $this->tarifaManipuladoMaquina->insert(["tarifa_manipulado_id" => $tarifa_manipulado_id, "maquina_id" => $maquina_id, "maquina_tarea_id" => $maquina_tarea_id]);
|
||||
}
|
||||
public function attachPreimpresionToMaquina(int $tarifa_preimpresion_id, int $maquina_id, int $maquina_tarea_id): bool|int|string
|
||||
{
|
||||
return $this->tarifaPreimpresionMaquina->insert(["tarifa_preimpresion_id" => $tarifa_preimpresion_id, "maquina_id" => $maquina_id, "maquina_tarea_id" => $maquina_tarea_id]);
|
||||
}
|
||||
public function attachEncuadernacionToMaquina(int $tarifa_encuadernacion_id, int $maquina_id, int $maquina_tarea_id): bool|int|string
|
||||
{
|
||||
return $this->tarifaEncuadernacionMaquina->insert(["tarifa_encuadernacion_id" => $tarifa_encuadernacion_id, "maquina_id" => $maquina_id, "maquina_tarea_id" => $maquina_tarea_id]);
|
||||
}
|
||||
public function attachExtraToMaquina(int $tarifa_extra_id, int $maquina_id, int $maquina_tarea_id): bool|int|string
|
||||
{
|
||||
return $this->tarifaExtraMaquina->insert(["tarifa_extra_id" => $tarifa_extra_id, "maquina_id" => $maquina_id, "maquina_tarea_id" => $maquina_tarea_id]);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,61 @@
|
||||
<form class="form-control" id="<?= $id ?>" data-id="<?= $model->id ?>">
|
||||
<div class="row mb-2">
|
||||
<!-- Servicio cliente nombre-->
|
||||
<div class="col-xs-12 col-md-6 col-lg-6 mb-2">
|
||||
<label for="servicio-cliente-nombre" class="form-label"><?= @lang("ServicioCliente.datatable.nombre") ?></label>
|
||||
<input type="text" class="form-control" name="nombre" id="servicio-cliente-nombre">
|
||||
</div>
|
||||
<!-- Servicio cliente code-->
|
||||
<div class="col-xs-12 col-md-6 col-lg-6 mb-2">
|
||||
<label for="servicio-cliente-code" class="form-label"><?= @lang("ServicioCliente.datatable.code") ?></label>
|
||||
<input type="text" class="form-control" name="code" id="servicio-cliente-code">
|
||||
|
||||
</div>
|
||||
<!-- Tarifa acabado asociada a servicio -->
|
||||
<div class="col-xs-12 col-md-8 col-lg-6 mb-2" id="container-tarifa-acabado-select">
|
||||
<label for="servicio-cliente-tarifa-acabado" class="form-label"><?= @lang("Tarifaacabado.tarifaacabado") ?></label>
|
||||
<select class="select2 form-select" name="tarifa_acabado_id" id="servicio-cliente-tarifa-acabado" placeholder="<?= @lang("Tarifaacabado.tarifasacabado") ?>">
|
||||
</select>
|
||||
<div class="form-text"><?= @lang("ServicioCliente.infoTarifaAcabado") ?></div>
|
||||
|
||||
</div>
|
||||
<!-- Tarifa manipulado asociada a servicio-->
|
||||
<div class="col-xs-12 col-md-8 col-lg-6 mb-2 d-none" id="container-tarifa-manipulado-select">
|
||||
<label for="servicio-cliente-tarifa-manipulado" class="form-label"><?= @lang("Tarifamanipulado.tarifamanipulado") ?></label>
|
||||
<select class="select2 form-select" name="tarifa_manipulado_id" id="servicio-cliente-tarifa-manipulado" placeholder="<?= @lang("Tarifamanipulado.tarifasmanipulado") ?>">
|
||||
</select>
|
||||
<div class="form-text"><?= @lang("ServicioCliente.infoTarifaManipulado") ?></div>
|
||||
</div>
|
||||
<!-- Check tarifa acabado o manipulado -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-6 mb-2">
|
||||
<div class="text-light small fw-medium mb-2">Seleccione tipo de tarifa</div>
|
||||
<div class="switches-stacked">
|
||||
<label class="switch">
|
||||
<input type="radio" class="switch-input" id="check-tarifa-acabado" name="switches-stacked-radio" checked />
|
||||
<span class="switch-toggle-slider">
|
||||
<span class="switch-on"></span>
|
||||
<span class="switch-off"></span>
|
||||
</span>
|
||||
<span class="switch-label"><?= @lang("Tarifaacabado.tarifasacabado") ?></span>
|
||||
</label>
|
||||
<label class="switch">
|
||||
<input type="radio" class="switch-input" id="check-tarifa-manipulado" name="switches-stacked-radio" />
|
||||
<span class="switch-toggle-slider">
|
||||
<span class="switch-on"></span>
|
||||
<span class="switch-off"></span>
|
||||
</span>
|
||||
<span class="switch-label"><?= @lang("Tarifamanipulado.tarifasmanipulado") ?></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-2">
|
||||
<div class="col-md-12 d-flex justify-content-start gap-4">
|
||||
<button type="button" class="btn btn-primary btn-md d-none" id="btn-new-servicio-cliente"><?= lang("App.global_save") ?></button>
|
||||
<button type="button" class="btn btn-primary btn-md d-none" id="btn-update-servicio-cliente"><?= lang("App.global_save") ?></button>
|
||||
<button type="button" class="btn btn-secondary btn-md"><?= lang("App.global_come_back") ?></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
@ -0,0 +1,30 @@
|
||||
<div class="p-2" id="<?= $id ?>" data-id="<?= $tarifaId ?>">
|
||||
<form action="" id="tarifa-maquina" class="needs-validation" novalidate>
|
||||
<div class="row mb-3">
|
||||
<div class="col-md-5 col-xs-12 mb-2">
|
||||
<label for="select-tarifa-maquina">Máquina asociada</label>
|
||||
<select id="select-tarifa-maquina" class="select2 form-select" data-allow-clear="true"></select>
|
||||
</div>
|
||||
<div class="col-md-5 col-xs-12 mb-2">
|
||||
<label for="select-maquina-tarea">Tarea asociada</label>
|
||||
<select id="select-maquina-tarea" class="select2 form-select" data-allow-clear="true"></select>
|
||||
</div>
|
||||
<div class="col-md-2 col-xs-12 mb-2" id="container-new-tarifa-maquina">
|
||||
<br />
|
||||
<button type="button" class="btn btn-md btn-primary w-100 text-truncate" id="btn-new-tarifa-maquina"><?= lang("App.notification_btn_add") ?></button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
<table id="table-tarifa-maquinas" class="table table-striped table-hover" style="width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= lang('Maquinas.maquinas') ?></th>
|
||||
<th><?= lang('Maquinas.maquina_tarea') ?></th>
|
||||
<th>Acción</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
22
ci4/app/Views/themes/vuexy/components/tables/ot_table.php
Normal file
22
ci4/app/Views/themes/vuexy/components/tables/ot_table.php
Normal file
@ -0,0 +1,22 @@
|
||||
<div class="table-responsive">
|
||||
|
||||
<table id="<?= $id ?>" class="table table-striped table-hover" style="width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= lang('Produccion.datatable.pedido_id') ?></th>
|
||||
<th><?= lang('Produccion.datatable.fecha_encuadernacion') ?></th>
|
||||
<th><?= lang('Produccion.datatable.cliente') ?></th>
|
||||
<th><?= lang('Produccion.datatable.titulo') ?></th>
|
||||
<th><?= lang('Produccion.datatable.ubicacion') ?></th>
|
||||
<th><?= lang('Produccion.datatable.tirada') ?></th>
|
||||
<th><?= lang('Produccion.datatable.impresion') ?></th>
|
||||
<th><?= lang('Produccion.datatable.logo') ?></th>
|
||||
<th><?= lang('Produccion.datatable.progreso') ?></th>
|
||||
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@ -0,0 +1,20 @@
|
||||
<div class="table-responsive">
|
||||
|
||||
<table id="<?= $id ?>" class="table table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= lang('Produccion.task.order') ?></th>
|
||||
<th><?= lang('Produccion.task.task') ?></th>
|
||||
<th><?= lang('Produccion.task.maquina_presupuesto') ?></th>
|
||||
<th><?= lang('Produccion.task.maquina_actual') ?></th>
|
||||
<!-- <th><?= lang('Produccion.task.imposicion_id') ?></th> -->
|
||||
<th><?= lang('Produccion.task.tiempo_estimado') ?></th>
|
||||
<th><?= lang('Produccion.task.tiempo') ?></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@ -0,0 +1,17 @@
|
||||
<div class="table-responsive">
|
||||
|
||||
<table id="<?= $id ?>" class="table table-striped table-hover" style="width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= lang('Produccion.datatable.papel') ?></th>
|
||||
<th><?= lang('Produccion.datatable.gramaje') ?> (gr)</th>
|
||||
<th><?= lang('Produccion.datatable.tareas') ?></th>
|
||||
<th><?= lang('Produccion.datatable.tiradas') ?></th>
|
||||
<th><?= lang('Produccion.datatable.tiempo') ?>(HH:MM)</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@ -0,0 +1,38 @@
|
||||
<div class="table-responsive">
|
||||
|
||||
<table id="<?= $id ?>" class="table table-striped table-hover" style="width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= lang('ID') ?></th>
|
||||
<th><?= lang('Produccion.datatable.fecha_entrega_at') ?></th>
|
||||
<th><?= lang('Produccion.datatable.titulo') ?></th>
|
||||
<th><?= lang('Produccion.datatable.maquina') ?></th>
|
||||
<th><?= lang('Produccion.datatable.tirada') ?></th>
|
||||
<th><?= lang('Produccion.datatable.ancho') ?></th>
|
||||
<th><?= lang('Produccion.datatable.alto') ?></th>
|
||||
<th><?= lang('Produccion.datatable.papel') ?></th>
|
||||
<th><?= lang('Produccion.datatable.gramaje') ?></th>
|
||||
<!-- <th><?= lang('Produccion.datatable.corte') ?></th>
|
||||
<th><?= lang('Produccion.datatable.metros_sel') ?></th>
|
||||
<th><?= lang('Produccion.datatable.metros_papel') ?></th> -->
|
||||
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><input type="text" class="form-control planning-filter" name="otId" placeholder="ID"></th>
|
||||
<th><input type="text" class="form-control planning-filter" name="fecha_entrega_real_at" placeholder="d/m/Y"></th>
|
||||
<th><input type="text" class="form-control planning-filter" name="presupuesto_titulo" placeholder="Titulo"></th>
|
||||
<th><select class="select2 form-select select-maquina" id="maquina-select-filter" name="maquina_planning_nombre"></select></th>
|
||||
<th></th>
|
||||
<th><input type="text" class="form-control planning-filter" name="maquina_ancho" placeholder="Ancho"></th>
|
||||
<th><input type="text" class="form-control planning-filter" name="maquina_alto" placeholder="Alto"></th>
|
||||
<th><select class="form-control" name=""></select></th>
|
||||
<th><input type="text" class="form-control planning-filter" name=""></th>
|
||||
<th></th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@ -0,0 +1,14 @@
|
||||
|
||||
<table id="<?= $id ?>" class="table table-striped table-hover" style="width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= lang('ServicioCliente.datatable.nombre') ?></th>
|
||||
<th><?= lang('ServicioCliente.datatable.code') ?></th>
|
||||
<th><?= lang('ServicioCliente.datatable.created_at') ?></th>
|
||||
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
@ -0,0 +1,37 @@
|
||||
<?= $this->include('themes/_commonPartialsBs/select2bs5') ?>
|
||||
<?= $this->include('themes/_commonPartialsBs/datatables') ?>
|
||||
<?= $this->include('themes/_commonPartialsBs/_confirm2delete') ?>
|
||||
<?= $this->extend('themes/vuexy/main/defaultlayout') ?>
|
||||
|
||||
<?= $this->section('content'); ?>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
<div class="card card-info">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title"><?= lang('ServicioCliente.cardTitle') ?></h3>
|
||||
</div>
|
||||
<!--//.card-header -->
|
||||
<div class="card-body" id="serviciosClienteCard">
|
||||
|
||||
<?= view('themes/_commonPartialsBs/_alertBoxes'); ?>
|
||||
|
||||
<?= view('themes/vuexy/components/forms/servicio_cliente', ["id" => "formServicioCliente"]); ?>
|
||||
|
||||
</div>
|
||||
<!--//.card-body -->
|
||||
<div class="card-footer">
|
||||
|
||||
</div>
|
||||
<!--//.card-footer -->
|
||||
</div>
|
||||
<!--//.card -->
|
||||
</div>
|
||||
<!--//.col -->
|
||||
</div>
|
||||
<!--//.row -->
|
||||
<?= $this->endSection() ?>
|
||||
<?= $this->section("additionalExternalJs") ?>
|
||||
<script type="module" src="<?= site_url("assets/js/safekat/pages/configuracion/servicio_cliente/edit.js") ?>">
|
||||
</script>
|
||||
<?= $this->endSection() ?>
|
||||
@ -0,0 +1,37 @@
|
||||
<?= $this->include('themes/_commonPartialsBs/select2bs5') ?>
|
||||
<?= $this->include('themes/_commonPartialsBs/datatables') ?>
|
||||
<?= $this->include('themes/_commonPartialsBs/_confirm2delete') ?>
|
||||
<?= $this->extend('themes/vuexy/main/defaultlayout') ?>
|
||||
|
||||
<?= $this->section('content'); ?>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
<div class="card card-info">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title"><?= lang('ServicioCliente.cardTitle') ?></h3>
|
||||
</div>
|
||||
<!--//.card-header -->
|
||||
<div class="card-body" id="serviciosClienteCard">
|
||||
|
||||
<?= view('themes/_commonPartialsBs/_alertBoxes'); ?>
|
||||
|
||||
<?= view('themes/vuexy/components/tables/servicios_cliente_table', ["id" => "tableServiciosCliente"]); ?>
|
||||
|
||||
</div>
|
||||
<!--//.card-body -->
|
||||
<div class="card-footer">
|
||||
|
||||
</div>
|
||||
<!--//.card-footer -->
|
||||
</div>
|
||||
<!--//.card -->
|
||||
</div>
|
||||
<!--//.col -->
|
||||
</div>
|
||||
<!--//.row -->
|
||||
<?= $this->endSection() ?>
|
||||
<?= $this->section("additionalExternalJs") ?>
|
||||
<script type="module" src="<?= site_url("assets/js/safekat/pages/configuracion/servicio_cliente/index.js") ?>">
|
||||
</script>
|
||||
<?= $this->endSection() ?>
|
||||
@ -19,15 +19,26 @@
|
||||
<?= view("themes/vuexy/form/pedidos/_cabeceraItems") ?>
|
||||
<?= view("themes/vuexy/form/pedidos/_lineasItems") ?>
|
||||
<?php if (!(auth()->user()->inGroup('cliente-admin') || auth()->user()->inGroup('cliente-editor'))) : ?>
|
||||
<?= view("themes/vuexy/form/pedidos/_albaranesItems") ?>
|
||||
<?= view("themes/vuexy/form/pedidos/_albaranesItems") ?>
|
||||
<?php endif; ?>
|
||||
<?= view("themes/vuexy/form/pedidos/_facturasItems") ?>
|
||||
<?= view("themes/vuexy/components/chat_internal_pedido", data: ["modelId" => $pedidoEntity->id,"type" => "pedido"]) ?>
|
||||
<?= view("themes/vuexy/components/chat_internal_pedido", data: ["modelId" => $pedidoEntity->id, "type" => "pedido"]) ?>
|
||||
</div><!-- /.card-body -->
|
||||
<div class="pt-4">
|
||||
<?= anchor(route_to("listaPresupuestos"), lang("Basic.global.Cancel"), ["class" => "btn btn-secondary float-start"]) ?>
|
||||
</div><!-- /.card-footer -->
|
||||
|
||||
</form>
|
||||
<div class="row">
|
||||
<div class="col-md-12 d-flex justify-content-between">
|
||||
<div class="pt-4">
|
||||
<?= anchor(route_to("listaPresupuestos"), lang("Basic.global.Cancel"), ["class" => "btn btn-secondary float-start"]) ?>
|
||||
</div><!-- /.card-footer -->
|
||||
<?php if ($pedidoEntity->estado == 'finalizado') : ?>
|
||||
<div class="pt-4">
|
||||
<button type="button" class="btn btn-primary btn-md" id="button-pedido-to-prod" data-id="<?= $pedidoEntity->id ?>"><span> <i class="ti ti-building-factory-2 ti-xs"></i> <?= lang("Produccion.btn_pedido_produccion_accion") ?> </span></button>
|
||||
</div><!-- /.card-footer -->
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- //.card -->
|
||||
</div>
|
||||
<!--//.col -->
|
||||
@ -43,9 +54,13 @@
|
||||
<link rel="stylesheet"
|
||||
href="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.bootstrap5.min.css") ?>">
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/css/sk-datatables.css') ?>">
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/libs/sweetalert2/sweetalert2.css') ?>" />
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
<?= $this->section('additionalExternalJs') ?>
|
||||
<script src="<?= site_url('themes/vuexy/vendor/libs/sweetalert2/sweetalert2.js') ?>"></script>
|
||||
<script type="module" src="<?= site_url("assets/js/safekat/pages/produccion/to_prod.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/flatpickr/flatpickr.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/dataTables.buttons.min.js") ?>">
|
||||
</script>
|
||||
|
||||
@ -0,0 +1,6 @@
|
||||
|
||||
<div class="cold-md-12 mt-3">
|
||||
<!-- Comment text area-->
|
||||
<label for="ot-comment" class="form-label"><h4><?= @lang("Produccion.comments") ?></h4></label>
|
||||
<textarea rows=5 cols="10" type="text" class="form-control w-100" name="comentarios" id="ot-comment"></textarea>
|
||||
</div>
|
||||
18
ci4/app/Views/themes/vuexy/form/produccion/ot/otCosts.php
Normal file
18
ci4/app/Views/themes/vuexy/form/produccion/ot/otCosts.php
Normal file
@ -0,0 +1,18 @@
|
||||
<div class="accordion accordion-bordered mt-3" id="accordionOtCost">
|
||||
<div class="card accordion-item active">
|
||||
<h2 class="accordion-header">
|
||||
<button type="button" class="accordion-button" data-bs-toggle="collapse" data-bs-target="#accordionOtCostTip" aria-expanded="false" aria-controls="accordionOtCostTip">
|
||||
|
||||
<h4> <i class="tf-icon ti-receipt ti-xs ti">Costes producción</i> </h4>
|
||||
</button>
|
||||
</h2>
|
||||
|
||||
<div id="accordionOtCostTip" class="accordion-collapse collapse show" data-bs-parent="#accordionOtCost">
|
||||
<div class="accordion-body">
|
||||
<div class="row">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
79
ci4/app/Views/themes/vuexy/form/produccion/ot/otDates.php
Normal file
79
ci4/app/Views/themes/vuexy/form/produccion/ot/otDates.php
Normal file
@ -0,0 +1,79 @@
|
||||
<div class="accordion accordion-bordered mt-3" id="accordionOtDates">
|
||||
<div class="card accordion-item active">
|
||||
<h2 class="accordion-header">
|
||||
<button type="button" class="accordion-button" data-bs-toggle="collapse" data-bs-target="#accordionOtDatesTip" aria-expanded="false" aria-controls="accordionOtDatesTip">
|
||||
|
||||
<h4> <i class="tf-icon ti-calendar ti-xs ti">Fechas</i> </h4>
|
||||
</button>
|
||||
</h2>
|
||||
|
||||
<div id="accordionOtDatesTip" class="accordion-collapse collapse show" data-bs-parent="#accordionOtDates">
|
||||
<div class="accordion-body mt-2">
|
||||
<div class="row">
|
||||
<!-- Date 1-->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2">
|
||||
<label for="ot-tiempo-procesamiento" class="form-label"><?= @lang("Produccion.tiempo_procesamiento") ?></label>
|
||||
<input type="text" class="form-control" name="tiempo_procesamiento" placeholder="HH:MM" id="ot-tiempo-procesamiento" data-input disabled>
|
||||
</div>
|
||||
<!-- Date 2-->
|
||||
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2">
|
||||
<label for="ot-fecha-entrega" class="form-label"><?= @lang("Produccion.fecha_impresion") ?></label>
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="fecha_impresion_at" id="ot-fecha-impresion" data-input>
|
||||
|
||||
</div>
|
||||
<!-- Date 2-->
|
||||
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2">
|
||||
<label for="ot-fecha-entrega" class="form-label"><?= @lang("Produccion.fecha_encuadernado") ?></label>
|
||||
<input type="date" class="form-control ot-date" placeholder="DD/MM/YYYY" name="fecha_encuadernado_at" id="ot-fecha-encuadernado" data-input />
|
||||
</div>
|
||||
<!-- Date 4-->
|
||||
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2">
|
||||
<label for="ot-fecha-entrega" class="form-label"><?= @lang("Produccion.fecha_entrega_externo") ?></label>
|
||||
<input type="date" class="form-control ot-date" placeholder="DD/MM/YYYY" name="fecha_entrega_externo" id="ot-fecha-entrega-externo" data-input />
|
||||
</div>
|
||||
<!-- Date 5-->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2">
|
||||
<div class="row d-flex flex-column">
|
||||
<label for="ot-fecha-entrega" class="form-label"><?= @lang("Produccion.fecha_entrega_real") ?></label>
|
||||
<input type="date" class="form-control ot-date" placeholder="DD/MM/YYYY" name="fecha_entrega_real_at" id="ot-fecha-entrega-real" data-input />
|
||||
<label class="switch switch-danger switch-md mt-1">
|
||||
<input type="checkbox" class="switch-input ot-preview" name="fecha_entrega_warning" />
|
||||
<span class="switch-toggle-slider">
|
||||
<span class="switch-on">
|
||||
<i class="ti ti-alert-triangle"></i>
|
||||
</span>
|
||||
<span class="switch-off">
|
||||
<i class="ti ti-x"></i>
|
||||
</span>
|
||||
</span>
|
||||
<span class="switch-label">Inaplazable</span>
|
||||
</label>
|
||||
<label class="switch switch-md mt-1">
|
||||
<input type="checkbox" class="switch-input ot-preview" name="fecha_entrega_warning_revised" />
|
||||
<span class="switch-toggle-slider">
|
||||
<span class="switch-on">
|
||||
<i class="ti ti-check"></i>
|
||||
</span>
|
||||
<span class="switch-off">
|
||||
<i class="ti ti-x"></i>
|
||||
</span>
|
||||
</span>
|
||||
<span class="switch-label">Revisada</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- Date 6-->
|
||||
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2">
|
||||
<label for="ot-fecha-entrega" class="form-label"><?= @lang("Produccion.fecha_entrega_estimada") ?></label>
|
||||
<input type="date" class="form-control ot-date" placeholder="DD/MM/YYYY" name="fecha_entrega_estimada_at" id="ot-fecha-entrega-estimada" data-input disabled />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
42
ci4/app/Views/themes/vuexy/form/produccion/ot/otDetails.php
Normal file
42
ci4/app/Views/themes/vuexy/form/produccion/ot/otDetails.php
Normal file
@ -0,0 +1,42 @@
|
||||
<div class="accordion accordion-bordered mt-3" id="accordionOtDetails">
|
||||
<div class="card accordion-item active">
|
||||
<h2 class="accordion-header">
|
||||
<button type="button" class="accordion-button" data-bs-toggle="collapse" data-bs-target="#accordionOtDetailsTip" aria-expanded="false" aria-controls="accordionOtDetailsTip">
|
||||
|
||||
<h4> <i class="tf-icon ti-file-info ti-xs ti">Detalles</i> </h4>
|
||||
</button>
|
||||
</h2>
|
||||
|
||||
<div id="accordionOtDetailsTip" class="accordion-collapse collapse show" data-bs-parent="#accordionOtDetails">
|
||||
<div class="accordion-body">
|
||||
<div class="row">
|
||||
<!-- Detail 1-->
|
||||
<div class="col-xs-12 col-md-4 col-lg-2 mb-2">
|
||||
<label for="ot-formato" class="form-label"><?= @lang("Produccion.formato") ?></label>
|
||||
<input type="text" class="form-control" name="formato" id="ot-formato" disabled>
|
||||
</div>
|
||||
<!-- Detail 2-->
|
||||
<div class="col-xs-12 col-md-4 col-lg-2 mb-2">
|
||||
<label for="ot-paginas" class="form-label"><?= @lang("Produccion.paginas") ?></label>
|
||||
<input type="text" class="form-control" name="paginas" id="ot-paginas" name="presupuesto.paginas" disabled>
|
||||
</div>
|
||||
<!-- Detail 3-->
|
||||
<div class="col-xs-12 col-md-4 col-lg-2 mb-2">
|
||||
<label for="ot-solapa" class="form-label"><?= @lang("Produccion.solapa") ?></label>
|
||||
<input type="text" class="form-control" name="solapa" id="ot-solapa" disabled>
|
||||
</div>
|
||||
<!-- Detail 4-->
|
||||
<div class="col-xs-12 col-md-4 col-lg-2 mb-2">
|
||||
<label for="ot-tirada" class="form-label"><?= @lang("Produccion.tirada") ?></label>
|
||||
<input type="text" class="form-control" name="tirada" id="ot-tirada" name="presupuesto.tirada" disabled>
|
||||
</div>
|
||||
<!-- Detail 5-->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2">
|
||||
<label for="ot-merma" class="form-label"><?= @lang("Produccion.merma") ?></label>
|
||||
<input type="text" class="form-control" name="merma" id="ot-merma" name="presupuesto.merma" disabled>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -0,0 +1,77 @@
|
||||
<div class="row mt-3">
|
||||
<div class="col-md-4 text-start">
|
||||
<label for="text-avisar-comercial">
|
||||
<h4>Gestión de ferros</h4>
|
||||
</label>
|
||||
<p class="text-start">Indica si tiene ferro y las horas de entrega del mismo. Se le enviará un mensaje a comercial asociado indicando cuando estará disponible el ferro.</p>
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<div class="row mb-1">
|
||||
<div class="col-md-12">
|
||||
<label for="select-ferro-option" class="form-label">Gestión de envíos</label>
|
||||
<select name="ferro_option" id="select-ferro-option" class="form-control">
|
||||
<option value="0">Sin ferro</option>
|
||||
<option value="1">24h</option>
|
||||
<option value="2">48h</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-1">
|
||||
<div class="col-md-2">
|
||||
<label for="codigo-postal" class="form-label">CP</label>
|
||||
<input class="form-control" type="text" name="cp" id="codigo-postal">
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label for="codigo-seguimiento" class="form-label">Código seguimiento</label>
|
||||
<input class="form-control" type="text" name="codigo_seguimiento" id="codigo-seguimiento">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label for="select-empresa-envio-ferro" class="form-label">Empresa envío</label>
|
||||
<select name="empresa_envio" id="select-empresa-envio-ferro" class="form-control">
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mt-3">
|
||||
<div class="col-md-12">
|
||||
<button type="button" class="btn btn-success btn-md w-100">Confirmar envío ferro</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mt-3">
|
||||
<hr>
|
||||
<div class="col-md-4 text-start">
|
||||
<label for="text-avisar-comercial">
|
||||
<h4>Gestión de envíos</h4>
|
||||
</label>
|
||||
<p class="text-start">Introduce el número de seguimiento de envío. Se le enviará un mensaje al cliente asociado indicando el envío y el tracking.</p>
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<div class="row mb-1">
|
||||
<div class="col-md-2">
|
||||
<label for="codigo-postal-envio" class="form-label">CP</label>
|
||||
<input class="form-control" type="text" name="cp-envio" id="codigo-postal-envio">
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label for="n-bultos" class="form-label">N bultos</label>
|
||||
<input class="form-control" min="0" type="number" name="n_bultos" id="n-bultos">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label for="select-empresa-envio-envio" class="form-label">Empresa envío</label>
|
||||
<select name="empresa_envio" id="select-empresa-envio-envio" class="form-control">
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mt-3">
|
||||
<div class="col-md-6">
|
||||
<button type="button" class="btn btn-primary btn-md w-100">Etiqueda proveedor</button>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<button type="button" class="btn btn-success btn-md w-100">Confirmar envío</button>
|
||||
</div>
|
||||
</div>
|
||||
22
ci4/app/Views/themes/vuexy/form/produccion/ot/otPortada.php
Normal file
22
ci4/app/Views/themes/vuexy/form/produccion/ot/otPortada.php
Normal file
@ -0,0 +1,22 @@
|
||||
<div class="accordion accordion-bordered mt-3" id="accordionOtPortada">
|
||||
<div class="card accordion-item">
|
||||
<h2 class="accordion-header">
|
||||
<button type="button" class="accordion-button" data-bs-toggle="collapse" data-bs-target="#accordionOtPortadaTip" aria-expanded="false" aria-controls="accordionOtPortadaTip">
|
||||
|
||||
<h4> <i class="tf-icon ti-photo ti-xs ti">Portada</i> </h4>
|
||||
</button>
|
||||
</h2>
|
||||
|
||||
<div id="accordionOtPortadaTip" class="accordion-collapse collapse show" data-bs-parent="#accordionOtPortada">
|
||||
<div class="accordion-body">
|
||||
<div class="mb-3">
|
||||
<label for="formFile" class="form-label">Portada</label>
|
||||
<input class="form-control" type="file" id="portada-file-input">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<button type="button" class="btn btn-primary w-100" id="btn-upload-portada"><i class="ti ti-md ti-upload"></i>Subir portada </button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -0,0 +1,121 @@
|
||||
<div class="col-sm-4">
|
||||
<div class="text-light small fw-medium mb-4 text-start">Revisión</div>
|
||||
<div class="d-flex flex-column justify-content-start text-start gap-2">
|
||||
<label class="switch switch-md">
|
||||
<input type="checkbox" class="switch-input ot-preview" name="revisar_formato"/>
|
||||
<span class="switch-toggle-slider">
|
||||
<span class="switch-on">
|
||||
<i class="ti ti-check"></i>
|
||||
</span>
|
||||
<span class="switch-off">
|
||||
<i class="ti ti-x"></i>
|
||||
</span>
|
||||
</span>
|
||||
<span class="switch-label">Revisar formato</span>
|
||||
</label>
|
||||
<label class="switch switch-md">
|
||||
<input type="checkbox" class="switch-input ot-preview" name="revisar_lomo" />
|
||||
<span class="switch-toggle-slider">
|
||||
<span class="switch-on">
|
||||
<i class="ti ti-check"></i>
|
||||
</span>
|
||||
<span class="switch-off">
|
||||
<i class="ti ti-x"></i>
|
||||
</span>
|
||||
</span>
|
||||
<span class="switch-label">Revisar lomo</span>
|
||||
</label>
|
||||
<label class="switch switch-md">
|
||||
<input type="checkbox" class="switch-input ot-preview" name="revisar_solapa" />
|
||||
<span class="switch-toggle-slider">
|
||||
<span class="switch-on">
|
||||
<i class="ti ti-check"></i>
|
||||
</span>
|
||||
<span class="switch-off">
|
||||
<i class="ti ti-x"></i>
|
||||
</span>
|
||||
</span>
|
||||
<span class="switch-label">Revisar solapa</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-sm-4">
|
||||
<div class="text-light small fw-medium mb-4 text-start"> </div>
|
||||
<div class="d-flex flex-column justify-content-start text-start gap-2">
|
||||
<label class="switch switch-md">
|
||||
<input type="checkbox" class="switch-input ot-preview" name="revisar_isbn" />
|
||||
<span class="switch-toggle-slider">
|
||||
<span class="switch-on">
|
||||
<i class="ti ti-check"></i>
|
||||
</span>
|
||||
<span class="switch-off">
|
||||
<i class="ti ti-x"></i>
|
||||
</span>
|
||||
</span>
|
||||
<span class="switch-label">Revisar ISBN,D.L.</span>
|
||||
</label>
|
||||
<label class="switch switch-md">
|
||||
<input type="checkbox" class="switch-input ot-preview" name="revisar_codigo_barras" />
|
||||
<span class="switch-toggle-slider">
|
||||
<span class="switch-on">
|
||||
<i class="ti ti-check"></i>
|
||||
</span>
|
||||
<span class="switch-off">
|
||||
<i class="ti ti-x"></i>
|
||||
</span>
|
||||
</span>
|
||||
<span class="switch-label">Revisar código de barras</span>
|
||||
</label>
|
||||
<label class="switch switch-md">
|
||||
<input type="checkbox" class="switch-input ot-preview" name="realizar_imposicion" />
|
||||
<span class="switch-toggle-slider">
|
||||
<span class="switch-on">
|
||||
<i class="ti ti-check"></i>
|
||||
</span>
|
||||
<span class="switch-off">
|
||||
<i class="ti ti-x"></i>
|
||||
</span>
|
||||
</span>
|
||||
<span class="switch-label">Realizar imposición</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<div class="text-light small fw-medium mb-4 text-start"> </div>
|
||||
<div class="d-flex flex-column justify-content-start text-start gap-2">
|
||||
<label class="switch switch-md">
|
||||
<input type="checkbox" class="switch-input ot-preview" name="enviar_impresion" />
|
||||
<span class="switch-toggle-slider">
|
||||
<span class="switch-on">
|
||||
<i class="ti ti-check"></i>
|
||||
</span>
|
||||
<span class="switch-off">
|
||||
<i class="ti ti-x"></i>
|
||||
</span>
|
||||
</span>
|
||||
<span class="switch-label">Enviar a imprimir</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt-3">
|
||||
<hr>
|
||||
<div class="col-md-6 text-start">
|
||||
<label for="text-avisar-comercial">
|
||||
<h4>Avisar comercial</h4>
|
||||
</label>
|
||||
<p class="text-start">Enviar un mensaje al comercial indicando que faltan materiales.
|
||||
La orden se marcará y aparecerá en el listado: OTs pendientes de material</p>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="row text-start">
|
||||
<label for="comercial-message" class="form-label">Mensaje al comercial</label>
|
||||
<textarea class="form-control" rows="5" cols="5" style="resize: none;" placeholder="Escriba un mensaje"></textarea>
|
||||
</div>
|
||||
<div class="row mt-3">
|
||||
<button type="button" class="btn btn-primary btn-md p-2">Avisar comercial</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
95
ci4/app/Views/themes/vuexy/form/produccion/ot/otProgress.php
Normal file
95
ci4/app/Views/themes/vuexy/form/produccion/ot/otProgress.php
Normal file
@ -0,0 +1,95 @@
|
||||
<div class="accordion accordion-bordered mt-3" id="accordionOtProgress">
|
||||
<div class="card accordion-item active">
|
||||
<h2 class="accordion-header">
|
||||
<button type="button" class="accordion-button" data-bs-toggle="collapse" data-bs-target="#accordionOtProgressTip" aria-expanded="false" aria-controls="accordionOtProgressTip">
|
||||
|
||||
<h4> <i class="tf-icon ti-hourglass ti-xs ti">Progreso</i> </h4>
|
||||
</button>
|
||||
</h2>
|
||||
|
||||
<div id="accordionOtProgressTip" class="accordion-collapse collapse show" data-bs-parent="#accordionOtProgress">
|
||||
<div class="accordion-body">
|
||||
<div class="row">
|
||||
<div class="col-md-12 mb-3">
|
||||
<label class="form-label" for="ot-progress-bar-parent"><?=@lang("App.progress") ?></label>
|
||||
<div class="progress" id="ot-progress-bar-parent">
|
||||
<div id="ot-progress-bar" class="progress-bar" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2">
|
||||
<label for="ot-pendiente-ferro" class="form-label"><?= @lang("Produccion.pendiente_ferro") ?></label>
|
||||
<input type="text" class="form-control ot-date" name="pendiente_ferro_at" placeholder="DD/MM/YYYY" id="ot-pendiente-ferro">
|
||||
</div>
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2">
|
||||
<label for="ot-ferro-cliente" class="form-label"><?= @lang("Produccion.ferro_cliente") ?></label>
|
||||
<input type="text" class="form-control ot-date" name="ferro_en_cliente_at" placeholder="DD/MM/YYYY" id="ot-ferro-cliente">
|
||||
</div>
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2">
|
||||
<label for="ot-ferro-ok" class="form-label"><?= @lang("Produccion.ferro_ok") ?></label>
|
||||
<input type="text" class="form-control ot-date" name="ferro_ok_at" placeholder="DD/MM/YYYY" id="ot-ferro-ok">
|
||||
</div>
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2">
|
||||
<label for="ot-plakene-traslucido" class="form-label"><?= @lang("Produccion.plakene_traslucido") ?></label>
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="plakene_taslucido_at" id="ot-plakene-traslucido">
|
||||
</div>
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2">
|
||||
<label for="ot-impresion-color" class="form-label"><?= @lang("Produccion.impresion_color") ?></label>
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="interior_color_at" id="ot-impresion-color">
|
||||
</div>
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2">
|
||||
<label for="ot-portada" class="form-label"><?= @lang("Produccion.portada") ?></label>
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="cubierta_at" id="ot-portada">
|
||||
</div>
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2">
|
||||
<label for="ot-plastificado-mate" class="form-label"><?= @lang("Produccion.plastificado_mate") ?></label>
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="plastificado_at" id="ot-plastificado-mate">
|
||||
</div>
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2">
|
||||
<label for="ot-prep-guillotina" class="form-label"><?= @lang("Produccion.guillotina") ?></label>
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="corte_at" id="ot-prep-guillotina">
|
||||
</div>
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2">
|
||||
<label for="ot-espiral" class="form-label"><?= @lang("Produccion.espiral") ?></label>
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="espiral_at" id="ot-espiral">
|
||||
</div>
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2">
|
||||
<label for="ot-embalaje" class="form-label"><?= @lang("Produccion.embalaje") ?></label>
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="embalaje_at" id="ot-embalaje">
|
||||
</div>
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2">
|
||||
<label for="ot-envio" class="form-label"><?= @lang("Produccion.envio") ?></label>
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="envio_at" id="ot-envio">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="row">
|
||||
<p><?= @lang("Produccion.tiempo_estimado") ?> :</p>
|
||||
</div>
|
||||
<div class="row">
|
||||
<p><?= @lang("Produccion.tiempo_consumido") ?> :</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="d-grip">
|
||||
<button type="button" id="btn-finalizar-orden-pedido" class="btn btn-primary btn-block w-100" <?=$ot->estado == "F" ? "disabled" : "" ?>><?=@lang("Produccion.finalizar_orden")?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
72
ci4/app/Views/themes/vuexy/form/produccion/ot/otTask.php
Normal file
72
ci4/app/Views/themes/vuexy/form/produccion/ot/otTask.php
Normal file
@ -0,0 +1,72 @@
|
||||
<div class="accordion accordion-bordered mt-3" id="accordionOtTasks">
|
||||
<div class="card accordion-item active">
|
||||
<h2 class="accordion-header">
|
||||
<button type="button" class="accordion-button" data-bs-toggle="collapse" data-bs-target="#accordionOtTasksTip" aria-expanded="false" aria-controls="accordionOtTasksTip">
|
||||
|
||||
<h4> <i class="tf-icon ti-list-check ti-xs ti">Tareas</i> </h4>
|
||||
</button>
|
||||
</h2>
|
||||
|
||||
<div id="accordionOtTasksTip" class="accordion-collapse collapse show" data-bs-parent="#accordionOtTasks">
|
||||
<div class="accordion-body">
|
||||
<div class="card text-center">
|
||||
<div class="card-header">
|
||||
<div class="nav-align-top">
|
||||
<ul class="nav nav-pills" role="tablist">
|
||||
<li class="nav-item">
|
||||
<button type="button" class="nav-link d-flex flex-column gap-1 active" role="tab" data-bs-toggle="tab" data-bs-target="#nav-ot-task-general" aria-controls="nav-ot-task-general-active" aria-selected="true">Tareas</button>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<button type="button" class="nav-link d-flex flex-column gap-1" role="tab" data-bs-toggle="tab" data-bs-target="#nav-ot-task-preimpresion" aria-controls="nav-ot-task-preimpresion" aria-selected="false">Preimpresion</button>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<button type="button" class="nav-link d-flex flex-column gap-1" role="tab" data-bs-toggle="tab" data-bs-target="#nav-ot-task-ferro-envio" aria-controls="nav-ot-task-ferro-envio" aria-selected="false">Ferros y envíos</button>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<button type="button" class="nav-link d-flex flex-column gap-1" role="tab" data-bs-toggle="tab" data-bs-target="#nav-ot-task-messages" aria-controls="nav-ot-task-messages" aria-selected="false">Mensajes</button>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<!-- CARD BODY -->
|
||||
<div class="card-body">
|
||||
<div class="tab-content p-0">
|
||||
<!-- TAREAS -->
|
||||
<div class="tab-pane fade show active" id="nav-ot-task-general" role="tabpanel">
|
||||
<div class="row text-start">
|
||||
<div class="col-md-12">
|
||||
|
||||
<?= view("themes/vuexy/components/tables/ot_task_table", ["id" => "ot-task-table"]) ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row text-end mt-2">
|
||||
<div class="col-md-12">
|
||||
<button type="button" class="btn btn-danger btn-md" id="btn-reset-tareas"><i class="ti ti-trash ti-xs"></i> Reiniciar tareas</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- PREIMPRESION -->
|
||||
<div class="tab-pane fade" id="nav-ot-task-preimpresion" role="tabpanel">
|
||||
<div class="row text-start">
|
||||
<?= view("themes/vuexy/form/produccion/ot/otPreimpresionReview") ?>
|
||||
</div>
|
||||
</div>
|
||||
<!-- FERROS Y ENVIOS -->
|
||||
<div class="tab-pane fade" id="nav-ot-task-ferro-envio" role="tabpanel">
|
||||
<div class="row text-start">
|
||||
<?= view("themes/vuexy/form/produccion/ot/otFerrosEnvios") ?>
|
||||
</div>
|
||||
</div>
|
||||
<!-- MENSAJES -->
|
||||
<div class="tab-pane fade" id="nav-ot-task-messages" role="tabpanel">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -0,0 +1,45 @@
|
||||
<?= $this->include('themes/_commonPartialsBs/select2bs5') ?>
|
||||
<?= $this->include('themes/_commonPartialsBs/datatables') ?>
|
||||
<?= $this->include('themes/_commonPartialsBs/sweetalert') ?>
|
||||
<?= $this->include('themes/_commonPartialsBs/_confirm2delete') ?>
|
||||
<?= $this->extend('themes/vuexy/main/defaultlayout') ?>
|
||||
|
||||
|
||||
<?= $this->section('content'); ?>
|
||||
<!--Content Body-->
|
||||
<div class="row" id="planning-rotativa-page">
|
||||
<div class="col-md-12">
|
||||
<div class="nav-tabs-shadow nav-align-top">
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
<li class="nav-item">
|
||||
<button type="button" class="nav-link active" role="tab" id="navs-top-align-prot-tab" data-bs-toggle="tab" data-bs-target="#navs-top-align-prot"><?= lang("Produccion.planning_rotativa") ?></button>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<button type="button" class="nav-link" role="tab" id="navs-top-align-papel-gramaje-tab" data-bs-toggle="tab" data-bs-target="#navs-top-align-papel-gramaje"><?= lang("Produccion.papel_gramajes") ?></button>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tab-content" id="prot-datatables-container">
|
||||
<div class="tab-pane fade show active" id="navs-top-align-prot">
|
||||
<?= view("themes/vuexy/components/tables/planning_rot_table.php", ["id" => "planning-rotativa-datatable"]) ?>
|
||||
</div>
|
||||
<div class="tab-pane fade show" id="navs-top-align-papel-gramaje">
|
||||
<?= view("themes/vuexy/components/tables/planning_papel_gramaje_table.php", ["id" => "planning-papel-datatable"]) ?>
|
||||
</div>
|
||||
</div>
|
||||
<!--//.card -->
|
||||
</div>
|
||||
</div>
|
||||
<!--//.col -->
|
||||
</div>
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
<?= $this->section('css') ?>
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/libs/formvalidation/dist/css/formValidation.min.css') ?>" />
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
<?= $this->section("additionalExternalJs") ?>
|
||||
<script type="module" src="<?= site_url("assets/js/safekat/pages/produccion/planning_rotativa/index.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>
|
||||
<?= $this->endSection() ?>
|
||||
@ -0,0 +1,156 @@
|
||||
<?= $this->include('themes/_commonPartialsBs/select2bs5') ?>
|
||||
<?= $this->include('themes/_commonPartialsBs/datatables') ?>
|
||||
<?= $this->include('themes/_commonPartialsBs/sweetalert') ?>
|
||||
<?= $this->include('themes/_commonPartialsBs/_confirm2delete') ?>
|
||||
<?= $this->extend('themes/vuexy/main/defaultlayout') ?>
|
||||
<?= $this->section('content'); ?>
|
||||
<div id="ot-edit" data-id="<?= $modelId ?>">
|
||||
<div class="row">
|
||||
<div class="col-md-2 d-flex align-items-center justify-content-center">
|
||||
<div class="sk-wave sk-primary portada-loader">
|
||||
<div class="sk-wave-rect"></div>
|
||||
<div class="sk-wave-rect"></div>
|
||||
<div class="sk-wave-rect"></div>
|
||||
<div class="sk-wave-rect"></div>
|
||||
<div class="sk-wave-rect"></div>
|
||||
</div>
|
||||
|
||||
<img class="rounded" id="portada-orden-trabajo" src="" width="100%" height="100%" hidden>
|
||||
</div>
|
||||
<div class="col-md-10">
|
||||
|
||||
<div class="alert alert-info h-100" role="alert" id="alert-orden-trabajo">
|
||||
<div class="row">
|
||||
<div class="col-md-10">
|
||||
<div class="d-flex flex-row bd-highlight gap-2">
|
||||
<div class="bd-highlight">
|
||||
<h4>OT : </h4>
|
||||
</div>
|
||||
<div class="bd-highlight">
|
||||
<h4><?= $ot->id ?></h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<div class="d-flex flex-row bd-highlight justify-content-end">
|
||||
<h4><?= $ot->progreso ?> %</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-10">
|
||||
|
||||
<div class="d-flex flex-row bd-highlight gap-2">
|
||||
<div class="bd-highlight">
|
||||
<span><i class="tf-icons ti-md ti ti-building-factory-2"></i></span>
|
||||
</div>
|
||||
<div class="bd-highlight">
|
||||
<h4><?= $presupuesto->titulo ?></h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<div class="d-flex flex-row bd-highlight justify-content-end">
|
||||
<button class="btn btn-sm btn-warning w-100">Presupuesto</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-10">
|
||||
<div class="d-flex flex-row bd-highlight">
|
||||
<div class="bd-highlight">
|
||||
<span><i class="tf-icons ti-md ti ti-user"></i></span>
|
||||
</div>
|
||||
<div>
|
||||
<h4><?= $cliente->nombre ?></h4>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-md-2 ">
|
||||
<div class="d-flex flex-row bd-highlight justify-content-end">
|
||||
<button class="btn btn-sm btn-warning w-100">Pedido</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div><!--//.col -->
|
||||
|
||||
</div><!--//.row -->
|
||||
<div class="row">
|
||||
<form id="ot-edit-form">
|
||||
<div class="col-md-12">
|
||||
<?= view("themes/vuexy/form/produccion/ot/otPortada") ?>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<?= view("themes/vuexy/form/produccion/ot/otDates") ?>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<?= view("themes/vuexy/form/produccion/ot/otDetails") ?>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<?= view("themes/vuexy/form/produccion/ot/otProgress") ?>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<?= view("themes/vuexy/form/produccion/ot/otTask") ?>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<?= view("themes/vuexy/form/produccion/ot/otCosts") ?>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<?= view("themes/vuexy/form/produccion/ot/otComments") ?>
|
||||
</div>
|
||||
</form>
|
||||
<div class="col-md-12 mt-3">
|
||||
<div class="d-grip gap-2">
|
||||
<a type="button" class="btn btn-primary btn-block w-100 mb-1" target="__blank" href="<?= "/produccion/ordentrabajo/pdf/" . $modelId ?>"><?= @lang("Produccion.preview_pdf") ?></a>
|
||||
<button type="button" class="btn btn-primary btn-block w-100 mb-1"><?= @lang("Produccion.imprimir_ferro") ?></button>
|
||||
<button type="button" class="btn btn-secondary btn-block w-100 mb-1"><?= @lang("Produccion.imprimir_codigo_safekat") ?></button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Modal -->
|
||||
<div class="modal fade" id="modalCommentTarea" tabindex="-1" aria-hidden="true">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="exampleModalLabel1"><?= lang('Produccion.tarea') ?></h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<label for="comment-tarea" class="form-label d-flex text-start w-100">Comentario <p id="comment-type"></p></label>
|
||||
<textarea name="comment" class="form-control" id="comment-tarea" rows="5" cols="5"></textarea>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" id="btn-update-tarea-comment" class="btn btn-primary"><?= lang('Chat.modal.btn_send') ?></button>
|
||||
<button type="button" class="btn btn-label-secondary" data-bs-dismiss="modal"><?= lang('App.global_come_back') ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
<?= $this->section('css') ?>
|
||||
<link rel="stylesheet" href="<?= site_url("themes/vuexy/vendor/libs/dropzone/dropzone.css") ?>" />
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/libs/spinkit/spinkit.css') ?>" />
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/libs/sweetalert2/sweetalert2.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.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/autosize/autosize.js') ?>"></script>
|
||||
<script src="<?= site_url('themes/vuexy/vendor/libs/two/two.js') ?>"></script>
|
||||
<script src="<?= site_url('themes/vuexy/vendor/libs/sweetalert2/sweetalert2.js') ?>"></script>
|
||||
<script src="<?= site_url('themes/vuexy/vendor/libs/perfect-scrollbar/perfect-scrollbar.js') ?>"></script>
|
||||
|
||||
<script type="module" src="<?= site_url('assets/js/safekat/pages/produccion/edit.js') ?>"></script>
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
@ -0,0 +1,62 @@
|
||||
<?= $this->include('themes/_commonPartialsBs/select2bs5') ?>
|
||||
<?= $this->include('themes/_commonPartialsBs/datatables') ?>
|
||||
<?= $this->include('themes/_commonPartialsBs/sweetalert') ?>
|
||||
<?= $this->include('themes/_commonPartialsBs/_confirm2delete') ?>
|
||||
<?= $this->extend('themes/vuexy/main/defaultlayout') ?>
|
||||
|
||||
<?= $this->include('themes/_commonPartialsBs/select2bs5') ?>
|
||||
<?= $this->include('themes/_commonPartialsBs/datatables') ?>
|
||||
<?= $this->include('themes/_commonPartialsBs/_confirm2delete') ?>
|
||||
<?= $this->extend('themes/vuexy/main/defaultlayout') ?>
|
||||
|
||||
|
||||
<?= $this->section('content'); ?>
|
||||
<!--Content Body-->
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="nav-tabs-shadow nav-align-top">
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
<li class="nav-item">
|
||||
<button type="button" class="nav-link active" role="tab" id="navs-top-align-finalizados-tab" data-bs-toggle="tab" data-bs-target="#navs-top-align-finalizados"><?= lang("Produccion.finalizadas") ?></button>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<button type="button" class="nav-link" role="tab" id="navs-top-align-pendientes-tab" data-bs-toggle="tab" data-bs-target="#navs-top-align-pendientes"><?= lang("Produccion.pendientes") ?></button>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<button type="button" class="nav-link" role="tab" id="navs-top-align-ferro-pendiente-tab" data-bs-toggle="tab" data-bs-target="#navs-top-align-ferro-pendiente"><?= lang("Produccion.pendiente_ferro") ?></button>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<button type="button" class="nav-link" role="tab" id="navs-top-align-ferro-ok-tab" data-bs-toggle="tab" data-bs-target="#navs-top-align-ferro-ok"><?= lang("Produccion.ferro_ok") ?></button>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tab-content" id="ots-datatables-container">
|
||||
<div class="tab-pane fade show active" id="navs-top-align-finalizados">
|
||||
<?= view("themes/vuexy/components/tables/ot_table.php", ["id" => "ot-datatable-finalizados"]) ?>
|
||||
</div>
|
||||
<div class="tab-pane fade show" id="navs-top-align-pendientes">
|
||||
<?= view("themes/vuexy/components/tables/ot_table.php", ["id" => "ot-datatable-pendientes"]) ?>
|
||||
</div>
|
||||
<div class="tab-pane fade show" id="navs-top-align-ferro-pendiente">
|
||||
<?= view("themes/vuexy/components/tables/ot_table.php", ["id" => "ot-datatable-ferro-pendiente"]) ?>
|
||||
</div>
|
||||
<div class="tab-pane fade show" id="navs-top-align-ferro-ok">
|
||||
<?= view("themes/vuexy/components/tables/ot_table.php", ["id" => "ot-datatable-ferro-ok"]) ?>
|
||||
</div>
|
||||
</div>
|
||||
<!--//.card -->
|
||||
</div>
|
||||
</div>
|
||||
<!--//.col -->
|
||||
</div>
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
<?= $this->section('css') ?>
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/libs/formvalidation/dist/css/formValidation.min.css') ?>" />
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
<?= $this->section("additionalExternalJs") ?>
|
||||
<script type="module" src="<?= site_url("assets/js/safekat/pages/produccion/index.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>
|
||||
<?= $this->endSection() ?>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user