mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Compare commits
15 Commits
feat/ot-da
...
feat/revis
| Author | SHA1 | Date | |
|---|---|---|---|
| 5ce6859a2f | |||
| 2bfdd89085 | |||
| 305eea00e6 | |||
| 8ea6128109 | |||
| 7b645539e3 | |||
| fb7f2a28d9 | |||
| 39639d9ff8 | |||
| 3f90665c39 | |||
| 71e70bf551 | |||
| db70c57fb3 | |||
| 91b044bbae | |||
| a88ffda50d | |||
| 746955c3b1 | |||
| 8ca0a40b2b | |||
| 20c009f445 |
@ -122,7 +122,7 @@ class OrdenTrabajo extends BaseConfig
|
||||
];
|
||||
|
||||
public array $OT_TAREA_STATUS_COLOR = [
|
||||
"P" => '#FFD63A',
|
||||
"P" => '#FFB22C',
|
||||
"F" => '#67AE6E',
|
||||
"S" => '#EB5B00',
|
||||
"I" => '#3A59D1',
|
||||
@ -130,6 +130,7 @@ class OrdenTrabajo extends BaseConfig
|
||||
"D" => '#FFA725',
|
||||
];
|
||||
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__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,11 +742,17 @@ $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');
|
||||
@ -756,9 +762,8 @@ $routes->group('produccion', ['namespace' => 'App\Controllers\Produccion'], func
|
||||
$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('tarea/dates/(:num)','Ordentrabajo::get_orden_trabajo_tareas_dates/$1');
|
||||
$routes->get('maquinas/ots/datatable/(:num)','Ordentrabajo::datatable_maquina_ordenes_trabajo/$1');
|
||||
$routes->get('maquinas/ots/(:num)','Ordentrabajo::get_maquina_ots/$1');
|
||||
/**======================
|
||||
* UPDATES
|
||||
*========================**/
|
||||
@ -767,18 +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->post("update/tarea/proveedor", "Ordentrabajo::update_presupuesto_tarea_proveedor");
|
||||
$routes->delete("tarea/progress/(:num)", "Ordentrabajo::delete_orden_trabajo_progress_date/$1");
|
||||
$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
|
||||
*========================**/
|
||||
@ -792,6 +806,7 @@ $routes->group('produccion', ['namespace' => 'App\Controllers\Produccion'], func
|
||||
$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');
|
||||
@ -807,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']);
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -822,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');
|
||||
@ -842,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');
|
||||
});
|
||||
|
||||
/*
|
||||
|
||||
@ -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 =
|
||||
[
|
||||
|
||||
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,
|
||||
|
||||
@ -5,6 +5,7 @@ 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;
|
||||
@ -31,6 +32,7 @@ class Ordentrabajo extends BaseController
|
||||
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/';
|
||||
@ -47,6 +49,7 @@ 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");
|
||||
@ -141,7 +144,8 @@ class Ordentrabajo extends BaseController
|
||||
return $this->response->setJSON(["errors" => $this->validation->getErrors()])->setStatusCode(400);
|
||||
}
|
||||
}
|
||||
public function update_presupuesto_tarea_proveedor(){
|
||||
public function update_presupuesto_tarea_proveedor()
|
||||
{
|
||||
$bodyData = $this->request->getPost();
|
||||
$validated = $this->validation->run($bodyData, "proveedor_tarea");
|
||||
if ($validated) {
|
||||
@ -151,7 +155,6 @@ class Ordentrabajo extends BaseController
|
||||
} else {
|
||||
return $this->response->setJSON(["errors" => $this->validation->getErrors()])->setStatusCode(400);
|
||||
}
|
||||
|
||||
}
|
||||
public function reset_orden_trabajo_date()
|
||||
{
|
||||
@ -242,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()])
|
||||
@ -257,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()])
|
||||
@ -272,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()])
|
||||
@ -287,7 +290,7 @@ class Ordentrabajo extends BaseController
|
||||
{
|
||||
$logo = config(LogoImpresion::class);
|
||||
|
||||
$q = $this->otModel->getDatatableQuery();
|
||||
$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(
|
||||
@ -301,7 +304,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('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(
|
||||
@ -315,7 +318,7 @@ class Ordentrabajo extends BaseController
|
||||
{
|
||||
$logo = config(LogoImpresion::class);
|
||||
|
||||
$q = $this->otModel->getDatatableQuery()->where('ordenes_trabajo.is_pedido_espera',1);
|
||||
$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(
|
||||
@ -329,7 +332,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 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(
|
||||
@ -374,8 +377,9 @@ 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])
|
||||
@ -600,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);
|
||||
@ -614,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);
|
||||
@ -629,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);
|
||||
}
|
||||
@ -639,13 +681,12 @@ 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) {
|
||||
$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_trabajado()),
|
||||
"tiempo_trabajado" => float_seconds_to_hhmm_string($otTareaEntity->tiempo_real),
|
||||
"tarea" => $otTareaEntity,
|
||||
"estado" => $validatedData['estado'],
|
||||
];
|
||||
@ -673,20 +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 ]);
|
||||
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,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");
|
||||
}
|
||||
}
|
||||
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'];
|
||||
}
|
||||
@ -45,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",
|
||||
@ -72,6 +75,7 @@ class OrdenTrabajoEntity extends Entity
|
||||
"enviar_impresion" => "bool",
|
||||
"portada_path" => "string",
|
||||
"is_pedido_espera" => "bool",
|
||||
"preimpresion_revisada" => "bool",
|
||||
];
|
||||
|
||||
|
||||
@ -178,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');
|
||||
|
||||
@ -178,7 +178,7 @@ class OrdenTrabajoTareaEntity extends Entity
|
||||
$m = model(OrdenTrabajoTareaProgressDate::class);
|
||||
return $m->where('ot_tarea_id', $this->attributes["id"])->findAll() ?? [];
|
||||
}
|
||||
public function lastState() : ?OrdenTrabajoTareaProgressDateEntity
|
||||
public function lastState(): ?OrdenTrabajoTareaProgressDateEntity
|
||||
{
|
||||
$m = model(OrdenTrabajoTareaProgressDate::class);
|
||||
$progressDates = $m->where('ot_tarea_id', $this->attributes["id"])->orderBy('action_at', 'DESC')->first();
|
||||
@ -193,12 +193,12 @@ class OrdenTrabajoTareaEntity extends Entity
|
||||
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 && $init) {
|
||||
$end = Time::createFromFormat('Y-m-d H:i:s', $date->action_at);
|
||||
$end = $date->action_at;
|
||||
$intervals[] = $init->difference($end)->getSeconds();
|
||||
}
|
||||
}
|
||||
@ -218,23 +218,23 @@ class OrdenTrabajoTareaEntity extends Entity
|
||||
}
|
||||
return $isTareaCosido;
|
||||
}
|
||||
public function isImpresion() : bool
|
||||
public function isImpresion(): bool
|
||||
{
|
||||
return $this->attributes['presupuesto_linea_id'] != null;
|
||||
}
|
||||
public function isAcabado() : bool
|
||||
public function isAcabado(): bool
|
||||
{
|
||||
return $this->attributes['presupuesto_acabado_id'] != null;
|
||||
}
|
||||
public function isManipulado() : bool
|
||||
public function isManipulado(): bool
|
||||
{
|
||||
return $this->attributes['presupuesto_manipulado_id'] != null;
|
||||
}
|
||||
public function isEncuadernado() : bool
|
||||
public function isEncuadernado(): bool
|
||||
{
|
||||
return $this->attributes['presupuesto_encuadernado_id'] != null;
|
||||
}
|
||||
public function isCorte() : bool
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
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"];
|
||||
|
||||
@ -753,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",
|
||||
|
||||
@ -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',
|
||||
],
|
||||
|
||||
];
|
||||
@ -12,6 +12,8 @@ return [
|
||||
'prod' => 'Producción'
|
||||
],
|
||||
"datatable" => [
|
||||
"ot_id" => "OT ID",
|
||||
"barcode" => "Código",
|
||||
"pedido_id" => "Pedido ID",
|
||||
"fecha_encuadernacion" => "Fecha encuadernación",
|
||||
"fecha_impresion" => "Fecha impresión",
|
||||
@ -97,6 +99,7 @@ return [
|
||||
"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",
|
||||
@ -153,6 +156,17 @@ return [
|
||||
"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' => [
|
||||
@ -175,4 +189,15 @@ return [
|
||||
"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"
|
||||
|
||||
]
|
||||
];
|
||||
|
||||
@ -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)
|
||||
|
||||
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');
|
||||
}
|
||||
}
|
||||
@ -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';
|
||||
@ -39,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;
|
||||
@ -72,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 = [
|
||||
|
||||
@ -13,7 +13,7 @@ class EmailService
|
||||
|
||||
// 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) {
|
||||
|
||||
@ -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();
|
||||
}
|
||||
}
|
||||
@ -1984,17 +1983,17 @@ class PresupuestoService extends BaseService
|
||||
return $peso;
|
||||
}
|
||||
|
||||
public static function ajustarPresupuesto($id, $precio_unidad = null, $unidades = null, $precio_total = null, $forzar_descuento = false){
|
||||
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){
|
||||
$model = model('App\Models\Presupuestos\PresupuestoModel');
|
||||
if ($precio_unidad != null && $unidades != null) {
|
||||
$precio_total_asignado = round(floatval($precio_unidad) * intval($unidades), 2);
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
$precio_total_asignado = floatval($precio_total);
|
||||
}
|
||||
$presupuesto = $model->find($id);
|
||||
@ -2003,13 +2002,12 @@ class PresupuestoService extends BaseService
|
||||
|
||||
$total_descuento = 0;
|
||||
$total_descuentoPercent = 0;
|
||||
if($costes + $envio_base > $precio_total_asignado){
|
||||
if ($costes + $envio_base > $precio_total_asignado) {
|
||||
|
||||
if($forzar_descuento){
|
||||
if ($forzar_descuento) {
|
||||
$total_descuento = $costes + $envio_base - $precio_total_asignado;
|
||||
$total_descuentoPercent = round($total_descuento / ($costes + $envio_base) * 100, 2);
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
$precio_total_asignado = round($costes + $envio_base, 2);
|
||||
$precio_unidad_asignado = round($precio_total_asignado / intval($unidades), 4);
|
||||
}
|
||||
@ -2021,22 +2019,22 @@ class PresupuestoService extends BaseService
|
||||
|
||||
$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)
|
||||
|
||||
$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)
|
||||
|
||||
$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_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;
|
||||
$costes + $envio_base :
|
||||
$precio_total_asignado;
|
||||
$presupuesto->total_precio_unidad = $precio_unidad_asignado;
|
||||
$presupuesto->total_descuento = $total_descuento;
|
||||
$presupuesto->total_descuentoPercent = $total_descuentoPercent;
|
||||
|
||||
@ -52,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;
|
||||
@ -211,6 +212,14 @@ class ProductionService extends BaseService
|
||||
$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
|
||||
@ -218,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();
|
||||
@ -259,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();
|
||||
@ -272,7 +285,8 @@ 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);
|
||||
@ -596,6 +610,12 @@ 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()
|
||||
{
|
||||
@ -993,9 +1013,9 @@ 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'));
|
||||
}
|
||||
@ -1031,6 +1051,10 @@ class ProductionService extends BaseService
|
||||
$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);
|
||||
@ -1116,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)
|
||||
@ -1459,6 +1486,7 @@ class ProductionService extends BaseService
|
||||
}
|
||||
return $uvi;
|
||||
}
|
||||
//TODO ACTUALIZAR
|
||||
public function updateProgress(): bool
|
||||
{
|
||||
$userDates = $this->ordenTrabajoConfig->DATE_USER_MAPPING;
|
||||
@ -1903,10 +1931,12 @@ class ProductionService extends BaseService
|
||||
"pedidos.fecha_impresion",
|
||||
"orden_trabajo_tareas.nombre as tareaName",
|
||||
"orden_trabajo_tareas.maquina_id",
|
||||
"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
|
||||
@ -1922,9 +1952,9 @@ class ProductionService extends BaseService
|
||||
->join("pedidos", "pedidos.id = ordenes_trabajo.pedido_id", "right")
|
||||
->join("lg_maquinas", "lg_maquinas.id = orden_trabajo_tareas.maquina_id", "left")
|
||||
->where('orden_trabajo_tareas.maquina_id', $maquina_id)
|
||||
// ->where('pedidos.fecha_impresion IS NOT NULL', null, false)
|
||||
// ->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.id');
|
||||
|
||||
@ -2105,7 +2135,7 @@ class ProductionService extends BaseService
|
||||
$data[$tareasAcabado->id] = 'plastificado_at';
|
||||
}
|
||||
if ($tarifaAcabado->rectractilado) {
|
||||
$data[$tareasAcabado->id] = 'rectractilado_at';
|
||||
$data[$tareasAcabado->id] = 'retractilado_at';
|
||||
}
|
||||
if ($tarifaAcabado->estampado) {
|
||||
$data[$tareasAcabado->id] = 'estampado_at';
|
||||
@ -2127,7 +2157,7 @@ class ProductionService extends BaseService
|
||||
$dateName = 'plastificado_at';
|
||||
}
|
||||
if ($tarifaAcabado->rectractilado) {
|
||||
$dateName = 'rectractilado_at';
|
||||
$dateName = 'retractilado_at';
|
||||
}
|
||||
if ($tarifaAcabado->plakene) {
|
||||
$dateName = 'plakene_at';
|
||||
@ -2185,4 +2215,23 @@ class ProductionService extends BaseService
|
||||
}
|
||||
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,9 +1,9 @@
|
||||
<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.fecha_impresion') ?></th>
|
||||
|
||||
@ -5,6 +5,7 @@
|
||||
<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>
|
||||
|
||||
@ -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,25 +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>
|
||||
<button type="button" id="btn-delay-tasks" class="btn btn-warning h-100 w-50"><?= lang('Produccion.maquinista.tareas_delay') ?></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() ?>
|
||||
@ -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 -->
|
||||
@ -12,15 +12,37 @@
|
||||
|
||||
<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="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 -->
|
||||
@ -318,16 +340,7 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="row">
|
||||
<span><?= @lang("Produccion.tiempo_estimado") ?>(HH:MM)</span>
|
||||
<span class="tiempo-estimado"> <?= $tiempo_estimado ?></span>
|
||||
</div>
|
||||
<div class="row">
|
||||
<span><?= @lang("Produccion.tiempo_consumido") ?>(HH:MM)</span>
|
||||
<span id="tiempo-total"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="d-flex flex-row justify-content-between align-items-center">
|
||||
@ -344,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>
|
||||
|
||||
@ -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; ?>
|
||||
|
||||
@ -22,11 +22,6 @@ if (auth()->user()->inGroup('maquina','admin')) {
|
||||
<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 } ?>
|
||||
@ -286,9 +286,7 @@ $settings = $session->get('settings');
|
||||
</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>
|
||||
|
||||
@ -393,11 +393,6 @@ $settings = $session->get('settings');
|
||||
</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>
|
||||
|
||||
|
||||
</div>
|
||||
</body>
|
||||
<script src=<?= site_url("themes/vuexy/vendor/libs/html2pdf/html2pdf.bundle.min.js") ?>></script>
|
||||
|
||||
@ -391,9 +391,7 @@ $settings = $session->get('settings');
|
||||
</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>
|
||||
|
||||
@ -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,13 +4,15 @@ 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: '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 },
|
||||
@ -18,27 +20,28 @@ class MaquinistaTareaList {
|
||||
{ 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')
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -123,10 +123,12 @@ 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')
|
||||
}
|
||||
this.item.find('#tiempo-real-info').html(response.tiempo_trabajado ?? "00:00")
|
||||
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()
|
||||
})
|
||||
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;
|
||||
177
httpdocs/assets/js/safekat/pages/logistica/impresionEtiquetas.js
Normal file
177
httpdocs/assets/js/safekat/pages/logistica/impresionEtiquetas.js
Normal file
@ -0,0 +1,177 @@
|
||||
import ClassSelect from '../../components/select2.js';
|
||||
|
||||
$(() => {
|
||||
|
||||
let otsFilter = '';
|
||||
|
||||
const selectOts = new ClassSelect($('#buscadorPedidos'), '/etiquetasTitulos/otList', "", true);
|
||||
selectOts.init();
|
||||
|
||||
const selectDirecciones = new ClassSelect($('#selectDirecciones'), '/etiquetasTitulos/addList', "", true, {
|
||||
ot_id: () => selectOts.getVal()
|
||||
});
|
||||
selectDirecciones.init();
|
||||
|
||||
selectOts.item.on('select2:open', () => {
|
||||
$('.select-direcciones').addClass('d-none');
|
||||
$('.add-etiqueta').addClass('d-none');
|
||||
})
|
||||
selectOts.item.on('change', () => {
|
||||
selectDirecciones.empty();
|
||||
$('.add-etiqueta').addClass('d-none');
|
||||
$('.select-direcciones').removeClass('d-none');
|
||||
})
|
||||
selectDirecciones.item.on('select2:open', () => {
|
||||
$('.add-etiqueta').addClass('d-none');
|
||||
})
|
||||
|
||||
selectDirecciones.item.on('change', () => {
|
||||
$('.add-etiqueta').removeClass('d-none');
|
||||
})
|
||||
|
||||
$('#btnAddEtiqueta').on('click', () => {
|
||||
|
||||
Swal.fire({
|
||||
title: 'Unidades por caja',
|
||||
text: 'Seleccione la cantidad de unidades por caja',
|
||||
icon: 'info',
|
||||
input: 'text',
|
||||
inputLabel: 'Unidades/caja',
|
||||
inputValue: 0,
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
confirmButtonText: 'Aceptar',
|
||||
cancelButtonText: 'Cancelar',
|
||||
customClass: {
|
||||
confirmButton: 'btn btn-primary me-1',
|
||||
cancelButton: 'btn btn-secondary'
|
||||
},
|
||||
buttonsStyling: false
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
const unidades_caja = result.value;
|
||||
const url = '/etiquetasTitulos/newEtiquetaTitulos';
|
||||
const data = {
|
||||
ot_id: selectOts.getVal(),
|
||||
direccion: selectDirecciones.getText(),
|
||||
unidades_caja: unidades_caja
|
||||
};
|
||||
$.post(
|
||||
url,
|
||||
data,
|
||||
function (response) {
|
||||
if (response.status) {
|
||||
tableEtiquetas.ajax.reload();
|
||||
// open the new etiqueta in a new tab
|
||||
window.open(`${window.location.origin}/etiquetasTitulos/edit/${response.etiqueta}`, '_blank');
|
||||
} else {
|
||||
popErrorAlert('Error en la respuesta');
|
||||
}
|
||||
}
|
||||
).fail(function (xhr, status, error) {
|
||||
popErrorAlert(error);
|
||||
});
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
const tableEtiquetas = $('#tableOfEquiquetas').DataTable({
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
autoWidth: true,
|
||||
responsive: true,
|
||||
scrollX: true,
|
||||
orderCellsTop: true,
|
||||
lengthMenu: [5, 10, 25, 50, 75, 100, 250, 500, 1000, 2500],
|
||||
pageLength: 50,
|
||||
"dom": 'lBrtip',
|
||||
"ajax": {
|
||||
"url": "/etiquetasTitulos/datatable",
|
||||
"data": function (d) {
|
||||
d.otsFilter = otsFilter;
|
||||
}
|
||||
},
|
||||
"columns": [
|
||||
{ "data": "id" },
|
||||
{ "data": "lista_ots" },
|
||||
{ "data": "cajas" },
|
||||
{ "data": "att" },
|
||||
{ "data": "direccion" },
|
||||
{ "data": "action" }
|
||||
|
||||
],
|
||||
"language": {
|
||||
url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
|
||||
},
|
||||
"columnDefs": [
|
||||
{
|
||||
orderable: false,
|
||||
searchable: false,
|
||||
targets: [5]
|
||||
},
|
||||
],
|
||||
"order": [[0, "desc"]],
|
||||
});
|
||||
|
||||
$(document).on('click', '.btn-edit', function (e) {
|
||||
window.location.href = '/etiquetasTitulos/edit/' + $(this).attr('data-id');
|
||||
});
|
||||
|
||||
$(document).on('click', '.btn-delete', function (e) {
|
||||
Swal.fire({
|
||||
title: '¿Está seguro de eliminar la etiqueta?',
|
||||
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/delete',
|
||||
{
|
||||
id: $(this).attr('data-id')
|
||||
},
|
||||
function (response) {
|
||||
if (response.status) {
|
||||
tableEtiquetas.ajax.reload();
|
||||
popSuccessAlert(response.message);
|
||||
} else {
|
||||
popErrorAlert('Error borrando la etiqueta');
|
||||
}
|
||||
}
|
||||
).fail(function (xhr, status, error) {
|
||||
popErrorAlert(error);
|
||||
});
|
||||
}
|
||||
})
|
||||
|
||||
});
|
||||
|
||||
$(document).on("keyup", ".envio-filter", (event) => {
|
||||
let columnName = $(event.currentTarget).attr("name");
|
||||
let columnIndex = $('#tableOfEquiquetas').DataTable().columns().eq(0).filter(function (index) {
|
||||
return $('#tableOfEquiquetas').DataTable().column(index).dataSrc() === columnName;
|
||||
})[0];
|
||||
$('#tableOfEquiquetas').DataTable().column(columnIndex).search($(event.currentTarget).val()).draw()
|
||||
})
|
||||
|
||||
|
||||
$(document).on("keyup", ".envio-filter-ots", (event) => {
|
||||
otsFilter = $(event.currentTarget).val();
|
||||
$('#tableOfEquiquetas').DataTable().ajax.reload();
|
||||
})
|
||||
|
||||
$(document).on("change", ".envio-filter-select", (event) => {
|
||||
let columnName = $(event.currentTarget).attr("name");
|
||||
let columnIndex = $('#tableOfEquiquetas').DataTable().columns().eq(0).filter(function (index) {
|
||||
return $('#tableOfEquiquetas').DataTable().column(index).dataSrc() === columnName;
|
||||
})[0];
|
||||
$('#tableOfEquiquetas').DataTable().column(columnIndex).search($(event.currentTarget).val()).draw();
|
||||
});
|
||||
})
|
||||
@ -25,12 +25,15 @@ class OrdenTrabajo {
|
||||
this.tiempoEstimado = this.item.find('#tiempo-estimado')
|
||||
this.btnResetTareas = this.item.find("#btn-reset-tareas")
|
||||
this.pedidoEnEsperaCheck = this.item.find("#ot-pedido-espera");
|
||||
this.otPreimpresionRevisadaCheck = this.item.find("#ot-preimpresion-revisada");
|
||||
this.pedidoEnEsperaBy = this.item.find("#pedido_espera_by");
|
||||
this.otPreimpresionRevisadaUser = this.item.find("#preimpresion_revisada_by");
|
||||
this.otEstado = this.item.find("#ot-estado");
|
||||
|
||||
this.datatableColumns = [
|
||||
{ data: 'orden', searchable: true, sortable: true, render: this._renderOrdenTarea.bind(this) },
|
||||
{ data: 'nombre', searchable: true, sortable: true },
|
||||
{ data: 'tarea_estado', searchable: false, sortable: false, render: this._renderTareaEstado.bind(this) },
|
||||
{
|
||||
data: 'maquina_presupuesto_linea', searchable: true, sortable: true, render: (d) => {
|
||||
if (d) {
|
||||
@ -66,10 +69,9 @@ class OrdenTrabajo {
|
||||
*/
|
||||
this.configUploadDropzone = {
|
||||
domElement: '#dropzone-ot-files',
|
||||
nameId: "orden_trabajo_id",
|
||||
getUri: '/produccion/ordentrabajo/get_files',
|
||||
postUri: '/produccion/ordentrabajo/upload_files',
|
||||
resourcePath: 'orden_trabajo/' + this.modelId
|
||||
nameId: "presupuesto_id",
|
||||
getUri: '/presupuestos/presupuestocliente/get_files',
|
||||
postUri: '/presupuestos/presupuestocliente/upload_files'
|
||||
}
|
||||
if ($(this.configUploadDropzone.domElement).length > 0) {
|
||||
this.fileUploadDropzone = new FileUploadDropzone(this.configUploadDropzone)
|
||||
@ -264,6 +266,22 @@ class OrdenTrabajo {
|
||||
</div>`
|
||||
return cell;
|
||||
}
|
||||
_renderTareaEstado(d, t) {
|
||||
let html = `
|
||||
<div class="btn-group dropstart">
|
||||
<button style="background-color:${d.color};color:white" class="btn btn-xs dropdown-toggle" type="button" data-bs-toggle="dropdown">
|
||||
${d.title}
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
<li> <a class="dropdown-item" href="javascript:void(0);">${d.userName}</a> </li>
|
||||
</ul>
|
||||
</div>
|
||||
`
|
||||
if(d.userName == ""){
|
||||
html = `<span style="background-color:${d.color};color:white" class="badge">${d.title}</span>`
|
||||
}
|
||||
return html
|
||||
}
|
||||
_renderOrdenTarea(d, t) {
|
||||
|
||||
return `
|
||||
@ -429,6 +447,13 @@ class OrdenTrabajo {
|
||||
this.fillPreimpresionReview()
|
||||
this.fillPliegos()
|
||||
this.isOtFinalizada = this.summaryData.ot.estado == "F";
|
||||
if (this.isOtFinalizada) {
|
||||
this.btnEraseDate.addClass('d-none').attr('disabled', 'disabled')
|
||||
this.btnErasePedidoDate.addClass('d-none').attr('disabled', 'disabled')
|
||||
} else {
|
||||
this.btnEraseDate.removeClass('d-none').removeAttr('disabled')
|
||||
this.btnErasePedidoDate.removeClass('d-none').removeAttr('disabled')
|
||||
}
|
||||
this.datatableTareas.ajax.reload()
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
@ -516,12 +541,18 @@ class OrdenTrabajo {
|
||||
this.embalaje.setDate(this.summaryData.dates.embalaje_at)
|
||||
this.envio.setDate(this.summaryData.dates.envio_at)
|
||||
this.pedidoEnEsperaCheck.prop("checked", this.summaryData.ot.is_pedido_espera);
|
||||
this.otPreimpresionRevisadaCheck.prop("checked", this.summaryData.ot.preimpresion_revisada);
|
||||
this.tiempoProcesamiento.val(this.summaryData.tiempo_procesamiento);
|
||||
if (this.summaryData.ot.pedido_espera_by) {
|
||||
this.pedidoEnEsperaBy.text([this.summaryData.ot.pedido_espera_by.first_name, this.summaryData.ot.pedido_espera_by.last_name].join(" "))
|
||||
} else {
|
||||
this.pedidoEnEsperaBy.text("");
|
||||
}
|
||||
if (this.summaryData.ot.preimpresion_revisada_by) {
|
||||
this.otPreimpresionRevisadaUser.text([this.summaryData.ot.preimpresion_revisada_by.first_name, this.summaryData.ot.preimpresion_revisada_by.last_name].join(" "))
|
||||
} else {
|
||||
this.otPreimpresionRevisadaUser.text("")
|
||||
}
|
||||
this.otEstado.val(this.summaryData.ot.estado)
|
||||
this.preFormatoAt.setDate(this.summaryData.dates.pre_formato_at)
|
||||
this.preLomoAt.setDate(this.summaryData.dates.pre_lomo_at)
|
||||
|
||||
@ -4,6 +4,12 @@
|
||||
width : 100%;
|
||||
font-size : 20px;
|
||||
}
|
||||
.maquina-btn-v
|
||||
{
|
||||
height : 5rem;
|
||||
width : 1rem;
|
||||
font-size : 20px;
|
||||
}
|
||||
.table-maquinista td{
|
||||
height : 7rem;
|
||||
}
|
||||
@ -3,6 +3,10 @@
|
||||
* File include item demo only specific css only
|
||||
******************************************************************************/
|
||||
|
||||
.env-bg {
|
||||
background-color: #2E5939 !important;
|
||||
}
|
||||
|
||||
.light-style .menu .app-brand.demo {
|
||||
height: 64px;
|
||||
}
|
||||
@ -135,4 +139,8 @@
|
||||
.dtrg-group.ui-droppable-hover {
|
||||
background-color: #d1ecf1 !important;
|
||||
cursor: move;
|
||||
}
|
||||
|
||||
.dt-no-reorder {
|
||||
cursor: auto !important;
|
||||
}
|
||||
Reference in New Issue
Block a user