mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Compare commits
34 Commits
feat/tarif
...
feat/revis
| Author | SHA1 | Date | |
|---|---|---|---|
| 5ce6859a2f | |||
| 2bfdd89085 | |||
| 305eea00e6 | |||
| 8ea6128109 | |||
| 7b645539e3 | |||
| fb7f2a28d9 | |||
| 39639d9ff8 | |||
| 3f90665c39 | |||
| 71e70bf551 | |||
| db70c57fb3 | |||
| 91b044bbae | |||
| a88ffda50d | |||
| 746955c3b1 | |||
| 8ca0a40b2b | |||
| 20c009f445 | |||
| 5138681718 | |||
| 9283059f9d | |||
| b75278f449 | |||
| 3fb944ff97 | |||
| c7250cb8fd | |||
| 7a9b2af8a6 | |||
| cf5a42de8d | |||
| a259d76e5e | |||
| f696153d74 | |||
| 9181905233 | |||
| 0ec7dff479 | |||
| b0fb0f18fb | |||
| cf4c4df80a | |||
| 4e9dfb51c7 | |||
| 5aab9a33ac | |||
| ea762a09c0 | |||
| 21014d029f | |||
| 9c31f2bbc5 | |||
| b288ca498c |
@ -12,8 +12,14 @@ class OrdenTrabajo extends BaseConfig
|
||||
"interior_bn_at" => "interior_bn_user_id",
|
||||
"interior_color_at" => "interior_color_user_id",
|
||||
"cubierta_at" => "cubierta_user_id",
|
||||
"sobrecubierta_at" => "sobrecubierta_user_id",
|
||||
"guarda_at" => "guarda_user_id",
|
||||
//ACABADO
|
||||
"plastificado_at" => "plastificado_user_id",
|
||||
"plakene_at" => "plakene_user_id",
|
||||
"retractilado_at" => "retractilado_user_id",
|
||||
"estampado_at" => "estampado_user_id",
|
||||
"uvi_at" => "uvi_user_id",
|
||||
"encuadernacion_at" => "encuadernacion_user_id",
|
||||
"corte_at" => "corte_user_id",
|
||||
"preparacion_interiores_at" => "preparacion_interior_user_id",
|
||||
@ -21,7 +27,6 @@ class OrdenTrabajo extends BaseConfig
|
||||
"cosido_at" => "cosido_user_id",
|
||||
"grapado_at" => "grapado_user_id",
|
||||
"solapa_at" => "solapa_user_id",
|
||||
"retractilado_at" => "retractilado_user_id",
|
||||
"retractilado5_at" => "retractilado5_user_id",
|
||||
"prototipo_at" => "prototipo_user_id",
|
||||
"marcapaginas_at" => "marcapaginas_user_id",
|
||||
@ -116,6 +121,14 @@ class OrdenTrabajo extends BaseConfig
|
||||
"default" => ["bg" => "white", "color" => "black"],
|
||||
];
|
||||
|
||||
public array $OT_TAREA_STATUS_COLOR = [
|
||||
"P" => '#FFB22C',
|
||||
"F" => '#67AE6E',
|
||||
"S" => '#EB5B00',
|
||||
"I" => '#3A59D1',
|
||||
"E" => '#FF0B55',
|
||||
"D" => '#FFA725',
|
||||
];
|
||||
|
||||
|
||||
public function __construct()
|
||||
|
||||
@ -40,8 +40,8 @@ foreach (glob(APPPATH . 'Config/Routes/*Routes.php') as $routeFile) {
|
||||
|
||||
$routes->group('users', ['namespace' => 'App\Controllers\Configuracion'], function ($routes) {
|
||||
$routes->get('', 'Users::index', ['as' => 'userList']);
|
||||
$routes->get('maquinista/change/user','Users::index_maquinista_change_user',['as' => 'maquinistaUserChangeList']);
|
||||
$routes->get('maquinista/change/session/(:num)','Users::change_user_session/$1',['as' => 'maquinistaChangeUserSession']);
|
||||
$routes->get('maquinista/change/user', 'Users::index_maquinista_change_user', ['as' => 'maquinistaUserChangeList']);
|
||||
$routes->get('maquinista/change/session/(:num)', 'Users::change_user_session/$1', ['as' => 'maquinistaChangeUserSession']);
|
||||
$routes->get('list', 'Users::index', ['as' => 'userList2']);
|
||||
$routes->get('add', 'Users::add', ['as' => 'newUser']);
|
||||
$routes->post('add', 'Users::add', ['as' => 'createUser']);
|
||||
@ -742,18 +742,28 @@ $routes->group('soporte', ['namespace' => 'App\Controllers\Soporte'], function (
|
||||
|
||||
$routes->group('produccion', ['namespace' => 'App\Controllers\Produccion'], function ($routes) {
|
||||
$routes->group('ordentrabajo', ['namespace' => 'App\Controllers\Produccion'], function ($routes) {
|
||||
/** VIEWS */
|
||||
$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');
|
||||
|
||||
/** GET */
|
||||
$routes->get('summary/(:num)', 'Ordentrabajo::get_orden_trabajo_summary/$1', ['as' => 'getOrdenTrabajoSumary']);
|
||||
$routes->get("tarea/progress/(:num)", "Ordentrabajo::get_orden_trabajo_progress_date/$1");
|
||||
$routes->get('tarea/(:num)', 'Ordentrabajo::find_tarea/$1');
|
||||
$routes->get('tarea/dates/(:num)', 'Ordentrabajo::get_orden_trabajo_tareas_dates/$1');
|
||||
$routes->get('tareas/maquina/(:num)/(:num)','Ordentrabajo::get_tareas_ot_maquina/$1/$2');
|
||||
/** DATATABLES */
|
||||
$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('datatable_news', 'Ordentrabajo::datatable_news');
|
||||
$routes->get('datatable_prod', 'Ordentrabajo::datatable_prod');
|
||||
$routes->get('datatable_waiting', 'Ordentrabajo::datatable_waiting');
|
||||
$routes->get('datatable_revision_com', 'Ordentrabajo::datatable_revision_com');
|
||||
$routes->get('tareas/datatable/(:num)', 'Ordentrabajo::tareas_datatable/$1', ['as' => 'datatableTareasOrdenTrabajo']);
|
||||
$routes->get("tarea/progress/(:num)", "Ordentrabajo::get_orden_trabajo_progress_date/$1");
|
||||
$routes->get('tarea/(:num)', 'Ordentrabajo::find_tarea/$1');
|
||||
$routes->get('maquinas/ots/datatable/(:num)','Ordentrabajo::datatable_maquina_ordenes_trabajo/$1');
|
||||
$routes->get('maquinas/ots/(:num)','Ordentrabajo::get_maquina_ots/$1');
|
||||
/**======================
|
||||
* UPDATES
|
||||
*========================**/
|
||||
@ -762,17 +772,27 @@ $routes->group('produccion', ['namespace' => 'App\Controllers\Produccion'], func
|
||||
$routes->post("reset/date", 'Ordentrabajo::reset_orden_trabajo_date');
|
||||
$routes->post("update/pedido/date", 'Ordentrabajo::update_orden_trabajo_pedido_date');
|
||||
$routes->post("reset/pedido/date", 'Ordentrabajo::reset_orden_trabajo_pedido_date');
|
||||
$routes->post("update/pod/pedido/date/(:num)",'Ordentrabajo::update_pod_pedido_dates/$1');
|
||||
$routes->post("update/pod/pedido/date/(:num)", 'Ordentrabajo::update_pod_pedido_dates/$1');
|
||||
$routes->post("update/pedido", 'Ordentrabajo::update_orden_trabajo_pedido');
|
||||
$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');
|
||||
$routes->delete("portada/(:num)", 'Ordentrabajo::delete_orden_trabajo_portada/$1');
|
||||
$routes->get("color/(:num)", 'Ordentrabajo::get_orden_trabajo_color_status/$1');
|
||||
$routes->post("update/tarea/progress", "Ordentrabajo::store_orden_trabajo_progress_date");
|
||||
$routes->post("update/tarea/pliegos", "Ordentrabajo::update_orden_trabajo_pliegos");
|
||||
$routes->delete("tarea/progress/(:num)", "Ordentrabajo::delete_orden_trabajo_progress_date/$1");
|
||||
$routes->post("update/tarea/proveedor", "Ordentrabajo::update_presupuesto_tarea_proveedor");
|
||||
$routes->post("fa/tareas/finish", 'Ordentrabajo::update_orden_trabajo_fa_tareas');
|
||||
$routes->post('maquinas/ots','Ordentrabajo::store_maquina_ordenes_trabajo');
|
||||
$routes->post('maquinas/ots/estado','Ordentrabajo::update_maquina_ordenes_trabajo_estado');
|
||||
|
||||
|
||||
/**DELETES */
|
||||
$routes->delete("portada/(:num)", 'Ordentrabajo::delete_orden_trabajo_portada/$1');
|
||||
$routes->delete("tarea/progress/(:num)", "Ordentrabajo::delete_orden_trabajo_progress_date/$1");
|
||||
$routes->delete('reset/tareas/(:num)', 'Ordentrabajo::reset_tareas/$1');
|
||||
$routes->delete('tareas/(:num)', 'Ordentrabajo::delete_tarea/$1');
|
||||
$routes->delete('maquinas/ots/(:num)', 'Ordentrabajo::delete_maquina_orden_trabajo_tarea/$1');
|
||||
$routes->delete('maquinas/ots/all/(:num)', 'Ordentrabajo::delete_maquina_orden_trabajo_all/$1');
|
||||
/**======================
|
||||
* FILES
|
||||
*========================**/
|
||||
@ -783,7 +803,10 @@ $routes->group('produccion', ['namespace' => 'App\Controllers\Produccion'], func
|
||||
* PDF
|
||||
*========================**/
|
||||
$routes->get('pdf/(:num)', 'Ordentrabajo::get_pdf/$1');
|
||||
$routes->get('pdf/ferro/(:num)', 'Ordentrabajo::get_ferro_pdf/$1');
|
||||
$routes->get('pdf/prototipo/(:num)', 'Ordentrabajo::get_prototipo_pdf/$1');
|
||||
$routes->get('portada/(:num)', 'Ordentrabajo::get_portada_img/$1');
|
||||
/** PLANNING */
|
||||
$routes->group('planning', ['namespace' => 'App\Controllers\Produccion'], function ($routes) {
|
||||
$routes->get('select/maquina/rotativa', 'Ordentrabajo::select_maquina_planning_rot');
|
||||
$routes->get('select/papel/rotativa', 'Ordentrabajo::select_papel_planning_rot');
|
||||
@ -799,12 +822,21 @@ $routes->group('produccion', ['namespace' => 'App\Controllers\Produccion'], func
|
||||
});
|
||||
|
||||
$routes->group('maquinista', ['namespace' => 'App\Controllers\Produccion'], function ($routes) {
|
||||
/**
|
||||
* VIEWS
|
||||
*/
|
||||
$routes->get('maquinas/view', 'Ordentrabajo::maquinista_maquinas_view', ['as' => 'viewProduccionMaquinistaMaquinas']);
|
||||
$routes->get('maquinas/view/(:num)', 'Ordentrabajo::maquinista_maquina_tareas_list/$1', ['as' => 'viewProduccionMaquinaTareasList']);
|
||||
$routes->get('maquinas/tareas/datatable/(:alpha)/(:num)', 'Ordentrabajo::maquinista_maquina_tareas_datatable/$1/$2', ['as' => 'viewMaquinistaMaquinaTareaDatatable']);
|
||||
|
||||
$routes->get('maquinas/view/auto/(:num)', 'Ordentrabajo::maquinista_maquina_tareas_fichaje_automatico/$1', ['as' => 'viewMaquinistaFichajeAutomatico']);
|
||||
$routes->get('maquinas/view/scan/(:num)', 'Ordentrabajo::maquinista_maquina_tareas_scan/$1', ['as' => 'viewMaquinistaTareaScan']);
|
||||
$routes->get('maquinas/view/tarea/(:num)', 'Ordentrabajo::maquinista_maquina_tarea_view/$1', ['as' => 'viewProduccionMaquinistaTareaView']);
|
||||
$routes->get('maquinas/view/maquina/ot/tareas/(:num)', 'Ordentrabajo::maquinista_maquina_ot_tareas_view/$1', ['as' => 'viewProduccionMaquinistaOtTareasView']);
|
||||
|
||||
$routes->get('colas/view', 'Ordentrabajo::maquinista_colas_view', ['as' => 'viewProduccionMaquinistaColas']);
|
||||
|
||||
/** DATATABLE */
|
||||
$routes->get('maquinas/tareas/datatable/(:alpha)/(:num)', 'Ordentrabajo::maquinista_maquina_tareas_datatable/$1/$2', ['as' => 'viewMaquinistaMaquinaTareaDatatable']);
|
||||
$routes->get('maquinas/tareas/aplazadas/datatable/(:num)', 'Ordentrabajo::maquinista_maquina_tareas_aplazada_datatable/$1', ['as' => 'viewMaquinistaMaquinaTareaAplazadaDatatable']);
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -814,6 +846,7 @@ $routes->group('logistica', ['namespace' => 'App\Controllers\Logistica'], functi
|
||||
$routes->get('panel', 'LogisticaController::panel', ['as' => 'LogisticaPanel']);
|
||||
$routes->get('envios', 'LogisticaController::gestionEnvios', ['as' => 'gestionEnvios']);
|
||||
$routes->get('enviosFerros', 'LogisticaController::gestionEnviosFerros', ['as' => 'gestionEnviosFerros']);
|
||||
$routes->get('etiquetasLogistica', 'LogisticaController::etiquetasLogistica', ['as' => 'etiquetasLogistica']);
|
||||
$routes->get('datatableEnvios', 'LogisticaController::datatable_envios');
|
||||
$routes->get('datatableLineasEnvios/(:num)', 'LogisticaController::datatable_enviosEdit/$1');
|
||||
$routes->get('envio/(:num)', 'LogisticaController::editEnvio/$1');
|
||||
@ -834,7 +867,25 @@ $routes->group('logistica', ['namespace' => 'App\Controllers\Logistica'], functi
|
||||
$routes->post('imprimirEtiquetas', 'LogisticaController::imprimirEtiquetas');
|
||||
|
||||
$routes->get('listAlbaranes', 'LogisticaController::listAlbaranes', ['as' => 'albaranesList']);
|
||||
|
||||
});
|
||||
|
||||
$routes->group('etiquetasTitulos', ['namespace' => 'App\Controllers\Logistica'], function ($routes) {
|
||||
|
||||
$routes->get('otList', 'EtiquetasTitulosController::findOTs');
|
||||
$routes->get('addList', 'EtiquetasTitulosController::findAddresses');
|
||||
$routes->post('newEtiquetaTitulos', 'EtiquetasTitulosController::addEtiqueta');
|
||||
$routes->get('datatable', 'EtiquetasTitulosController::datatable');
|
||||
$routes->post('delete', 'EtiquetasTitulosController::deleteEtiqueta');
|
||||
$routes->get('edit/(:num)', 'EtiquetasTitulosController::edit/$1');
|
||||
$routes->get('datatableLineas/(:num)', 'EtiquetasTitulosController::datatableLineasEtiquetas/$1');
|
||||
$routes->get('findOts', 'EtiquetasTitulosController::findOtsWithAddress');
|
||||
$routes->post('addLineas', 'EtiquetasTitulosController::addLineasEtiqueta');
|
||||
$routes->post('deleteLineas', 'EtiquetasTitulosController::deleteLineasEtiqueta');
|
||||
$routes->post('updateLineas', 'EtiquetasTitulosController::updateLineasEtiqueta');
|
||||
$routes->post('updateComentarios', 'EtiquetasTitulosController::updateComentarios');
|
||||
$routes->post('updateOrdenCajas', 'EtiquetasTitulosController::updateOrdenCajas');
|
||||
$routes->post('renumber', 'EtiquetasTitulosController::renumberCajas');
|
||||
$routes->post('imprimirEtiquetas', 'EtiquetasTitulosController::imprimirEtiquetas');
|
||||
});
|
||||
|
||||
/*
|
||||
|
||||
@ -6,20 +6,33 @@ use CodeIgniter\Router\RouteCollection;
|
||||
|
||||
/* Rutas para tarifas */
|
||||
$routes->group('importador', ['namespace' => 'App\Controllers\Importadores'], function ($routes) {
|
||||
/* Libros */
|
||||
|
||||
/* Desde Catalogo */
|
||||
$routes->group('catalogo', ['namespace' => 'App\Controllers\Importadores'], function ($routes) {
|
||||
/**======================
|
||||
* Tool
|
||||
*========================**/
|
||||
$routes->get('', 'ImportadorCatalogo::index', ['as' => 'importadorCatalogoTool']);
|
||||
|
||||
|
||||
/**======================
|
||||
* AJAX
|
||||
*========================**/
|
||||
$routes->post('validar-fila', 'ImportadorCatalogo::validarFila');
|
||||
$routes->post('importar-fila', 'ImportadorCatalogo::importarFila');
|
||||
|
||||
});
|
||||
|
||||
/* Desde Cliente Bubok */
|
||||
$routes->group('bubok', ['namespace' => 'App\Controllers\Importadores'], function ($routes) {
|
||||
/**======================
|
||||
* Tool
|
||||
*========================**/
|
||||
$routes->get('', 'ImportadorBubok::index', ['as' => 'importadorBubokTool']);
|
||||
|
||||
/**======================
|
||||
* AJAX
|
||||
*========================**/
|
||||
$routes->post('importar-fila', 'ImportadorBubok::importarFila');
|
||||
|
||||
});
|
||||
});
|
||||
@ -172,6 +172,40 @@ class Validation extends BaseConfig
|
||||
"label" => "Orden trabajo"
|
||||
],
|
||||
|
||||
];
|
||||
public array $orden_trabajo_fichaje_auto = [
|
||||
"orden_trabajo_id" => [
|
||||
"rules" => "required|integer",
|
||||
"label" => "Orden trabajo"
|
||||
],
|
||||
"maquina_id" => [
|
||||
"rules" => "required|integer",
|
||||
"label" => "Máquina"
|
||||
],
|
||||
"tareas" => [
|
||||
"rules" => "required",
|
||||
"label" => "Tareas"
|
||||
],
|
||||
"click_init" => [
|
||||
"rules" => "required|integer",
|
||||
"label" => "Click init"
|
||||
],
|
||||
"click_end" => [
|
||||
"rules" => "required|integer",
|
||||
"label" => "Click end"
|
||||
],
|
||||
|
||||
];
|
||||
public array $maquina_ordenes_trabajo = [
|
||||
"ordenes_trabajo" => [
|
||||
"rules" => "required",
|
||||
"label" => "Orden trabajo"
|
||||
],
|
||||
"maquina_id" => [
|
||||
"rules" => "required|integer",
|
||||
"label" => "Máquina"
|
||||
],
|
||||
|
||||
];
|
||||
public array $chat_department =
|
||||
[
|
||||
@ -184,4 +218,15 @@ class Validation extends BaseConfig
|
||||
"label" => "maquina",
|
||||
],
|
||||
];
|
||||
public array $proveedor_tarea =
|
||||
[
|
||||
"proveedor_id" => [
|
||||
"rules" => "required|integer",
|
||||
"label" => "Proveedor",
|
||||
],
|
||||
"orden_trabajo_tarea_id" => [
|
||||
"rules" => "required|integer",
|
||||
"label" => "Tarea",
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
396
ci4/app/Controllers/Importadores/ImportadorBubok.php
Normal file
396
ci4/app/Controllers/Importadores/ImportadorBubok.php
Normal file
@ -0,0 +1,396 @@
|
||||
<?php
|
||||
namespace App\Controllers\Importadores;
|
||||
|
||||
use App\Controllers\BaseResourceController;
|
||||
use App\Controllers\Presupuestos\Presupuestocliente;
|
||||
use App\Services\PresupuestoService;
|
||||
|
||||
class ImportadorBubok extends BaseResourceController
|
||||
{
|
||||
|
||||
protected $format = 'json';
|
||||
|
||||
protected static $singularObjectName = 'Importador';
|
||||
protected static $singularObjectNameCc = 'ImportadorBubok';
|
||||
protected static $pluralObjectName = 'Importadores';
|
||||
protected static $pluralObjectNameCc = 'importadores';
|
||||
|
||||
protected static $controllerSlug = 'importador';
|
||||
|
||||
protected static $viewPath = 'themes/vuexy/form/importador/bubok/';
|
||||
|
||||
protected $indexRoute = 'ImportadorBubokTool';
|
||||
|
||||
|
||||
public function initController(\CodeIgniter\HTTP\RequestInterface $request, \CodeIgniter\HTTP\ResponseInterface $response, \Psr\Log\LoggerInterface $logger)
|
||||
{
|
||||
$this->viewData['pageTitle'] = lang('Importador.listingPage');
|
||||
$this->viewData['usingSweetAlert'] = true;
|
||||
|
||||
// Breadcrumbs (IMN)
|
||||
$this->viewData['breadcrumb'] = [
|
||||
['title' => lang("App.menu_importadores"), 'route' => "javascript:void(0);", 'active' => false],
|
||||
['title' => lang("App.menu_importadores_bubok"), 'route' => route_to('importadorBubokTool'), 'active' => true]
|
||||
];
|
||||
|
||||
parent::initController($request, $response, $logger);
|
||||
}
|
||||
|
||||
|
||||
public function index()
|
||||
{
|
||||
|
||||
$viewData = [
|
||||
'pageSubTitle' => lang('Basic.global.ManageAllRecords', [lang('Importador.importadorCatalogoTitle')]),
|
||||
|
||||
];
|
||||
|
||||
$viewData = array_merge($this->viewData, $viewData); // merge any possible values from the parent controller class
|
||||
|
||||
return view(static::$viewPath . 'viewImportadorBubokTool', $viewData);
|
||||
}
|
||||
|
||||
|
||||
public function importarFila()
|
||||
{
|
||||
$json = $this->request->getJSON();
|
||||
|
||||
// Validación mínima de datos comunes
|
||||
$pedido = $json->pedido ?? null;
|
||||
if (!$pedido || !isset($pedido->orderNumber)) {
|
||||
return $this->respond([
|
||||
'status' => 400,
|
||||
'message' => 'Datos comunes del pedido ausentes o inválidos.'
|
||||
]);
|
||||
}
|
||||
|
||||
// Validación mínima de existencia del producto en la linea
|
||||
if (!$json || !isset($json->producto)) {
|
||||
return $this->respond([
|
||||
'status' => 400,
|
||||
'message' => 'Producto no proporcionado o inválido.'
|
||||
]);
|
||||
}
|
||||
$producto = $json->producto;
|
||||
|
||||
// 1. Datos básicos:
|
||||
// Referencia del cliente
|
||||
$orderNumber = $pedido->orderNumber ?? null;
|
||||
$productId = $producto->id ?? null;
|
||||
if (is_null($orderNumber) || is_null($productId)) {
|
||||
return $this->respond([
|
||||
'status' => 400,
|
||||
'message' => 'Número de orden o ID del producto no reconocidos.'
|
||||
]);
|
||||
}
|
||||
$refCliente = "$orderNumber - $productId";
|
||||
|
||||
// Titulo
|
||||
$titulo = $producto->title ?? null;
|
||||
if (is_null($titulo)) {
|
||||
return $this->respond([
|
||||
'status' => 400,
|
||||
'message' => 'Título del libro no reconocido.'
|
||||
]);
|
||||
}
|
||||
|
||||
// Validación de páginas y tirada
|
||||
$paginas = isset($producto->body->pages) ? (int) $producto->body->pages : 0;
|
||||
$tirada = isset($producto->amount) ? (int) $producto->amount : 0;
|
||||
if ($paginas <= 0 || $tirada <= 0) {
|
||||
$errores = [];
|
||||
if ($paginas <= 0) {
|
||||
$errores[] = 'Número de páginas inválido.';
|
||||
}
|
||||
if ($tirada <= 0) {
|
||||
$errores[] = 'Tirada inválida.';
|
||||
}
|
||||
|
||||
return $this->respond([
|
||||
'status' => 400,
|
||||
'message' => implode(' ', $errores)
|
||||
]);
|
||||
}
|
||||
|
||||
// Ancho y alto
|
||||
$ancho = null;
|
||||
$alto = null;
|
||||
foreach ($producto->size as $key => $val) {
|
||||
if ($val == 1) {
|
||||
// ejemplo: size170x235
|
||||
$size = str_replace('size', '', $key);
|
||||
[$ancho, $alto] = explode('x', $size);
|
||||
$ancho = (int) $ancho;
|
||||
$alto = (int) $alto;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!$ancho || !$alto) {
|
||||
return $this->respond([
|
||||
'status' => 400,
|
||||
'message' => 'Tamaño del libro no reconocido.'
|
||||
]);
|
||||
}
|
||||
|
||||
/*$numGuardaPages = 4;
|
||||
$hasGuarda = !empty($producto->cover->guarda);
|
||||
if ($hasGuarda)
|
||||
$paginas += $numGuardaPages;*/
|
||||
|
||||
// 2. Interior: color o negro
|
||||
// Determinar tipo de impresión interior
|
||||
$interiorTipo = null;
|
||||
if (isset($producto->body->color->CMYK) && $producto->body->color->CMYK == '1') {
|
||||
$interiorTipo = 'color';
|
||||
} elseif (isset($producto->body->color->Monochrome) && $producto->body->color->Monochrome == '1') {
|
||||
$interiorTipo = 'negro';
|
||||
} elseif (isset($producto->body->color->Semicolor) && $producto->body->color->Semicolor == '1') {
|
||||
return $this->respond([
|
||||
'status' => 400,
|
||||
'message' => 'Tipo de impresión "Semicolor" no soportado.'
|
||||
]);
|
||||
}
|
||||
|
||||
if (is_null($interiorTipo)) {
|
||||
return $this->respond([
|
||||
'status' => 400,
|
||||
'message' => 'No se pudo determinar si el interior es en color o blanco y negro.'
|
||||
]);
|
||||
}
|
||||
|
||||
// Determinar tipo de papel interior
|
||||
$papelInteriorId = null;
|
||||
if (isset($producto->body->paperColor->white) && $producto->body->paperColor->white == '1') {
|
||||
$papelInteriorId = 3; // Offset blanco 'OFF1'
|
||||
} elseif (isset($producto->body->paperColor->cream) && $producto->body->paperColor->cream == '1') {
|
||||
$papelInteriorId = 4; // Offset ahuesado 'OFF2'
|
||||
} else {
|
||||
return $this->respond([
|
||||
'status' => 400,
|
||||
'message' => 'Tipo de papel interior no definido.'
|
||||
]);
|
||||
}
|
||||
|
||||
// Determinar el gramaje del papel
|
||||
$gramajePapelInterior = null;
|
||||
foreach ($producto->body->paperWeight as $key => $val) {
|
||||
if ($val == 1) {
|
||||
$gramajePapelInterior = (int) str_replace(['weight', 'gr'], '', $key);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!$gramajePapelInterior) {
|
||||
return $this->respond([
|
||||
'status' => 400,
|
||||
'message' => 'Gramaje del papel no válido.'
|
||||
]);
|
||||
}
|
||||
|
||||
// 3. Encuadernación
|
||||
// Tapa dura
|
||||
$tapaDura = isset($producto->cover->type->tapadura) && $producto->cover->type->tapadura == '1';
|
||||
|
||||
// Solapas
|
||||
$solapas = isset($producto->cover->type->consolapas) && $producto->cover->type->consolapas == '1';
|
||||
|
||||
// Doble cara (a veces se activa con tapa dura) una cara => 2; dos caras => 4
|
||||
$doscara = false;
|
||||
|
||||
// Tipo de encuadernado
|
||||
$encuadernadoId = null;
|
||||
|
||||
if (isset($producto->cover->coverType->SoftCover) && $producto->cover->coverType->SoftCover == '1') {
|
||||
if ($tapaDura) {
|
||||
$encuadernadoId = 1; // Libro fresado tapa dura
|
||||
$doscara = true;
|
||||
} else {
|
||||
$encuadernadoId = 2; // Libro fresado tapa blanda
|
||||
}
|
||||
} elseif (isset($producto->cover->coverType->SaddleStitch) && $producto->cover->coverType->SaddleStitch == '1') {
|
||||
if ($tapaDura) {
|
||||
$encuadernadoId = 3; // Libro cosido tapa dura
|
||||
$doscara = true;
|
||||
} else {
|
||||
$encuadernadoId = $solapas ? 20 : 4; // Libro cosido tapa blanda (solapas) : (sin solapas)
|
||||
}
|
||||
} elseif (isset($producto->cover->coverType->CoilBinding) && $producto->cover->coverType->CoilBinding == '1') {
|
||||
if ($tapaDura) {
|
||||
$encuadernadoId = 5; // Libro espiral tapa dura
|
||||
$doscara = true;
|
||||
} else {
|
||||
$encuadernadoId = 6; // Libro espiral tapa blanda
|
||||
}
|
||||
}
|
||||
if (!$encuadernadoId) {
|
||||
return $this->respond([
|
||||
'status' => 400,
|
||||
'message' => 'Tipo de encuadernación no identificado.'
|
||||
]);
|
||||
}
|
||||
|
||||
// Determinar el acabado de la cubierta
|
||||
$acabadoId = null;
|
||||
if (isset($producto->cover->acabado->brillo) && $producto->cover->acabado->brillo == '1') {
|
||||
$acabadoId = 1; // Plastificado brillo 1/c
|
||||
} elseif (isset($producto->cover->acabado->mate) && $producto->cover->acabado->mate == '1') {
|
||||
$acabadoId = 2; // Plastificado mate 1/c
|
||||
} else {
|
||||
return $this->respond([
|
||||
'status' => 400,
|
||||
'message' => 'Tipo de acabado de cubierta no definido.'
|
||||
]);
|
||||
}
|
||||
|
||||
// 4. ENVÍO: recuperamos la primera dirección del cliente BUBOK (ID 40)
|
||||
$clienteDireccionModel = model('App\Models\Clientes\ClienteDireccionesModel');
|
||||
$direccionCliente = $clienteDireccionModel
|
||||
->where('cliente_id', 40)
|
||||
->orderBy('id', 'asc')
|
||||
->first();
|
||||
|
||||
if (!$direccionCliente) {
|
||||
return $this->respond([
|
||||
'status' => 400,
|
||||
'message' => 'El cliente Bubok no tiene direcciones asociadas.'
|
||||
]);
|
||||
}
|
||||
|
||||
$direcciones = [
|
||||
[
|
||||
'direccion' => [
|
||||
'id' => (int) $direccionCliente->id,
|
||||
'cliente_id' => (int) $direccionCliente->cliente_id,
|
||||
'cliente_nombre' => $direccionCliente->clienteNombre,
|
||||
'att' => $direccionCliente->persona_contacto ?? '',
|
||||
'alias' => $direccionCliente->alias ?? '',
|
||||
'email' => $direccionCliente->email ?? '',
|
||||
'direccion' => $direccionCliente->direccion,
|
||||
'pais_id' => (int) $direccionCliente->pais_id,
|
||||
'pais' => $direccionCliente->paisNombre,
|
||||
'municipio' => $direccionCliente->municipio,
|
||||
'provincia' => $direccionCliente->provincia,
|
||||
'cp' => $direccionCliente->cp,
|
||||
'telefono' => $direccionCliente->telefono,
|
||||
],
|
||||
'unidades' => $tirada,
|
||||
'entregaPalets' => false
|
||||
]
|
||||
];
|
||||
|
||||
// Generamos el objeto a importar
|
||||
$dataToImport = [
|
||||
'selectedTirada' => $tirada,
|
||||
'datosCabecera' => [
|
||||
'titulo' => $titulo,
|
||||
'autor' => null,
|
||||
'isbn' => null,
|
||||
'coleccion' => null,
|
||||
'referenciaCliente' => $refCliente
|
||||
],
|
||||
'tirada' => [$tirada],
|
||||
'tamanio' => [
|
||||
'ancho' => $ancho,
|
||||
'alto' => $alto
|
||||
],
|
||||
'tipo' => '',
|
||||
'tipo_presupuesto_id' => $encuadernadoId,
|
||||
'clienteId' => 40, // BUBOK ID
|
||||
'isColor' => ($interiorTipo === 'color') ? 1 : 0,
|
||||
'isHq' => 0,
|
||||
'paginas' => $paginas,
|
||||
'paginasColor' => ($interiorTipo === 'color') ? $paginas : 0,
|
||||
'paginasCuadernillo' => 32,
|
||||
'interior' => [
|
||||
'papelInterior' => $papelInteriorId,
|
||||
'gramajeInterior' => $gramajePapelInterior
|
||||
],
|
||||
'cubierta' => [
|
||||
'papelCubierta' => 2, // 'EST2'
|
||||
'carasCubierta' => $doscara ? 2 : 4,
|
||||
'gramajeCubierta' => in_array($encuadernadoId, [1, 3]) ? 150 : 300, // 150 gramos para "fresado tapa dura" y "cosido tapa dura"
|
||||
'solapas' => !empty($producto->cover->type->consolapas) ? 80 : 0,
|
||||
'acabado' => $acabadoId,
|
||||
'cabezada' => 'WHI',
|
||||
'lomoRedondo' => 0
|
||||
],
|
||||
'guardas' => [],
|
||||
'sobrecubierta' => [],
|
||||
'faja' => null,
|
||||
|
||||
'entrega_taller' => 1,
|
||||
//'direcciones' => $direcciones, las direcciones que aparecen no se añaden, ya que la recogida la hacen ellos con su empresa de mensajeria
|
||||
|
||||
'ivaReducido' => 1,
|
||||
];
|
||||
|
||||
/*return $this->respond([
|
||||
'status' => 400,
|
||||
'message' => $dataToImport
|
||||
]);*/
|
||||
|
||||
// 5. Guardar
|
||||
try {
|
||||
$presupuestocliente = new Presupuestocliente();
|
||||
$response = $presupuestocliente->guardar($dataToImport);
|
||||
|
||||
// Guardar la URL de la portada y el cuerpo en los comentarios del presupuesto
|
||||
$presupuestoModel = model('App\Models\Presupuestos\PresupuestoModel');
|
||||
$presupuestoModel->update($response['sk_id'], [
|
||||
'comentarios_safekat' => 'URL COVER: ' . $producto->cover->file . "\nURL BODY: " . $producto->body->file,
|
||||
]);
|
||||
|
||||
|
||||
// Ajuste del precio
|
||||
$precio_compra = $json->producto->prices->unitPrice ?? null;
|
||||
if ($precio_compra != null && $precio_compra > 0) {
|
||||
|
||||
$respuesta_ajuste = PresupuestoService::ajustarPresupuesto(
|
||||
$response['sk_id'],
|
||||
$precio_compra,
|
||||
$tirada,
|
||||
null,
|
||||
true
|
||||
);
|
||||
if ($respuesta_ajuste['warning'] == true) {
|
||||
$response['price_warning'] = [
|
||||
'new_precio_unidad' => $respuesta_ajuste['new_precio_unidad'],
|
||||
'new_total' => $respuesta_ajuste['new_total'],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
// confirmar y crear pedido y ot
|
||||
$presupuestoModel->confirmarPresupuesto($response['sk_id']);
|
||||
PresupuestoService::crearPedido($response['sk_id']);
|
||||
|
||||
|
||||
if (!isset($response['sk_id'])) {
|
||||
return $this->respond([
|
||||
'status' => 400,
|
||||
'error' => 'Missing sk_id',
|
||||
'message' => 'No se pudo crear el presupuesto.'
|
||||
], 400);
|
||||
}
|
||||
|
||||
return $this->respond([
|
||||
'status' => 200,
|
||||
'data' => [
|
||||
'sk_id' => $response['sk_id'],
|
||||
'sk_url' => $response['sk_url'] ?? null
|
||||
]
|
||||
]);
|
||||
|
||||
} catch (\Throwable $e) {
|
||||
return $this->respond([
|
||||
'status' => 500,
|
||||
'error' => 'Server error',
|
||||
'message' => 'Error inesperado',
|
||||
'debug' => $e->getMessage()
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -5,6 +5,7 @@ use App\Controllers\BaseResourceController;
|
||||
use App\Entities\Catalogo\CatalogoLibroEntity;
|
||||
use App\Models\Catalogo\CatalogoLibroModel;
|
||||
use App\Controllers\Presupuestos\Presupuestocliente;
|
||||
use App\Services\PresupuestoService;
|
||||
|
||||
class ImportadorCatalogo extends BaseResourceController
|
||||
{
|
||||
@ -43,11 +44,8 @@ class ImportadorCatalogo extends BaseResourceController
|
||||
{
|
||||
|
||||
$viewData = [
|
||||
'currentModule' => static::$controllerSlug,
|
||||
'pageSubTitle' => lang('Basic.global.ManageAllRecords', [lang('Importador.importadorCatalogoTitle')]),
|
||||
'catalogoLibrosEntity' => new CatalogoLibroEntity(),
|
||||
'usingServerSideDataTable' => true,
|
||||
|
||||
|
||||
];
|
||||
|
||||
$viewData = array_merge($this->viewData, $viewData); // merge any possible values from the parent controller class
|
||||
@ -241,9 +239,11 @@ class ImportadorCatalogo extends BaseResourceController
|
||||
'lomoRedondo' => 0
|
||||
],
|
||||
|
||||
'ivaReducido' => 1,
|
||||
|
||||
'guardas' => [],
|
||||
'sobrecubierta' => $sobrecubierta,
|
||||
'faja' => [],
|
||||
//'faja' => null,
|
||||
|
||||
'entrega_taller' => 1,
|
||||
];
|
||||
@ -281,17 +281,25 @@ class ImportadorCatalogo extends BaseResourceController
|
||||
]
|
||||
];
|
||||
|
||||
// Ajuste del precio a RAMA
|
||||
$dataToUpdate = [
|
||||
'total_aceptado' => ($tirada * $precio_compra),
|
||||
'total_aceptado_revisado' => ($tirada * $precio_compra),
|
||||
'total_precio_unidad' => $precio_compra
|
||||
];
|
||||
$presupuestoModel = model('App\Models\Presupuestos\Presupuestomodel');
|
||||
$presupuestoModel->update($response['data']['sk_id'], $dataToUpdate);
|
||||
|
||||
|
||||
|
||||
// Ajuste del precio a RAMA
|
||||
$respuesta_ajuste = PresupuestoService::ajustarPresupuesto(
|
||||
$response['data']['sk_id'],
|
||||
$precio_compra,
|
||||
$tirada,
|
||||
null,
|
||||
true
|
||||
);
|
||||
if ($respuesta_ajuste['warning'] == true) {
|
||||
$response['price_warning'] = [
|
||||
'new_precio_unidad' => $respuesta_ajuste['new_precio_unidad'],
|
||||
'new_total' => $respuesta_ajuste['new_total'],
|
||||
];
|
||||
}
|
||||
|
||||
// confirmar y crear pedido y ot
|
||||
model('App\Models\Presupuestos\PresupuestoModel')->confirmarPresupuesto($response['data']['sk_id']);
|
||||
PresupuestoService::crearPedido($response['data']['sk_id']);
|
||||
|
||||
return $this->respond($response);
|
||||
|
||||
|
||||
467
ci4/app/Controllers/Logistica/EtiquetasTitulosController.php
Normal file
467
ci4/app/Controllers/Logistica/EtiquetasTitulosController.php
Normal file
@ -0,0 +1,467 @@
|
||||
<?php
|
||||
|
||||
namespace App\Controllers\Logistica;
|
||||
|
||||
use App\Controllers\BaseController;
|
||||
use App\Services\ImpresoraEtiquetaService;
|
||||
use App\Services\EtiquetasTitulosService;
|
||||
use CodeIgniter\HTTP\RequestInterface;
|
||||
use CodeIgniter\HTTP\ResponseInterface;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Hermawan\DataTables\DataTable;
|
||||
|
||||
class EtiquetasTitulosController extends BaseController
|
||||
{
|
||||
|
||||
protected ImpresoraEtiquetaService $impresoraEtiquetaService;
|
||||
protected string $locale;
|
||||
protected array $viewData;
|
||||
|
||||
protected static $controllerSlug = 'etiquetas_titulos';
|
||||
protected static $viewPath = 'themes/vuexy/form/logistica/';
|
||||
|
||||
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
|
||||
{
|
||||
$this->impresoraEtiquetaService = service('impresora_etiqueta');
|
||||
$this->locale = session()->get('lang');
|
||||
$this->model = model('App\Models\Etiquetas\EtiquetasTitulosModel');
|
||||
|
||||
$this->viewData['pageTitle'] = lang('Logistica.logistica');
|
||||
|
||||
// Breadcrumbs
|
||||
$this->viewData['breadcrumb'] = [
|
||||
['title' => lang("App.menu_logistica"), 'route' => route_to("LogisticaPanel"), 'active' => false],
|
||||
];
|
||||
|
||||
|
||||
parent::initController($request, $response, $logger);
|
||||
}
|
||||
|
||||
public function findOTs()
|
||||
{
|
||||
if ($this->request->isAJAX()) {
|
||||
|
||||
$query = EtiquetasTitulosService::getOtsWithTitulos();
|
||||
|
||||
if ($this->request->getGet("q")) {
|
||||
$query->groupStart()
|
||||
->orLike("ot.id", $this->request->getGet("q"))
|
||||
->orLike("pr.titulo)", $this->request->getGet("q"))
|
||||
->groupEnd();
|
||||
}
|
||||
|
||||
|
||||
$result = $query->orderBy("id", "DESC")->get()->getResultObject();
|
||||
|
||||
return $this->response->setJSON($result);
|
||||
} else {
|
||||
return $this->failUnauthorized('Invalid request', 403);
|
||||
}
|
||||
}
|
||||
|
||||
public function findAddresses()
|
||||
{
|
||||
if ($this->request->isAJAX()) {
|
||||
|
||||
$ot_id = $this->request->getGet("ot_id");
|
||||
|
||||
$query = EtiquetasTitulosService::getDireccionesOT($ot_id);
|
||||
|
||||
if ($this->request->getGet("q")) {
|
||||
$query->groupStart()
|
||||
->orLike("pd.direccion", $this->request->getGet("q"))
|
||||
->groupEnd();
|
||||
}
|
||||
|
||||
|
||||
$result = $query->orderBy("pd.direccion", "ASC")->get()->getResultObject();
|
||||
|
||||
return $this->response->setJSON($result);
|
||||
} else {
|
||||
return $this->failUnauthorized('Invalid request', 403);
|
||||
}
|
||||
}
|
||||
|
||||
public function addEtiqueta()
|
||||
{
|
||||
if ($this->request->isAJAX()) {
|
||||
|
||||
$data = [];
|
||||
$data['user_id'] = auth()->user()->id;
|
||||
$data['ot_id'] = $this->request->getPost('ot_id') ?? null;
|
||||
$data['direccion'] = $this->request->getPost('direccion') ?? null;
|
||||
$data['unidades_caja'] = $this->request->getPost('unidades_caja') ?? null;
|
||||
|
||||
if (
|
||||
$this->request->getPost('ot_id') == null ||
|
||||
$this->request->getPost('direccion') == null ||
|
||||
$this->request->getPost('unidades_caja') == null
|
||||
) {
|
||||
return [
|
||||
'status' => false,
|
||||
'message' => lang('Logistica.errorMissingData')
|
||||
];
|
||||
}
|
||||
|
||||
$result = EtiquetasTitulosService::addEtiqueta($data);
|
||||
|
||||
return $this->response->setJSON($result);
|
||||
} else {
|
||||
return $this->failUnauthorized('Invalid request', 403);
|
||||
}
|
||||
}
|
||||
|
||||
public function deleteEtiqueta($id = null)
|
||||
{
|
||||
if ($this->request->isAJAX()) {
|
||||
$id = $this->request->getPost('id') ?? null;
|
||||
|
||||
if ($id == null) {
|
||||
return [
|
||||
'status' => false,
|
||||
'message' => lang('Logistica.errorMissingData')
|
||||
];
|
||||
}
|
||||
|
||||
$modelLineas = model('App\Models\Etiquetas\EtiquetasTitulosLineasModel');
|
||||
$ids = $modelLineas->where('etiqueta_titulos_id', $id)->findColumn('id');
|
||||
if ($ids) {
|
||||
$modelLineas->delete($ids);
|
||||
}
|
||||
$model = model('App\Models\Etiquetas\EtiquetasTitulosModel');
|
||||
$id = $model->where('id', $id)->findColumn('id');
|
||||
if ($id) {
|
||||
$model->delete($id);
|
||||
}
|
||||
$result = [
|
||||
'status' => true,
|
||||
'message' => lang('Logistica.success.jhn<successDeleteEtiqueta'),
|
||||
];
|
||||
|
||||
return $this->response->setJSON($result);
|
||||
} else {
|
||||
return $this->failUnauthorized('Invalid request', 403);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function edit($id = null)
|
||||
{
|
||||
|
||||
if (empty($id)) {
|
||||
return redirect()->to(base_url('logistica/selectEnvios/simple'))->with('error', lang('Logistica.errors.noEnvio'));
|
||||
}
|
||||
$model = model('App\Models\Etiquetas\EtiquetasTitulosModel');
|
||||
$etiquetaEntity = $model->select('etiquetas_titulos.*, clientes.nombre as cliente')
|
||||
->join('clientes', 'clientes.id = etiquetas_titulos.cliente_id', 'left')
|
||||
->where('etiquetas_titulos.id', $id)
|
||||
->first();
|
||||
if (empty($etiquetaEntity)) {
|
||||
return redirect()->to(base_url('logistica/etiquetasLogistica'))->with('error', lang('Logistica.errors.noEnvio'));
|
||||
}
|
||||
|
||||
|
||||
$modelImpresora = model('App\Models\Configuracion\ImpresoraEtiquetaModel');
|
||||
$impresoras = $modelImpresora->select('id, name')
|
||||
->where('deleted_at', null)
|
||||
->where('tipo', 1)
|
||||
->orderBy('name', 'asc')
|
||||
->findAll();
|
||||
$etiquetaEntity->impresoras = $impresoras;
|
||||
|
||||
$viewData = [
|
||||
'currentModule' => static::$controllerSlug,
|
||||
'boxTitle' => '<i class="ti ti-ticket ti-xl"></i>' . ' ' . lang('Logistica.EtiquetasTitulos') . ' [' . $etiquetaEntity->id . ']: ' . $etiquetaEntity->direccion,
|
||||
'usingServerSideDataTable' => true,
|
||||
'etiquetaEntity' => $etiquetaEntity,
|
||||
];
|
||||
|
||||
$viewData = array_merge($this->viewData, $viewData); // merge any possible values from the parent controller class
|
||||
|
||||
return view(static::$viewPath . 'viewEtiquetasTitulosEdit', $viewData);
|
||||
}
|
||||
|
||||
|
||||
public function datatable()
|
||||
{
|
||||
$q = $this->model->getEtiquetasTitulos();
|
||||
|
||||
if (!empty($otsFilter)) {
|
||||
$q->groupStart();
|
||||
$q->like('etl.ot_id', $otsFilter);
|
||||
$q->groupEnd();
|
||||
}
|
||||
|
||||
$result = DataTable::of($q)
|
||||
->add("action", callback: function ($q) {
|
||||
return '
|
||||
<div class="btn-group btn-group-sm">
|
||||
<a href="javascript:void(0);"><i class="ti ti-pencil ti-sm btn-edit mx-2" data-id="' . $q->id . '"></i></a>
|
||||
<a href="javascript:void(0);"><i class="ti ti-trash ti-sm btn-delete" data-id="' . $q->id . '"></i></a>
|
||||
</div>
|
||||
';
|
||||
});
|
||||
|
||||
return $result->toJson(returnAsObject: true);
|
||||
}
|
||||
|
||||
public function findOtsWithAddress()
|
||||
{
|
||||
if ($this->request->isAJAX()) {
|
||||
$id = $this->request->getGet('id') ?? null;
|
||||
|
||||
$query = EtiquetasTitulosService::findOTsWithAddress($id);
|
||||
|
||||
if ($this->request->getGet("q")) {
|
||||
$query->groupStart()
|
||||
->orLike("name", $this->request->getGet("q"))
|
||||
->groupEnd();
|
||||
}
|
||||
|
||||
|
||||
$result = $query->orderBy("id", "DESC")->get()->getResultObject();
|
||||
|
||||
return $this->response->setJSON($result);
|
||||
|
||||
} else {
|
||||
return $this->failUnauthorized('Invalid request', 403);
|
||||
}
|
||||
}
|
||||
|
||||
public function addLineasEtiqueta()
|
||||
{
|
||||
|
||||
if ($this->request->isAJAX()) {
|
||||
|
||||
$etiqueta_id = $this->request->getPost('etiqueta_id') ?? null;
|
||||
$ot_id = $this->request->getPost('ot_id') ?? null;
|
||||
$unidades = $this->request->getPost('unidades') ?? null;
|
||||
$cajas = $this->request->getPost('cajas') ?? null;
|
||||
|
||||
$result = EtiquetasTitulosService::addLineasEtiqueta($etiqueta_id, $ot_id, $unidades, $cajas);
|
||||
return $this->response->setJSON($result);
|
||||
} else {
|
||||
return $this->failUnauthorized('Invalid request', 403);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function datatableLineasEtiquetas($id = null)
|
||||
{
|
||||
|
||||
$model = model('App\Models\Etiquetas\EtiquetasTitulosLineasModel');
|
||||
|
||||
$id = $this->request->getGet('id') ?? null;
|
||||
$direccion = $this->request->getGet('direccion') ?? null;
|
||||
|
||||
$q = $model->getDatatableQuery($id, $direccion);
|
||||
|
||||
|
||||
$result = DataTable::of($q)
|
||||
->add(
|
||||
"rowSelected",
|
||||
callback: function ($q) {
|
||||
return '<input type="checkbox" class="form-check-input checkbox-linea-envio" name="row_selected[]" value="' . $q->id . '">';
|
||||
}
|
||||
)
|
||||
->edit(
|
||||
"ot",
|
||||
function ($row, $meta) {
|
||||
return '<a href="' . base_url('produccion/ordentrabajo/edit/' . $row->ot) . '" target="_blank">' . $row->ot . '</a>';
|
||||
}
|
||||
)
|
||||
->edit(
|
||||
"unidades",
|
||||
function ($row, $meta) {
|
||||
return '<input type="number" class="form-control input-lineas input-unidades text-center"
|
||||
data-id="' . $row->id . '" data-name="unidades" value="' . $row->unidades . '">';
|
||||
}
|
||||
)
|
||||
->edit(
|
||||
"numero_caja",
|
||||
function ($row, $meta) {
|
||||
return '<input type="number" class="form-control input-lineas input-cajas text-center"
|
||||
data-id="' . $row->id . '" data-name="numero_caja" value="' . $row->numero_caja . '">';
|
||||
}
|
||||
)
|
||||
->add("unidades_raw", fn($row) => $row->unidades)
|
||||
->add("pesoUnidad_raw", fn($row) => $row->pesoUnidad)
|
||||
->add(
|
||||
"action",
|
||||
callback: function ($q) {
|
||||
return '
|
||||
<div class="btn-group btn-group-sm">
|
||||
<a href="javascript:void(0);"><i class="ti ti-trash ti-sm btn-delete" data-id="' . $q->id . '"></i></a>
|
||||
</div>
|
||||
';
|
||||
}
|
||||
);
|
||||
|
||||
return $result->toJson(returnAsObject: true);
|
||||
}
|
||||
|
||||
public function deleteLineasEtiqueta()
|
||||
{
|
||||
if ($this->request->isAJAX()) {
|
||||
$ids = $this->request->getPost('ids') ?? [];
|
||||
|
||||
if ($ids == [] || $ids == null) {
|
||||
return [
|
||||
'status' => false,
|
||||
'message' => lang('Logistica.errors.errorMissingData')
|
||||
];
|
||||
}
|
||||
|
||||
$model = model('App\Models\Etiquetas\EtiquetasTitulosLineasModel');
|
||||
for ($i = 0; $i < count($ids); $i++) {
|
||||
$model->delete($ids[$i]);
|
||||
}
|
||||
|
||||
|
||||
$result = [
|
||||
'status' => true,
|
||||
'message' => lang('Logistica.success.successDeleteLines'),
|
||||
];
|
||||
|
||||
return $this->response->setJSON($result);
|
||||
} else {
|
||||
return $this->failUnauthorized('Invalid request', 403);
|
||||
}
|
||||
}
|
||||
|
||||
public function updateLineasEtiqueta()
|
||||
{
|
||||
|
||||
if ($this->request->isAJAX()) {
|
||||
$id = $this->request->getPost('id') ?? null;
|
||||
$name = $this->request->getPost('name') ?? null;
|
||||
$value = $this->request->getPost('value') ?? null;
|
||||
|
||||
if ($id == null || $name == null || $value == null) {
|
||||
return [
|
||||
'status' => false,
|
||||
'message' => lang('Logistica.errors.errorMissingData')
|
||||
];
|
||||
}
|
||||
|
||||
$model = model('App\Models\Etiquetas\EtiquetasTitulosLineasModel');
|
||||
$model->update($id, [$name => $value]);
|
||||
|
||||
$result = [
|
||||
'status' => true,
|
||||
'message' => lang('Logistica.success.successUpdateLine'),
|
||||
];
|
||||
|
||||
return $this->response->setJSON($result);
|
||||
} else {
|
||||
return $this->failUnauthorized('Invalid request', 403);
|
||||
}
|
||||
}
|
||||
|
||||
public function updateComentarios()
|
||||
{
|
||||
|
||||
if ($this->request->isAJAX()) {
|
||||
$id = $this->request->getPost('id') ?? null;
|
||||
$comentarios = $this->request->getPost('comentarios') ?? null;
|
||||
|
||||
if ($id == null || $comentarios == null) {
|
||||
return [
|
||||
'status' => false,
|
||||
'message' => lang('Logistica.errors.errorMissingData')
|
||||
];
|
||||
}
|
||||
|
||||
$model = model('App\Models\Etiquetas\EtiquetasTitulosModel');
|
||||
$model->update($id, ['comentarios' => $comentarios]);
|
||||
|
||||
$result = [
|
||||
'status' => true,
|
||||
'message' => lang('Logistica.success.comentariosUpdated'),
|
||||
];
|
||||
|
||||
return $this->response->setJSON($result);
|
||||
} else {
|
||||
return $this->failUnauthorized('Invalid request', 403);
|
||||
}
|
||||
}
|
||||
|
||||
public function updateOrdenCajas()
|
||||
{
|
||||
$rawInput = $this->request->getBody();
|
||||
$data = json_decode($rawInput, true);
|
||||
$orden = $data['orden'] ?? [];
|
||||
|
||||
if (!is_array($orden)) {
|
||||
return $this->response->setJSON([
|
||||
'status' => false,
|
||||
'message' => 'Datos inválidos'
|
||||
]);
|
||||
}
|
||||
|
||||
$model = model('App\Models\Etiquetas\EtiquetasTitulosLineasModel');
|
||||
|
||||
foreach ($orden as $item) {
|
||||
if (isset($item['id'], $item['numero_caja'])) {
|
||||
$model->update($item['id'], [
|
||||
'numero_caja' => $item['numero_caja'],
|
||||
'updated_at' => date('Y-m-d H:i:s') // opcional
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
return $this->response->setJSON([
|
||||
'status' => true,
|
||||
'message' => 'Orden de cajas actualizado correctamente'
|
||||
]);
|
||||
}
|
||||
|
||||
public function renumberCajas()
|
||||
{
|
||||
$id = $this->request->getPost('id') ?? null;
|
||||
|
||||
if ($id == null) {
|
||||
return [
|
||||
'status' => false,
|
||||
'message' => lang('Logistica.errors.errorMissingData')
|
||||
];
|
||||
}
|
||||
|
||||
$result = EtiquetasTitulosService::reordenarCajas($id);
|
||||
|
||||
return $this->response->setJSON($result);
|
||||
}
|
||||
|
||||
public function imprimirEtiquetas()
|
||||
{
|
||||
$etiqueta_id = $this->request->getPost('etiqueta_id') ?? null;
|
||||
$ids = $this->request->getPost('ids') ?? [];
|
||||
$impresora_id = $this->request->getPost('impresora_id') ?? null;
|
||||
|
||||
$modelImpresora = model('App\Models\Configuracion\ImpresoraEtiquetaModel');
|
||||
$impresora = $modelImpresora->select('id, name, ip, port, user, pass')
|
||||
->where('deleted_at', null)
|
||||
->where('id', $impresora_id)
|
||||
->orderBy('name', 'asc')
|
||||
->first();
|
||||
if ($impresora == null) {
|
||||
return $this->response->setJSON([
|
||||
'status' => false,
|
||||
'message' => 'Impresora no válida'
|
||||
]);
|
||||
}
|
||||
|
||||
if ($etiqueta_id == null || $ids == []) {
|
||||
return [
|
||||
'status' => false,
|
||||
'message' => lang('Logistica.errors.errorMissingData')
|
||||
];
|
||||
}
|
||||
|
||||
$result = EtiquetasTitulosService::imprimirEtiquetas($etiqueta_id, $ids, $impresora);
|
||||
|
||||
return $this->response->setJSON($result);
|
||||
}
|
||||
|
||||
}
|
||||
@ -85,6 +85,19 @@ class LogisticaController extends BaseController
|
||||
return view(static::$viewPath . 'viewLogisticaSelectEnvios', $viewData);
|
||||
}
|
||||
|
||||
public function etiquetasLogistica()
|
||||
{
|
||||
$viewData = [
|
||||
'currentModule' => static::$controllerSlug,
|
||||
'boxTitle' => lang('Logistica.etiquetasTitulos'),
|
||||
'usingServerSideDataTable' => true,
|
||||
];
|
||||
|
||||
$viewData = array_merge($this->viewData, $viewData); // merge any possible values from the parent controller class
|
||||
|
||||
return view(static::$viewPath . 'viewImpresionEtiquetas', $viewData);
|
||||
}
|
||||
|
||||
public function listAlbaranes(){
|
||||
$viewData = [
|
||||
'currentModule' => static::$controllerSlug,
|
||||
|
||||
@ -993,6 +993,8 @@ class Presupuestoadmin extends \App\Controllers\BaseResourceController
|
||||
|
||||
$reqData = $this->request->getPost();
|
||||
|
||||
$calcular_merma = $reqData['calcular_merma'] ?? 0;
|
||||
|
||||
$type = $reqData['type'] ?? null;
|
||||
// por defecto, se deja cosido tapa blanda por ahora JJO
|
||||
$tipo_impresion_id = $reqData['tipo_impresion_id'] ?? 4;
|
||||
@ -1071,8 +1073,27 @@ class Presupuestoadmin extends \App\Controllers\BaseResourceController
|
||||
'a_favor_fibra' => $a_favor_fibra
|
||||
);
|
||||
|
||||
|
||||
$resourceData = PresupuestoService::obtenerComparadorPlana($input_data);
|
||||
|
||||
if($calcular_merma == 1 && count($resourceData) > 0 &&
|
||||
count($resourceData[0]['fields']) >0 && $resourceData[0]['fields']['num_formas'] > 0) {
|
||||
|
||||
usort($resourceData, function ($a, $b) {
|
||||
return $b['fields']['total_impresion'] <=> $a['fields']['total_impresion'];
|
||||
});
|
||||
|
||||
$num_formas = [];
|
||||
$formas_linea = $datosPedido->isCosido ? intval($resourceData[0]['fields']['num_formas']['value']) / 2 :
|
||||
intval($resourceData[0]['fields']['num_formas']['value']);
|
||||
array_push($num_formas, $formas_linea);
|
||||
|
||||
$POD = $this->getPOD();
|
||||
$datosPedido->merma = PresupuestoService::calcular_merma($datosPedido->tirada,$POD, $num_formas);
|
||||
|
||||
$resourceData = PresupuestoService::obtenerComparadorPlana($input_data);
|
||||
}
|
||||
|
||||
} else if ($type == 'interior_rot') {
|
||||
|
||||
$paginas = (object) array(
|
||||
@ -1105,6 +1126,24 @@ class Presupuestoadmin extends \App\Controllers\BaseResourceController
|
||||
|
||||
$resourceData = PresupuestoService::obtenerComparadorRotativa($input_data);
|
||||
|
||||
if($calcular_merma == 1 && count($resourceData) > 0 &&
|
||||
count($resourceData[0]['fields']) >0 && $resourceData[0]['fields']['num_formas'] > 0) {
|
||||
|
||||
usort($resourceData, function ($a, $b) {
|
||||
return $b['fields']['total_impresion'] <=> $a['fields']['total_impresion'];
|
||||
});
|
||||
|
||||
$num_formas = [];
|
||||
$formas_linea = $datosPedido->isCosido ? intval($resourceData[0]['fields']['num_formas']['value']) / 2 :
|
||||
intval($resourceData[0]['fields']['num_formas']['value']);
|
||||
array_push($num_formas, $formas_linea);
|
||||
|
||||
$POD = $this->getPOD();
|
||||
$datosPedido->merma = PresupuestoService::calcular_merma($datosPedido->tirada,$POD, $num_formas);
|
||||
|
||||
$resourceData = PresupuestoService::obtenerComparadorRotativa($input_data);
|
||||
}
|
||||
|
||||
} else if ($type == 'cubierta' || $type == 'sobrecubierta' || $type == 'faja') {
|
||||
|
||||
$datosPedido->solapas = $reqData['solapas'];
|
||||
|
||||
@ -323,17 +323,23 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
||||
$datosPedido = (object) array(
|
||||
'paginas' => $paginas,
|
||||
'tirada' => $tirada[0],
|
||||
'merma' => $this->calcular_merma($tirada[0], $POD),
|
||||
'merma' => PresupuestoService::calcular_merma($tirada[0], $POD),
|
||||
'ancho' => intval($tamanio['ancho']) ?? 100000,
|
||||
'alto' => intval($tamanio['alto']) ?? 100000,
|
||||
'isCosido' => $is_cosido,
|
||||
'a_favor_fibra' => 1,
|
||||
);
|
||||
|
||||
$cliente_model = model(('App\Models\Clientes\ClienteModel'));
|
||||
$cliente = $cliente_model->find($cliente_id);
|
||||
// Para POD siempre es HQ
|
||||
if ($tirada[0] <= $POD) {
|
||||
if ($tirada[0] <= $POD && !$cliente->forzar_rotativa_pod) {
|
||||
$isHq = true;
|
||||
}
|
||||
$forzarRotativa = false;
|
||||
if ($tirada[0] <= $POD && $cliente->forzar_rotativa_pod) {
|
||||
$forzarRotativa = true;
|
||||
}
|
||||
|
||||
$input_data = array(
|
||||
'uso' => 'interior',
|
||||
@ -346,7 +352,8 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
||||
'cliente_id' => $cliente_id,
|
||||
'paginas_color' => $paginas_color,
|
||||
'excluirRotativa' => $excluirRotativa,
|
||||
'papelInteriorDiferente' => $papelInteriorDiferente
|
||||
'papelInteriorDiferente' => $papelInteriorDiferente,
|
||||
'forzarRotativa' => $forzarRotativa,
|
||||
);
|
||||
|
||||
$interior = PresupuestoClienteService::obtenerInterior($input_data);
|
||||
@ -460,6 +467,7 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
||||
$id = $reqData['id'] ?? 0;
|
||||
|
||||
$cliente_id = $reqData['clienteId'] ?? -1;
|
||||
$noEnvioBase = model('App\Models\Clientes\ClienteModel')->find($cliente_id)->no_envio_base ?? false;
|
||||
|
||||
$tirada = $reqData['tirada'] ?? 0;
|
||||
$selectedTirada = $reqData['selectedTirada'] ?? -1;
|
||||
@ -609,6 +617,10 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
||||
} else {
|
||||
$coste = floatval($coste_direccion->coste);
|
||||
$margen = $coste * (intval($coste_direccion->margen) / 100.0);
|
||||
if ($noEnvioBase) {
|
||||
$coste = 0.0;
|
||||
$margen = 0.0;
|
||||
}
|
||||
$return_data['eb'][$i] = round($coste + $margen, 2);
|
||||
}
|
||||
}
|
||||
@ -739,17 +751,23 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
||||
$datosPedido = (object) array(
|
||||
'paginas' => $paginas,
|
||||
'tirada' => $tirada[0],
|
||||
'merma' => $tirada[0] > $POD ? $this->calcular_merma($tirada[0], $POD) : 0,
|
||||
'merma' => $tirada[0] > $POD ? PresupuestoService::calcular_merma($tirada[0], $POD) : 0,
|
||||
'ancho' => intval($tamanio['ancho']) ?? 100000,
|
||||
'alto' => intval($tamanio['alto']) ?? 100000,
|
||||
'isCosido' => $is_cosido,
|
||||
'a_favor_fibra' => 1,
|
||||
);
|
||||
|
||||
$cliente_model = model(('App\Models\Clientes\ClienteModel'));
|
||||
$cliente = $cliente_model->find($cliente_id);
|
||||
// Para POD siempre es HQ
|
||||
if ($tirada[0] <= $POD) {
|
||||
if ($tirada[0] <= $POD && !$cliente->forzar_rotativa_pod) {
|
||||
$isHq = true;
|
||||
}
|
||||
$forzarRotativa = false;
|
||||
if ($tirada[0] <= $POD && $cliente->forzar_rotativa_pod) {
|
||||
$forzarRotativa = true;
|
||||
}
|
||||
|
||||
$input_data = array(
|
||||
'uso' => 'interior',
|
||||
@ -762,7 +780,8 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
||||
'cliente_id' => $cliente_id,
|
||||
'paginas_color' => $paginas_color,
|
||||
'excluirRotativa' => $excluirRotativa,
|
||||
'papelInteriorDiferente' => $papelInteriorDiferente
|
||||
'papelInteriorDiferente' => $papelInteriorDiferente,
|
||||
'forzarRotativa' => $forzarRotativa,
|
||||
);
|
||||
|
||||
$interior = PresupuestoClienteService::obtenerInterior($input_data);
|
||||
@ -1126,6 +1145,7 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
||||
$peso_libro = $resultado_presupuesto['peso'][array_search($selected_tirada, $tirada)];
|
||||
|
||||
// calculo del envio base (tirada_maxima)
|
||||
$noEnvioBase = model('App\Models\Clientes\ClienteModel')->find($cliente_id)->no_envio_base ?? false;
|
||||
$resultado_presupuesto['eb'] = [];
|
||||
$datos_presupuesto['envio_base'] = 0;
|
||||
for ($i = 0; $i < count($tirada); $i++) {
|
||||
@ -1139,6 +1159,10 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
||||
);
|
||||
|
||||
if (intval($selected_tirada) == intval($tirada[$i])) {
|
||||
if ($noEnvioBase) {
|
||||
$coste_direccion->coste = 0.0;
|
||||
$coste_direccion->margen = 0.0;
|
||||
}
|
||||
$datos_presupuesto['envio_base'] = round($coste_direccion->coste * (1 + $coste_direccion->margen / 100.0), 2);
|
||||
}
|
||||
|
||||
@ -1160,6 +1184,10 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
||||
];
|
||||
return $resultado_presupuesto;
|
||||
} else {
|
||||
if ($noEnvioBase) {
|
||||
$coste_direccion->coste = 0.0;
|
||||
$coste_direccion->margen = 0.0;
|
||||
}
|
||||
$resultado_presupuesto['eb'][$i] = round($coste_direccion->coste, 2);
|
||||
$resultado_presupuesto['eb_margen'][$i] = round($coste_direccion->margen, 2);
|
||||
}
|
||||
@ -1176,10 +1204,10 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
||||
for ($i = 0; $i < count($tirada); $i++) {
|
||||
$coste_envio = 0.0;
|
||||
$coste_envio += ($resultado_presupuesto['eb'][$i] / $tirada[$i]);
|
||||
$resultado_presupuesto['info']['totales'][$i]['envio_base_margen'] =
|
||||
floatval($resultado_presupuesto['eb'][$i])*(floatval($resultado_presupuesto['eb_margen'][$i])/100.0);
|
||||
$resultado_presupuesto['info']['totales'][$i]['envio_base_margen'] =
|
||||
floatval($resultado_presupuesto['eb'][$i]) * (floatval($resultado_presupuesto['eb_margen'][$i]) / 100.0);
|
||||
$resultado_presupuesto['info']['totales'][$i]['envio_base_coste'] = $resultado_presupuesto['eb'][$i];
|
||||
|
||||
|
||||
$resultado_presupuesto['precio_u'][$i] = round(floatval($resultado_presupuesto['precio_u'][$i]) + $coste_envio, 4);
|
||||
}
|
||||
|
||||
@ -1312,7 +1340,7 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
||||
$datos_presupuesto['entrega_taller'] = $reqData['entrega_taller'] ?? 0;
|
||||
|
||||
|
||||
$resultado_presupuesto['info']['merma'] = $this->calcular_merma($selected_tirada, $POD);
|
||||
$resultado_presupuesto['info']['merma'] = PresupuestoService::calcular_merma($selected_tirada, $POD);
|
||||
|
||||
$datos_presupuesto['faja'] = $faja;
|
||||
|
||||
@ -1357,7 +1385,11 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
||||
foreach ($serviciosAcabado as $service) {
|
||||
$model = model('App\Models\Presupuestos\PresupuestoAcabadosModel');
|
||||
$servicio = $model->getPrecioTarifa(
|
||||
intval($service), intval($selected_tirada)+$resultado_presupuesto['info']['merma'], -1, $POD);
|
||||
intval($service),
|
||||
intval($selected_tirada) + $resultado_presupuesto['info']['merma'],
|
||||
-1,
|
||||
$POD
|
||||
);
|
||||
|
||||
if (count($servicio) > 0) {
|
||||
if ($servicio[0]->total > 0) {
|
||||
@ -1375,8 +1407,11 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
||||
foreach ($serviciosAcabado as $service) {
|
||||
$model = model('App\Models\Presupuestos\PresupuestoAcabadosModel');
|
||||
$servicio = $model->getPrecioTarifa(
|
||||
intval($service),
|
||||
intval($selected_tirada) + $resultado_presupuesto['info']['merma'], -1, $POD);
|
||||
intval($service),
|
||||
intval($selected_tirada) + $resultado_presupuesto['info']['merma'],
|
||||
-1,
|
||||
$POD
|
||||
);
|
||||
|
||||
if (count($servicio) > 0) {
|
||||
if ($servicio[0]->total > 0) {
|
||||
@ -1393,8 +1428,11 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
||||
foreach ($serviciosAcabado as $service) {
|
||||
$model = model('App\Models\Presupuestos\PresupuestoAcabadosModel');
|
||||
$servicio = $model->getPrecioTarifa(
|
||||
intval($service),
|
||||
intval($selected_tirada) + $resultado_presupuesto['info']['merma'], -1, $POD);
|
||||
intval($service),
|
||||
intval($selected_tirada) + $resultado_presupuesto['info']['merma'],
|
||||
-1,
|
||||
$POD
|
||||
);
|
||||
|
||||
if (count($servicio) > 0) {
|
||||
if ($servicio[0]->total > 0) {
|
||||
@ -1407,7 +1445,7 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
||||
$tarifa_id = model('App\Models\Configuracion\ConfigVariableModel')->getVariable('id_servicio_lomo_redondo')->value;
|
||||
$serv_lomo = PresupuestoCLienteService::getServiciosManipulado([
|
||||
'tarifa_id' => intval($tarifa_id),
|
||||
'tirada' => $selected_tirada+$resultado_presupuesto['info']['merma'],
|
||||
'tirada' => $selected_tirada + $resultado_presupuesto['info']['merma'],
|
||||
'POD' => $POD,
|
||||
])[0];
|
||||
|
||||
@ -2029,7 +2067,7 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
||||
$datosPedido = (object) array(
|
||||
'paginas' => $paginas,
|
||||
'tirada' => $tirada[$t],
|
||||
'merma' => $this->calcular_merma($tirada[$t], $POD),
|
||||
'merma' => PresupuestoService::calcular_merma($tirada[$t], $POD),
|
||||
'ancho' => intval($tamanio['ancho']) ?? 100000,
|
||||
'alto' => intval($tamanio['alto']) ?? 100000,
|
||||
'isCosido' => $is_cosido,
|
||||
@ -2039,10 +2077,16 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
||||
$info['merma'] = $datosPedido->merma;
|
||||
}
|
||||
|
||||
$cliente_model = model(('App\Models\Clientes\ClienteModel'));
|
||||
$cliente = $cliente_model->find($cliente_id);
|
||||
// Para POD siempre es HQ
|
||||
if ($tirada[$t] <= $POD) {
|
||||
if ($tirada[$t] <= $POD && !$cliente->forzar_rotativa_pod) {
|
||||
$isHq = true;
|
||||
}
|
||||
$forzarRotativa = false;
|
||||
if ($tirada[$t] <= $POD && $cliente->forzar_rotativa_pod) {
|
||||
$forzarRotativa = true;
|
||||
}
|
||||
|
||||
$input_data = array(
|
||||
'uso' => 'interior',
|
||||
@ -2055,7 +2099,8 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
||||
'cliente_id' => $cliente_id,
|
||||
'paginas_color' => $paginas_color,
|
||||
'excluirRotativa' => $excluirRotativa,
|
||||
'papelInteriorDiferente' => $papelInteriorDiferente
|
||||
'papelInteriorDiferente' => $papelInteriorDiferente,
|
||||
'forzarRotativa' => $forzarRotativa,
|
||||
);
|
||||
|
||||
$interior = PresupuestoClienteService::obtenerInterior($input_data);
|
||||
@ -2107,7 +2152,7 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
||||
array_push($num_formas, $formas_linea);
|
||||
}
|
||||
}
|
||||
$input_data['datosPedido']->merma = $this->calcular_merma($tirada[$t], $POD, $num_formas);
|
||||
$input_data['datosPedido']->merma = PresupuestoService::calcular_merma($tirada[$t], $POD, $num_formas);
|
||||
if ($extra_info) {
|
||||
$info['merma'] = max($info['merma'], $input_data['datosPedido']->merma);
|
||||
}
|
||||
@ -3071,7 +3116,7 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
||||
$sumForFactor += round($linea['precio_pedido'], 2)
|
||||
- round($linea['margen_papel_pedido'], 2);
|
||||
$margenPapel += round($linea['margen_papel_pedido'], 2);
|
||||
|
||||
|
||||
$totalImpresion += round($linea['precio_click_pedido'], 2);
|
||||
$totalImpresion -= round($linea['margen_click_pedido'], 2);
|
||||
$sumForFactor += round($linea['precio_click_pedido'], 2)
|
||||
@ -3142,31 +3187,6 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected function calcular_merma($tirada, $POD, $formas_lineas_interior = [])
|
||||
{
|
||||
|
||||
$merma = 0;
|
||||
|
||||
if ($tirada > $POD) {
|
||||
$merma = $tirada * 0.1;
|
||||
} else {
|
||||
$merma_lineas = [];
|
||||
foreach ($formas_lineas_interior as $formas_linea) {
|
||||
if ($formas_linea > $tirada)
|
||||
array_push($merma_lineas, $formas_linea - $tirada);
|
||||
else
|
||||
array_push($merma_lineas, $tirada % $formas_linea);
|
||||
}
|
||||
if (count($merma_lineas) > 0)
|
||||
$merma = max($merma_lineas);
|
||||
}
|
||||
|
||||
|
||||
return round($merma, 0);
|
||||
}
|
||||
|
||||
|
||||
protected function getPapelFormatoListItems($selId = null)
|
||||
{
|
||||
$papelFormatoModel = model('App\Models\Configuracion\PapelFormatoModel');
|
||||
|
||||
@ -3,7 +3,9 @@
|
||||
namespace App\Controllers\Produccion;
|
||||
|
||||
use App\Controllers\BaseController;
|
||||
use App\Models\Compras\ProveedorModel;
|
||||
use App\Models\Configuracion\MaquinaModel;
|
||||
use App\Models\Configuracion\MaquinaOtTareaModel;
|
||||
use App\Models\OrdenTrabajo\OrdenTrabajoModel;
|
||||
use App\Models\OrdenTrabajo\OrdenTrabajoTarea;
|
||||
use App\Models\OrdenTrabajo\OrdenTrabajoUser;
|
||||
@ -28,7 +30,9 @@ class Ordentrabajo extends BaseController
|
||||
protected OrdenTrabajoModel $otModel;
|
||||
protected OrdenTrabajoUser $otUserModel;
|
||||
protected OrdenTrabajoTarea $otTarea;
|
||||
protected ProveedorModel $proveedorModel;
|
||||
protected MaquinaModel $maquinaModel;
|
||||
protected MaquinaOtTareaModel $maquinaOtTareaModel;
|
||||
protected UserModel $userModel;
|
||||
protected Validation $validation;
|
||||
protected static $viewPath = 'themes/vuexy/form/produccion/';
|
||||
@ -45,6 +49,8 @@ class Ordentrabajo extends BaseController
|
||||
$this->produccionService = new ProductionService();
|
||||
$this->otTarea = model(OrdenTrabajoTarea::class);
|
||||
$this->maquinaModel = model(MaquinaModel::class);
|
||||
$this->maquinaOtTareaModel = model(MaquinaOtTareaModel::class);
|
||||
$this->proveedorModel = model(ProveedorModel::class);
|
||||
$this->validation = service("validation");
|
||||
helper("time");
|
||||
parent::initController($request, $response, $logger);
|
||||
@ -138,6 +144,18 @@ class Ordentrabajo extends BaseController
|
||||
return $this->response->setJSON(["errors" => $this->validation->getErrors()])->setStatusCode(400);
|
||||
}
|
||||
}
|
||||
public function update_presupuesto_tarea_proveedor()
|
||||
{
|
||||
$bodyData = $this->request->getPost();
|
||||
$validated = $this->validation->run($bodyData, "proveedor_tarea");
|
||||
if ($validated) {
|
||||
$validatedData = $this->validation->getValidated();
|
||||
$r = $this->produccionService->updateProveedorLinea($validatedData['orden_trabajo_tarea_id'], $validatedData['proveedor_id']);
|
||||
return $this->response->setJSON(["message" => lang("App.global_alert_save_success"), "status" => $r]);
|
||||
} else {
|
||||
return $this->response->setJSON(["errors" => $this->validation->getErrors()])->setStatusCode(400);
|
||||
}
|
||||
}
|
||||
public function reset_orden_trabajo_date()
|
||||
{
|
||||
$bodyData = $this->request->getPost();
|
||||
@ -227,7 +245,7 @@ class Ordentrabajo extends BaseController
|
||||
{
|
||||
$logo = config(LogoImpresion::class);
|
||||
|
||||
$q = $this->otModel->getDatatableQuery()->whereIn("ordenes_trabajo.estado", ["I", "PM"]);
|
||||
$q = $this->otModel->getDatatableQuery()->whereIn("ordenes_trabajo.estado", ["I", "PM"])->where('ordenes_trabajo.preimpresion_revisada', true);
|
||||
// return $this->response->setJSON($q->get()->getResultArray());
|
||||
return DataTable::of($q)
|
||||
->add("logo", fn($q) => ["logo" => site_url($logo->get_logo_path($q->presupuesto_linea_tipo)), "imposicion" => $q->imposicion_name, "color" => $this->produccionService->init($q->id)->getOtColorStatus()])
|
||||
@ -242,7 +260,7 @@ class Ordentrabajo extends BaseController
|
||||
{
|
||||
$logo = config(LogoImpresion::class);
|
||||
|
||||
$q = $this->otModel->getDatatableQuery()->where('presupuestos.ferro',1)->where("ferro_ok_at", null);
|
||||
$q = $this->otModel->getDatatableQuery()->where('presupuestos.ferro', 1)->where("ferro_ok_at", null);
|
||||
// return $this->response->setJSON($q->get()->getResultArray());
|
||||
return DataTable::of($q)
|
||||
->add("logo", fn($q) => ["logo" => site_url($logo->get_logo_path($q->presupuesto_linea_tipo)), "imposicion" => $q->imposicion_name, "color" => $this->produccionService->init($q->id)->getOtColorStatus()])
|
||||
@ -257,7 +275,7 @@ class Ordentrabajo extends BaseController
|
||||
{
|
||||
$logo = config(LogoImpresion::class);
|
||||
|
||||
$q = $this->otModel->getDatatableQuery()->where('presupuestos.ferro',1)->where("ferro_ok_at is NOT NULL", NULL, FALSE);
|
||||
$q = $this->otModel->getDatatableQuery()->where('presupuestos.ferro', 1)->where("ferro_ok_at is NOT NULL", NULL, FALSE);
|
||||
// return $this->response->setJSON($q->get()->getResultArray());
|
||||
return DataTable::of($q)
|
||||
->add("logo", fn($q) => ["logo" => site_url($logo->get_logo_path($q->presupuesto_linea_tipo)), "imposicion" => $q->imposicion_name, "color" => $this->produccionService->init($q->id)->getOtColorStatus()])
|
||||
@ -268,6 +286,62 @@ class Ordentrabajo extends BaseController
|
||||
->add("action", fn($q) => $q->id)
|
||||
->toJson(true);
|
||||
}
|
||||
public function datatable_news()
|
||||
{
|
||||
$logo = config(LogoImpresion::class);
|
||||
|
||||
$q = $this->otModel->getDatatableQuery()->where('ordenes_trabajo.preimpresion_revisada', false);
|
||||
return DataTable::of($q)
|
||||
->add("logo", fn($q) => ["logo" => site_url($logo->get_logo_path($q->presupuesto_linea_tipo)), "imposicion" => $q->imposicion_name, "color" => $this->produccionService->init($q->id)->getOtColorStatus()])
|
||||
->edit(
|
||||
"fecha_encuadernado_at",
|
||||
fn($q) => $q->fecha_encuadernado_at ? Time::createFromFormat("Y-m-d H:i:s", $q->fecha_encuadernado_at)->format("d/m/Y") : ""
|
||||
)
|
||||
->add("action", fn($q) => $q->id)
|
||||
->toJson(true);
|
||||
}
|
||||
public function datatable_prod()
|
||||
{
|
||||
$logo = config(LogoImpresion::class);
|
||||
|
||||
$q = $this->otModel->getDatatableQuery()->where('ordenes_trabajo.preimpresion_revisada', true)->where('pedidos.estado', 'produccion');
|
||||
return DataTable::of($q)
|
||||
->add("logo", fn($q) => ["logo" => site_url($logo->get_logo_path($q->presupuesto_linea_tipo)), "imposicion" => $q->imposicion_name, "color" => $this->produccionService->init($q->id)->getOtColorStatus()])
|
||||
->edit(
|
||||
"fecha_encuadernado_at",
|
||||
fn($q) => $q->fecha_encuadernado_at ? Time::createFromFormat("Y-m-d H:i:s", $q->fecha_encuadernado_at)->format("d/m/Y") : ""
|
||||
)
|
||||
->add("action", fn($q) => $q->id)
|
||||
->toJson(true);
|
||||
}
|
||||
public function datatable_waiting()
|
||||
{
|
||||
$logo = config(LogoImpresion::class);
|
||||
|
||||
$q = $this->otModel->getDatatableQuery()->where('ordenes_trabajo.is_pedido_espera', 1);
|
||||
return DataTable::of($q)
|
||||
->add("logo", fn($q) => ["logo" => site_url($logo->get_logo_path($q->presupuesto_linea_tipo)), "imposicion" => $q->imposicion_name, "color" => $this->produccionService->init($q->id)->getOtColorStatus()])
|
||||
->edit(
|
||||
"fecha_encuadernado_at",
|
||||
fn($q) => $q->fecha_encuadernado_at ? Time::createFromFormat("Y-m-d H:i:s", $q->fecha_encuadernado_at)->format("d/m/Y") : ""
|
||||
)
|
||||
->add("action", fn($q) => $q->id)
|
||||
->toJson(true);
|
||||
}
|
||||
public function datatable_revision_com()
|
||||
{
|
||||
$logo = config(LogoImpresion::class);
|
||||
|
||||
$q = $this->otModel->getDatatableQuery()->where('presupuestos.ferro', 1)->where("ferro_ok_at is NOT NULL", NULL, FALSE);
|
||||
return DataTable::of($q)
|
||||
->add("logo", fn($q) => ["logo" => site_url($logo->get_logo_path($q->presupuesto_linea_tipo)), "imposicion" => $q->imposicion_name, "color" => $this->produccionService->init($q->id)->getOtColorStatus()])
|
||||
->edit(
|
||||
"fecha_encuadernado_at",
|
||||
fn($q) => $q->fecha_encuadernado_at ? Time::createFromFormat("Y-m-d H:i:s", $q->fecha_encuadernado_at)->format("d/m/Y") : ""
|
||||
)
|
||||
->add("action", fn($q) => $q->id)
|
||||
->toJson(true);
|
||||
}
|
||||
public function papel_gramaje_datatable()
|
||||
{
|
||||
|
||||
@ -303,8 +377,10 @@ class Ordentrabajo extends BaseController
|
||||
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))
|
||||
->add("tarea_estado", fn($q) => $this->produccionService->getTitleTareaEstado($q->id))
|
||||
->edit("tiempo_estimado", fn($q) => float_seconds_to_hhmmss_string($q->tiempo_estimado))
|
||||
->edit("tiempo_real", fn($q) => float_seconds_to_hhmmss_string($q->tiempo_real))
|
||||
->add("proveedor", fn($q) => $this->produccionService->getProveedorTarea($q->id))
|
||||
->edit("maquina_tarea", fn($q) => ["id" => $q->id, "maquina_id" => $q->maquina_tarea, "maquina_name" => $q->maquina_nombre])
|
||||
->add("imposicion", fn($q) => ["id" => $q->id, "imposicion_id" => $q->imposicion_id, "name" => $q->imposicion_name, "is_presupuesto_linea" => $q->presupuesto_linea_id ? true : false])
|
||||
->toJson(true);
|
||||
@ -313,6 +389,14 @@ class Ordentrabajo extends BaseController
|
||||
{
|
||||
return $this->produccionService->init($orden_trabajo_id)->getPdf();
|
||||
}
|
||||
public function get_ferro_pdf($orden_trabajo_id)
|
||||
{
|
||||
return $this->produccionService->init($orden_trabajo_id)->getFerroPdf();
|
||||
}
|
||||
public function get_prototipo_pdf($orden_trabajo_id)
|
||||
{
|
||||
return $this->produccionService->init($orden_trabajo_id)->getPrototipoPdf();
|
||||
}
|
||||
public function upload_orden_trabajo_portada()
|
||||
{
|
||||
try {
|
||||
@ -520,8 +604,26 @@ class Ordentrabajo extends BaseController
|
||||
['title' => $maquina->nombre, 'route' => route_to("viewProduccionMaquinistaMaquina", $maquina_id), 'active' => true],
|
||||
];
|
||||
$this->viewData["maquinaEntity"] = $maquina;
|
||||
return view(static::$viewPath . '/maquinista/viewMaquinistaMaquinaTareas', $this->viewData);
|
||||
$tareasRunning = $this->maquinaOtTareaModel->queryDatatableJoinOrdenTrabajo($maquina->id)->countAllResults();
|
||||
if ($tareasRunning) {
|
||||
return view(static::$viewPath . '/maquinista/viewProduccionMaquinistaOtTareasView', $this->viewData);
|
||||
} else {
|
||||
return view(static::$viewPath . '/maquinista/viewMaquinistaMaquinaTareas', $this->viewData);
|
||||
}
|
||||
}
|
||||
public function maquinista_maquina_tareas_fichaje_automatico(int $maquina_id)
|
||||
{
|
||||
$maquina = $this->maquinaModel->find($maquina_id);
|
||||
$this->viewData["maquinaEntity"] = $maquina;
|
||||
return view(static::$viewPath . '/maquinista/viewMaquinistaFichajeAutomatico', $this->viewData);
|
||||
}
|
||||
public function maquinista_maquina_tareas_scan(int $maquina_id)
|
||||
{
|
||||
$maquina = $this->maquinaModel->find($maquina_id);
|
||||
$this->viewData["maquinaEntity"] = $maquina;
|
||||
return view(static::$viewPath . '/maquinista/viewMaquinistaTareaScan', $this->viewData);
|
||||
}
|
||||
|
||||
public function maquinista_maquina_tarea_view(int $orden_trabajo_tarea_id)
|
||||
{
|
||||
$otTareaEntity = $this->otTarea->find($orden_trabajo_tarea_id);
|
||||
@ -534,9 +636,19 @@ class Ordentrabajo extends BaseController
|
||||
['title' => $otTareaEntity->nombre, 'route' => route_to("viewProduccionMaquinistaTareaView", $otTareaEntity->id), 'active' => true]
|
||||
|
||||
];
|
||||
|
||||
return view(static::$viewPath . '/maquinista/viewMaquinistaMaquinaTarea', $this->viewData);
|
||||
}
|
||||
public function maquinista_maquina_ot_tareas_view(int $maquina_id)
|
||||
{
|
||||
$maquinaEntity = $this->maquinaModel->find($maquina_id);
|
||||
$this->viewData['maquinaEntity'] = $maquinaEntity;
|
||||
$tareasRunning = $this->maquinaOtTareaModel->queryDatatableJoinOrdenTrabajo($maquina_id)->countAllResults();
|
||||
if ($tareasRunning) {
|
||||
return view(static::$viewPath . '/maquinista/viewProduccionMaquinistaOtTareasView', $this->viewData);
|
||||
} else {
|
||||
return view(static::$viewPath . '/maquinista/viewMaquinistaMaquinaTareas', $this->viewData);
|
||||
}
|
||||
}
|
||||
public function maquinista_colas_view()
|
||||
{
|
||||
return view(static::$viewPath . '/maquinista/viewMaquinistaPlanningList', $this->viewData);
|
||||
@ -549,6 +661,16 @@ class Ordentrabajo extends BaseController
|
||||
}
|
||||
return DataTable::of($pm)
|
||||
->edit('fecha_impresion', fn($q) => $q->fecha_impresion ? Time::createFromFormat('Y-m-d H:i:s', $q->fecha_impresion)->format('d/m/Y') : '')
|
||||
->add("tareaEstado", fn($q) => $this->produccionService->getTitleTareaEstado($q->ot_tarea_id))
|
||||
->add('action', fn($q) => $this->produccionService->buttonActionDatatableTareaList($q->ot_tarea_id))
|
||||
->toJson(true);
|
||||
}
|
||||
public function maquinista_maquina_tareas_aplazada_datatable(int $maquina_id)
|
||||
{
|
||||
$pm = $this->produccionService->getMaquinaImpresionTareasList($maquina_id)->where("tarea_progress.estado", 'D');
|
||||
return DataTable::of($pm)
|
||||
->edit('fecha_impresion', fn($q) => $q->fecha_impresion ? Time::createFromFormat('Y-m-d H:i:s', $q->fecha_impresion)->format('d/m/Y') : '')
|
||||
->add("tareaEstado", fn($q) => $this->produccionService->getTitleTareaEstado($q->ot_tarea_id))
|
||||
->add('action', fn($q) => $this->produccionService->buttonActionDatatableTareaList($q->ot_tarea_id))
|
||||
->toJson(true);
|
||||
}
|
||||
@ -559,10 +681,16 @@ class Ordentrabajo extends BaseController
|
||||
try {
|
||||
$bodyData = $this->request->getPost();
|
||||
$validated = $this->validation->run($bodyData, "orden_trabajo_tarea_progress_date");
|
||||
// return $this->response->setJSON(["message" => lang("App.global_alert_save_success"), "data" => $this->validation->getValidated(),"errors" => $this->validation->getErrors()]);
|
||||
if ($validated) {
|
||||
$r = $this->produccionService->storeOrdenTrabajoTareaProgressDate($this->validation->getValidated());
|
||||
return $this->response->setJSON(["message" => lang("App.global_alert_save_success"), "status" => $r, "data" => $bodyData]);
|
||||
$validatedData = $this->validation->getValidated();
|
||||
$r = $this->produccionService->storeOrdenTrabajoTareaProgressDate($validatedData);
|
||||
$otTareaEntity = $this->otTarea->find($validatedData['ot_tarea_id']);
|
||||
$data = [
|
||||
"tiempo_trabajado" => float_seconds_to_hhmm_string($otTareaEntity->tiempo_real),
|
||||
"tarea" => $otTareaEntity,
|
||||
"estado" => $validatedData['estado'],
|
||||
];
|
||||
return $this->response->setJSON(["message" => lang("App.global_alert_save_success"), "status" => $r, "data" => $data]);
|
||||
} else {
|
||||
return $this->response->setJSON(["errors" => $this->validation->getErrors()])->setStatusCode(400);
|
||||
}
|
||||
@ -572,7 +700,6 @@ class Ordentrabajo extends BaseController
|
||||
}
|
||||
public function delete_orden_trabajo_progress_date(int $orden_trabajo_tarea_id)
|
||||
{
|
||||
|
||||
$status = $this->produccionService->deleteOrdenTrabajoTareaProgressDates($orden_trabajo_tarea_id);
|
||||
return $this->response->setJSON(["message" => lang("App.global_alert_save_success"), "status" => $status]);
|
||||
}
|
||||
@ -587,15 +714,181 @@ class Ordentrabajo extends BaseController
|
||||
}
|
||||
public function update_pod_pedido_dates($orden_trabajo_id)
|
||||
{
|
||||
|
||||
|
||||
$this->produccionService->init($orden_trabajo_id);
|
||||
if($this->produccionService->isPOD){
|
||||
if ($this->produccionService->isPOD) {
|
||||
$status = $this->produccionService->updatePodDates();
|
||||
return $this->response->setJSON(["message" => lang("App.global_alert_save_success"), "status" => $status, "data" => $this->produccionService->getPedido()]);
|
||||
}else{
|
||||
} else {
|
||||
return $this->response->setJSON(["message" => lang("App.global_alert_save_success"), "status" => false, "data" => $this->produccionService->getPedido()]);
|
||||
|
||||
}
|
||||
}
|
||||
public function get_orden_trabajo_tareas_dates($orden_trabajo_id)
|
||||
{
|
||||
$data = $this->produccionService->init($orden_trabajo_id)->getOrdenTrabajoTareaDates();
|
||||
return $this->response->setJSON(["data" => $data]);
|
||||
}
|
||||
public function get_tareas_ot_maquina(int $orden_trabajo_id, int $maquina_id)
|
||||
{
|
||||
$tareasWithMaquina = $this->produccionService->init($orden_trabajo_id)->getTareasWithMaquina($maquina_id, ['P', 'I', 'S', 'D']);
|
||||
if ($tareasWithMaquina) {
|
||||
$data = [
|
||||
'tareas' => $tareasWithMaquina,
|
||||
'ot' => $this->produccionService->getOrdenTrabajo(),
|
||||
'presupuesto' => $this->produccionService->getPresupuesto()
|
||||
];
|
||||
return $this->response->setJSON(["message" => lang("App.global_alert_fetch_success"), "data" => $data]);
|
||||
} else {
|
||||
$tareasWithMaquina = $this->produccionService->init($orden_trabajo_id)->getTareasWithMaquina($maquina_id, ['F']);
|
||||
if ($tareasWithMaquina) {
|
||||
return $this->response->setJSON(["message" => lang("Produccion.errors.tareas_finalizadas"), "data" => $tareasWithMaquina])->setStatusCode(400);
|
||||
} else {
|
||||
return $this->response->setJSON(["message" => lang("Produccion.errors.maquina_not_in_ot"), "data" => null])->setStatusCode(400);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function update_orden_trabajo_fa_tareas()
|
||||
{
|
||||
$bodyData = $this->request->getPost();
|
||||
$validated = $this->validation->run($bodyData, "orden_trabajo_fichaje_auto");
|
||||
if ($validated) {
|
||||
$validatedData = $this->validation->getValidated();
|
||||
$this->produccionService->init($validatedData['orden_trabajo_id']);
|
||||
foreach ($validatedData['tareas'] as $key => $tareaId) {
|
||||
$this->produccionService->storeOrdenTrabajoTareaProgressDate(
|
||||
[
|
||||
'estado' => 'F',
|
||||
'ot_tarea_id' => $tareaId
|
||||
]
|
||||
);
|
||||
$tareaEntity = $this->otTarea->find($tareaId);
|
||||
$tiempo_trabajado = $tareaEntity->tiempo_trabajado();
|
||||
$tareaEntity->tiempo_real = $tiempo_trabajado / count($validatedData['tareas']);
|
||||
$tareaEntity->click_init = $validatedData['click_init'] / count($validatedData['tareas']);
|
||||
$tareaEntity->click_end = $validatedData['click_end'] / count($validatedData['tareas']);
|
||||
|
||||
$this->otTarea->save($tareaEntity);
|
||||
}
|
||||
return $this->response->setJSON(["message" => lang("App.global_alert_save_success"), "status" => true, "data" => $validatedData]);
|
||||
} else {
|
||||
return $this->response->setJSON(["errors" => $this->validation->getErrors()])->setStatusCode(400);
|
||||
}
|
||||
}
|
||||
public function store_maquina_ordenes_trabajo()
|
||||
{
|
||||
$bodyData = $this->request->getPost();
|
||||
$validated = $this->validation->run($bodyData, "maquina_ordenes_trabajo");
|
||||
if ($validated) {
|
||||
$validatedData = $this->validation->getValidated();
|
||||
|
||||
foreach ($validatedData['ordenes_trabajo'] as $key => $orden_trabajo_id) {
|
||||
$maquinaOtTarea = $this->maquinaOtTareaModel->where('orden_trabajo_id', $orden_trabajo_id)->where('maquina_id', $validatedData['maquina_id'])->where('deleted_at',null)->countAllResults();
|
||||
if ($maquinaOtTarea) {
|
||||
continue;
|
||||
}
|
||||
$this->maquinaOtTareaModel->insert(['maquina_id' => $validatedData['maquina_id'], 'orden_trabajo_id' => $orden_trabajo_id]);
|
||||
}
|
||||
return $this->response->setJSON(["message" => lang("App.global_alert_save_success"), "status" => true, "data" => $validatedData]);
|
||||
} else {
|
||||
return $this->response->setJSON(["errors" => $this->validation->getErrors()])->setStatusCode(400);
|
||||
}
|
||||
}
|
||||
public function update_maquina_ordenes_trabajo_estado()
|
||||
{
|
||||
$bodyData = $this->request->getPost();
|
||||
$maquina_id = $bodyData['maquina_id'];
|
||||
$estado = $bodyData['estado'];
|
||||
$maquina_ots = $this->maquinaOtTareaModel->where('maquina_id', $maquina_id)->findAll();
|
||||
$totalTareas = [];
|
||||
|
||||
foreach ($maquina_ots as $key => $maquina_ot) {
|
||||
$tareas = $this->produccionService->init($maquina_ot->orden_trabajo_id)
|
||||
->getTareasWithMaquina($maquina_id, ['P', 'I', 'S', 'D']);
|
||||
foreach ($tareas as $key => $tarea) {
|
||||
$this->produccionService->storeOrdenTrabajoTareaProgressDate(
|
||||
[
|
||||
'estado' => $estado,
|
||||
'ot_tarea_id' => $tarea->id
|
||||
]
|
||||
);
|
||||
$tarea->click_init = $bodyData['click_init'];
|
||||
$tarea->click_end = $bodyData['click_end'];
|
||||
$totalTareas[] = $tarea;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
foreach ($totalTareas as $key => $tarea) {
|
||||
$tiempo_trabajado = $tarea->tiempo_trabajado();
|
||||
$tarea->tiempo_real = $tiempo_trabajado / count($totalTareas);
|
||||
$tarea->click_init = $tarea->click_init / count($totalTareas);
|
||||
$tarea->click_end = $tarea->click_end / count($totalTareas);
|
||||
|
||||
$this->otTarea->save($tarea);
|
||||
}
|
||||
if ($estado == "F") {
|
||||
$this->maquinaOtTareaModel->where('maquina_id', $maquina_id)->delete();
|
||||
}
|
||||
|
||||
return $this->response->setJSON(["message" => lang("Produccion.responses.update_maquina_ordenes_trabajo_estado")]);
|
||||
}
|
||||
public function delete_maquina_orden_trabajo_tarea($maquina_orden_trabajo_tarea_id)
|
||||
{
|
||||
|
||||
$status = $this->maquinaOtTareaModel->delete($maquina_orden_trabajo_tarea_id);
|
||||
return $this->response->setJSON(["message" => lang("App.user_alert_delete"), "status" => $status]);
|
||||
}
|
||||
public function delete_maquina_orden_trabajo_all($maquina_id)
|
||||
{
|
||||
$maquina_ots = $this->maquinaOtTareaModel->where('maquina_id', $maquina_id)->findAll();
|
||||
foreach ($maquina_ots as $key => $maquina_ot) {
|
||||
$tareas = $this->produccionService->init($maquina_ot->orden_trabajo_id)
|
||||
->getTareasWithMaquina($maquina_id, ['P', 'I', 'S', 'D']);
|
||||
foreach ($tareas as $key => $tarea) {
|
||||
$this->produccionService->deleteOrdenTrabajoTareaProgressDates($tarea->id);
|
||||
}
|
||||
}
|
||||
$status = $this->maquinaOtTareaModel->where('maquina_id',$maquina_id)->delete();
|
||||
return $this->response->setJSON(["message" => lang("App.user_alert_delete"), "status" => $status]);
|
||||
}
|
||||
|
||||
public function datatable_maquina_ordenes_trabajo($maquina_id)
|
||||
{
|
||||
$query = $this->maquinaOtTareaModel->queryDatatableJoinOrdenTrabajo($maquina_id);
|
||||
return DataTable::of($query)
|
||||
->add('action', fn($q) => $q->otId)
|
||||
->add('titulo', fn($q) => $this->otModel->find($q->otId)->presupuesto()->titulo)
|
||||
->add('barcode', fn($q) => $this->otModel->find($q->otId)->getBarCode())
|
||||
->toJson(true);
|
||||
}
|
||||
public function get_maquina_ots($maquina_id)
|
||||
{
|
||||
$responseData = [
|
||||
"tiempo_total_estimado" => 0,
|
||||
"tiempo_total_real" => 0,
|
||||
"clicks_total" => 0,
|
||||
"tirada_total" => 0,
|
||||
"estado" => "P",
|
||||
];
|
||||
$maquina_ots = $this->maquinaOtTareaModel->where('maquina_id', $maquina_id)->findAll();
|
||||
foreach ($maquina_ots as $key => $maquina_ot) {
|
||||
$tareas = $this->produccionService->init($maquina_ot->orden_trabajo_id)
|
||||
->getTareasWithMaquina($maquina_id, ['P', 'I', 'S', 'D']);
|
||||
foreach ($tareas as $key => $tarea) {
|
||||
$responseData['tiempo_total_estimado']+= $tarea->tiempo_estimado;
|
||||
$responseData['tiempo_total_real']+= $tarea->tiempo_real;
|
||||
$responseData["estado"] = $tarea->lastState()->estado;
|
||||
if($tarea->presupuesto_linea_id){
|
||||
$responseData["clicks_total"] += $tarea->presupuesto_linea()->rotativa_clicks_total;
|
||||
$responseData["tirada_total"] += $tarea->orden_trabajo()->presupuesto()->tirada;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
$responseData['tiempo_total_estimado'] = float_seconds_to_hhmmss_string($responseData['tiempo_total_estimado']);
|
||||
$responseData['tiempo_total_real'] = float_seconds_to_hhmmss_string($responseData['tiempo_total_real']);
|
||||
return $this->response->setJSON($responseData);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -30,10 +30,17 @@ class Test extends BaseController
|
||||
|
||||
}
|
||||
|
||||
private function index()
|
||||
public function index()
|
||||
{
|
||||
|
||||
$modelCL = new CatalogoLibroModel();
|
||||
|
||||
$this->emailService = service('emailService');
|
||||
|
||||
$a= $this->emailService->send('prueba', 'Esto es una prueba', ['imnavajas@coit.es','imnavajas@gmail.com']);
|
||||
|
||||
echo var_dump($a);
|
||||
|
||||
/*$modelCL = new CatalogoLibroModel();
|
||||
$modelISK = new IdentificadorIskModel();
|
||||
|
||||
// Obtener todos los registros sin isk
|
||||
@ -46,7 +53,7 @@ class Test extends BaseController
|
||||
$modelCL->update($registro->id, ['isk' => $isk]);
|
||||
|
||||
echo "[" . $i++ . "]Asignado ISK {$isk} a ID {$registro->id}<br>";
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Database\Migrations;
|
||||
|
||||
use CodeIgniter\Database\RawSql;
|
||||
use CodeIgniter\Database\Migration;
|
||||
|
||||
class AddClienteNoBasePODnoHQ extends Migration
|
||||
{
|
||||
protected array $COLUMNS = [
|
||||
"no_envio_base" => [
|
||||
"type" => "TINYINT",
|
||||
"default" => 0,
|
||||
],
|
||||
"forzar_rotativa_pod" => [
|
||||
"type" => "TINYINT",
|
||||
"default" => 0,
|
||||
],
|
||||
];
|
||||
public function up()
|
||||
{
|
||||
$this->forge->addColumn('clientes', $this->COLUMNS);
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
//
|
||||
$this->forge->dropColumn('clientes', array_keys($this->COLUMNS));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace App\Database\Migrations;
|
||||
|
||||
use CodeIgniter\Database\Migration;
|
||||
|
||||
class AlterOrdenesTrabajoAddCommentColumns extends Migration
|
||||
{
|
||||
protected array $COLUMNS = [
|
||||
'comment_interior' => [
|
||||
'type' => 'LONGTEXT',
|
||||
'null' => true
|
||||
],
|
||||
'comment_cubierta' => [
|
||||
'type' => 'LONGTEXT',
|
||||
'null' => true
|
||||
],
|
||||
'comment_encuadernacion' => [
|
||||
'type' => 'LONGTEXT',
|
||||
'null' => true
|
||||
],
|
||||
'comment_logistica' => [
|
||||
'type' => 'LONGTEXT',
|
||||
'null' => true
|
||||
],
|
||||
"info_solapa_guillotina" => [
|
||||
'type' => 'LONGTEXT',
|
||||
'null' => true
|
||||
]
|
||||
];
|
||||
public function up()
|
||||
{
|
||||
|
||||
$this->forge->addColumn('ordenes_trabajo',$this->COLUMNS);
|
||||
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->forge->dropColumn('ordenes_trabajo',array_keys($this->COLUMNS));
|
||||
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,82 @@
|
||||
<?php
|
||||
|
||||
namespace App\Database\Migrations;
|
||||
|
||||
use CodeIgniter\Database\Migration;
|
||||
use CodeIgniter\Database\RawSql;
|
||||
|
||||
class AddOrdenTrabajoDatesManipuladoImpresion extends Migration
|
||||
{
|
||||
protected array $DATES = [
|
||||
"sobrecubierta_at" => [
|
||||
"type" => "DATE",
|
||||
"null" => true,
|
||||
],
|
||||
"guarda_at" => [
|
||||
"type" => "DATE",
|
||||
"null" => true,
|
||||
],
|
||||
"plakene_at" => [
|
||||
"type" => "DATE",
|
||||
"null" => true,
|
||||
],
|
||||
"estampado_at" => [
|
||||
"type" => "DATE",
|
||||
"null" => true,
|
||||
],
|
||||
"uvi_at" => [
|
||||
"type" => "DATE",
|
||||
"null" => true,
|
||||
],
|
||||
|
||||
];
|
||||
protected array $USERS = [
|
||||
"sobrecubierta_user_id" => [
|
||||
"type" => "INT",
|
||||
"unsigned" => true,
|
||||
"constraint" => 10,
|
||||
"null" => true,
|
||||
],
|
||||
"guarda_user_id" => [
|
||||
"type" => "INT",
|
||||
"unsigned" => true,
|
||||
"constraint" => 10,
|
||||
"null" => true,
|
||||
],
|
||||
"plakene_user_id" => [
|
||||
"type" => "INT",
|
||||
"unsigned" => true,
|
||||
"constraint" => 10,
|
||||
"null" => true,
|
||||
],
|
||||
"estampado_user_id" => [
|
||||
"type" => "INT",
|
||||
"unsigned" => true,
|
||||
"constraint" => 10,
|
||||
"null" => true,
|
||||
],
|
||||
"uvi_user_id" => [
|
||||
"type" => "INT",
|
||||
"unsigned" => true,
|
||||
"constraint" => 10,
|
||||
"null" => true,
|
||||
],
|
||||
];
|
||||
|
||||
public function up()
|
||||
{
|
||||
$this->forge->addColumn("orden_trabajo_dates", $this->DATES);
|
||||
$this->forge->addColumn("orden_trabajo_users", $this->USERS);
|
||||
foreach ($this->USERS as $key => $value) {
|
||||
$this->forge->addForeignKey([$key],"users",["id"]);
|
||||
}
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->forge->dropColumn("orden_trabajo_dates", array_keys($this->DATES));
|
||||
$this->forge->dropColumn("orden_trabajo_users", array_keys($this->USERS));
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace App\Database\Migrations;
|
||||
|
||||
use CodeIgniter\Database\Migration;
|
||||
|
||||
class AlterOrdenesTrabajoAddCommentColumns extends Migration
|
||||
{
|
||||
protected array $COLUMNS = [
|
||||
'preimpresion_revisada' => [
|
||||
'type' => 'BOOL',
|
||||
'default' => false
|
||||
],
|
||||
'preimpresion_revisada_by' => [
|
||||
'type' => 'INT',
|
||||
'unsigned' => true,
|
||||
'constraint' => 11,
|
||||
],
|
||||
];
|
||||
public function up()
|
||||
{
|
||||
|
||||
$this->forge->addColumn('ordenes_trabajo',$this->COLUMNS);
|
||||
$this->forge->addForeignKey('preimpresion_revisada_by','users','id','NULL','NULL');
|
||||
$this->forge->processIndexes('ordenes_trabajo');
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->forge->dropForeignKey('ordenes_trabajo','ordenes_trabajo_preimpresion_revisada_by_foreign');
|
||||
$this->forge->dropColumn('ordenes_trabajo',array_keys($this->COLUMNS));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,60 @@
|
||||
<?php
|
||||
|
||||
namespace App\Database\Migrations;
|
||||
|
||||
use CodeIgniter\Database\Migration;
|
||||
|
||||
class CreateEtiquetasTitulos extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
// Tabla: etiquetas_titulos
|
||||
$this->forge->addField([
|
||||
'id' => ['type' => 'INT', 'unsigned' => true, 'auto_increment' => true],
|
||||
'comentarios' => ['type' => 'TEXT', 'null' => true],
|
||||
'direccion' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => false],
|
||||
'att' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => false],
|
||||
'cliente_id' => ['type' => 'INT', 'unsigned' => true, 'null' => true],
|
||||
'created_at' => ['type' => 'DATETIME', 'null' => true],
|
||||
'updated_at' => ['type' => 'DATETIME', 'null' => true],
|
||||
'deleted_at' => ['type' => 'DATETIME', 'null' => true],
|
||||
'user_created_at' => ['type' => 'INT', 'unsigned' => true, 'null' => true],
|
||||
'user_updated_at' => ['type' => 'INT', 'unsigned' => true, 'null' => true],
|
||||
'user_deleted_at' => ['type' => 'INT', 'unsigned' => true, 'null' => true],
|
||||
]);
|
||||
$this->forge->addKey('id', true);
|
||||
$this->forge->addForeignKey('user_created_at', 'users', 'id', 'SET NULL', 'CASCADE');
|
||||
$this->forge->addForeignKey('user_updated_at', 'users', 'id', 'SET NULL', 'CASCADE');
|
||||
$this->forge->addForeignKey('user_deleted_at', 'users', 'id', 'SET NULL', 'CASCADE');
|
||||
$this->forge->addForeignKey('cliente_id', 'clientes', 'id', 'SET NULL', 'CASCADE');
|
||||
$this->forge->createTable('etiquetas_titulos');
|
||||
|
||||
// Tabla: etiquetas_titulos_lineas
|
||||
$this->forge->addField([
|
||||
'id' => ['type' => 'INT', 'unsigned' => true, 'auto_increment' => true],
|
||||
'etiqueta_titulos_id' => ['type' => 'INT', 'unsigned' => true],
|
||||
'ot_id' => ['type' => 'INT', 'unsigned' => true],
|
||||
'unidades' => ['type' => 'INT', 'unsigned' => true],
|
||||
'numero_caja' => ['type' => 'INT', 'unsigned' => true],
|
||||
'created_at' => ['type' => 'DATETIME', 'null' => true],
|
||||
'updated_at' => ['type' => 'DATETIME', 'null' => true],
|
||||
'deleted_at' => ['type' => 'DATETIME', 'null' => true],
|
||||
'user_created_at' => ['type' => 'INT', 'unsigned' => true, 'null' => true],
|
||||
'user_updated_at' => ['type' => 'INT', 'unsigned' => true, 'null' => true],
|
||||
'user_deleted_at' => ['type' => 'INT', 'unsigned' => true, 'null' => true],
|
||||
]);
|
||||
$this->forge->addKey('id', true);
|
||||
$this->forge->addForeignKey('etiqueta_titulos_id', 'etiquetas_titulos', 'id', 'CASCADE', 'CASCADE');
|
||||
$this->forge->addForeignKey('ot_id', 'ordenes_trabajo', 'id', 'CASCADE', 'CASCADE');
|
||||
$this->forge->addForeignKey('user_created_at', 'users', 'id', 'SET NULL', 'CASCADE');
|
||||
$this->forge->addForeignKey('user_updated_at', 'users', 'id', 'SET NULL', 'CASCADE');
|
||||
$this->forge->addForeignKey('user_deleted_at', 'users', 'id', 'SET NULL', 'CASCADE');
|
||||
$this->forge->createTable('etiquetas_titulos_lineas');
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->forge->dropTable('etiquetas_titulos_lineas', true);
|
||||
$this->forge->dropTable('etiquetas_titulos', true);
|
||||
}
|
||||
}
|
||||
58
ci4/app/Database/Migrations/2025-05-04-172900_MaquinaOtTareasTable.php
Executable file
58
ci4/app/Database/Migrations/2025-05-04-172900_MaquinaOtTareasTable.php
Executable file
@ -0,0 +1,58 @@
|
||||
<?php
|
||||
|
||||
namespace App\Database\Migrations;
|
||||
|
||||
use CodeIgniter\Database\Migration;
|
||||
use CodeIgniter\Database\RawSql;
|
||||
|
||||
class MaquinaOtTareasTable extends Migration
|
||||
{
|
||||
protected array $COLUMNS = [
|
||||
|
||||
'id' => [
|
||||
'type' => 'INT',
|
||||
'unsigned' => true,
|
||||
'auto_increment' => true,
|
||||
],
|
||||
'maquina_id' => [
|
||||
'type' => 'INT',
|
||||
'unsigned' => true,
|
||||
'constraint' => 11
|
||||
],
|
||||
'orden_trabajo_id' => [
|
||||
'type' => 'INT',
|
||||
'unsigned' => 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->addForeignKey('maquina_id','lg_maquinas','id','CASCADE','CASCADE','maquina_ot_tareas_maquina_id_fk');
|
||||
$this->forge->addForeignKey('orden_trabajo_id','ordenes_trabajo','id','CASCADE','CASCADE','maquina_ot_tareas_ot_id_fk');
|
||||
$this->forge->createTable("maquina_ot_tareas");
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->forge->dropTable("maquina_ot_tareas");
|
||||
}
|
||||
}
|
||||
@ -1,7 +1,9 @@
|
||||
<?php
|
||||
namespace App\Entities\Cliente;
|
||||
namespace App\Entities\Clientes;
|
||||
|
||||
use CodeIgniter\Entity;
|
||||
use App\Models\Clientes\ClienteModel;
|
||||
use App\Models\Configuracion\PaisModel;
|
||||
|
||||
class ClienteDireccionesEntity extends \CodeIgniter\Entity\Entity
|
||||
{
|
||||
@ -23,4 +25,29 @@ class ClienteDireccionesEntity extends \CodeIgniter\Entity\Entity
|
||||
"pais_id" => "int",
|
||||
"cp" => "int",
|
||||
];
|
||||
|
||||
public function getClienteNombre(): ?string
|
||||
{
|
||||
if (!$this->cliente_id) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$clienteModel = model(ClienteModel::class);
|
||||
$cliente = $clienteModel->find($this->cliente_id);
|
||||
|
||||
return $cliente ? $cliente->nombre : null;
|
||||
}
|
||||
|
||||
public function getPaisNombre(): ?string
|
||||
{
|
||||
if (!$this->pais_id) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$paisModel = model(PaisModel::class);
|
||||
$pais = $paisModel->find($this->pais_id);
|
||||
|
||||
return $pais ? $pais->nombre : null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -48,6 +48,8 @@ class ClienteEntity extends \CodeIgniter\Entity\Entity
|
||||
"updated_at" => null,
|
||||
"user_created_id" => 1,
|
||||
"user_update_id" => 1,
|
||||
"no_envio_base" => 0,
|
||||
"forzar_rotativa_pod" => 0,
|
||||
];
|
||||
protected $casts = [
|
||||
"comunidad_autonoma_id" => "?int",
|
||||
@ -70,6 +72,8 @@ class ClienteEntity extends \CodeIgniter\Entity\Entity
|
||||
"is_deleted" => "int",
|
||||
"user_created_id" => "int",
|
||||
"user_update_id" => "int",
|
||||
"no_envio_base" => "boolean",
|
||||
"forzar_rotativa_pod" => "boolean",
|
||||
];
|
||||
|
||||
public function comercial() : ?UserEntity
|
||||
|
||||
17
ci4/app/Entities/Etiquetas/EtiquetaTitulo.php
Normal file
17
ci4/app/Entities/Etiquetas/EtiquetaTitulo.php
Normal file
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entities\Etiquetas;
|
||||
use App\Models\Etiquetas\EtiquetasTitulosLineasModel;
|
||||
|
||||
use CodeIgniter\Entity\Entity;
|
||||
|
||||
class EtiquetaTitulo extends Entity
|
||||
{
|
||||
protected $dates = ['created_at', 'updated_at', 'deleted_at'];
|
||||
|
||||
public function getLineas()
|
||||
{
|
||||
$model = new EtiquetasTitulosLineasModel();
|
||||
return $model->where('etiqueta_titulos_id', $this->id)->findAll();
|
||||
}
|
||||
}
|
||||
10
ci4/app/Entities/Etiquetas/EtiquetaTituloLinea.php
Normal file
10
ci4/app/Entities/Etiquetas/EtiquetaTituloLinea.php
Normal file
@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entities\Etiquetas;
|
||||
|
||||
use CodeIgniter\Entity\Entity;
|
||||
|
||||
class EtiquetaTituloLinea extends Entity
|
||||
{
|
||||
protected $dates = ['created_at', 'updated_at', 'deleted_at'];
|
||||
}
|
||||
@ -222,6 +222,7 @@ class PresupuestoLineaEntity extends \CodeIgniter\Entity\Entity
|
||||
|
||||
return $nombre;
|
||||
}
|
||||
|
||||
public function isGuarda(): bool
|
||||
{
|
||||
return in_array($this->attributes["tipo"], ["lp_guardas"]);
|
||||
|
||||
@ -15,8 +15,15 @@ class OrdenTrabajoDateEntity extends Entity
|
||||
"interior_bn_at" => null,
|
||||
"interior_color_at" => null,
|
||||
"cubierta_at" => null,
|
||||
"sobrecubierta_at" => null, //TODO
|
||||
"guarda_at" => null, //TODO
|
||||
//ACABADO
|
||||
"plastificado_at" => null,
|
||||
"plakene_at" => null, //TODO
|
||||
"retractilado_at"=> null,
|
||||
"estampado_at" => null, //TODO
|
||||
"uvi_at" => null, //TODO
|
||||
//MANIPULADO
|
||||
"encuadernacion_at" => null,
|
||||
"corte_at" => null,
|
||||
"preparacion_interiores_at" => null,
|
||||
@ -24,9 +31,8 @@ class OrdenTrabajoDateEntity extends Entity
|
||||
"cosido_at" => null,
|
||||
"solapa_at" => null,
|
||||
"grapado_at" => null,
|
||||
"retractilado_at"=> null,
|
||||
"retractilado5_at"=> null,
|
||||
"prototipo_at"=> null,
|
||||
"retractilado5_at"=> null, // !DELETE
|
||||
"prototipo_at"=> null, // !DELETE
|
||||
"marcapaginas_at"=> null,
|
||||
"espiral_at"=> null,
|
||||
//FERRO
|
||||
|
||||
@ -30,6 +30,11 @@ class OrdenTrabajoEntity extends Entity
|
||||
"progreso" => 0.00,
|
||||
"estado" => "I",
|
||||
"comentarios" => null,
|
||||
"comment_interior" => null,
|
||||
"comment_cubierta" => null,
|
||||
"comment_encuadernacion" => null,
|
||||
"comment_logistica" => null,
|
||||
"info_solapa_guillotina" => null,
|
||||
"revisar_formato" => null,
|
||||
"revisar_lomo" => null,
|
||||
"revisar_solapa" => null,
|
||||
@ -40,6 +45,9 @@ class OrdenTrabajoEntity extends Entity
|
||||
"portada_path" => null,
|
||||
"is_pedido_espera" => null,
|
||||
"pedido_espera_by" => null,
|
||||
"preimpresion_revisada" => false,
|
||||
"preimpresion_revisada_by" => null,
|
||||
|
||||
];
|
||||
protected $casts = [
|
||||
"pedido_id" => "integer",
|
||||
@ -52,7 +60,12 @@ class OrdenTrabajoEntity extends Entity
|
||||
"tipo_entrada" => "string",
|
||||
"progreso" => "float",
|
||||
"estado" => "string",
|
||||
"comentarios" => "string",
|
||||
"comentarios" => "?string",
|
||||
"comment_interior" => "?string",
|
||||
"comment_cubierta" => "?string",
|
||||
"comment_encuadernacion" => "?string",
|
||||
"comment_logistica" => "?string",
|
||||
"info_solapa_guillotina" => "?string",
|
||||
"revisar_formato" => "bool",
|
||||
"revisar_lomo" => "bool",
|
||||
"revisar_solapa" => "bool",
|
||||
@ -62,6 +75,7 @@ class OrdenTrabajoEntity extends Entity
|
||||
"enviar_impresion" => "bool",
|
||||
"portada_path" => "string",
|
||||
"is_pedido_espera" => "bool",
|
||||
"preimpresion_revisada" => "bool",
|
||||
];
|
||||
|
||||
|
||||
@ -80,7 +94,22 @@ class OrdenTrabajoEntity extends Entity
|
||||
$m = model(OrdenTrabajoTarea::class);
|
||||
return $m->where("orden_trabajo_id", $this->attributes["id"])->where("presupuesto_linea_id IS NOT NULL", NULL, FALSE)->findAll() ?? [];
|
||||
}
|
||||
/**
|
||||
public function tareas_acabado(): array
|
||||
{
|
||||
$m = model(OrdenTrabajoTarea::class);
|
||||
return $m->where("orden_trabajo_id", $this->attributes["id"])->where("presupuesto_acabado_id IS NOT NULL", NULL, FALSE)->findAll() ?? [];
|
||||
}
|
||||
public function tareas_encuadernado(): array
|
||||
{
|
||||
$m = model(OrdenTrabajoTarea::class);
|
||||
return $m->where("orden_trabajo_id", $this->attributes["id"])->where("presupuesto_encuadernado_id IS NOT NULL", NULL, FALSE)->findAll() ?? [];
|
||||
}
|
||||
public function tareas_manipulado(): array
|
||||
{
|
||||
$m = model(OrdenTrabajoTarea::class);
|
||||
return $m->where("orden_trabajo_id", $this->attributes["id"])->where("presupuesto_manipulado_id IS NOT NULL", NULL, FALSE)->findAll() ?? [];
|
||||
}
|
||||
/**
|
||||
* Devuelve el presupuesto de la orden de trabajo
|
||||
*
|
||||
* @return PresupuestoEntity
|
||||
@ -153,10 +182,23 @@ class OrdenTrabajoEntity extends Entity
|
||||
return null;
|
||||
}
|
||||
}
|
||||
public function preimpresionRevisadaUser(): ?UserEntity
|
||||
{
|
||||
$m = model(UserModel::class);
|
||||
if ($this->attributes['preimpresion_revisada_by']) {
|
||||
return $m->findById($this->attributes['preimpresion_revisada_by']);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
public function getPedidoEsperaBy(): ?UserEntity
|
||||
{
|
||||
return $this->pedidoEsperaBy();
|
||||
}
|
||||
public function getPreimpresionRevisadaBy(): ?UserEntity
|
||||
{
|
||||
return $this->preimpresionRevisadaUser();
|
||||
}
|
||||
public function getFullPath(): ?string
|
||||
{
|
||||
helper('filesystem');
|
||||
@ -183,4 +225,5 @@ class OrdenTrabajoEntity extends Entity
|
||||
];
|
||||
return $estados[$this->attributes["estado"]];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -5,6 +5,7 @@ namespace App\Entities\Produccion;
|
||||
use App\Entities\Configuracion\Imposicion;
|
||||
use App\Entities\Configuracion\Maquina;
|
||||
use App\Entities\Presupuestos\PresupuestoAcabadosEntity;
|
||||
use App\Entities\Presupuestos\PresupuestoEncuadernacionesEntity;
|
||||
use App\Entities\Presupuestos\PresupuestoLineaEntity;
|
||||
use App\Entities\Presupuestos\PresupuestoManipuladosEntity;
|
||||
use App\Models\Configuracion\ImposicionModel;
|
||||
@ -12,6 +13,7 @@ use App\Models\Configuracion\MaquinaModel;
|
||||
use App\Models\OrdenTrabajo\OrdenTrabajoModel;
|
||||
use App\Models\OrdenTrabajo\OrdenTrabajoTareaProgressDate;
|
||||
use App\Models\Presupuestos\PresupuestoAcabadosModel;
|
||||
use App\Models\Presupuestos\PresupuestoEncuadernacionesModel;
|
||||
use App\Models\Presupuestos\PresupuestoLineaModel;
|
||||
use App\Models\Presupuestos\PresupuestoManipuladosModel;
|
||||
use CodeIgniter\Entity\Entity;
|
||||
@ -23,6 +25,11 @@ class OrdenTrabajoTareaEntity extends Entity
|
||||
"id" => null,
|
||||
"orden_trabajo_id" => null,
|
||||
"presupuesto_linea_id" => null,
|
||||
"presupuesto_acabado_id" => null,
|
||||
"presupuesto_preimpresion_id" => null,
|
||||
"presupuesto_encuadernado_id" => null,
|
||||
"presupuesto_extra_id" => null,
|
||||
"presupuesto_manipulado_id" => null,
|
||||
"nombre" => null,
|
||||
"orden" => null,
|
||||
"maquina_id" => null,
|
||||
@ -96,10 +103,15 @@ class OrdenTrabajoTareaEntity extends Entity
|
||||
*
|
||||
* @return PresupuestoLineaEntity
|
||||
*/
|
||||
public function presupuesto_linea(): PresupuestoLineaEntity
|
||||
public function presupuesto_linea(): ?PresupuestoLineaEntity
|
||||
{
|
||||
$presupuesto_linea = null;
|
||||
$m = model(PresupuestoLineaModel::class);
|
||||
return $m->find($this->attributes["presupuesto_linea_id"]);
|
||||
if ($this->attributes['presupuesto_linea_id']) {
|
||||
|
||||
$presupuesto_linea = $m->find($this->attributes["presupuesto_linea_id"]);
|
||||
}
|
||||
return $presupuesto_linea;
|
||||
}
|
||||
/**
|
||||
* Devuelve la maquina original del presupuesto linea
|
||||
@ -108,17 +120,35 @@ class OrdenTrabajoTareaEntity extends Entity
|
||||
*/
|
||||
public function maquina_presupuesto_linea(): Maquina
|
||||
{
|
||||
return $this->presupuesto_linea()->maquina();
|
||||
return $this->presupuesto_linea()?->maquina();
|
||||
}
|
||||
/**
|
||||
* Devuelve el presupuesto acabado origen de esta tarea
|
||||
*
|
||||
* @return PresupuestoAcabadosEntity
|
||||
*/
|
||||
public function presupuesto_acabado(): PresupuestoAcabadosEntity
|
||||
public function presupuesto_acabado(): ?PresupuestoAcabadosEntity
|
||||
{
|
||||
$presupuesto_acabado = null;
|
||||
$m = model(PresupuestoAcabadosModel::class);
|
||||
return $m->find($this->attributes["presupuesto_linea_id"]);
|
||||
if ($this->attributes["presupuesto_acabado_id"]) {
|
||||
$presupuesto_acabado = $m->find($this->attributes["presupuesto_acabado_id"]);
|
||||
}
|
||||
return $presupuesto_acabado;
|
||||
}
|
||||
/**
|
||||
* Devuelve el presupuesto enducadernacion origen de esta tarea
|
||||
*
|
||||
* @return PresupuestoEncuadernacionesEntity
|
||||
*/
|
||||
public function presupuesto_encuadernacion(): ?PresupuestoEncuadernacionesEntity
|
||||
{
|
||||
$presupuesto_encuadernacion = null;
|
||||
$m = model(PresupuestoEncuadernacionesModel::class);
|
||||
if ($this->attributes["presupuesto_encuadernado_id"]) {
|
||||
$presupuesto_encuadernacion = $m->find($this->attributes["presupuesto_encuadernado_id"]);
|
||||
}
|
||||
return $presupuesto_encuadernacion;
|
||||
}
|
||||
/**
|
||||
* Devuelve el presupuesto acabado origen de esta tarea
|
||||
@ -148,21 +178,27 @@ class OrdenTrabajoTareaEntity extends Entity
|
||||
$m = model(OrdenTrabajoTareaProgressDate::class);
|
||||
return $m->where('ot_tarea_id', $this->attributes["id"])->findAll() ?? [];
|
||||
}
|
||||
public function lastState(): ?OrdenTrabajoTareaProgressDateEntity
|
||||
{
|
||||
$m = model(OrdenTrabajoTareaProgressDate::class);
|
||||
$progressDates = $m->where('ot_tarea_id', $this->attributes["id"])->orderBy('action_at', 'DESC')->first();
|
||||
return $progressDates;
|
||||
}
|
||||
public function tiempo_trabajado()
|
||||
{
|
||||
$dates = $this->progress_dates();
|
||||
$intervals = [];
|
||||
$init = [];
|
||||
$end = [];
|
||||
$init = null;
|
||||
$end = null;
|
||||
foreach ($dates as $key => $date) {
|
||||
if ($date->estado == "I") {
|
||||
if ($date->action_at) {
|
||||
$init = Time::createFromFormat('Y-m-d H:i:s', $date->action_at);
|
||||
$init = $date->action_at;
|
||||
}
|
||||
}
|
||||
if ($date->estado == "S" || $date->estado == "F") {
|
||||
if ($date->action_at) {
|
||||
$end = Time::createFromFormat('Y-m-d H:i:s', $date->action_at);
|
||||
if ($date->action_at && $init) {
|
||||
$end = $date->action_at;
|
||||
$intervals[] = $init->difference($end)->getSeconds();
|
||||
}
|
||||
}
|
||||
@ -182,4 +218,24 @@ class OrdenTrabajoTareaEntity extends Entity
|
||||
}
|
||||
return $isTareaCosido;
|
||||
}
|
||||
public function isImpresion(): bool
|
||||
{
|
||||
return $this->attributes['presupuesto_linea_id'] != null;
|
||||
}
|
||||
public function isAcabado(): bool
|
||||
{
|
||||
return $this->attributes['presupuesto_acabado_id'] != null;
|
||||
}
|
||||
public function isManipulado(): bool
|
||||
{
|
||||
return $this->attributes['presupuesto_manipulado_id'] != null;
|
||||
}
|
||||
public function isEncuadernado(): bool
|
||||
{
|
||||
return $this->attributes['presupuesto_encuadernado_id'] != null;
|
||||
}
|
||||
public function isCorte(): bool
|
||||
{
|
||||
return $this->attributes['is_corte'];
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Entities\Produccion;
|
||||
|
||||
use App\Entities\Usuarios\UserEntity;
|
||||
use App\Models\OrdenTrabajo\OrdenTrabajoTarea;
|
||||
use CodeIgniter\Entity\Entity;
|
||||
|
||||
@ -20,12 +21,21 @@ class OrdenTrabajoTareaProgressDateEntity extends Entity
|
||||
/**
|
||||
* Orden de trabajo de la tarea
|
||||
*
|
||||
* @return OrdenTrabajoEntity
|
||||
* @return OrdenTrabajoTareaEntity
|
||||
*/
|
||||
public function orden_trabajo_tarea() : OrdenTrabajoTareaEntity
|
||||
{
|
||||
$m = model(OrdenTrabajoTarea::class);
|
||||
return $m->find($this->attributes["ot_tarea_id"]);
|
||||
}
|
||||
public function user() : ?UserEntity
|
||||
{
|
||||
$user = null;
|
||||
if($this->attributes['action_user_id'])
|
||||
{
|
||||
$user = auth()->getProvider()->findById($this->attributes['action_user_id']);
|
||||
}
|
||||
return $user;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -19,8 +19,13 @@ class OrdenTrabajoUserEntity extends Entity
|
||||
"interior_bn_user_id" => null,
|
||||
"interior_color_user_id" => null,
|
||||
"cubierta_user_id" => null,
|
||||
"sobrecubierta_user_id" => null,
|
||||
"guarda_user_id" => null,
|
||||
//ACABADO
|
||||
"plastificado_user_id" => null,
|
||||
"plakene_user_id" => null,
|
||||
"estampado_user_id" => null,
|
||||
"uvi_user_id" => null,
|
||||
"encuadernacion_user_id" => null,
|
||||
"corte_user_id" => null,
|
||||
"preparacion_interior_user_id" => null,
|
||||
|
||||
@ -24,11 +24,11 @@ class TarifaAcabadoEntity extends \CodeIgniter\Entity\Entity
|
||||
"deleted_at" => null,
|
||||
"created_at" => null,
|
||||
"updated_at" => null,
|
||||
'plastificado' => false,
|
||||
'plakene' => false,
|
||||
'rectractilado' => false,
|
||||
'estampado' => false,
|
||||
'uvi' => false,
|
||||
'plastificado' => null,
|
||||
'plakene' => null,
|
||||
'rectractilado' => null,
|
||||
'estampado' => null,
|
||||
'uvi' => null,
|
||||
'plastificado_tipo' => null,
|
||||
'plakene_tipo' => null,
|
||||
'rectractilado_tipo' => null,
|
||||
|
||||
45
ci4/app/Entities/Tarifas/Maquinas/MaquinaOtTareaEntity.php
Executable file
45
ci4/app/Entities/Tarifas/Maquinas/MaquinaOtTareaEntity.php
Executable file
@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entities\Tarifas\Maquinas;
|
||||
|
||||
use App\Entities\Configuracion\Maquina;
|
||||
use App\Entities\Produccion\OrdenTrabajoEntity;
|
||||
use App\Models\Configuracion\MaquinaModel;
|
||||
use App\Models\OrdenTrabajo\OrdenTrabajoModel;
|
||||
use CodeIgniter\Entity\Entity;
|
||||
|
||||
|
||||
class MaquinaOtTareaEntity extends Entity
|
||||
{
|
||||
protected $attributes = [
|
||||
"id" => null,
|
||||
"maquina_id" => null,
|
||||
"orden_trabajo_id" => null,
|
||||
];
|
||||
protected $casts = [
|
||||
"id" => "integer",
|
||||
"maquina_id" => "integer",
|
||||
"orden_trabajo_id" => "integer",
|
||||
];
|
||||
protected $dates = ['created_at', 'updated_at', 'deleted_at'];
|
||||
/**
|
||||
* Orden de trabajo
|
||||
*
|
||||
* @return OrdenTrabajoEntity
|
||||
*/
|
||||
public function orden_trabajo_tarea(): OrdenTrabajoEntity
|
||||
{
|
||||
$m = model(OrdenTrabajoModel::class);
|
||||
return $m->find($this->attributes["orden_trabajo_id"]);
|
||||
}
|
||||
/**
|
||||
* Maquina
|
||||
*
|
||||
* @return Maquina
|
||||
*/
|
||||
public function maquina(): Maquina
|
||||
{
|
||||
$m = model(MaquinaModel::class);
|
||||
return $m->find($this->attributes["maquina_id"]);
|
||||
}
|
||||
}
|
||||
@ -10,7 +10,17 @@ function float_seconds_to_hhmm_string(?float $time):?string
|
||||
}
|
||||
return $time_str;
|
||||
}
|
||||
|
||||
function float_seconds_to_hhmmss_string(?float $time): ?string
|
||||
{
|
||||
$time_str = null;
|
||||
if ($time !== null) {
|
||||
$hours = floor($time / 3600);
|
||||
$minutes = floor(($time % 3600) / 60);
|
||||
$seconds = floor($time % 60);
|
||||
$time_str = sprintf("%02d:%02d:%02d", $hours, $minutes, $seconds);
|
||||
}
|
||||
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"];
|
||||
|
||||
@ -722,6 +722,7 @@ return [
|
||||
|
||||
"menu_importadores" => "Importadores",
|
||||
"menu_importadores_catalogo" => "Desde catálogo",
|
||||
"menu_importadores_bubok" => "Bubok",
|
||||
|
||||
"menu_catalogo" => "Catálogo",
|
||||
"menu_catalogo_libros" => "Libros",
|
||||
@ -752,7 +753,7 @@ return [
|
||||
"menu_informes" => "Informes",
|
||||
|
||||
"menu_pedidos" => "Pedidos",
|
||||
"menu_pedidos_validacion" => "Validación",
|
||||
"menu_pedidos_validacion" => "Aprobación",
|
||||
"menu_pedidos_activos" => "Producción",
|
||||
"menu_pedidos_finalizados" => "Finalizados",
|
||||
"menu_pedidos_cancelados" => "Cancelados",
|
||||
|
||||
@ -46,6 +46,8 @@ return [
|
||||
'userCreatedId' => 'User Created ID',
|
||||
'userUpdateId' => 'User Update ID',
|
||||
'vencimiento' => 'Vencimiento',
|
||||
'removeEnvioBase' => 'No añadir Envio Base',
|
||||
'forzarRotativaPod' => 'Forzar rotativa en POD',
|
||||
|
||||
'direccionesEnvio' => 'Direcciones de Envío',
|
||||
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
return [
|
||||
'moduleTitle' => 'Importadores',
|
||||
'importadorCatalogoTitle' => 'Importador RA-MA Ediciones S.L.',
|
||||
'importadorBubokTitle' => 'Importador BUBOK Publishing S.L.',
|
||||
'catalogo' => 'catálogo',
|
||||
'input' => 'ISBN',
|
||||
'descripcion' => 'Título',
|
||||
@ -10,7 +11,8 @@ return [
|
||||
'cnt_pedida' => 'Unidades',
|
||||
'precio_compra' => 'Precio Compra',
|
||||
'importar' => 'Importar',
|
||||
'subirArchivo' => 'Cargar Excel proporcionado por RA-MA',
|
||||
'subirArchivoRama' => 'Cargar Excel proporcionado por RA-MA',
|
||||
'subirArchivoBubok' => 'Cargar XML proporcionado por BUBOK',
|
||||
|
||||
'libro' => 'libro',
|
||||
'id' => 'ID',
|
||||
|
||||
@ -65,16 +65,42 @@ return [
|
||||
'finalizarEnvio' => 'Finalizar envío',
|
||||
'finalizarEnvioYOTs' => 'Finalizar envío y OTS',
|
||||
|
||||
|
||||
'EtiquetasTitulos' => 'Etiquetas de títulos',
|
||||
'id' => 'ID',
|
||||
'otId' => 'OT ID',
|
||||
'num_caja' => 'Nº Caja',
|
||||
'unidadesTotalesOt' => 'Unidades totales OT',
|
||||
'numeroCajas' => 'Nº Cajas',
|
||||
'unidadesEnCaja' => 'Unidades en caja',
|
||||
'listadoEtiquetas' => 'Listado de etiquetas',
|
||||
'nuevaEtiqueta' => 'Nueva etiqueta',
|
||||
'cliente' => 'Cliente',
|
||||
'comentariosEtiqueta' => 'Comentarios etiqueta',
|
||||
'addLineaEtiqueta' => 'Añadir líneas a la etiqueta',
|
||||
'renumber' => 'Renumerar etiquetas',
|
||||
|
||||
'errors' => [
|
||||
'noEnvio' => 'No se ha encontrado el envio',
|
||||
'noEnvioLineas' => 'No se han encontrado líneas de envío',
|
||||
'noDataToFind' => 'No se ha introducido ningún dato para buscar',
|
||||
'notFound' => 'No se encuentra el pedido o ISBN, el pedido no está en producción o finalizado o no tiene envíos pendientes',
|
||||
'noAddresses' => 'El pedido no tiene direcciones de envío',
|
||||
'errorMissingData' => 'Faltan datos para crear la etiqueta',
|
||||
'errorInsertarEtiqueta' => 'Error al insertar la etiqueta',
|
||||
'noEtiqueta' => 'No se ha encontrado la etiqueta',
|
||||
'noEtiquetaLineas' => 'No se han encontrado líneas de etiqueta',
|
||||
],
|
||||
'success' => [
|
||||
'finalizado' => 'El envío se ha finalizado correctamente',
|
||||
'finalizadoOTs' => 'El envío se ha finalizado correctamente.\nSe han creado las OTs siguientes OTs: {ots}',
|
||||
'successDeleteEtiqueta' => 'Etiqueta eliminada correctamente',
|
||||
'successInsertLines' => 'Lineas de etiqueta insertadas correctamente',
|
||||
'successDeleteLines' => 'Lineas de etiqueta eliminadas correctamente',
|
||||
'successUpdateLine' => 'Linea de etiqueta actualizadas correctamente',
|
||||
'comentariosUpdated' => 'Comentarios actualizados correctamente',
|
||||
'successReordenarCajas' => 'Cajas reordenadas correctamente',
|
||||
'imprimirEtiquetas' => 'Etiquetas impresas correctamente',
|
||||
],
|
||||
|
||||
];
|
||||
@ -1,15 +1,27 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
"navs" => [
|
||||
'finalizadas' => 'Finalizadas',
|
||||
'pendientes' => 'Pendientes',
|
||||
'pendientes_ferro' => 'Ferro pendiente',
|
||||
'ferro_ok' => 'Ferro/Prototipo OK',
|
||||
'news' => 'Nuevas',
|
||||
'waiting' => 'En espera',
|
||||
'revision_com' => 'Revisión comercial',
|
||||
'prod' => 'Producción'
|
||||
],
|
||||
"datatable" => [
|
||||
"pedido_id"=> "Pedido ID",
|
||||
"fecha_encuadernacion"=> "Fecha encuadernación",
|
||||
"fecha_impresion"=> "Fecha impresión",
|
||||
"cliente"=> "Cliente",
|
||||
"titulo"=> "Título",
|
||||
"ubicacion"=> "Ubicación",
|
||||
"tirada"=> "Tirada",
|
||||
"impresion"=> "Impresión",
|
||||
"ot_id" => "OT ID",
|
||||
"barcode" => "Código",
|
||||
"pedido_id" => "Pedido ID",
|
||||
"fecha_encuadernacion" => "Fecha encuadernación",
|
||||
"fecha_impresion" => "Fecha impresió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",
|
||||
@ -31,8 +43,6 @@ return [
|
||||
"pliegos" => "Pliegos",
|
||||
"pliegos_libro" => "Pliegos",
|
||||
"fecha" => "fecha"
|
||||
|
||||
|
||||
],
|
||||
"task" => [
|
||||
"order" => "Orden",
|
||||
@ -43,12 +53,13 @@ return [
|
||||
"maquina_actual" => "Máquina actual",
|
||||
"tiempo_estimado" => "Tiempo estimado",
|
||||
"tiempo" => "Tiempo",
|
||||
"proveedor" => "Proveedor",
|
||||
"imposicion" => "Imposición"
|
||||
],
|
||||
"finalizadas" => "Finalizadas",
|
||||
"pendiente_ferro" => "Ferro pendiente",
|
||||
"pendientes" => "Pendientes",
|
||||
"ferro_ok" => "Ferro ok",
|
||||
"ferro_ok" => "Ferro/Prototipo ok",
|
||||
"envio" => "Envío",
|
||||
"ferro" => "Ferro",
|
||||
"ot" => "Orden trabajo",
|
||||
@ -70,6 +81,7 @@ return [
|
||||
"portada" => "portada",
|
||||
"plakene_traslucido" => "Plakene traslúcido",
|
||||
"plastificado_mate" => "Plastificado mate",
|
||||
"plastificado" => "Plastificado",
|
||||
"espiral" => "Espiral",
|
||||
"embalaje" => "Embalaje",
|
||||
"tiempo_consumido" => "Tiempo consumido",
|
||||
@ -80,12 +92,14 @@ return [
|
||||
"preview_pdf" => "Previsualizar PDF",
|
||||
"imprimir_codigo_safekat" => "Imprimir código SAFEKAT",
|
||||
"imprimir_ferro" => "Imprimir ferro",
|
||||
"imprimir_prototipo" => "Prototipo",
|
||||
"planning_rotativa" => "Planificación rotativa",
|
||||
"planning_plana" => "Planificación plana",
|
||||
"solapa" => "Solapa",
|
||||
"papel_gramajes" => "Papel y gramajes",
|
||||
"estado" => "Estado",
|
||||
"pedido_espera" => "Pedido en espera",
|
||||
"preimpresion_revisada" => "Preimpresión revisada",
|
||||
"imposicion_no_label" => "Sin etiqueta",
|
||||
"pliegos_de" => "pliegos de",
|
||||
"size" => "Tamaño",
|
||||
@ -97,19 +111,23 @@ return [
|
||||
"grapado" => "Grapado",
|
||||
"solapa" => "Solapas",
|
||||
"retractilado" => "Retractilado",
|
||||
"manipulado" => "Entrada manipulado",
|
||||
"retractilado5" => "Retractilado 5",
|
||||
"prototipo" => "Prototipo",
|
||||
"marcapaginas" => "Marcapáginas",
|
||||
//IMPRESION
|
||||
"impresion_bn" => "Impresión BN",
|
||||
"cubierta" => "Cubierta/Portada",
|
||||
"guarda" => "Guarda",
|
||||
"encuadernacion" => "Encuadernación",
|
||||
|
||||
//PREIMPRESION
|
||||
"pre_formato" => "Revisión formato",
|
||||
"pre_lomo" => "Revisión lomo",
|
||||
"pre_solapa" => "Revisión solapa",
|
||||
"pre_codbarras" => "Revisión código barras",
|
||||
"pre_imposicion" => "Revisión imposición",
|
||||
|
||||
|
||||
"iniciada" => "Iniciada",
|
||||
"finalizada" => "Finalizada",
|
||||
"error" => "Error",
|
||||
@ -121,7 +139,7 @@ return [
|
||||
"attr_not_exist" => "El atributo {0,string} no pertenece al modelo Pedido"
|
||||
|
||||
],
|
||||
|
||||
|
||||
"progress_ferro" => "Ferro",
|
||||
"progress_preimpresion" => "Preimpresión",
|
||||
"progress_logistica" => "Logística",
|
||||
@ -132,18 +150,54 @@ return [
|
||||
"maquinas" => "Máquinas",
|
||||
"tareas_hoy" => "Tareas para HOY",
|
||||
"tareas_all" => "Todas",
|
||||
"tareas_delay" => "Aplazadas",
|
||||
"play_tarea" => "Continuar",
|
||||
"play_pause" => "Pausar",
|
||||
"play_stop" => "Aplazar",
|
||||
"play_end" => "Finalizar",
|
||||
"cancel" => "Cancelar",
|
||||
"fichaje_auto" => "F.auto",
|
||||
"scan" => "Escanear",
|
||||
"tarea_list" => "Lista de tareas",
|
||||
"fichaje_auto_alert_text" => "Cada vez que introduza un nº de pedido se iniciará la tarea y se finalizará la tarea actual (del pedido anterior)",
|
||||
"next_ot" => "SIGUIENTE OT",
|
||||
"placeholder_ot_id" => "Introduce el ID de la OT",
|
||||
"fa_ot_input_form_text" => "Introduce una OT para terminar la actual e iniciar la siguiente.",
|
||||
"scan_ot_input_form_text" => "Introduce una OT para añadirla al proceso",
|
||||
"next_scan_ot" => "Comenzar",
|
||||
"reset" => "Resetear"
|
||||
|
||||
|
||||
],
|
||||
'tarea_estados' => [
|
||||
'P' => 'Pendiente',
|
||||
'I' => 'Iniciada',
|
||||
'F' => 'Finalizada',
|
||||
'S' => 'Pausada',
|
||||
'D' => 'Aplazada',
|
||||
'E' => 'Error'
|
||||
],
|
||||
'duplicate_estado_tarea_progress' => "Último estado de la tarea repetido",
|
||||
'task_already_finished' => "La tarea se ha marcado como finalizada.",
|
||||
'print_label' => "Imprimir etiqueta",
|
||||
'click_init' => "Clicks al inicio",
|
||||
'click_end' => "Clicks al final",
|
||||
"comentarios" => "Comentarios",
|
||||
"comentariosOt" => "Comentarios orden",
|
||||
"comentariosImpresionInterior" => "Comentarios interior",
|
||||
"comentariosCubierta" => "Comentarios cubierta",
|
||||
"comentariosEncuadernacion" => "Comentarios encuadernación",
|
||||
"comentariosLogistica" => "Comentarios logística",
|
||||
"info_solapa_guillotina" => "Datos solapa y preparación guillotina",
|
||||
"responses" => [
|
||||
"finish_maquina_ordenes_trabajo" => "Tareas finalizadas correctamente",
|
||||
"update_maquina_ordenes_trabajo_estado" => "Tareas actualizadas correctamente",
|
||||
|
||||
],
|
||||
"errors" => [
|
||||
"maquina_not_in_ot" => "Esta OT no tiene ninguna tarea con esta máquina",
|
||||
"tareas_finalizadas" => "Las tareas de esta OT y máquina están marcadas como finalizadas",
|
||||
"ot_not_found" => "La orden de trabajo número {ot_id} no existe"
|
||||
|
||||
];
|
||||
]
|
||||
];
|
||||
|
||||
@ -70,6 +70,7 @@ return [
|
||||
'catalogoSection' => 'Catálogo',
|
||||
'importadoresSection' => 'Importadores',
|
||||
'catalogoPermission' => 'Desde catálogo',
|
||||
'bubokPermission' => 'Bubok',
|
||||
|
||||
|
||||
|
||||
|
||||
@ -61,6 +61,8 @@ class ClienteModel extends \App\Models\BaseModel
|
||||
"comentarios",
|
||||
"user_created_id",
|
||||
"user_update_id",
|
||||
"no_envio_base",
|
||||
"forzar_rotativa_pod",
|
||||
];
|
||||
protected $returnType = ClienteEntity::class;
|
||||
protected $useSoftDeletes = true;
|
||||
|
||||
@ -214,4 +214,12 @@ class ProveedorModel extends \App\Models\BaseModel
|
||||
|
||||
return $builder->get()->getResultObject();
|
||||
}
|
||||
public function querySelect(?string $q)
|
||||
{
|
||||
$query = $this->builder()->select(['id','nombre as name']);
|
||||
if($q){
|
||||
$query->like('nombre',$q);
|
||||
}
|
||||
return $query;
|
||||
}
|
||||
}
|
||||
|
||||
@ -404,7 +404,9 @@ class MaquinaModel extends \App\Models\BaseModel
|
||||
->select([
|
||||
'lg_maquinas.id as maquinaId',
|
||||
'lg_maquinas.nombre',
|
||||
'COUNT(tarea_progress.ot_tarea_id) as countTareas'
|
||||
'COUNT(tarea_progress.ot_tarea_id) as countTareas',
|
||||
'COUNT(maquina_ot_tareas.orden_trabajo_id) as countMaquinaTareas'
|
||||
|
||||
])
|
||||
->join('orden_trabajo_tareas', 'orden_trabajo_tareas.maquina_id = lg_maquinas.id', 'left')
|
||||
->join(
|
||||
@ -420,6 +422,14 @@ class MaquinaModel extends \App\Models\BaseModel
|
||||
'tarea_progress.ot_tarea_id = orden_trabajo_tareas.id',
|
||||
'left'
|
||||
)
|
||||
->join(
|
||||
"(SELECT orden_trabajo_id,deleted_at,maquina_id
|
||||
FROM maquina_ot_tareas
|
||||
WHERE deleted_at is NULL
|
||||
) as maquina_ot_tareas",
|
||||
'maquina_ot_tareas.maquina_id = lg_maquinas.id',
|
||||
'left'
|
||||
)
|
||||
->join('ordenes_trabajo', 'ordenes_trabajo.id = orden_trabajo_tareas.orden_trabajo_id', 'left')
|
||||
->join('pedidos', 'pedidos.id = ordenes_trabajo.pedido_id', 'left')
|
||||
->where('lg_maquinas.tipo', $maquina_tipo)
|
||||
@ -427,6 +437,9 @@ class MaquinaModel extends \App\Models\BaseModel
|
||||
->where('tarea_progress.deleted_at', null)
|
||||
->groupBy('lg_maquinas.id')
|
||||
->orderBy('countTareas','DESC');
|
||||
if($maquina_tipo == "impresion"){
|
||||
$query->where('orden_trabajo_tareas.is_corte',0);
|
||||
}
|
||||
|
||||
return $query;
|
||||
}
|
||||
|
||||
66
ci4/app/Models/Configuracion/MaquinaOtTareaModel.php
Executable file
66
ci4/app/Models/Configuracion/MaquinaOtTareaModel.php
Executable file
@ -0,0 +1,66 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Configuracion;
|
||||
|
||||
use App\Entities\Tarifas\Maquinas\MaquinaOtTareaEntity;
|
||||
use App\Entities\Tarifas\Maquinas\TareaMaquinaEntity;
|
||||
|
||||
use CodeIgniter\Model;
|
||||
|
||||
class MaquinaOtTareaModel extends Model
|
||||
{
|
||||
protected $table = 'maquina_ot_tareas';
|
||||
protected $primaryKey = 'id';
|
||||
protected $useAutoIncrement = true;
|
||||
protected $returnType = MaquinaOtTareaEntity::class;
|
||||
protected $useSoftDeletes = true;
|
||||
protected $protectFields = true;
|
||||
protected $allowedFields = [
|
||||
"maquina_id",
|
||||
"orden_trabajo_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 = [];
|
||||
|
||||
public function queryDatatableJoinOrdenTrabajo($maquina_id){
|
||||
return $this->builder()
|
||||
->select([
|
||||
'maquina_ot_tareas.id as maquinaOtTareaId',
|
||||
'ordenes_trabajo.id as otId'
|
||||
])
|
||||
->join('ordenes_trabajo','ordenes_trabajo.id = maquina_ot_tareas.orden_trabajo_id','left')
|
||||
->where('maquina_ot_tareas.maquina_id',$maquina_id)
|
||||
->where('maquina_ot_tareas.deleted_at',null);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
108
ci4/app/Models/Etiquetas/EtiquetasTitulosLineasModel.php
Normal file
108
ci4/app/Models/Etiquetas/EtiquetasTitulosLineasModel.php
Normal file
@ -0,0 +1,108 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Etiquetas;
|
||||
|
||||
use CodeIgniter\Model;
|
||||
use App\Entities\Etiquetas\EtiquetaTituloLinea;
|
||||
|
||||
class EtiquetasTitulosLineasModel extends Model
|
||||
{
|
||||
protected $table = 'etiquetas_titulos_lineas';
|
||||
protected $primaryKey = 'id';
|
||||
protected $useAutoIncrement = true;
|
||||
|
||||
protected $returnType = EtiquetaTituloLinea::class;
|
||||
protected $useSoftDeletes = true;
|
||||
|
||||
protected $allowedFields = [
|
||||
'etiqueta_titulos_id',
|
||||
'ot_id',
|
||||
'unidades',
|
||||
'numero_caja',
|
||||
'user_created_at',
|
||||
'user_updated_at',
|
||||
'user_deleted_at',
|
||||
];
|
||||
|
||||
protected $useTimestamps = true;
|
||||
protected $createdField = 'created_at';
|
||||
protected $updatedField = 'updated_at';
|
||||
protected $deletedField = 'deleted_at';
|
||||
|
||||
protected $validationRules = [];
|
||||
protected $validationMessages = [];
|
||||
protected $skipValidation = false;
|
||||
|
||||
protected $beforeDelete = ['addUserDeleted'];
|
||||
protected $beforeUpdate = ['addUserUpdated'];
|
||||
|
||||
protected function addUserDeleted(array $data)
|
||||
{
|
||||
$userId = auth()->user()->id;
|
||||
|
||||
if (!isset($data['data'])) {
|
||||
$data['data'] = [];
|
||||
}
|
||||
|
||||
if (!empty($data['id'])) {
|
||||
$builder = $this->builder();
|
||||
$builder->whereIn($this->primaryKey, (array) $data['id'])
|
||||
->update(['user_deleted_at' => $userId]);
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
|
||||
protected function addUserUpdated(array $data)
|
||||
{
|
||||
$userId = auth()->user()->id;
|
||||
|
||||
if (!isset($data['data'])) {
|
||||
$data['data'] = [];
|
||||
}
|
||||
|
||||
if (!empty($data['id'])) {
|
||||
$builder = $this->builder();
|
||||
$builder->whereIn($this->primaryKey, (array) $data['id'])
|
||||
->update(['user_updated_at' => $userId]);
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function getDatatableQuery($etiqueta_id, $direccion = null)
|
||||
{
|
||||
$direccionNormalizada = str_replace(' ', '', strtolower(trim($direccion)));
|
||||
|
||||
// Subconsulta: suma de pesos por presupuesto
|
||||
$subPeso = $this->db->table('presupuesto_linea')
|
||||
->select('presupuesto_id, ROUND(SUM(peso)/1000, 2) as pesoUnidad')
|
||||
->groupBy('presupuesto_id');
|
||||
|
||||
$builder = $this->db->table('etiquetas_titulos_lineas etl')
|
||||
->select('
|
||||
etl.id as id,
|
||||
etl.ot_id as ot,
|
||||
pr.titulo as titulo,
|
||||
etl.unidades as unidades,
|
||||
etl.numero_caja as numero_caja,
|
||||
etl.numero_caja as numero_caja_raw,
|
||||
pd.cantidad as unidadesTotal,
|
||||
etl.id as id,
|
||||
etl.unidades as unidadesRaw,
|
||||
peso_sub.pesoUnidad
|
||||
')
|
||||
->join('etiquetas_titulos et', 'et.id = etl.etiqueta_titulos_id')
|
||||
->join('ordenes_trabajo ot', 'ot.id = etl.ot_id')
|
||||
->join('pedidos p', 'p.id = ot.pedido_id')
|
||||
->join('pedidos_linea pl', 'pl.pedido_id = p.id')
|
||||
->join('presupuestos pr', 'pr.id = pl.presupuesto_id')
|
||||
->join("({$subPeso->getCompiledSelect()}) as peso_sub", 'peso_sub.presupuesto_id = pr.id', 'left')
|
||||
->join('presupuesto_direcciones pd', 'pd.presupuesto_id = pr.id')
|
||||
->where('etl.deleted_at IS NULL')
|
||||
->where('et.id', $etiqueta_id)
|
||||
->where("REPLACE(LOWER(TRIM(pd.direccion)), ' ', '') = '{$direccionNormalizada}'", null, false)
|
||||
->orderBy('etl.numero_caja');
|
||||
|
||||
return $builder;
|
||||
}
|
||||
|
||||
}
|
||||
82
ci4/app/Models/Etiquetas/EtiquetasTitulosModel.php
Normal file
82
ci4/app/Models/Etiquetas/EtiquetasTitulosModel.php
Normal file
@ -0,0 +1,82 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Etiquetas;
|
||||
|
||||
use CodeIgniter\Model;
|
||||
use App\Entities\Etiquetas\EtiquetaTitulo;
|
||||
|
||||
class EtiquetasTitulosModel extends Model
|
||||
{
|
||||
protected $table = 'etiquetas_titulos';
|
||||
protected $primaryKey = 'id';
|
||||
protected $useAutoIncrement = true;
|
||||
|
||||
protected $returnType = EtiquetaTitulo::class;
|
||||
protected $useSoftDeletes = true;
|
||||
|
||||
protected $allowedFields = [
|
||||
'comentarios',
|
||||
'direccion',
|
||||
'att',
|
||||
'cliente_id',
|
||||
'user_created_at',
|
||||
'user_updated_at',
|
||||
'user_deleted_at',
|
||||
];
|
||||
|
||||
protected $useTimestamps = true;
|
||||
protected $createdField = 'created_at';
|
||||
protected $updatedField = 'updated_at';
|
||||
protected $deletedField = 'deleted_at';
|
||||
|
||||
protected $validationRules = [];
|
||||
protected $validationMessages = [];
|
||||
protected $skipValidation = false;
|
||||
|
||||
|
||||
protected $beforeDelete = ['addUserDeleted'];
|
||||
protected $beforeUpdate = ['addUserUpdated'];
|
||||
|
||||
protected function addUserDeleted(array $data)
|
||||
{
|
||||
$userId = auth()->user()->id;
|
||||
|
||||
if (!isset($data['data'])) {
|
||||
$data['data'] = [];
|
||||
}
|
||||
|
||||
if (!empty($data['id'])) {
|
||||
$builder = $this->builder();
|
||||
$builder->whereIn($this->primaryKey, (array) $data['id'])
|
||||
->update(['user_deleted_at' => $userId]);
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
|
||||
protected function addUserUpdated(array $data)
|
||||
{
|
||||
$userId = auth()->user()->id;
|
||||
|
||||
if (!isset($data['data'])) {
|
||||
$data['data'] = [];
|
||||
}
|
||||
|
||||
if (!empty($data['id'])) {
|
||||
$builder = $this->builder();
|
||||
$builder->whereIn($this->primaryKey, (array) $data['id'])
|
||||
->update(['user_updated_at' => $userId]);
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function getEtiquetasTitulos()
|
||||
{
|
||||
return $this->db->table('etiquetas_titulos et')
|
||||
->select('et.id, GROUP_CONCAT(DISTINCT etl.ot_id ORDER BY etl.ot_id ASC SEPARATOR ", ") as lista_ots')
|
||||
->select('COUNT(DISTINCT etl.numero_caja) as cajas, et.att, et.direccion')
|
||||
->join('etiquetas_titulos_lineas etl', 'etl.etiqueta_titulos_id = et.id')
|
||||
->where('et.deleted_at IS NULL')
|
||||
->where('etl.deleted_at IS NULL')
|
||||
->groupBy('et.id, et.att, et.direccion');
|
||||
}
|
||||
}
|
||||
@ -22,8 +22,14 @@ class OrdenTrabajoDate extends Model
|
||||
"interior_bn_at",
|
||||
"interior_color_at",
|
||||
"cubierta_at",
|
||||
"sobrecubierta_at", //TODO
|
||||
"guarda_at", //TODO
|
||||
//ACABADO
|
||||
"plastificado_at",
|
||||
"plakene_at", //TODO
|
||||
"retractilado_at",
|
||||
"estampado_at", //TODO
|
||||
"uvi_at", //TODO
|
||||
"encuadernacion_at",
|
||||
"corte_at",
|
||||
"preparacion_interiores_at",
|
||||
@ -31,7 +37,6 @@ class OrdenTrabajoDate extends Model
|
||||
"cosido_at",
|
||||
"solapa_at",
|
||||
"grapado_at",
|
||||
"retractilado_at",
|
||||
"retractilado5_at",
|
||||
"prototipo_at",
|
||||
"marcapaginas_at",
|
||||
|
||||
@ -5,6 +5,7 @@ namespace App\Models\OrdenTrabajo;
|
||||
use App\Entities\Produccion\OrdenTrabajoEntity;
|
||||
use CodeIgniter\Database\BaseBuilder;
|
||||
use CodeIgniter\Model;
|
||||
|
||||
class OrdenTrabajoModel extends Model
|
||||
{
|
||||
protected $table = 'ordenes_trabajo';
|
||||
@ -25,6 +26,11 @@ class OrdenTrabajoModel extends Model
|
||||
"progreso",
|
||||
"estado",
|
||||
"comentarios",
|
||||
"comment_interior",
|
||||
"comment_cubierta",
|
||||
"comment_encuadernacion",
|
||||
"comment_logistica",
|
||||
"info_solapa_guillotina",
|
||||
"revisar_formato",
|
||||
"revisar_lomo",
|
||||
"revisar_solapa",
|
||||
@ -34,7 +40,10 @@ class OrdenTrabajoModel extends Model
|
||||
"enviar_impresion",
|
||||
"portada_path",
|
||||
"is_pedido_espera",
|
||||
"pedido_espera_by"
|
||||
"pedido_espera_by",
|
||||
"preimpresion_revisada",
|
||||
"preimpresion_revisada_by",
|
||||
|
||||
];
|
||||
|
||||
protected bool $allowEmptyInserts = false;
|
||||
@ -67,41 +76,71 @@ class OrdenTrabajoModel extends Model
|
||||
protected $beforeDelete = [];
|
||||
protected $afterDelete = [];
|
||||
|
||||
public function getDatatableQuery() : BaseBuilder
|
||||
public function getDatatableQuery(): BaseBuilder
|
||||
{
|
||||
$q = $this->builder()
|
||||
->select([
|
||||
"ordenes_trabajo.id",
|
||||
"ordenes_trabajo.pedido_id",
|
||||
"pedidos.fecha_encuadernado as 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",
|
||||
"CONCAT(lg_imposiciones.ancho,'x',lg_imposiciones.alto,'_',COALESCE(lg_imposiciones.unidades,'NULL'),'_',COALESCE(lg_imposiciones.orientacion,'NULL')) as imposicion_name"
|
||||
->select([
|
||||
"ordenes_trabajo.id",
|
||||
"ordenes_trabajo.pedido_id",
|
||||
"pedidos.fecha_encuadernado as 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",
|
||||
"CONCAT(lg_imposiciones.ancho,'x',lg_imposiciones.alto,'_',COALESCE(lg_imposiciones.unidades,'NULL'),'_',COALESCE(lg_imposiciones.orientacion,'NULL')) as imposicion_name"
|
||||
|
||||
])
|
||||
->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")
|
||||
->join("orden_trabajo_tareas","orden_trabajo_tareas.orden_trabajo_id = ordenes_trabajo.id","left")
|
||||
->join("lg_imposiciones","lg_imposiciones.id = orden_trabajo_tareas.imposicion_id","left")
|
||||
])
|
||||
->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")
|
||||
->join("orden_trabajo_tareas", "orden_trabajo_tareas.orden_trabajo_id = ordenes_trabajo.id", "left")
|
||||
->join("lg_imposiciones", "lg_imposiciones.id = orden_trabajo_tareas.imposicion_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");
|
||||
->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 queryMaquinaTareas(int $maquina_id, ?array $tareaEstados = null)
|
||||
{
|
||||
$query = $this->builder()->select([
|
||||
'orden_trabajo_tareas.*',
|
||||
'tarea_progress.estado'
|
||||
])
|
||||
->join('orden_trabajo_tareas', 'orden_trabajo_tareas.orden_trabajo_id = ordenes_trabajo.id', 'left')
|
||||
->join('lg_maquinas', 'orden_trabajo_tareas.maquina_id = lg_maquinas.id', 'left');
|
||||
//* Obtener el ultimo estado de la tarea
|
||||
if ($tareaEstados) {
|
||||
$query->join(
|
||||
'(SELECT ot_tarea_id, estado
|
||||
FROM orden_trabajo_tarea_progress_dates
|
||||
WHERE (ot_tarea_id, created_at) IN (
|
||||
SELECT ot_tarea_id, MAX(created_at)
|
||||
FROM orden_trabajo_tarea_progress_dates
|
||||
GROUP BY ot_tarea_id
|
||||
)
|
||||
) as tarea_progress',
|
||||
'tarea_progress.ot_tarea_id = orden_trabajo_tareas.id',
|
||||
'left'
|
||||
)
|
||||
->groupStart()
|
||||
->whereIn('tarea_progress.estado', $tareaEstados)
|
||||
->orWhere('tarea_progress.estado',null)
|
||||
->groupEnd();
|
||||
}
|
||||
$query->where('orden_trabajo_tareas.deleted_at', null)
|
||||
->where('lg_maquinas.id', $maquina_id)
|
||||
->groupBy('orden_trabajo_tareas.id');
|
||||
return $query;
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
namespace App\Models\OrdenTrabajo;
|
||||
|
||||
use App\Entities\Produccion\OrdenTrabajoTareaEntity;
|
||||
use App\Entities\Produccion\OrdenTrabajoTareaProgressDateEntity;
|
||||
use CodeIgniter\Database\MySQLi\Builder;
|
||||
use CodeIgniter\Model;
|
||||
|
||||
@ -11,7 +12,7 @@ class OrdenTrabajoTareaProgressDate extends Model
|
||||
protected $table = 'orden_trabajo_tarea_progress_dates';
|
||||
protected $primaryKey = 'id';
|
||||
protected $useAutoIncrement = true;
|
||||
protected $returnType = OrdenTrabajoTareaEntity::class;
|
||||
protected $returnType = OrdenTrabajoTareaProgressDateEntity::class;
|
||||
protected $useSoftDeletes = true;
|
||||
protected $protectFields = true;
|
||||
protected $allowedFields = [
|
||||
|
||||
@ -23,11 +23,18 @@ class OrdenTrabajoUser extends Model
|
||||
"interior_bn_user_id",
|
||||
"interior_color_user_id",
|
||||
"cubierta_user_id",
|
||||
"sobrecubierta_user_id",
|
||||
"guarda_user_id",
|
||||
//ACABADO
|
||||
"plastificado_user_id",
|
||||
"plakene_user_id",
|
||||
"retractilado_user_id",
|
||||
"estampado_user_id",
|
||||
"uvi_user_id",
|
||||
//ENCUADERNADO
|
||||
"encuadernacion_user_id",
|
||||
"corte_user_id",
|
||||
"preparacion_interior_user_id",
|
||||
"corte_user_id",
|
||||
"entrada_manipulado_user_id",
|
||||
"cosido_user_id",
|
||||
"solapa_user_id",
|
||||
|
||||
@ -9,11 +9,11 @@ class EmailService
|
||||
public function send(string $subject, string $body, $recipient): bool
|
||||
{
|
||||
|
||||
$skEnv = env('sk_environment', 'production'); // fallback a producción si no está definido
|
||||
$skEnv = env('SK_ENVIRONMENT', 'production'); // fallback a producción si no está definido
|
||||
|
||||
// Si no estamos en producción, forzar el destinatario a uno fijo
|
||||
if ($skEnv !== 'production') {
|
||||
$recipient = 'imnavajas@coit.es'; // <-- Cambia por el correo de pruebas
|
||||
$recipient = env('MAIL_DEV_RECIPIENT', 'imnavajas@coit.es'); // fallback opcional
|
||||
}
|
||||
|
||||
$settings_model = model('App\Models\Configuracion\ConfigVariableModel');
|
||||
|
||||
364
ci4/app/Services/EtiquetasTitulosService.php
Normal file
364
ci4/app/Services/EtiquetasTitulosService.php
Normal file
@ -0,0 +1,364 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services;
|
||||
|
||||
use Config\Services;
|
||||
|
||||
class EtiquetasTitulosService
|
||||
{
|
||||
|
||||
public static function getOtsWithTitulos()
|
||||
{
|
||||
|
||||
$db = \Config\Database::connect();
|
||||
|
||||
// 3. Subconsulta principal
|
||||
$builder = $db->table('ordenes_trabajo ot')
|
||||
->select("
|
||||
ot.id AS id,
|
||||
CONCAT('[', ot.id, '] - ', pr.titulo) AS name")
|
||||
->join('pedidos p', 'p.id = ot.pedido_id')
|
||||
->join('pedidos_linea pl', 'p.id = pl.pedido_id')
|
||||
->join('presupuestos pr', 'pr.id = pl.presupuesto_id')
|
||||
->join('orden_trabajo_dates ot_dates', 'ot_dates.orden_trabajo_id = ot.id')
|
||||
->whereIn('p.estado', ['finalizado', 'produccion']);
|
||||
|
||||
return $builder;
|
||||
}
|
||||
|
||||
public static function getDireccionesOT($ot_id)
|
||||
{
|
||||
|
||||
$db = \Config\Database::connect();
|
||||
|
||||
// 3. Subconsulta principal
|
||||
$builder = $db->table('presupuesto_direcciones pd')
|
||||
->select("
|
||||
pd.id AS id,
|
||||
pd.direccion AS name")
|
||||
->join('presupuestos pr', 'pr.id = pd.presupuesto_id')
|
||||
->join('pedidos_linea pl', 'pr.id = pl.presupuesto_id')
|
||||
->join('pedidos p', 'p.id = pl.pedido_id')
|
||||
->join('ordenes_trabajo ot', 'ot.pedido_id = p.id')
|
||||
->join('orden_trabajo_dates ot_dates', 'ot_dates.orden_trabajo_id = ot.id')
|
||||
->whereIn('p.estado', ['finalizado', 'produccion'])
|
||||
->where('ot.id', $ot_id);
|
||||
|
||||
return $builder;
|
||||
}
|
||||
|
||||
public static function addEtiqueta($data)
|
||||
{
|
||||
$db = \Config\Database::connect();
|
||||
|
||||
$builder = $db->table('presupuesto_direcciones pd');
|
||||
$builder->select('pd.att, pd.direccion, pd.cantidad, pr.cliente_id');
|
||||
$builder->join('presupuestos pr', 'pr.id = pd.presupuesto_id');
|
||||
$builder->join('pedidos_linea pl', 'pr.id = pl.presupuesto_id');
|
||||
$builder->join('pedidos p', 'p.id = pl.pedido_id');
|
||||
$builder->join('ordenes_trabajo ot', 'ot.pedido_id = p.id');
|
||||
$builder->where('ot.id', $data['ot_id']);
|
||||
$builder->where('pd.direccion', $data['direccion']);
|
||||
|
||||
$result = $builder->get()->getRow();
|
||||
$data['att'] = $result->att;
|
||||
$data['direccion'] = $result->direccion;
|
||||
$data['cantidad'] = $result->cantidad;
|
||||
$data['cliente_id'] = $result->cliente_id;
|
||||
|
||||
$modelEtiquetasTitulos = model('App\Models\Etiquetas\EtiquetasTitulosModel');
|
||||
$modelEtiquetasTitulos->insert([
|
||||
'direccion' => $data['direccion'],
|
||||
'att' => $data['att'],
|
||||
'cliente_id' => $data['cliente_id'],
|
||||
'user_created_at' => $data['user_id'],
|
||||
]);
|
||||
$etiquetaId = $modelEtiquetasTitulos->getInsertID();
|
||||
|
||||
if ($etiquetaId == null) {
|
||||
return [
|
||||
'status' => false,
|
||||
'message' => lang('Logistica.errorInsertarEtiqueta'),
|
||||
];
|
||||
}
|
||||
|
||||
$cantidad_restante = intval($data['cantidad']);
|
||||
$numero_caja = 1;
|
||||
while ($cantidad_restante > 0) {
|
||||
$modelEtiquetasTitulosLineas = model('App\Models\Etiquetas\EtiquetasTitulosLineasModel');
|
||||
$modelEtiquetasTitulosLineas->insert([
|
||||
'etiqueta_titulos_id' => $etiquetaId,
|
||||
'ot_id' => $data['ot_id'],
|
||||
'unidades' => $cantidad_restante - intval($data['unidades_caja']) < 0 ? $cantidad_restante : intval($data['unidades_caja']),
|
||||
'numero_caja' => $numero_caja,
|
||||
'user_created_at' => $data['user_id'],
|
||||
]);
|
||||
$cantidad_restante -= $data['unidades_caja'];
|
||||
$numero_caja++;
|
||||
}
|
||||
|
||||
|
||||
return [
|
||||
'status' => true,
|
||||
'etiqueta' => $etiquetaId,
|
||||
];
|
||||
}
|
||||
|
||||
public static function findOTsWithAddress(int $etiqueta_id)
|
||||
{
|
||||
$db = \Config\Database::connect();
|
||||
|
||||
// 1. Dirección del envío actual
|
||||
$etiqueta = $db->table('etiquetas_titulos')->select('direccion')->where('id', $etiqueta_id)->get()->getRow();
|
||||
if (!$etiqueta) {
|
||||
return $db->table('(SELECT NULL AS id, NULL AS name, NULL as unidades) AS empty')->where('1 = 0');
|
||||
}
|
||||
|
||||
$direccionNormalizada = str_replace(' ', '', strtolower(trim($etiqueta->direccion)));
|
||||
$direccionSQL = $db->escape($direccionNormalizada);
|
||||
|
||||
// 2. Obtener presupuestos con esa dirección
|
||||
$presupuestosConEsaDireccion = $db->table('presupuesto_direcciones')
|
||||
->select('presupuesto_id')
|
||||
->where("REPLACE(LOWER(TRIM(direccion)), ' ', '') = $direccionSQL", null, false)
|
||||
->get()
|
||||
->getResultArray();
|
||||
|
||||
$presupuestoIds = array_column($presupuestosConEsaDireccion, 'presupuesto_id');
|
||||
if (empty($presupuestoIds)) {
|
||||
return $db->table('(SELECT NULL AS id, NULL AS name, NULL as unidades) AS empty')->where('1 = 0');
|
||||
}
|
||||
|
||||
// 3. Subconsulta principal
|
||||
$subBuilder = $db->table('pedidos_linea pl')
|
||||
->select("
|
||||
ot.id AS id,
|
||||
CONCAT('[', ot.id, '] - ', pr.titulo) AS name,
|
||||
pd.cantidad AS description
|
||||
")
|
||||
->join('pedidos p', 'p.id = pl.pedido_id')
|
||||
->join('presupuestos pr', 'pr.id = pl.presupuesto_id')
|
||||
->join('presupuesto_direcciones pd', 'pd.presupuesto_id = pr.id')
|
||||
->join('ordenes_trabajo ot', 'ot.pedido_id = p.id')
|
||||
->join('orden_trabajo_dates ot_dates', 'ot_dates.orden_trabajo_id = ot.id')
|
||||
->whereIn('pr.id', $presupuestoIds)
|
||||
->whereIn('p.estado', ['finalizado', 'produccion'])
|
||||
->groupBy('pl.id');
|
||||
|
||||
// 4. Envolver y filtrar por unidades pendientes
|
||||
$builder = $db->table("({$subBuilder->getCompiledSelect(false)}) AS sub");
|
||||
$builder->select('id, name, description');
|
||||
|
||||
return $builder;
|
||||
}
|
||||
|
||||
public static function addLineasEtiqueta($etiqueta_id, $ot_id, $unidades, $cajas)
|
||||
{
|
||||
|
||||
$unidades_caja = intdiv($unidades, $cajas);
|
||||
$unidades_caja = $unidades_caja == 0 ? $unidades : $unidades_caja;
|
||||
|
||||
$unidades_restantes = $unidades;
|
||||
|
||||
$modelEtitquetaLinea = model('\App\Models\Etiquetas\EtiquetasTitulosLineasModel');
|
||||
$next_caja = $modelEtitquetaLinea
|
||||
->selectMax('numero_caja')
|
||||
->where('etiqueta_titulos_id', $etiqueta_id)
|
||||
->first();
|
||||
$next_caja = $next_caja->numero_caja ?? 0;
|
||||
$next_caja++;
|
||||
|
||||
$user_id = auth()->user()->id;
|
||||
|
||||
while ($unidades_restantes > 0) {
|
||||
$modelEtitquetaLinea->insert([
|
||||
'etiqueta_titulos_id' => $etiqueta_id,
|
||||
'ot_id' => $ot_id,
|
||||
'unidades' => $unidades_restantes - $unidades_caja < 0 ? $unidades_restantes : intval($unidades_caja),
|
||||
'numero_caja' => $next_caja,
|
||||
'user_created_at' => $user_id,
|
||||
]);
|
||||
$unidades_restantes -= $unidades_caja;
|
||||
$next_caja++;
|
||||
}
|
||||
|
||||
return [
|
||||
'status' => true,
|
||||
'message' => lang('Logistica.success.successInsertLines'),
|
||||
];
|
||||
|
||||
}
|
||||
|
||||
public static function reordenarCajas($etiqueta_id)
|
||||
{
|
||||
$model = model('App\Models\Etiquetas\EtiquetasTitulosLineasModel');
|
||||
|
||||
// 1. Obtener todas las líneas ordenadas por numero_caja e id
|
||||
$lineas = $model
|
||||
->where('etiqueta_titulos_id', $etiqueta_id)
|
||||
->orderBy('numero_caja ASC')
|
||||
->orderBy('id ASC')
|
||||
->findAll();
|
||||
|
||||
// 2. Agrupar por caja
|
||||
$grupos = [];
|
||||
foreach ($lineas as $linea) {
|
||||
$grupos[$linea->numero_caja][] = $linea;
|
||||
}
|
||||
|
||||
// 3. Reasignar números de caja de forma consecutiva
|
||||
$nuevoNumeroCaja = 1;
|
||||
foreach ($grupos as $grupo) {
|
||||
foreach ($grupo as $linea) {
|
||||
$model->update($linea->id, ['numero_caja' => $nuevoNumeroCaja]);
|
||||
|
||||
}
|
||||
$nuevoNumeroCaja++;
|
||||
}
|
||||
|
||||
return [
|
||||
'status' => true,
|
||||
'message' => lang('Logistica.success.successReordenarCajas'),
|
||||
];
|
||||
}
|
||||
|
||||
public static function imprimirEtiquetas($etiqueta_id = null, $ids = [], $printer = null){
|
||||
|
||||
$model = model('App\Models\Etiquetas\EtiquetasTitulosModel');
|
||||
$modelLineas = model('App\Models\Etiquetas\EtiquetasTitulosLineasModel');
|
||||
|
||||
if ($etiqueta_id) {
|
||||
$etiquetas = $model->where('id', $etiqueta_id)->first();
|
||||
$etiquetas_lineas = $modelLineas->whereIn('id', $ids)->orderBy('numero_caja', 'ASC')->findAll();
|
||||
}
|
||||
|
||||
// buscar el maximo numero_cajas en el array de objetos etiquetas_lineas
|
||||
$max_num_cajas = 0;
|
||||
foreach ($etiquetas_lineas as $linea) {
|
||||
if ($linea->numero_caja > $max_num_cajas) {
|
||||
$max_num_cajas = $linea->numero_caja;
|
||||
}
|
||||
}
|
||||
|
||||
// se obtienen los numero_caja diferentes en un array
|
||||
$numero_cajas = [];
|
||||
foreach ($etiquetas_lineas as $linea) {
|
||||
if (!in_array($linea->numero_caja, $numero_cajas)) {
|
||||
$numero_cajas[] = $linea->numero_caja;
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($etiquetas)) {
|
||||
return [
|
||||
'status' => false,
|
||||
'message' => lang('Logistica.errors.noEtiqueta'),
|
||||
];
|
||||
}
|
||||
if (empty($etiquetas_lineas)) {
|
||||
return [
|
||||
'status' => false,
|
||||
'message' => lang('Logistica.errors.noEtiquetaLineas'),
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
$data = [
|
||||
"printer" => $printer->name,
|
||||
"header" => [
|
||||
"_FORMAT" => "E:MULTI.ZPL",
|
||||
"_QUANTITY" => 1,
|
||||
"_PRINBTERNAME" => $printer->name,
|
||||
"_JOBNAME" => "LBL101"
|
||||
],
|
||||
'direccion' => $etiquetas->direccion,
|
||||
'grupos' => [],
|
||||
'notas' => $etiquetas->comentarios,
|
||||
'nombre' => $etiquetas->att,
|
||||
];
|
||||
|
||||
|
||||
$index_etiqueta = 0;
|
||||
foreach ($numero_cajas as $caja) {
|
||||
|
||||
array_push($data['grupos'], [
|
||||
]);
|
||||
|
||||
$prefix = 1;
|
||||
$lineas = array_filter($etiquetas_lineas, function ($linea) use ($caja) {
|
||||
return $linea->numero_caja == $caja;
|
||||
});
|
||||
|
||||
$lineaCounter = 0;
|
||||
foreach($lineas as $linea){
|
||||
|
||||
|
||||
if($lineaCounter >= 5){
|
||||
$lineaCounter = 0;
|
||||
$index_etiqueta++;
|
||||
array_push($data['grupos'], []);
|
||||
}
|
||||
|
||||
$modelPresupuestos = model('App\Models\OrdenTrabajo\OrdenTrabajoModel');
|
||||
$datos_etiqueta = $modelPresupuestos->select('
|
||||
pr.titulo as titulo,
|
||||
pr.isbn as isbn,
|
||||
pr.referencia_cliente as referencia_cliente,
|
||||
p.id as id_pedido,
|
||||
ordenes_trabajo.total_tirada as total_tirada,')
|
||||
->join('pedidos p', 'p.id = ordenes_trabajo.pedido_id')
|
||||
->join('pedidos_linea pl', 'pl.pedido_id = p.id')
|
||||
->join('presupuestos pr', 'pr.id = pl.presupuesto_id')
|
||||
->where('ordenes_trabajo.id',$linea->ot_id)->first();
|
||||
|
||||
|
||||
|
||||
$data['grupos'][$index_etiqueta][] = [
|
||||
'prefix' => $caja,
|
||||
'titulo' => mb_substr($datos_etiqueta->titulo, 0, 40),
|
||||
'cantidad' => $linea->unidades,
|
||||
'tirada' => $datos_etiqueta->total_tirada,
|
||||
'ean' => str_replace('-', '', $datos_etiqueta->isbn),
|
||||
'npedido' => $datos_etiqueta->id,
|
||||
'refcliente' => $datos_etiqueta->referencia_cliente,
|
||||
];
|
||||
|
||||
$lineaCounter++;
|
||||
}
|
||||
$index_etiqueta++;
|
||||
}
|
||||
|
||||
$servicioImpresora = new ImpresoraEtiquetaService();
|
||||
$xml = $servicioImpresora->createEtiquetaTitulos($data);
|
||||
if ($xml == null) {
|
||||
return [
|
||||
'status' => false,
|
||||
'message' => lang('Logistica.errors.noEtiquetas'),
|
||||
];
|
||||
}
|
||||
$sk_environment = getenv('SK_ENVIRONMENT');
|
||||
if ($sk_environment == 'production') {
|
||||
|
||||
$status = $servicioImpresora->sendToImpresoraEtiqueta("ETIQUETA", $xml, $printer);
|
||||
if ($status) {
|
||||
return [
|
||||
'status' => true,
|
||||
'message' => lang('Logistica.success.imprimirEtiquetas'),
|
||||
];
|
||||
} else {
|
||||
return [
|
||||
'status' => false,
|
||||
'message' => lang('Logistica.errors.noEtiquetas'),
|
||||
];
|
||||
}
|
||||
|
||||
} else {
|
||||
return [
|
||||
'status' => true,
|
||||
'message' => lang('Logistica.success.imprimirEtiquetas'),
|
||||
'data' => $xml
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@ -24,9 +24,9 @@ class ImpresoraEtiquetaService extends BaseService
|
||||
"labels" => [
|
||||
[
|
||||
"cliente" => "Cliente Potencial",
|
||||
"titulo" => "[1234] TEST OLIVEROS",
|
||||
"titulo" => "[1234] TEST OLIVEROS",
|
||||
"cantidad" => 100,
|
||||
"tirada" => 50,
|
||||
"tirada" => 50,
|
||||
"cajas" => 1,
|
||||
"ean" => null,
|
||||
"nombre" => "___Nombre___",
|
||||
@ -76,6 +76,66 @@ class ImpresoraEtiquetaService extends BaseService
|
||||
$xml->appendChild($labels);
|
||||
return $xml->saveXML();
|
||||
}
|
||||
|
||||
|
||||
public function createEtiquetaTitulos(array $data_label = []): ?string
|
||||
{
|
||||
$xml = new DOMDocument('1.0', 'utf-8');
|
||||
|
||||
// Crear nodo raíz "labels"
|
||||
$labels = $xml->createElement("labels");
|
||||
|
||||
// Establecer atributos de "labels" desde "header"
|
||||
foreach ($data_label["header"] as $key => $value) {
|
||||
$labels->setAttribute($key, $value);
|
||||
}
|
||||
|
||||
// Recorrer grupos de etiquetas
|
||||
foreach ($data_label["grupos"] as $grupo) {
|
||||
$labelChild = $xml->createElement('label');
|
||||
|
||||
// Crear variables específicas del grupo
|
||||
foreach ($grupo as $libro) {
|
||||
$prefix = $libro['prefix'];
|
||||
|
||||
$variables = [
|
||||
"titulo$prefix" => $libro['titulo'],
|
||||
"tirada$prefix" => $libro['tirada'],
|
||||
"ean$prefix" => $libro['ean'],
|
||||
"npedido$prefix" => $libro['npedido'],
|
||||
"refcliente$prefix" => $libro['refcliente'],
|
||||
"textpedido$prefix" => 'Pedido',
|
||||
"textcantidad$prefix" => 'Cantidad:',
|
||||
"textref$prefix" => 'Ref:',
|
||||
"textean$prefix" => 'ISBN',
|
||||
];
|
||||
|
||||
foreach ($variables as $varName => $varValue) {
|
||||
$variableChild = $xml->createElement('variable');
|
||||
$variableChild->setAttribute("name", $varName);
|
||||
$variableChild->appendChild($xml->createTextNode((string) $varValue));
|
||||
$labelChild->appendChild($variableChild);
|
||||
}
|
||||
}
|
||||
|
||||
// Variables comunes del grupo
|
||||
$nombreVariable = $xml->createElement('variable', htmlspecialchars($data_label['nombre']));
|
||||
$nombreVariable->setAttribute('name', 'nombre');
|
||||
$labelChild->appendChild($nombreVariable);
|
||||
|
||||
$direccionVariable = $xml->createElement('variable', htmlspecialchars($data_label['direccion']));
|
||||
$direccionVariable->setAttribute('name', 'direccion');
|
||||
$labelChild->appendChild($direccionVariable);
|
||||
|
||||
$labels->appendChild($labelChild);
|
||||
}
|
||||
|
||||
$xml->appendChild($labels);
|
||||
return $xml->saveXML();
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function sendToImpresoraEtiqueta(string $name, string $content, ImpresoraEtiquetaEntity $impresoraEtiqueta): bool
|
||||
{
|
||||
$tmpFile = tmpfile();
|
||||
@ -84,8 +144,8 @@ class ImpresoraEtiquetaService extends BaseService
|
||||
rewind($tmpFile);
|
||||
|
||||
$tmpMetaData = stream_get_meta_data($tmpFile);
|
||||
$conn = @ftp_connect($impresoraEtiqueta->ip,$impresoraEtiqueta->port);
|
||||
if(!$conn){
|
||||
$conn = @ftp_connect($impresoraEtiqueta->ip, $impresoraEtiqueta->port);
|
||||
if (!$conn) {
|
||||
throw new Exception('Error al establecer conexión FTP');
|
||||
}
|
||||
$isLoginSuccess = @ftp_login($conn, $impresoraEtiqueta->user, $impresoraEtiqueta->pass);
|
||||
@ -99,10 +159,10 @@ class ImpresoraEtiquetaService extends BaseService
|
||||
if (ftp_put($conn, $name, $tmpMetaData['uri'], FTP_ASCII) === FALSE) {
|
||||
$status = false;
|
||||
ftp_close($conn);
|
||||
}else{
|
||||
} else {
|
||||
$status = true;
|
||||
}
|
||||
|
||||
|
||||
return $status;
|
||||
}
|
||||
}
|
||||
|
||||
@ -78,6 +78,7 @@ class LogisticaService
|
||||
return $builder;
|
||||
}
|
||||
|
||||
|
||||
public static function findForNewEnvio()
|
||||
{
|
||||
$db = \Config\Database::connect();
|
||||
@ -576,11 +577,11 @@ class LogisticaService
|
||||
$data = [
|
||||
"printer" => $printer->name,
|
||||
"header" => [
|
||||
"_FORMAT" => "E:PEDIDO.ZPL",
|
||||
"_QUANTITY" => 1,
|
||||
"_PRINBTERNAME" => $printer->name,
|
||||
"_JOBNAME" => "LBL101"
|
||||
],
|
||||
"_FORMAT" => "E:PEDIDO.ZPL",
|
||||
"_QUANTITY" => 1,
|
||||
"_PRINBTERNAME" => $printer->name,
|
||||
"_JOBNAME" => "LBL101"
|
||||
],
|
||||
];
|
||||
|
||||
foreach ($lineas as $linea) {
|
||||
|
||||
@ -58,7 +58,7 @@ class PresupuestoClienteService extends BaseService
|
||||
if ($total_plana < 0 && $total_rotativa < 0)
|
||||
return [];
|
||||
else {
|
||||
if ($total_plana > $total_rotativa)
|
||||
if ($total_plana > $total_rotativa && $data['forzarRotativa'] == 0)
|
||||
return $plana;
|
||||
else
|
||||
return [$rotativa];
|
||||
|
||||
@ -253,8 +253,7 @@ class PresupuestoService extends BaseService
|
||||
$linea['fields']['precio_libro'] = $linea['fields']['pliegos_libro'] * $linea['fields']['precios_pliegos'];
|
||||
// Precio papel pedido
|
||||
$linea['fields']['precio_pedido'] = $linea['fields']['precio_libro'] * ($datosPedido->tirada + $datosPedido->merma);
|
||||
$linea['fields']['margen_papel_pedido'] = $linea['fields']['pliegos_libro'] * $margen_pliego_impresion * ($datosPedido->tirada + $datosPedido->merma);
|
||||
;
|
||||
$linea['fields']['margen_papel_pedido'] = $linea['fields']['pliegos_libro'] * $margen_pliego_impresion * ($datosPedido->tirada + $datosPedido->merma);;
|
||||
|
||||
$linea['fields']['a_favor_fibra'] = $parametrosRotativa->a_favor_fibra;
|
||||
$linea['fields']['maquina'] = $maquina->maquina;
|
||||
@ -615,9 +614,9 @@ class PresupuestoService extends BaseService
|
||||
// precio tinta
|
||||
$data['precio_tinta'] = round(
|
||||
round(($data['peso_gotas_negro_pedido'] / 1000.0) * $maquina->precio_tinta_negro, 2) +
|
||||
round(($data['peso_gotas_cyan_pedido'] / 1000.0) * $maquina->precio_tinta_color, 2) +
|
||||
round(($data['peso_gotas_magenta_pedido'] / 1000.0) * $maquina->precio_tinta_color, 2) +
|
||||
round(($data['peso_gotas_amarillo_pedido'] / 1000.0) * $maquina->precio_tinta_color, 2),
|
||||
round(($data['peso_gotas_cyan_pedido'] / 1000.0) * $maquina->precio_tinta_color, 2) +
|
||||
round(($data['peso_gotas_magenta_pedido'] / 1000.0) * $maquina->precio_tinta_color, 2) +
|
||||
round(($data['peso_gotas_amarillo_pedido'] / 1000.0) * $maquina->precio_tinta_color, 2),
|
||||
2
|
||||
);
|
||||
|
||||
@ -1907,8 +1906,8 @@ class PresupuestoService extends BaseService
|
||||
$pedido = $modelPedido->find($pedido_id);
|
||||
$serviceProduction->setPedido($pedido);
|
||||
if (!$pedido->orden_trabajo()) {
|
||||
|
||||
$r = $serviceProduction->createOrdenTrabajo();
|
||||
|
||||
$r = $serviceProduction->createOrdenTrabajo(true);
|
||||
$modelPedido->set(['estado' => 'produccion'])->where('id', $pedido_id)->update();
|
||||
}
|
||||
}
|
||||
@ -1983,4 +1982,94 @@ class PresupuestoService extends BaseService
|
||||
|
||||
return $peso;
|
||||
}
|
||||
|
||||
public static function ajustarPresupuesto($id, $precio_unidad = null, $unidades = null, $precio_total = null, $forzar_descuento = false)
|
||||
{
|
||||
|
||||
$precio_total_asignado = 0;
|
||||
$precio_unidad_asignado = $precio_unidad;
|
||||
$warning = false;
|
||||
|
||||
$model = model('App\Models\Presupuestos\PresupuestoModel');
|
||||
if ($precio_unidad != null && $unidades != null) {
|
||||
$precio_total_asignado = round(floatval($precio_unidad) * intval($unidades), 2);
|
||||
} else {
|
||||
$precio_total_asignado = floatval($precio_total);
|
||||
}
|
||||
$presupuesto = $model->find($id);
|
||||
$costes = floatval($presupuesto->total_costes);
|
||||
$envio_base = floatval($presupuesto->envio_base);
|
||||
|
||||
$total_descuento = 0;
|
||||
$total_descuentoPercent = 0;
|
||||
if ($costes + $envio_base > $precio_total_asignado) {
|
||||
|
||||
if ($forzar_descuento) {
|
||||
$total_descuento = $costes + $envio_base - $precio_total_asignado;
|
||||
$total_descuentoPercent = round($total_descuento / ($costes + $envio_base) * 100, 2);
|
||||
} else {
|
||||
$precio_total_asignado = round($costes + $envio_base, 2);
|
||||
$precio_unidad_asignado = round($precio_total_asignado / intval($unidades), 4);
|
||||
}
|
||||
$warning = true;
|
||||
}
|
||||
$total_margenes = $precio_total_asignado - $costes - $envio_base < 0 ?
|
||||
0 :
|
||||
$precio_total_asignado - $costes - $envio_base;
|
||||
|
||||
$sumForFactor = floatval($presupuesto->total_coste_papel) + floatval($presupuesto->total_coste_impresion);
|
||||
$sumForFactorPonderado = $sumForFactor + floatval($presupuesto->total_coste_servicios);
|
||||
|
||||
$factor = ($precio_total_asignado - floatval($presupuesto->envio_base)
|
||||
- floatval($presupuesto->total_coste_envios) - floatval($presupuesto->total_margen_envios)) / $sumForFactor;
|
||||
|
||||
$factorPonderado = ($precio_total_asignado - floatval($presupuesto->envio_base)
|
||||
- floatval($presupuesto->total_coste_envios) - floatval($presupuesto->total_margen_envios)) / $sumForFactorPonderado;
|
||||
|
||||
if ($presupuesto) {
|
||||
|
||||
$presupuesto->total_margenes = $total_margenes;
|
||||
$presupuesto->total_aceptado = $precio_total_asignado;
|
||||
$presupuesto->total_aceptado_revisado = $precio_total_asignado;
|
||||
$presupuesto->total_presupuesto = $precio_total_asignado;
|
||||
$presupuesto->total_antes_descuento = $precio_total_asignado - $costes - $envio_base < 0 ?
|
||||
$costes + $envio_base :
|
||||
$precio_total_asignado;
|
||||
$presupuesto->total_precio_unidad = $precio_unidad_asignado;
|
||||
$presupuesto->total_descuento = $total_descuento;
|
||||
$presupuesto->total_descuentoPercent = $total_descuentoPercent;
|
||||
$presupuesto->total_factor = round($factor, 2);
|
||||
$presupuesto->total_factor_ponderado = round($factorPonderado, 2);
|
||||
$model->update($id, $presupuesto);
|
||||
}
|
||||
return [
|
||||
"success" => true,
|
||||
"warning" => $warning,
|
||||
"new_total" => $precio_total_asignado,
|
||||
"new_precio_unidad" => $precio_unidad_asignado,
|
||||
];
|
||||
}
|
||||
|
||||
public static function calcular_merma($tirada, $POD, $formas_lineas_interior = [])
|
||||
{
|
||||
|
||||
$merma = 0;
|
||||
|
||||
if ($tirada > $POD) {
|
||||
$merma = $tirada * 0.1;
|
||||
} else {
|
||||
$merma_lineas = [];
|
||||
foreach ($formas_lineas_interior as $formas_linea) {
|
||||
if ($formas_linea > $tirada)
|
||||
array_push($merma_lineas, $formas_linea - $tirada);
|
||||
else
|
||||
array_push($merma_lineas, $tirada % $formas_linea);
|
||||
}
|
||||
if (count($merma_lineas) > 0)
|
||||
$merma = max($merma_lineas);
|
||||
}
|
||||
|
||||
|
||||
return round($merma, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@ -23,6 +23,8 @@ use App\Models\Configuracion\MaquinaModel;
|
||||
use App\Models\OrdenTrabajo\OrdenTrabajoFileModel;
|
||||
use App\Models\OrdenTrabajo\OrdenTrabajoTareaProgressDate;
|
||||
use App\Models\Pedidos\PedidoModel;
|
||||
use App\Models\Presupuestos\PresupuestoAcabadosModel;
|
||||
use App\Models\Presupuestos\PresupuestoEncuadernacionesModel;
|
||||
use App\Models\Usuarios\UserModel;
|
||||
use CodeIgniter\Database\BaseBuilder;
|
||||
use CodeIgniter\Database\BaseResult;
|
||||
@ -50,6 +52,7 @@ class ProductionService extends BaseService
|
||||
*/
|
||||
public array $TIPOS_ROTATIVA = ['lp_rot_bn', 'lp_rot_color'];
|
||||
|
||||
public array $OT_TAREA_STATUS_TITLE;
|
||||
protected OrdenTrabajoModel $otModel;
|
||||
|
||||
protected OrdenTrabajoTarea $otTarea;
|
||||
@ -65,6 +68,8 @@ class ProductionService extends BaseService
|
||||
protected MaquinaEntity $defaultMaquinaCorte;
|
||||
protected MaquinaModel $maquinaModel;
|
||||
protected OrdenTrabajo $ordenTrabajoConfig;
|
||||
protected PresupuestoAcabadosModel $presupuestoAcabadoModel;
|
||||
protected PresupuestoEncuadernacionesModel $presupuestoEncuadernacionModel;
|
||||
|
||||
|
||||
/**
|
||||
@ -106,6 +111,12 @@ class ProductionService extends BaseService
|
||||
* @var boolean
|
||||
*/
|
||||
public bool $isPlastificado = false; //* CHECK DONE
|
||||
/**
|
||||
* Indica si la orden de trabajo contiene retractilado
|
||||
* Se usa para mostrar la fecha correspondiente en la vista
|
||||
* @var boolean
|
||||
*/
|
||||
public bool $isRetractilado = false; //* CHECK DONE
|
||||
/**
|
||||
* Indica si la orden de trabajo contiene gofrado
|
||||
* Se usa para mostrar la fecha correspondiente en la vista
|
||||
@ -130,7 +141,7 @@ class ProductionService extends BaseService
|
||||
* TODO Hay que implementar un boolean en `lg_tarifa_manipulado` para identificar
|
||||
* @var boolean
|
||||
*/
|
||||
public bool $isGrapado = true; //TODO
|
||||
public bool $isGrapado = false; //TODO
|
||||
/**
|
||||
* Indica si la orden de trabajo contiene espiral
|
||||
* Se usa para mostrar la fecha correspondiente en la vista
|
||||
@ -138,7 +149,7 @@ class ProductionService extends BaseService
|
||||
* DEFAULT true hasta implementacion
|
||||
* @var boolean
|
||||
*/
|
||||
public bool $isEspiral = true; //TODO
|
||||
public bool $isEspiral = false; //TODO
|
||||
/**
|
||||
* Indica si la orden de trabajo contiene UVI
|
||||
* Se usa para mostrar la fecha correspondiente en la vista
|
||||
@ -196,9 +207,19 @@ class ProductionService extends BaseService
|
||||
$this->otTareaProgressDate = model(OrdenTrabajoTareaProgressDate::class);
|
||||
$this->festivoModel = model(FestivoModel::class);
|
||||
$this->ordenTrabajoConfig = config('OrdenTrabajo');
|
||||
$this->presupuestoAcabadoModel = model(PresupuestoAcabadosModel::class);
|
||||
$this->presupuestoEncuadernacionModel = model(PresupuestoEncuadernacionesModel::class);
|
||||
$this->statusColor = $this->ordenTrabajoConfig->OT_COLORS["sin_imprimir"];
|
||||
$this->configVariableModel = model(ConfigVariableModel::class);
|
||||
$this->podValue = $this->configVariableModel->getVariable('POD')->value;
|
||||
$this->OT_TAREA_STATUS_TITLE = [
|
||||
"P" => lang('Produccion.tarea_estados.P'),
|
||||
"F" => lang('Produccion.tarea_estados.F'),
|
||||
"S" => lang('Produccion.tarea_estados.S'),
|
||||
"I" => lang('Produccion.tarea_estados.I'),
|
||||
"E" => lang('Produccion.tarea_estados.E'),
|
||||
"D" => lang('Produccion.tarea_estados.D'),
|
||||
];
|
||||
}
|
||||
|
||||
public function init(int $orden_trabajo_id): self
|
||||
@ -206,7 +227,11 @@ class ProductionService extends BaseService
|
||||
try {
|
||||
$this->maquinaModel = model(MaquinaModel::class);
|
||||
$this->otModel = model(OrdenTrabajoModel::class);
|
||||
$this->ot = $this->otModel->find($orden_trabajo_id);
|
||||
$ot = $this->otModel->find($orden_trabajo_id);
|
||||
if($ot == null){
|
||||
throw new Exception(lang('Produccion.errors.ot_not_found',['ot_id' => $orden_trabajo_id]));
|
||||
}
|
||||
$this->ot = $ot;
|
||||
$pedido = $this->ot->pedido();
|
||||
$this->setPedido($pedido);
|
||||
$this->defaultMaquinaCorte = $this->maquinaModel->where('nombre', $this->defaultMaquinaCorteName)->first();
|
||||
@ -247,7 +272,7 @@ class ProductionService extends BaseService
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function createOrdenTrabajo(): OrdenTrabajoEntity|DatabaseException
|
||||
public function createOrdenTrabajo(bool $imported = false): OrdenTrabajoEntity|DatabaseException
|
||||
{
|
||||
|
||||
$auth_user = auth()->user();
|
||||
@ -260,13 +285,18 @@ class ProductionService extends BaseService
|
||||
"user_created_id" => $auth_user->id,
|
||||
"user_updated_id" => $auth_user->id,
|
||||
"total_tirada" => $this->pedido->total_tirada,
|
||||
"total_precio" => $this->pedido->total_precio
|
||||
"total_precio" => $this->pedido->total_precio,
|
||||
"preimpresion_revisada" => $imported
|
||||
];
|
||||
$id = $this->otModel->insert($data);
|
||||
$this->init($id);
|
||||
$this->storeOrdenTrabajoUsers();
|
||||
$this->storeOrdenTrabajoDates();
|
||||
$this->storeAllTareas();
|
||||
try {
|
||||
$this->updatePodDates();
|
||||
} catch (\Throwable $th) {
|
||||
}
|
||||
$this->updatePedidoEspera();
|
||||
return $this->ot;
|
||||
}
|
||||
@ -580,11 +610,25 @@ class ProductionService extends BaseService
|
||||
}
|
||||
return ["tareas" => $tareas];
|
||||
}
|
||||
public function getTareasWithMaquina(int $maquina_id,?array $tareaEstados = null) : ?array
|
||||
{
|
||||
return $this->otModel->queryMaquinaTareas($maquina_id, $tareaEstados)
|
||||
->where('ordenes_trabajo.id', $this->ot->id)
|
||||
->get()->getResult(OrdenTrabajoTareaEntity::class);
|
||||
}
|
||||
|
||||
public function getPdf()
|
||||
{
|
||||
return view("themes/vuexy/pdfs/orden_trabajo", $this->getDataPdf());
|
||||
}
|
||||
public function getFerroPdf()
|
||||
{
|
||||
return view("themes/vuexy/pdfs/ferro", $this->getDataPdf());
|
||||
}
|
||||
public function getPrototipoPdf()
|
||||
{
|
||||
return view("themes/vuexy/pdfs/prototipo", $this->getDataPdf());
|
||||
}
|
||||
/**
|
||||
* Query para mostrar en datatable
|
||||
*
|
||||
@ -605,6 +649,10 @@ class ProductionService extends BaseService
|
||||
"orden_trabajo_tareas.tiempo_real",
|
||||
"orden_trabajo_tareas.comment",
|
||||
"orden_trabajo_tareas.presupuesto_linea_id",
|
||||
"orden_trabajo_tareas.presupuesto_acabado_id",
|
||||
"orden_trabajo_tareas.presupuesto_manipulado_id",
|
||||
"orden_trabajo_tareas.presupuesto_preimpresion_id",
|
||||
"orden_trabajo_tareas.presupuesto_encuadernado_id",
|
||||
"presupuesto_linea.tipo",
|
||||
|
||||
])
|
||||
@ -826,6 +874,7 @@ class ProductionService extends BaseService
|
||||
"tareas_preimpresion" => $this->tareas_preimpresion(),
|
||||
"tareas_impresion" => $this->tareas_impresion(),
|
||||
"tiempo_procesamiento" => $this->getTiempoProcesamientoHHMM(),
|
||||
"tiempo_total" => $this->getTiempoTotalTareas(),
|
||||
"statusColor" => $this->getOtColorStatus(),
|
||||
"tareaCosido" => $this->getTareaCosido(),
|
||||
];
|
||||
@ -964,13 +1013,25 @@ class ProductionService extends BaseService
|
||||
$data["action_user_id"] = auth()->user()->id;
|
||||
$lastDate = $this->otTareaProgressDate->where('ot_tarea_id', $data['ot_tarea_id'])->orderBy('action_at', 'DESC')->first();
|
||||
if ($lastDate) {
|
||||
if ($lastDate->estado == $data['estado']) {
|
||||
throw new Exception(lang('Produccion.duplicate_estado_tarea_progress'));
|
||||
}
|
||||
// if ($lastDate->estado == $data['estado']) {
|
||||
// throw new Exception(lang('Produccion.duplicate_estado_tarea_progress'));
|
||||
// }
|
||||
if ($lastDate->estado == 'F') {
|
||||
throw new Exception(lang('Produccion.task_already_finished'));
|
||||
}
|
||||
}
|
||||
if (isset($data['estado'])) {
|
||||
if ($data['estado'] == 'F') {
|
||||
$tareaEntity = $this->otTarea->find($data['ot_tarea_id']);
|
||||
$this->init($tareaEntity->orden_trabajo_id);
|
||||
$dateName = $this->getOrdenTrabajoTareaDate($tareaEntity);
|
||||
$dataDate = [
|
||||
'name' => $dateName,
|
||||
];
|
||||
$dataDate[$dateName] = Time::now()->format('Y-m-d');
|
||||
$this->updateOrdenTrabajoDate($dataDate);
|
||||
}
|
||||
}
|
||||
return $this->otTareaProgressDate->insert($data);
|
||||
}
|
||||
public function getTareaLastState($tarea_id)
|
||||
@ -985,6 +1046,16 @@ class ProductionService extends BaseService
|
||||
$data["action_at"] = Time::now()->format('Y-m-d H:i:s');
|
||||
$data["action_user_id"] = auth()->user()->id;
|
||||
$status = $this->otTareaProgressDate->where('ot_tarea_id', $orden_trabajo_tarea_id)->delete();
|
||||
if ($status) {
|
||||
$tareaEntity = $this->otTarea->find($orden_trabajo_tarea_id);
|
||||
$this->init($tareaEntity->orden_trabajo_id);
|
||||
$dateName = $this->getOrdenTrabajoTareaDate($tareaEntity);
|
||||
$this->emptyOrdenTrabajoDate($this->ot->id, $dateName);
|
||||
$tareaEntity->tiempo_real = 0;
|
||||
$tareaEntity->click_init = 0;
|
||||
$tareaEntity->click_end = 0;
|
||||
$this->otTarea->save($tareaEntity);
|
||||
}
|
||||
if ($status) {
|
||||
$response = $this->storeOrdenTrabajoTareaProgressDate($data);
|
||||
}
|
||||
@ -1069,6 +1140,9 @@ class ProductionService extends BaseService
|
||||
if (isset($data["is_pedido_espera"])) {
|
||||
$data["pedido_espera_by"] = auth()->user()->id;
|
||||
}
|
||||
if (isset($data["preimpresion_revisada"])) {
|
||||
$data["preimpresion_revisada_by"] = auth()->user()->id;
|
||||
}
|
||||
return $this->otModel->update($this->ot->id, $data);
|
||||
}
|
||||
public function updateOrdenTrabajoPedido($data)
|
||||
@ -1373,14 +1447,33 @@ class ProductionService extends BaseService
|
||||
}
|
||||
public function getTiempoTareasImpresionHHMM(): string
|
||||
{
|
||||
$tareas_impresion = $this->ot->tareas_impresion();
|
||||
$tiempo_seconds = 0;
|
||||
foreach ($tareas_impresion as $key => $tarea) {
|
||||
if ($tarea->is_corte == false) {
|
||||
$tiempo_seconds += $tarea->tiempo_estimado;
|
||||
try {
|
||||
$tareas_impresion = $this->ot->tareas_impresion();
|
||||
$tiempo_seconds = 0;
|
||||
foreach ($tareas_impresion as $key => $tarea) {
|
||||
if ($tarea->is_corte == false) {
|
||||
$tiempo_seconds += $tarea->tiempo_estimado;
|
||||
}
|
||||
}
|
||||
return float_seconds_to_hhmm_string($tiempo_seconds);
|
||||
} catch (\Throwable $th) {
|
||||
return '00:00';
|
||||
}
|
||||
}
|
||||
public function getTiempoTotalTareas(): string
|
||||
{
|
||||
try {
|
||||
$tareas = $this->ot->tareas();
|
||||
$tiempo_seconds = 0;
|
||||
foreach ($tareas as $key => $tarea) {
|
||||
if ($tarea->tiempo_real) {
|
||||
$tiempo_seconds += $tarea->tiempo_real;
|
||||
}
|
||||
}
|
||||
return float_seconds_to_hhmm_string($tiempo_seconds);
|
||||
} catch (\Throwable $th) {
|
||||
return '00:00';
|
||||
}
|
||||
return float_seconds_to_hhmm_string($tiempo_seconds);
|
||||
}
|
||||
public function getUVI(): ?TarifaAcabadoEntity
|
||||
{
|
||||
@ -1393,6 +1486,7 @@ class ProductionService extends BaseService
|
||||
}
|
||||
return $uvi;
|
||||
}
|
||||
//TODO ACTUALIZAR
|
||||
public function updateProgress(): bool
|
||||
{
|
||||
$userDates = $this->ordenTrabajoConfig->DATE_USER_MAPPING;
|
||||
@ -1647,9 +1741,14 @@ class ProductionService extends BaseService
|
||||
return [
|
||||
"isGofrado" => $this->gofrado(),
|
||||
"isEspiral" => $this->isEspiral, //TODO
|
||||
"isUVI" => $this->uvi(),
|
||||
"isPlastificado" => $this->plastificado(),
|
||||
"isPlakene" => $this->plakene(),
|
||||
"isEstampado" => $this->estampado(),
|
||||
"isRetractilado" => $this->retractilado(),
|
||||
"isUVI" => $this->uvi(),
|
||||
"isCubierta" => $this->cubierta(),
|
||||
"isSobrecubierta" => $this->sobreCubierta(),
|
||||
"isGuarda" => $this->guarda(),
|
||||
"isColor" => $this->isColor,
|
||||
"isBN" => $this->isBN,
|
||||
"isCorte" => $this->corte(),
|
||||
@ -1688,6 +1787,20 @@ class ProductionService extends BaseService
|
||||
$this->isPlakene = $flag;
|
||||
return $this->isPlakene;
|
||||
}
|
||||
public function retractilado(): bool
|
||||
{
|
||||
$flag = false;
|
||||
$acabados = $this->presupuesto->acabados();
|
||||
foreach ($acabados as $key => $acabado) {
|
||||
$tarifa_acabado = $acabado->tarifa();
|
||||
if ($tarifa_acabado->rectractilado) {
|
||||
$flag = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
$this->isRetractilado = $flag;
|
||||
return $this->isRetractilado;
|
||||
}
|
||||
public function plakene_tipo(): ?string
|
||||
{
|
||||
$tipo = "";
|
||||
@ -1761,6 +1874,24 @@ class ProductionService extends BaseService
|
||||
}
|
||||
return $this->isCubierta;
|
||||
}
|
||||
public function sobreCubierta(): bool
|
||||
{
|
||||
$flag = false;
|
||||
$lineaCubierta = $this->presupuesto->presupuestoLineaSobreCubierta();
|
||||
if ($lineaCubierta) {
|
||||
$flag = true;
|
||||
}
|
||||
return $flag;
|
||||
}
|
||||
public function guarda(): bool
|
||||
{
|
||||
$flag = false;
|
||||
$lineaCubierta = $this->presupuesto->presupuestoLineaGuarda();
|
||||
if ($lineaCubierta) {
|
||||
$flag = true;
|
||||
}
|
||||
return $flag;
|
||||
}
|
||||
public function color(): bool
|
||||
{
|
||||
$linea_impresion = $this->presupuesto->presupuestoLineaImpresion();
|
||||
@ -1799,14 +1930,13 @@ class ProductionService extends BaseService
|
||||
"orden_trabajo_tareas.id as ot_tarea_id",
|
||||
"pedidos.fecha_impresion",
|
||||
"orden_trabajo_tareas.nombre as tareaName",
|
||||
"presupuestos.titulo as presupuesto_titulo",
|
||||
"orden_trabajo_tareas.maquina_id",
|
||||
"lg_papel_impresion.nombre as papel_impresion",
|
||||
"presupuesto_linea.gramaje as papel_gramaje",
|
||||
"tarea_progress.estado as tareaEstado"
|
||||
"tarea_progress.estado as tareaEstado",
|
||||
"tarea_progress.estado",
|
||||
|
||||
])
|
||||
->join("orden_trabajo_tareas", "orden_trabajo_tareas.orden_trabajo_id = ordenes_trabajo.id", "left")
|
||||
// Obtener el ultimo estado de la tarea
|
||||
//* Obtener el ultimo estado de la tarea
|
||||
->join(
|
||||
'(SELECT ot_tarea_id, estado
|
||||
FROM orden_trabajo_tarea_progress_dates
|
||||
@ -1819,21 +1949,14 @@ class ProductionService extends BaseService
|
||||
'tarea_progress.ot_tarea_id = orden_trabajo_tareas.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("pedidos", "pedidos.id = ordenes_trabajo.pedido_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")
|
||||
->groupStart()
|
||||
->orWhere('orden_trabajo_tareas.maquina_id', $maquina_id) //!TODO
|
||||
->orWhere('presupuesto_linea.maquina_id', $maquina_id)
|
||||
->groupEnd()
|
||||
// ->where('pedidos.fecha_impresion IS NOT NULL', null, false)
|
||||
->where('orden_trabajo_tareas.maquina_id', $maquina_id)
|
||||
// ->where('pedidos.fecha_impresion IS NOT NULL', null, false) //! Dejar comentado por ahora
|
||||
->where('ordenes_trabajo.preimpresion_revisada', true)
|
||||
->where("orden_trabajo_tareas.deleted_at", null)
|
||||
->where("tarea_progress.estado", 'P')
|
||||
->orderBy("pedidos.fecha_impresion", "ASC")
|
||||
->groupBy('orden_trabajo_tareas.nombre');
|
||||
->groupBy('orden_trabajo_tareas.id');
|
||||
|
||||
return $q;
|
||||
}
|
||||
@ -1920,4 +2043,195 @@ class ProductionService extends BaseService
|
||||
$dates = $this->createDatesForPOD();
|
||||
return $this->pedidoModel->update($this->pedido->id, $dates);
|
||||
}
|
||||
public function getProveedorTarea($tarea_id)
|
||||
{
|
||||
$proveedor = null;
|
||||
$tareaEntity = $this->otTarea->find($tarea_id);
|
||||
if ($tareaEntity) {
|
||||
$proveedorEncuadernado = $tareaEntity->presupuesto_encuadernacion();
|
||||
$proveedorAcabado = $tareaEntity->presupuesto_acabado();
|
||||
if ($proveedorEncuadernado) {
|
||||
$proveedor = $proveedorEncuadernado->proveedor();
|
||||
} elseif ($proveedorAcabado) {
|
||||
$proveedor = $proveedorAcabado->proveedor();
|
||||
} else {
|
||||
$proveedor = null;
|
||||
}
|
||||
}
|
||||
return ["tarea" => $tareaEntity, "proveedor" => $proveedor];
|
||||
}
|
||||
public function updateProveedorLinea($tarea_id, $proveedor_id)
|
||||
{
|
||||
$status = false;
|
||||
$tareaEntity = $this->otTarea->find($tarea_id);
|
||||
$presupuestoEncuadernado = $tareaEntity->presupuesto_encuadernacion();
|
||||
$presupuestoAcabado = $tareaEntity->presupuesto_acabado();
|
||||
if ($presupuestoEncuadernado) {
|
||||
$status = $this->presupuestoEncuadernacionModel->update($presupuestoEncuadernado->id, ['proveedor_id' => $proveedor_id]);
|
||||
} elseif ($presupuestoAcabado) {
|
||||
$status = $this->presupuestoAcabadoModel->update($presupuestoAcabado->id, ['proveedor_id' => $proveedor_id]);
|
||||
} else {
|
||||
$status = null;
|
||||
}
|
||||
return $status;
|
||||
}
|
||||
public function otTareaImpresionWithDates()
|
||||
{
|
||||
$tareasImpresion = $this->ot->tareas_impresion();
|
||||
$data = [];
|
||||
foreach ($tareasImpresion as $key => $tareaImpresion) {
|
||||
if ($tareaImpresion->is_corte) {
|
||||
$data[$tareaImpresion->id] = 'corte_at';
|
||||
continue;
|
||||
}
|
||||
$presupuestoLineaEntity = $tareaImpresion->presupuesto_linea();
|
||||
if ($presupuestoLineaEntity) {
|
||||
if ($presupuestoLineaEntity->isGuarda()) {
|
||||
$data[$tareaImpresion->id] = 'guarda_at';
|
||||
} elseif ($presupuestoLineaEntity->isCubierta()) {
|
||||
$data[$tareaImpresion->id] = 'cubierta_at';
|
||||
} elseif ($presupuestoLineaEntity->isColor()) {
|
||||
$data[$tareaImpresion->id] = 'interior_color_at';
|
||||
} elseif ($presupuestoLineaEntity->isBN()) {
|
||||
$data[$tareaImpresion->id] = 'interior_bn_at';
|
||||
} elseif ($presupuestoLineaEntity->isSobreCubierta()) {
|
||||
$data[$tareaImpresion->id] = 'sobrecubierta_at';
|
||||
}
|
||||
}
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
public function tareaImpresionDate($tarea): string
|
||||
{
|
||||
|
||||
$dateName = "";
|
||||
$presupuestoLineaEntity = $tarea->presupuesto_linea();
|
||||
if ($presupuestoLineaEntity) {
|
||||
if ($presupuestoLineaEntity->isGuarda()) {
|
||||
$dateName = 'guarda_at';
|
||||
} elseif ($presupuestoLineaEntity->isCubierta()) {
|
||||
$dateName = 'cubierta_at';
|
||||
} elseif ($presupuestoLineaEntity->isColor()) {
|
||||
$dateName = 'interior_color_at';
|
||||
} elseif ($presupuestoLineaEntity->isBN()) {
|
||||
$dateName = 'interior_bn_at';
|
||||
} elseif ($presupuestoLineaEntity->isSobreCubierta()) {
|
||||
$dateName = 'sobrecubierta_at';
|
||||
}
|
||||
if ($tarea->is_corte) {
|
||||
$dateName = 'corte_at';
|
||||
}
|
||||
}
|
||||
return $dateName;
|
||||
}
|
||||
public function otTareaAcabadoWithDates()
|
||||
{
|
||||
$tareasAcabado = $this->ot->tareas_acabado();
|
||||
$data = [];
|
||||
foreach ($tareasAcabado as $key => $tareasAcabado) {
|
||||
$tarifaAcabado = $tareasAcabado->presupuesto_acabado()?->tarifa();
|
||||
if ($tarifaAcabado) {
|
||||
if ($tarifaAcabado->plastificado) {
|
||||
$data[$tareasAcabado->id] = 'plastificado_at';
|
||||
}
|
||||
if ($tarifaAcabado->rectractilado) {
|
||||
$data[$tareasAcabado->id] = 'retractilado_at';
|
||||
}
|
||||
if ($tarifaAcabado->estampado) {
|
||||
$data[$tareasAcabado->id] = 'estampado_at';
|
||||
}
|
||||
if ($tarifaAcabado->uvi) {
|
||||
$data[$tareasAcabado->id] = 'uvi_at';
|
||||
}
|
||||
}
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
public function tareaAcabadoDate($tarea): string
|
||||
{
|
||||
|
||||
$dateName = "";
|
||||
$tarifaAcabado = $tarea->presupuesto_acabado()?->tarifa();;
|
||||
if ($tarifaAcabado) {
|
||||
if ($tarifaAcabado->plastificado) {
|
||||
$dateName = 'plastificado_at';
|
||||
}
|
||||
if ($tarifaAcabado->rectractilado) {
|
||||
$dateName = 'retractilado_at';
|
||||
}
|
||||
if ($tarifaAcabado->plakene) {
|
||||
$dateName = 'plakene_at';
|
||||
}
|
||||
if ($tarifaAcabado->estampado) {
|
||||
$dateName = 'estampado_at';
|
||||
}
|
||||
if ($tarifaAcabado->uvi) {
|
||||
$dateName = 'uvi_at';
|
||||
}
|
||||
}
|
||||
return $dateName;
|
||||
}
|
||||
public function otTareaEncuadernadoWithDates()
|
||||
{
|
||||
$tareas = $this->ot->tareas_encuadernado();
|
||||
$data = [];
|
||||
foreach ($tareas as $key => $tarea) {
|
||||
$data[$tarea->id] = "encuadernacion_at";
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function otTareaManipuladooWithDates()
|
||||
{
|
||||
$tareas = $this->ot->tareas_manipulado();
|
||||
$data = [];
|
||||
foreach ($tareas as $key => $tarea) {
|
||||
$data[$tarea->id] = "entrada_manipulado_at";
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
public function getOrdenTrabajoTareaDates(): array
|
||||
{
|
||||
$dates = [];
|
||||
foreach ($this->ot->tareas() as $key => $tarea) {
|
||||
$dates[] = $this->getOrdenTrabajoTareaDate($tarea);
|
||||
}
|
||||
return array_unique($dates);
|
||||
}
|
||||
public function getOrdenTrabajoTareaDate(OrdenTrabajoTareaEntity $tarea): ?string
|
||||
{
|
||||
$dateName = null;
|
||||
if ($tarea->isImpresion()) {
|
||||
$dateName = $this->tareaImpresionDate($tarea);
|
||||
}
|
||||
if ($tarea->isAcabado()) {
|
||||
$dateName = $this->tareaAcabadoDate($tarea);
|
||||
}
|
||||
if ($tarea->isManipulado()) {
|
||||
$dateName = "entrada_manipulado_at";
|
||||
}
|
||||
if ($tarea->isEncuadernado()) {
|
||||
$dateName = "encuadernacion_at";
|
||||
}
|
||||
return $dateName;
|
||||
}
|
||||
public function getTitleTareaEstado($tarea_id): array
|
||||
{
|
||||
$estadoTitle = $this->OT_TAREA_STATUS_TITLE["P"];
|
||||
$estadoColor = $this->ordenTrabajoConfig->OT_TAREA_STATUS_COLOR['P'];
|
||||
$userName = null;
|
||||
$progressDateEntity = $this->otTarea->find($tarea_id)->lastState();
|
||||
if ($progressDateEntity) {
|
||||
if (isset($this->OT_TAREA_STATUS_TITLE[$progressDateEntity->estado])) {
|
||||
$estadoTitle = $this->OT_TAREA_STATUS_TITLE[$progressDateEntity->estado];
|
||||
$estadoColor = $this->ordenTrabajoConfig->OT_TAREA_STATUS_COLOR[$progressDateEntity->estado];
|
||||
$userName = $progressDateEntity->user()->fullName();
|
||||
}
|
||||
}
|
||||
return [
|
||||
"title" => $estadoTitle,
|
||||
"color" => $estadoColor,
|
||||
"userName" => $userName ?? "",
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,45 @@
|
||||
<div class="card h-100">
|
||||
<div class="card-body">
|
||||
<div class="row h-100">
|
||||
<div class="col-9">
|
||||
<div class="d-flex flex-column justify-content-evenly gap-2 h-100">
|
||||
<div class="row mb-2">
|
||||
<div class="col-md-12">
|
||||
<h4 class="alert-heading d-flex align-items-center gap-1">
|
||||
<span id="ot-id-header" style="color:red"></span>
|
||||
<span id="presupuesto-id" class="fs-bold"></span>
|
||||
<span id="ot-title" class="fs-bold"></span></h4>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<p class="mb-0">Tiempo estimado</p>
|
||||
<h4 class="mb-0" id="tiempo-estimado-info">00:00:00</h4>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<p class="mb-0">Tiempo real</p>
|
||||
<h4 class="mb-0" id="tiempo-real-info">00:00:00</h4>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12 form-group form-group-lg">
|
||||
<label for="input-click-init" class="form-label"><?= lang('Produccion.click_init') ?></label>
|
||||
<input class="form-control input-lg ot-tarea-click" min="0" name="click_init" id="input-click-init" placeholder="<?= lang('Produccion.click_init') ?>" value="0">
|
||||
</div>
|
||||
<div class="col-md-12 form-group form-group-lg">
|
||||
<label for="input-click-init" class="form-label input-lg"><?= lang('Produccion.click_end') ?></label>
|
||||
<input class="form-control ot-tarea-click" min="0" name="click_end" id="input-click-end" placeholder="<?= lang('Produccion.click_end') ?>" value="0">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-3 h-100">
|
||||
<div class="d-flex flex-column justify-content-evenly gap-2 h-100">
|
||||
<button type="button" id="btn-cancel-tarea" class="maquina-btn btn btn-danger w-100 d-flex justify-content-evenly"><span class="ti ti-square-x ti-lg"></span><?= lang('Produccion.maquinista.cancel') ?></button>
|
||||
<button type="button" id="btn-finish-tarea" class="maquina-btn btn btn-primary w-100 d-flex justify-content-evenly action-btn"><span class="ti ti-player-eject ti-lg"></span><?= lang('Produccion.maquinista.play_end') ?></button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@ -0,0 +1,55 @@
|
||||
<div class="card h-100">
|
||||
<div class="card-body">
|
||||
<div class="row h-100">
|
||||
<div class="col-6">
|
||||
<div class="d-flex flex-column justify-content-evenly gap-2 h-100">
|
||||
|
||||
<div class="row mb-2">
|
||||
|
||||
<div class="col-md-6 mb-2">
|
||||
<p class="mb-0">Tirada</p>
|
||||
<h5 class="mb-0" id="tirada-info"></h5>
|
||||
</div>
|
||||
<div class="col-md-6 mb-2 <?= $maquinaEntity->tipo != "impresion" ? "d-none" : "" ?>" >
|
||||
<p class="mb-0">Clicks</p>
|
||||
<h5 class="mb-0" id="clicks-info"></h5>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-2">
|
||||
<div class="col-md-6">
|
||||
<p class="mb-0 text-truncate">Tiempo estimado</p>
|
||||
<h5 class="mb-0" id="tiempo-estimado-info"></h5>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<p class="mb-0 text-truncate">Tiempo real</p>
|
||||
<h5 class="mb-0" id="tiempo-real-info"></h5>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" <?= $maquinaEntity->tipo != "impresion" ? "disabled" : "" ?>>
|
||||
<div class="col-md-12 form-group form-group-lg">
|
||||
<label for="input-click-init" class="form-label"><?= lang('Produccion.click_init') ?></label>
|
||||
<input class="form-control input-lg ot-tarea-click" min="0" name="click_init" id="input-click-init" placeholder="<?= lang('Produccion.click_init') ?>" value="0">
|
||||
</div>
|
||||
<div class="col-md-12 form-group form-group-lg">
|
||||
<label for="input-click-init" class="form-label input-lg"><?= lang('Produccion.click_end') ?></label>
|
||||
<input class="form-control ot-tarea-click" min="0" name="click_end" id="input-click-end" placeholder="<?= lang('Produccion.click_end') ?>" value="0">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-6 h-100">
|
||||
<div class="d-flex flex-column justify-content-evenly gap-2 h-100">
|
||||
<button type="button" data-estado="I" id="btn-start-tarea" class="maquina-btn btn btn-success w-100 d-flex justify-content-evenly action-btn"><span class="ti ti-player-play ti-lg"></span><?= lang('Produccion.maquinista.play_tarea') ?></button>
|
||||
<button type="button" data-estado="S" id="btn-pause-tarea" class="maquina-btn btn btn-info w-100 d-flex justify-content-evenly d-none action-btn"><span class="ti ti-player-pause ti-lg"></span><?= lang('Produccion.maquinista.play_pause') ?></button>
|
||||
<button type="button" data-estado="D" id="btn-stop-tarea" class="maquina-btn btn btn-warning w-100 d-flex justify-content-evenly"><span class="ti ti-player-stop ti-lg"></span><?= lang('Produccion.maquinista.play_stop') ?></button>
|
||||
<button type="button" data-estado="F" id="btn-finish-tarea" class="maquina-btn btn btn-primary w-100 d-flex justify-content-evenly action-btn d-none"><span class="ti ti-player-eject ti-lg"></span><?= lang('Produccion.maquinista.play_end') ?></button>
|
||||
<button type="button" id="btn-delete-tarea" class="maquina-btn btn btn-danger w-100 d-flex justify-content-evenly"><span class="ti ti-square-x ti-lg"></span><?= lang('Produccion.maquinista.cancel') ?></button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@ -1,14 +1,11 @@
|
||||
<div class="table-maquinista table-responsive">
|
||||
|
||||
<table id="maquinista-tarea-table" class="table table-hover text-dark" style="width: 100%;">
|
||||
<table id="<?= $id ?>" class="table table-hover text-dark" style="width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= lang('ID') ?></th>
|
||||
<th><?= lang('OT ID') ?></th>
|
||||
<th><?= lang('Produccion.task.task') ?></th>
|
||||
<th><?= lang('Produccion.task.estado') ?></th>
|
||||
<th><?= lang('Produccion.datatable.titulo') ?></th>
|
||||
<th><?= lang('Produccion.datatable.papel') ?></th>
|
||||
<th><?= lang('Produccion.datatable.gramaje') ?></th>
|
||||
<th><?= lang('Produccion.datatable.fecha_impresion') ?></th>
|
||||
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
||||
</tr>
|
||||
|
||||
@ -1,13 +1,15 @@
|
||||
<div class="table-responsive">
|
||||
|
||||
<table id="<?= $id ?>" class="table table-hover">
|
||||
<table id="<?= $id ?>" class="table table-hover table-sm">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= lang('Produccion.task.order') ?></th>
|
||||
<th><?= lang('Produccion.task.task') ?></th>
|
||||
<th><?= lang('Produccion.task.estado') ?></th>
|
||||
<th><?= lang('Produccion.task.maquina_presupuesto') ?></th>
|
||||
<th><?= lang('Produccion.task.maquina_actual') ?></th>
|
||||
<th><?= lang('Produccion.task.imposicion') ?></th>
|
||||
<th><?= lang('Produccion.task.proveedor') ?></th>
|
||||
<th><?= lang('Produccion.task.tiempo_estimado') ?></th>
|
||||
<th><?= lang('Produccion.task.tiempo') ?></th>
|
||||
<th></th>
|
||||
|
||||
@ -521,6 +521,28 @@
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="form-check">
|
||||
<label for="removeEnvioBase" class="form-check-label">
|
||||
<input type="checkbox" id="removeEnvioBase"
|
||||
name="no_envio_base" value="1"
|
||||
class="form-check-input"<?= $clienteEntity->no_envio_base == true ? 'checked' : ''; ?>>
|
||||
<?= lang('Clientes.removeEnvioBase') ?>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="form-check">
|
||||
<label for="rotativaPOD" class="form-check-label">
|
||||
<input type="checkbox" id="rotativaPOD"
|
||||
name="forzar_rotativa_pod" value="1"
|
||||
class="form-check-input"<?= $clienteEntity->forzar_rotativa_pod == true ? 'checked' : ''; ?>>
|
||||
<?= lang('Clientes.forzarRotativaPod') ?>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row g-3 mb-3">
|
||||
<div class="col-md-3">
|
||||
<div class="form-check">
|
||||
<label for="tiradaFlexible" class="form-check-label">
|
||||
|
||||
@ -0,0 +1,103 @@
|
||||
<?= $this->include('themes/_commonPartialsBs/datatables') ?>
|
||||
<?= $this->include('themes/_commonPartialsBs/sweetalert') ?>
|
||||
<?= $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('Importador.importadorBubokTitle') ?></h3>
|
||||
</div><!--//.card-header -->
|
||||
|
||||
<form id="catalogoLibroForm" class="card-body" method="post" action="#">
|
||||
<?= csrf_field() ?>
|
||||
|
||||
<!-- card-body -->
|
||||
<div class="card-body">
|
||||
|
||||
<?= view('themes/_commonPartialsBs/_alertBoxes'); ?>
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-6 mb-3">
|
||||
<label for="xmlFile"
|
||||
class="form-label"><?= lang('Importador.subirArchivoBubok') ?? 'Subir archivo XML' ?></label>
|
||||
<input type="file" id="xmlFile" accept=".xml" class="form-control">
|
||||
</div>
|
||||
<div class="col-md-4 mb-3 d-flex align-items-end">
|
||||
<button type="button" id="importBtn" class="btn btn-success w-100">
|
||||
<i class="fas fa-file-import me-2"></i> <?= lang('Importador.importar') ?? 'Importar' ?>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12 mb-3">
|
||||
|
||||
<table id="xmlTable" class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><input type="checkbox" id="selectAll" /></th>
|
||||
<th>Referencia</th>
|
||||
<th>Título</th>
|
||||
<th>Tamaño</th>
|
||||
<th>Páginas</th>
|
||||
<th>Tirada</th>
|
||||
<th>Interior</th>
|
||||
<th>Notas</th>
|
||||
<th>Acciones</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th></th> <!-- No filtro para checkbox -->
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th> <!-- No filtro para notas -->
|
||||
<th></th> <!-- No filtro para acciones -->
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div><!--//.card-body -->
|
||||
<div class="card-footer">
|
||||
|
||||
</div><!--//.card-footer -->
|
||||
</div><!--//.card -->
|
||||
</div><!--//.col -->
|
||||
</div><!--//.row -->
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
|
||||
|
||||
<?= $this->section('css') ?>
|
||||
<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/vendor/libs/sweetalert2/sweetalert2.css') ?>" />
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
|
||||
<?= $this->section('additionalExternalJs') ?>
|
||||
<script
|
||||
src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/dataTables.buttons.min.js") ?>"></script>
|
||||
<script
|
||||
src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.bootstrap5.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.html5.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.print.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/jszip/jszip.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/pdfmake/pdfmake.min.js") ?>"
|
||||
crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/pdfmake/vfs_fonts.js") ?>"></script>
|
||||
<script src="<?= site_url('themes/vuexy/vendor/libs/sweetalert2/sweetalert2.js') ?>"></script>
|
||||
<script type="module" src="<?= site_url("assets/js/safekat/pages/importadores/bubok/bubok_tool.js") ?>"></script>
|
||||
<?= $this->endSection() ?>
|
||||
@ -22,7 +22,7 @@
|
||||
|
||||
<div class="col-md-6 mb-3">
|
||||
<label for="excelFile"
|
||||
class="form-label"><?= lang('Importador.subirArchivo') ?? 'Subir archivo Excel' ?></label>
|
||||
class="form-label"><?= lang('Importador.subirArchivoRama') ?? 'Subir archivo Excel' ?></label>
|
||||
<input type="file" class="form-control" id="excelFile" name="excelFile"
|
||||
accept=".xlsx, .xls">
|
||||
</div>
|
||||
|
||||
@ -0,0 +1,249 @@
|
||||
<?= $this->include("themes/_commonPartialsBs/sweetalert") ?>
|
||||
<?= $this->include('themes/_commonPartialsBs/datatables') ?>
|
||||
<?= $this->include("themes/_commonPartialsBs/select2bs5") ?>
|
||||
<?= $this->extend('themes/vuexy/main/defaultlayout') ?>
|
||||
|
||||
|
||||
<?= $this->section('content'); ?>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4><?= $boxTitle ?>
|
||||
</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
|
||||
<?= view("themes/_commonPartialsBs/_alertBoxes") ?>
|
||||
|
||||
<input type="hidden" id="id" name="id" value="<?= $etiquetaEntity->id ?>">
|
||||
|
||||
<div class="accordion accordion-bordered">
|
||||
<div class="card accordion-item active mb-5">
|
||||
<h4 class="accordion-header px-4 py-3">
|
||||
<?= lang("Logistica.datosEnvio") ?>
|
||||
</h4>
|
||||
|
||||
<div id="accordionDatosEnvioTip" class="accordion-collapse collapse show">
|
||||
<div class="accordion-body px-4 py-3">
|
||||
<div class="d-flex flex-row mb-3">
|
||||
|
||||
<div class="col-sm-3 px-3">
|
||||
<label for="att" class="form-label">
|
||||
<?= lang("Logistica.cliente") ?>
|
||||
</label>
|
||||
<input readonly id="cliente" name="cliente" tabindex="1" maxlength="50"
|
||||
class="form-control" value="<?= old('att', $etiquetaEntity->cliente) ?>">
|
||||
</div>
|
||||
|
||||
<div class="col-sm-4 px-3">
|
||||
<label for="att" class="form-label">
|
||||
<?= lang("Logistica.att") ?>
|
||||
</label>
|
||||
<input readonly id="att" name="att" tabindex="1" maxlength="50"
|
||||
class="form-control" value="<?= old('att', $etiquetaEntity->att) ?>">
|
||||
</div>
|
||||
|
||||
<div class="col-sm-5 px-3">
|
||||
<label for="direccion" class="form-label">
|
||||
<?= lang("Logistica.direccion") ?>
|
||||
</label>
|
||||
<input readonly id="direccion" name="direccion" tabindex="1" maxlength="50"
|
||||
class="form-control"
|
||||
value="<?= old('direccion', $etiquetaEntity->direccion) ?>">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="d-flex flex-row mb-3">
|
||||
<div class="col-sm-9 px-3">
|
||||
<label for="comentarios" class="form-label">
|
||||
<?= lang("Logistica.comentariosEtiqueta") ?>
|
||||
</label>
|
||||
<input id="comentarios" name="comentarios" tabindex="1" maxlength="50"
|
||||
class="form-control"
|
||||
value="<?= old('comentarios', $etiquetaEntity->comentarios) ?>">
|
||||
</div>
|
||||
|
||||
<div class="col-sm-3 px-3">
|
||||
<button id="guardarComentarios" name="guardar_comentarios" tabindex="1"
|
||||
class="btn btn-primary mt-4 w-100">
|
||||
<?= lang("Logistica.guardar") ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="accordion accordion-bordered">
|
||||
<div class="card accordion-item active mb-5">
|
||||
<h4 class="accordion-header px-4 py-3">
|
||||
<?= lang("Logistica.addLineaEtiqueta") ?>
|
||||
</h4>
|
||||
|
||||
<div id="accordionaddLineasEnvioTip" class="accordion-collapse collapse show">
|
||||
|
||||
<div class="d-flex flex-row mb-3">
|
||||
<div class="col-sm-12 px-3">
|
||||
<p><?= lang('Logistica.addLineasText') ?></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="d-flex flex-row mb-3">
|
||||
<div class="col-sm-6 px-3">
|
||||
<label for="buscadorPedidos" class="form-label">
|
||||
<?= lang("Logistica.buscadorPedidosTitle2") ?>
|
||||
</label>
|
||||
<select id="buscadorPedidos" name="buscador_pedidos" tabindex="1" maxlength="50"
|
||||
class="form-control select2bs2" style="width: 100%;">
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-sm-2 px-3">
|
||||
<button id="btnAddLinea" name="btnBuscar" tabindex="1"
|
||||
class="btn btn-primary mt-4 w-100">
|
||||
<?= lang("Logistica.add") ?>
|
||||
<ti class="ti ti-circle-plus"></ti>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="accordion accordion-bordered">
|
||||
<div class="card accordion-item active mb-5">
|
||||
<h4 class="accordion-header px-4 py-3">
|
||||
<?= lang("Logistica.lineasEnvio") ?>
|
||||
</h4>
|
||||
|
||||
<div id="accordionDatosEnvioTip" class="accordion-collapse collapse show">
|
||||
<div class="accordion-body px-4 py-3">
|
||||
<div class="d-flex flex-row">
|
||||
<p><?= lang('Logistica.buttonsActions') ?></p>
|
||||
</div>
|
||||
<div class="d-flex flex-row mb-3 align-items-end">
|
||||
<div class="col-sm-2 px-3">
|
||||
<button id="btnSelectAll" name="btnSelectAll" tabindex="1"
|
||||
class="btn btn-primary w-100">
|
||||
<?= lang("Logistica.selectAll") ?>
|
||||
<i class="ti ti-select"></i>
|
||||
</button>
|
||||
</div>
|
||||
<div class="col-sm-2 px-3">
|
||||
<button id="btnEliminarLineas" name="btnEliminarLineas" tabindex="1"
|
||||
class="btn btn-danger w-100">
|
||||
<?= lang("Logistica.eliminar") ?>
|
||||
<i class="ti ti-trash"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-2 px-3">
|
||||
<button id="btnRenumber" name="btnRenumber" tabindex="1"
|
||||
class="btn btn-success w-100">
|
||||
<?= lang("Logistica.renumber") ?>
|
||||
<i class="ti ti-box"></i>
|
||||
</button>
|
||||
</div>
|
||||
<div class="col-sm-2 px-3">
|
||||
<button id="btnImprimirEtiquetas" name="btnImprimirEtiquetas" tabindex="1"
|
||||
class="btn btn-info w-100">
|
||||
<?= lang("Logistica.imprimirEtiquetas") ?>
|
||||
<i class="ti ti-printer"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-2 px-3 d-flex flex-column justify-content-end">
|
||||
<div class="d-flex flex-column justify-content-end h-100">
|
||||
<label for="impresoraEtiquetas" class="form-label">
|
||||
<?= lang("Logistica.impresoraEtiquetas") ?>
|
||||
</label>
|
||||
<select id="impresoraEtiquetas" name="impresora_etiquetas" tabindex="1"
|
||||
maxlength="50" class="form-control select2bs2" style="width: 100%;">
|
||||
<?php foreach ($etiquetaEntity->impresoras as $impresora): ?>
|
||||
<option value="<?= $impresora->id ?>">
|
||||
<?= $impresora->name ?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
|
||||
<table id="tableLineasEtiqueta" class="table table-striped table-hover w-100">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th style="max-width: 10%;"><?= lang("Logistica.otId") ?></th>
|
||||
<th style="max-width: 70%;"><?= lang("Logistica.titulo") ?></th>
|
||||
<th style="max-width: 10%;"><?= lang("Logistica.num_caja") ?></th>
|
||||
<th class="text-center" style="width: 10%;">
|
||||
<?= lang("Logistica.unidadesEnCaja") ?>
|
||||
</th>
|
||||
<th class="text-center" style="width: 10%;">
|
||||
<?= lang("Logistica.unidadesTotalesOt") ?>
|
||||
</th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th colspan="11">
|
||||
<div class="text-end">
|
||||
<?= lang("Logistica.unidadesTotalesFooter") ?>
|
||||
<span id="footer-unidades-envio"></span>
|
||||
</div>
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th colspan="11">
|
||||
<div class="text-end">
|
||||
<?= lang("Logistica.peso") ?>
|
||||
<span id="footer-peso"></span>
|
||||
</div>
|
||||
</th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
<?= $this->section('css') ?>
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/libs/sweetalert2/sweetalert2.css') ?>" />
|
||||
<link rel="stylesheet" href="https://cdn.datatables.net/rowreorder/1.4.1/css/rowReorder.dataTables.min.css">
|
||||
<link rel="stylesheet" href="https://code.jquery.com/ui/1.13.2/themes/base/jquery-ui.css">
|
||||
<link rel="stylesheet" href="<?= site_url("/themes/vuexy/vendor/libs/flatpickr/flatpickr.css") ?>">
|
||||
<link rel="stylesheet" href="https://cdn.datatables.net/rowreorder/1.4.1/css/rowReorder.dataTables.min.css">
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
<?= $this->section('additionalExternalJs') ?>
|
||||
<script src="https://code.jquery.com/ui/1.13.2/jquery-ui.min.js"></script>
|
||||
<script src="<?= site_url('themes/vuexy/vendor/libs/sweetalert2/sweetalert2.js') ?>"></script>
|
||||
<script src="https://cdn.datatables.net/rowgroup/1.3.1/js/dataTables.rowGroup.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/rowreorder/1.4.1/js/dataTables.rowReorder.min.js"></script>
|
||||
<script type="module" src="<?= site_url("assets/js/safekat/pages/logistica/etiquetaEdit.js") ?>"></script>
|
||||
<?= $this->endSection() ?>
|
||||
@ -0,0 +1,119 @@
|
||||
<?= $this->include("themes/_commonPartialsBs/sweetalert") ?>
|
||||
<?= $this->include('themes/_commonPartialsBs/datatables') ?>
|
||||
<?= $this->include("themes/_commonPartialsBs/select2bs5") ?>
|
||||
<?= $this->extend('themes/vuexy/main/defaultlayout') ?>
|
||||
|
||||
<?= $this->section('content'); ?>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4><?= $boxTitle ?></h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
|
||||
<?= view("themes/_commonPartialsBs/_alertBoxes") ?>
|
||||
|
||||
<div class="card accordion-item active mb-5">
|
||||
<h4 class="accordion-header px-4 py-3">
|
||||
<?= lang("Logistica.nuevaEtiqueta") ?>
|
||||
</h4>
|
||||
|
||||
<div id="accordionNuevaEtiquetaTip" class="accordion-collapse collapse show">
|
||||
<div class="accordion-body px-4 py-3">
|
||||
|
||||
<div class="row">
|
||||
<div class="mb-1 col-sm-6">
|
||||
<label for="buscadorPedidos" class="form-label">
|
||||
<?= lang("Logistica.buscadorPedidosTitle2") ?>
|
||||
</label>
|
||||
<select id="buscadorPedidos" name="buscador_pedidos" tabindex="1" maxlength="50"
|
||||
class="form-control select2bs2">
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row select-direcciones d-none">
|
||||
<div class="col-sm-6 px-3">
|
||||
<label for="selectDirecciones" class="form-label">
|
||||
<?= lang("Logistica.selectDirecciones") ?>
|
||||
</label>
|
||||
<select id="selectDirecciones" name="select_direcciones" tabindex="1" maxlength="50"
|
||||
class="form-control select2bs2" style="width: 100%;">
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row add-etiqueta d-none">
|
||||
<div class="col-sm-2 px-3">
|
||||
<button id="btnAddEtiqueta" name="btn_add_etiqueta" tabindex="1"
|
||||
class="btn btn-primary mt-4 w-100">
|
||||
<?= lang("Logistica.add") ?>
|
||||
<ti class="ti ti-circle-plus"></ti>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="card accordion-item active">
|
||||
<h4 class="accordion-header px-4 py-3">
|
||||
<?= lang("Logistica.listadoEtiquetas") ?>
|
||||
</h4>
|
||||
|
||||
<div id="accordionListadoEnviosTip" class="accordion-collapse collapse show">
|
||||
<div class="accordion-body px-4 py-3">
|
||||
|
||||
<div class="row">
|
||||
<table id="tableOfEquiquetas" class="table table-striped table-hover w-100">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="max-width: 8%;"><?= lang('Logistica.id') ?? 'ID Envío' ?></th>
|
||||
<th style="max-width: 10%;"><?= lang('Logistica.numeroOts') ?? 'Nº OTs' ?></th>
|
||||
<th style="max-width: 8%;"><?= lang('Logistica.numeroCajas') ?? 'Nº Cajas' ?></th>
|
||||
<th><?= lang('Logistica.att') ?? 'Att' ?></th>
|
||||
<th><?= lang('Logistica.direccion') ?? 'Dirección' ?></th>
|
||||
<th style="max-width: 120px;"><?= lang('Logistica.acciones') ?? 'Acciones' ?></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><input type="text" class="form-control envio-filter" name="id"></th>
|
||||
<th><input type="text" class="form-control envio-filter-ots" name="ots"></th>
|
||||
<th></th>
|
||||
<th><input type="text" class="form-control envio-filter" name="att"></th>
|
||||
<th><input type="text" class="form-control envio-filter" name="direccion"></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-3">
|
||||
<button type="button" class="btn btn-secondary" id="btnBackToPanel"
|
||||
onclick="window.location.href='<?= route_to('LogisticaPanel') ?>'">
|
||||
<?= lang('Logistica.backToPanel') ?>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
|
||||
<?= $this->section('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/logistica/impresionEtiquetas.js") ?>"></script>
|
||||
<?= $this->endSection() ?>
|
||||
@ -21,7 +21,7 @@
|
||||
<img src="<?= site_url("assets/img/logistica/envios_ferros.png") ?>" alt="Envío de Ferros/Prototipos">
|
||||
<div><span><?= lang("Logistica.envioFerros"); ?></span></div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<div class="item" onclick="location.href='<?= route_to('etiquetasLogistica') ?>'">
|
||||
<img src="<?= site_url("assets/img/logistica/impresionEtiquetas.jpg") ?>" alt="Etiquetas de títulos">
|
||||
<div><span><?= lang("Logistica.etiquetasTitulos"); ?></span></div>
|
||||
</div>
|
||||
|
||||
@ -0,0 +1,63 @@
|
||||
<?= $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="viewMaquinistaFichajeAuto" data-id="<?= $maquinaEntity->id ?>">
|
||||
<div class="col-md-12">
|
||||
<div class="d-flex flex-row justify-content-end align-items-stretch mb-2 gap-2">
|
||||
<a type="button" id="tarea-list-link" class="btn btn-primary" href="<?= route_to('viewProduccionMaquinaTareasList', $maquinaEntity->id) ?>"><span class="icon-base ti ti-list ti-xs me-1"></span> <?= lang('Produccion.maquinista.tarea_list') ?></a>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row mb-2">
|
||||
|
||||
<div class="col-md-8 mb-2">
|
||||
<div class="alert alert-primary h-100 w-100" role="alert">
|
||||
<h4 class="alert-heading d-flex align-items-center gap-1"><span style="color:red">AUTO: </span><span class="fs-bold"><?= $maquinaEntity->nombre ?></span></h4>
|
||||
<hr>
|
||||
<p class="mb-0">
|
||||
<?= lang('Produccion.maquinista.fichaje_auto_alert_text') ?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4 mb-2">
|
||||
<label for="ot-id" class="form-label"><strong><?= lang('Produccion.maquinista.next_ot') ?></strong></label>
|
||||
<input type="text" class="form-control h-50 fs-large" id="ot-id" name="orden_trabajo_id" placeholder="<?= lang('Produccion.maquinista.placeholder_ot_id') ?>">
|
||||
<div class="fs-medium fs-bold mt-2"><?= lang('Produccion.maquinista.fa_ot_input_form_text') ?></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<?= view('themes/_commonPartialsBs/_alertBoxes'); ?>
|
||||
</div>
|
||||
<div class="row mb-2 section-block d-none" id="ot-fa-card">
|
||||
<div class="col-md-12">
|
||||
<?= view('/themes/vuexy/components/cards/tarea_card_auto.php') ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
<?= $this->section('css') ?>
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/libs/formvalidation/dist/css/formValidation.min.css') ?>" />
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/css/maquinista.css') ?>" />
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/libs/notiflix/notiflix.css') ?>" />
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/libs/sweetalert2/sweetalert2.css') ?>" />
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/libs/spinkit/spinkit.css') ?>" />
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
<?= $this->section("additionalExternalJs") ?>
|
||||
<script src="<?= site_url("themes/vuexy/vendor/libs/notiflix/notiflix.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/sweetalert2/sweetalert2.js') ?>"></script>
|
||||
<script type="module" src="<?= site_url("/assets/js/safekat/pages/configuracion/maquinista/viewFichajeAuto.js") ?>"></script>
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
@ -18,7 +18,7 @@
|
||||
<div class="row" id="maquinas-impresion">
|
||||
<?php foreach ($maquinas["impresion"] as $key => $maquina): ?>
|
||||
<div class="col-md-4 col-sm-2 col-lg-3 col-xs-12 mb-2 h-100 p-2">
|
||||
<a href="<?= route_to("viewProduccionMaquinaTareasList", $maquina["maquinaId"]) ?>" type="button" class="maquina-btn btn btn-outline-primary w-100">
|
||||
<a href="<?= route_to("viewProduccionMaquinaTareasList", $maquina["maquinaId"]) ?>" type="button" class="maquina-btn btn btn-outline-<?= $maquina['countMaquinaTareas'] > 0 ? "danger" : "primary" ?> w-100">
|
||||
<span class="d-sm-inline-flex justify-content-between align-items-center gap-2">
|
||||
<?= $maquina["nombre"] ?>
|
||||
<?php if ($maquina["countTareas"] > 0): ?>
|
||||
@ -39,7 +39,7 @@
|
||||
<div class="row" id="maquinas-acabado">
|
||||
<?php foreach ($maquinas["acabado"] as $key => $maquina): ?>
|
||||
<div class="col-md-4 col-sm-2 col-lg-3 col-xs-12 mb-2 h-100 p-2">
|
||||
<a href="<?= route_to("viewProduccionMaquinaTareasList", $maquina["maquinaId"]) ?>" type="button" class="maquina-btn btn btn-outline-primary w-100">
|
||||
<a href="<?= route_to("viewProduccionMaquinaTareasList", $maquina["maquinaId"]) ?>" type="button" class="maquina-btn btn btn-outline-<?= $maquina['countMaquinaTareas'] > 0 ? "danger" : "primary" ?> w-100">
|
||||
<span class="d-sm-inline-flex justify-content-between align-items-center gap-2">
|
||||
<?= $maquina["nombre"] ?>
|
||||
<?php if ($maquina["countTareas"] > 0): ?>
|
||||
@ -60,7 +60,7 @@
|
||||
<div class="row" id="maquinas-manipulado">
|
||||
<?php foreach ($maquinas["manipulado"] as $key => $maquina): ?>
|
||||
<div class="col-md-4 col-sm-2 col-lg-3 col-xs-12 mb-2 h-100 p-2">
|
||||
<a href="<?= route_to("viewProduccionMaquinaTareasList", $maquina["maquinaId"]) ?>" type="button" class="maquina-btn btn btn-outline-primary w-100">
|
||||
<a href="<?= route_to("viewProduccionMaquinaTareasList", $maquina["maquinaId"]) ?>" type="button" class="maquina-btn btn btn-outline-<?= $maquina['countMaquinaTareas'] > 0 ? "danger" : "primary" ?> w-100">
|
||||
<span class="d-sm-inline-flex justify-content-between align-items-center gap-2">
|
||||
<?= $maquina["nombre"] ?>
|
||||
<?php if ($maquina["countTareas"] > 0): ?>
|
||||
|
||||
@ -11,23 +11,27 @@ use CodeIgniter\I18n\Time;
|
||||
?>
|
||||
<div class="row" id="viewMaquinistaMaquinaTareas" data-id="<?= $maquinaEntity->id ?>">
|
||||
<div class="col-md-12">
|
||||
<div class="d-flex flex-row justify-content-end align-items-stretch mb-2 gap-2">
|
||||
<a type="button" href="<?= route_to('viewMaquinistaFichajeAutomatico', $maquinaEntity->id) ?>" id="btn-fichaje-automatico" class="btn btn-primary" aria-pressed="true"><span class="icon-base ti ti-wand ti-xs me-1"></span> <?= lang('Produccion.maquinista.fichaje_auto') ?></a>
|
||||
<a type="button" href="<?= route_to('viewMaquinistaTareaScan', $maquinaEntity->id) ?>" id="btn-tarea-scan" class="btn btn-primary" aria-pressed="true"><span class="icon-base ti ti-scan ti-xs me-1"></span><?= lang('Produccion.maquinista.scan') ?></a>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div id="tareas-aplazadas" class="d-none">
|
||||
<?= view("/themes/vuexy/components/tables/maquinista_tarea_table.php", ["id" => "maquinista-tarea-aplazada-table"]) ?>
|
||||
</div>
|
||||
<div class="row mb-2 align-items-center">
|
||||
<div class="col-md-6 col-xs-12 justify-content-start ">
|
||||
<div class="d-flex flex-row justify-content-center align-items-stretch gap-2 h-100">
|
||||
<button type="button" id="btn-tareas-hoy" class="btn btn-primary h-100 active w-50" aria-pressed="true"><?= lang('Produccion.maquinista.tareas_hoy') ?></button>
|
||||
<button type="button" id="btn-all-tareas" class="btn btn-primary h-100 w-50"><?= lang('Produccion.maquinista.tareas_all') ?></button>
|
||||
<div class="d-flex flex-row justify-content-start align-items-stretch gap-2 h-100">
|
||||
<button type="button" id="btn-tareas-hoy" class="btn btn-primary h-100 active" aria-pressed="true"><?= lang('Produccion.maquinista.tareas_hoy') ?></button>
|
||||
<button type="button" id="btn-all-tareas" class="btn btn-primary h-100"><?= lang('Produccion.maquinista.tareas_all') ?></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6 col-xs-12 justify-content-end d-flex">
|
||||
<span class="display-6" id="today-date"><?= Time::now()->format('d/m/Y') ?></span>
|
||||
</div>
|
||||
<!-- <div class="d-flex flex-row justify-content-end align-content-center gap-2">
|
||||
<button type="button" class="btn btn-primary"><?= lang('Produccion.maquinista.maquinas') ?></button>
|
||||
</div> -->
|
||||
</div>
|
||||
<?= view("/themes/vuexy/components/tables/maquinista_tarea_table.php") ?>
|
||||
<?= view("/themes/vuexy/components/tables/maquinista_tarea_table.php", ["id" => "maquinista-tarea-table"]) ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -0,0 +1,87 @@
|
||||
<?= $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="viewMaquinistaTareaScan" data-id="<?= $maquinaEntity->id ?>">
|
||||
<div class="col-md-12">
|
||||
<div class="d-flex flex-row justify-content-end align-items-stretch mb-2 gap-2">
|
||||
<a type="button" id="tarea-list-link" class="btn btn-primary" href="<?= route_to('viewProduccionMaquinaTareasList', $maquinaEntity->id) ?>"><span class="icon-base ti ti-list ti-xs me-1"></span> <?= lang('Produccion.maquinista.tarea_list') ?></a>
|
||||
</div>
|
||||
<div class="card section-block">
|
||||
<div class="card-body">
|
||||
<h4 class="alert-heading d-flex align-items-center gap-1"><span style="color:red">ESCANEAR: </span><span class="fs-bold"><?= $maquinaEntity->nombre ?></span></h4>
|
||||
<?= view('themes/_commonPartialsBs/_alertBoxes'); ?>
|
||||
<div class="row ot-scan-wrapper">
|
||||
<div class="col-md-4">
|
||||
<button type="button" class="btn btn-danger" id="btn-reset-ots">
|
||||
<span class="icon-base ti ti-trash me-1"></span>
|
||||
<?= lang('Produccion.maquinista.reset') ?>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-2 ot-scan-wrapper">
|
||||
<div class="col-md-8 mb-2">
|
||||
|
||||
<div class="table-responsive">
|
||||
<table id="table-scanned-ots" class="table-maquinista table table-hover table-sm">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= lang('Produccion.datatable.ot_id') ?></th>
|
||||
<th><?= lang('Produccion.datatable.titulo') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
|
||||
<div class="col-md-12 mb-2">
|
||||
<label for="ot-id" class="form-label"><strong><?= lang('Produccion.maquinista.next_ot') ?></strong></label>
|
||||
<input type="text" class="form-control h-50 fs-large" id="ot-id" name="orden_trabajo_id" placeholder="<?= lang('Produccion.maquinista.placeholder_ot_id') ?>">
|
||||
<div class="fs-medium fs-bold mt-2"><?= lang('Produccion.maquinista.scan_ot_input_form_text') ?></div>
|
||||
</div>
|
||||
<div class="col-md-12 mb-2">
|
||||
<button type="button" class="maquina-btn btn btn-primary w-100" id="btn-save-maquina-ots" disabled>
|
||||
<span class="icon-base ti ti-arrow-big-right me-1"></span>
|
||||
<?= lang('Produccion.maquinista.next_scan_ot') ?>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12 d-none" id="ot-maquina-tareas-link">
|
||||
<a class="maquina-btn btn btn-primary w-100" href="<?= route_to('viewProduccionMaquinistaOtTareasView', $maquinaEntity->id) ?>">
|
||||
<span class="icon-base ti ti-arrow-big-right me-1"></span>
|
||||
<?= lang('Produccion.maquinista.next_scan_ot') ?>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
<?= $this->section('css') ?>
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/libs/formvalidation/dist/css/formValidation.min.css') ?>" />
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/css/maquinista.css') ?>" />
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/libs/notiflix/notiflix.css') ?>" />
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/libs/sweetalert2/sweetalert2.css') ?>" />
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/libs/spinkit/spinkit.css') ?>" />
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
<?= $this->section("additionalExternalJs") ?>
|
||||
<script src="<?= site_url("themes/vuexy/vendor/libs/notiflix/notiflix.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/sweetalert2/sweetalert2.js') ?>"></script>
|
||||
<script type="module" src="<?= site_url("/assets/js/safekat/pages/configuracion/maquinista/viewMaquinistaScan.js") ?>"></script>
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
@ -0,0 +1,81 @@
|
||||
<?= $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="viewProduccionMaquinistaOtTareasView" data-id="<?= $maquinaEntity->id ?>">
|
||||
<div class="nav-align-top">
|
||||
<ul class="nav nav-pills mb-4 nav-fill" role="tablist">
|
||||
<li class="nav-item mb-1 mb-sm-0">
|
||||
<button
|
||||
type="button"
|
||||
class="nav-link active"
|
||||
role="tab"
|
||||
data-bs-toggle="tab"
|
||||
data-bs-target="#navs-tarea"
|
||||
aria-controls="navs-tarea"
|
||||
aria-selected="true">
|
||||
<span class="d-none d-sm-inline-flex align-items-center">
|
||||
<?= lang('Produccion.ots') ?>
|
||||
</span>
|
||||
<i class="icon-base ti tabler-home icon-sm d-sm-none"></i>
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane fade show active" id="navs-tarea">
|
||||
<div class="container-fluid h-100">
|
||||
<?= view('themes/_commonPartialsBs/_alertBoxes'); ?>
|
||||
<div class="row tarea-card-action-block">
|
||||
<div class="col-md-6 mb-2">
|
||||
|
||||
<div class="table-responsive">
|
||||
<table id="table-scanned-ots" class="table-maquinista table table-hover table-sm">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="w-20"><?= lang('Produccion.datatable.ot_id') ?></th>
|
||||
<th class="w-30"><?= lang('Produccion.datatable.titulo') ?></th>
|
||||
<th class="w-40"><?= lang('Produccion.datatable.barcode') ?></th>
|
||||
<th class="w-10"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6 mb-2">
|
||||
<?= view("/themes/vuexy/components/cards/tarea_multiple_card_actions.php") ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
<?= $this->section('css') ?>
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/libs/formvalidation/dist/css/formValidation.min.css') ?>" />
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/css/maquinista.css') ?>" />
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/libs/notiflix/notiflix.css') ?>" />
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/libs/sweetalert2/sweetalert2.css') ?>" />
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/libs/spinkit/spinkit.css') ?>" />
|
||||
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
<?= $this->section("additionalExternalJs") ?>
|
||||
<script src="<?= site_url("themes/vuexy/vendor/libs/notiflix/notiflix.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/sweetalert2/sweetalert2.js') ?>"></script>
|
||||
<script type="module" src="<?= site_url("/assets/js/safekat/pages/configuracion/maquinista/viewTareaMultipleView.js") ?>"></script>
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
@ -1,6 +1,195 @@
|
||||
<div class="accordion accordion-bordered mt-3" id="accordionComentarios">
|
||||
<div class="card accordion-item active">
|
||||
<h2 class="accordion-header" id="headingOne">
|
||||
<button type="button" class="accordion-button" data-bs-toggle="collapse"
|
||||
data-bs-target="#accordionComentariosTip" aria-expanded="false"
|
||||
aria-controls="accordionComentariosTip">
|
||||
<div class="d-flex flex-row justify-content-start align-items-stretch gap-2">
|
||||
<span><i class="ti-quote ti-md ti"></i></span>
|
||||
<h4> <?= lang('Produccion.comentarios') ?> </h4>
|
||||
</div>
|
||||
</button>
|
||||
</h2>
|
||||
|
||||
<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>
|
||||
<div id="accordionComentariosTip" class="accordion-collapse collapse show"
|
||||
data-bs-parent="#accordionComentarios">
|
||||
<div class="accordion-body">
|
||||
<div class="nav-align-top mb-4">
|
||||
<ul class="nav nav-pills mb-3" role="tablist">
|
||||
<li class="nav-item">
|
||||
<button
|
||||
type="button"
|
||||
class="nav-link active"
|
||||
role="tab"
|
||||
data-bs-toggle="tab"
|
||||
data-bs-target="#comentarios-ot"
|
||||
aria-controls="comentarios-ot"
|
||||
aria-selected="true">
|
||||
<?= lang("Produccion.comentariosOt") ?>
|
||||
|
||||
</button>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<button
|
||||
type="button"
|
||||
class="nav-link"
|
||||
role="tab"
|
||||
data-bs-toggle="tab"
|
||||
data-bs-target="#comentarios-interior"
|
||||
aria-controls="comentarios-interior"
|
||||
aria-selected="true">
|
||||
<?= lang("Produccion.comentariosImpresionInterior") ?>
|
||||
|
||||
</button>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<button
|
||||
type="button"
|
||||
class="nav-link"
|
||||
role="tab"
|
||||
data-bs-toggle="tab"
|
||||
data-bs-target="#comentarios-cubierta"
|
||||
aria-controls="comentarios-cubierta"
|
||||
aria-selected="false">
|
||||
<?= lang("Produccion.comentariosCubierta") ?>
|
||||
|
||||
</button>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<button
|
||||
type="button"
|
||||
class="nav-link"
|
||||
role="tab"
|
||||
data-bs-toggle="tab"
|
||||
data-bs-target="#comentarios-encuadernacion"
|
||||
aria-controls="comentarios-encuadernacion"
|
||||
aria-selected="false">
|
||||
<?= lang("Produccion.comentariosEncuadernacion") ?>
|
||||
|
||||
</button>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<button
|
||||
type="button"
|
||||
class="nav-link"
|
||||
role="tab"
|
||||
data-bs-toggle="tab"
|
||||
data-bs-target="#comentarios-logistica"
|
||||
aria-controls="comentarios-logistica"
|
||||
aria-selected="false">
|
||||
<?= lang("Produccion.comentariosLogistica") ?>
|
||||
|
||||
</button>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<button
|
||||
type="button"
|
||||
class="nav-link"
|
||||
role="tab"
|
||||
data-bs-toggle="tab"
|
||||
data-bs-target="#info-solapa-guillotina"
|
||||
aria-controls="info-solapa-guillotina"
|
||||
aria-selected="false">
|
||||
<?= lang("Produccion.info_solapa_guillotina") ?>
|
||||
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tab-content border border-container">
|
||||
<div class="tab-pane fade show active" id="comentarios-ot" role="tabpanel">
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-lg-12 px-4">
|
||||
<div class="mb-3">
|
||||
<textarea
|
||||
rows="3"
|
||||
name="comentarios"
|
||||
class="ot-comment w-100"
|
||||
style="height: 10em;"
|
||||
class="form-control"><?= $ot->comentarios ?></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="comentarios-interior" role="tabpanel">
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-lg-12 px-4">
|
||||
<div class="mb-3">
|
||||
<textarea
|
||||
rows="3"
|
||||
name="comment_interior"
|
||||
class="ot-comment w-100"
|
||||
style="height: 10em;"
|
||||
class="form-control"><?= $ot->comment_interior ?></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="comentarios-cubierta" role="tabpanel">
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-lg-12 px-4">
|
||||
<div class="mb-3">
|
||||
<textarea
|
||||
rows="3"
|
||||
name="comment_cubierta"
|
||||
class="ot-comment w-100"
|
||||
style="height: 10em;"
|
||||
class="form-control"><?= $ot->comment_cubierta ?></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="comentarios-encuadernacion" role="tabpanel">
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-lg-12 px-4">
|
||||
<div class="mb-3">
|
||||
<textarea
|
||||
rows="3"
|
||||
name="comment_encuadernacion"
|
||||
class="ot-comment w-100"
|
||||
style="height: 10em;"
|
||||
class="form-control"><?= $ot->comment_encuadernacion ?></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="comentarios-logistica" role="tabpanel">
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-lg-12 px-4">
|
||||
<div class="mb-3">
|
||||
<textarea
|
||||
rows="3"
|
||||
name="comment_logistica"
|
||||
class="ot-comment w-100"
|
||||
style="height: 10em;"
|
||||
class="form-control"><?= $ot->comment_logistica ?></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="tab-pane fade" id="info-solapa-guillotina" role="tabpanel">
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-lg-12 px-4">
|
||||
<div class="mb-3">
|
||||
<textarea
|
||||
rows="3"
|
||||
name="info_solapa_guillotina"
|
||||
class="ot-comment w-100"
|
||||
style="height: 10em;"
|
||||
class="form-control"><?= $ot->info_solapa_guillotina ?></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> <!-- //.accordion-body -->
|
||||
</div> <!-- //.accordion-collapse -->
|
||||
</div> <!-- //.accordion-item -->
|
||||
</div> <!-- //.accordion -->
|
||||
@ -22,7 +22,11 @@
|
||||
<i class="ti ti-dimensions ti-lg"></i>
|
||||
</div>
|
||||
<div class="card-info">
|
||||
<h5 class="mb-0" id="ot-formato"><?=$presupuesto->papel_formato()->ancho?>x<?=$presupuesto->papel_formato()->alto?></h5>
|
||||
<?php if ($presupuesto->papel_formato_personalizado): ?>
|
||||
<h5 class="mb-0" id="ot-formato"><?= $presupuesto->papel_formato_ancho ?>x<?= $presupuesto->papel_formato_alto ?></h5>
|
||||
<?php else: ?>
|
||||
<h5 class="mb-0" id="ot-formato"><?= $presupuesto->papel_formato()->ancho ?>x<?= $presupuesto->papel_formato()->alto ?></h5>
|
||||
<?php endif; ?>
|
||||
<span class="fx-large"><?= @lang("Produccion.formato") ?></span>
|
||||
</div>
|
||||
</div>
|
||||
@ -33,30 +37,32 @@
|
||||
<i class="ti ti-box-multiple ti-lg"></i>
|
||||
</div>
|
||||
<div class="card-info">
|
||||
<h5 class="mb-0" id="ot-paginas"><?=$presupuesto->paginas?></h5>
|
||||
<h5 class="mb-0" id="ot-paginas"><?= $presupuesto->paginas ?></h5>
|
||||
<span class="fx-large"><?= @lang("Produccion.paginas") ?></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2 col-6">
|
||||
<div class="d-flex align-items-center">
|
||||
<div class="badge rounded-pill bg-label-danger me-3 p-2">
|
||||
<i class="ti ti-bookmark ti-lg"></i>
|
||||
</div>
|
||||
<div class="card-info">
|
||||
<h5 class="mb-0" id="ot-solapa"><?=$presupuesto->solapas > 0 ? $presupuesto->solapas : 0?></h5>
|
||||
<?php if ($presupuesto->solapas): ?>
|
||||
<div class="col-md-2 col-6">
|
||||
<div class="d-flex align-items-center">
|
||||
<div class="badge rounded-pill bg-label-danger me-3 p-2">
|
||||
<i class="ti ti-bookmark ti-lg"></i>
|
||||
</div>
|
||||
<div class="card-info">
|
||||
<h5 class="mb-0" id="ot-solapa"><?= number_format($presupuesto->solapas_ancho, 2, ',', '.') ?> mm</h5>
|
||||
|
||||
<span class="fx-large"><?= @lang("Produccion.solapa") ?></span>
|
||||
<span class="fx-large"><?= @lang("Produccion.solapa") ?></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="col-md-2 col-6">
|
||||
<div class="d-flex align-items-center">
|
||||
<div class="badge rounded-pill bg-label-success me-3 p-2">
|
||||
<i class="ti ti-books ti-lg"></i>
|
||||
</div>
|
||||
<div class="card-info">
|
||||
<h5 class="mb-0" id="ot-tirada"><?=$presupuesto->tirada?></h5>
|
||||
<h5 class="mb-0" id="ot-tirada"><?= $presupuesto->tirada ?></h5>
|
||||
|
||||
<span class="fx-large"><?= @lang("Produccion.tirada") ?></span>
|
||||
</div>
|
||||
@ -68,7 +74,7 @@
|
||||
<i class="ti ti-notebook ti-lg"></i>
|
||||
</div>
|
||||
<div class="card-info">
|
||||
<h5 class="mb-0" id="ot-merma"><?=$presupuesto->merma?></h5>
|
||||
<h5 class="mb-0" id="ot-merma"><?= $presupuesto->merma ?></h5>
|
||||
|
||||
<span class="fx-large"><?= @lang("Produccion.merma") ?></span>
|
||||
</div>
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<?= view("themes/vuexy/components/dropzone",data: ['id' => 'dropzone-ot-files','modelId' => $modelId]) ?>
|
||||
<?= view("themes/vuexy/components/dropzone",data: ['id' => 'dropzone-ot-files','modelId' => $presupuesto->id]) ?>
|
||||
</div><!--//.col -->
|
||||
</div><!--//.row -->
|
||||
@ -42,9 +42,17 @@
|
||||
<span class="ti-sm ti ti-truck-delivery me-1"></span>
|
||||
Pedido
|
||||
</a>
|
||||
<a type="button" class="btn btn-danger btn-block mb-1" target="__blank" href="<?= "/produccion/ordentrabajo/pdf/" . $modelId ?>">
|
||||
<span class="ti-sm ti ti-file me-1"></span>
|
||||
PDF</a>
|
||||
<?php if ($presupuesto->ferro == 1): ?>
|
||||
<?php if ($ot->dates()->ferro_ok_at != null): ?>
|
||||
<a type="button" class="btn btn-danger btn-block mb-1" target="__blank" href="<?= "/produccion/ordentrabajo/pdf/" . $modelId ?>">
|
||||
<span class="ti-sm ti ti-file me-1"></span>
|
||||
PDF</a>
|
||||
<?php endif; ?>
|
||||
<?php else: ?>
|
||||
<a type="button" class="btn btn-danger btn-block mb-1" target="__blank" href="<?= "/produccion/ordentrabajo/pdf/" . $modelId ?>">
|
||||
<span class="ti-sm ti ti-file me-1"></span>
|
||||
PDF</a>
|
||||
<?php endif; ?>
|
||||
<a type="button" href="<?= route_to('getOrdenTrabajoBarCode', $modelId) ?>" class="btn btn-secondary btn-block mb-1" download><span class="ti-sm ti ti-barcode me-1"></span><?= @lang("Produccion.imprimir_codigo_safekat") ?></a>
|
||||
|
||||
|
||||
|
||||
@ -12,16 +12,38 @@
|
||||
|
||||
<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">
|
||||
<div class="row justify-content-start align-items-center">
|
||||
<div class="col-md-8 mb-3">
|
||||
<label class="form-label" for="ot-progress-bar-parent"><?= @lang("App.progress") ?></label>
|
||||
<div class="progress" style="height: 25px;" 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 class="col-md-2 col-6">
|
||||
<div class="d-flex align-items-center">
|
||||
<div class="badge rounded-pill bg-label-primary me-3 p-2">
|
||||
<i class="ti ti-clock ti-lg"></i>
|
||||
</div>
|
||||
<div class="card-info">
|
||||
<h5 class="mb-0 tiempo-estimado" id="ot-tiempo-estimado"><?= $tiempo_estimado ?></h5>
|
||||
<span class="fx-large"><?= @lang("Produccion.tiempo_estimado") ?></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2 col-6">
|
||||
<div class="d-flex align-items-center">
|
||||
<div class="badge rounded-pill bg-label-warning me-3 p-2">
|
||||
<i class="ti ti-clock ti-lg"></i>
|
||||
</div>
|
||||
<div class="card-info">
|
||||
<h5 class="mb-0 tiempo-estimado" id="tiempo-total"></h5>
|
||||
<span class="fx-large"><?= @lang("Produccion.tiempo_consumido") ?></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-3 <?= $user_dates["pre_formato_at"]||$user_dates["pre_lomo_at"]||$user_dates["pre_solapa_at"]||$user_dates["pre_codbarras_at"]||$user_dates["pre_imposicion_at"] ? "" : "d-none" ?>">
|
||||
<div class="row mb-2">
|
||||
<div class="col-md-3 <?= $user_dates["pre_formato_at"] || $user_dates["pre_lomo_at"] || $user_dates["pre_solapa_at"] || $user_dates["pre_codbarras_at"] || $user_dates["pre_imposicion_at"] ? "" : "d-none" ?>">
|
||||
<!-- PREIMPRESION -->
|
||||
<!-- Preformato -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100">
|
||||
@ -136,30 +158,90 @@
|
||||
</div>
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $flags["isCubierta"] ? "" : "d-none" ?>">
|
||||
<label for="ot-portada" class="form-label"><?= @lang("Produccion.cubierta") ?></label>
|
||||
<label for="ot-cubierta" class="form-label"><?= @lang("Produccion.cubierta") ?></label>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="cubierta_at" id="ot-portada" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="cubierta_at" id="ot-cubierta" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
|
||||
</div>
|
||||
<div class="form-text"><?= $user_dates["cubierta_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
|
||||
|
||||
</div>
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $flags["isSobrecubierta"] ? "" : "d-none" ?>">
|
||||
<label for="ot-sobrecubierta" class="form-label"><?= @lang("Produccion.sobrecubierta") ?></label>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="sobrecubierta_at" id="ot-sobrecubierta" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
|
||||
</div>
|
||||
<div class="form-text"><?= $user_dates["sobrecubierta_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
|
||||
|
||||
</div>
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $flags["isGuarda"] ? "" : "d-none" ?>">
|
||||
<label for="ot-guarda" class="form-label"><?= @lang("Produccion.guarda") ?></label>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="guarda_at" id="ot-guarda" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
|
||||
</div>
|
||||
<div class="form-text"><?= $user_dates["guarda_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100">
|
||||
<h4 class="text-truncate"><?= lang("Produccion.progress_manipulado") ?></h4>
|
||||
</div>
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $flags["isPlastificado"] ? "" : "d-none" ?>">
|
||||
<label for="ot-plastificado-mate" class="form-label"><?= @lang("Produccion.plastificado_mate") ?></label>
|
||||
<label for="ot-plastificado" class="form-label"><?= @lang("Produccion.plastificado") ?></label>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="plastificado_at" id="ot-plastificado-mate" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="plastificado_at" id="ot-plastificado" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
|
||||
</div>
|
||||
<div class="form-text"><?= $user_dates["plastificado_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100">
|
||||
<h4><?= lang("Produccion.progress_manipulado") ?></h4>
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $flags["isPlakene"] ? "" : "d-none" ?>">
|
||||
<label for="ot-plakene" class="form-label"><?= @lang("Produccion.plakene") ?></label>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="plakene_at" id="ot-plakene" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
|
||||
</div>
|
||||
<div class="form-text"><?= $user_dates["plakene_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
|
||||
|
||||
</div>
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $flags["isRetractilado"] ? "" : "d-none" ?>">
|
||||
<label for="ot-retractilado" class="form-label"><?= @lang("Produccion.retractilado") ?></label>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="retractilado_at" id="ot-retractilado" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
|
||||
</div>
|
||||
<div class="form-text"><?= $user_dates["retractilado_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
|
||||
|
||||
</div>
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $flags["isUVI"] ? "" : "d-none" ?>">
|
||||
<label for="ot-uvi" class="form-label"><?= @lang("Produccion.uvi") ?></label>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="uvi_at" id="ot-uvi" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
|
||||
</div>
|
||||
<div class="form-text"><?= $user_dates["uvi_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
|
||||
|
||||
</div>
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $flags["isEstampado"] ? "" : "d-none" ?>">
|
||||
<label for="ot-estampado" class="form-label"><?= @lang("Produccion.estampado") ?></label>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="estampado_at" id="ot-estampado" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
|
||||
</div>
|
||||
<div class="form-text"><?= $user_dates["estampado_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
|
||||
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $presupuesto->cosido ? "" : "d-none" ?>">
|
||||
<label for="ot-prep-cosido" class="form-label"><?= @lang("Produccion.cosido") ?></label>
|
||||
@ -187,35 +269,6 @@
|
||||
</div>
|
||||
<div class="form-text"><?= $user_dates["solapa_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
|
||||
</div>
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $presupuesto->retractilado ? "" : "d-none" ?>">
|
||||
<label for="ot-prep-retractilado" class="form-label"><?= @lang("Produccion.retractilado") ?></label>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="retractilado_at" id="ot-prep-retractilado" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
|
||||
</div>
|
||||
<div class="form-text"><?= $user_dates["retractilado_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
|
||||
</div>
|
||||
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $presupuesto->retractilado5 ? "" : "d-none" ?>">
|
||||
<label for="ot-prep-retractilado5" class="form-label"><?= @lang("Produccion.retractilado5") ?></label>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="retractilado5_at" id="ot-prep-retractilado5" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
|
||||
</div>
|
||||
<div class="form-text"><?= $user_dates["retractilado5_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
|
||||
</div>
|
||||
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $presupuesto->prototipo ? "" : "d-none" ?>">
|
||||
<label for="ot-prep-prototipo" class="form-label"><?= @lang("Produccion.prototipo") ?></label>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="prototipo_at" id="ot-prep-prototipo" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
|
||||
</div>
|
||||
<div class="form-text"><?= $user_dates["prototipo_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
|
||||
</div>
|
||||
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $presupuesto->marcapaginas ? "" : "d-none" ?>">
|
||||
@ -237,13 +290,23 @@
|
||||
|
||||
</div>
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $flags["isEspiral"] ? "" : "d-none" ?>">
|
||||
<label for="ot-espiral" class="form-label"><?= @lang("Produccion.espiral") ?></label>
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= count($ot->tareas_manipulado()) > 0 ? "" : "d-none" ?>">
|
||||
<label for="ot-manipulado" class="form-label"><?= @lang("Produccion.manipulado") ?></label>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="espiral_at" id="ot-espiral" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="entrada_manipulado_at" id="ot-manipulado" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
|
||||
</div>
|
||||
<div class="form-text"> <?= $user_dates["espiral_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
|
||||
<div class="form-text"> <?= $user_dates["entrada_manipulado_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
|
||||
|
||||
</div>
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= count($ot->tareas_encuadernado()) > 0 ? "" : "d-none" ?>">
|
||||
<label for="ot-encuadernacion" class="form-label"><?= @lang("Produccion.encuadernacion") ?></label>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="encuadernacion_at" id="ot-encuadernacion" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
|
||||
</div>
|
||||
<div class="form-text"> <?= $user_dates["encuadernacion_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@ -277,14 +340,7 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="row">
|
||||
<p><?= @lang("Produccion.tiempo_estimado") ?> : <?= $tiempo_estimado ?> (HH:MM)</p>
|
||||
</div>
|
||||
<div class="row">
|
||||
<p><?= @lang("Produccion.tiempo_consumido") ?> :</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="d-flex flex-row justify-content-between align-items-center">
|
||||
@ -301,12 +357,31 @@
|
||||
<span class="switch-label fw-lg"><?= @lang("Produccion.pedido_espera") ?></span>
|
||||
<span class="badge text-bg-warning fw-lg" id="pedido_espera_by"></span>
|
||||
</label>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12 mt-2">
|
||||
<div class="d-flex flex-row justify-content-between align-items-center">
|
||||
|
||||
<label class="switch switch-success switch-lg mt-1">
|
||||
<input type="checkbox" class="switch-input ot-preview" id="ot-preimpresion-revisada" name="preimpresion_revisada" data-input <?= $is_finalizada ? "disabled" : "" ?> />
|
||||
<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 fw-lg"><?= @lang("Produccion.preimpresion_revisada") ?></span>
|
||||
<span class="badge text-bg-primary fw-lg" id="preimpresion_revisada_by"></span>
|
||||
</label>
|
||||
<?php if ($is_finalizada): ?>
|
||||
<button type="button" id="btn-reactivar-orden-pedido" class="btn btn-primary btn-block"><?= @lang("Produccion.reactivar_orden") ?></button>
|
||||
<?php else: ?>
|
||||
<button type="button" id="btn-finalizar-orden-pedido" class="btn btn-warning btn-block"><?= @lang("Produccion.finalizar_orden") ?></button>
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -45,9 +45,17 @@
|
||||
href="<?= "/produccion/ordentrabajo/pdf/" . $modelId ?>">
|
||||
<span class="ti-sm ti ti-eye me-1"></span>
|
||||
<?= @lang("Produccion.preview_pdf") ?></a>
|
||||
<?php if ($presupuesto->ferro): ?>
|
||||
<a type="button" class="btn btn-primary btn-block mb-1" target="__blank"
|
||||
href="<?= "/produccion/ordentrabajo/pdf/ferro/" . $modelId ?>">
|
||||
<span class="ti-sm ti ti-download me-1"></span>
|
||||
<?= @lang("Produccion.imprimir_ferro") ?></a>
|
||||
<?php endif; ?>
|
||||
<?php if ($presupuesto->prototipo): ?>
|
||||
<button type="button"
|
||||
class="btn btn-primary btn-block mb-1 beta"><?= @lang("Produccion.imprimir_ferro") ?></button>
|
||||
<a type="button" class="btn btn-primary btn-block mb-1" target="__blank"
|
||||
href="<?= "/produccion/ordentrabajo/pdf/prototipo/" . $modelId ?>">
|
||||
<span class="ti-sm ti ti-download me-1"></span>
|
||||
<?= @lang("Produccion.prototipo") ?></a>
|
||||
<?php endif; ?>
|
||||
<a type="button" href="<?= route_to('getOrdenTrabajoBarCode', $modelId) ?>"
|
||||
class="btn btn-secondary btn-block mb-1"
|
||||
|
||||
@ -11,17 +11,30 @@
|
||||
<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" role="tab" id="navs-top-align-finalizados-tab" data-bs-toggle="tab" data-bs-target="#navs-top-align-finalizados"><?= lang("Produccion.finalizadas") ?></button>
|
||||
<button type="button" class="nav-link" role="tab" id="navs-top-align-news-tab" data-bs-toggle="tab" data-bs-target="#navs-top-align-news"><?= lang("Produccion.navs.news") ?></button>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<button type="button" class="nav-link active" 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-waiting-tab" data-bs-toggle="tab" data-bs-target="#navs-top-align-waiting"><?= lang("Produccion.navs.waiting") ?></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>
|
||||
|
||||
<li class="nav-item d-none">
|
||||
<button type="button" class="nav-link" role="tab" id="navs-top-align-revision-com-tab" data-bs-toggle="tab" data-bs-target="#navs-top-align-revision-com"><?= lang("Produccion.navs.revision_com") ?></button>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<button type="button" class="nav-link" role="tab" id="navs-top-align-prod-tab" data-bs-toggle="tab" data-bs-target="#navs-top-align-prod"><?= lang("Produccion.navs.prod") ?></button>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<button type="button" class="nav-link" role="tab" id="navs-top-align-finalizados-tab" data-bs-toggle="tab" data-bs-target="#navs-top-align-finalizados"><?= lang("Produccion.finalizadas") ?></button>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tab-content" id="ots-datatables-container">
|
||||
<div class="tab-pane fade show" id="navs-top-align-finalizados">
|
||||
@ -36,6 +49,19 @@
|
||||
<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 class="tab-pane fade show" id="navs-top-align-news">
|
||||
<?= view("themes/vuexy/components/tables/ot_table.php", ["id" => "ot-datatable-news"]) ?>
|
||||
</div>
|
||||
<div class="tab-pane fade show" id="navs-top-align-waiting">
|
||||
<?= view("themes/vuexy/components/tables/ot_table.php", ["id" => "ot-datatable-waiting"]) ?>
|
||||
</div>
|
||||
<div class="tab-pane fade show" id="navs-top-align-revision-com">
|
||||
<?= view("themes/vuexy/components/tables/ot_table.php", ["id" => "ot-datatable-revision-com"]) ?>
|
||||
</div>
|
||||
<div class="tab-pane fade show" id="navs-top-align-prod">
|
||||
<?= view("themes/vuexy/components/tables/ot_table.php", ["id" => "ot-datatable-prod"]) ?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--//.card -->
|
||||
</div>
|
||||
|
||||
@ -5,19 +5,14 @@ $picture = "/assets/img/default-user.png";
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html
|
||||
lang="<?= $session->get('lang') ?>"
|
||||
class="h-100 light-style layout-navbar-fixed layout-menu-fixed"
|
||||
dir="ltr"
|
||||
data-theme="theme-default"
|
||||
data-assets-path="<?= site_url('themes/vuexy/') ?>"
|
||||
<html lang="<?= $session->get('lang') ?>" class="h-100 light-style layout-navbar-fixed layout-menu-fixed" dir="ltr"
|
||||
data-theme="theme-default" data-assets-path="<?= site_url('themes/vuexy/') ?>"
|
||||
data-template="vertical-menu-template-no-customizer">
|
||||
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta
|
||||
name="viewport"
|
||||
<meta name="viewport"
|
||||
content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0" />
|
||||
|
||||
<meta name="locale" content="<?= $session->get("lang") ?>">
|
||||
@ -102,8 +97,7 @@ $picture = "/assets/img/default-user.png";
|
||||
<div class="layout-page">
|
||||
|
||||
<!-- Navbar -->
|
||||
<nav
|
||||
class="layout-navbar container-fluid navbar navbar-expand-xl navbar-detached align-items-center bg-navbar-theme"
|
||||
<nav class="layout-navbar container-fluid navbar navbar-expand-xl navbar-detached align-items-center bg-navbar-theme"
|
||||
id="layout-navbar">
|
||||
<div class="layout-menu-toggle navbar-nav align-items-xl-center me-3 me-xl-0 d-xl-none">
|
||||
<a class="nav-item nav-link px-0 me-xl-4" href="javascript:void(0)">
|
||||
@ -116,24 +110,30 @@ $picture = "/assets/img/default-user.png";
|
||||
<ul class="navbar-nav flex-row justify-content-start align-items-center ms-auto">
|
||||
<li class="nav-item dropdown-shortcuts navbar-dropdown dropdown me-2 me-xl-0">
|
||||
|
||||
<a type="btn" href="<?= route_to('maquinistaUserChangeList') ?>" class="btn btn-outline-primary btn-sm w-100">Cambiar usuario</a>
|
||||
<a type="btn" href="<?= route_to('maquinistaUserChangeList') ?>"
|
||||
class="btn btn-outline-primary btn-sm w-100">Cambiar usuario</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="navbar-nav-right d-flex align-items-center" id="navbar-collapse">
|
||||
|
||||
<?php if (env('SK_ENVIRONMENT') === 'development'): ?>
|
||||
<div class="me-auto ms-2">
|
||||
<span class="badge px-3 py-2" style="background-color: #2E5939; color: #fff;">
|
||||
Entorno de desarrollo
|
||||
</span>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<ul class="navbar-nav flex-row align-items-center ms-auto">
|
||||
<li class="nav-item dropdown-shortcuts navbar-dropdown dropdown me-2 me-xl-0">
|
||||
<a
|
||||
class="nav-link dropdown-toggle hide-arrow"
|
||||
href="javascript:void(0);"
|
||||
data-bs-toggle="dropdown"
|
||||
data-bs-auto-close="outside"
|
||||
id="message-notification-dropdown"
|
||||
aria-expanded="false">
|
||||
<a class="nav-link dropdown-toggle hide-arrow" href="javascript:void(0);"
|
||||
data-bs-toggle="dropdown" data-bs-auto-close="outside"
|
||||
id="message-notification-dropdown" aria-expanded="false">
|
||||
<span class="tf-icons ti-md ti ti-message-circle"></span>
|
||||
<span id="chat-notification-number" class="badge bg-danger text-white badge-notifications d-none"></span>
|
||||
<span id="chat-notification-number"
|
||||
class="badge bg-danger text-white badge-notifications d-none"></span>
|
||||
|
||||
</a>
|
||||
<div class="dropdown-menu dropdown-menu-end py-0">
|
||||
@ -151,8 +151,10 @@ $picture = "/assets/img/default-user.png";
|
||||
<div class="container-m-nx m-2">
|
||||
<div class="sidebar-body">
|
||||
<!-- Contacts -->
|
||||
<h6 id="chat-message-notification-title"><?= lang("Chat.no_messages_notification") ?> </h6>
|
||||
<ul class="list-unstyled chat-contact-list mb-0" id="chat-notification-list">
|
||||
<h6 id="chat-message-notification-title">
|
||||
<?= lang("Chat.no_messages_notification") ?> </h6>
|
||||
<ul class="list-unstyled chat-contact-list mb-0"
|
||||
id="chat-notification-list">
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
@ -166,9 +168,7 @@ $picture = "/assets/img/default-user.png";
|
||||
|
||||
<!-- Search Budgets -->
|
||||
<li class="nav-item navbar-dropdown dropdown me-3 me-xl-1">
|
||||
<a
|
||||
class="nav-link hide-arrow"
|
||||
href="<?= route_to("buscadorPresupuestosList"); ?>"
|
||||
<a class="nav-link hide-arrow" href="<?= route_to("buscadorPresupuestosList"); ?>"
|
||||
title="Acceso directo a buscador de presupuestos">
|
||||
<i class="ti ti-report-search ti-md"></i>
|
||||
</a>
|
||||
@ -177,15 +177,11 @@ $picture = "/assets/img/default-user.png";
|
||||
|
||||
<!-- View Mode links -->
|
||||
<?php
|
||||
if (auth()->user()->inGroup('beta')) :
|
||||
?>
|
||||
if (auth()->user()->inGroup('beta')):
|
||||
?>
|
||||
<li class="nav-item dropdown-shortcuts navbar-dropdown dropdown me-2 me-xl-0">
|
||||
<a
|
||||
class="nav-link dropdown-toggle hide-arrow"
|
||||
href="javascript:void(0);"
|
||||
data-bs-toggle="dropdown"
|
||||
data-bs-auto-close="outside"
|
||||
aria-expanded="false">
|
||||
<a class="nav-link dropdown-toggle hide-arrow" href="javascript:void(0);"
|
||||
data-bs-toggle="dropdown" data-bs-auto-close="outside" aria-expanded="false">
|
||||
<i class="ti ti-building ti-md"></i>
|
||||
</a>
|
||||
<div class="dropdown-menu dropdown-menu-end py-0">
|
||||
@ -228,7 +224,7 @@ $picture = "/assets/img/default-user.png";
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<?php
|
||||
<?php
|
||||
endif;
|
||||
?>
|
||||
<!-- View Mode links -->
|
||||
@ -270,11 +266,13 @@ $picture = "/assets/img/default-user.png";
|
||||
<div class="d-flex">
|
||||
<div class="flex-shrink-0 me-3">
|
||||
<div class="avatar avatar">
|
||||
<img src="<?= getGravatarURL() ?? '' ?>" alt class="h-auto rounded-circle" />
|
||||
<img src="<?= getGravatarURL() ?? '' ?>" alt
|
||||
class="h-auto rounded-circle" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-grow-1">
|
||||
<span class="fw-semibold d-block"><?= auth()->user()->getFullName(); ?></span>
|
||||
<span
|
||||
class="fw-semibold d-block"><?= auth()->user()->getFullName(); ?></span>
|
||||
<small class="text-muted"><?= auth()->user()->getEmail(); ?></small>
|
||||
</div>
|
||||
</div>
|
||||
@ -315,19 +313,20 @@ $picture = "/assets/img/default-user.png";
|
||||
<?php
|
||||
// Include breadcrumbs block
|
||||
include "breadcrumbs.php"
|
||||
?>
|
||||
?>
|
||||
|
||||
<?=
|
||||
// Render the content section
|
||||
$this->renderSection('content')
|
||||
?>
|
||||
// Render the content section
|
||||
$this->renderSection('content')
|
||||
?>
|
||||
</div>
|
||||
<!-- / Content -->
|
||||
|
||||
<!-- Footer -->
|
||||
<footer class="content-footer footer bg-footer-theme">
|
||||
<div class="container-fluid">
|
||||
<div class="footer-container d-flex align-items-center justify-content-between py-2 flex-md-row flex-column">
|
||||
<div
|
||||
class="footer-container d-flex align-items-center justify-content-between py-2 flex-md-row flex-column">
|
||||
<div>
|
||||
<a href="#" target="_blank" class="fw-semibold">Safekat</a> © <?= date('Y'); ?>
|
||||
</div>
|
||||
@ -412,7 +411,7 @@ $picture = "/assets/img/default-user.png";
|
||||
});
|
||||
}
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
|
||||
function adjustSidebar4ContentWrapper() {
|
||||
if ($('#sidebar').hasClass('d-none') && $(window).width() <= 768) {
|
||||
@ -426,7 +425,7 @@ $picture = "/assets/img/default-user.png";
|
||||
|
||||
adjustSidebar4ContentWrapper();
|
||||
|
||||
$('#sidebarCollapse').on('click', function() {
|
||||
$('#sidebarCollapse').on('click', function () {
|
||||
|
||||
if ($('#sidebar').hasClass('d-none') && $(window).width() <= 768) {
|
||||
$('#sidebar').removeClass('d-none d-sm-none d-md-block');
|
||||
@ -441,7 +440,7 @@ $picture = "/assets/img/default-user.png";
|
||||
|
||||
});
|
||||
|
||||
$(window).resize(function() {
|
||||
$(window).resize(function () {
|
||||
adjustSidebar4ContentWrapper();
|
||||
});
|
||||
|
||||
|
||||
@ -1,93 +1,98 @@
|
||||
<?php $menus = getMenuControl(); ?>
|
||||
|
||||
<!-- Menu -->
|
||||
<aside id="layout-menu" class="layout-menu menu-vertical menu bg-menu-theme">
|
||||
<div class="app-brand">
|
||||
<a href="<?= site_url('home') ?>" class="app-brand-link">
|
||||
<span class="app-brand-logo">
|
||||
<img src="<?= site_url('themes/vuexy/img/branding/logo.png') ?>" width="150px">
|
||||
</span>
|
||||
<!-- Menu -->
|
||||
<?php
|
||||
$skEnv = env('SK_ENVIRONMENT', 'production');
|
||||
$developmentClass = ($skEnv === 'development') ? 'env-bg' : '';
|
||||
?>
|
||||
<aside id="layout-menu" class="layout-menu menu-vertical menu bg-menu-theme <?= esc($developmentClass) ?>">
|
||||
<div class="app-brand">
|
||||
<a href="<?= site_url('home') ?>" class="app-brand-link">
|
||||
<span class="app-brand-logo">
|
||||
<img src="<?= site_url('themes/vuexy/img/branding/logo.png') ?>" width="150px">
|
||||
</span>
|
||||
</a>
|
||||
<a href="javascript:void(0);" class="layout-menu-toggle menu-link text-large ms-auto">
|
||||
<i class="ti menu-toggle-icon d-none d-xl-block ti-sm align-middle"></i>
|
||||
<i class="ti ti-x d-block d-xl-none ti-sm align-middle"></i>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="menu-inner-shadow"></div>
|
||||
|
||||
<ul class="menu-inner py-1">
|
||||
|
||||
<li class="menu-item active">
|
||||
<a href="<?= site_url("") ?>" class="menu-link">
|
||||
<i class="menu-icon tf-icons ti ti-dashboard"></i>
|
||||
<div data-i18n="<?= lang("App.menu_dashboard") ?>"><?= lang("App.menu_dashboard") ?></div>
|
||||
</a>
|
||||
<a href="javascript:void(0);" class="layout-menu-toggle menu-link text-large ms-auto">
|
||||
<i class="ti menu-toggle-icon d-none d-xl-block ti-sm align-middle"></i>
|
||||
<i class="ti ti-x d-block d-xl-none ti-sm align-middle"></i>
|
||||
</a>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<div class="menu-inner-shadow"></div>
|
||||
|
||||
<ul class="menu-inner py-1">
|
||||
|
||||
<li class="menu-item active">
|
||||
<a href="<?= site_url("") ?>" class="menu-link">
|
||||
<i class="menu-icon tf-icons ti ti-dashboard"></i>
|
||||
<div data-i18n="<?= lang("App.menu_dashboard") ?>"><?= lang("App.menu_dashboard") ?></div>
|
||||
<?php
|
||||
/**
|
||||
* MENU CLIENTES
|
||||
*/
|
||||
if (allowMenuSection($menus, ['Cliente'], 'index')):
|
||||
?>
|
||||
<!-- Clientes -->
|
||||
<li class="menu-item">
|
||||
<a href="javascript:void(0);" class="menu-link menu-toggle">
|
||||
<i class="menu-icon tf-icons ti ti-users"></i>
|
||||
<div data-i18n="<?= lang("App.menu_clientes") ?>"><?= lang("App.menu_clientes") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<?php
|
||||
/**
|
||||
* MENU CLIENTES
|
||||
*/
|
||||
if (allowMenuSection($menus, ['Cliente'], 'index')):
|
||||
?>
|
||||
<!-- Clientes -->
|
||||
<li class="menu-item">
|
||||
<a href="javascript:void(0);" class="menu-link menu-toggle">
|
||||
<i class="menu-icon tf-icons ti ti-users"></i>
|
||||
<div data-i18n="<?= lang("App.menu_clientes") ?>"><?= lang("App.menu_clientes") ?></div>
|
||||
</a>
|
||||
<ul class="menu-sub">
|
||||
<?php if (count($temp = getArrayItem($menus, 'name', 'Cliente')) > 0): ?>
|
||||
<?php if (count(getArrayItem($temp, 'methods', 'index', true)) > 0): ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("clientes/cliente") ?>" class="menu-link">
|
||||
<div data-i18n="<?= lang("App.menu_clientes") ?>"><?= lang("App.menu_clientes") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
<li class="menu-item">
|
||||
<a href="<?= route_to("clienteplantillapreciosList") ?>" class="menu-link">
|
||||
<div data-i18n="<?= lang("App.menu_plantillas_tarifas_clientes") ?>"><?= lang("App.menu_plantillas_tarifas_clientes") ?></div>
|
||||
<ul class="menu-sub">
|
||||
<?php if (count($temp = getArrayItem($menus, 'name', 'Cliente')) > 0): ?>
|
||||
<?php if (count(getArrayItem($temp, 'methods', 'index', true)) > 0): ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("clientes/cliente") ?>" class="menu-link">
|
||||
<div data-i18n="<?= lang("App.menu_clientes") ?>"><?= lang("App.menu_clientes") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
<li class="menu-item">
|
||||
<a href="<?= route_to("clienteplantillapreciosList") ?>" class="menu-link">
|
||||
<div data-i18n="<?= lang("App.menu_plantillas_tarifas_clientes") ?>">
|
||||
<?= lang("App.menu_plantillas_tarifas_clientes") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
<?php
|
||||
/**
|
||||
* MENU PRESUPUESTOS
|
||||
*/
|
||||
if (allowMenuSection($menus, ['Presupuesto'], 'index')): ?>
|
||||
<!-- Budgets -->
|
||||
<li class="menu-item">
|
||||
<a href="javascript:void(0);" class="menu-link menu-toggle">
|
||||
<i class="menu-icon tf-icons ti ti-currency-dollar"></i>
|
||||
<div data-i18n="<?= lang("App.menu_presupuestos") ?>"><?= lang("App.menu_presupuestos") ?></div>
|
||||
</a>
|
||||
<ul class="menu-sub">
|
||||
<?php if (count($temp = getArrayItem($menus, 'name', 'Presupuesto')) > 0): ?>
|
||||
<?php if (count(getArrayItem($temp, 'methods', 'index', true)) > 0): ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("presupuestos/presupuesto") ?>" class="menu-link">
|
||||
<div data-i18n="<?= lang("App.menu_presupuesto") ?>"><?= lang("App.menu_presupuesto") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php
|
||||
/**
|
||||
* MENU PRESUPUESTOS
|
||||
*/
|
||||
if (allowMenuSection($menus, ['Presupuesto'], 'index')): ?>
|
||||
<!-- Budgets -->
|
||||
<li class="menu-item">
|
||||
<a href="javascript:void(0);" class="menu-link menu-toggle">
|
||||
<i class="menu-icon tf-icons ti ti-currency-dollar"></i>
|
||||
<div data-i18n="<?= lang("App.menu_presupuestos") ?>"><?= lang("App.menu_presupuestos") ?></div>
|
||||
</a>
|
||||
<ul class="menu-sub">
|
||||
<?php if (count($temp = getArrayItem($menus, 'name', 'Presupuesto')) > 0): ?>
|
||||
<?php if (count(getArrayItem($temp, 'methods', 'index', true)) > 0): ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("presupuestos/presupuesto") ?>" class="menu-link">
|
||||
<div data-i18n="<?= lang("App.menu_presupuesto") ?>"><?= lang("App.menu_presupuesto") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
<?php
|
||||
/**
|
||||
* MENU PEDIDOS
|
||||
*/
|
||||
if (allowMenuSection($menus, ['Pedido'], 'index')): ?>
|
||||
<?php
|
||||
/**
|
||||
* MENU PEDIDOS
|
||||
*/
|
||||
if (allowMenuSection($menus, ['Pedido'], 'index')): ?>
|
||||
<!-- Orders -->
|
||||
<li class="menu-item">
|
||||
<a href="javascript:void(0);" class="menu-link menu-toggle">
|
||||
@ -99,241 +104,257 @@
|
||||
<?php if (count(getArrayItem($temp, 'methods', 'activos', true)) > 0): ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= route_to("validacionView") ?>" class="menu-link">
|
||||
<div data-i18n="<?= lang("App.menu_pedidos_activos") ?>"><?= lang("App.menu_pedidos_activos") ?></div>
|
||||
<div data-i18n="<?= lang("App.menu_pedidos_activos") ?>"><?= lang("App.menu_pedidos_activos") ?>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php if (count(getArrayItem($temp, 'methods', 'finalizados', true)) > 0): ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= route_to("listaPedidosFinalizados") ?>" class="menu-link">
|
||||
<div data-i18n="<?= lang("App.menu_pedidos_finalizados") ?>"><?= lang("App.menu_pedidos_finalizados") ?></div>
|
||||
<div data-i18n="<?= lang("App.menu_pedidos_finalizados") ?>">
|
||||
<?= lang("App.menu_pedidos_finalizados") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php if (count(getArrayItem($temp, 'methods', 'cancelados', true)) > 0): ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= route_to("listaPedidosCancelados") ?>" class="menu-link">
|
||||
<div data-i18n="<?= lang("App.menu_pedidos_cancelados") ?>"><?= lang("App.menu_pedidos_cancelados") ?></div>
|
||||
<div data-i18n="<?= lang("App.menu_pedidos_cancelados") ?>">
|
||||
<?= lang("App.menu_pedidos_cancelados") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php if (count(getArrayItem($temp, 'methods', 'todos', true)) > 0): ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= route_to("listaPedidos") ?>" class="menu-link">
|
||||
<div data-i18n="<?= lang("App.menu_pedidos_todos") ?>"><?= lang("App.menu_pedidos_todos") ?></div>
|
||||
<div data-i18n="<?= lang("App.menu_pedidos_todos") ?>"><?= lang("App.menu_pedidos_todos") ?>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
<?php
|
||||
/**
|
||||
* MENU PRODUCCION
|
||||
*/
|
||||
if
|
||||
(allowMenuSection($menus, ['Ordentrabajo'], 'index')): ?>
|
||||
<!-- Production -->
|
||||
<li class="menu-item">
|
||||
<a href="javascript:void(0);" class="menu-link menu-toggle">
|
||||
<i class="menu-icon tf-icons ti ti-printer"></i>
|
||||
<div data-i18n="<?= lang("App.menu_produccion") ?>"><?= lang("App.menu_produccion") ?></div>
|
||||
</a>
|
||||
<ul class="menu-sub">
|
||||
<?php if (count($temp = getArrayItem($menus, 'name', 'Ordentrabajo')) > 0): ?>
|
||||
<?php if (count(getArrayItem($temp, 'methods', 'index', true)) > 0): ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("produccion/ordentrabajo") ?>" class="menu-link">
|
||||
<div data-i18n="<?= lang("App.menu_orden_trabajo") ?>"><?= lang("App.menu_orden_trabajo") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php
|
||||
/**
|
||||
* MENU PRODUCCION
|
||||
*/
|
||||
if
|
||||
(allowMenuSection($menus, ['Ordentrabajo'], 'index')): ?>
|
||||
<!-- Production -->
|
||||
<li class="menu-item">
|
||||
<a href="javascript:void(0);" class="menu-link menu-toggle">
|
||||
<i class="menu-icon tf-icons ti ti-printer"></i>
|
||||
<div data-i18n="<?= lang("App.menu_produccion") ?>"><?= lang("App.menu_produccion") ?></div>
|
||||
</a>
|
||||
<ul class="menu-sub">
|
||||
<?php if (count($temp = getArrayItem($menus, 'name', 'Ordentrabajo')) > 0): ?>
|
||||
<?php if (count(getArrayItem($temp, 'methods', 'index', true)) > 0): ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("produccion/ordentrabajo") ?>" class="menu-link">
|
||||
<div data-i18n="<?= lang("App.menu_orden_trabajo") ?>"><?= lang("App.menu_orden_trabajo") ?>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php if (count($temp = getArrayItem($menus, 'name', 'Ordentrabajo')) > 0): ?>
|
||||
<?php if (count(getArrayItem($temp, 'methods', 'cien', true)) > 0): ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("produccion/ordentrabajo/cien") ?>" class="menu-link">
|
||||
<div data-i18n="<?= lang("App.menu_orden_trabajo_100") ?>"><?= lang("App.menu_orden_trabajo_100") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
<?php if (count($temp = getArrayItem($menus, 'name', 'Ordentrabajo')) > 0): ?>
|
||||
<?php if (count(getArrayItem($temp, 'methods', 'cien', true)) > 0): ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("produccion/ordentrabajo/cien") ?>" class="menu-link">
|
||||
<div data-i18n="<?= lang("App.menu_orden_trabajo_100") ?>">
|
||||
<?= lang("App.menu_orden_trabajo_100") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php if (count($temp = getArrayItem($menus, 'name', 'Ordentrabajo')) > 0): ?>
|
||||
<?php if (count(getArrayItem($temp, 'methods', 'finalizado', true)) > 0): ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("produccion/ordentrabajo/finalizado") ?>" class="menu-link">
|
||||
<div data-i18n="<?= lang("App.menu_orden_trabajo_finalizados") ?>"><?= lang("App.menu_orden_trabajo_finalizados") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
<?php if (count($temp = getArrayItem($menus, 'name', 'Ordentrabajo')) > 0): ?>
|
||||
<?php if (count(getArrayItem($temp, 'methods', 'finalizado', true)) > 0): ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("produccion/ordentrabajo/finalizado") ?>" class="menu-link">
|
||||
<div data-i18n="<?= lang("App.menu_orden_trabajo_finalizados") ?>">
|
||||
<?= lang("App.menu_orden_trabajo_finalizados") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php if (count($temp = getArrayItem($menus, 'name', 'Ordentrabajo')) > 0): ?>
|
||||
<?php if (count(getArrayItem($temp, 'methods', 'pendiente', true)) > 0): ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("produccion/ordentrabajo/pendiente") ?>" class="menu-link">
|
||||
<div data-i18n="<?= lang("App.menu_orden_trabajo_pendientes") ?>"><?= lang("App.menu_orden_trabajo_pendientes") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
<?php if (count($temp = getArrayItem($menus, 'name', 'Ordentrabajo')) > 0): ?>
|
||||
<?php if (count(getArrayItem($temp, 'methods', 'pendiente', true)) > 0): ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("produccion/ordentrabajo/pendiente") ?>" class="menu-link">
|
||||
<div data-i18n="<?= lang("App.menu_orden_trabajo_pendientes") ?>">
|
||||
<?= lang("App.menu_orden_trabajo_pendientes") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
<?php
|
||||
/**
|
||||
* MENU FACTURACION
|
||||
*/
|
||||
if (allowMenuSection($menus, ['Albaran', 'Factura'], 'index')): ?>
|
||||
<!-- Invoicing -->
|
||||
<li class="menu-item">
|
||||
<a href="javascript:void(0);" class="menu-link menu-toggle">
|
||||
<i class="menu-icon tf-icons ti ti-file-dollar"></i>
|
||||
<div data-i18n="<?= lang("App.menu_facturación") ?>"><?= lang("App.menu_facturación") ?></div>
|
||||
</a>
|
||||
<ul class="menu-sub">
|
||||
<?php if (count($temp = getArrayItem($menus, 'name', 'Factura')) > 0): ?>
|
||||
<?php if (count(getArrayItem($temp, 'methods', 'index', true)) > 0): ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("facturacion/factura") ?>" class="menu-link">
|
||||
<div data-i18n="<?= lang("App.menu_facturas") ?>"><?= lang("App.menu_facturas") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php if (count(getArrayItem($temp, 'methods', 'vencimiento', true)) > 0): ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("facturacion/factura/vencimiento") ?>" class="menu-link">
|
||||
<div data-i18n="<?= lang("App.menu_facturas_vencimiento") ?>"><?= lang("App.menu_facturas_vencimiento") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php if (count(getArrayItem($temp, 'methods', 'nueva', true)) > 0): ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("facturacion/factura/nueva") ?>" class="menu-link">
|
||||
<div data-i18n="<?= lang("App.menu_facturas_nueva") ?>"><?= lang("App.menu_facturas_nueva") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
<?php if (count($temp = getArrayItem($menus, 'name', 'Albaran')) > 0): ?>
|
||||
<?php if (count(getArrayItem($temp, 'methods', 'index', true)) > 0): ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("facturacion/albaran") ?>" class="menu-link">
|
||||
<div data-i18n="<?= lang("App.menu_albaran") ?>"><?= lang("App.menu_albaran") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php
|
||||
/**
|
||||
* MENU CONFIGURACION
|
||||
*/
|
||||
if (allowMenuSection($menus,
|
||||
['Calendario', 'Paises', 'Users', 'Group'], 'index')): ?>
|
||||
<li class="menu-item">
|
||||
<a href="javascript:void(0);" class="menu-link menu-toggle">
|
||||
<i class="menu-icon tf-icons ti ti-adjustments-horizontal"></i>
|
||||
<div data-i18n="<?= lang("App.menu_configuration") ?>"><?= lang("App.menu_configuration") ?></div>
|
||||
</a>
|
||||
<ul class="menu-sub">
|
||||
<?php if (count($temp = getArrayItem($menus, 'name', 'Calendario')) > 0): ?>
|
||||
<?php if (count(getArrayItem($temp, 'methods', 'index', true)) > 0): ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("configuracion/calendario") ?>" class="menu-link">
|
||||
<div data-i18n="<?= lang("App.menu_calendario") ?>"><?= lang("App.menu_calendario") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
<?php if (count($temp = getArrayItem($menus, 'name', 'Paises')) > 0): ?>
|
||||
<?php if (count(getArrayItem($temp, 'methods', 'index', true)) > 0): ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= route_to('paisesList') ?>" class="menu-link">
|
||||
<div data-i18n="<?= lang("App.menu_paises") ?>"><?= lang("App.menu_paises") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
<?php if (count($temp = getArrayItem($menus, 'name', 'Users')) > 0): ?>
|
||||
<?php if (count(getArrayItem($temp, 'methods', 'index', true)) > 0): ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= route_to('userList') ?>" class="menu-link">
|
||||
<div data-i18n="<?= lang("App.menu_users") ?>"><?= lang("App.menu_users") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (count($temp = getArrayItem($menus, 'name', 'Group')) > 0): ?>
|
||||
<?php if (count(getArrayItem($temp, 'methods', 'index', true)) > 0): ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= route_to("userGroupList") ?>" class="menu-link">
|
||||
<div data-i18n="<?= lang("App.menu_permission_group") ?>"><?= lang("App.menu_permission_group") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
<?php
|
||||
/**
|
||||
* MENU MENSAJES
|
||||
*/
|
||||
if (count(getArrayItem($menus, 'name', 'Mensajes')) > 0): ?>
|
||||
<!-- Messages -->
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("servicios/mensajes") ?>" class="menu-link">
|
||||
<i class="menu-icon tf-icons ti ti-message"></i>
|
||||
<div data-i18n="<?= lang("App.menu_mensajes") ?>"><?= lang("App.menu_mensajes") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
<li class="menu-header small text-uppercase">
|
||||
<span class="menu-header-text">Sistema</span>
|
||||
<?php endif; ?>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<?php
|
||||
/**
|
||||
* MENU AJUSTES
|
||||
*/
|
||||
if (count(getArrayItem($menus, 'name', 'Settings')) > 0): ?>
|
||||
<!-- Settings -->
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("settings")?>" class="menu-link">
|
||||
<i class="menu-icon tf-icons ti ti-settings""></i>
|
||||
<div data-i18n="<?= lang("App.menu_settings") ?>"><?= lang("App.menu_settings") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php
|
||||
/**
|
||||
* MENU ACTIVIDAD
|
||||
*/
|
||||
if (count(getArrayItem($menus, 'name', 'Activity')) > 0): ?>
|
||||
<!-- Activity -->
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("activity") ?>" class="menu-link">
|
||||
<i class="menu-icon tf-icons ti ti-fingerprint""></i>
|
||||
<div data-i18n="<?= lang("App.menu_activity") ?>"><?= lang("App.menu_activity") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
</ul>
|
||||
</aside>
|
||||
<!-- / Menu -->
|
||||
<?php
|
||||
/**
|
||||
* MENU FACTURACION
|
||||
*/
|
||||
if (allowMenuSection($menus, ['Albaran', 'Factura'], 'index')): ?>
|
||||
<!-- Invoicing -->
|
||||
<li class="menu-item">
|
||||
<a href="javascript:void(0);" class="menu-link menu-toggle">
|
||||
<i class="menu-icon tf-icons ti ti-file-dollar"></i>
|
||||
<div data-i18n="<?= lang("App.menu_facturación") ?>"><?= lang("App.menu_facturación") ?></div>
|
||||
</a>
|
||||
<ul class="menu-sub">
|
||||
<?php if (count($temp = getArrayItem($menus, 'name', 'Factura')) > 0): ?>
|
||||
<?php if (count(getArrayItem($temp, 'methods', 'index', true)) > 0): ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("facturacion/factura") ?>" class="menu-link">
|
||||
<div data-i18n="<?= lang("App.menu_facturas") ?>"><?= lang("App.menu_facturas") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php if (count(getArrayItem($temp, 'methods', 'vencimiento', true)) > 0): ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("facturacion/factura/vencimiento") ?>" class="menu-link">
|
||||
<div data-i18n="<?= lang("App.menu_facturas_vencimiento") ?>">
|
||||
<?= lang("App.menu_facturas_vencimiento") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php if (count(getArrayItem($temp, 'methods', 'nueva', true)) > 0): ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("facturacion/factura/nueva") ?>" class="menu-link">
|
||||
<div data-i18n="<?= lang("App.menu_facturas_nueva") ?>"><?= lang("App.menu_facturas_nueva") ?>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
<?php if (count($temp = getArrayItem($menus, 'name', 'Albaran')) > 0): ?>
|
||||
<?php if (count(getArrayItem($temp, 'methods', 'index', true)) > 0): ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("facturacion/albaran") ?>" class="menu-link">
|
||||
<div data-i18n="<?= lang("App.menu_albaran") ?>"><?= lang("App.menu_albaran") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php
|
||||
/**
|
||||
* MENU CONFIGURACION
|
||||
*/
|
||||
if (
|
||||
allowMenuSection(
|
||||
$menus,
|
||||
['Calendario', 'Paises', 'Users', 'Group'],
|
||||
'index'
|
||||
)
|
||||
): ?>
|
||||
<li class="menu-item">
|
||||
<a href="javascript:void(0);" class="menu-link menu-toggle">
|
||||
<i class="menu-icon tf-icons ti ti-adjustments-horizontal"></i>
|
||||
<div data-i18n="<?= lang("App.menu_configuration") ?>"><?= lang("App.menu_configuration") ?></div>
|
||||
</a>
|
||||
<ul class="menu-sub">
|
||||
<?php if (count($temp = getArrayItem($menus, 'name', 'Calendario')) > 0): ?>
|
||||
<?php if (count(getArrayItem($temp, 'methods', 'index', true)) > 0): ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("configuracion/calendario") ?>" class="menu-link">
|
||||
<div data-i18n="<?= lang("App.menu_calendario") ?>"><?= lang("App.menu_calendario") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
<?php if (count($temp = getArrayItem($menus, 'name', 'Paises')) > 0): ?>
|
||||
<?php if (count(getArrayItem($temp, 'methods', 'index', true)) > 0): ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= route_to('paisesList') ?>" class="menu-link">
|
||||
<div data-i18n="<?= lang("App.menu_paises") ?>"><?= lang("App.menu_paises") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
<?php if (count($temp = getArrayItem($menus, 'name', 'Users')) > 0): ?>
|
||||
<?php if (count(getArrayItem($temp, 'methods', 'index', true)) > 0): ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= route_to('userList') ?>" class="menu-link">
|
||||
<div data-i18n="<?= lang("App.menu_users") ?>"><?= lang("App.menu_users") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (count($temp = getArrayItem($menus, 'name', 'Group')) > 0): ?>
|
||||
<?php if (count(getArrayItem($temp, 'methods', 'index', true)) > 0): ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= route_to("userGroupList") ?>" class="menu-link">
|
||||
<div data-i18n="<?= lang("App.menu_permission_group") ?>">
|
||||
<?= lang("App.menu_permission_group") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
<?php
|
||||
/**
|
||||
* MENU MENSAJES
|
||||
*/
|
||||
if (count(getArrayItem($menus, 'name', 'Mensajes')) > 0): ?>
|
||||
<!-- Messages -->
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("servicios/mensajes") ?>" class="menu-link">
|
||||
<i class="menu-icon tf-icons ti ti-message"></i>
|
||||
<div data-i18n="<?= lang("App.menu_mensajes") ?>"><?= lang("App.menu_mensajes") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
<li class="menu-header small text-uppercase">
|
||||
<span class="menu-header-text">Sistema</span>
|
||||
</li>
|
||||
|
||||
<?php
|
||||
/**
|
||||
* MENU AJUSTES
|
||||
*/
|
||||
if (count(getArrayItem($menus, 'name', 'Settings')) > 0): ?>
|
||||
<!-- Settings -->
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("settings") ?>" class="menu-link">
|
||||
<i class="menu-icon tf-icons ti ti-settings""></i>
|
||||
<div data-i18n=" <?= lang("App.menu_settings") ?>"><?= lang("App.menu_settings") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php
|
||||
/**
|
||||
* MENU ACTIVIDAD
|
||||
*/
|
||||
if (count(getArrayItem($menus, 'name', 'Activity')) > 0): ?>
|
||||
<!-- Activity -->
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("activity") ?>" class="menu-link">
|
||||
<i class="menu-icon tf-icons ti ti-fingerprint""></i>
|
||||
<div data-i18n=" <?= lang("App.menu_activity") ?>"><?= lang("App.menu_activity") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
</ul>
|
||||
</aside>
|
||||
<!-- / Menu -->
|
||||
@ -1,5 +1,9 @@
|
||||
<!-- Menu -->
|
||||
<aside id="layout-menu" class="layout-menu menu-vertical menu bg-menu-theme">
|
||||
<?php
|
||||
$skEnv = env('SK_ENVIRONMENT', 'production');
|
||||
$developmentClass = ($skEnv === 'development') ? 'env-bg' : '';
|
||||
?>
|
||||
<aside id="layout-menu" class="layout-menu menu-vertical menu bg-menu-theme <?= esc($developmentClass) ?>">
|
||||
<div class="app-brand">
|
||||
<a href="<?= site_url('home') ?>" class="app-brand-link">
|
||||
<span class="app-brand-logo">
|
||||
|
||||
@ -1,7 +1,11 @@
|
||||
<?php $menus = getMenuControl(); ?>
|
||||
|
||||
<!-- Menu -->
|
||||
<aside id="layout-menu" class="layout-menu menu-vertical menu bg-menu-theme">
|
||||
<?php
|
||||
$skEnv = env('SK_ENVIRONMENT', 'production');
|
||||
$developmentClass = ($skEnv === 'development') ? 'env-bg' : '';
|
||||
?>
|
||||
<aside id="layout-menu" class="layout-menu menu-vertical menu bg-menu-theme <?= esc($developmentClass) ?>">
|
||||
<div class="app-brand">
|
||||
<a href="<?= site_url('home') ?>" class="app-brand-link">
|
||||
<span class="app-brand-logo">
|
||||
@ -48,7 +52,8 @@
|
||||
<li class="menu-item">
|
||||
<a href="<?= route_to("clienteplantillapreciosList") ?>" class="menu-link">
|
||||
<div data-i18n="<?= lang("App.menu_plantillas_tarifas_clientes") ?>">
|
||||
<?= lang("App.menu_plantillas_tarifas_clientes") ?></div>
|
||||
<?= lang("App.menu_plantillas_tarifas_clientes") ?>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
@ -75,7 +80,8 @@
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("presupuestos/presupuestomaquetacion") ?>" class="menu-link">
|
||||
<div data-i18n="<?= lang("App.menu_presupuestomaquetacion_todos") ?>">
|
||||
<?= lang("App.menu_presupuestomaquetacion_todos") ?></div>
|
||||
<?= lang("App.menu_presupuestomaquetacion_todos") ?>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
@ -83,7 +89,8 @@
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("presupuestos/presupuestomaquetacion/nuevo") ?>" class="menu-link">
|
||||
<div data-i18n="<?= lang("App.menu_presupuestomaquetacion_nuevo") ?>">
|
||||
<?= lang("App.menu_presupuestomaquetacion_nuevo") ?></div>
|
||||
<?= lang("App.menu_presupuestomaquetacion_nuevo") ?>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
@ -91,7 +98,8 @@
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("presupuestos/presupuestomaquetacion/borrador") ?>" class="menu-link">
|
||||
<div data-i18n="<?= lang("App.menu_presupuestomaquetacion_borrador") ?>">
|
||||
<?= lang("App.menu_presupuestomaquetacion_borrador") ?></div>
|
||||
<?= lang("App.menu_presupuestomaquetacion_borrador") ?>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
@ -99,7 +107,8 @@
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("presupuestos/presupuestomaquetacion/aceptados") ?>" class="menu-link">
|
||||
<div data-i18n="<?= lang("App.menu_presupuestomaquetacion_aceptados") ?>">
|
||||
<?= lang("App.menu_presupuestomaquetacion_aceptados") ?></div>
|
||||
<?= lang("App.menu_presupuestomaquetacion_aceptados") ?>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
@ -134,7 +143,8 @@
|
||||
<li class="menu-item">
|
||||
<a href="<?= route_to("listaPedidosFinalizados") ?>" class="menu-link">
|
||||
<div data-i18n="<?= lang("App.menu_pedidos_finalizados") ?>">
|
||||
<?= lang("App.menu_pedidos_finalizados") ?></div>
|
||||
<?= lang("App.menu_pedidos_finalizados") ?>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
@ -142,7 +152,8 @@
|
||||
<li class="menu-item">
|
||||
<a href="<?= route_to("listaPedidosCancelados") ?>" class="menu-link">
|
||||
<div data-i18n="<?= lang("App.menu_pedidos_cancelados") ?>">
|
||||
<?= lang("App.menu_pedidos_cancelados") ?></div>
|
||||
<?= lang("App.menu_pedidos_cancelados") ?>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
@ -188,7 +199,8 @@
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("produccion/ordentrabajo/cien") ?>" class="menu-link">
|
||||
<div data-i18n="<?= lang("App.menu_orden_trabajo_100") ?>">
|
||||
<?= lang("App.menu_orden_trabajo_100") ?></div>
|
||||
<?= lang("App.menu_orden_trabajo_100") ?>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
@ -198,7 +210,8 @@
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("produccion/ordentrabajo/finalizado") ?>" class="menu-link">
|
||||
<div data-i18n="<?= lang("App.menu_orden_trabajo_finalizados") ?>">
|
||||
<?= lang("App.menu_orden_trabajo_finalizados") ?></div>
|
||||
<?= lang("App.menu_orden_trabajo_finalizados") ?>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
@ -208,7 +221,8 @@
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("produccion/ordentrabajo/pendiente") ?>" class="menu-link">
|
||||
<div data-i18n="<?= lang("App.menu_orden_trabajo_pendientes") ?>">
|
||||
<?= lang("App.menu_orden_trabajo_pendientes") ?></div>
|
||||
<?= lang("App.menu_orden_trabajo_pendientes") ?>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
@ -243,7 +257,8 @@
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("facturacion/factura/vencimiento") ?>" class="menu-link">
|
||||
<div data-i18n="<?= lang("App.menu_facturas_vencimiento") ?>">
|
||||
<?= lang("App.menu_facturas_vencimiento") ?></div>
|
||||
<?= lang("App.menu_facturas_vencimiento") ?>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
@ -321,7 +336,8 @@
|
||||
<li class="menu-item">
|
||||
<a href="<?= route_to("userGroupList") ?>" class="menu-link">
|
||||
<div data-i18n="<?= lang("App.menu_permission_group") ?>">
|
||||
<?= lang("App.menu_permission_group") ?></div>
|
||||
<?= lang("App.menu_permission_group") ?>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
|
||||
@ -20,7 +20,14 @@ if (auth()->user()->can('importadores.menu')) {
|
||||
</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
|
||||
<?php if (auth()->user()->can('importadores.bubok')) { ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= route_to("importadorBubokTool") ?>" class="menu-link">
|
||||
<?= lang("App.menu_importadores_bubok") ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
/**
|
||||
* MAQUINISTA MENU
|
||||
*/
|
||||
if (auth()->user()->inGroup('maquina')) {
|
||||
if (auth()->user()->inGroup('maquina','admin')) {
|
||||
?>
|
||||
<!-- Catalogue -->
|
||||
<li class="menu-item">
|
||||
@ -22,11 +22,6 @@ if (auth()->user()->inGroup('maquina')) {
|
||||
<div><?= lang("App.menu_maquinista_colas") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
<li class="menu-item">
|
||||
<a href="<?= route_to("viewProduccionMaquinistaMantenimiento") ?>" class="menu-link beta">
|
||||
<div><?= lang("App.menu_maquinista_mantenimiento") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<?php } ?>
|
||||
@ -11,7 +11,7 @@
|
||||
<?php if (count($encuadernaciones) > 0): ?>
|
||||
<tr style="color: red;">
|
||||
<td><?= $encuadernacion->tarifa()->nombre ?></td>
|
||||
<td></td>
|
||||
<td>Plástico</td>
|
||||
<td></td>
|
||||
<td><?= $flags['isPlakene'] ? "SI" : "NO" ?></td>
|
||||
<td><?= $plakene_tipo ?? "" ?></td>
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<table>
|
||||
<tr class="encuadernacion">
|
||||
<th class="cell-50">Encuadernacion</th>
|
||||
<th class="cell-50">Color</th>
|
||||
<th class="cell-50">Tipo</th>
|
||||
<th class="cell-50">Plakenes</th>
|
||||
<th class="cell-50">Plakene</th>
|
||||
<th class="cell-50">Externo</th>
|
||||
@ -10,7 +10,7 @@
|
||||
<?php if (count($encuadernaciones) > 0): ?>
|
||||
<tr style="color: red;">
|
||||
<td><?= $encuadernacion->tarifa()->nombre ?></td>
|
||||
<td></td>
|
||||
<td>Metálico</td>
|
||||
<td><?= $flags['isPlakene'] ? "SI" : "NO" ?></td>
|
||||
<td><?= $plakene_tipo ?? "" ?></td>
|
||||
<td><?= $encuadernacion->proveedor() ? $encuadernacion->proveedor()->nombre : "" ?></td>
|
||||
|
||||
303
ci4/app/Views/themes/vuexy/pdfs/ferro.php
Executable file
303
ci4/app/Views/themes/vuexy/pdfs/ferro.php
Executable file
@ -0,0 +1,303 @@
|
||||
<?php
|
||||
|
||||
use CodeIgniter\I18n\Time;
|
||||
|
||||
$session = session();
|
||||
$settings = $session->get('settings');
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html
|
||||
lang="<?= $session->get('lang') ?>"
|
||||
data-assets-path="<?= site_url('themes/vuexy/') ?>"
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<!-- Icons -->
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/fonts/fontawesome.css') ?>" />
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/fonts/tabler-icons.css') ?>" />
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/fonts/flag-icons.css') ?>" />
|
||||
|
||||
<!-- Core CSS -->
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/css/rtl/core.css') ?>" />
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/css/rtl/theme-semi-dark.css') ?>" />
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/css/safekat.css') ?>" />
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/css/pages/app-chat.css') ?>">
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/libs/flatpickr/flatpickr.css') ?>" />
|
||||
<link rel="icon" type="image/x-icon" href="<?= site_url('themes/vuexy/img/favicon/favicon.ico') ?>" />
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/css/pdf.ot.css') ?>">
|
||||
|
||||
<title><?= $presupuesto->titulo ?>[OT:<?= $ot->id ?>]</title>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="col-md-12 pdf-wrapper" data-id="<?= $ot->id . "_FERRO_" . "_" . $presupuesto->id . "_" . $presupuesto->titulo ?>">
|
||||
<div class="row">
|
||||
<div class="col-12 d-flex justify-content-between align-items-center">
|
||||
<h5><?= $presupuesto->titulo ?></h5>
|
||||
<span class="fs-medium"><strong><?= Time::now()->format("d/m/Y H:i:s") ?></strong></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="row mb-2 d-flex flex align-items-stretch">
|
||||
<div class="col-2">
|
||||
<?php if ($ot->full_path): ?>
|
||||
<img class="portada-img border-secondary img-thumbnail img-fluid" src="<?= $ot->full_path ? "data:image/png;base64," . base64_encode(file_get_contents($ot->full_path)) : '/assets/img/portada_not_found.png' ?>" />
|
||||
<?php else: ?>
|
||||
<img class="portada-img border-secondary img-thumbnail img-fluid" src="/assets/img/portada_not_found.png" />
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
<div class="col-10 py-2 rounded border-1 border-secondary" style="background-color: <?= $colors["general"]["bg"] ?>;color:<?= $colors["general"]["color"] ?>;">
|
||||
<div class="row">
|
||||
<div class="col-8">
|
||||
<div class="px-2 d-flex flex justify-content-between align-items-center" style="background-color: <?= $colors["week_day"]["bg"] ?>;color:<?= $colors["week_day"]["color"] ?>;">
|
||||
<span><strong><?= $pedido->fecha_encuadernado ? week_day_humanize(Time::createFromFormat("Y-m-d H:i:s", $pedido->fecha_encuadernado)->getDayOfWeek() - 1, true) : "" ?></strong></span>
|
||||
<span><strong>Comercial:</strong> <?= $cliente->first_name . " " . $cliente->comercial()->last_name ?> </span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<div class="px-2 d-flex flex justify-content-center align-items-center w-100">
|
||||
<span class="w-100 text-center" style="background-color: <?= $colors["impresion_interior_ppal"]["bg"] ?>;color:<?= $colors["impresion_interior_ppal"]["color"] ?>;">
|
||||
<?php if ($isPOD): ?>
|
||||
<strong>POD</strong>
|
||||
<?php elseif ($presupuesto->presupuestoLineaImpresion()->isRotativa()): ?>
|
||||
<strong>ROTATIVA</strong>
|
||||
<?php else: ?>
|
||||
<strong>GENERAL</strong>
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row p-2">
|
||||
<div class="col-3 h-100">
|
||||
|
||||
<div class="row px-2 mt-2 h-100">
|
||||
<table class="h-100 bg-white">
|
||||
<tr>
|
||||
<th class="bg-white">IN</th>
|
||||
<td class="t-cell bg-white"><?= $ubicacion ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>PORT.</th>
|
||||
<td class="t-cell bg-white"><?= $ubicacion ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>ACABAD.</th>
|
||||
<td class="t-cell bg-white"><?= $ubicacion ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>ENCUAD.</th>
|
||||
<td class="t-cell bg-white"><?= $ubicacion ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>MANIPUL.</th>
|
||||
<td class="t-cell bg-white"><?= $ubicacion ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-5">
|
||||
<div class="row">
|
||||
<div class="col-12 w-50 text-center" style="background-color: <?= $colors["ot"]["bg"] ?>;color:<?= $colors["ot"]["color"] ?>;">
|
||||
<strong><?= $encuadernacionCode ?></strong>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row h-75">
|
||||
<div class="col-6 square text-center" style="background-color: <?= $colors["papel_interior"]["bg"] ?>;color:<?= $colors["papel_interior"]["color"] ?>;">
|
||||
<?= $linea_impresion?->papel_impresion()->papel_code_ot ?>
|
||||
</div>
|
||||
<div class="col-6 square text-center <?= $linea_impresion->isColor() ? "cmyk" : "bn" ?>">
|
||||
<?= $tiempo_impresion ?>
|
||||
</div>
|
||||
<div class="col-6 square text-center" style="background-color: <?= $colors["papel_cubierta"]["bg"] ?>;color:<?= $colors["papel_cubierta"]["color"] ?>;">
|
||||
<?= $linea_cubierta?->papel_impresion()->papel_code_ot ?>
|
||||
</div>
|
||||
<div class="col-6 square text-center" style="background-color: <?= $colors["plastificado"]["bg"] ?>;color:<?= $colors["plastificado"]["color"] ?>;">
|
||||
<?= isset($acabados[0]) ? $acabados[0]->tarifa()->code : "" ?>
|
||||
</div>
|
||||
<?php foreach ($acabados as $key => $acabado): ?>
|
||||
<?php if ($acabado->tarifa()->isUVI()): ?>
|
||||
<div class="col-6 square offset-md-6 text-center" style="background-color:<?= $acabado->tarifa()->code == "R2D" ? "#4D93D9" : "#0070C0" ?>;color:white;">
|
||||
+ <?= $acabado->tarifa()->code ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-4" style="background-color: <?= $colors["ot"]["bg"] ?>">
|
||||
<div class="row h-100">
|
||||
<div class="col-12 h-50 d-flex flex align-items-center justify-content-center">
|
||||
<span class="fs-large" style="color:<?= $colors["ot"]["color"] ?>;"><strong><?= $ot->id ?></strong></span>
|
||||
</div>
|
||||
<div class="col-12 h-50 d-flex flex align-items-center justify-content-center bg-white">
|
||||
<img class="img-fluid" src="data:image/png;base64,<?= $ot->bar_code ?>" alt="barcode" />
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-8">
|
||||
<table class="h-50">
|
||||
<tr>
|
||||
<th>IDSK</th>
|
||||
<td class="t-cell">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>CLIENTE</th>
|
||||
<td class="t-cell">
|
||||
<?= $cliente->alias ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>TITULO</th>
|
||||
<td class="t-cell">
|
||||
<?= $presupuesto->titulo ?>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<th>ISBN</th>
|
||||
<td class="t-cell"><?= $presupuesto->isbn ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>PEDIDO CLIENTE</th>
|
||||
<td class="t-cell"><?= $pedido->id ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<div class="col-12 d-flex justify-content-center" style="width: 100%">
|
||||
<?php if ($imposicion): ?>
|
||||
|
||||
<?php if ($imposicion->imposicion_esquema()): ?>
|
||||
<?= $imposicion->imposicion_esquema()->svg_schema ?>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<div class="imposicion">
|
||||
<table>
|
||||
<tr>
|
||||
<th class="w-50">Imposicion</th>
|
||||
<td><?= $imposicion?->full_name ?? "" ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="section-title impresion">IMP. INTERIOR</div>
|
||||
<div class="col-12">
|
||||
<div>
|
||||
<table>
|
||||
<tr>
|
||||
<th class="t-header" style="width: 10%;"><?= lang('Produccion.size') ?></th>
|
||||
<td class="t-cell text-center"> <?= $papel_formato->ancho ?>x<?= $papel_formato->alto ?> </td>
|
||||
<th class="t-header" style="width: 10%;"><?= lang('Produccion.ejemplares') ?></th>
|
||||
<td class="t-cell text-center"> 1 </td>
|
||||
<th class="t-header" style="width: 10%;"><?= lang('Produccion.tipo') ?></th>
|
||||
<td class="t-cell text-center"> <?= $presupuesto->tipo_presupuesto()?->codigo ?? "" ?> </td>
|
||||
<th class="t-header" style="width: 10%;"><?= lang('Produccion.lomo') ?></th>
|
||||
<td class="t-cell text-center"> <?= number_format($presupuesto->lomo_cubierta, 2, ',', '.') ?> </td>
|
||||
</tr>
|
||||
</table>
|
||||
<table>
|
||||
<tr>
|
||||
<td rowspan="3" class="row-logo-impresion"><img src="<?= site_url($linea_impresion->get_impresion_logo()) ?>" width="35px" height="35px"></td>
|
||||
<th>Páginas</th>
|
||||
<th>Ejemplares</th>
|
||||
<th>Tintas</th>
|
||||
<th>Formas</th>
|
||||
<th>Máquina</th>
|
||||
<th>Clics</th>
|
||||
<th>Tiempo</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?= $presupuesto->paginas ?></td> <!-- Páginas libro -->
|
||||
<td> 1 </td>
|
||||
<td><?= $linea_impresion->tinta() ?></td>
|
||||
<td><?= json_decode($linea_impresion->formas)->formas ?></td>
|
||||
<td><strong><?= $linea_impresion->maquina()->nombre ?></strong></td>
|
||||
<td><?= $linea_impresion->rotativa_clicks_libro ?></td>
|
||||
<td><?= float_seconds_to_hhmm_string($linea_impresion->horas_maquina * 3600 / $presupuesto->tirada) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="4"><?= $linea_impresion->papel_impresion ?></td>
|
||||
<td><?= $linea_impresion->papel_impresion()->gramaje . " " . "gr" ?></td>
|
||||
<td colspan="2">
|
||||
<?php if ($linea_impresion->isRotativa()): ?>
|
||||
<?= number_format($linea_impresion->rotativa_metros_libro, 2, ',', '.') ?> metros
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="comments <?=$ot->comment_interior ? '' : 'd-none' ?>">
|
||||
<div class="flex-row impresion">Comentarios impresión interior</div>
|
||||
<div class="comment-content w-100">
|
||||
<p>
|
||||
<?= $ot->comment_interior ?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="section-title">LOGISTICA</div>
|
||||
<div class="col-12">
|
||||
<table>
|
||||
<tr>
|
||||
<th>Peso Unidad</th>
|
||||
<th>Peso Pedido</th>
|
||||
<th>Corte Pie</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?= number_format($peso_unidad, 2, ',', '.') ?> gr</td>
|
||||
<td><?= $peso_unidad > 1000 ? number_format($peso_unidad / 1000, 2, ',', '.') . " kg" : number_format($peso_unidad, 2, ',', '.') . " gr" ?> </td>
|
||||
<td>-</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="comments <?=$ot->comment_logistica ? '' : 'd-none' ?>">
|
||||
<div class="flex-row">Comentarios logistica:</div>
|
||||
<div class="comment-content">
|
||||
<p>
|
||||
<?= $ot->comment_logistica ?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src=<?= site_url("themes/vuexy/vendor/libs/html2pdf/html2pdf.bundle.min.js") ?>></script>
|
||||
<script src="<?= site_url('themes/vuexy/vendor/libs/jquery/jquery.js') ?>"></script>
|
||||
<script src="<?= site_url('themes/vuexy/vendor/libs/popper/popper.js') ?>"></script>
|
||||
<script src="<?= site_url('themes/vuexy/vendor/js/bootstrap.js') ?>"></script>
|
||||
<script src="<?= site_url('themes/vuexy/vendor/libs/flatpickr/flatpickr.js') ?>"></script>
|
||||
<script src="<?= site_url('themes/vuexy/vendor/libs/perfect-scrollbar/perfect-scrollbar.js') ?>"></script>
|
||||
<script src="<?= site_url('themes/vuexy/vendor/libs/hammer/hammer.js') ?>"></script>
|
||||
<script src="<?= site_url('themes/vuexy/vendor/js/menu.js') ?>"></script>
|
||||
<script src="<?= site_url('assets/js/safekat/pages/pdf/otDownload.js') ?>"></script>
|
||||
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@ -32,378 +32,377 @@ $settings = $session->get('settings');
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="col-md-12 pdf-wrapper" data-id="<?= $ot->id . "_" . "_" . $presupuesto->id . "_" . $presupuesto->titulo ?>">
|
||||
<div class="row">
|
||||
<div class="col-12 d-flex justify-content-between align-items-center">
|
||||
<h5><?= $presupuesto->titulo ?></h5>
|
||||
<span class="fs-medium"><strong><?= Time::now()->format("d/m/Y H:i:s") ?></strong></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="row mb-2 d-flex flex align-items-stretch">
|
||||
<div class="col-2">
|
||||
<?php if ($ot->full_path): ?>
|
||||
<img class="portada-img border-secondary img-thumbnail img-fluid" src="<?= $ot->full_path ? "data:image/png;base64," . base64_encode(file_get_contents($ot->full_path)) : '/assets/img/portada_not_found.png' ?>" />
|
||||
<?php else: ?>
|
||||
<img class="portada-img border-secondary img-thumbnail img-fluid" src="/assets/img/portada_not_found.png" />
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
<div class="col-10 py-2 rounded border-1 border-secondary" style="background-color: <?= $colors["general"]["bg"] ?>;color:<?= $colors["general"]["color"] ?>;">
|
||||
<div>
|
||||
<div class="col-md-12 pdf-wrapper" data-id="<?= $ot->id . "_" . "_" . $presupuesto->id . "_" . $presupuesto->titulo ?>">
|
||||
<div class="row">
|
||||
<div class="col-8">
|
||||
<div class="px-2 d-flex flex justify-content-between align-items-center" style="background-color: <?= $colors["week_day"]["bg"] ?>;color:<?= $colors["week_day"]["color"] ?>;">
|
||||
<span><strong><?= $pedido->fecha_encuadernado ? week_day_humanize(Time::createFromFormat("Y-m-d H:i:s", $pedido->fecha_encuadernado)->getDayOfWeek() - 1, true) : "" ?></strong></span>
|
||||
<span><strong>Comercial:</strong> <?= $cliente->first_name . " " . $cliente->comercial()->last_name ?> </span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<div class="px-2 d-flex flex justify-content-center align-items-center w-100">
|
||||
<span class="w-100 text-center" style="background-color: <?= $colors["impresion_interior_ppal"]["bg"] ?>;color:<?= $colors["impresion_interior_ppal"]["color"] ?>;">
|
||||
<?php if ($isPOD): ?>
|
||||
<strong>POD</strong>
|
||||
<?php elseif ($presupuesto->presupuestoLineaImpresion()->isRotativa()): ?>
|
||||
<strong>ROTATIVA</strong>
|
||||
<?php else: ?>
|
||||
<strong>GENERAL</strong>
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row p-2">
|
||||
<div class="col-3 h-100">
|
||||
<div class="row px-2 d-flex flex justify-content-between align-items-center">
|
||||
<div class="col-6 w-100 text-center">
|
||||
<span id="fecha_encuadernado_at" style="color:<?= $colors["general"]["color"] ?>;"><strong><?= $pedido->fecha_encuadernado ? Time::createFromFormat("Y-m-d H:i:s", $pedido->fecha_encuadernado)->format('d/m/Y') : "" ?></strong></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row px-2 mt-2 h-100">
|
||||
<table class="h-100 bg-white">
|
||||
<tr>
|
||||
<th class="bg-white">IN</th>
|
||||
<td class="t-cell bg-white"><?= $ubicacion ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>PORT.</th>
|
||||
<td class="t-cell bg-white"><?= $ubicacion ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>ACABAD.</th>
|
||||
<td class="t-cell bg-white"><?= $ubicacion ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>ENCUAD.</th>
|
||||
<td class="t-cell bg-white"><?= $ubicacion ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>MANIPUL.</th>
|
||||
<td class="t-cell bg-white"><?= $ubicacion ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-5">
|
||||
<div class="row">
|
||||
<div class="col-12 w-50 text-center" style="background-color: <?= $colors["ot"]["bg"] ?>;color:<?= $colors["ot"]["color"] ?>;">
|
||||
<strong><?= $encuadernacionCode ?></strong>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row h-75">
|
||||
<div class="col-6 square text-center" style="background-color: <?= $colors["papel_interior"]["bg"] ?>;color:<?= $colors["papel_interior"]["color"] ?>;">
|
||||
<?= $linea_impresion?->papel_impresion()->papel_code_ot ?>
|
||||
</div>
|
||||
<div class="col-6 square text-center <?= $linea_impresion->isColor() ? "cmyk" : "bn" ?>">
|
||||
<?= $tiempo_impresion ?>
|
||||
</div>
|
||||
<div class="col-6 square text-center" style="background-color: <?= $colors["papel_cubierta"]["bg"] ?>;color:<?= $colors["papel_cubierta"]["color"] ?>;">
|
||||
<?= $linea_cubierta?->papel_impresion()->papel_code_ot ?>
|
||||
</div>
|
||||
<div class="col-6 square text-center" style="background-color: <?= $colors["plastificado"]["bg"] ?>;color:<?= $colors["plastificado"]["color"] ?>;">
|
||||
<?= isset($acabados[0]) ? $acabados[0]->tarifa()->code : "" ?>
|
||||
</div>
|
||||
<?php foreach ($acabados as $key => $acabado): ?>
|
||||
<?php if ($acabado->tarifa()->isUVI()): ?>
|
||||
<div class="col-6 square offset-md-6 text-center" style="background-color:<?= $acabado->tarifa()->code == "R2D" ? "#4D93D9" : "#0070C0" ?>;color:white;">
|
||||
+ <?= $acabado->tarifa()->code ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-4" style="background-color: <?= $colors["ot"]["bg"] ?>">
|
||||
<div class="row h-100">
|
||||
<div class="col-12 h-50 d-flex flex align-items-center justify-content-center">
|
||||
<span class="fs-large" style="color:<?= $colors["ot"]["color"] ?>;"><strong><?= $ot->id ?></strong></span>
|
||||
</div>
|
||||
<div class="col-12 h-50 d-flex flex align-items-center justify-content-center bg-white">
|
||||
<img class="img-fluid" src="data:image/png;base64,<?= $ot->bar_code ?>" alt="barcode" />
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-12 d-flex justify-content-between align-items-center">
|
||||
<h5><?= $presupuesto->titulo ?></h5>
|
||||
<span class="fs-medium"><strong><?= Time::now()->format("d/m/Y H:i:s") ?></strong></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-8">
|
||||
<table class="h-50">
|
||||
<tr>
|
||||
<th>IDSK</th>
|
||||
<td class="t-cell">
|
||||
<div class="row mb-2 d-flex flex align-items-stretch">
|
||||
<div class="col-2">
|
||||
<?php if ($ot->full_path): ?>
|
||||
<img class="portada-img border-secondary img-thumbnail img-fluid" src="<?= $ot->full_path ? "data:image/png;base64," . base64_encode(file_get_contents($ot->full_path)) : '/assets/img/portada_not_found.png' ?>" />
|
||||
<?php else: ?>
|
||||
<img class="portada-img border-secondary img-thumbnail img-fluid" src="/assets/img/portada_not_found.png" />
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>CLIENTE</th>
|
||||
<td class="t-cell">
|
||||
<?= $cliente->alias ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>TITULO</th>
|
||||
<td class="t-cell">
|
||||
<?= $presupuesto->titulo ?>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<th>ISBN</th>
|
||||
<td class="t-cell"><?= $presupuesto->isbn ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>PEDIDO CLIENTE</th>
|
||||
<td class="t-cell"><?= $pedido->id ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<div class="col-12 d-flex justify-content-center" style="width: 100%">
|
||||
<?php if ($imposicion): ?>
|
||||
|
||||
<?php if ($imposicion->imposicion_esquema()): ?>
|
||||
<?= $imposicion->imposicion_esquema()->svg_schema ?>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<div class="imposicion">
|
||||
<table>
|
||||
<tr>
|
||||
<th class="w-50">Imposicion</th>
|
||||
<td><?= $imposicion?->full_name ?? "" ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="col-10 py-2 rounded border-1 border-secondary" style="background-color: <?= $colors["general"]["bg"] ?>;color:<?= $colors["general"]["color"] ?>;">
|
||||
<div class="row">
|
||||
<div class="col-8">
|
||||
<div class="px-2 d-flex flex justify-content-between align-items-center" style="background-color: <?= $colors["week_day"]["bg"] ?>;color:<?= $colors["week_day"]["color"] ?>;">
|
||||
<span><strong><?= $pedido->fecha_encuadernado ? week_day_humanize(Time::createFromFormat("Y-m-d H:i:s", $pedido->fecha_encuadernado)->getDayOfWeek() - 1, true) : "" ?></strong></span>
|
||||
<span><strong>Comercial:</strong> <?= $cliente->first_name . " " . $cliente->comercial()->last_name ?> </span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<div class="px-2 d-flex flex justify-content-center align-items-center w-100">
|
||||
<span class="w-100 text-center" style="background-color: <?= $colors["impresion_interior_ppal"]["bg"] ?>;color:<?= $colors["impresion_interior_ppal"]["color"] ?>;">
|
||||
<?php if ($isPOD): ?>
|
||||
<strong>POD</strong>
|
||||
<?php elseif ($presupuesto->presupuestoLineaImpresion()->isRotativa()): ?>
|
||||
<strong>ROTATIVA</strong>
|
||||
<?php else: ?>
|
||||
<strong>GENERAL</strong>
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row p-2">
|
||||
<div class="col-3 h-100">
|
||||
<div class="row px-2 d-flex flex justify-content-between align-items-center">
|
||||
<div class="col-6 w-100 text-center">
|
||||
<span id="fecha_encuadernado_at" style="color:<?= $colors["general"]["color"] ?>;"><strong><?= $pedido->fecha_encuadernado ? Time::createFromFormat("Y-m-d H:i:s", $pedido->fecha_encuadernado)->format('d/m/Y') : "" ?></strong></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row px-2 mt-2 h-100">
|
||||
<table class="h-100 bg-white">
|
||||
<tr>
|
||||
<th class="bg-white">IN</th>
|
||||
<td class="t-cell bg-white"><?= $ubicacion ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>PORT.</th>
|
||||
<td class="t-cell bg-white"><?= $ubicacion ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>ACABAD.</th>
|
||||
<td class="t-cell bg-white"><?= $ubicacion ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>ENCUAD.</th>
|
||||
<td class="t-cell bg-white"><?= $ubicacion ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>MANIPUL.</th>
|
||||
<td class="t-cell bg-white"><?= $ubicacion ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-5">
|
||||
<div class="row">
|
||||
<div class="col-12 w-50 text-center" style="background-color: <?= $colors["ot"]["bg"] ?>;color:<?= $colors["ot"]["color"] ?>;">
|
||||
<strong><?= $encuadernacionCode ?></strong>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row h-75">
|
||||
<div class="col-6 square text-center" style="background-color: <?= $colors["papel_interior"]["bg"] ?>;color:<?= $colors["papel_interior"]["color"] ?>;">
|
||||
<?= $linea_impresion?->papel_impresion()->papel_code_ot ?>
|
||||
</div>
|
||||
<div class="col-6 square text-center <?= $linea_impresion->isColor() ? "cmyk" : "bn" ?>">
|
||||
<?= $tiempo_impresion ?>
|
||||
</div>
|
||||
<div class="col-6 square text-center" style="background-color: <?= $colors["papel_cubierta"]["bg"] ?>;color:<?= $colors["papel_cubierta"]["color"] ?>;">
|
||||
<?= $linea_cubierta?->papel_impresion()->papel_code_ot ?>
|
||||
</div>
|
||||
<div class="col-6 square text-center" style="background-color: <?= $colors["plastificado"]["bg"] ?>;color:<?= $colors["plastificado"]["color"] ?>;">
|
||||
<?= isset($acabados[0]) ? $acabados[0]->tarifa()->code : "" ?>
|
||||
</div>
|
||||
<?php foreach ($acabados as $key => $acabado): ?>
|
||||
<?php if ($acabado->tarifa()->isUVI()): ?>
|
||||
<div class="col-6 square offset-md-6 text-center" style="background-color:<?= $acabado->tarifa()->code == "R2D" ? "#4D93D9" : "#0070C0" ?>;color:white;">
|
||||
+ <?= $acabado->tarifa()->code ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-4" style="background-color: <?= $colors["ot"]["bg"] ?>">
|
||||
<div class="row h-100">
|
||||
<div class="col-12 h-50 d-flex flex align-items-center justify-content-center">
|
||||
<span class="fs-large" style="color:<?= $colors["ot"]["color"] ?>;"><strong><?= $ot->id ?></strong></span>
|
||||
</div>
|
||||
<div class="col-12 h-50 d-flex flex align-items-center justify-content-center bg-white">
|
||||
<img class="img-fluid" src="data:image/png;base64,<?= $ot->bar_code ?>" alt="barcode" />
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="section-title impresion">IMP. INTERIOR</div>
|
||||
<div class="col-12">
|
||||
<div>
|
||||
<table>
|
||||
<div class="row">
|
||||
<div class="col-8">
|
||||
<table class="h-50">
|
||||
<tr>
|
||||
<th class="t-header" style="width: 10%;"><?= lang('Produccion.size') ?></th>
|
||||
<td class="t-cell text-center"> <?= $papel_formato->ancho ?>x<?= $papel_formato->alto ?> </td>
|
||||
<th class="t-header" style="width: 10%;"><?= lang('Produccion.ejemplares') ?></th>
|
||||
<td class="t-cell text-center"> <?= $presupuesto->tirada ?> + <?= $presupuesto->merma ?> </td>
|
||||
<th class="t-header" style="width: 10%;"><?= lang('Produccion.tipo') ?></th>
|
||||
<td class="t-cell text-center"> <?= $presupuesto->tipo_presupuesto()?->codigo ?? "" ?> </td>
|
||||
<th class="t-header" style="width: 10%;"><?= lang('Produccion.lomo') ?></th>
|
||||
<td class="t-cell text-center"> <?= number_format($presupuesto->lomo_cubierta, 2, ',', '.') ?> </td>
|
||||
</tr>
|
||||
</table>
|
||||
<table>
|
||||
<tr>
|
||||
<td rowspan="3" class="row-logo-impresion"><img src="<?= site_url($linea_impresion->get_impresion_logo()) ?>" width="35px" height="35px"></td>
|
||||
<th>Páginas</th>
|
||||
<th>Ejemplares</th>
|
||||
<th>Tintas</th>
|
||||
<th>Formas</th>
|
||||
<th>Máquina</th>
|
||||
<th>Clics</th>
|
||||
<th>Tiempo</th>
|
||||
<th>IDSK</th>
|
||||
<td class="t-cell">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?= $presupuesto->paginas ?></td> <!-- Páginas libro -->
|
||||
<td><?= $presupuesto->tirada ?> </td>
|
||||
<td><?= $linea_impresion->tinta() ?></td>
|
||||
<td><?= json_decode($linea_impresion->formas)->formas ?></td>
|
||||
<td><strong><?= $linea_impresion->maquina()->nombre ?></strong></td>
|
||||
<td><?= $linea_impresion->rotativa_clicks_total ?></td>
|
||||
<td><?= float_seconds_to_hhmm_string($linea_impresion->horas_maquina * 3600) ?></td>
|
||||
<th>CLIENTE</th>
|
||||
<td class="t-cell">
|
||||
<?= $cliente->alias ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="4"><?= $linea_impresion->papel_impresion ?></td>
|
||||
<td><?= $linea_impresion->papel_impresion()->gramaje . " " . "gr" ?></td>
|
||||
<td colspan="2">
|
||||
<?php if ($linea_impresion->isRotativa()): ?>
|
||||
<?= number_format($linea_impresion->rotativa_metros_total, 2, ',', '.') ?> metros
|
||||
<?php endif; ?>
|
||||
<th>TITULO</th>
|
||||
<td class="t-cell">
|
||||
<?= $presupuesto->titulo ?>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<th>ISBN</th>
|
||||
<td class="t-cell"><?= $presupuesto->isbn ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>PEDIDO CLIENTE</th>
|
||||
<td class="t-cell"><?= $pedido->id ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="comments">
|
||||
<div class="flex-row impresion">Comentarios impresión interior</div>
|
||||
<div class="comment-content w-100">
|
||||
<p>
|
||||
</p>
|
||||
<br />
|
||||
<p>
|
||||
</p>
|
||||
<div class="col-4">
|
||||
<div class="col-12 d-flex justify-content-center" style="width: 100%">
|
||||
<?php if ($imposicion): ?>
|
||||
|
||||
<?php if ($imposicion->imposicion_esquema()): ?>
|
||||
<?= $imposicion->imposicion_esquema()->svg_schema ?>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<div class="imposicion">
|
||||
<table>
|
||||
<tr>
|
||||
<th class="w-50">Imposicion</th>
|
||||
<td><?= $imposicion?->full_name ?? "" ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php if ($linea_cubierta): ?>
|
||||
<div class="row mb-2">
|
||||
<div class="section-title cubierta">IMP. CUBIERTA</div>
|
||||
<div class="section-title impresion">IMP. INTERIOR</div>
|
||||
<div class="col-12">
|
||||
<div>
|
||||
<table>
|
||||
<tr>
|
||||
<th class="t-header" style="width: 10%;"><?= lang('Produccion.size') ?></th>
|
||||
<td class="t-cell text-center"> <?= $papel_formato->ancho ?>x<?= $papel_formato->alto ?> </td>
|
||||
<th class="t-header" style="width: 10%;"><?= lang('Produccion.ejemplares') ?></th>
|
||||
<td class="t-cell text-center"> <?= $presupuesto->tirada ?> + <?= $presupuesto->merma ?> </td>
|
||||
<th class="t-header" style="width: 10%;"><?= lang('Produccion.tipo') ?></th>
|
||||
<td class="t-cell text-center"> <?= $presupuesto->tipo_presupuesto()?->codigo ?? "" ?> </td>
|
||||
<th class="t-header" style="width: 10%;"><?= lang('Produccion.lomo') ?></th>
|
||||
<td class="t-cell text-center"> <?= number_format($presupuesto->lomo_cubierta, 2, ',', '.') ?> </td>
|
||||
</tr>
|
||||
</table>
|
||||
<table>
|
||||
<tr>
|
||||
<td rowspan="3" class="row-logo-impresion"><img src="<?= site_url($linea_impresion->get_impresion_logo()) ?>" width="35px" height="35px"></td>
|
||||
<th>Páginas</th>
|
||||
<th>Ejemplares</th>
|
||||
<th>Tintas</th>
|
||||
<th>Formas</th>
|
||||
<th>Máquina</th>
|
||||
<th>Clics</th>
|
||||
<th>Tiempo</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?= $presupuesto->paginas ?></td> <!-- Páginas libro -->
|
||||
<td><?= $presupuesto->tirada ?> </td>
|
||||
<td><?= $linea_impresion->tinta() ?></td>
|
||||
<td><?= json_decode($linea_impresion->formas)->formas ?></td>
|
||||
<td><strong><?= $linea_impresion->maquina()->nombre ?></strong></td>
|
||||
<td><?= $linea_impresion->rotativa_clicks_total ?></td>
|
||||
<td><?= float_seconds_to_hhmm_string($linea_impresion->horas_maquina * 3600) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="4"><?= $linea_impresion->papel_impresion ?></td>
|
||||
<td><?= $linea_impresion->papel_impresion()->gramaje . " " . "gr" ?></td>
|
||||
<td colspan="2">
|
||||
<?php if ($linea_impresion->isRotativa()): ?>
|
||||
<?= number_format($linea_impresion->rotativa_metros_total, 2, ',', '.') ?> metros
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="comments <?=$ot->comment_interior ? '' : 'd-none' ?>">
|
||||
<div class="flex-row impresion"><?= lang('Produccion.comentariosImpresionInterior') ?></div>
|
||||
<div class=" w-100">
|
||||
<p>
|
||||
<?= $ot->comment_interior ?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php if ($linea_cubierta): ?>
|
||||
<div class="row mb-2">
|
||||
<div class="section-title cubierta">IMP. CUBIERTA</div>
|
||||
<div class="col-12">
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td rowspan="3" class="row-logo-impresion"><img src="<?= site_url($linea_cubierta->get_impresion_logo()) ?>" width="35px" height="35px"></td>
|
||||
<th>Tintas</th>
|
||||
<th>Ejemplares</th>
|
||||
<th>Maquina</th>
|
||||
<th>Marcapaginas</th>
|
||||
<th>Tiempo</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?= $linea_cubierta->tinta() ?></td>
|
||||
<td><?= $presupuesto->tirada ?></td>
|
||||
<td><strong><?= $linea_cubierta->maquina()->nombre ?></strong></td>
|
||||
<td><?= $presupuesto->marcapaginas ? "SI" : "NO" ?></td>
|
||||
<td><?= float_seconds_to_hhmm_string($linea_cubierta->horas_maquina * 3600) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="1"><?= json_decode($linea_cubierta->formas)->maquina_ancho ?>x<?= json_decode($linea_cubierta->formas)->maquina_alto ?></td>
|
||||
<td colspan="1"><?= $papel_formato->ancho ?>x<?= $papel_formato->alto ?></td>
|
||||
<td colspan="2"><?= $linea_cubierta->papel_impresion ?></td>
|
||||
<td colspan="2"><?= $linea_cubierta->papel_impresion()->gramaje . " " . "gr" ?></td>
|
||||
|
||||
</tr>
|
||||
</table>
|
||||
<div class="comments <?=$ot->comment_cubierta ? '' : 'd-none' ?>">
|
||||
<div class="flex-row cubierta"><?= lang('Produccion.comentariosCubierta') ?></div>
|
||||
|
||||
<div class="">
|
||||
<p>
|
||||
<?= $ot->comment_cubierta ?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="row">
|
||||
<div class="section-title encuadernacion">ACABADOS/ENCUADERNACIÓN</div>
|
||||
<div class="col-12">
|
||||
<div class="col-1 w-10 mb-2 text-center" style="background-color: <?= $colors["ot"]["bg"] ?>;color:<?= $colors["ot"]["color"] ?>;">
|
||||
<span class="fs-bold"><?= $encuadernacionCode ?></span>
|
||||
</div>
|
||||
<table>
|
||||
<?php foreach ($acabados as $key => $acabado): ?>
|
||||
<tr>
|
||||
<td class="w-10 encuadernacion">Plastificado</td>
|
||||
<td><?= $acabado->tarifa()->nombre ?></td>
|
||||
<td class="encuadernacion bg-encuadernacion" style="width: 100px;">UVI</td>
|
||||
<td style="color:red;width:100px" class="bg-encuadernacion"> <?= $uvi ? 'SI' : "NO" ?> </td>
|
||||
<td class="encuadernacion bg-encuadernacion" style="width: 100px;">EXTERNO:</td>
|
||||
<td class="bg-encuadernacion" style="width: 100px;"><?= $acabado->proveedor() ? $acabado->proveedor()->nombre : "" ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-start" colspan="2"><?=$ot->info_solapa_guillotina?></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td class="t-header">CORTE PIE:</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
|
||||
</table>
|
||||
|
||||
<?php
|
||||
foreach ($encuadernaciones as $key => $encuadernacion) {
|
||||
$encuadernacion_code = $encuadernacion->tarifa()->code;
|
||||
try {
|
||||
if ($encuadernacion_code) {
|
||||
echo view("/themes/vuexy/pdfs/encuadernados/$encuadernacion_code.php", ["encuadernacion" => $encuadernacion]);
|
||||
} else {
|
||||
echo view("/themes/vuexy/pdfs/encuadernados/default.php", ["encuadernacion" => $encuadernacion]);
|
||||
}
|
||||
} catch (\Throwable $th) {
|
||||
$error_message = $th->getMessage();
|
||||
echo "<span style='color:red'>No se ha podido renderizar la tabla de encuadernación</span>";
|
||||
// echo "<br><span style='color:red'>$error_message</span>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
<?php if (count($encuadernaciones) > 0): ?>
|
||||
|
||||
<div class="comments <?=$ot->comment_encuadernacion ? '' : 'd-none' ?>" >
|
||||
<div class="flex-row encuadernacion"><?= lang('Produccion.comentariosEncuadernacion') ?></div>
|
||||
<div class="">
|
||||
<p>
|
||||
<?= $ot->comment_encuadernacion ?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="section-title">LOGISTICA</div>
|
||||
<div class="col-12">
|
||||
<table>
|
||||
<tr>
|
||||
<td rowspan="3" class="row-logo-impresion"><img src="<?= site_url($linea_cubierta->get_impresion_logo()) ?>" width="35px" height="35px"></td>
|
||||
<th>Tintas</th>
|
||||
<th>Ejemplares</th>
|
||||
<th>Maquina</th>
|
||||
<th>Marcapaginas</th>
|
||||
<th>Tiempo</th>
|
||||
<th>Peso Unidad</th>
|
||||
<th>Peso Pedido</th>
|
||||
<th>Cajas</th>
|
||||
<th>Corte Pie</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?= $linea_cubierta->tinta() ?></td>
|
||||
<td><?= $presupuesto->tirada ?></td>
|
||||
<td><strong><?= $linea_cubierta->maquina()->nombre ?></strong></td>
|
||||
<td><?= $presupuesto->marcapaginas ? "SI" : "NO" ?></td>
|
||||
<td><?= float_seconds_to_hhmm_string($linea_cubierta->horas_maquina * 3600) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="1"><?= json_decode($linea_cubierta->formas)->maquina_ancho ?>x<?= json_decode($linea_cubierta->formas)->maquina_alto ?></td>
|
||||
<td colspan="1"><?= $papel_formato->ancho ?>x<?= $papel_formato->alto ?></td>
|
||||
<td colspan="2"><?= $linea_cubierta->papel_impresion ?></td>
|
||||
<td colspan="2"><?= $linea_cubierta->papel_impresion()->gramaje . " " . "gr" ?></td>
|
||||
|
||||
<td><?= number_format($peso_unidad, 2, ',', '.') ?> gr</td>
|
||||
<td><?= $peso_pedido > 1000 ? number_format($peso_pedido / 1000, 2, ',', '.') . " kg" : number_format($peso_pedido, 2, ',', '.') . " gr" ?> </td>
|
||||
<td>-</td>
|
||||
<td>-</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="comments">
|
||||
<div class="flex-row cubierta">Comentarios cubierta</div>
|
||||
<div class="comment-content">
|
||||
<div class="comments <?=$ot->comment_logistica ? '' : 'd-none' ?>">
|
||||
<div class="flex-row logistica"><?= lang('Produccion.comentariosLogistica') ?></div>
|
||||
|
||||
<div class="">
|
||||
<p>
|
||||
<?= $ot->comment_logistica ?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="row mb-2">
|
||||
<div class="section-title encuadernacion">ACABADOS/ENCUADERNACIÓN</div>
|
||||
<div class="col-12">
|
||||
<div class="col-1 w-10 mb-2 text-center" style="background-color: <?= $colors["ot"]["bg"] ?>;color:<?= $colors["ot"]["color"] ?>;">
|
||||
<span class="fs-bold"><?= $encuadernacionCode ?></span>
|
||||
</div>
|
||||
<table>
|
||||
<?php foreach ($acabados as $key => $acabado): ?>
|
||||
<tr>
|
||||
<td class="w-10 encuadernacion">Plastificado</td>
|
||||
<td><?= $acabado->tarifa()->nombre ?></td>
|
||||
<td class="encuadernacion bg-encuadernacion" style="width: 100px;">UVI</td>
|
||||
<td style="color:red;width:100px" class="bg-encuadernacion"> <?= $uvi ? 'SI' : "NO" ?> </td>
|
||||
<td class="encuadernacion bg-encuadernacion" style="width: 100px;">EXTERNO:</td>
|
||||
<td class="bg-encuadernacion" style="width: 100px;"><?= $acabado->proveedor() ? $acabado->proveedor()->nombre : "" ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-start" colspan="2">Meter datos de solapas y preparación guillotina</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td class="t-header">CORTE PIE:</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
|
||||
</table>
|
||||
|
||||
<?php
|
||||
foreach ($encuadernaciones as $key => $encuadernacion) {
|
||||
$encuadernacion_code = $encuadernacion->tarifa()->code;
|
||||
try {
|
||||
if ($encuadernacion_code) {
|
||||
echo view("/themes/vuexy/pdfs/encuadernados/$encuadernacion_code.php", ["encuadernacion" => $encuadernacion]);
|
||||
} else {
|
||||
echo view("/themes/vuexy/pdfs/encuadernados/default.php", ["encuadernacion" => $encuadernacion]);
|
||||
}
|
||||
} catch (\Throwable $th) {
|
||||
$error_message = $th->getMessage();
|
||||
echo "<span style='color:red'>No se ha podido renderizar la tabla de encuadernación</span>";
|
||||
// echo "<br><span style='color:red'>$error_message</span>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
<?php if (count($encuadernaciones) > 0): ?>
|
||||
|
||||
<div class="comments">
|
||||
<div class="flex-row encuadernacion">Comentarios encuadernacion:</div>
|
||||
<div class="comment-content">
|
||||
<p>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="section-title">LOGISTICA</div>
|
||||
<div class="col-12">
|
||||
<table>
|
||||
<tr>
|
||||
<th>Peso Unidad</th>
|
||||
<th>Peso Pedido</th>
|
||||
<th>Cajas</th>
|
||||
<th>Corte Pie</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?= number_format($peso_unidad, 2, ',', '.') ?> gr</td>
|
||||
<td><?= $peso_pedido > 1000 ? number_format($peso_pedido / 1000, 2, ',', '.') . " kg" : number_format($peso_pedido, 2, ',', '.') . " gr" ?> </td>
|
||||
<td>-</td>
|
||||
<td>-</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="comments">
|
||||
<div class="flex-row">Comentarios logistica:</div>
|
||||
<div class="comment-content">
|
||||
<p>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12 d-flex justify-content-center align-items-center">
|
||||
<span class="footer">© 2024 SAFEKAT. Todos los derechos reservados.</span>
|
||||
</div>
|
||||
<script src=<?= site_url("themes/vuexy/vendor/libs/html2pdf/html2pdf.bundle.min.js") ?>></script>
|
||||
<script src="<?= site_url('themes/vuexy/vendor/libs/jquery/jquery.js') ?>"></script>
|
||||
<script src="<?= site_url('themes/vuexy/vendor/libs/popper/popper.js') ?>"></script>
|
||||
<script src="<?= site_url('themes/vuexy/vendor/js/bootstrap.js') ?>"></script>
|
||||
<script src="<?= site_url('themes/vuexy/vendor/libs/flatpickr/flatpickr.js') ?>"></script>
|
||||
<script src="<?= site_url('themes/vuexy/vendor/libs/perfect-scrollbar/perfect-scrollbar.js') ?>"></script>
|
||||
<script src="<?= site_url('themes/vuexy/vendor/libs/hammer/hammer.js') ?>"></script>
|
||||
<script src="<?= site_url('themes/vuexy/vendor/js/menu.js') ?>"></script>
|
||||
<script src="<?= site_url('assets/js/safekat/pages/pdf/otDownload.js') ?>"></script>
|
||||
|
||||
|
||||
</body>
|
||||
<script src=<?= site_url("themes/vuexy/vendor/libs/html2pdf/html2pdf.bundle.min.js") ?>></script>
|
||||
<script src="<?= site_url('themes/vuexy/vendor/libs/jquery/jquery.js') ?>"></script>
|
||||
<script src="<?= site_url('themes/vuexy/vendor/libs/popper/popper.js') ?>"></script>
|
||||
<script src="<?= site_url('themes/vuexy/vendor/js/bootstrap.js') ?>"></script>
|
||||
<script src="<?= site_url('themes/vuexy/vendor/libs/flatpickr/flatpickr.js') ?>"></script>
|
||||
<script src="<?= site_url('themes/vuexy/vendor/libs/perfect-scrollbar/perfect-scrollbar.js') ?>"></script>
|
||||
<script src="<?= site_url('themes/vuexy/vendor/libs/hammer/hammer.js') ?>"></script>
|
||||
<script src="<?= site_url('themes/vuexy/vendor/js/menu.js') ?>"></script>
|
||||
<script src="<?= site_url('assets/js/safekat/pages/pdf/otDownload.js') ?>"></script>
|
||||
|
||||
</html>
|
||||
408
ci4/app/Views/themes/vuexy/pdfs/prototipo.php
Executable file
408
ci4/app/Views/themes/vuexy/pdfs/prototipo.php
Executable file
@ -0,0 +1,408 @@
|
||||
<?php
|
||||
|
||||
use CodeIgniter\I18n\Time;
|
||||
|
||||
$session = session();
|
||||
$settings = $session->get('settings');
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html
|
||||
lang="<?= $session->get('lang') ?>"
|
||||
data-assets-path="<?= site_url('themes/vuexy/') ?>"
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<!-- Icons -->
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/fonts/fontawesome.css') ?>" />
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/fonts/tabler-icons.css') ?>" />
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/fonts/flag-icons.css') ?>" />
|
||||
|
||||
<!-- Core CSS -->
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/css/rtl/core.css') ?>" />
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/css/rtl/theme-semi-dark.css') ?>" />
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/css/safekat.css') ?>" />
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/css/pages/app-chat.css') ?>">
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/libs/flatpickr/flatpickr.css') ?>" />
|
||||
<link rel="icon" type="image/x-icon" href="<?= site_url('themes/vuexy/img/favicon/favicon.ico') ?>" />
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/css/pdf.ot.css') ?>">
|
||||
|
||||
<title><?= $presupuesto->titulo ?>[OT:<?= $ot->id ?>]</title>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="col-md-12 pdf-wrapper" data-id="<?= $ot->id . "_PROTOTIPO_" . "_" . $presupuesto->id . "_" . $presupuesto->titulo ?>">
|
||||
<div class="row">
|
||||
<div class="col-12 d-flex justify-content-between align-items-center">
|
||||
<h5><?= $presupuesto->titulo ?></h5>
|
||||
<span class="fs-medium"><strong><?= Time::now()->format("d/m/Y H:i:s") ?></strong></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="row mb-2 d-flex flex align-items-stretch">
|
||||
<div class="col-2">
|
||||
<?php if ($ot->full_path): ?>
|
||||
<img class="portada-img border-secondary img-thumbnail img-fluid" src="<?= $ot->full_path ? "data:image/png;base64," . base64_encode(file_get_contents($ot->full_path)) : '/assets/img/portada_not_found.png' ?>" />
|
||||
<?php else: ?>
|
||||
<img class="portada-img border-secondary img-thumbnail img-fluid" src="/assets/img/portada_not_found.png" />
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
<div class="col-10 py-2 rounded border-1 border-secondary" style="background-color: <?= $colors["general"]["bg"] ?>;color:<?= $colors["general"]["color"] ?>;">
|
||||
<div class="row">
|
||||
<div class="col-8">
|
||||
<div class="px-2 d-flex flex justify-content-between align-items-center" style="background-color: <?= $colors["week_day"]["bg"] ?>;color:<?= $colors["week_day"]["color"] ?>;">
|
||||
<span><strong><?= $pedido->fecha_encuadernado ? week_day_humanize(Time::createFromFormat("Y-m-d H:i:s", $pedido->fecha_encuadernado)->getDayOfWeek() - 1, true) : "" ?></strong></span>
|
||||
<span><strong>Comercial:</strong> <?= $cliente->first_name . " " . $cliente->comercial()->last_name ?> </span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<div class="px-2 d-flex flex justify-content-center align-items-center w-100">
|
||||
<span class="w-100 text-center" style="background-color: <?= $colors["impresion_interior_ppal"]["bg"] ?>;color:<?= $colors["impresion_interior_ppal"]["color"] ?>;">
|
||||
<?php if ($isPOD): ?>
|
||||
<strong>POD</strong>
|
||||
<?php elseif ($presupuesto->presupuestoLineaImpresion()->isRotativa()): ?>
|
||||
<strong>ROTATIVA</strong>
|
||||
<?php else: ?>
|
||||
<strong>GENERAL</strong>
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row p-2">
|
||||
<div class="col-3 h-100">
|
||||
<div class="row px-2 d-flex flex justify-content-between align-items-center">
|
||||
<div class="col-6 w-100 text-center">
|
||||
<span id="fecha_encuadernado_at" style="color:<?= $colors["general"]["color"] ?>;"><strong><?= $pedido->fecha_encuadernado ? Time::createFromFormat("Y-m-d H:i:s", $pedido->fecha_encuadernado)->format('d/m/Y') : "" ?></strong></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row px-2 mt-2 h-100">
|
||||
<table class="h-100 bg-white">
|
||||
<tr>
|
||||
<th class="bg-white">IN</th>
|
||||
<td class="t-cell bg-white"><?= $ubicacion ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>PORT.</th>
|
||||
<td class="t-cell bg-white"><?= $ubicacion ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>ACABAD.</th>
|
||||
<td class="t-cell bg-white"><?= $ubicacion ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>ENCUAD.</th>
|
||||
<td class="t-cell bg-white"><?= $ubicacion ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>MANIPUL.</th>
|
||||
<td class="t-cell bg-white"><?= $ubicacion ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-5">
|
||||
<div class="row">
|
||||
<div class="col-12 w-50 text-center" style="background-color: <?= $colors["ot"]["bg"] ?>;color:<?= $colors["ot"]["color"] ?>;">
|
||||
<strong><?= $encuadernacionCode ?></strong>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row h-75">
|
||||
<div class="col-6 square text-center" style="background-color: <?= $colors["papel_interior"]["bg"] ?>;color:<?= $colors["papel_interior"]["color"] ?>;">
|
||||
<?= $linea_impresion?->papel_impresion()->papel_code_ot ?>
|
||||
</div>
|
||||
<div class="col-6 square text-center <?= $linea_impresion->isColor() ? "cmyk" : "bn" ?>">
|
||||
<?= $tiempo_impresion ?>
|
||||
</div>
|
||||
<div class="col-6 square text-center" style="background-color: <?= $colors["papel_cubierta"]["bg"] ?>;color:<?= $colors["papel_cubierta"]["color"] ?>;">
|
||||
<?= $linea_cubierta?->papel_impresion()->papel_code_ot ?>
|
||||
</div>
|
||||
<div class="col-6 square text-center" style="background-color: <?= $colors["plastificado"]["bg"] ?>;color:<?= $colors["plastificado"]["color"] ?>;">
|
||||
<?= isset($acabados[0]) ? $acabados[0]->tarifa()->code : "" ?>
|
||||
</div>
|
||||
<?php foreach ($acabados as $key => $acabado): ?>
|
||||
<?php if ($acabado->tarifa()->isUVI()): ?>
|
||||
<div class="col-6 square offset-md-6 text-center" style="background-color:<?= $acabado->tarifa()->code == "R2D" ? "#4D93D9" : "#0070C0" ?>;color:white;">
|
||||
+ <?= $acabado->tarifa()->code ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-4" style="background-color: <?= $colors["ot"]["bg"] ?>">
|
||||
<div class="row h-100">
|
||||
<div class="col-12 h-50 d-flex flex align-items-center justify-content-center">
|
||||
<span class="fs-large" style="color:<?= $colors["ot"]["color"] ?>;"><strong><?= $ot->id ?></strong></span>
|
||||
</div>
|
||||
<div class="col-12 h-50 d-flex flex align-items-center justify-content-center bg-white">
|
||||
<img class="img-fluid" src="data:image/png;base64,<?= $ot->bar_code ?>" alt="barcode" />
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-8">
|
||||
<table class="h-50">
|
||||
<tr>
|
||||
<th>IDSK</th>
|
||||
<td class="t-cell">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>CLIENTE</th>
|
||||
<td class="t-cell">
|
||||
<?= $cliente->alias ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>TITULO</th>
|
||||
<td class="t-cell">
|
||||
<?= $presupuesto->titulo ?>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<th>ISBN</th>
|
||||
<td class="t-cell"><?= $presupuesto->isbn ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>PEDIDO CLIENTE</th>
|
||||
<td class="t-cell"><?= $pedido->id ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<div class="col-12 d-flex justify-content-center" style="width: 100%">
|
||||
<?php if ($imposicion): ?>
|
||||
|
||||
<?php if ($imposicion->imposicion_esquema()): ?>
|
||||
<?= $imposicion->imposicion_esquema()->svg_schema ?>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<div class="imposicion">
|
||||
<table>
|
||||
<tr>
|
||||
<th class="w-50">Imposicion</th>
|
||||
<td><?= $imposicion?->full_name ?? "" ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="section-title impresion">IMP. INTERIOR</div>
|
||||
<div class="col-12">
|
||||
<div>
|
||||
<table>
|
||||
<tr>
|
||||
<th class="t-header" style="width: 10%;"><?= lang('Produccion.size') ?></th>
|
||||
<td class="t-cell text-center"> <?= $papel_formato->ancho ?>x<?= $papel_formato->alto ?> </td>
|
||||
<th class="t-header" style="width: 10%;"><?= lang('Produccion.ejemplares') ?></th>
|
||||
<td class="t-cell text-center"> <?= $presupuesto->tirada/$presupuesto->tirada ?> </td>
|
||||
<th class="t-header" style="width: 10%;"><?= lang('Produccion.tipo') ?></th>
|
||||
<td class="t-cell text-center"> <?= $presupuesto->tipo_presupuesto()?->codigo ?? "" ?> </td>
|
||||
<th class="t-header" style="width: 10%;"><?= lang('Produccion.lomo') ?></th>
|
||||
<td class="t-cell text-center"> <?= number_format($presupuesto->lomo_cubierta, 2, ',', '.') ?> </td>
|
||||
</tr>
|
||||
</table>
|
||||
<table>
|
||||
<tr>
|
||||
<td rowspan="3" class="row-logo-impresion"><img src="<?= site_url($linea_impresion->get_impresion_logo()) ?>" width="35px" height="35px"></td>
|
||||
<th>Páginas</th>
|
||||
<th>Ejemplares</th>
|
||||
<th>Tintas</th>
|
||||
<th>Formas</th>
|
||||
<th>Máquina</th>
|
||||
<th>Clics</th>
|
||||
<th>Tiempo</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?= $presupuesto->paginas ?></td> <!-- Páginas libro -->
|
||||
<td><?= $presupuesto->tirada / $presupuesto->tirada ?> </td>
|
||||
<td><?= $linea_impresion->tinta() ?></td>
|
||||
<td><?= json_decode($linea_impresion->formas)->formas ?></td>
|
||||
<td><strong><?= $linea_impresion->maquina()->nombre ?></strong></td>
|
||||
<td><?= $linea_impresion->rotativa_clicks_libro ?></td>
|
||||
<td><?= float_seconds_to_hhmm_string($linea_impresion->horas_maquina * 3600 / $presupuesto->tirada) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="4"><?= $linea_impresion->papel_impresion ?></td>
|
||||
<td><?= $linea_impresion->papel_impresion()->gramaje . " " . "gr" ?></td>
|
||||
<td colspan="2">
|
||||
<?php if ($linea_impresion->isRotativa()): ?>
|
||||
<?= number_format($linea_impresion->rotativa_metros_libro, 2, ',', '.') ?> metros
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="comments <?=$ot->comment_interior ? '' : 'd-none' ?>">
|
||||
<div class="flex-row impresion"><?= lang('Produccion.comentariosImpresionInterior') ?></div>
|
||||
<div class="comment-content w-100">
|
||||
<p>
|
||||
<?= $ot->comment_interior ?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php if ($linea_cubierta): ?>
|
||||
<div class="row mb-2">
|
||||
<div class="section-title cubierta">IMP. CUBIERTA</div>
|
||||
<div class="col-12">
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td rowspan="3" class="row-logo-impresion"><img src="<?= site_url($linea_cubierta->get_impresion_logo()) ?>" width="35px" height="35px"></td>
|
||||
<th>Tintas</th>
|
||||
<th>Ejemplares</th>
|
||||
<th>Maquina</th>
|
||||
<th>Marcapaginas</th>
|
||||
<th>Tiempo</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?= $linea_cubierta->tinta() ?></td>
|
||||
<td><?= $presupuesto->tirada/$presupuesto->tirada ?></td>
|
||||
<td><strong><?= $linea_cubierta->maquina()->nombre ?></strong></td>
|
||||
<td><?= $presupuesto->marcapaginas ? "SI" : "NO" ?></td>
|
||||
<td><?= float_seconds_to_hhmm_string($linea_cubierta->horas_maquina * 3600/$presupuesto->tirada) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="1"><?= json_decode($linea_cubierta->formas)->maquina_ancho ?>x<?= json_decode($linea_cubierta->formas)->maquina_alto ?></td>
|
||||
<td colspan="1"><?= $papel_formato->ancho ?>x<?= $papel_formato->alto ?></td>
|
||||
<td colspan="2"><?= $linea_cubierta->papel_impresion ?></td>
|
||||
<td colspan="2"><?= $linea_cubierta->papel_impresion()->gramaje . " " . "gr" ?></td>
|
||||
|
||||
</tr>
|
||||
</table>
|
||||
<div class="comments <?=$ot->comment_cubierta ? '' : 'd-none' ?>">
|
||||
<div class="flex-row cubierta"><?= lang('Produccion.comentariosCubierta') ?></div>
|
||||
|
||||
<div class="comment-content">
|
||||
<p>
|
||||
<?= $ot->comment_cubierta ?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="row mb-2">
|
||||
<div class="section-title encuadernacion">ACABADOS/ENCUADERNACIÓN</div>
|
||||
<div class="col-12">
|
||||
<div class="col-1 w-10 mb-2 text-center" style="background-color: <?= $colors["ot"]["bg"] ?>;color:<?= $colors["ot"]["color"] ?>;">
|
||||
<span class="fs-bold"><?= $encuadernacionCode ?></span>
|
||||
</div>
|
||||
<table>
|
||||
<?php foreach ($acabados as $key => $acabado): ?>
|
||||
<tr>
|
||||
<td class="w-10 encuadernacion">Plastificado</td>
|
||||
<td><?= $acabado->tarifa()->nombre ?></td>
|
||||
<td class="encuadernacion bg-encuadernacion" style="width: 100px;">UVI</td>
|
||||
<td style="color:red;width:100px" class="bg-encuadernacion"> <?= $uvi ? 'SI' : "NO" ?> </td>
|
||||
<td class="encuadernacion bg-encuadernacion" style="width: 100px;">EXTERNO:</td>
|
||||
<td class="bg-encuadernacion" style="width: 100px;"><?= $acabado->proveedor() ? $acabado->proveedor()->nombre : "" ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-start" colspan="2"><?=$ot->info_solapa_guillotina?></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td class="t-header">CORTE PIE:</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
|
||||
</table>
|
||||
|
||||
<?php
|
||||
foreach ($encuadernaciones as $key => $encuadernacion) {
|
||||
$encuadernacion_code = $encuadernacion->tarifa()->code;
|
||||
try {
|
||||
if ($encuadernacion_code) {
|
||||
echo view("/themes/vuexy/pdfs/encuadernados/$encuadernacion_code.php", ["encuadernacion" => $encuadernacion]);
|
||||
} else {
|
||||
echo view("/themes/vuexy/pdfs/encuadernados/default.php", ["encuadernacion" => $encuadernacion]);
|
||||
}
|
||||
} catch (\Throwable $th) {
|
||||
$error_message = $th->getMessage();
|
||||
echo "<span style='color:red'>No se ha podido renderizar la tabla de encuadernación</span>";
|
||||
// echo "<br><span style='color:red'>$error_message</span>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
<?php if (count($encuadernaciones) > 0): ?>
|
||||
|
||||
<div class="comments <?=$ot->comment_encuadernacion ? '' : 'd-none' ?>">
|
||||
<div class="flex-row encuadernacion"><?= lang('Produccion.comentariosEncuadernacion') ?></div>
|
||||
<div class="comment-content">
|
||||
<p>
|
||||
<?= $ot->comment_encuadernacion ?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="section-title">LOGISTICA</div>
|
||||
<div class="col-12">
|
||||
<table>
|
||||
<tr>
|
||||
<th>Peso Unidad</th>
|
||||
<th>Peso Pedido</th>
|
||||
<th>Corte Pie</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?= number_format($peso_unidad, 2, ',', '.') ?> gr</td>
|
||||
<td><?= $peso_unidad > 1000 ? number_format($peso_unidad / 1000, 2, ',', '.') . " kg" : number_format($peso_unidad, 2, ',', '.') . " gr" ?> </td>
|
||||
<td>-</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="comments">
|
||||
<div class="flex-row logistica"><?= lang('Produccion.comentariosLogistica') ?></div>
|
||||
|
||||
<div class="comment-content">
|
||||
<p>
|
||||
<?= $ot->comment_logistica ?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src=<?= site_url("themes/vuexy/vendor/libs/html2pdf/html2pdf.bundle.min.js") ?>></script>
|
||||
<script src="<?= site_url('themes/vuexy/vendor/libs/jquery/jquery.js') ?>"></script>
|
||||
<script src="<?= site_url('themes/vuexy/vendor/libs/popper/popper.js') ?>"></script>
|
||||
<script src="<?= site_url('themes/vuexy/vendor/js/bootstrap.js') ?>"></script>
|
||||
<script src="<?= site_url('themes/vuexy/vendor/libs/flatpickr/flatpickr.js') ?>"></script>
|
||||
<script src="<?= site_url('themes/vuexy/vendor/libs/perfect-scrollbar/perfect-scrollbar.js') ?>"></script>
|
||||
<script src="<?= site_url('themes/vuexy/vendor/libs/hammer/hammer.js') ?>"></script>
|
||||
<script src="<?= site_url('themes/vuexy/vendor/js/menu.js') ?>"></script>
|
||||
<script src="<?= site_url('assets/js/safekat/pages/pdf/otDownload.js') ?>"></script>
|
||||
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@ -6,6 +6,12 @@ class OrdenTrabajoDatatable {
|
||||
this.datatablePendientesItem = this.item.find("#ot-datatable-pendientes")
|
||||
this.datatableFerroPendienteItem = this.item.find("#ot-datatable-ferro-pendiente")
|
||||
this.datatableFerroOkItem = this.item.find("#ot-datatable-ferro-ok")
|
||||
this.datatableNews = this.item.find("#ot-datatable-news")
|
||||
this.datatableProd = this.item.find("#ot-datatable-prod")
|
||||
this.datatableWaiting = this.item.find("#ot-datatable-waiting")
|
||||
this.datatableRevisionComerical = this.item.find("#ot-datatable-revision-com")
|
||||
|
||||
|
||||
|
||||
|
||||
this.datatableColumns = [
|
||||
@ -37,15 +43,15 @@ class OrdenTrabajoDatatable {
|
||||
render: (d, t) => {
|
||||
return `<div class="btn-group btn-group-sm">
|
||||
<a type="button" href="/produccion/ordentrabajo/edit/${d}" class=" btn btn-outline ot-edit"><i class="ti ti-eye ti-sm mx-2"></i></a>
|
||||
<a type="button" target="_blank" href="/produccion/ordentrabajo/pdf/${d}" class="btn btn-outline ot-pdf"><i class="ti ti-download ti-sm mx-2"></i></a>
|
||||
|
||||
</div>`
|
||||
}
|
||||
// <a type="button" target="_blank" href="/produccion/ordentrabajo/pdf/${d}" class="btn btn-outline ot-pdf"><i class="ti ti-download ti-sm mx-2"></i></a>
|
||||
|
||||
}
|
||||
]
|
||||
}
|
||||
init() {
|
||||
this.datatable = this.datatableItem.DataTable({
|
||||
this.datatableItem.DataTable({
|
||||
processing: true,
|
||||
layout: {
|
||||
topStart: 'pageLength',
|
||||
@ -71,7 +77,7 @@ class OrdenTrabajoDatatable {
|
||||
});
|
||||
}
|
||||
initPendientes() {
|
||||
this.datatable = this.datatablePendientesItem.DataTable({
|
||||
this.datatablePendientesItem.DataTable({
|
||||
processing: true,
|
||||
layout: {
|
||||
topStart: 'pageLength',
|
||||
@ -98,7 +104,7 @@ class OrdenTrabajoDatatable {
|
||||
});
|
||||
}
|
||||
initFerroPendiente() {
|
||||
this.datatable = this.datatableFerroPendienteItem.DataTable({
|
||||
this.datatableFerroPendienteItem.DataTable({
|
||||
processing: true,
|
||||
layout: {
|
||||
topStart: 'pageLength',
|
||||
@ -124,7 +130,7 @@ class OrdenTrabajoDatatable {
|
||||
});
|
||||
}
|
||||
initFerroOk() {
|
||||
this.datatable = this.datatableFerroOkItem.DataTable({
|
||||
this.datatableFerroOkItem.DataTable({
|
||||
processing: true,
|
||||
layout: {
|
||||
topStart: 'pageLength',
|
||||
@ -149,6 +155,110 @@ class OrdenTrabajoDatatable {
|
||||
}
|
||||
});
|
||||
}
|
||||
initNews() {
|
||||
this.datatableNews.DataTable({
|
||||
processing: true,
|
||||
layout: {
|
||||
topStart: 'pageLength',
|
||||
topEnd: 'search',
|
||||
bottomStart: 'info',
|
||||
bottomEnd: 'paging'
|
||||
},
|
||||
serverSide: true,
|
||||
columnDefs: [
|
||||
{ className: 'dt-center', targets: '_all' },
|
||||
|
||||
],
|
||||
pageLength: 25,
|
||||
language: {
|
||||
url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
|
||||
},
|
||||
columns: this.datatableColumns,
|
||||
ajax: '/produccion/ordentrabajo/datatable_news',
|
||||
createdRow: (row,data,dataIndex) => {
|
||||
$(row).css("border-left",`20px solid ${data.logo.color}`)
|
||||
$(row).css("border-right",`20px solid ${data.logo.color}`)
|
||||
}
|
||||
});
|
||||
}
|
||||
initWaiting() {
|
||||
this.datatableWaiting.DataTable({
|
||||
processing: true,
|
||||
layout: {
|
||||
topStart: 'pageLength',
|
||||
topEnd: 'search',
|
||||
bottomStart: 'info',
|
||||
bottomEnd: 'paging'
|
||||
},
|
||||
serverSide: true,
|
||||
columnDefs: [
|
||||
{ className: 'dt-center', targets: '_all' },
|
||||
|
||||
],
|
||||
pageLength: 25,
|
||||
language: {
|
||||
url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
|
||||
},
|
||||
columns: this.datatableColumns,
|
||||
ajax: '/produccion/ordentrabajo/datatable_waiting',
|
||||
createdRow: (row,data,dataIndex) => {
|
||||
$(row).css("border-left",`20px solid ${data.logo.color}`)
|
||||
$(row).css("border-right",`20px solid ${data.logo.color}`)
|
||||
}
|
||||
});
|
||||
}
|
||||
initProd() {
|
||||
this.datatableProd.DataTable({
|
||||
processing: true,
|
||||
layout: {
|
||||
topStart: 'pageLength',
|
||||
topEnd: 'search',
|
||||
bottomStart: 'info',
|
||||
bottomEnd: 'paging'
|
||||
},
|
||||
serverSide: true,
|
||||
columnDefs: [
|
||||
{ className: 'dt-center', targets: '_all' },
|
||||
|
||||
],
|
||||
pageLength: 25,
|
||||
language: {
|
||||
url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
|
||||
},
|
||||
columns: this.datatableColumns,
|
||||
ajax: '/produccion/ordentrabajo/datatable_prod',
|
||||
createdRow: (row,data,dataIndex) => {
|
||||
$(row).css("border-left",`20px solid ${data.logo.color}`)
|
||||
$(row).css("border-right",`20px solid ${data.logo.color}`)
|
||||
}
|
||||
});
|
||||
}
|
||||
initRevisionComercial() {
|
||||
this.datatableRevisionComerical.DataTable({
|
||||
processing: true,
|
||||
layout: {
|
||||
topStart: 'pageLength',
|
||||
topEnd: 'search',
|
||||
bottomStart: 'info',
|
||||
bottomEnd: 'paging'
|
||||
},
|
||||
serverSide: true,
|
||||
columnDefs: [
|
||||
{ className: 'dt-center', targets: '_all' },
|
||||
|
||||
],
|
||||
pageLength: 25,
|
||||
language: {
|
||||
url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
|
||||
},
|
||||
columns: this.datatableColumns,
|
||||
ajax: '/produccion/ordentrabajo/datatable_revision_com',
|
||||
createdRow: (row,data,dataIndex) => {
|
||||
$(row).css("border-left",`20px solid ${data.logo.color}`)
|
||||
$(row).css("border-right",`20px solid ${data.logo.color}`)
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -88,6 +88,9 @@ let ClassSelect = function (domItem, url, placeholder, allowClear = false, param
|
||||
this.getText = () => {
|
||||
return this.item.find(":selected").text();
|
||||
};
|
||||
this.getDesc = () => {
|
||||
return this.item.find(":selected").data("desc");
|
||||
};
|
||||
this.onChange = function (callback) {
|
||||
this.item.on('change', callback);
|
||||
};
|
||||
|
||||
@ -0,0 +1,175 @@
|
||||
|
||||
import Ajax from '../../../components/ajax.js'
|
||||
import { alertConfirmAction, alertError, alertSuccess } from '../../../components/alerts/sweetAlert.js'
|
||||
|
||||
class MaquinistaFichajeAuto {
|
||||
constructor(domItem) {
|
||||
this.item = domItem
|
||||
/** ELEMENT DOM VARIABLES */
|
||||
this.otInputId = this.item.find('#ot-id')
|
||||
this.wrapperCard = this.item.find('#ot-fa-card')
|
||||
this.btnCancelTarea = this.item.find('#btn-cancel-tarea')
|
||||
this.btnFinishTarea = this.item.find('#btn-finish-tarea')
|
||||
this.inputClickInit = this.item.find("#input-click-init")
|
||||
this.inputClickEnd = this.item.find("#input-click-end")
|
||||
|
||||
this.otId = null
|
||||
this.lastOtId = null
|
||||
this.maquinaId = this.item.data("id")
|
||||
this.tareas = []
|
||||
|
||||
}
|
||||
init() {
|
||||
Notiflix.Block.circle('.section-block');
|
||||
this.otInputId.trigger('focus')
|
||||
this.otInputId.on('change', this._handleGetOt.bind(this))
|
||||
this.btnFinishTarea.on('click', this._handleFinishTareasConfirm.bind(this))
|
||||
}
|
||||
|
||||
hideCard() {
|
||||
this.wrapperCard.addClass('d-none')
|
||||
}
|
||||
showCard() {
|
||||
this.wrapperCard.removeClass('d-none')
|
||||
}
|
||||
actionLoader(status = true) {
|
||||
if (status) {
|
||||
Notiflix.Block.circle('.section-block');
|
||||
} else {
|
||||
Notiflix.Block.remove('.section-block');
|
||||
}
|
||||
}
|
||||
|
||||
getFormData() {
|
||||
return {
|
||||
maquina_id: this.maquinaId,
|
||||
tareas: this.tareas,
|
||||
click_init: this.inputClickInit.val() ?? 0,
|
||||
click_end: this.inputClickEnd.val() ?? 0
|
||||
}
|
||||
}
|
||||
fillData(data) {
|
||||
this.lastOtId = data.ot.id
|
||||
this.item.find('#ot-id-header').text(data.ot.id)
|
||||
this.item.find('#presupuesto-id').text(data.presupuesto.id)
|
||||
this.item.find('#ot-title').text(data.presupuesto.titulo)
|
||||
if (data.tareas) {
|
||||
this.tareas = data.tareas.map(tarea => tarea.id)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
_handleGetOt() {
|
||||
this.otId = this.otInputId.val();
|
||||
this.otInputId.removeClass('is-valid')
|
||||
this.otInputId.removeClass('is-invalid')
|
||||
this.actionLoader(false)
|
||||
let ajax = new Ajax(
|
||||
`/produccion/ordentrabajo/tareas/maquina/${this.otId}/${this.maquinaId}`,
|
||||
null,
|
||||
null,
|
||||
this._handleGetOtSuccess.bind(this),
|
||||
this._handleGetOtError.bind(this)
|
||||
)
|
||||
if (this.otId) {
|
||||
ajax.get();
|
||||
}
|
||||
}
|
||||
_handleGetOtSuccess(response) {
|
||||
this.showCard();
|
||||
if (this.lastOtId) {
|
||||
console.log("Siguiente OT insertada")
|
||||
console.log("Iniciar ", this.otId)
|
||||
if (this.lastOtId != this.otId) {
|
||||
console.log("Finalizar", this.lastOtId)
|
||||
this._handleFinishTareas(this.lastOtId)
|
||||
}
|
||||
} else {
|
||||
console.log("Primera OT insertada")
|
||||
}
|
||||
this.otInputId.addClass('is-valid')
|
||||
popSuccessAlert(response.message)
|
||||
this.actionLoader(false)
|
||||
if (response.data) {
|
||||
this.fillData(response.data)
|
||||
response.data.tareas.forEach(tarea => {
|
||||
this._handleInitTareas(tarea.id, 'I')
|
||||
});
|
||||
}
|
||||
}
|
||||
_handleGetOtError(error) {
|
||||
this.hideCard()
|
||||
this.otInputId.addClass('is-invalid')
|
||||
popErrorAlert(error.responseJSON.message)
|
||||
}
|
||||
_handleInitTareas(tareaId, estado = 'I') {
|
||||
let ajax = new Ajax('/produccion/ordentrabajo/update/tarea/progress',
|
||||
{
|
||||
ot_tarea_id: tareaId,
|
||||
estado: estado
|
||||
}, null,
|
||||
this._handleInitTareasSuccess.bind(this),
|
||||
this._handleInitTareasError.bind(this)
|
||||
);
|
||||
if (tareaId) {
|
||||
ajax.post();
|
||||
}
|
||||
}
|
||||
_handleInitTareasSuccess() { }
|
||||
_handleInitTareasError() { }
|
||||
|
||||
_handleFinishTareas(otId) {
|
||||
let ajax = new Ajax('/produccion/ordentrabajo/fa/tareas/finish',
|
||||
{
|
||||
orden_trabajo_id: otId,
|
||||
...this.getFormData()
|
||||
}, null,
|
||||
this._handleFinishTareasSucess.bind(this),
|
||||
this._handleFinishTareasError.bind(this)
|
||||
);
|
||||
ajax.post()
|
||||
|
||||
}
|
||||
_handleFinishTareasConfirm(event) {
|
||||
let otId = this.otInputId.val()
|
||||
console.log("Finalizar", otId);
|
||||
let ajax = new Ajax('/produccion/ordentrabajo/fa/tareas/finish',
|
||||
{
|
||||
orden_trabajo_id: otId,
|
||||
...this.getFormData()
|
||||
}, null,
|
||||
this._handleFinishTareasConfirmSucess.bind(this),
|
||||
this._handleFinishTareasConfirmError.bind(this)
|
||||
);
|
||||
if (otId) {
|
||||
alertConfirmAction('Se va finalizar la tarea actual y se cancelará el modo auto.')
|
||||
.then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
ajax.post();
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
_handleFinishTareasConfirmSucess(response) {
|
||||
this.hideCard()
|
||||
this.otInputId.val(null)
|
||||
this.otId = null
|
||||
this.lastOtId = null
|
||||
this.tareas = []
|
||||
popSuccessAlert(response.message)
|
||||
}
|
||||
_handleFinishTareasConfirmError() { }
|
||||
_handleFinishTareasSucess() { }
|
||||
_handleFinishTareasError() { }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
export default MaquinistaFichajeAuto;
|
||||
@ -0,0 +1,223 @@
|
||||
|
||||
|
||||
import Ajax from '../../../components/ajax.js'
|
||||
import { alertConfirmAction, alertError, alertSuccess } from '../../../components/alerts/sweetAlert.js'
|
||||
class MaquinistaMultipleTarea {
|
||||
constructor(domItem) {
|
||||
this.item = domItem
|
||||
this.maquinaId = this.item.data("id");
|
||||
this.btnPlay = this.item.find("#btn-start-tarea")
|
||||
this.btnPause = this.item.find("#btn-pause-tarea")
|
||||
this.btnDelay = this.item.find("#btn-stop-tarea")
|
||||
this.btnFinish = this.item.find("#btn-finish-tarea")
|
||||
this.btnDeleteProgress = this.item.find("#btn-delete-tarea")
|
||||
this.actionButtons = this.item.find('.action-btn')
|
||||
this.tareaCardClass = '.tarea-card-action-block'
|
||||
this.inputClick = $('.ot-tarea-click')
|
||||
this.datatableItem = this.item.find('#table-scanned-ots')
|
||||
this.datatableColumns = [
|
||||
{ data: 'otId', searchable: false, sortable: false },
|
||||
{ data: 'titulo', searchable: false, sortable: false },
|
||||
{
|
||||
data: 'barcode', searchable: false, sortable: false, render: (d, t) => {
|
||||
return `<img class="img-fluid w-100 h-50" src="data:image/png;base64,${d}" alt="barcode" />`
|
||||
}
|
||||
},
|
||||
{
|
||||
data: 'action', searchable: false, sortable: false, render: (d, t) => {
|
||||
return `<a href="/produccion/ordentrabajo/edit/${d}" type="button" title="OT" class="maquina-btn btn btn-primary d-flex justify-content-center gap-2"><span class="ti ti-eye ti-lg"></span></a>`
|
||||
}
|
||||
},
|
||||
]
|
||||
}
|
||||
init() {
|
||||
this.actionButtons.on('click', this.eventActionButton.bind(this))
|
||||
this.btnDelay.on('click', this.delayEventActionButton.bind(this))
|
||||
this.btnDeleteProgress.on('click', this.deleteAll.bind(this))
|
||||
this.actionLoader(true)
|
||||
this.datatableItem.DataTable({
|
||||
processing: true,
|
||||
dom: "",
|
||||
serverSide: true,
|
||||
ordering: false,
|
||||
pageLength: 25,
|
||||
language: {
|
||||
url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
|
||||
},
|
||||
columns: this.datatableColumns,
|
||||
ajax: '/produccion/ordentrabajo/maquinas/ots/datatable/' + this.maquinaId,
|
||||
|
||||
});
|
||||
this.initData()
|
||||
}
|
||||
async initData() {
|
||||
try {
|
||||
let responseData = await this.getMaquinaMultipleTarea();
|
||||
this.fillCardData(responseData)
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
} finally {
|
||||
this.actionLoader(false)
|
||||
}
|
||||
}
|
||||
fillCardData(responseData) {
|
||||
this.item.find('#tirada-info').text(responseData?.tirada_total ?? 0)
|
||||
this.item.find('#clicks-info').text(responseData?.clicks_total ?? 0)
|
||||
this.item.find('#tiempo-estimado-info').text(responseData.tiempo_total_estimado ?? "00:00:00")
|
||||
this.item.find('#tiempo-real-info').text(responseData.tiempo_total_real ?? "00:00:00")
|
||||
this.showBasedOnStatus(responseData.estado)
|
||||
}
|
||||
async deleteAll() {
|
||||
try {
|
||||
let result = await alertConfirmAction('Se resetearán las tareas y se borrará el progreso')
|
||||
if(result.isConfirmed){
|
||||
let response = await this.deleteMaquinaOrdenesTrabajo()
|
||||
popSuccessAlert(response.message);
|
||||
window.location.reload();
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
}
|
||||
|
||||
}
|
||||
async eventActionButton(event) {
|
||||
try {
|
||||
this.actionLoader(true)
|
||||
let statusClick = $(event.currentTarget).data('estado');
|
||||
this.showBasedOnStatus(statusClick);
|
||||
console.info(`Estado ${statusClick}`)
|
||||
this.showBasedOnStatus(statusClick);
|
||||
if (statusClick == "F") {
|
||||
let result = await alertConfirmAction('Se marcarán como finalizadas todas las tareas')
|
||||
if (result.isConfirmed == false) {
|
||||
this.enableButtons()
|
||||
throw new Error('Cancelado')
|
||||
}
|
||||
}
|
||||
let response = await this.updateEstadoOts(statusClick)
|
||||
popSuccessAlert(response.message)
|
||||
let responseData = await this.getMaquinaMultipleTarea()
|
||||
this.fillCardData(responseData)
|
||||
if(statusClick == "F"){
|
||||
window.location.reload();
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
} finally {
|
||||
this.actionLoader(false)
|
||||
}
|
||||
}
|
||||
|
||||
async delayEventActionButton(event) {
|
||||
try {
|
||||
this.actionLoader(true)
|
||||
let statusClick = $(event.currentTarget).data('estado');
|
||||
this.showBasedOnStatus(statusClick);
|
||||
let response = await this.updateEstadoOts(statusClick)
|
||||
popSuccessAlert(response.message)
|
||||
let responseData = await this.getMaquinaMultipleTarea()
|
||||
this.fillCardData(responseData)
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
} finally {
|
||||
this.actionLoader(false)
|
||||
}
|
||||
}
|
||||
actionLoader(status = true) {
|
||||
if (status) {
|
||||
Notiflix.Block.circle(this.tareaCardClass);
|
||||
} else {
|
||||
Notiflix.Block.remove(this.tareaCardClass);
|
||||
}
|
||||
}
|
||||
showPlay() {
|
||||
this.btnPause.addClass('d-none')
|
||||
this.btnPlay.removeClass('d-none')
|
||||
this.btnFinish.removeClass('d-none')
|
||||
this.btnDelay.removeClass('d-none')
|
||||
|
||||
}
|
||||
showPause() {
|
||||
this.btnPlay.addClass('d-none')
|
||||
this.btnFinish.addClass('d-none')
|
||||
this.btnPause.removeClass('d-none')
|
||||
|
||||
}
|
||||
disableButtons() {
|
||||
this.actionButtons.attr('disabled', 'disabled')
|
||||
this.btnDelay.attr('disabled', 'disabled')
|
||||
this.btnDeleteProgress.attr('disabled', 'disabled')
|
||||
}
|
||||
enableButtons() {
|
||||
this.actionButtons.removeAttr('disabled')
|
||||
this.btnDelay.removeAttr('disabled', 'disabled')
|
||||
this.btnDeleteProgress.removeAttr('disabled', 'disabled')
|
||||
}
|
||||
|
||||
showBasedOnStatus(status) {
|
||||
if (['P', 'S'].includes(status)) {
|
||||
this.enableButtons()
|
||||
this.showPlay()
|
||||
}
|
||||
if (['F', 'E'].includes(status)) {
|
||||
this.disableButtons()
|
||||
this.showPlay()
|
||||
}
|
||||
if (status == 'I') {
|
||||
this.enableButtons()
|
||||
this.showPause()
|
||||
}
|
||||
if (status == "D") {
|
||||
this.showPlay()
|
||||
}
|
||||
|
||||
}
|
||||
getClicks() {
|
||||
return {
|
||||
click_init: this.item.find('#input-click-init').val() ?? 0,
|
||||
click_end: this.item.find('#input-click-end').val() ?? 0,
|
||||
}
|
||||
}
|
||||
/** maquinas/ots/estado */
|
||||
updateEstadoOts(estado) {
|
||||
return new Promise((resolve, reject) => {
|
||||
new Ajax('/produccion/ordentrabajo/maquinas/ots/estado',
|
||||
{
|
||||
maquina_id: this.maquinaId,
|
||||
estado: estado,
|
||||
...this.getClicks()
|
||||
},
|
||||
null,
|
||||
resolve,
|
||||
reject
|
||||
).post()
|
||||
})
|
||||
}
|
||||
getMaquinaMultipleTarea() {
|
||||
return new Promise((resolve, reject) => {
|
||||
new Ajax('/produccion/ordentrabajo/maquinas/ots/' + this.maquinaId,
|
||||
null,
|
||||
null,
|
||||
resolve,
|
||||
reject
|
||||
).get()
|
||||
})
|
||||
}
|
||||
|
||||
deleteMaquinaOrdenesTrabajo() {
|
||||
return new Promise((resolve, reject) => {
|
||||
new Ajax('/produccion/ordentrabajo/maquinas/ots/all/' + this.maquinaId,
|
||||
null,
|
||||
null,
|
||||
resolve,
|
||||
reject
|
||||
).delete()
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
export default MaquinistaMultipleTarea;
|
||||
@ -0,0 +1,164 @@
|
||||
|
||||
import Ajax from '../../../components/ajax.js'
|
||||
import { alertConfirmAction, alertError, alertSuccess } from '../../../components/alerts/sweetAlert.js'
|
||||
|
||||
class MaquinistaScan {
|
||||
constructor(domItem) {
|
||||
this.item = domItem
|
||||
/** ELEMENT DOM VARIABLES */
|
||||
this.otInputId = this.item.find('#ot-id')
|
||||
this.otId = null
|
||||
this.maquinaId = this.item.data("id")
|
||||
this.ots = []
|
||||
this.datatableItem = this.item.find('#table-scanned-ots')
|
||||
this.btnSave = this.item.find('#btn-save-maquina-ots');
|
||||
this.btnReset = this.item.find('#btn-reset-ots')
|
||||
this.datatableColumns = [
|
||||
{ data: 'id', searchable: false, sortable: false },
|
||||
{ data: 'title', searchable: false, sortable: false },
|
||||
]
|
||||
this.datatableData = [];
|
||||
this.linkAfterSave = this.item.find('#ot-maquina-tareas-link')
|
||||
this.scanWrapper = this.item.find('.ot-scan-wrapper')
|
||||
|
||||
}
|
||||
init() {
|
||||
this.otInputId.trigger('focus')
|
||||
this.otInputId.on('change', this.addOt.bind(this))
|
||||
this.btnReset.on('click',this.reset.bind(this))
|
||||
this.btnSave.on('click',this.saveMultipleOTs.bind(this))
|
||||
this.datatable = this.datatableItem.DataTable({
|
||||
processing: true,
|
||||
serverSide: false,
|
||||
ordering: false,
|
||||
dom: "",
|
||||
language: {
|
||||
url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
|
||||
},
|
||||
columns: this.datatableColumns,
|
||||
data: this.datatableData
|
||||
});
|
||||
|
||||
}
|
||||
reset(){
|
||||
this.ots = []
|
||||
this.datatable.clear()
|
||||
this.datatable.draw()
|
||||
this.reloadFocus();
|
||||
this.btnSave.attr('disabled','disabled');
|
||||
}
|
||||
hideWrapper() {
|
||||
this.scanWrapper.addClass('d-none')
|
||||
}
|
||||
showWrapper() {
|
||||
this.scanWrapper.removeClass('d-none')
|
||||
}
|
||||
actionLoader(status = true) {
|
||||
if (status) {
|
||||
Notiflix.Block.circle('.section-block');
|
||||
} else {
|
||||
Notiflix.Block.remove('.section-block');
|
||||
}
|
||||
}
|
||||
reloadFocus() {
|
||||
this.otInputId.val("")
|
||||
this.otInputId.trigger('focus')
|
||||
}
|
||||
async saveMultipleOTs() {
|
||||
try {
|
||||
let result = await alertConfirmAction()
|
||||
if(result.isConfirmed){
|
||||
this.actionLoader(true)
|
||||
let response = await this.postMaquinaOrdenesTrabajo()
|
||||
this.actionLoader(false)
|
||||
popSuccessAlert(response.message)
|
||||
this.hideWrapper()
|
||||
this.linkAfterSave.removeClass('d-none')
|
||||
}
|
||||
|
||||
} catch (error) {
|
||||
this.actionLoader(false)
|
||||
if (error?.responseJSON) {
|
||||
popErrorAlert(error.responseJSON.message)
|
||||
} else {
|
||||
popErrorAlert(error)
|
||||
}
|
||||
}
|
||||
}
|
||||
async addOt() {
|
||||
try {
|
||||
if (this.ots.includes(this.otInputId.val())) {
|
||||
throw new Error("Esta OT ya ha sido introducida");
|
||||
}
|
||||
if (this.otInputId.val()) {
|
||||
let response = await this.getOt(this.otInputId.val())
|
||||
console.log(response)
|
||||
const data = response.data
|
||||
this.ots.push(data.ot.id)
|
||||
this.datatable.rows.add([{
|
||||
id: data.ot.id,
|
||||
title: data.presupuesto.titulo
|
||||
}])
|
||||
this.datatable.draw()
|
||||
this.reloadFocus()
|
||||
this.btnSave.removeAttr('disabled')
|
||||
}
|
||||
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
this.reloadFocus()
|
||||
if (error?.responseJSON) {
|
||||
popErrorAlert(error.responseJSON.message)
|
||||
} else {
|
||||
popErrorAlert(error)
|
||||
}
|
||||
}
|
||||
}
|
||||
getOt(otId) {
|
||||
return new Promise((resolve, reject) => {
|
||||
let ajax = new Ajax(
|
||||
`/produccion/ordentrabajo/tareas/maquina/${otId}/${this.maquinaId}`,
|
||||
null,
|
||||
null,
|
||||
(response) => {
|
||||
resolve(response)
|
||||
},
|
||||
(error) => {
|
||||
reject(error)
|
||||
}
|
||||
)
|
||||
ajax.get();
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
postMaquinaOrdenesTrabajo() {
|
||||
return new Promise((resolve, reject) => {
|
||||
let ajax = new Ajax(
|
||||
`/produccion/ordentrabajo/maquinas/ots`,
|
||||
{
|
||||
maquina_id: this.maquinaId,
|
||||
ordenes_trabajo: this.ots
|
||||
},
|
||||
null,
|
||||
(response) => {
|
||||
resolve(response)
|
||||
},
|
||||
(error) => {
|
||||
reject(error)
|
||||
}
|
||||
)
|
||||
ajax.post();
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
export default MaquinistaScan;
|
||||
@ -4,41 +4,44 @@ class MaquinistaTareaList {
|
||||
this.item = domItem
|
||||
this.maquinaId = this.item.data("id")
|
||||
this.datatableItem = $("#maquinista-tarea-table")
|
||||
this.datatableTareaAplazadaItem = this.item.find('#maquinista-tarea-aplazada-table')
|
||||
this.wrapperDatatableTareaAplazada = this.item.find('#tareas-aplazadas')
|
||||
this.btnTareasHoy = $("#btn-tareas-hoy")
|
||||
this.todayDate = $('#today-date')
|
||||
this.btnAllTareas = $("#btn-all-tareas")
|
||||
this.datatableColumns = [
|
||||
{ data: 'otId', searchable: false, sortable: false },
|
||||
{ data: 'tareaName', searchable: false, sortable: false },
|
||||
{ data: 'tareaEstado', searchable: false, sortable: false,render : this.renderStado.bind(this)},
|
||||
{ data: 'presupuesto_titulo', searchable: false, sortable: false },
|
||||
{ data: 'papel_impresion', searchable: false, sortable: false },
|
||||
{ data: 'papel_gramaje', searchable: false, sortable: false },
|
||||
{ data: 'tareaEstado', searchable: false, sortable: false, render: this.renderStado.bind(this) },
|
||||
// { data: 'presupuesto_titulo', searchable: false, sortable: false },
|
||||
// { data: 'papel_impresion', searchable: false, sortable: false },
|
||||
// { data: 'papel_gramaje', searchable: false, sortable: false },
|
||||
{ data: 'fecha_impresion', searchable: false, sortable: false },
|
||||
{ data: 'action', searchable: false, sortable: false, width: "20rem" },
|
||||
]
|
||||
this.urlAll = '/produccion/ordentrabajo/maquinista/maquinas/tareas/datatable/all/' + this.maquinaId
|
||||
this.urlAplazada = '/produccion/ordentrabajo/maquinista/maquinas/tareas/aplazadas/datatable/' + this.maquinaId
|
||||
this.urlToday = '/produccion/ordentrabajo/maquinista/maquinas/tareas/datatable/today/' + this.maquinaId
|
||||
this.initTable()
|
||||
this.estadoClass = {
|
||||
I : 'primary',
|
||||
P : 'warning',
|
||||
S : 'warning',
|
||||
D : 'danger',
|
||||
F : 'success'
|
||||
I: 'primary',
|
||||
P: 'warning',
|
||||
S: 'warning',
|
||||
D: 'danger',
|
||||
F: 'success'
|
||||
}
|
||||
this.estadoNames = {
|
||||
I : 'Iniciada',
|
||||
P : 'Pendiente',
|
||||
S : 'Pausada',
|
||||
D : 'Aplazada',
|
||||
F : 'Finalizada'
|
||||
I: 'Iniciada',
|
||||
P: 'Pendiente',
|
||||
S: 'Pausada',
|
||||
D: 'Aplazada',
|
||||
F: 'Finalizada'
|
||||
}
|
||||
|
||||
}
|
||||
init(){
|
||||
this.btnTareasHoy.on('click',this.loadToday.bind(this))
|
||||
this.btnAllTareas.on('click',this.loadAll.bind(this))
|
||||
init() {
|
||||
this.btnTareasHoy.on('click', this.loadToday.bind(this))
|
||||
this.btnAllTareas.on('click', this.loadAll.bind(this))
|
||||
}
|
||||
initTable() {
|
||||
|
||||
@ -51,13 +54,28 @@ class MaquinistaTareaList {
|
||||
bottomEnd: 'paging'
|
||||
},
|
||||
serverSide: true,
|
||||
pageLength: 25,
|
||||
pageLength: 100,
|
||||
language: {
|
||||
url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
|
||||
},
|
||||
columns: this.datatableColumns,
|
||||
ajax: this.urlToday
|
||||
});
|
||||
this.datatableAplazada = this.datatableTareaAplazadaItem.DataTable({
|
||||
processing: true,
|
||||
layout: {
|
||||
bottomStart: 'info',
|
||||
bottomEnd: 'paging'
|
||||
},
|
||||
serverSide: true,
|
||||
pageLength: 100,
|
||||
language: {
|
||||
url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
|
||||
},
|
||||
columns: this.datatableColumns,
|
||||
ajax: this.urlAplazada
|
||||
});
|
||||
this.datatableAplazada.on('draw.dt', this.handleShowTareasAplazadas.bind(this))
|
||||
}
|
||||
loadToday() {
|
||||
this.btnTareasHoy.removeClass('active')
|
||||
@ -66,25 +84,34 @@ class MaquinistaTareaList {
|
||||
this.btnAllTareas.removeAttr('aria-pressed')
|
||||
this.todayDate.removeClass('d-none')
|
||||
this.btnTareasHoy.addClass('active')
|
||||
this.btnTareasHoy.attr('aria-pressed',true)
|
||||
this.btnTareasHoy.attr('aria-pressed', true)
|
||||
this.datatable.ajax.url(this.urlToday)
|
||||
this.datatable.ajax.reload()
|
||||
|
||||
|
||||
}
|
||||
loadAll(){
|
||||
loadAll() {
|
||||
this.btnTareasHoy.removeClass('active')
|
||||
this.btnTareasHoy.removeAttr('aria-pressed')
|
||||
this.todayDate.addClass('d-none')
|
||||
this.btnAllTareas.addClass('active')
|
||||
this.btnAllTareas.attr('aria-pressed',true)
|
||||
this.btnAllTareas.attr('aria-pressed', true)
|
||||
this.datatable.ajax.url(this.urlAll)
|
||||
this.datatable.ajax.reload()
|
||||
|
||||
}
|
||||
renderStado(d){
|
||||
renderStado(d) {
|
||||
|
||||
return `<span class="badge text-bg-${this.estadoClass[d]}">${this.estadoNames[d]}</span>`
|
||||
return `<span class="badge" style="background-color:${d.color};color:white">${d.title}</span>`
|
||||
}
|
||||
handleShowTareasAplazadas() {
|
||||
let totalTareasAplazadas = this.datatableAplazada.page.info().recordsTotal
|
||||
console.log(totalTareasAplazadas)
|
||||
if (totalTareasAplazadas > 0) {
|
||||
this.wrapperDatatableTareaAplazada.removeClass('d-none')
|
||||
} else {
|
||||
this.wrapperDatatableTareaAplazada.addClass('d-none')
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
|
||||
import Ajax from '../../../components/ajax.js'
|
||||
import { alertConfirmAction } from '../../../components/alerts/sweetAlert.js'
|
||||
import { alertConfirmAction, alertError, alertSuccess } from '../../../components/alerts/sweetAlert.js'
|
||||
class MaquinistaTareaView {
|
||||
constructor(domItem) {
|
||||
this.item = domItem
|
||||
@ -53,6 +53,8 @@ class MaquinistaTareaView {
|
||||
}
|
||||
disableButtons() {
|
||||
this.actionButtons.attr('disabled', 'disabled')
|
||||
this.btnDelay.attr('disabled','disabled')
|
||||
this.btnDeleteProgress.attr('disabled','disabled')
|
||||
}
|
||||
enableButtons() {
|
||||
this.actionButtons.removeAttr('disabled')
|
||||
@ -84,7 +86,7 @@ class MaquinistaTareaView {
|
||||
handleUpdateClickInputError(error) {
|
||||
popErrorAlert(error)
|
||||
}
|
||||
updateContentClick(clicks){
|
||||
updateContentClick(clicks) {
|
||||
this.item.find('#clicks-info').empty().html(clicks)
|
||||
}
|
||||
handleDeleteTareaProgress() {
|
||||
@ -121,14 +123,14 @@ class MaquinistaTareaView {
|
||||
}
|
||||
}
|
||||
handleGetTareaProgressSuccess(response) {
|
||||
if (response.progress_dates) {
|
||||
if (response.progress_dates.length > 0) {
|
||||
let lastStatus = response.progress_dates.findLast(e => e.estado != null).estado
|
||||
console.log("Last status :", lastStatus)
|
||||
this.showBasedOnStatus(lastStatus)
|
||||
}else{
|
||||
this.showBasedOnStatus('P')
|
||||
}
|
||||
if (response.tiempo_trabajado) {
|
||||
this.item.find('#tiempo-real-info').html(response.tiempo_trabajado)
|
||||
}
|
||||
this.item.find('#tiempo-real-info').html(response.tiempo_trabajado ?? "00:00")
|
||||
this.actionLoader(false)
|
||||
|
||||
}
|
||||
@ -146,20 +148,32 @@ class MaquinistaTareaView {
|
||||
this.handleUpdateTareaProgressError.bind(this),
|
||||
)
|
||||
if (this.tareaId) {
|
||||
ajax.post();
|
||||
if(status == "F"){
|
||||
alertConfirmAction('La tarea se marcará como finalizada')
|
||||
.then(result => {
|
||||
if (result.isConfirmed) {
|
||||
ajax.post();
|
||||
}
|
||||
})
|
||||
}else{
|
||||
ajax.post();
|
||||
}
|
||||
}
|
||||
}
|
||||
handleUpdateTareaProgressSuccess(response) {
|
||||
if (response.data) {
|
||||
if (response.data.estado == 'D') {
|
||||
if (response.data.tarea) {
|
||||
if (response.data.tarea.estado == 'D') {
|
||||
window.location.href = '/produccion/ordentrabajo/maquinista/maquinas/view'
|
||||
}
|
||||
this.showBasedOnStatus(response.data.status)
|
||||
this.item.find('#tiempo-real-info').html(response.data.tiempo_trabajado ?? "00:00")
|
||||
this.showBasedOnStatus(response.data.estado)
|
||||
alertSuccess(response.message, null, { position: 'top' }).fire()
|
||||
}
|
||||
this.actionLoader(false)
|
||||
}
|
||||
handleUpdateTareaProgressError(error) {
|
||||
popErrorAlert(error.error)
|
||||
alertError(error.error, null, { position: 'top' }).fire()
|
||||
this.actionLoader(false)
|
||||
}
|
||||
|
||||
|
||||
@ -0,0 +1,7 @@
|
||||
import MaquinistaFichajeAuto from "./maquinistaFichajeAuto.js";
|
||||
|
||||
$(() => {
|
||||
console.info("MAQUINISTA FA")
|
||||
let maquinistaFA = new MaquinistaFichajeAuto($("#viewMaquinistaFichajeAuto"))
|
||||
maquinistaFA.init();
|
||||
})
|
||||
@ -0,0 +1,7 @@
|
||||
import MaquinistaScan from "./maquinistaScan.js";
|
||||
|
||||
$(() => {
|
||||
console.info("MAQUINISTA SCAN")
|
||||
let maquinistaScan = new MaquinistaScan($("#viewMaquinistaTareaScan"))
|
||||
maquinistaScan.init();
|
||||
})
|
||||
@ -0,0 +1,7 @@
|
||||
import MaquinistaMultipleTarea from "./maquinistaMultipleTarea.js"
|
||||
|
||||
$(() => {
|
||||
console.info("MAQUINISTA MAQUINA OT TAREAS")
|
||||
let tareaMultiple = new MaquinistaMultipleTarea($("#viewProduccionMaquinistaOtTareasView"))
|
||||
tareaMultiple.init()
|
||||
})
|
||||
@ -0,0 +1,344 @@
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
let dataTable;
|
||||
let productosOriginales = [];
|
||||
let datosComunesPedido = {};
|
||||
|
||||
document.getElementById('xmlFile').addEventListener('change', function (e) {
|
||||
const file = e.target.files[0];
|
||||
if (!file) return;
|
||||
|
||||
const reader = new FileReader();
|
||||
reader.onload = function (event) {
|
||||
const xmlText = event.target.result;
|
||||
parseXmlAndLoadTable(xmlText);
|
||||
};
|
||||
reader.readAsText(file);
|
||||
});
|
||||
|
||||
function parseXmlAndLoadTable(xmlText) {
|
||||
let parser = new DOMParser();
|
||||
let xmlDoc;
|
||||
|
||||
try {
|
||||
xmlDoc = parser.parseFromString(xmlText, 'application/xml');
|
||||
if (xmlDoc.getElementsByTagName('parsererror').length > 0) throw new Error('XML inválido');
|
||||
} catch (e) {
|
||||
Swal.fire('Error', 'No se pudo leer el XML.', 'error');
|
||||
return;
|
||||
}
|
||||
|
||||
datosComunesPedido = {
|
||||
orderNumber: xmlDoc.querySelector('orderNumber')?.textContent ?? '',
|
||||
shipping: {
|
||||
address: xmlDoc.querySelector('shippingData > address')?.textContent ?? '',
|
||||
city: xmlDoc.querySelector('shippingData > city')?.textContent ?? '',
|
||||
country: xmlDoc.querySelector('shippingData > country')?.textContent ?? '',
|
||||
postalCode: xmlDoc.querySelector('shippingData > postalCode')?.textContent ?? '',
|
||||
name: xmlDoc.querySelector('shippingData > name')?.textContent ?? '',
|
||||
phone: xmlDoc.querySelector('shippingData > phone')?.textContent ?? ''
|
||||
},
|
||||
labelUrl: xmlDoc.querySelector('urlPdfSeur')?.textContent ?? ''
|
||||
};
|
||||
|
||||
const products = Array.from(xmlDoc.getElementsByTagName('product'));
|
||||
productosOriginales = products.map((prod, idx) => ({ index: idx, data: prod }));
|
||||
|
||||
const rows = products.map((product, index) => {
|
||||
const id = product.querySelector('id')?.textContent ?? '';
|
||||
const title = product.querySelector('title')?.textContent ?? '';
|
||||
const pages = product.querySelector('body > pages')?.textContent ?? '';
|
||||
const tirada = product.querySelector('amount')?.textContent ?? '';
|
||||
|
||||
let interior = 'Desconocido';
|
||||
const colorNode = product.querySelector('body > color');
|
||||
if (colorNode) {
|
||||
const monochrome = colorNode.querySelector('Monochrome')?.textContent ?? '0';
|
||||
const cmyk = colorNode.querySelector('CMYK')?.textContent ?? '0';
|
||||
const semicolor = colorNode.querySelector('Semicolor')?.textContent ?? '0';
|
||||
|
||||
if (monochrome === '1') interior = 'Negro';
|
||||
else if (cmyk === '1') interior = 'Color';
|
||||
else if (semicolor === '1') interior = 'Semicolor';
|
||||
}
|
||||
|
||||
let tamano = 'Desconocido';
|
||||
const sizeTags = product.querySelectorAll('size > *');
|
||||
sizeTags.forEach(tag => {
|
||||
if (tag.textContent === '1') {
|
||||
tamano = tag.tagName.replace(/^size/, '');
|
||||
}
|
||||
});
|
||||
|
||||
return [
|
||||
`<input type="checkbox" class="form-check-input select-row" checked>`,
|
||||
`${datosComunesPedido.orderNumber} - ${id}`,
|
||||
title,
|
||||
tamano,
|
||||
pages,
|
||||
tirada,
|
||||
interior,
|
||||
'',
|
||||
`<button type="button" class="btn btn-sm btn-outline-success importRow">Importar</button>
|
||||
<button type="button" class="btn btn-sm btn-outline-danger deleteRow">Eliminar</button>`
|
||||
];
|
||||
});
|
||||
|
||||
if (!$.fn.DataTable.isDataTable('#xmlTable')) {
|
||||
const headerHtml = `
|
||||
<thead>
|
||||
<tr>
|
||||
<th><input type="checkbox" id="selectAll" /></th>
|
||||
<th>Referencia</th>
|
||||
<th>Título</th>
|
||||
<th>Tamaño</th>
|
||||
<th>Páginas</th>
|
||||
<th>Tirada</th>
|
||||
<th>Interior</th>
|
||||
<th>Notas</th>
|
||||
<th>Acciones</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th></th><th></th><th></th><th></th><th></th>
|
||||
<th></th><th></th><th></th><th></th>
|
||||
</tr>
|
||||
</thead>`;
|
||||
$('#xmlTable').html(headerHtml);
|
||||
}
|
||||
|
||||
dataTable = $('#xmlTable').DataTable({
|
||||
destroy: true,
|
||||
data: rows,
|
||||
orderCellsTop: true,
|
||||
responsive: true,
|
||||
scrollX: true,
|
||||
dom: 'lfrtip',
|
||||
language: {
|
||||
url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
|
||||
},
|
||||
order: [[1, 'asc']]
|
||||
});
|
||||
|
||||
$('#xmlTable thead tr:eq(1) th').each(function (i) {
|
||||
if (![0, 7, 8].includes(i)) {
|
||||
$(this).html('<input type="text" class="form-control form-control-sm" placeholder="Filtrar..." />');
|
||||
$('input', this).on('keyup change', function () {
|
||||
if (dataTable.column(i).search() !== this.value) {
|
||||
dataTable.column(i).search(this.value).draw();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
setupEventListeners();
|
||||
}
|
||||
|
||||
function setupEventListeners() {
|
||||
$('#xmlTable tbody').off('click', '.deleteRow').on('click', '.deleteRow', function () {
|
||||
dataTable.row($(this).parents('tr')).remove().draw();
|
||||
});
|
||||
|
||||
$('#xmlTable tbody').off('click', '.importRow').on('click', '.importRow', async function () {
|
||||
const $row = $(this).closest('tr');
|
||||
const rowIndex = dataTable.row($row).index();
|
||||
const xmlProduct = productosOriginales.find(p => p.index === rowIndex)?.data;
|
||||
|
||||
if (!xmlProduct) return;
|
||||
|
||||
try {
|
||||
const response = await fetch('/importador/bubok/importar-fila', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'X-CSRF-TOKEN': '<?= csrf_hash() ?>'
|
||||
},
|
||||
body: JSON.stringify({
|
||||
producto: xmlToJson(xmlProduct),
|
||||
pedido: datosComunesPedido
|
||||
})
|
||||
});
|
||||
|
||||
const result = await response.json();
|
||||
|
||||
const rowData = dataTable.row($row).data();
|
||||
if (response.ok && result.status === 200) {
|
||||
const skUrl = result.data?.sk_url?.replace('presupuestocliente', 'presupuestoadmin') ?? null;
|
||||
const htmlLink = skUrl
|
||||
? `<a href="${skUrl}" target="_blank" class="btn btn-sm btn-primary">Ver presupuesto</a>`
|
||||
: 'Importado';
|
||||
rowData[7] = htmlLink;
|
||||
dataTable.row($row).data(rowData).draw(false);
|
||||
|
||||
Swal.fire({
|
||||
title: 'Importado correctamente',
|
||||
html: skUrl
|
||||
? `Se importó correctamente.<br><a href="${skUrl}" target="_blank" class="btn btn-primary mt-2">Ver presupuesto</a>`
|
||||
: 'Importación realizada.',
|
||||
icon: 'success',
|
||||
confirmButtonText: 'Aceptar',
|
||||
customClass: { confirmButton: 'btn btn-success' }
|
||||
});
|
||||
} else {
|
||||
rowData[7] = `<span class="badge bg-danger">${result.message ?? 'Error inesperado'}</span>`;
|
||||
dataTable.row($row).data(rowData).draw(false);
|
||||
|
||||
Swal.fire({
|
||||
title: 'Error',
|
||||
text: result.message ?? 'Hubo un error al importar esta fila.',
|
||||
icon: 'error',
|
||||
confirmButtonText: 'Aceptar',
|
||||
customClass: { confirmButton: 'btn btn-danger' }
|
||||
});
|
||||
}
|
||||
|
||||
dataTable.row($row).data(rowData).draw(false);
|
||||
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
Swal.fire('Error', 'Error de comunicación con el servidor.', 'error');
|
||||
}
|
||||
});
|
||||
|
||||
$('#selectAll').off('change').on('change', function () {
|
||||
const checked = $(this).is(':checked');
|
||||
$('#xmlTable tbody input.select-row:enabled').prop('checked', checked);
|
||||
});
|
||||
}
|
||||
|
||||
function xmlToJson(xmlNode) {
|
||||
// Si es nodo de texto
|
||||
if (xmlNode.nodeType === 3) {
|
||||
return xmlNode.nodeValue.trim();
|
||||
}
|
||||
|
||||
let obj = {};
|
||||
|
||||
// Procesar atributos si existen
|
||||
if (xmlNode.attributes && xmlNode.attributes.length > 0) {
|
||||
for (let attr of xmlNode.attributes) {
|
||||
obj[`@${attr.name}`] = attr.value;
|
||||
}
|
||||
}
|
||||
|
||||
// Procesar hijos
|
||||
if (xmlNode.hasChildNodes()) {
|
||||
const children = Array.from(xmlNode.childNodes).filter(n => n.nodeType !== 8); // ignorar comentarios
|
||||
|
||||
// Si el único hijo es texto, devolver como string
|
||||
if (children.length === 1 && children[0].nodeType === 3) {
|
||||
return children[0].nodeValue.trim();
|
||||
}
|
||||
|
||||
// Procesar nodos hijos normalmente
|
||||
children.forEach(child => {
|
||||
const name = child.nodeName;
|
||||
const value = xmlToJson(child);
|
||||
|
||||
if (obj[name]) {
|
||||
if (!Array.isArray(obj[name])) {
|
||||
obj[name] = [obj[name]];
|
||||
}
|
||||
obj[name].push(value);
|
||||
} else {
|
||||
obj[name] = value;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
document.getElementById('importBtn').addEventListener('click', async function () {
|
||||
if (!dataTable || dataTable.rows().count() === 0) {
|
||||
Swal.fire({
|
||||
title: 'Atención',
|
||||
text: 'Primero debes cargar un archivo XML válido.',
|
||||
icon: 'warning',
|
||||
confirmButtonText: 'Aceptar',
|
||||
customClass: { confirmButton: 'btn btn-warning' }
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
const filasSeleccionadas = [];
|
||||
|
||||
dataTable.rows().every(function () {
|
||||
const node = this.node();
|
||||
const checkbox = $(node).find('input.select-row');
|
||||
if (checkbox.length > 0 && checkbox.is(':checked') && !checkbox.is(':disabled')) {
|
||||
filasSeleccionadas.push(this.index());
|
||||
}
|
||||
});
|
||||
|
||||
if (filasSeleccionadas.length === 0) {
|
||||
Swal.fire({
|
||||
title: 'Atención',
|
||||
text: 'No hay filas seleccionadas.',
|
||||
icon: 'warning',
|
||||
confirmButtonText: 'Aceptar',
|
||||
customClass: { confirmButton: 'btn btn-warning' }
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
Swal.fire({
|
||||
title: '¿Importar seleccionados?',
|
||||
text: `Se van a importar ${filasSeleccionadas.length} filas.`,
|
||||
icon: 'question',
|
||||
showCancelButton: true,
|
||||
confirmButtonText: 'Sí, importar',
|
||||
cancelButtonText: 'Cancelar',
|
||||
reverseButtons: true,
|
||||
customClass: {
|
||||
confirmButton: 'btn btn-primary',
|
||||
cancelButton: 'btn btn-secondary'
|
||||
}
|
||||
}).then(async (result) => {
|
||||
if (!result.isConfirmed) return;
|
||||
|
||||
for (const i of filasSeleccionadas) {
|
||||
const productXml = productosOriginales.find(p => p.index === i)?.data;
|
||||
if (!productXml) continue;
|
||||
|
||||
try {
|
||||
const response = await fetch('/importador/bubok/importar-fila', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'X-CSRF-TOKEN': '<?= csrf_hash() ?>'
|
||||
},
|
||||
body: JSON.stringify({
|
||||
producto: xmlToJson(productXml),
|
||||
pedido: datosComunesPedido
|
||||
})
|
||||
});
|
||||
|
||||
const result = await response.json();
|
||||
const rowNode = dataTable.row(i).node();
|
||||
const rowData = dataTable.row(i).data();
|
||||
|
||||
if (response.ok && result.status === 200) {
|
||||
const skUrl = result.data?.sk_url?.replace('presupuestocliente', 'presupuestoadmin') ?? null;
|
||||
rowData[7] = skUrl
|
||||
? `<a href="${skUrl}" target="_blank" class="btn btn-sm btn-primary">Ver presupuesto</a>`
|
||||
: '<span class="badge bg-success">Importado</span>';
|
||||
} else {
|
||||
rowData[7] = `<span class="badge bg-danger">${result.message ?? 'Error desconocido'}</span>`;
|
||||
}
|
||||
|
||||
dataTable.row(rowNode).data(rowData).draw(false);
|
||||
} catch (error) {
|
||||
console.error('Importación fallida:', error);
|
||||
}
|
||||
}
|
||||
|
||||
Swal.fire({
|
||||
title: 'Importación finalizada',
|
||||
text: 'Se han procesado todas las filas seleccionadas.',
|
||||
icon: 'success',
|
||||
confirmButtonText: 'Aceptar',
|
||||
customClass: { confirmButton: 'btn btn-success' }
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
@ -169,12 +169,21 @@ document.addEventListener('DOMContentLoaded', function () {
|
||||
dataTable.row($row).data(rowData).draw(false); // Redibujar la fila SIN perder scroll ni filtros
|
||||
}
|
||||
|
||||
let html = skUrl
|
||||
? `La fila se importó exitosamente.<br><br><a href="${skUrl}" target="_blank" class="btn btn-primary mt-2">Ver presupuesto</a>`
|
||||
: 'La fila se importó exitosamente.';
|
||||
let icon = 'success';
|
||||
|
||||
if (result.price_warning) {
|
||||
html = skUrl ? `La fila se importó exitosamente, pero el precio se ha ajustado debajo de costes.<br><br><a href="${skUrl}" target="_blank" class="btn btn-primary mt-2">Ver presupuesto</a>`
|
||||
: 'La fila se importó exitosamente, pero el precio se ha ajustado debajo de costes.';
|
||||
icon = 'warning';
|
||||
}
|
||||
|
||||
Swal.fire({
|
||||
title: 'Importado correctamente',
|
||||
html: skUrl
|
||||
? `La fila se importó exitosamente.<br><br><a href="${skUrl}" target="_blank" class="btn btn-primary mt-2">Ver presupuesto</a>`
|
||||
: 'La fila se importó exitosamente.',
|
||||
icon: 'success',
|
||||
html: html,
|
||||
icon: icon,
|
||||
confirmButtonText: 'Aceptar',
|
||||
buttonsStyling: true,
|
||||
customClass: { confirmButton: 'btn btn-success' }
|
||||
@ -252,6 +261,9 @@ document.addEventListener('DOMContentLoaded', function () {
|
||||
}).then(async (result) => {
|
||||
if (!result.isConfirmed) return;
|
||||
|
||||
// array para contener los IDs que no se han podido ajustar
|
||||
let idsNoAjustados = [];
|
||||
|
||||
for (const fila of filasAptas) {
|
||||
try {
|
||||
const response = await fetch('/importador/catalogo/importar-fila', {
|
||||
@ -268,6 +280,10 @@ document.addEventListener('DOMContentLoaded', function () {
|
||||
if (response.ok && result.status === 200) {
|
||||
const skUrl = result.data?.sk_url?.replace('presupuestocliente', 'presupuestoadmin') ?? null;
|
||||
|
||||
if (result.price_warning) {
|
||||
idsNoAjustados.push(result.data.sk_id);
|
||||
}
|
||||
|
||||
if (skUrl) {
|
||||
fila.rowData[6] = `<a href="${skUrl}" target="_blank" class="btn btn-sm btn-primary">Ver presupuesto</a>`;
|
||||
} else {
|
||||
@ -286,10 +302,16 @@ document.addEventListener('DOMContentLoaded', function () {
|
||||
}
|
||||
}
|
||||
|
||||
let text = 'Se han procesado todas las filas seleccionadas.';
|
||||
let icon = 'success';
|
||||
if (idsNoAjustados.length > 0) {
|
||||
text = 'Se han procesado todas las filas seleccionadas, pero se han ajustado los siguientes presupuestos por debajo de costes: ' + idsNoAjustados.join(', ');
|
||||
icon = 'warning';
|
||||
}
|
||||
Swal.fire({
|
||||
title: 'Importación finalizada',
|
||||
text: 'Se han procesado todas las filas seleccionadas.',
|
||||
icon: 'success',
|
||||
text: text,
|
||||
icon: icon,
|
||||
confirmButtonText: 'Aceptar',
|
||||
buttonsStyling: true,
|
||||
customClass: { confirmButton: 'btn btn-success' }
|
||||
|
||||
467
httpdocs/assets/js/safekat/pages/logistica/etiquetaEdit.js
Normal file
467
httpdocs/assets/js/safekat/pages/logistica/etiquetaEdit.js
Normal file
@ -0,0 +1,467 @@
|
||||
import ClassSelect from '../../components/select2.js';
|
||||
import Ajax from '../../components/ajax.js';
|
||||
import AlbaranComponent from '../../components/albaranComponent.js';
|
||||
|
||||
class EtiquetaEdit {
|
||||
|
||||
constructor() {
|
||||
|
||||
this.tableCols = [
|
||||
{ data: "rowSelected" },
|
||||
{ data: "ot" },
|
||||
{ data: "titulo" },
|
||||
{ data: "numero_caja" },
|
||||
{ data: "unidades" },
|
||||
{ data: "unidadesTotal" },
|
||||
{ data: "id" },
|
||||
{ data: "pesoUnidad" },
|
||||
{ data: "unidadesRaw" },
|
||||
{ data: "action" },
|
||||
{ data: "numero_caja_raw" }
|
||||
|
||||
];
|
||||
|
||||
this.table = null;
|
||||
|
||||
this.direccion = $('#direccion');
|
||||
this.addLineas = $('#btnAddLinea');
|
||||
this.btnEliminarLineas = $('#btnEliminarLineas');
|
||||
this.btbnGuardarComentarios = $('#guardarComentarios');
|
||||
this.btnSelectAll = $('#btnSelectAll');
|
||||
this.btnRenumber = $('#btnRenumber');
|
||||
this.btnImprimirEtiquetas = $('#btnImprimirEtiquetas');
|
||||
|
||||
this.buscador = new ClassSelect($('#buscadorPedidos'), '/etiquetasTitulos/findOts', '', true, { 'id': $('#id').val() });
|
||||
}
|
||||
|
||||
init() {
|
||||
|
||||
const self = this;
|
||||
|
||||
this._initDatatable();
|
||||
this.buscador.init();
|
||||
|
||||
this.addLineas.on('click', this._addLineas.bind(this));
|
||||
$(document).on('click', '.btn-delete', this._deleteLinea.bind(this));
|
||||
$(document).on('change', '.input-lineas', this._updateLinea.bind(this));
|
||||
this.btnEliminarLineas.on('click', this._deleteLinea.bind(this));
|
||||
this.btbnGuardarComentarios.on('click', this._guardarComentarios.bind(this));
|
||||
this.btnSelectAll.on('click', this._selectAll.bind(this));
|
||||
this.btnRenumber.on('click', this._renumber.bind(this));
|
||||
this.btnImprimirEtiquetas.on('click', this._imprimirEtiquetas.bind(this));
|
||||
}
|
||||
|
||||
_imprimirEtiquetas() {
|
||||
|
||||
const self = this;
|
||||
const ids = [];
|
||||
this.table.rows().every(function (rowIdx, tableLoop, rowLoop) {
|
||||
const node = this.node(); // DOM del tr
|
||||
const checkbox = $(node).find('.checkbox-linea-envio');
|
||||
if (checkbox.is(':checked')) {
|
||||
const data = this.data();
|
||||
ids.push(data.id);
|
||||
}
|
||||
});
|
||||
|
||||
$.post(
|
||||
'/etiquetasTitulos/imprimirEtiquetas',
|
||||
{
|
||||
etiqueta_id: $('#id').val(),
|
||||
ids: ids,
|
||||
impresora_id: $('#impresoraEtiquetas').val()
|
||||
},
|
||||
function (response) {
|
||||
if (response.status) {
|
||||
popSuccessAlert(response.message);
|
||||
if(response.data) {
|
||||
// show xml in new tab
|
||||
const blob = new Blob([response.data], { type: 'application/xml' });
|
||||
const url = URL.createObjectURL(blob);
|
||||
const newTab = window.open(url, '_blank');
|
||||
if (newTab) {
|
||||
newTab.onload = function () {
|
||||
// Revoke the object URL after the new tab has loaded
|
||||
URL.revokeObjectURL(url);
|
||||
};
|
||||
} else {
|
||||
popErrorAlert('Error abriendo la pestaña');
|
||||
}
|
||||
}
|
||||
} else {
|
||||
popErrorAlert('Error imprimiendo las etiquetas');
|
||||
}
|
||||
}
|
||||
).fail(function (xhr, status, error) {
|
||||
popErrorAlert(error);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
_renumber() {
|
||||
const self = this;
|
||||
$.post(
|
||||
'/etiquetasTitulos/renumber',
|
||||
{
|
||||
id: $('#id').val()
|
||||
},
|
||||
function (response) {
|
||||
if (response.status) {
|
||||
self.table.ajax.reload();
|
||||
popSuccessAlert(response.message);
|
||||
} else {
|
||||
popErrorAlert('Error renumerando las lineas');
|
||||
}
|
||||
}
|
||||
).fail(function (xhr, status, error) {
|
||||
popErrorAlert(error);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
_selectAll() {
|
||||
const checkboxes = this.table.$('input[type="checkbox"]');
|
||||
const allChecked = checkboxes.length === checkboxes.filter(':checked').length;
|
||||
checkboxes.prop('checked', !allChecked);
|
||||
}
|
||||
_initDatatable() {
|
||||
|
||||
const self = this;
|
||||
|
||||
this.table = $('#tableLineasEtiqueta').DataTable({
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
autoWidth: true,
|
||||
responsive: true,
|
||||
scrollX: true,
|
||||
orderCellsTop: true,
|
||||
rowId: 'id',
|
||||
order: [[10, 'asc']],
|
||||
rowGroup: {
|
||||
dataSrc: 'numero_caja_raw',
|
||||
startRender: function (rows, group) {
|
||||
let totalUnidades = 0;
|
||||
let totalPeso = 0;
|
||||
|
||||
rows.data().each(function (row) {
|
||||
const unidades = parseFloat(row.unidadesRaw) || 0;
|
||||
const pesoUnidad = parseFloat(row.pesoUnidad) || 0;
|
||||
totalUnidades += unidades;
|
||||
totalPeso += unidades * pesoUnidad;
|
||||
});
|
||||
|
||||
const groupId = 'grupo-caja-' + group;
|
||||
|
||||
return $('<tr/>')
|
||||
.attr('data-group', groupId)
|
||||
.addClass('group-header bg-light fw-bold')
|
||||
.css('cursor', 'pointer')
|
||||
.append(
|
||||
`<td colspan="11">
|
||||
📦 CAJA ${group} – UNIDADES: ${totalUnidades} – PESO: ${totalPeso.toFixed(2)} kg
|
||||
</td>`
|
||||
);
|
||||
}
|
||||
},
|
||||
rowReorder: {
|
||||
dataSrc: 'numero_caja_raw',
|
||||
update: false,
|
||||
selector: 'td:not(.dt-no-reorder)' // evita inputs
|
||||
},
|
||||
lengthMenu: [5, 10, 25, 50, 100],
|
||||
pageLength: 50,
|
||||
ajax: {
|
||||
url: "/etiquetasTitulos/datatableLineas/" + $('#id').val(),
|
||||
data: function (d) {
|
||||
d.direccion = $('#direccion').val();
|
||||
d.id = $('#id').val();
|
||||
},
|
||||
},
|
||||
columns: this.tableCols,
|
||||
language: {
|
||||
url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
|
||||
},
|
||||
columnDefs: [
|
||||
{
|
||||
targets: [0, 9],
|
||||
className: "text-center dt-no-reorder",
|
||||
orderable: false,
|
||||
searchable: false
|
||||
},
|
||||
{
|
||||
targets: [3, 4],
|
||||
className: "text-center dt-no-reorder"
|
||||
},
|
||||
{
|
||||
targets: [1, 2, 4, 5, 6],
|
||||
className: "text-center"
|
||||
},
|
||||
{
|
||||
targets: [6, 7, 8, 10],
|
||||
visible: false
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
$('#tableLineasEtiqueta tbody').on('click', 'tr.group-header', function () {
|
||||
const group = $(this).data('group');
|
||||
const table = $('#tableLineasEtiqueta').DataTable();
|
||||
const icon = $(this).find('.group-toggle-icon');
|
||||
|
||||
let visible = true;
|
||||
|
||||
table.rows().every(function () {
|
||||
const row = this.node();
|
||||
const data = this.data();
|
||||
|
||||
if ('numero_caja' in data && ('grupo-caja-' + data.numero_caja) === group) {
|
||||
if (!$(row).hasClass('group-header')) {
|
||||
$(row).toggle();
|
||||
visible = !$(row).is(':visible');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Cambiar el icono
|
||||
icon.text(visible ? '▼' : '►');
|
||||
});
|
||||
|
||||
|
||||
this.table.on('row-reorder', function (e, diff, edit) {
|
||||
if (!diff.length || !edit.triggerRow) return;
|
||||
|
||||
const table = self.table;
|
||||
const movedRowData = table.row(edit.triggerRow).data();
|
||||
if (!movedRowData?.id) return;
|
||||
|
||||
const movedItem = diff.find(d => {
|
||||
const rowData = table.row(d.node).data();
|
||||
return rowData?.id === movedRowData.id;
|
||||
});
|
||||
if (!movedItem) return;
|
||||
|
||||
const payload = {
|
||||
id: movedRowData.id,
|
||||
numero_caja: movedItem.newData
|
||||
};
|
||||
|
||||
$.ajax({
|
||||
url: '/etiquetasTitulos/updateOrdenCajas',
|
||||
method: 'POST',
|
||||
contentType: 'application/json',
|
||||
data: JSON.stringify({ orden: [payload] }),
|
||||
success: function (response) {
|
||||
if (response.status) {
|
||||
setTimeout(() => {
|
||||
self.table.ajax.reload(null, false);
|
||||
}, 100);
|
||||
} else {
|
||||
popErrorAlert('Error actualizando el orden');
|
||||
}
|
||||
},
|
||||
error: function () {
|
||||
popErrorAlert('Error en la solicitud AJAX');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
_addLineas() {
|
||||
if (this.buscador.item.select2('data').length > 0) {
|
||||
|
||||
let maxUnidades = 0;
|
||||
if (this.buscador.item.select2('data')[0].desc) {
|
||||
maxUnidades = parseInt(this.buscador.item.select2('data')[0].desc);
|
||||
Swal.fire({
|
||||
title: 'Unidades',
|
||||
html: `
|
||||
<div class="mb-2">
|
||||
<label for="inputUnidades">Unidades:</label>
|
||||
<input type="number" id="inputUnidades" class="swal2-input" value="${maxUnidades}">
|
||||
</div>
|
||||
<div>
|
||||
<label for="inputCajas">Cajas:</label>
|
||||
<input type="number" id="inputCajas" class="swal2-input" value="1">
|
||||
</div>
|
||||
`,
|
||||
icon: 'info',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
confirmButtonText: 'Aceptar',
|
||||
cancelButtonText: 'Cancelar',
|
||||
customClass: {
|
||||
confirmButton: 'btn btn-primary me-1',
|
||||
cancelButton: 'btn btn-secondary'
|
||||
},
|
||||
buttonsStyling: false,
|
||||
preConfirm: () => {
|
||||
const unidades = parseInt(document.getElementById('inputUnidades').value);
|
||||
const cajas = parseInt(document.getElementById('inputCajas').value);
|
||||
if (isNaN(unidades) || isNaN(cajas)) {
|
||||
Swal.showValidationMessage('Debe completar ambos campos');
|
||||
}
|
||||
return { unidades, cajas };
|
||||
}
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
const { unidades, cajas } = result.value;
|
||||
const url = '/etiquetasTitulos/addLineas';
|
||||
const data = {
|
||||
etiqueta_id: $('#id').val(),
|
||||
ot_id: this.buscador.getVal(),
|
||||
unidades: unidades,
|
||||
cajas: cajas
|
||||
};
|
||||
$.post(
|
||||
url,
|
||||
data,
|
||||
function (response) {
|
||||
if (response.status) {
|
||||
self.table.ajax.reload();
|
||||
popSuccessAlert(response.message);
|
||||
|
||||
} else {
|
||||
popErrorAlert('Error en la respuesta');
|
||||
}
|
||||
}
|
||||
).fail(function (xhr, status, error) {
|
||||
popErrorAlert(error);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
_deleteLinea(e) {
|
||||
e.preventDefault();
|
||||
const self = this;
|
||||
let ids = [];
|
||||
if (e.currentTarget.id == "btnEliminarLineas") {
|
||||
|
||||
this.table.rows().every(function (rowIdx, tableLoop, rowLoop) {
|
||||
const node = this.node(); // DOM del tr
|
||||
const checkbox = $(node).find('.checkbox-linea-envio');
|
||||
if (checkbox.is(':checked')) {
|
||||
const data = this.data();
|
||||
ids.push(data.id);
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
ids.push($(e.currentTarget).attr('data-id'));
|
||||
}
|
||||
Swal.fire({
|
||||
title: '¿Está seguro de eliminar la linea?',
|
||||
text: "No podrá revertir esta acción",
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonText: 'Sí',
|
||||
cancelButtonText: 'Cancelar',
|
||||
customClass: {
|
||||
confirmButton: 'btn btn-danger me-1',
|
||||
cancelButton: 'btn btn-secondary'
|
||||
},
|
||||
buttonsStyling: false
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.post(
|
||||
'/etiquetasTitulos/deleteLineas',
|
||||
{
|
||||
ids: ids
|
||||
},
|
||||
function (response) {
|
||||
if (response.status) {
|
||||
self.table.ajax.reload();
|
||||
popSuccessAlert(response.message);
|
||||
} else {
|
||||
popErrorAlert('Error borrando la etiqueta');
|
||||
}
|
||||
}
|
||||
).fail(function (xhr, status, error) {
|
||||
popErrorAlert(error);
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
_updateLinea(e) {
|
||||
e.preventDefault();
|
||||
const self = this;
|
||||
const id = $(e.currentTarget).attr('data-id');
|
||||
const name = $(e.currentTarget).attr('data-name');
|
||||
const value = $(e.currentTarget).val();
|
||||
const url = '/etiquetasTitulos/updateLineas';
|
||||
const data = {
|
||||
id: id,
|
||||
name: name,
|
||||
value: value
|
||||
};
|
||||
$.post(
|
||||
url,
|
||||
data,
|
||||
function (response) {
|
||||
if (!response.status) {
|
||||
popErrorAlert('Error actualizando la linea');
|
||||
}
|
||||
else {
|
||||
self.table.ajax.reload();
|
||||
}
|
||||
}
|
||||
).fail(function (xhr, status, error) {
|
||||
popErrorAlert(error);
|
||||
});
|
||||
}
|
||||
|
||||
_guardarComentarios() {
|
||||
const self = this;
|
||||
const id = $('#id').val();
|
||||
const comentarios = $('#comentarios').val();
|
||||
const url = '/etiquetasTitulos/updateComentarios';
|
||||
const data = {
|
||||
id: id,
|
||||
comentarios: comentarios
|
||||
};
|
||||
$.post(
|
||||
url,
|
||||
data,
|
||||
function (response) {
|
||||
if (!response.status) {
|
||||
popErrorAlert('Error actualizando comentarios');
|
||||
}
|
||||
else {
|
||||
popSuccessAlert(response.message);
|
||||
}
|
||||
}
|
||||
).fail(function (xhr, status, error) {
|
||||
popErrorAlert(error);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
/*const dropdown = document.querySelector(".dropdown-language");
|
||||
const activeItem = dropdown.querySelector(".dropdown-menu .dropdown-item");
|
||||
let locale = 'es';
|
||||
if (activeItem) {
|
||||
locale = activeItem.getAttribute("data-language");
|
||||
}
|
||||
|
||||
new Ajax('/translate/getTranslation', { locale: locale, translationFile: [] }, {},
|
||||
function (translations) {
|
||||
window.language = JSON.parse(translations);
|
||||
new EtiquetaEdit().init();
|
||||
},
|
||||
function (error) {
|
||||
console.log("Error getting translations:", error);
|
||||
}
|
||||
).post();
|
||||
*/
|
||||
new EtiquetaEdit().init();
|
||||
});
|
||||
|
||||
export default EtiquetaEdit;
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user