mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Compare commits
80 Commits
feat/view-
...
feat/ot-da
| Author | SHA1 | Date | |
|---|---|---|---|
| 5138681718 | |||
| 9283059f9d | |||
| b75278f449 | |||
| 3fb944ff97 | |||
| c7250cb8fd | |||
| 7a9b2af8a6 | |||
| cf5a42de8d | |||
| a259d76e5e | |||
| f696153d74 | |||
| 9181905233 | |||
| 0ec7dff479 | |||
| b0fb0f18fb | |||
| cf4c4df80a | |||
| 36c9227586 | |||
| 4e9dfb51c7 | |||
| 5aab9a33ac | |||
| ea762a09c0 | |||
| 21014d029f | |||
| 9c31f2bbc5 | |||
| b288ca498c | |||
| 96a6845c0c | |||
| eed5c0994e | |||
| e2ab42cd84 | |||
| 7da76af866 | |||
| bf1e66d746 | |||
| adccc414be | |||
| 95fa192cb9 | |||
| 9310d2dabd | |||
| 3abf45ca6e | |||
| 6ea22066c2 | |||
| bf21a336b1 | |||
| d1e5731d1d | |||
| 029757bb40 | |||
| bb4c9690b9 | |||
| 6d45a950df | |||
| 6f8890a8b1 | |||
| c093c01c00 | |||
| a4532a7ff6 | |||
| 31a12ff343 | |||
| 1d6f5fe53e | |||
| 0b767c63e9 | |||
| e464652fe2 | |||
| dd20f2a20e | |||
| 97554bffc9 | |||
| 73e9e941ed | |||
| 05720cf1ce | |||
| 04e9e3ee6f | |||
| 9804a6a927 | |||
| 3402e67fb2 | |||
| b1932e6f85 | |||
| 13ae70236e | |||
| 4d8332e625 | |||
| c75d08b3c3 | |||
| a0b5f3b4df | |||
| 0e444295e3 | |||
| ae7707057a | |||
| ff115f4f20 | |||
| 45e41c77e4 | |||
| ae456c8890 | |||
| e8958dc893 | |||
| b0ac132e59 | |||
| b50e564641 | |||
| 894770d6ce | |||
| 367c7c2ea8 | |||
| 9375b9b624 | |||
| 9a6a4f89a2 | |||
| 7f31e65960 | |||
| 5aa2a2e6c9 | |||
| dfbcb13ba5 | |||
| 033184cfa2 | |||
| 25b6d14423 | |||
| 96bd24ae8b | |||
| b5b86b4164 | |||
| ef173ab0fc | |||
| f473caf06c | |||
| 5e8a7f8bd4 | |||
| 905112334f | |||
| d0f37cb714 | |||
| 151e4a2d7a | |||
| 05ebfa06df |
@ -12,8 +12,14 @@ class OrdenTrabajo extends BaseConfig
|
||||
"interior_bn_at" => "interior_bn_user_id",
|
||||
"interior_color_at" => "interior_color_user_id",
|
||||
"cubierta_at" => "cubierta_user_id",
|
||||
"sobrecubierta_at" => "sobrecubierta_user_id",
|
||||
"guarda_at" => "guarda_user_id",
|
||||
//ACABADO
|
||||
"plastificado_at" => "plastificado_user_id",
|
||||
"plakene_at" => "plakene_user_id",
|
||||
"retractilado_at" => "retractilado_user_id",
|
||||
"estampado_at" => "estampado_user_id",
|
||||
"uvi_at" => "uvi_user_id",
|
||||
"encuadernacion_at" => "encuadernacion_user_id",
|
||||
"corte_at" => "corte_user_id",
|
||||
"preparacion_interiores_at" => "preparacion_interior_user_id",
|
||||
@ -21,7 +27,6 @@ class OrdenTrabajo extends BaseConfig
|
||||
"cosido_at" => "cosido_user_id",
|
||||
"grapado_at" => "grapado_user_id",
|
||||
"solapa_at" => "solapa_user_id",
|
||||
"retractilado_at" => "retractilado_user_id",
|
||||
"retractilado5_at" => "retractilado5_user_id",
|
||||
"prototipo_at" => "prototipo_user_id",
|
||||
"marcapaginas_at" => "marcapaginas_user_id",
|
||||
@ -65,7 +70,7 @@ class OrdenTrabajo extends BaseConfig
|
||||
["bg" => "yellow", "color" => "black"],
|
||||
["bg" => "purple", "color" => "white"],
|
||||
["bg" => "orange", "color" => "white"],
|
||||
["bg" => "blue", "color" => "black"],
|
||||
["bg" => "blue", "color" => "white"],
|
||||
["bg" => "pink", "color" => "black"],
|
||||
["bg" => "#FFFFFF", "color" => "black"],
|
||||
];
|
||||
@ -100,9 +105,9 @@ class OrdenTrabajo extends BaseConfig
|
||||
];
|
||||
public array $OT_PLASTIFICADO_COLOR =
|
||||
[
|
||||
"BRIL" => ["bg" => "#00B0F0", "color" => "white"],
|
||||
"BRILLO" => ["bg" => "#00B0F0", "color" => "white"],
|
||||
"MATE" => ["bg" => "#FF0000", "color" => "white"],
|
||||
"SOFT_TOUCH" => ["bg" => "#00B050", "color" => "white"],
|
||||
"SOFT" => ["bg" => "#00B050", "color" => "white"],
|
||||
"SANDY" => ["bg" => "#782170", "color" => "white"],
|
||||
"ANTIRAYADO" => ["bg" => "#E97132", "color" => "white"],
|
||||
"GOFRADO" => ["bg" => "#FFFF00", "color" => "black"],
|
||||
@ -116,7 +121,14 @@ class OrdenTrabajo extends BaseConfig
|
||||
"default" => ["bg" => "white", "color" => "black"],
|
||||
];
|
||||
|
||||
|
||||
public array $OT_TAREA_STATUS_COLOR = [
|
||||
"P" => '#FFD63A',
|
||||
"F" => '#67AE6E',
|
||||
"S" => '#EB5B00',
|
||||
"I" => '#3A59D1',
|
||||
"E" => '#FF0B55',
|
||||
"D" => '#FFA725',
|
||||
];
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
|
||||
Binary file not shown.
@ -40,6 +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('list', 'Users::index', ['as' => 'userList2']);
|
||||
$routes->get('add', 'Users::add', ['as' => 'newUser']);
|
||||
$routes->post('add', 'Users::add', ['as' => 'createUser']);
|
||||
@ -522,6 +524,9 @@ $routes->group('albaranes', ['namespace' => 'App\Controllers\Albaranes'], functi
|
||||
$routes->post('updateAlbaranLinea', 'Albaran::updateAlbaranLinea');
|
||||
$routes->post('addIvaAlbaran', 'Albaran::addLineasIva');
|
||||
$routes->post('nuevaLineaAlbaran', 'Albaran::addBlankLineaAlbaran');
|
||||
$routes->get('datatable', 'Albaran::datatable', ['as' => 'dataTableOfAlbaranes']);
|
||||
$routes->get('getAlbaran', 'Albaran::getAlbaran');
|
||||
$routes->get('edit/(:num)', 'Albaran::editAlbaran/$1', ['as' => 'editarAlbaran']);
|
||||
});
|
||||
$routes->resource('albaranes', ['namespace' => 'App\Controllers\Pedidos', 'controller' => 'Albaran', 'except' => 'show,new,create,update']);
|
||||
|
||||
@ -639,6 +644,7 @@ $routes->group('messages', ['namespace' => 'App\Controllers\Chat'], function ($r
|
||||
$routes->get('datatable/presupuesto', 'ChatController::datatable_presupuesto_messages', ['as' => 'getDatatablePresupuestoMessages']);
|
||||
$routes->get('datatable/pedido', 'ChatController::datatable_pedido_messages', ['as' => 'getDatatablePedidoMessages']);
|
||||
$routes->get('datatable/factura', 'ChatController::datatable_factura_messages', ['as' => 'getDatatableFacturaMessages']);
|
||||
$routes->get('datatable/ots', 'ChatController::datatable_ot_messages', ['as' => 'getDatatableOtMessages']);
|
||||
|
||||
$routes->post('direct', 'ChatController::store_new_direct_message', ['as' => 'storeNewDirectMessage']);
|
||||
$routes->post('direct/client', 'ChatController::store_new_direct_message_client', ['as' => 'storeNewDirectMessageClient']);
|
||||
@ -649,6 +655,8 @@ $routes->group('chat', ['namespace' => 'App\Controllers\Chat'], function ($route
|
||||
$routes->get('presupuesto/(:num)', 'ChatController::get_chat_presupuesto_view/$1', ['as' => 'getChatPresupuestoView']);
|
||||
$routes->get('pedido/(:num)', 'ChatController::get_chat_pedido_view/$1', ['as' => 'getChatPedidoView']);
|
||||
$routes->get('factura/(:num)', 'ChatController::get_chat_factura_view/$1', ['as' => 'getChatFacturaView']);
|
||||
$routes->get('ot/(:num)', 'ChatController::get_chat_ot_view/$1', ['as' => 'getChatOtView']);
|
||||
|
||||
|
||||
$routes->get('direct/conversation/(:num)', 'ChatController::get_chat_direct/$1', ['as' => 'getChatDirect']);
|
||||
$routes->get('direct/users/select/(:num)', 'ChatController::get_chat_direct_select_users/$1', ['as' => 'getChatDirectSelectUsers']);
|
||||
@ -743,9 +751,14 @@ $routes->group('produccion', ['namespace' => 'App\Controllers\Produccion'], func
|
||||
$routes->get('datatable_pendientes', 'Ordentrabajo::datatable_pendientes');
|
||||
$routes->get('datatable_ferro_pendiente', 'Ordentrabajo::datatable_ferro_pendiente');
|
||||
$routes->get('datatable_ferro_ok', 'Ordentrabajo::datatable_ferro_ok');
|
||||
$routes->get('datatable_news', 'Ordentrabajo::datatable_news');
|
||||
$routes->get('datatable_prod', 'Ordentrabajo::datatable_prod');
|
||||
$routes->get('datatable_waiting', 'Ordentrabajo::datatable_waiting');
|
||||
$routes->get('datatable_revision_com', 'Ordentrabajo::datatable_revision_com');
|
||||
$routes->get('tareas/datatable/(:num)', 'Ordentrabajo::tareas_datatable/$1', ['as' => 'datatableTareasOrdenTrabajo']);
|
||||
$routes->get("tarea/progress/(:num)","Ordentrabajo::get_orden_trabajo_progress_date/$1");
|
||||
|
||||
$routes->get("tarea/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');
|
||||
/**======================
|
||||
* UPDATES
|
||||
*========================**/
|
||||
@ -754,25 +767,30 @@ $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/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->delete("tarea/progress/(:num)","Ordentrabajo::delete_orden_trabajo_progress_date/$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");
|
||||
|
||||
/**======================
|
||||
* FILES
|
||||
*========================**/
|
||||
$routes->post('get_files', 'Ordentrabajo::get_files');
|
||||
$routes->post('upload_files', 'Ordentrabajo::upload_files');
|
||||
$routes->get('barcode/(:num)', 'Ordentrabajo::imprimir_codigo_safekat/$1',['as' => "getOrdenTrabajoBarCode"]);
|
||||
$routes->get('barcode/(:num)', 'Ordentrabajo::imprimir_codigo_safekat/$1', ['as' => "getOrdenTrabajoBarCode"]);
|
||||
/**======================
|
||||
* PDF
|
||||
*========================**/
|
||||
$routes->get('pdf/(:num)', 'Ordentrabajo::get_pdf/$1');
|
||||
$routes->get('pdf/ferro/(:num)', 'Ordentrabajo::get_ferro_pdf/$1');
|
||||
$routes->get('pdf/prototipo/(:num)', 'Ordentrabajo::get_prototipo_pdf/$1');
|
||||
$routes->get('portada/(:num)', 'Ordentrabajo::get_portada_img/$1');
|
||||
$routes->group('planning', ['namespace' => 'App\Controllers\Produccion'], function ($routes) {
|
||||
$routes->get('select/maquina/rotativa', 'Ordentrabajo::select_maquina_planning_rot');
|
||||
@ -803,6 +821,7 @@ $routes->group('logistica', ['namespace' => 'App\Controllers\Logistica'], functi
|
||||
$routes->get('print/label/test', 'LogisticaController::print_test_label');
|
||||
$routes->get('panel', 'LogisticaController::panel', ['as' => 'LogisticaPanel']);
|
||||
$routes->get('envios', 'LogisticaController::gestionEnvios', ['as' => 'gestionEnvios']);
|
||||
$routes->get('enviosFerros', 'LogisticaController::gestionEnviosFerros', ['as' => 'gestionEnviosFerros']);
|
||||
$routes->get('datatableEnvios', 'LogisticaController::datatable_envios');
|
||||
$routes->get('datatableLineasEnvios/(:num)', 'LogisticaController::datatable_enviosEdit/$1');
|
||||
$routes->get('envio/(:num)', 'LogisticaController::editEnvio/$1');
|
||||
@ -817,8 +836,13 @@ $routes->group('logistica', ['namespace' => 'App\Controllers\Logistica'], functi
|
||||
$routes->post('updateProveedorEnvio', 'LogisticaController::updateProveedorEnvio');
|
||||
$routes->post('finalizarEnvio', 'LogisticaController::finalizarEnvio');
|
||||
$routes->post('generateEnvio', 'LogisticaController::generarEnvio');
|
||||
$routes->get('selectPedidosForEnvio', 'LogisticaController::findPedidosNewEnvio');
|
||||
$routes->get('selectDireccionForEnvio', 'LogisticaController::selectDireccionForEnvio');
|
||||
$routes->post('generateEnvioFerro', 'LogisticaController::generarEnvioFerro');
|
||||
$routes->get('selectForNewEnvio', 'LogisticaController::findForNewEnvio');
|
||||
$routes->get('selectDireccionForEnvio', 'LogisticaController::selectDireccionForEnvio');
|
||||
$routes->post('imprimirEtiquetas', 'LogisticaController::imprimirEtiquetas');
|
||||
|
||||
$routes->get('listAlbaranes', 'LogisticaController::listAlbaranes', ['as' => 'albaranesList']);
|
||||
|
||||
});
|
||||
|
||||
/*
|
||||
|
||||
@ -53,7 +53,6 @@ $routes->group('configuracion', ['namespace' => 'App\Controllers\Configuracion']
|
||||
$routes->post('duplicate/(:num)', 'Papelesimpresion::duplicate/$1', ['as' => 'duplicatePapelImpresion']);
|
||||
$routes->get('select', 'Papelesimpresion::papel_impresion_select', ['as' => 'papelImpresionSelect']);
|
||||
$routes->get('show/(:num)', 'Papelesimpresion::papel_impresion_find/$1', ['as' => 'showPapelImpresion']);
|
||||
|
||||
});
|
||||
|
||||
/* Maquinas */
|
||||
@ -149,5 +148,15 @@ $routes->group('configuracion', ['namespace' => 'App\Controllers\Configuracion']
|
||||
$routes->group("messages", ["namespace" => 'App\Controllers\Chat'], function ($routes) {
|
||||
$routes->get('', 'ChatController::config_view', ['as' => 'configMessagesIndex']);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
/* Festivos */
|
||||
$routes->group("festivos", ["namespace" => 'App\Controllers\Configuracion'], function ($routes) {
|
||||
$routes->get('', 'FestivoController::index', ['as' => 'festivosList']);
|
||||
$routes->post('', 'FestivoController::store_festivo_date', ['as' => 'storeFestivoDate']);
|
||||
$routes->delete('(:num)', 'FestivoController::delete_festivo_date/$1', ['as' => 'deleteFestivoDate']);
|
||||
$routes->get('all', 'FestivoController::find_all', ['as' => 'getFindAllFestivos']);
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
38
ci4/app/Config/Routes/ImportadoresRoutes.php
Normal file
38
ci4/app/Config/Routes/ImportadoresRoutes.php
Normal file
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
use CodeIgniter\Router\RouteCollection;
|
||||
|
||||
/** @var RouteCollection $routes */
|
||||
|
||||
/* Rutas para tarifas */
|
||||
$routes->group('importador', ['namespace' => 'App\Controllers\Importadores'], function ($routes) {
|
||||
|
||||
/* Desde Catalogo */
|
||||
$routes->group('catalogo', ['namespace' => 'App\Controllers\Importadores'], function ($routes) {
|
||||
/**======================
|
||||
* Tool
|
||||
*========================**/
|
||||
$routes->get('', 'ImportadorCatalogo::index', ['as' => 'importadorCatalogoTool']);
|
||||
|
||||
/**======================
|
||||
* AJAX
|
||||
*========================**/
|
||||
$routes->post('validar-fila', 'ImportadorCatalogo::validarFila');
|
||||
$routes->post('importar-fila', 'ImportadorCatalogo::importarFila');
|
||||
|
||||
});
|
||||
|
||||
/* Desde Cliente Bubok */
|
||||
$routes->group('bubok', ['namespace' => 'App\Controllers\Importadores'], function ($routes) {
|
||||
/**======================
|
||||
* Tool
|
||||
*========================**/
|
||||
$routes->get('', 'ImportadorBubok::index', ['as' => 'importadorBubokTool']);
|
||||
|
||||
/**======================
|
||||
* AJAX
|
||||
*========================**/
|
||||
$routes->post('importar-fila', 'ImportadorBubok::importarFila');
|
||||
|
||||
});
|
||||
});
|
||||
@ -184,4 +184,15 @@ class Validation extends BaseConfig
|
||||
"label" => "maquina",
|
||||
],
|
||||
];
|
||||
public array $proveedor_tarea =
|
||||
[
|
||||
"proveedor_id" => [
|
||||
"rules" => "required|integer",
|
||||
"label" => "Proveedor",
|
||||
],
|
||||
"orden_trabajo_tarea_id" => [
|
||||
"rules" => "required|integer",
|
||||
"label" => "Tarea",
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
@ -5,22 +5,13 @@ namespace App\Controllers\API;
|
||||
use App\Controllers\Presupuestos\Presupuestocliente;
|
||||
use CodeIgniter\RESTful\ResourceController;
|
||||
use CodeIgniter\API\ResponseTrait;
|
||||
use App\Models\API\ItemModel;
|
||||
|
||||
class ImprimelibrosApi extends ResourceController
|
||||
{
|
||||
|
||||
use ResponseTrait;
|
||||
|
||||
public function index()
|
||||
{
|
||||
$model = new ItemModel();
|
||||
$data = $model->findAll();
|
||||
return $this->respond($data);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public function calcular()
|
||||
{
|
||||
helper(['form']);
|
||||
|
||||
@ -47,6 +47,18 @@ class Albaran extends \App\Controllers\BaseResourceController
|
||||
}
|
||||
}
|
||||
|
||||
public function editAlbaran($albaran_id){
|
||||
|
||||
$albaran = $this->model->find($albaran_id);
|
||||
if ($albaran == false) {
|
||||
return redirect()->to(base_url('albaranesList'));
|
||||
}
|
||||
$this->viewData['boxTitle'] = lang('Albaran.editAlbaran') . ' ' . $albaran->numero_albaran;
|
||||
$this->viewData['albaranId'] = $albaran_id;
|
||||
|
||||
return view('themes/vuexy/form/logistica/albaranes/viewAlbaranesEdit', $this->viewData);
|
||||
}
|
||||
|
||||
public function addLinea($albaran_id)
|
||||
{
|
||||
|
||||
@ -305,6 +317,23 @@ class Albaran extends \App\Controllers\BaseResourceController
|
||||
}
|
||||
}
|
||||
|
||||
public function getAlbaran()
|
||||
{
|
||||
|
||||
if ($this->request->isAJAX()) {
|
||||
|
||||
$id = $this->request->getGet('id');
|
||||
$albaran = $this->model->getAlbaranData($id);
|
||||
$data = [
|
||||
'success' => true,
|
||||
'data' => $albaran,
|
||||
];
|
||||
return $this->respond($data);
|
||||
} else {
|
||||
return $this->failUnauthorized('Invalid request', 403);
|
||||
}
|
||||
}
|
||||
|
||||
public function generateAlbaran()
|
||||
{
|
||||
|
||||
@ -324,6 +353,32 @@ class Albaran extends \App\Controllers\BaseResourceController
|
||||
}
|
||||
}
|
||||
|
||||
public function datatable(){
|
||||
|
||||
$pedidosFilter = $this->request->getGet('pedidosFilter');
|
||||
$q = $this->model->getDatatableQuery();
|
||||
|
||||
if($pedidosFilter != null && !empty($pedidosFilter)) {
|
||||
$q->groupStart();
|
||||
$q->like('t4.id', $pedidosFilter);
|
||||
$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 mx-2" data-id="' . $q->id . '"></i></a>
|
||||
</div>
|
||||
';
|
||||
}
|
||||
);
|
||||
|
||||
return $result->toJson(returnAsObject: true);
|
||||
}
|
||||
|
||||
public function datatablesLineasAlbaran()
|
||||
{
|
||||
|
||||
|
||||
@ -1,2 +0,0 @@
|
||||
Portada Id Cliente Título Edición Autor Archivo ISBN EAN Páginas Acciones
|
||||
Lo que hay que listar
|
||||
@ -222,6 +222,25 @@ class ChatController extends BaseController
|
||||
return view(static::$viewPath . 'messageChatInternal', $this->viewData);
|
||||
}
|
||||
}
|
||||
public function get_chat_ot_view($chat_id)
|
||||
{
|
||||
$chat = $this->chatModel->find($chat_id);
|
||||
$this->viewData['breadcrumb'] = [
|
||||
['title' => lang("Chat.chat"), 'route' => route_to("mensajeriaView"), 'active' => false],
|
||||
['title' => $chat->title, 'route' => 'javascript:void(0);', 'active' => true]
|
||||
];
|
||||
$this->viewData["modelId"] = $chat->orden_trabajo_id;
|
||||
$this->viewData["type"] = "ot";
|
||||
$auth_user = auth()->user();
|
||||
$this->chatModel->setAsViewedChatUserNotifications($chat_id, $auth_user->id);
|
||||
$this->chatModel->setAsUnviewedChatUserMessages($chat_id, $auth_user->id);
|
||||
|
||||
if ($chat->chat_department_id) {
|
||||
return view(static::$viewPath . 'messageChatFactura', $this->viewData);
|
||||
} else {
|
||||
return view(static::$viewPath . 'messageChatInternal', $this->viewData);
|
||||
}
|
||||
}
|
||||
public function get_chat(int $chat_id)
|
||||
{
|
||||
|
||||
@ -502,6 +521,23 @@ class ChatController extends BaseController
|
||||
|
||||
->toJson(true);
|
||||
}
|
||||
public function datatable_ot_messages()
|
||||
{
|
||||
$auth_user_id = auth()->user()->id;
|
||||
$isAdmin = auth()->user()->inGroup('admin');
|
||||
$query = $this->chatModel->getQueryDatatableMessageOrdenTrabajo($auth_user_id);
|
||||
return DataTable::of($query)
|
||||
->edit('created_at', fn($q) => $q->created_at ? Time::createFromFormat('Y-m-d H:i:s', $q->created_at)->format("d/m/Y H:i") : "")
|
||||
->edit('updated_at', fn($q) => $q->updated_at ? Time::createFromFormat('Y-m-d H:i:s', $q->updated_at)->format("d/m/Y H:i") : "")
|
||||
->edit("creator",fn($q) => $q->userId == $auth_user_id ? '<span class="badge text-bg-success w-100">'.lang("App.me").'</span>' : $q->creator)
|
||||
->add("viewed", fn($q) => $this->chatModel->isMessageChatViewed($q->chatMessageId))
|
||||
->add("action", fn($q) => ["type" => "ot", "modelId" => $q->id, "isAdmin" => $isAdmin,"chatMessageId" => $q->chatMessageId, "lang" => [
|
||||
"view_chat" => lang('Chat.view_chat'),
|
||||
"view_by_alt_message" => lang('Chat.view_by_alt_message')
|
||||
]])
|
||||
|
||||
->toJson(true);
|
||||
}
|
||||
public function get_notifications_not_viewed_from_message(int $chat_message_id)
|
||||
{
|
||||
$unviewedNotifications = $this->chatModel->getUsersNotificationNotViewedFromChat($chat_message_id);
|
||||
|
||||
103
ci4/app/Controllers/Configuracion/FestivoController.php
Normal file
103
ci4/app/Controllers/Configuracion/FestivoController.php
Normal file
@ -0,0 +1,103 @@
|
||||
<?php
|
||||
|
||||
namespace App\Controllers\Configuracion;
|
||||
|
||||
use App\Controllers\BaseController;
|
||||
use App\Controllers\BaseResourceController;
|
||||
use App\Entities\Configuracion\FestivoEntity;
|
||||
use App\Models\Collection;
|
||||
|
||||
use App\Entities\Configuracion\Imposicion;
|
||||
use App\Models\Configuracion\FestivoModel;
|
||||
use App\Models\Configuracion\ImposicionEsquemaModel;
|
||||
use App\Models\Configuracion\ImposicionModel;
|
||||
use CodeIgniter\HTTP\RequestInterface;
|
||||
use CodeIgniter\HTTP\ResponseInterface;
|
||||
use CodeIgniter\Validation\Validation;
|
||||
use Hermawan\DataTables\DataTable;
|
||||
use Psr\Log\LoggerInterface;
|
||||
|
||||
class FestivoController extends BaseController
|
||||
{
|
||||
|
||||
protected $modelName = FestivoModel::class;
|
||||
protected FestivoModel $model;
|
||||
protected static $controllerSlug = 'festivos';
|
||||
protected $format = 'json';
|
||||
|
||||
protected string $viewPath = 'themes/vuexy/form/configuracion/festivos/';
|
||||
|
||||
protected $indexRoute = 'festivoList';
|
||||
protected array $viewData = [];
|
||||
protected Validation $validation;
|
||||
|
||||
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
|
||||
{
|
||||
$this->viewData['pageTitle'] = lang('Festivos.moduleTitle');
|
||||
$this->viewData['usingSweetAlert'] = true;
|
||||
$this->model = model($this->modelName);
|
||||
$this->validation = service("validation");
|
||||
parent::initController($request, $response, $logger);
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
return view($this->viewPath . $this->indexRoute);
|
||||
}
|
||||
|
||||
public function store_festivo_date()
|
||||
{
|
||||
$bodyData = $this->request->getPost();
|
||||
$date = $bodyData['date'];
|
||||
$count = $this->model->where('date',$date)->countAllResults();
|
||||
if ($count) {
|
||||
$status = $this->model->where('date', $date)->delete(purge: true);
|
||||
return $this->response->setJSON([
|
||||
"message" => lang("App.user_alert_delete"),
|
||||
"status" => $status,
|
||||
]);
|
||||
} else {
|
||||
|
||||
$status = $this->model->insert($bodyData);
|
||||
if ($status) {
|
||||
$festivoEntity = $this->model->find($status);
|
||||
return $this->response->setJSON([
|
||||
"message" => lang("App.global_alert_save_success"),
|
||||
"status" => $status,
|
||||
"data" => $festivoEntity
|
||||
]);
|
||||
} else {
|
||||
return $this->response->setJSON([
|
||||
"message" => lang("App.global_alert_save_error"),
|
||||
"errors" => $this->model->errors(),
|
||||
"status" => true
|
||||
])->setStatusCode(400);
|
||||
}
|
||||
}
|
||||
}
|
||||
public function delete_festivo_date($id)
|
||||
{
|
||||
$status = $this->model->delete($id, true);
|
||||
if ($status) {
|
||||
return $this->response->setJSON([
|
||||
"message" => lang("App.user_alert_delete"),
|
||||
"status" => $status,
|
||||
]);
|
||||
} else {
|
||||
return $this->response->setJSON([
|
||||
"message" => lang("App.global_alert_save_error"),
|
||||
"errors" => $this->model->errors(),
|
||||
"status" => true
|
||||
])->setStatusCode(400);
|
||||
}
|
||||
}
|
||||
public function find_all()
|
||||
{
|
||||
$festivos = $this->model->findAll();
|
||||
return $this->response->setJSON([
|
||||
"message" => lang("App.global_alert_fetch_success"),
|
||||
"status" => true,
|
||||
"data" => $festivos
|
||||
]);
|
||||
}
|
||||
}
|
||||
@ -1,4 +1,6 @@
|
||||
<?php namespace App\Controllers\Configuracion;
|
||||
<?php
|
||||
|
||||
namespace App\Controllers\Configuracion;
|
||||
|
||||
use App\Entities\Usuarios\UserEntity;
|
||||
use App\Models\Chat\ChatDeparmentModel;
|
||||
@ -54,7 +56,6 @@ class Users extends \App\Controllers\GoBaseController
|
||||
];
|
||||
|
||||
parent::initController($request, $response, $logger);
|
||||
|
||||
}
|
||||
|
||||
public function index()
|
||||
@ -87,7 +88,7 @@ class Users extends \App\Controllers\GoBaseController
|
||||
|
||||
// Marcar el username como NULL
|
||||
$sanitizedData = $this->sanitized($postData, true);
|
||||
|
||||
|
||||
$noException = true;
|
||||
|
||||
// Obtener proveedor de usuarios
|
||||
@ -118,11 +119,10 @@ class Users extends \App\Controllers\GoBaseController
|
||||
|
||||
} // Email is not unique!
|
||||
else {
|
||||
$this->viewData['errorMessage'] = "El correo '". $sanitizedData['email'] ."' ya está registrado en el sistema";
|
||||
$this->viewData['errorMessage'] = "El correo '" . $sanitizedData['email'] . "' ya está registrado en el sistema";
|
||||
$this->session->setFlashdata('formErrors', $this->model->errors());
|
||||
$successfulResult = false; // Hacked
|
||||
}
|
||||
|
||||
} catch (\Exception $e) {
|
||||
$noException = false;
|
||||
$this->viewData['errorMessage'] = $e->getMessage();
|
||||
@ -234,7 +234,6 @@ class Users extends \App\Controllers\GoBaseController
|
||||
} else {
|
||||
$successfulResult = $this->model->skipValidation(true)->update($id, $sanitizedData);
|
||||
}
|
||||
|
||||
} catch (\Exception $e) {
|
||||
$noException = false;
|
||||
$this->dealWithException($e);
|
||||
@ -319,8 +318,6 @@ class Users extends \App\Controllers\GoBaseController
|
||||
|
||||
$message = "Usuario eliminado correctamente";
|
||||
return $this->redirect2listView('successMessage', $message);
|
||||
|
||||
|
||||
} // end function delete(...)
|
||||
|
||||
|
||||
@ -374,9 +371,10 @@ class Users extends \App\Controllers\GoBaseController
|
||||
}
|
||||
}
|
||||
|
||||
public function datatable(){
|
||||
public function datatable()
|
||||
{
|
||||
|
||||
if($this->request->isAJAX()){
|
||||
if ($this->request->isAJAX()) {
|
||||
|
||||
$reqData = $this->request->getPost();
|
||||
if (!isset($reqData['draw']) || !isset($reqData['columns'])) {
|
||||
@ -405,7 +403,6 @@ class Users extends \App\Controllers\GoBaseController
|
||||
$this->model->getResource([])->countAllResults(),
|
||||
$this->model->getResource($searchValues)->countAllResults()
|
||||
));
|
||||
|
||||
} else {
|
||||
return $this->failUnauthorized('Invalid request', 403);
|
||||
}
|
||||
@ -447,4 +444,27 @@ class Users extends \App\Controllers\GoBaseController
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function index_maquinista_change_user()
|
||||
{
|
||||
$this->viewData['breadcrumb'] = [
|
||||
['title' => lang("App.menu_change_session"), 'route' => route_to('maquinistaUserChangeList'), 'active' => true]
|
||||
];
|
||||
$maquinistas = [];
|
||||
$users = auth()->getProvider()->whereNotIn('id',[auth()->user()->id])->findAll();
|
||||
foreach ($users as $key => $user) {
|
||||
if ($user->inGroup('maquina') && !$user->inGroup('admin', 'comercial', 'cliente-editor', 'cliente-admin')) {
|
||||
$maquinistas[] = $user;
|
||||
}
|
||||
}
|
||||
$this->viewData['maquinistas'] = $maquinistas;
|
||||
return view('/themes/vuexy/form/produccion/maquinista/viewMaquinistaCambioUserList.php', $this->viewData);
|
||||
}
|
||||
public function change_user_session(int $user_id)
|
||||
{
|
||||
// Check the credentials
|
||||
$user = auth()->getProvider()->findById($user_id);
|
||||
auth()->logout();
|
||||
auth()->login($user);
|
||||
return redirect("home");
|
||||
}
|
||||
}
|
||||
|
||||
396
ci4/app/Controllers/Importadores/ImportadorBubok.php
Normal file
396
ci4/app/Controllers/Importadores/ImportadorBubok.php
Normal file
@ -0,0 +1,396 @@
|
||||
<?php
|
||||
namespace App\Controllers\Importadores;
|
||||
|
||||
use App\Controllers\BaseResourceController;
|
||||
use App\Controllers\Presupuestos\Presupuestocliente;
|
||||
use App\Services\PresupuestoService;
|
||||
|
||||
class ImportadorBubok extends BaseResourceController
|
||||
{
|
||||
|
||||
protected $format = 'json';
|
||||
|
||||
protected static $singularObjectName = 'Importador';
|
||||
protected static $singularObjectNameCc = 'ImportadorBubok';
|
||||
protected static $pluralObjectName = 'Importadores';
|
||||
protected static $pluralObjectNameCc = 'importadores';
|
||||
|
||||
protected static $controllerSlug = 'importador';
|
||||
|
||||
protected static $viewPath = 'themes/vuexy/form/importador/bubok/';
|
||||
|
||||
protected $indexRoute = 'ImportadorBubokTool';
|
||||
|
||||
|
||||
public function initController(\CodeIgniter\HTTP\RequestInterface $request, \CodeIgniter\HTTP\ResponseInterface $response, \Psr\Log\LoggerInterface $logger)
|
||||
{
|
||||
$this->viewData['pageTitle'] = lang('Importador.listingPage');
|
||||
$this->viewData['usingSweetAlert'] = true;
|
||||
|
||||
// Breadcrumbs (IMN)
|
||||
$this->viewData['breadcrumb'] = [
|
||||
['title' => lang("App.menu_importadores"), 'route' => "javascript:void(0);", 'active' => false],
|
||||
['title' => lang("App.menu_importadores_bubok"), 'route' => route_to('importadorBubokTool'), 'active' => true]
|
||||
];
|
||||
|
||||
parent::initController($request, $response, $logger);
|
||||
}
|
||||
|
||||
|
||||
public function index()
|
||||
{
|
||||
|
||||
$viewData = [
|
||||
'pageSubTitle' => lang('Basic.global.ManageAllRecords', [lang('Importador.importadorCatalogoTitle')]),
|
||||
|
||||
];
|
||||
|
||||
$viewData = array_merge($this->viewData, $viewData); // merge any possible values from the parent controller class
|
||||
|
||||
return view(static::$viewPath . 'viewImportadorBubokTool', $viewData);
|
||||
}
|
||||
|
||||
|
||||
public function importarFila()
|
||||
{
|
||||
$json = $this->request->getJSON();
|
||||
|
||||
// Validación mínima de datos comunes
|
||||
$pedido = $json->pedido ?? null;
|
||||
if (!$pedido || !isset($pedido->orderNumber)) {
|
||||
return $this->respond([
|
||||
'status' => 400,
|
||||
'message' => 'Datos comunes del pedido ausentes o inválidos.'
|
||||
]);
|
||||
}
|
||||
|
||||
// Validación mínima de existencia del producto en la linea
|
||||
if (!$json || !isset($json->producto)) {
|
||||
return $this->respond([
|
||||
'status' => 400,
|
||||
'message' => 'Producto no proporcionado o inválido.'
|
||||
]);
|
||||
}
|
||||
$producto = $json->producto;
|
||||
|
||||
// 1. Datos básicos:
|
||||
// Referencia del cliente
|
||||
$orderNumber = $pedido->orderNumber ?? null;
|
||||
$productId = $producto->id ?? null;
|
||||
if (is_null($orderNumber) || is_null($productId)) {
|
||||
return $this->respond([
|
||||
'status' => 400,
|
||||
'message' => 'Número de orden o ID del producto no reconocidos.'
|
||||
]);
|
||||
}
|
||||
$refCliente = "$orderNumber - $productId";
|
||||
|
||||
// Titulo
|
||||
$titulo = $producto->title ?? null;
|
||||
if (is_null($titulo)) {
|
||||
return $this->respond([
|
||||
'status' => 400,
|
||||
'message' => 'Título del libro no reconocido.'
|
||||
]);
|
||||
}
|
||||
|
||||
// Validación de páginas y tirada
|
||||
$paginas = isset($producto->body->pages) ? (int) $producto->body->pages : 0;
|
||||
$tirada = isset($producto->amount) ? (int) $producto->amount : 0;
|
||||
if ($paginas <= 0 || $tirada <= 0) {
|
||||
$errores = [];
|
||||
if ($paginas <= 0) {
|
||||
$errores[] = 'Número de páginas inválido.';
|
||||
}
|
||||
if ($tirada <= 0) {
|
||||
$errores[] = 'Tirada inválida.';
|
||||
}
|
||||
|
||||
return $this->respond([
|
||||
'status' => 400,
|
||||
'message' => implode(' ', $errores)
|
||||
]);
|
||||
}
|
||||
|
||||
// Ancho y alto
|
||||
$ancho = null;
|
||||
$alto = null;
|
||||
foreach ($producto->size as $key => $val) {
|
||||
if ($val == 1) {
|
||||
// ejemplo: size170x235
|
||||
$size = str_replace('size', '', $key);
|
||||
[$ancho, $alto] = explode('x', $size);
|
||||
$ancho = (int) $ancho;
|
||||
$alto = (int) $alto;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!$ancho || !$alto) {
|
||||
return $this->respond([
|
||||
'status' => 400,
|
||||
'message' => 'Tamaño del libro no reconocido.'
|
||||
]);
|
||||
}
|
||||
|
||||
/*$numGuardaPages = 4;
|
||||
$hasGuarda = !empty($producto->cover->guarda);
|
||||
if ($hasGuarda)
|
||||
$paginas += $numGuardaPages;*/
|
||||
|
||||
// 2. Interior: color o negro
|
||||
// Determinar tipo de impresión interior
|
||||
$interiorTipo = null;
|
||||
if (isset($producto->body->color->CMYK) && $producto->body->color->CMYK == '1') {
|
||||
$interiorTipo = 'color';
|
||||
} elseif (isset($producto->body->color->Monochrome) && $producto->body->color->Monochrome == '1') {
|
||||
$interiorTipo = 'negro';
|
||||
} elseif (isset($producto->body->color->Semicolor) && $producto->body->color->Semicolor == '1') {
|
||||
return $this->respond([
|
||||
'status' => 400,
|
||||
'message' => 'Tipo de impresión "Semicolor" no soportado.'
|
||||
]);
|
||||
}
|
||||
|
||||
if (is_null($interiorTipo)) {
|
||||
return $this->respond([
|
||||
'status' => 400,
|
||||
'message' => 'No se pudo determinar si el interior es en color o blanco y negro.'
|
||||
]);
|
||||
}
|
||||
|
||||
// Determinar tipo de papel interior
|
||||
$papelInteriorId = null;
|
||||
if (isset($producto->body->paperColor->white) && $producto->body->paperColor->white == '1') {
|
||||
$papelInteriorId = 3; // Offset blanco 'OFF1'
|
||||
} elseif (isset($producto->body->paperColor->cream) && $producto->body->paperColor->cream == '1') {
|
||||
$papelInteriorId = 4; // Offset ahuesado 'OFF2'
|
||||
} else {
|
||||
return $this->respond([
|
||||
'status' => 400,
|
||||
'message' => 'Tipo de papel interior no definido.'
|
||||
]);
|
||||
}
|
||||
|
||||
// Determinar el gramaje del papel
|
||||
$gramajePapelInterior = null;
|
||||
foreach ($producto->body->paperWeight as $key => $val) {
|
||||
if ($val == 1) {
|
||||
$gramajePapelInterior = (int) str_replace(['weight', 'gr'], '', $key);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!$gramajePapelInterior) {
|
||||
return $this->respond([
|
||||
'status' => 400,
|
||||
'message' => 'Gramaje del papel no válido.'
|
||||
]);
|
||||
}
|
||||
|
||||
// 3. Encuadernación
|
||||
// Tapa dura
|
||||
$tapaDura = isset($producto->cover->type->tapadura) && $producto->cover->type->tapadura == '1';
|
||||
|
||||
// Solapas
|
||||
$solapas = isset($producto->cover->type->consolapas) && $producto->cover->type->consolapas == '1';
|
||||
|
||||
// Doble cara (a veces se activa con tapa dura) una cara => 2; dos caras => 4
|
||||
$doscara = false;
|
||||
|
||||
// Tipo de encuadernado
|
||||
$encuadernadoId = null;
|
||||
|
||||
if (isset($producto->cover->coverType->SoftCover) && $producto->cover->coverType->SoftCover == '1') {
|
||||
if ($tapaDura) {
|
||||
$encuadernadoId = 1; // Libro fresado tapa dura
|
||||
$doscara = true;
|
||||
} else {
|
||||
$encuadernadoId = 2; // Libro fresado tapa blanda
|
||||
}
|
||||
} elseif (isset($producto->cover->coverType->SaddleStitch) && $producto->cover->coverType->SaddleStitch == '1') {
|
||||
if ($tapaDura) {
|
||||
$encuadernadoId = 3; // Libro cosido tapa dura
|
||||
$doscara = true;
|
||||
} else {
|
||||
$encuadernadoId = $solapas ? 20 : 4; // Libro cosido tapa blanda (solapas) : (sin solapas)
|
||||
}
|
||||
} elseif (isset($producto->cover->coverType->CoilBinding) && $producto->cover->coverType->CoilBinding == '1') {
|
||||
if ($tapaDura) {
|
||||
$encuadernadoId = 5; // Libro espiral tapa dura
|
||||
$doscara = true;
|
||||
} else {
|
||||
$encuadernadoId = 6; // Libro espiral tapa blanda
|
||||
}
|
||||
}
|
||||
if (!$encuadernadoId) {
|
||||
return $this->respond([
|
||||
'status' => 400,
|
||||
'message' => 'Tipo de encuadernación no identificado.'
|
||||
]);
|
||||
}
|
||||
|
||||
// Determinar el acabado de la cubierta
|
||||
$acabadoId = null;
|
||||
if (isset($producto->cover->acabado->brillo) && $producto->cover->acabado->brillo == '1') {
|
||||
$acabadoId = 1; // Plastificado brillo 1/c
|
||||
} elseif (isset($producto->cover->acabado->mate) && $producto->cover->acabado->mate == '1') {
|
||||
$acabadoId = 2; // Plastificado mate 1/c
|
||||
} else {
|
||||
return $this->respond([
|
||||
'status' => 400,
|
||||
'message' => 'Tipo de acabado de cubierta no definido.'
|
||||
]);
|
||||
}
|
||||
|
||||
// 4. ENVÍO: recuperamos la primera dirección del cliente BUBOK (ID 40)
|
||||
$clienteDireccionModel = model('App\Models\Clientes\ClienteDireccionesModel');
|
||||
$direccionCliente = $clienteDireccionModel
|
||||
->where('cliente_id', 40)
|
||||
->orderBy('id', 'asc')
|
||||
->first();
|
||||
|
||||
if (!$direccionCliente) {
|
||||
return $this->respond([
|
||||
'status' => 400,
|
||||
'message' => 'El cliente Bubok no tiene direcciones asociadas.'
|
||||
]);
|
||||
}
|
||||
|
||||
$direcciones = [
|
||||
[
|
||||
'direccion' => [
|
||||
'id' => (int) $direccionCliente->id,
|
||||
'cliente_id' => (int) $direccionCliente->cliente_id,
|
||||
'cliente_nombre' => $direccionCliente->clienteNombre,
|
||||
'att' => $direccionCliente->persona_contacto ?? '',
|
||||
'alias' => $direccionCliente->alias ?? '',
|
||||
'email' => $direccionCliente->email ?? '',
|
||||
'direccion' => $direccionCliente->direccion,
|
||||
'pais_id' => (int) $direccionCliente->pais_id,
|
||||
'pais' => $direccionCliente->paisNombre,
|
||||
'municipio' => $direccionCliente->municipio,
|
||||
'provincia' => $direccionCliente->provincia,
|
||||
'cp' => $direccionCliente->cp,
|
||||
'telefono' => $direccionCliente->telefono,
|
||||
],
|
||||
'unidades' => $tirada,
|
||||
'entregaPalets' => false
|
||||
]
|
||||
];
|
||||
|
||||
// Generamos el objeto a importar
|
||||
$dataToImport = [
|
||||
'selectedTirada' => $tirada,
|
||||
'datosCabecera' => [
|
||||
'titulo' => $titulo,
|
||||
'autor' => null,
|
||||
'isbn' => null,
|
||||
'coleccion' => null,
|
||||
'referenciaCliente' => $refCliente
|
||||
],
|
||||
'tirada' => [$tirada],
|
||||
'tamanio' => [
|
||||
'ancho' => $ancho,
|
||||
'alto' => $alto
|
||||
],
|
||||
'tipo' => '',
|
||||
'tipo_presupuesto_id' => $encuadernadoId,
|
||||
'clienteId' => 40, // BUBOK ID
|
||||
'isColor' => ($interiorTipo === 'color') ? 1 : 0,
|
||||
'isHq' => 0,
|
||||
'paginas' => $paginas,
|
||||
'paginasColor' => ($interiorTipo === 'color') ? $paginas : 0,
|
||||
'paginasCuadernillo' => 32,
|
||||
'interior' => [
|
||||
'papelInterior' => $papelInteriorId,
|
||||
'gramajeInterior' => $gramajePapelInterior
|
||||
],
|
||||
'cubierta' => [
|
||||
'papelCubierta' => 2, // 'EST2'
|
||||
'carasCubierta' => $doscara ? 2 : 4,
|
||||
'gramajeCubierta' => in_array($encuadernadoId, [1, 3]) ? 150 : 300, // 150 gramos para "fresado tapa dura" y "cosido tapa dura"
|
||||
'solapas' => !empty($producto->cover->type->consolapas) ? 80 : 0,
|
||||
'acabado' => $acabadoId,
|
||||
'cabezada' => 'WHI',
|
||||
'lomoRedondo' => 0
|
||||
],
|
||||
'guardas' => [],
|
||||
'sobrecubierta' => [],
|
||||
'faja' => null,
|
||||
|
||||
'entrega_taller' => 1,
|
||||
//'direcciones' => $direcciones, las direcciones que aparecen no se añaden, ya que la recogida la hacen ellos con su empresa de mensajeria
|
||||
|
||||
'ivaReducido' => 1,
|
||||
];
|
||||
|
||||
/*return $this->respond([
|
||||
'status' => 400,
|
||||
'message' => $dataToImport
|
||||
]);*/
|
||||
|
||||
// 5. Guardar
|
||||
try {
|
||||
$presupuestocliente = new Presupuestocliente();
|
||||
$response = $presupuestocliente->guardar($dataToImport);
|
||||
|
||||
// Guardar la URL de la portada y el cuerpo en los comentarios del presupuesto
|
||||
$presupuestoModel = model('App\Models\Presupuestos\PresupuestoModel');
|
||||
$presupuestoModel->update($response['sk_id'], [
|
||||
'comentarios_safekat' => 'URL COVER: ' . $producto->cover->file . "\nURL BODY: " . $producto->body->file,
|
||||
]);
|
||||
|
||||
|
||||
// Ajuste del precio
|
||||
$precio_compra = $json->producto->prices->unitPrice ?? null;
|
||||
if ($precio_compra != null && $precio_compra > 0) {
|
||||
|
||||
$respuesta_ajuste = PresupuestoService::ajustarPresupuesto(
|
||||
$response['sk_id'],
|
||||
$precio_compra,
|
||||
$tirada,
|
||||
null,
|
||||
true
|
||||
);
|
||||
if ($respuesta_ajuste['warning'] == true) {
|
||||
$response['price_warning'] = [
|
||||
'new_precio_unidad' => $respuesta_ajuste['new_precio_unidad'],
|
||||
'new_total' => $respuesta_ajuste['new_total'],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
// confirmar y crear pedido y ot
|
||||
$presupuestoModel->confirmarPresupuesto($response['sk_id']);
|
||||
PresupuestoService::crearPedido($response['sk_id']);
|
||||
|
||||
|
||||
if (!isset($response['sk_id'])) {
|
||||
return $this->respond([
|
||||
'status' => 400,
|
||||
'error' => 'Missing sk_id',
|
||||
'message' => 'No se pudo crear el presupuesto.'
|
||||
], 400);
|
||||
}
|
||||
|
||||
return $this->respond([
|
||||
'status' => 200,
|
||||
'data' => [
|
||||
'sk_id' => $response['sk_id'],
|
||||
'sk_url' => $response['sk_url'] ?? null
|
||||
]
|
||||
]);
|
||||
|
||||
} catch (\Throwable $e) {
|
||||
return $this->respond([
|
||||
'status' => 500,
|
||||
'error' => 'Server error',
|
||||
'message' => 'Error inesperado',
|
||||
'debug' => $e->getMessage()
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
322
ci4/app/Controllers/Importadores/ImportadorCatalogo.php
Normal file
322
ci4/app/Controllers/Importadores/ImportadorCatalogo.php
Normal file
@ -0,0 +1,322 @@
|
||||
<?php
|
||||
namespace App\Controllers\Importadores;
|
||||
|
||||
use App\Controllers\BaseResourceController;
|
||||
use App\Entities\Catalogo\CatalogoLibroEntity;
|
||||
use App\Models\Catalogo\CatalogoLibroModel;
|
||||
use App\Controllers\Presupuestos\Presupuestocliente;
|
||||
use App\Services\PresupuestoService;
|
||||
|
||||
class ImportadorCatalogo extends BaseResourceController
|
||||
{
|
||||
|
||||
protected $modelName = CatalogoLibroModel::class;
|
||||
protected $format = 'json';
|
||||
|
||||
protected static $singularObjectName = 'Importador';
|
||||
protected static $singularObjectNameCc = 'ImportadorCatalogo';
|
||||
protected static $pluralObjectName = 'Importadores';
|
||||
protected static $pluralObjectNameCc = 'importadores';
|
||||
|
||||
protected static $controllerSlug = 'importador';
|
||||
|
||||
protected static $viewPath = 'themes/vuexy/form/importador/catalogo/';
|
||||
|
||||
protected $indexRoute = 'ImportadorCatalogoTool';
|
||||
|
||||
|
||||
public function initController(\CodeIgniter\HTTP\RequestInterface $request, \CodeIgniter\HTTP\ResponseInterface $response, \Psr\Log\LoggerInterface $logger)
|
||||
{
|
||||
$this->viewData['pageTitle'] = lang('Importador.listingPage');
|
||||
$this->viewData['usingSweetAlert'] = true;
|
||||
|
||||
// Breadcrumbs (IMN)
|
||||
$this->viewData['breadcrumb'] = [
|
||||
['title' => lang("App.menu_importadores"), 'route' => "javascript:void(0);", 'active' => false],
|
||||
['title' => lang("App.menu_importadores_catalogo"), 'route' => route_to('importadorCatalogoTool'), 'active' => true]
|
||||
];
|
||||
|
||||
parent::initController($request, $response, $logger);
|
||||
}
|
||||
|
||||
|
||||
public function index()
|
||||
{
|
||||
|
||||
$viewData = [
|
||||
'pageSubTitle' => lang('Basic.global.ManageAllRecords', [lang('Importador.importadorCatalogoTitle')]),
|
||||
|
||||
];
|
||||
|
||||
$viewData = array_merge($this->viewData, $viewData); // merge any possible values from the parent controller class
|
||||
|
||||
return view(static::$viewPath . 'viewImportadorCatalogoTool', $viewData);
|
||||
}
|
||||
|
||||
|
||||
public function validarFila()
|
||||
{
|
||||
$json = $this->request->getJSON();
|
||||
|
||||
if (!$json || !isset($json->fila[0])) {
|
||||
return $this->response->setJSON([
|
||||
'apto' => false,
|
||||
'reason' => 'Datos inválidos'
|
||||
]);
|
||||
}
|
||||
|
||||
$input = trim($json->fila[0]); // Asumimos que 'input' es el primer campo de la fila
|
||||
|
||||
if (empty($input)) {
|
||||
return $this->response->setJSON([
|
||||
'apto' => false,
|
||||
'reason' => 'ISBN no proporiconado'
|
||||
]);
|
||||
}
|
||||
|
||||
$catalogoModel = new CatalogoLibroModel();
|
||||
|
||||
// 1. Buscar por ISBN exacto
|
||||
$libroPorIsbn = $catalogoModel->where('isbn', $input)->first();
|
||||
|
||||
if ($libroPorIsbn) {
|
||||
return $this->response->setJSON([
|
||||
'apto' => true
|
||||
]);
|
||||
}
|
||||
|
||||
// 2. Buscar por EAN sin guiones
|
||||
$eanLimpio = str_replace('-', '', $input);
|
||||
|
||||
$libroPorEan = $catalogoModel->where('REPLACE(ean, "-", "")', $eanLimpio)->first();
|
||||
|
||||
if ($libroPorEan) {
|
||||
return $this->response->setJSON([
|
||||
'apto' => true
|
||||
]);
|
||||
}
|
||||
|
||||
// No encontrado
|
||||
return $this->response->setJSON([
|
||||
'apto' => false,
|
||||
'reason' => 'No encontrado en catálogo'
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function importarFila()
|
||||
{
|
||||
$json = $this->request->getJSON();
|
||||
|
||||
if (!$json || !isset($json->fila[0])) {
|
||||
return $this->response->setJSON([
|
||||
'success' => false,
|
||||
'message' => 'Datos inválidos.'
|
||||
]);
|
||||
}
|
||||
|
||||
// Mapear cada columna a una variable
|
||||
$isbn = isset($json->fila[0]) ? trim($json->fila[0]) : null;
|
||||
$refCliente = isset($json->fila[1]) ? trim($json->fila[1]) : null;
|
||||
//$descripcion = isset($json->fila[2]) ? trim($json->fila[2]) : null;
|
||||
$tirada = isset($json->fila[3]) ? (float) $json->fila[3] : null;
|
||||
$precio_compra = isset($json->fila[4]) ? (float) $json->fila[4] : null;
|
||||
|
||||
if (empty($isbn)) {
|
||||
return $this->response->setJSON([
|
||||
'success' => false,
|
||||
'message' => 'Input vacío o no proporcionado.'
|
||||
]);
|
||||
}
|
||||
|
||||
$catalogoModel = new CatalogoLibroModel();
|
||||
|
||||
// 1. Buscar por ISBN exacto
|
||||
$libro = $catalogoModel->where('isbn', $isbn)->first();
|
||||
|
||||
// 2. Si no, buscar por EAN sin guiones
|
||||
if (!$libro) {
|
||||
$eanLimpio = str_replace('-', '', $isbn);
|
||||
|
||||
$libro = $catalogoModel->where('REPLACE(ean, "-", "")', $eanLimpio)->first();
|
||||
}
|
||||
|
||||
if (!$libro) {
|
||||
return $this->response->setJSON([
|
||||
'success' => false,
|
||||
'message' => 'No se encontró el libro en el catálogo.'
|
||||
]);
|
||||
}
|
||||
|
||||
// Aquí ya tenemos el libro correcto.
|
||||
// Ahora se prepara la "inserción" o el "registro" a importar
|
||||
// Variables intermedias
|
||||
$colorPaginas = (int) ($libro->color_paginas ?? 0);
|
||||
$negroPaginas = (int) ($libro->negro_paginas ?? 0);
|
||||
$papelInteriorDiferente = ($colorPaginas > 0 && $negroPaginas > 0) ? 1 : 0;
|
||||
|
||||
// --- Interior (lo que cambiamos ahora)
|
||||
if ($papelInteriorDiferente) {
|
||||
// Mixto: páginas en negro + color
|
||||
$interior = [
|
||||
'papelInterior' => [
|
||||
'negro' => $libro->negro_papel_id,
|
||||
'color' => $libro->color_papel_id,
|
||||
],
|
||||
'gramajeInterior' => [
|
||||
'negro' => $libro->negro_gramaje,
|
||||
'color' => $libro->color_gramaje,
|
||||
]
|
||||
];
|
||||
} else {
|
||||
// SOLO un tipo: negro O color
|
||||
$colorPaginas = (int) ($libro->color_paginas ?? 0);
|
||||
$negroPaginas = (int) ($libro->negro_paginas ?? 0);
|
||||
|
||||
if ($colorPaginas > 0 && $negroPaginas == 0) {
|
||||
// Libro completamente en color
|
||||
$interior = [
|
||||
'papelInterior' => $libro->color_papel_id,
|
||||
'gramajeInterior' => $libro->color_gramaje,
|
||||
];
|
||||
} else {
|
||||
// Libro completamente en blanco y negro
|
||||
$interior = [
|
||||
'papelInterior' => $libro->negro_papel_id,
|
||||
'gramajeInterior' => $libro->negro_gramaje,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
// Sobrecubierta
|
||||
$sobrecubierta = [];
|
||||
if (!is_null($libro->sobrecubierta_paginas)) {
|
||||
$sobrecubierta['papel'] = $libro->sobrecubierta_papel_id;
|
||||
$sobrecubierta['gramaje'] = $libro->sobrecubierta_gramaje;
|
||||
$sobrecubierta['solapas'] = $libro->sobrecubierta_solapas;
|
||||
$sobrecubierta['acabado'] = $libro->sobrecubierta_acabado_id;
|
||||
}
|
||||
|
||||
|
||||
$dataToImport = [
|
||||
'selectedTirada' => $tirada,
|
||||
'datosCabecera' => [
|
||||
'titulo' => $libro->titulo,
|
||||
'autor' => $libro->autor,
|
||||
'isbn' => $isbn,
|
||||
'coleccion' => $libro->coleccion,
|
||||
'referenciaCliente' => $refCliente
|
||||
],
|
||||
'tirada' => array_values(array_filter([
|
||||
$tirada,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
])),
|
||||
'tamanio' => [
|
||||
'ancho' => $libro->ancho,
|
||||
'alto' => $libro->alto
|
||||
],
|
||||
'tipo' => "",
|
||||
'tipo_presupuesto_id' => $libro->encuadernacion_id,
|
||||
'clienteId' => 251,
|
||||
'isColor' => (in_array(strtolower($libro->tipo_impresion), ['color', 'colorhq']) ? 1 : 0),
|
||||
'isHq' => (in_array(strtolower($libro->tipo_impresion), ['negrohq', 'colorhq']) ? 1 : 0),
|
||||
'paginas' => $libro->paginas,
|
||||
'paginasColor' => $colorPaginas,
|
||||
'papelInteriorDiferente' => $papelInteriorDiferente,
|
||||
'paginasCuadernillo' => 32,
|
||||
|
||||
'interior' => $interior,
|
||||
|
||||
'cubierta' => [
|
||||
'papelCubierta' => $libro->cubierta_papel_id,
|
||||
'gramajeCubierta' => $libro->cubierta_gramaje,
|
||||
'solapas' => $libro->cubierta_ancho_solapas,
|
||||
'acabado' => $libro->cubierta_acabado_id,
|
||||
'cabezada' => 'WHI',
|
||||
'lomoRedondo' => 0
|
||||
],
|
||||
|
||||
'ivaReducido' => 1,
|
||||
|
||||
'guardas' => [],
|
||||
'sobrecubierta' => $sobrecubierta,
|
||||
//'faja' => null,
|
||||
|
||||
'entrega_taller' => 1,
|
||||
];
|
||||
|
||||
/*return $this->response->setJSON([
|
||||
'success' => true,
|
||||
'message' => 'Libro encontrado y preparado para importar.',
|
||||
'data' => $dataToImport
|
||||
]);*/
|
||||
|
||||
|
||||
// Procedemos a intentar guardar el presupuesto
|
||||
// Instancia de presupuesto cliente
|
||||
$presupuestocliente = new Presupuestocliente();
|
||||
try {
|
||||
$response = $presupuestocliente->guardar($dataToImport);
|
||||
|
||||
// DEBUG LINE
|
||||
//return $this->respond($response);
|
||||
|
||||
if (!isset($response['sk_id'])) {
|
||||
return $this->respond([
|
||||
'status' => 400,
|
||||
'error' => 'Missing sk_id',
|
||||
'message' => 'El identificador sk_id es requerido pero no se recibió.'
|
||||
], 400);
|
||||
}
|
||||
|
||||
$response = [
|
||||
'status' => 200,
|
||||
'error' => null,
|
||||
'data' => [
|
||||
'sk_id' => $response['sk_id'],
|
||||
'sk_url' => $response['sk_url'] ?? null
|
||||
]
|
||||
];
|
||||
|
||||
|
||||
// Ajuste del precio a RAMA
|
||||
$respuesta_ajuste = PresupuestoService::ajustarPresupuesto(
|
||||
$response['data']['sk_id'],
|
||||
$precio_compra,
|
||||
$tirada,
|
||||
null,
|
||||
true
|
||||
);
|
||||
if ($respuesta_ajuste['warning'] == true) {
|
||||
$response['price_warning'] = [
|
||||
'new_precio_unidad' => $respuesta_ajuste['new_precio_unidad'],
|
||||
'new_total' => $respuesta_ajuste['new_total'],
|
||||
];
|
||||
}
|
||||
|
||||
// confirmar y crear pedido y ot
|
||||
model('App\Models\Presupuestos\PresupuestoModel')->confirmarPresupuesto($response['data']['sk_id']);
|
||||
PresupuestoService::crearPedido($response['data']['sk_id']);
|
||||
|
||||
return $this->respond($response);
|
||||
|
||||
} catch (\Exception $e) {
|
||||
|
||||
return $this->respond([
|
||||
'status' => 500,
|
||||
'error' => 'Server error',
|
||||
'message' => 'Error inesperado durante el procesado',
|
||||
'debug' => $e->getMessage()
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -62,6 +62,7 @@ class LogisticaController extends BaseController
|
||||
'currentModule' => static::$controllerSlug,
|
||||
'boxTitle' => lang('Logistica.gestionEnvios'),
|
||||
'usingServerSideDataTable' => true,
|
||||
'tipo_envio' => 'estandar',
|
||||
];
|
||||
|
||||
$viewData = array_merge($this->viewData, $viewData); // merge any possible values from the parent controller class
|
||||
@ -70,11 +71,44 @@ class LogisticaController extends BaseController
|
||||
}
|
||||
|
||||
|
||||
public function findPedidosNewEnvio()
|
||||
public function gestionEnviosFerros()
|
||||
{
|
||||
$viewData = [
|
||||
'currentModule' => static::$controllerSlug,
|
||||
'boxTitle' => lang('Logistica.envioFerros'),
|
||||
'usingServerSideDataTable' => true,
|
||||
'tipo_envio' => 'ferro_prototipo',
|
||||
];
|
||||
|
||||
$viewData = array_merge($this->viewData, $viewData); // merge any possible values from the parent controller class
|
||||
|
||||
return view(static::$viewPath . 'viewLogisticaSelectEnvios', $viewData);
|
||||
}
|
||||
|
||||
public function listAlbaranes(){
|
||||
$viewData = [
|
||||
'currentModule' => static::$controllerSlug,
|
||||
'boxTitle' => lang('Albaran.albaranes'),
|
||||
'usingServerSideDataTable' => true,
|
||||
];
|
||||
|
||||
$viewData = array_merge($this->viewData, $viewData); // merge any possible values from the parent controller class
|
||||
|
||||
return view(static::$viewPath . '/albaranes/viewAlbaranesList', $viewData);
|
||||
}
|
||||
|
||||
public function findForNewEnvio()
|
||||
{
|
||||
|
||||
if ($this->request->isAJAX()) {
|
||||
$query = LogisticaService::findPedidosNewEnvio();
|
||||
|
||||
$tipo_envio = $this->request->getGet('tipo_envio') ?? 'estandar';
|
||||
|
||||
if($tipo_envio == 'ferro_prototipo'){
|
||||
$query = LogisticaService::findForNewEnvioFerro();
|
||||
} else {
|
||||
$query = LogisticaService::findForNewEnvio();
|
||||
}
|
||||
if ($this->request->getGet("q")) {
|
||||
$query->groupStart()
|
||||
->orLike("id", $this->request->getGet("q"))
|
||||
@ -94,12 +128,12 @@ class LogisticaController extends BaseController
|
||||
public function selectDireccionForEnvio(){
|
||||
|
||||
if ($this->request->isAJAX()) {
|
||||
$pedido_id = $this->request->getGet('pedido_id');
|
||||
if($pedido_id == null || $pedido_id == 0){
|
||||
$ot = $this->request->getGet('ot_id');
|
||||
if($ot == null || $ot == 0){
|
||||
return [];
|
||||
}
|
||||
$searchVal = $this->request->getGet("q") ?? "";
|
||||
$result = LogisticaService::findDireccionesNewEnvio($pedido_id, $searchVal);
|
||||
$result = LogisticaService::findDireccionesNewEnvio($ot, $searchVal);
|
||||
|
||||
return $this->response->setJSON($result);
|
||||
} else {
|
||||
@ -109,34 +143,91 @@ class LogisticaController extends BaseController
|
||||
|
||||
|
||||
|
||||
public function searchPedidoOrISBN($search = "", $envio_id = null)
|
||||
{
|
||||
|
||||
if (empty($search)) {
|
||||
$result = [
|
||||
'status' => false,
|
||||
'message' => lang('Logistica.errors.noDataToFind'),
|
||||
];
|
||||
return $this->response->setJSON($result);
|
||||
}
|
||||
$result = LogisticaService::findPedidoOrISBN($search);
|
||||
return $this->response->setJSON($result);
|
||||
}
|
||||
|
||||
|
||||
public function generarEnvio()
|
||||
{
|
||||
if ($this->request->isAJAX()) {
|
||||
|
||||
$pedido_id = $this->request->getPost('pedido_id');
|
||||
$direccion = $this->request->getPost('direccion');
|
||||
$result = LogisticaService::generateEnvio($pedido_id, $direccion);
|
||||
$ot_id = $this->request->getPost('ot_id');
|
||||
$direccion = $this->request->getPost('direccion') ?? "";
|
||||
$result = LogisticaService::generateEnvio($ot_id, $direccion);
|
||||
return $this->response->setJSON($result);
|
||||
} else {
|
||||
return $this->failUnauthorized('Invalid request', 403);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function generarEnvioFerro()
|
||||
{
|
||||
if ($this->request->isAJAX()) {
|
||||
|
||||
$ot_id = $this->request->getPost('ot_id');
|
||||
$result = LogisticaService::generateEnvioFerro($ot_id);
|
||||
return $this->response->setJSON($result);
|
||||
} else {
|
||||
return $this->failUnauthorized('Invalid request', 403);
|
||||
}
|
||||
}
|
||||
|
||||
public function imprimirEtiquetas()
|
||||
{
|
||||
if ($this->request->isAJAX()) {
|
||||
$envio_id = $this->request->getPost('envio_id');
|
||||
$ids = $this->request->getPost('envio_lineas');
|
||||
$cajas = $this->request->getPost('cajas');
|
||||
$printer_id = $this->request->getPost('printer_id');
|
||||
|
||||
if($cajas == null || $cajas == 0){
|
||||
return $this->response->setJSON([
|
||||
'status' => false,
|
||||
'message' => 'Cajas no válidas'
|
||||
]);
|
||||
}
|
||||
|
||||
$model = model('App\Models\Logistica\EnvioModel');
|
||||
$envio = $model->select('envios.*, clientes.nombre as cliente')
|
||||
->join('clientes', 'clientes.id = envios.cliente_id', 'left')
|
||||
->where('envios.id', $envio_id)
|
||||
->first();
|
||||
if($envio == null){
|
||||
return $this->response->setJSON([
|
||||
'status' => false,
|
||||
'message' => 'Envio no válido'
|
||||
]);
|
||||
}
|
||||
|
||||
$model = model('App\Models\Logistica\EnvioLineaModel');
|
||||
$lineas = $model->select('envios_lineas.*, presupuestos.titulo as titulo, presupuestos.referencia_cliente as referencia_cliente')
|
||||
->join('presupuestos', 'presupuestos.id = envios_lineas.presupuesto_id', 'left')
|
||||
->whereIn('envios_lineas.id', $ids)->findAll();
|
||||
if($lineas == null){
|
||||
return $this->response->setJSON([
|
||||
'status' => false,
|
||||
'message' => 'Lineas no válidas'
|
||||
]);
|
||||
}
|
||||
|
||||
$modelImpresora = model('App\Models\Configuracion\ImpresoraEtiquetaModel');
|
||||
$impresora = $modelImpresora->select('id, name, ip, port, user, pass')
|
||||
->where('deleted_at', null)
|
||||
->where('id', $printer_id)
|
||||
->orderBy('name', 'asc')
|
||||
->first();
|
||||
if($impresora == null){
|
||||
return $this->response->setJSON([
|
||||
'status' => false,
|
||||
'message' => 'Impresora no válida'
|
||||
]);
|
||||
}
|
||||
|
||||
$response = LogisticaService::generateEtiquetasTitulos($envio, $lineas, $impresora, $cajas);
|
||||
return $this->response->setJSON($response);
|
||||
|
||||
} else {
|
||||
return $this->failUnauthorized('Invalid request', 403);
|
||||
}
|
||||
}
|
||||
|
||||
public function selectAddEnvioLinea()
|
||||
{
|
||||
|
||||
@ -176,8 +267,18 @@ class LogisticaController extends BaseController
|
||||
|
||||
public function datatable_envios()
|
||||
{
|
||||
|
||||
$otsFilter = $this->request->getGetPost('otsFilter');
|
||||
$tipo_envio = $this->request->getGetPost('tipo_envio') ?? 'estandar';
|
||||
|
||||
$model = model('App\Models\Logistica\EnvioModel');
|
||||
$q = $model->getDatatableQuery();
|
||||
$q = $model->getDatatableQuery($tipo_envio);
|
||||
|
||||
if (!empty($otsFilter)) {
|
||||
$q->groupStart();
|
||||
$q->like('t5.id', $otsFilter);
|
||||
$q->groupEnd();
|
||||
}
|
||||
|
||||
|
||||
$result = DataTable::of($q)
|
||||
@ -227,6 +328,14 @@ class LogisticaController extends BaseController
|
||||
$envioEntity->proveedor_nombre = $proveedor->nombre;
|
||||
}
|
||||
|
||||
$modelImpresora = model('App\Models\Configuracion\ImpresoraEtiquetaModel');
|
||||
$impresoras = $modelImpresora->select('id, name')
|
||||
->where('deleted_at', null)
|
||||
->where('tipo', 1)
|
||||
->orderBy('name', 'asc')
|
||||
->findAll();
|
||||
$envioEntity->impresoras = $impresoras;
|
||||
|
||||
$viewData = [
|
||||
'currentModule' => static::$controllerSlug,
|
||||
'boxTitle' => '<i class="ti ti-truck ti-xl"></i>' . ' ' . lang('Logistica.envio') . ' [' . $envioEntity->id . ']: ' . $envioEntity->direccion,
|
||||
@ -298,7 +407,7 @@ class LogisticaController extends BaseController
|
||||
)->edit(
|
||||
"unidadesEnvio",
|
||||
function ($row, $meta) {
|
||||
if($row->finalizado == 1){
|
||||
if($row->finalizado == 1 || $row->tipo_envio == 'ferro_prototipo'){
|
||||
return $row->unidadesEnvio;
|
||||
}
|
||||
return '<input type="number" class="form-control input-lineas input-unidades text-center"
|
||||
|
||||
@ -993,6 +993,8 @@ class Presupuestoadmin extends \App\Controllers\BaseResourceController
|
||||
|
||||
$reqData = $this->request->getPost();
|
||||
|
||||
$calcular_merma = $reqData['calcular_merma'] ?? 0;
|
||||
|
||||
$type = $reqData['type'] ?? null;
|
||||
// por defecto, se deja cosido tapa blanda por ahora JJO
|
||||
$tipo_impresion_id = $reqData['tipo_impresion_id'] ?? 4;
|
||||
@ -1071,8 +1073,27 @@ class Presupuestoadmin extends \App\Controllers\BaseResourceController
|
||||
'a_favor_fibra' => $a_favor_fibra
|
||||
);
|
||||
|
||||
|
||||
$resourceData = PresupuestoService::obtenerComparadorPlana($input_data);
|
||||
|
||||
if($calcular_merma == 1 && count($resourceData) > 0 &&
|
||||
count($resourceData[0]['fields']) >0 && $resourceData[0]['fields']['num_formas'] > 0) {
|
||||
|
||||
usort($resourceData, function ($a, $b) {
|
||||
return $b['fields']['total_impresion'] <=> $a['fields']['total_impresion'];
|
||||
});
|
||||
|
||||
$num_formas = [];
|
||||
$formas_linea = $datosPedido->isCosido ? intval($resourceData[0]['fields']['num_formas']['value']) / 2 :
|
||||
intval($resourceData[0]['fields']['num_formas']['value']);
|
||||
array_push($num_formas, $formas_linea);
|
||||
|
||||
$POD = $this->getPOD();
|
||||
$datosPedido->merma = PresupuestoService::calcular_merma($datosPedido->tirada,$POD, $num_formas);
|
||||
|
||||
$resourceData = PresupuestoService::obtenerComparadorPlana($input_data);
|
||||
}
|
||||
|
||||
} else if ($type == 'interior_rot') {
|
||||
|
||||
$paginas = (object) array(
|
||||
@ -1105,6 +1126,24 @@ class Presupuestoadmin extends \App\Controllers\BaseResourceController
|
||||
|
||||
$resourceData = PresupuestoService::obtenerComparadorRotativa($input_data);
|
||||
|
||||
if($calcular_merma == 1 && count($resourceData) > 0 &&
|
||||
count($resourceData[0]['fields']) >0 && $resourceData[0]['fields']['num_formas'] > 0) {
|
||||
|
||||
usort($resourceData, function ($a, $b) {
|
||||
return $b['fields']['total_impresion'] <=> $a['fields']['total_impresion'];
|
||||
});
|
||||
|
||||
$num_formas = [];
|
||||
$formas_linea = $datosPedido->isCosido ? intval($resourceData[0]['fields']['num_formas']['value']) / 2 :
|
||||
intval($resourceData[0]['fields']['num_formas']['value']);
|
||||
array_push($num_formas, $formas_linea);
|
||||
|
||||
$POD = $this->getPOD();
|
||||
$datosPedido->merma = PresupuestoService::calcular_merma($datosPedido->tirada,$POD, $num_formas);
|
||||
|
||||
$resourceData = PresupuestoService::obtenerComparadorRotativa($input_data);
|
||||
}
|
||||
|
||||
} else if ($type == 'cubierta' || $type == 'sobrecubierta' || $type == 'faja') {
|
||||
|
||||
$datosPedido->solapas = $reqData['solapas'];
|
||||
|
||||
@ -323,17 +323,23 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
||||
$datosPedido = (object) array(
|
||||
'paginas' => $paginas,
|
||||
'tirada' => $tirada[0],
|
||||
'merma' => $this->calcular_merma($tirada[0], $POD),
|
||||
'merma' => PresupuestoService::calcular_merma($tirada[0], $POD),
|
||||
'ancho' => intval($tamanio['ancho']) ?? 100000,
|
||||
'alto' => intval($tamanio['alto']) ?? 100000,
|
||||
'isCosido' => $is_cosido,
|
||||
'a_favor_fibra' => 1,
|
||||
);
|
||||
|
||||
$cliente_model = model(('App\Models\Clientes\ClienteModel'));
|
||||
$cliente = $cliente_model->find($cliente_id);
|
||||
// Para POD siempre es HQ
|
||||
if ($tirada[0] <= $POD) {
|
||||
if ($tirada[0] <= $POD && !$cliente->forzar_rotativa_pod) {
|
||||
$isHq = true;
|
||||
}
|
||||
$forzarRotativa = false;
|
||||
if ($tirada[0] <= $POD && $cliente->forzar_rotativa_pod) {
|
||||
$forzarRotativa = true;
|
||||
}
|
||||
|
||||
$input_data = array(
|
||||
'uso' => 'interior',
|
||||
@ -346,7 +352,8 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
||||
'cliente_id' => $cliente_id,
|
||||
'paginas_color' => $paginas_color,
|
||||
'excluirRotativa' => $excluirRotativa,
|
||||
'papelInteriorDiferente' => $papelInteriorDiferente
|
||||
'papelInteriorDiferente' => $papelInteriorDiferente,
|
||||
'forzarRotativa' => $forzarRotativa,
|
||||
);
|
||||
|
||||
$interior = PresupuestoClienteService::obtenerInterior($input_data);
|
||||
@ -460,6 +467,7 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
||||
$id = $reqData['id'] ?? 0;
|
||||
|
||||
$cliente_id = $reqData['clienteId'] ?? -1;
|
||||
$noEnvioBase = model('App\Models\Clientes\ClienteModel')->find($cliente_id)->no_envio_base ?? false;
|
||||
|
||||
$tirada = $reqData['tirada'] ?? 0;
|
||||
$selectedTirada = $reqData['selectedTirada'] ?? -1;
|
||||
@ -609,6 +617,10 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
||||
} else {
|
||||
$coste = floatval($coste_direccion->coste);
|
||||
$margen = $coste * (intval($coste_direccion->margen) / 100.0);
|
||||
if ($noEnvioBase) {
|
||||
$coste = 0.0;
|
||||
$margen = 0.0;
|
||||
}
|
||||
$return_data['eb'][$i] = round($coste + $margen, 2);
|
||||
}
|
||||
}
|
||||
@ -739,17 +751,23 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
||||
$datosPedido = (object) array(
|
||||
'paginas' => $paginas,
|
||||
'tirada' => $tirada[0],
|
||||
'merma' => $tirada[0] > $POD ? $this->calcular_merma($tirada[0], $POD) : 0,
|
||||
'merma' => $tirada[0] > $POD ? PresupuestoService::calcular_merma($tirada[0], $POD) : 0,
|
||||
'ancho' => intval($tamanio['ancho']) ?? 100000,
|
||||
'alto' => intval($tamanio['alto']) ?? 100000,
|
||||
'isCosido' => $is_cosido,
|
||||
'a_favor_fibra' => 1,
|
||||
);
|
||||
|
||||
$cliente_model = model(('App\Models\Clientes\ClienteModel'));
|
||||
$cliente = $cliente_model->find($cliente_id);
|
||||
// Para POD siempre es HQ
|
||||
if ($tirada[0] <= $POD) {
|
||||
if ($tirada[0] <= $POD && !$cliente->forzar_rotativa_pod) {
|
||||
$isHq = true;
|
||||
}
|
||||
$forzarRotativa = false;
|
||||
if ($tirada[0] <= $POD && $cliente->forzar_rotativa_pod) {
|
||||
$forzarRotativa = true;
|
||||
}
|
||||
|
||||
$input_data = array(
|
||||
'uso' => 'interior',
|
||||
@ -762,7 +780,8 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
||||
'cliente_id' => $cliente_id,
|
||||
'paginas_color' => $paginas_color,
|
||||
'excluirRotativa' => $excluirRotativa,
|
||||
'papelInteriorDiferente' => $papelInteriorDiferente
|
||||
'papelInteriorDiferente' => $papelInteriorDiferente,
|
||||
'forzarRotativa' => $forzarRotativa,
|
||||
);
|
||||
|
||||
$interior = PresupuestoClienteService::obtenerInterior($input_data);
|
||||
@ -1126,6 +1145,7 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
||||
$peso_libro = $resultado_presupuesto['peso'][array_search($selected_tirada, $tirada)];
|
||||
|
||||
// calculo del envio base (tirada_maxima)
|
||||
$noEnvioBase = model('App\Models\Clientes\ClienteModel')->find($cliente_id)->no_envio_base ?? false;
|
||||
$resultado_presupuesto['eb'] = [];
|
||||
$datos_presupuesto['envio_base'] = 0;
|
||||
for ($i = 0; $i < count($tirada); $i++) {
|
||||
@ -1139,6 +1159,10 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
||||
);
|
||||
|
||||
if (intval($selected_tirada) == intval($tirada[$i])) {
|
||||
if ($noEnvioBase) {
|
||||
$coste_direccion->coste = 0.0;
|
||||
$coste_direccion->margen = 0.0;
|
||||
}
|
||||
$datos_presupuesto['envio_base'] = round($coste_direccion->coste * (1 + $coste_direccion->margen / 100.0), 2);
|
||||
}
|
||||
|
||||
@ -1160,6 +1184,10 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
||||
];
|
||||
return $resultado_presupuesto;
|
||||
} else {
|
||||
if ($noEnvioBase) {
|
||||
$coste_direccion->coste = 0.0;
|
||||
$coste_direccion->margen = 0.0;
|
||||
}
|
||||
$resultado_presupuesto['eb'][$i] = round($coste_direccion->coste, 2);
|
||||
$resultado_presupuesto['eb_margen'][$i] = round($coste_direccion->margen, 2);
|
||||
}
|
||||
@ -1176,10 +1204,10 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
||||
for ($i = 0; $i < count($tirada); $i++) {
|
||||
$coste_envio = 0.0;
|
||||
$coste_envio += ($resultado_presupuesto['eb'][$i] / $tirada[$i]);
|
||||
$resultado_presupuesto['info']['totales'][$i]['envio_base_margen'] =
|
||||
floatval($resultado_presupuesto['eb'][$i])*(floatval($resultado_presupuesto['eb_margen'][$i])/100.0);
|
||||
$resultado_presupuesto['info']['totales'][$i]['envio_base_margen'] =
|
||||
floatval($resultado_presupuesto['eb'][$i]) * (floatval($resultado_presupuesto['eb_margen'][$i]) / 100.0);
|
||||
$resultado_presupuesto['info']['totales'][$i]['envio_base_coste'] = $resultado_presupuesto['eb'][$i];
|
||||
|
||||
|
||||
$resultado_presupuesto['precio_u'][$i] = round(floatval($resultado_presupuesto['precio_u'][$i]) + $coste_envio, 4);
|
||||
}
|
||||
|
||||
@ -1312,7 +1340,7 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
||||
$datos_presupuesto['entrega_taller'] = $reqData['entrega_taller'] ?? 0;
|
||||
|
||||
|
||||
$resultado_presupuesto['info']['merma'] = $this->calcular_merma($selected_tirada, $POD);
|
||||
$resultado_presupuesto['info']['merma'] = PresupuestoService::calcular_merma($selected_tirada, $POD);
|
||||
|
||||
$datos_presupuesto['faja'] = $faja;
|
||||
|
||||
@ -1357,7 +1385,11 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
||||
foreach ($serviciosAcabado as $service) {
|
||||
$model = model('App\Models\Presupuestos\PresupuestoAcabadosModel');
|
||||
$servicio = $model->getPrecioTarifa(
|
||||
intval($service), intval($selected_tirada)+$resultado_presupuesto['info']['merma'], -1, $POD);
|
||||
intval($service),
|
||||
intval($selected_tirada) + $resultado_presupuesto['info']['merma'],
|
||||
-1,
|
||||
$POD
|
||||
);
|
||||
|
||||
if (count($servicio) > 0) {
|
||||
if ($servicio[0]->total > 0) {
|
||||
@ -1375,8 +1407,11 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
||||
foreach ($serviciosAcabado as $service) {
|
||||
$model = model('App\Models\Presupuestos\PresupuestoAcabadosModel');
|
||||
$servicio = $model->getPrecioTarifa(
|
||||
intval($service),
|
||||
intval($selected_tirada) + $resultado_presupuesto['info']['merma'], -1, $POD);
|
||||
intval($service),
|
||||
intval($selected_tirada) + $resultado_presupuesto['info']['merma'],
|
||||
-1,
|
||||
$POD
|
||||
);
|
||||
|
||||
if (count($servicio) > 0) {
|
||||
if ($servicio[0]->total > 0) {
|
||||
@ -1393,8 +1428,11 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
||||
foreach ($serviciosAcabado as $service) {
|
||||
$model = model('App\Models\Presupuestos\PresupuestoAcabadosModel');
|
||||
$servicio = $model->getPrecioTarifa(
|
||||
intval($service),
|
||||
intval($selected_tirada) + $resultado_presupuesto['info']['merma'], -1, $POD);
|
||||
intval($service),
|
||||
intval($selected_tirada) + $resultado_presupuesto['info']['merma'],
|
||||
-1,
|
||||
$POD
|
||||
);
|
||||
|
||||
if (count($servicio) > 0) {
|
||||
if ($servicio[0]->total > 0) {
|
||||
@ -1407,7 +1445,7 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
||||
$tarifa_id = model('App\Models\Configuracion\ConfigVariableModel')->getVariable('id_servicio_lomo_redondo')->value;
|
||||
$serv_lomo = PresupuestoCLienteService::getServiciosManipulado([
|
||||
'tarifa_id' => intval($tarifa_id),
|
||||
'tirada' => $selected_tirada+$resultado_presupuesto['info']['merma'],
|
||||
'tirada' => $selected_tirada + $resultado_presupuesto['info']['merma'],
|
||||
'POD' => $POD,
|
||||
])[0];
|
||||
|
||||
@ -2029,7 +2067,7 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
||||
$datosPedido = (object) array(
|
||||
'paginas' => $paginas,
|
||||
'tirada' => $tirada[$t],
|
||||
'merma' => $this->calcular_merma($tirada[$t], $POD),
|
||||
'merma' => PresupuestoService::calcular_merma($tirada[$t], $POD),
|
||||
'ancho' => intval($tamanio['ancho']) ?? 100000,
|
||||
'alto' => intval($tamanio['alto']) ?? 100000,
|
||||
'isCosido' => $is_cosido,
|
||||
@ -2039,10 +2077,16 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
||||
$info['merma'] = $datosPedido->merma;
|
||||
}
|
||||
|
||||
$cliente_model = model(('App\Models\Clientes\ClienteModel'));
|
||||
$cliente = $cliente_model->find($cliente_id);
|
||||
// Para POD siempre es HQ
|
||||
if ($tirada[$t] <= $POD) {
|
||||
if ($tirada[$t] <= $POD && !$cliente->forzar_rotativa_pod) {
|
||||
$isHq = true;
|
||||
}
|
||||
$forzarRotativa = false;
|
||||
if ($tirada[$t] <= $POD && $cliente->forzar_rotativa_pod) {
|
||||
$forzarRotativa = true;
|
||||
}
|
||||
|
||||
$input_data = array(
|
||||
'uso' => 'interior',
|
||||
@ -2055,7 +2099,8 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
||||
'cliente_id' => $cliente_id,
|
||||
'paginas_color' => $paginas_color,
|
||||
'excluirRotativa' => $excluirRotativa,
|
||||
'papelInteriorDiferente' => $papelInteriorDiferente
|
||||
'papelInteriorDiferente' => $papelInteriorDiferente,
|
||||
'forzarRotativa' => $forzarRotativa,
|
||||
);
|
||||
|
||||
$interior = PresupuestoClienteService::obtenerInterior($input_data);
|
||||
@ -2107,7 +2152,7 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
||||
array_push($num_formas, $formas_linea);
|
||||
}
|
||||
}
|
||||
$input_data['datosPedido']->merma = $this->calcular_merma($tirada[$t], $POD, $num_formas);
|
||||
$input_data['datosPedido']->merma = PresupuestoService::calcular_merma($tirada[$t], $POD, $num_formas);
|
||||
if ($extra_info) {
|
||||
$info['merma'] = max($info['merma'], $input_data['datosPedido']->merma);
|
||||
}
|
||||
@ -3071,7 +3116,7 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
||||
$sumForFactor += round($linea['precio_pedido'], 2)
|
||||
- round($linea['margen_papel_pedido'], 2);
|
||||
$margenPapel += round($linea['margen_papel_pedido'], 2);
|
||||
|
||||
|
||||
$totalImpresion += round($linea['precio_click_pedido'], 2);
|
||||
$totalImpresion -= round($linea['margen_click_pedido'], 2);
|
||||
$sumForFactor += round($linea['precio_click_pedido'], 2)
|
||||
@ -3142,31 +3187,6 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected function calcular_merma($tirada, $POD, $formas_lineas_interior = [])
|
||||
{
|
||||
|
||||
$merma = 0;
|
||||
|
||||
if ($tirada > $POD) {
|
||||
$merma = $tirada * 0.1;
|
||||
} else {
|
||||
$merma_lineas = [];
|
||||
foreach ($formas_lineas_interior as $formas_linea) {
|
||||
if ($formas_linea > $tirada)
|
||||
array_push($merma_lineas, $formas_linea - $tirada);
|
||||
else
|
||||
array_push($merma_lineas, $tirada % $formas_linea);
|
||||
}
|
||||
if (count($merma_lineas) > 0)
|
||||
$merma = max($merma_lineas);
|
||||
}
|
||||
|
||||
|
||||
return round($merma, 0);
|
||||
}
|
||||
|
||||
|
||||
protected function getPapelFormatoListItems($selId = null)
|
||||
{
|
||||
$papelFormatoModel = model('App\Models\Configuracion\PapelFormatoModel');
|
||||
|
||||
@ -54,6 +54,7 @@ class Presupuestodirecciones extends \App\Controllers\BaseResourceController
|
||||
$proveedor = $reqData['proveedor'] ?? "";
|
||||
$proveedor_id = $reqData['proveedor_id'] ?? "";
|
||||
$entregaPieCalle = $reqData['entregaPieCalle'] ?? 0;
|
||||
$is_ferro_prototipo = $reqData['is_ferro_prototipo'] ?? 0;
|
||||
|
||||
$data = [
|
||||
"presupuesto_id" => $presupuesto_id,
|
||||
@ -73,6 +74,7 @@ class Presupuestodirecciones extends \App\Controllers\BaseResourceController
|
||||
"proveedor" => $proveedor,
|
||||
"proveedor_id" => $proveedor_id,
|
||||
"entregaPieCalle" => $entregaPieCalle,
|
||||
"is_ferro_prototipo" => $is_ferro_prototipo
|
||||
];
|
||||
$response = $this->model->insert($data);
|
||||
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
namespace App\Controllers\Produccion;
|
||||
|
||||
use App\Controllers\BaseController;
|
||||
use App\Models\Compras\ProveedorModel;
|
||||
use App\Models\Configuracion\MaquinaModel;
|
||||
use App\Models\OrdenTrabajo\OrdenTrabajoModel;
|
||||
use App\Models\OrdenTrabajo\OrdenTrabajoTarea;
|
||||
@ -28,6 +29,7 @@ class Ordentrabajo extends BaseController
|
||||
protected OrdenTrabajoModel $otModel;
|
||||
protected OrdenTrabajoUser $otUserModel;
|
||||
protected OrdenTrabajoTarea $otTarea;
|
||||
protected ProveedorModel $proveedorModel;
|
||||
protected MaquinaModel $maquinaModel;
|
||||
protected UserModel $userModel;
|
||||
protected Validation $validation;
|
||||
@ -45,6 +47,7 @@ class Ordentrabajo extends BaseController
|
||||
$this->produccionService = new ProductionService();
|
||||
$this->otTarea = model(OrdenTrabajoTarea::class);
|
||||
$this->maquinaModel = model(MaquinaModel::class);
|
||||
$this->proveedorModel = model(ProveedorModel::class);
|
||||
$this->validation = service("validation");
|
||||
helper("time");
|
||||
parent::initController($request, $response, $logger);
|
||||
@ -70,6 +73,11 @@ class Ordentrabajo extends BaseController
|
||||
}
|
||||
|
||||
|
||||
public function find_tarea($orden_trabajo_tarea_id)
|
||||
{
|
||||
$t = $this->otTarea->find($orden_trabajo_tarea_id);
|
||||
return $this->response->setJSON($t);
|
||||
}
|
||||
public function get_orden_trabajo_summary($orden_trabajo_id)
|
||||
{
|
||||
try {
|
||||
@ -100,10 +108,22 @@ class Ordentrabajo extends BaseController
|
||||
public function update_orden_trabajo_tarea()
|
||||
{
|
||||
$bodyData = $this->request->getPost();
|
||||
// return $this->response->setJSON(["message" => lang("App.global_alert_save_success"), "data" => $bodyData]);
|
||||
$validated = $this->validation->run($bodyData, "orden_trabajo_tarea");
|
||||
if ($validated) {
|
||||
$r = $this->produccionService->updateOrdenTrabajoTarea($bodyData["orden_trabajo_tarea_id"], $bodyData);
|
||||
$tareaEntity = $this->otTarea->find($bodyData["orden_trabajo_tarea_id"]);
|
||||
return $this->response->setJSON(["message" => lang("App.global_alert_save_success"), "status" => $r, "data" => $tareaEntity]);
|
||||
} else {
|
||||
return $this->response->setJSON(["errors" => $this->validation->getErrors()])->setStatusCode(400);
|
||||
}
|
||||
}
|
||||
public function update_orden_trabajo_pliegos()
|
||||
{
|
||||
$bodyData = $this->request->getPost();
|
||||
// return $this->response->setJSON(["message" => lang("App.global_alert_save_success"), "data" => $bodyData]);
|
||||
$validated = $this->validation->run($bodyData, "orden_trabajo");
|
||||
if ($validated) {
|
||||
$r = $this->produccionService->init($bodyData["orden_trabajo_id"])->updateOrdenTrabajoTareaPliegos($bodyData);
|
||||
return $this->response->setJSON(["message" => lang("App.global_alert_save_success"), "status" => $r, "data" => $bodyData]);
|
||||
} else {
|
||||
return $this->response->setJSON(["errors" => $this->validation->getErrors()])->setStatusCode(400);
|
||||
@ -121,6 +141,18 @@ class Ordentrabajo extends BaseController
|
||||
return $this->response->setJSON(["errors" => $this->validation->getErrors()])->setStatusCode(400);
|
||||
}
|
||||
}
|
||||
public function update_presupuesto_tarea_proveedor(){
|
||||
$bodyData = $this->request->getPost();
|
||||
$validated = $this->validation->run($bodyData, "proveedor_tarea");
|
||||
if ($validated) {
|
||||
$validatedData = $this->validation->getValidated();
|
||||
$r = $this->produccionService->updateProveedorLinea($validatedData['orden_trabajo_tarea_id'], $validatedData['proveedor_id']);
|
||||
return $this->response->setJSON(["message" => lang("App.global_alert_save_success"), "status" => $r]);
|
||||
} else {
|
||||
return $this->response->setJSON(["errors" => $this->validation->getErrors()])->setStatusCode(400);
|
||||
}
|
||||
|
||||
}
|
||||
public function reset_orden_trabajo_date()
|
||||
{
|
||||
$bodyData = $this->request->getPost();
|
||||
@ -128,7 +160,7 @@ class Ordentrabajo extends BaseController
|
||||
$validated = $this->validation->run($bodyData, "orden_trabajo_date");
|
||||
if ($validated) {
|
||||
$validatedData = $bodyData;
|
||||
$r = $this->produccionService->emptyOrdenTrabajoDate($validatedData['orden_trabajo_id'],$validatedData['name']);
|
||||
$r = $this->produccionService->emptyOrdenTrabajoDate($validatedData['orden_trabajo_id'], $validatedData['name']);
|
||||
return $this->response->setJSON(["message" => lang("App.global_alert_save_success"), "status" => $r, "user" => auth()->user(), "data" => $bodyData]);
|
||||
} else {
|
||||
return $this->response->setJSON(["errors" => $this->validation->getErrors()])->setStatusCode(400);
|
||||
@ -225,7 +257,7 @@ class Ordentrabajo extends BaseController
|
||||
{
|
||||
$logo = config(LogoImpresion::class);
|
||||
|
||||
$q = $this->otModel->getDatatableQuery()->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()])
|
||||
@ -240,7 +272,7 @@ class Ordentrabajo extends BaseController
|
||||
{
|
||||
$logo = config(LogoImpresion::class);
|
||||
|
||||
$q = $this->otModel->getDatatableQuery()->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()])
|
||||
@ -251,6 +283,62 @@ class Ordentrabajo extends BaseController
|
||||
->add("action", fn($q) => $q->id)
|
||||
->toJson(true);
|
||||
}
|
||||
public function datatable_news()
|
||||
{
|
||||
$logo = config(LogoImpresion::class);
|
||||
|
||||
$q = $this->otModel->getDatatableQuery();
|
||||
return DataTable::of($q)
|
||||
->add("logo", fn($q) => ["logo" => site_url($logo->get_logo_path($q->presupuesto_linea_tipo)), "imposicion" => $q->imposicion_name, "color" => $this->produccionService->init($q->id)->getOtColorStatus()])
|
||||
->edit(
|
||||
"fecha_encuadernado_at",
|
||||
fn($q) => $q->fecha_encuadernado_at ? Time::createFromFormat("Y-m-d H:i:s", $q->fecha_encuadernado_at)->format("d/m/Y") : ""
|
||||
)
|
||||
->add("action", fn($q) => $q->id)
|
||||
->toJson(true);
|
||||
}
|
||||
public function datatable_prod()
|
||||
{
|
||||
$logo = config(LogoImpresion::class);
|
||||
|
||||
$q = $this->otModel->getDatatableQuery()->where('presupuestos.ferro',1)->where("ferro_ok_at is NOT NULL", NULL, FALSE);
|
||||
return DataTable::of($q)
|
||||
->add("logo", fn($q) => ["logo" => site_url($logo->get_logo_path($q->presupuesto_linea_tipo)), "imposicion" => $q->imposicion_name, "color" => $this->produccionService->init($q->id)->getOtColorStatus()])
|
||||
->edit(
|
||||
"fecha_encuadernado_at",
|
||||
fn($q) => $q->fecha_encuadernado_at ? Time::createFromFormat("Y-m-d H:i:s", $q->fecha_encuadernado_at)->format("d/m/Y") : ""
|
||||
)
|
||||
->add("action", fn($q) => $q->id)
|
||||
->toJson(true);
|
||||
}
|
||||
public function datatable_waiting()
|
||||
{
|
||||
$logo = config(LogoImpresion::class);
|
||||
|
||||
$q = $this->otModel->getDatatableQuery()->where('ordenes_trabajo.is_pedido_espera',1);
|
||||
return DataTable::of($q)
|
||||
->add("logo", fn($q) => ["logo" => site_url($logo->get_logo_path($q->presupuesto_linea_tipo)), "imposicion" => $q->imposicion_name, "color" => $this->produccionService->init($q->id)->getOtColorStatus()])
|
||||
->edit(
|
||||
"fecha_encuadernado_at",
|
||||
fn($q) => $q->fecha_encuadernado_at ? Time::createFromFormat("Y-m-d H:i:s", $q->fecha_encuadernado_at)->format("d/m/Y") : ""
|
||||
)
|
||||
->add("action", fn($q) => $q->id)
|
||||
->toJson(true);
|
||||
}
|
||||
public function datatable_revision_com()
|
||||
{
|
||||
$logo = config(LogoImpresion::class);
|
||||
|
||||
$q = $this->otModel->getDatatableQuery()->where('presupuestos.ferro',1)->where("ferro_ok_at is NOT NULL", NULL, FALSE);
|
||||
return DataTable::of($q)
|
||||
->add("logo", fn($q) => ["logo" => site_url($logo->get_logo_path($q->presupuesto_linea_tipo)), "imposicion" => $q->imposicion_name, "color" => $this->produccionService->init($q->id)->getOtColorStatus()])
|
||||
->edit(
|
||||
"fecha_encuadernado_at",
|
||||
fn($q) => $q->fecha_encuadernado_at ? Time::createFromFormat("Y-m-d H:i:s", $q->fecha_encuadernado_at)->format("d/m/Y") : ""
|
||||
)
|
||||
->add("action", fn($q) => $q->id)
|
||||
->toJson(true);
|
||||
}
|
||||
public function papel_gramaje_datatable()
|
||||
{
|
||||
|
||||
@ -288,6 +376,7 @@ class Ordentrabajo extends BaseController
|
||||
->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("proveedor", fn($q) => $this->produccionService->getProveedorTarea($q->id))
|
||||
->edit("maquina_tarea", fn($q) => ["id" => $q->id, "maquina_id" => $q->maquina_tarea, "maquina_name" => $q->maquina_nombre])
|
||||
->add("imposicion", fn($q) => ["id" => $q->id, "imposicion_id" => $q->imposicion_id, "name" => $q->imposicion_name, "is_presupuesto_linea" => $q->presupuesto_linea_id ? true : false])
|
||||
->toJson(true);
|
||||
@ -296,6 +385,14 @@ class Ordentrabajo extends BaseController
|
||||
{
|
||||
return $this->produccionService->init($orden_trabajo_id)->getPdf();
|
||||
}
|
||||
public function get_ferro_pdf($orden_trabajo_id)
|
||||
{
|
||||
return $this->produccionService->init($orden_trabajo_id)->getFerroPdf();
|
||||
}
|
||||
public function get_prototipo_pdf($orden_trabajo_id)
|
||||
{
|
||||
return $this->produccionService->init($orden_trabajo_id)->getPrototipoPdf();
|
||||
}
|
||||
public function upload_orden_trabajo_portada()
|
||||
{
|
||||
try {
|
||||
@ -524,10 +621,10 @@ class Ordentrabajo extends BaseController
|
||||
{
|
||||
return view(static::$viewPath . '/maquinista/viewMaquinistaPlanningList', $this->viewData);
|
||||
}
|
||||
public function maquinista_maquina_tareas_datatable(string $content , int $maquina_id)
|
||||
public function maquinista_maquina_tareas_datatable(string $content, int $maquina_id)
|
||||
{
|
||||
$pm = $this->produccionService->getMaquinaImpresionTareasList($maquina_id);
|
||||
if($content == 'today'){
|
||||
if ($content == 'today') {
|
||||
$pm->like('pedidos.fecha_impresion', Time::now()->format('Y-m-d'));
|
||||
}
|
||||
return DataTable::of($pm)
|
||||
@ -544,8 +641,15 @@ class Ordentrabajo extends BaseController
|
||||
$validated = $this->validation->run($bodyData, "orden_trabajo_tarea_progress_date");
|
||||
// return $this->response->setJSON(["message" => lang("App.global_alert_save_success"), "data" => $this->validation->getValidated(),"errors" => $this->validation->getErrors()]);
|
||||
if ($validated) {
|
||||
$r = $this->produccionService->storeOrdenTrabajoTareaProgressDate($this->validation->getValidated());
|
||||
return $this->response->setJSON(["message" => lang("App.global_alert_save_success"), "status" => $r, "data" => $bodyData]);
|
||||
$validatedData = $this->validation->getValidated();
|
||||
$r = $this->produccionService->storeOrdenTrabajoTareaProgressDate($validatedData);
|
||||
$otTareaEntity = $this->otTarea->find($validatedData['ot_tarea_id']);
|
||||
$data = [
|
||||
"tiempo_trabajado" => float_seconds_to_hhmm_string($otTareaEntity->tiempo_trabajado()),
|
||||
"tarea" => $otTareaEntity,
|
||||
"estado" => $validatedData['estado'],
|
||||
];
|
||||
return $this->response->setJSON(["message" => lang("App.global_alert_save_success"), "status" => $r, "data" => $data]);
|
||||
} else {
|
||||
return $this->response->setJSON(["errors" => $this->validation->getErrors()])->setStatusCode(400);
|
||||
}
|
||||
@ -555,7 +659,6 @@ class Ordentrabajo extends BaseController
|
||||
}
|
||||
public function delete_orden_trabajo_progress_date(int $orden_trabajo_tarea_id)
|
||||
{
|
||||
|
||||
$status = $this->produccionService->deleteOrdenTrabajoTareaProgressDates($orden_trabajo_tarea_id);
|
||||
return $this->response->setJSON(["message" => lang("App.global_alert_save_success"), "status" => $status]);
|
||||
}
|
||||
@ -568,4 +671,22 @@ class Ordentrabajo extends BaseController
|
||||
];
|
||||
return $this->response->setJSON($data);
|
||||
}
|
||||
public function update_pod_pedido_dates($orden_trabajo_id)
|
||||
{
|
||||
|
||||
$this->produccionService->init($orden_trabajo_id);
|
||||
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{
|
||||
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 ]);
|
||||
}
|
||||
}
|
||||
|
||||
@ -11,76 +11,85 @@ class CreateCatalogoLibros extends Migration
|
||||
$this->db->query('SET foreign_key_checks = 0');
|
||||
|
||||
$this->forge->addField([
|
||||
'id' => ['type' => 'INT', 'constraint' => 10, 'unsigned' => true, 'auto_increment' => true],
|
||||
'cliente_id' => ['type' => 'INT', 'constraint' => 10, 'unsigned' => true, 'null' => true],
|
||||
'proveedor_id' => ['type' => 'INT', 'constraint' => 10, 'unsigned' => true, 'null' => true],
|
||||
'user_created_id' => ['type' => 'INT', 'constraint' => 10, 'unsigned' => true, 'default' => 1],
|
||||
'user_update_id' => ['type' => 'INT', 'constraint' => 10, 'unsigned' => true, 'default' => 1],
|
||||
'cubierta_archivo' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true],
|
||||
'cubierta_url' => ['type' => 'VARCHAR', 'constraint' => 500, 'null' => true],
|
||||
'ancho' => ['type' => 'DOUBLE', 'constraint' => '8,2'],
|
||||
'alto' => ['type' => 'DOUBLE', 'constraint' => '8,2'],
|
||||
'peso' => ['type' => 'DOUBLE', 'constraint' => '8,2', 'null' => true],
|
||||
'titulo' => ['type' => 'VARCHAR', 'constraint' => 300],
|
||||
'autor' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true],
|
||||
'autor_entidad' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true],
|
||||
'traductor' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true],
|
||||
'ilustrador' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true],
|
||||
'idioma' => ['type' => 'VARCHAR', 'constraint' => 3, 'default' => 'spa'],
|
||||
'num_edic' => ['type' => 'INT', 'default' => 1, 'null' => true],
|
||||
'fecha_disponibilidad' => ['type' => 'DATE', 'null' => true],
|
||||
'fecha_public' => ['type' => 'DATE', 'null' => true],
|
||||
'num_fotos' => ['type' => 'INT', 'default' => 0],
|
||||
'num_ilustr' => ['type' => 'INT', 'default' => 0],
|
||||
'num_ilustr_color' => ['type' => 'INT', 'default' => 0],
|
||||
'num_ilustr_bn' => ['type' => 'INT', 'default' => 0],
|
||||
'coleccion' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true],
|
||||
'isk' => ['type' => 'VARCHAR', 'constraint' => 64, 'null' => true],
|
||||
'isbn' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true],
|
||||
'ean' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true],
|
||||
'editorial' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true],
|
||||
'resumen' => ['type' => 'TEXT', 'null' => true],
|
||||
'resumen_breve' => ['type' => 'TEXT', 'null' => true],
|
||||
'sello' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true],
|
||||
'paginas' => ['type' => 'INT'],
|
||||
'tipo_impresion' => ['type' => 'ENUM', 'constraint' => ['negro','negrohq','color','colorhq'], 'null' => true],
|
||||
'comentarios' => ['type' => 'TEXT', 'null' => true],
|
||||
'negro_paginas' => ['type' => 'INT', 'null' => true],
|
||||
'negro_papel_id' => ['type' => 'INT', 'constraint' => 10, 'unsigned' => true, 'null' => true],
|
||||
'negro_gramaje' => ['type' => 'DOUBLE', 'null' => true],
|
||||
'negro_pod_papel_id' => ['type' => 'INT', 'constraint' => 10, 'unsigned' => true, 'null' => true],
|
||||
'negro_pod_gramaje' => ['type' => 'DOUBLE', 'null' => true],
|
||||
'color_paginas' => ['type' => 'INT', 'null' => true],
|
||||
'color_papel_id' => ['type' => 'INT', 'constraint' => 10, 'unsigned' => true, 'null' => true],
|
||||
'color_gramaje' => ['type' => 'DOUBLE', 'null' => true],
|
||||
'color_pod_papel_id' => ['type' => 'INT', 'constraint' => 10, 'unsigned' => true, 'null' => true],
|
||||
'color_pod_gramaje' => ['type' => 'DOUBLE', 'null' => true],
|
||||
'cubierta_paginas' => ['type' => 'INT', 'null' => true],
|
||||
'cubierta_papel_id' => ['type' => 'INT', 'constraint' => 10, 'unsigned' => true, 'null' => true],
|
||||
'cubierta_gramaje' => ['type' => 'DOUBLE', 'null' => true],
|
||||
'cubierta_acabado_id' => ['type' => 'INT', 'constraint' => 10, 'unsigned' => true, 'null' => true],
|
||||
'cubierta_ancho_solapas' => ['type' => 'DOUBLE', 'constraint' => '8,2', 'default' => 0.00, 'unsigned' => true],
|
||||
'cubierta_pod_papel_id' => ['type' => 'INT', 'constraint' => 10, 'unsigned' => true, 'null' => true],
|
||||
'cubierta_pod_gramaje' => ['type' => 'DOUBLE', 'null' => true],
|
||||
'sobrecubierta_paginas' => ['type' => 'INT', 'null' => true],
|
||||
'sobrecubierta_papel_id' => ['type' => 'INT', 'constraint' => 10, 'unsigned' => true, 'null' => true],
|
||||
'sobrecubierta_gramaje' => ['type' => 'DOUBLE', 'null' => true],
|
||||
'id' => ['type' => 'INT', 'constraint' => 10, 'unsigned' => true, 'auto_increment' => true],
|
||||
'cliente_id' => ['type' => 'INT', 'constraint' => 10, 'unsigned' => true, 'null' => true],
|
||||
'proveedor_id' => ['type' => 'INT', 'constraint' => 10, 'unsigned' => true, 'null' => true],
|
||||
'user_created_id' => ['type' => 'INT', 'constraint' => 10, 'unsigned' => true, 'default' => 1],
|
||||
'user_update_id' => ['type' => 'INT', 'constraint' => 10, 'unsigned' => true, 'default' => 1],
|
||||
'cubierta_archivo' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true],
|
||||
'cubierta_url' => ['type' => 'VARCHAR', 'constraint' => 500, 'null' => true],
|
||||
'ancho' => ['type' => 'DOUBLE', 'constraint' => '8,2'],
|
||||
'alto' => ['type' => 'DOUBLE', 'constraint' => '8,2'],
|
||||
'peso' => ['type' => 'DOUBLE', 'constraint' => '8,2', 'null' => true],
|
||||
'titulo' => ['type' => 'VARCHAR', 'constraint' => 300],
|
||||
'autor' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true],
|
||||
'autor_entidad' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true],
|
||||
'traductor' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true],
|
||||
'ilustrador' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true],
|
||||
'idioma' => ['type' => 'VARCHAR', 'constraint' => 3, 'default' => 'spa'],
|
||||
'num_edic' => ['type' => 'INT', 'default' => 1, 'null' => true],
|
||||
'fecha_disponibilidad' => ['type' => 'DATE', 'null' => true],
|
||||
'fecha_public' => ['type' => 'DATE', 'null' => true],
|
||||
'num_fotos' => ['type' => 'INT', 'default' => 0],
|
||||
'num_ilustr' => ['type' => 'INT', 'default' => 0],
|
||||
'num_ilustr_color' => ['type' => 'INT', 'default' => 0],
|
||||
'num_ilustr_bn' => ['type' => 'INT', 'default' => 0],
|
||||
'coleccion' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true],
|
||||
'isk' => ['type' => 'VARCHAR', 'constraint' => 64, 'null' => true],
|
||||
'isbn' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true],
|
||||
'ean' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true],
|
||||
'editorial' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true],
|
||||
'resumen' => ['type' => 'TEXT', 'null' => true],
|
||||
'resumen_breve' => ['type' => 'TEXT', 'null' => true],
|
||||
'sello' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true],
|
||||
'paginas' => ['type' => 'INT'],
|
||||
'tipo_impresion' => ['type' => 'ENUM', 'constraint' => ['negro', 'negrohq', 'color', 'colorhq'], 'null' => true],
|
||||
'comentarios' => ['type' => 'TEXT', 'null' => true],
|
||||
'negro_paginas' => ['type' => 'INT', 'null' => true],
|
||||
'negro_papel_id' => ['type' => 'INT', 'constraint' => 10, 'unsigned' => true, 'null' => true],
|
||||
'negro_gramaje' => ['type' => 'DOUBLE', 'null' => true],
|
||||
'negro_pod_papel_id' => ['type' => 'INT', 'constraint' => 10, 'unsigned' => true, 'null' => true],
|
||||
'negro_pod_gramaje' => ['type' => 'DOUBLE', 'null' => true],
|
||||
'color_paginas' => ['type' => 'INT', 'null' => true],
|
||||
'color_papel_id' => ['type' => 'INT', 'constraint' => 10, 'unsigned' => true, 'null' => true],
|
||||
'color_gramaje' => ['type' => 'DOUBLE', 'null' => true],
|
||||
'color_pod_papel_id' => ['type' => 'INT', 'constraint' => 10, 'unsigned' => true, 'null' => true],
|
||||
'color_pod_gramaje' => ['type' => 'DOUBLE', 'null' => true],
|
||||
'cubierta_paginas' => ['type' => 'INT', 'null' => true],
|
||||
'cubierta_papel_id' => ['type' => 'INT', 'constraint' => 10, 'unsigned' => true, 'null' => true],
|
||||
'cubierta_gramaje' => ['type' => 'DOUBLE', 'null' => true],
|
||||
'cubierta_acabado_id' => ['type' => 'INT', 'constraint' => 10, 'unsigned' => true, 'null' => true],
|
||||
'cubierta_ancho_solapas' => ['type' => 'DOUBLE', 'constraint' => '8,2', 'default' => 0.00, 'unsigned' => true],
|
||||
'cubierta_pod_papel_id' => ['type' => 'INT', 'constraint' => 10, 'unsigned' => true, 'null' => true],
|
||||
'cubierta_pod_gramaje' => ['type' => 'DOUBLE', 'null' => true],
|
||||
'sobrecubierta_paginas' => ['type' => 'INT', 'null' => true],
|
||||
'sobrecubierta_papel_id' => ['type' => 'INT', 'constraint' => 10, 'unsigned' => true, 'null' => true],
|
||||
'sobrecubierta_gramaje' => ['type' => 'DOUBLE', 'null' => true],
|
||||
'sobrecubierta_acabado_id' => ['type' => 'INT', 'constraint' => 10, 'unsigned' => true, 'null' => true],
|
||||
'sobrecubierta_ancho_solapas' => ['type' => 'DOUBLE', 'constraint' => '8,2', 'default' => 0.00, 'unsigned' => true],
|
||||
'sobrecubierta_pod_papel_id' => ['type' => 'INT', 'constraint' => 10, 'unsigned' => true, 'null' => true],
|
||||
'sobrecubierta_pod_gramaje' => ['type' => 'DOUBLE', 'null' => true],
|
||||
'encuadernacion_id' => ['type' => 'INT', 'constraint' => 10, 'unsigned' => true, 'null' => true],
|
||||
'ubicacion' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true],
|
||||
'created_at' => ['type' => 'TIMESTAMP', 'default' => 'CURRENT_TIMESTAMP'],
|
||||
'updated_at' => ['type' => 'TIMESTAMP', 'null' => true],
|
||||
'deleted_at' => ['type' => 'TIMESTAMP', 'null' => true],
|
||||
'sobrecubierta_pod_papel_id' => ['type' => 'INT', 'constraint' => 10, 'unsigned' => true, 'null' => true],
|
||||
'sobrecubierta_pod_gramaje' => ['type' => 'DOUBLE', 'null' => true],
|
||||
'encuadernacion_id' => ['type' => 'INT', 'constraint' => 10, 'unsigned' => true, 'null' => true],
|
||||
'ubicacion' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true],
|
||||
'created_at' => [
|
||||
'type' => 'TIMESTAMP',
|
||||
'default' => new \CodeIgniter\Database\RawSql('CURRENT_TIMESTAMP'),
|
||||
],
|
||||
'updated_at' => [
|
||||
'type' => 'TIMESTAMP',
|
||||
'null' => true,
|
||||
],
|
||||
'deleted_at' => [
|
||||
'type' => 'TIMESTAMP',
|
||||
'null' => true,
|
||||
],
|
||||
]);
|
||||
|
||||
$this->forge->addKey('id', true);
|
||||
$this->forge->addUniqueKey('isk');
|
||||
$this->forge->addForeignKey('cliente_id', 'clientes', 'id');
|
||||
|
||||
$this->forge->createTable('catalogo_libros');
|
||||
$this->forge->createTable('catalogo_libros',true);
|
||||
|
||||
$this->db->query('SET foreign_key_checks = 1');
|
||||
}
|
||||
|
||||
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Database\Migrations;
|
||||
|
||||
use App\Models\OrdenTrabajo\OrdenTrabajoTarea;
|
||||
use CodeIgniter\Database\Migration;
|
||||
use CodeIgniter\Database\RawSql;
|
||||
use CodeIgniter\I18n\Time;
|
||||
|
||||
class AddFerroProtoPresupuestoDirecciones extends Migration
|
||||
{
|
||||
|
||||
protected array $COLUMNS = [
|
||||
"is_ferro_prototipo" => [
|
||||
"type" => "TINYINT",
|
||||
"unsigned" => true,
|
||||
"default" => 0,
|
||||
"comment" => "Indica si es una direccion para el prototipo o ferro",
|
||||
],
|
||||
];
|
||||
public function up()
|
||||
{
|
||||
$this->forge->addColumn('presupuesto_direcciones', $this->COLUMNS);
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->forge->dropColumn('presupuesto_direcciones', array_keys($this->COLUMNS));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Database\Migrations;
|
||||
|
||||
use App\Models\OrdenTrabajo\OrdenTrabajoTarea;
|
||||
use CodeIgniter\Database\Migration;
|
||||
use CodeIgniter\Database\RawSql;
|
||||
use CodeIgniter\I18n\Time;
|
||||
|
||||
class AddTipoEnvioEnvios extends Migration
|
||||
{
|
||||
|
||||
protected array $COLUMNS = [
|
||||
"tipo_envio" => [
|
||||
"type" => "enum",
|
||||
"constraint" => ['estandar', 'ferro_prototipo'],
|
||||
"default" => 'estandar',
|
||||
"comment" => "Indica el tipo de envio",
|
||||
],
|
||||
];
|
||||
public function up()
|
||||
{
|
||||
$this->forge->addColumn('envios', $this->COLUMNS);
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->forge->dropColumn('envios', array_keys($this->COLUMNS));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace App\Database\Migrations;
|
||||
|
||||
use CodeIgniter\Database\Migration;
|
||||
|
||||
class AddPliegoColumnOrdenTrabajoTarea extends Migration
|
||||
{
|
||||
|
||||
protected array $COLUMNS = [
|
||||
"pliego_1" => [
|
||||
"type" => "INT",
|
||||
"unsigned" => true,
|
||||
"default" => 0,
|
||||
],
|
||||
"pliego_1_total" => [
|
||||
"type" => "INT",
|
||||
"unsigned" => true,
|
||||
"default" => 0,
|
||||
],
|
||||
"pliego_2" => [
|
||||
"type" => "INT",
|
||||
"unsigned" => true,
|
||||
"default" => 0,
|
||||
],
|
||||
"pliego_2_total" => [
|
||||
"type" => "INT",
|
||||
"unsigned" => true,
|
||||
"default" => 0,
|
||||
],
|
||||
];
|
||||
public function up()
|
||||
{
|
||||
$this->forge->addColumn('orden_trabajo_tareas', $this->COLUMNS);
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->forge->dropColumn('orden_trabajo_tareas', array_keys($this->COLUMNS));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace App\Database\Migrations;
|
||||
|
||||
use CodeIgniter\Database\Migration;
|
||||
|
||||
class AlterFkOrdenTrabajoTareaProgressDates extends Migration
|
||||
{
|
||||
|
||||
|
||||
public function up()
|
||||
{
|
||||
$this->forge->dropForeignKey('orden_trabajo_tarea_progress_dates','orden_trabajo_tarea_progress_dates_ot_tarea_id_foreign');
|
||||
$this->forge->addForeignKey("ot_tarea_id","orden_trabajo_tareas","id",'CASCADE','CASCADE');
|
||||
$this->forge->processIndexes('orden_trabajo_tarea_progress_dates');
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->forge->dropForeignKey('orden_trabajo_tarea_progress_dates','orden_trabajo_tarea_progress_dates_ot_tarea_id_foreign');
|
||||
$this->forge->addForeignKey("ot_tarea_id","orden_trabajo_tareas","id");
|
||||
$this->forge->processIndexes('orden_trabajo_tarea_progress_dates');
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
namespace App\Database\Migrations;
|
||||
|
||||
use CodeIgniter\Database\RawSql;
|
||||
use CodeIgniter\Database\Migration;
|
||||
|
||||
class CreateTableFestivos extends Migration
|
||||
{
|
||||
protected array $COLUMNS = [
|
||||
"id" => [
|
||||
"type" => "INT",
|
||||
"unsigned" => true,
|
||||
"auto_increment" => true
|
||||
],
|
||||
"date" => [
|
||||
"type" => "DATE",
|
||||
"unique" => true,
|
||||
],
|
||||
];
|
||||
public function up()
|
||||
{
|
||||
$this->forge->addField($this->COLUMNS);
|
||||
$currenttime = new RawSql("CURRENT_TIMESTAMP");
|
||||
$this->forge->addField([
|
||||
"created_at" => [
|
||||
"type" => "TIMESTAMP",
|
||||
"default" => $currenttime,
|
||||
],
|
||||
"updated_at" => [
|
||||
"type" => "TIMESTAMP",
|
||||
"null" => true,
|
||||
],
|
||||
"deleted_at" => [
|
||||
"type" => "TIMESTAMP",
|
||||
"null" => true,
|
||||
|
||||
],
|
||||
]);
|
||||
$this->forge->addPrimaryKey('id');
|
||||
$this->forge->createTable("festivos", true);
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
//
|
||||
$this->forge->dropTable("festivos", true);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Database\Migrations;
|
||||
|
||||
use CodeIgniter\Database\RawSql;
|
||||
use CodeIgniter\Database\Migration;
|
||||
|
||||
class AddClienteNoBasePODnoHQ extends Migration
|
||||
{
|
||||
protected array $COLUMNS = [
|
||||
"no_envio_base" => [
|
||||
"type" => "TINYINT",
|
||||
"default" => 0,
|
||||
],
|
||||
"forzar_rotativa_pod" => [
|
||||
"type" => "TINYINT",
|
||||
"default" => 0,
|
||||
],
|
||||
];
|
||||
public function up()
|
||||
{
|
||||
$this->forge->addColumn('clientes', $this->COLUMNS);
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
//
|
||||
$this->forge->dropColumn('clientes', array_keys($this->COLUMNS));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,68 @@
|
||||
<?php
|
||||
|
||||
namespace App\Database\Migrations;
|
||||
|
||||
use CodeIgniter\Database\Migration;
|
||||
|
||||
class AlterTarifasAcabadoAddBoleanColumns extends Migration
|
||||
{
|
||||
protected array $COLUMNS = [
|
||||
'plastificado' => [
|
||||
'type' => 'BOOLEAN',
|
||||
'default' => false,
|
||||
],
|
||||
'plakene' => [
|
||||
'type' => 'BOOLEAN',
|
||||
'default' => false,
|
||||
],
|
||||
'rectractilado' => [
|
||||
'type' => 'BOOLEAN',
|
||||
'default' => false,
|
||||
],
|
||||
'estampado' => [
|
||||
'type' => 'BOOLEAN',
|
||||
'default' => false,
|
||||
],
|
||||
'uvi' => [
|
||||
'type' => 'BOOLEAN',
|
||||
'default' => false,
|
||||
],
|
||||
'plastificado_tipo' => [
|
||||
'type' => 'ENUM',
|
||||
'constraint' => ['BRILLO','MATE','SANDY','GOFRADO','SOFT','ANTIRAYADO'],
|
||||
'null' => true,
|
||||
],
|
||||
'plakene_tipo' => [
|
||||
'type' => 'ENUM',
|
||||
'constraint' => ['TRASLUCIDO','MATE','NEGRO'],
|
||||
'null' => true,
|
||||
],
|
||||
'rectractilado_tipo' => [
|
||||
'type' => 'ENUM',
|
||||
'constraint' => ['1','3','5'],
|
||||
'null' => true,
|
||||
],
|
||||
'estampado_tipo' => [
|
||||
'type' => 'ENUM',
|
||||
'constraint' => ['ORO','PLATA','COBRE','BRONCE'],
|
||||
'null' => true,
|
||||
],
|
||||
'uvi_tipo' => [
|
||||
'type' => 'ENUM',
|
||||
'constraint' => ['2D','3D','BRAILLE'],
|
||||
'null' => true,
|
||||
]
|
||||
];
|
||||
public function up()
|
||||
{
|
||||
|
||||
$this->forge->addColumn('lg_tarifa_acabado',$this->COLUMNS);
|
||||
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->forge->dropColumn('lg_tarifa_acabado',array_keys($this->COLUMNS));
|
||||
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace App\Database\Migrations;
|
||||
|
||||
use CodeIgniter\Database\Migration;
|
||||
|
||||
class AlterOrdenesTrabajoAddCommentColumns extends Migration
|
||||
{
|
||||
protected array $COLUMNS = [
|
||||
'comment_interior' => [
|
||||
'type' => 'LONGTEXT',
|
||||
'null' => true
|
||||
],
|
||||
'comment_cubierta' => [
|
||||
'type' => 'LONGTEXT',
|
||||
'null' => true
|
||||
],
|
||||
'comment_encuadernacion' => [
|
||||
'type' => 'LONGTEXT',
|
||||
'null' => true
|
||||
],
|
||||
'comment_logistica' => [
|
||||
'type' => 'LONGTEXT',
|
||||
'null' => true
|
||||
],
|
||||
"info_solapa_guillotina" => [
|
||||
'type' => 'LONGTEXT',
|
||||
'null' => true
|
||||
]
|
||||
];
|
||||
public function up()
|
||||
{
|
||||
|
||||
$this->forge->addColumn('ordenes_trabajo',$this->COLUMNS);
|
||||
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->forge->dropColumn('ordenes_trabajo',array_keys($this->COLUMNS));
|
||||
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,82 @@
|
||||
<?php
|
||||
|
||||
namespace App\Database\Migrations;
|
||||
|
||||
use CodeIgniter\Database\Migration;
|
||||
use CodeIgniter\Database\RawSql;
|
||||
|
||||
class AddOrdenTrabajoDatesManipuladoImpresion extends Migration
|
||||
{
|
||||
protected array $DATES = [
|
||||
"sobrecubierta_at" => [
|
||||
"type" => "DATE",
|
||||
"null" => true,
|
||||
],
|
||||
"guarda_at" => [
|
||||
"type" => "DATE",
|
||||
"null" => true,
|
||||
],
|
||||
"plakene_at" => [
|
||||
"type" => "DATE",
|
||||
"null" => true,
|
||||
],
|
||||
"estampado_at" => [
|
||||
"type" => "DATE",
|
||||
"null" => true,
|
||||
],
|
||||
"uvi_at" => [
|
||||
"type" => "DATE",
|
||||
"null" => true,
|
||||
],
|
||||
|
||||
];
|
||||
protected array $USERS = [
|
||||
"sobrecubierta_user_id" => [
|
||||
"type" => "INT",
|
||||
"unsigned" => true,
|
||||
"constraint" => 10,
|
||||
"null" => true,
|
||||
],
|
||||
"guarda_user_id" => [
|
||||
"type" => "INT",
|
||||
"unsigned" => true,
|
||||
"constraint" => 10,
|
||||
"null" => true,
|
||||
],
|
||||
"plakene_user_id" => [
|
||||
"type" => "INT",
|
||||
"unsigned" => true,
|
||||
"constraint" => 10,
|
||||
"null" => true,
|
||||
],
|
||||
"estampado_user_id" => [
|
||||
"type" => "INT",
|
||||
"unsigned" => true,
|
||||
"constraint" => 10,
|
||||
"null" => true,
|
||||
],
|
||||
"uvi_user_id" => [
|
||||
"type" => "INT",
|
||||
"unsigned" => true,
|
||||
"constraint" => 10,
|
||||
"null" => true,
|
||||
],
|
||||
];
|
||||
|
||||
public function up()
|
||||
{
|
||||
$this->forge->addColumn("orden_trabajo_dates", $this->DATES);
|
||||
$this->forge->addColumn("orden_trabajo_users", $this->USERS);
|
||||
foreach ($this->USERS as $key => $value) {
|
||||
$this->forge->addForeignKey([$key],"users",["id"]);
|
||||
}
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->forge->dropColumn("orden_trabajo_dates", array_keys($this->DATES));
|
||||
$this->forge->dropColumn("orden_trabajo_users", array_keys($this->USERS));
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
43
ci4/app/Database/Seeds/PedidoPodSeeder.php
Normal file
43
ci4/app/Database/Seeds/PedidoPodSeeder.php
Normal file
@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace App\Database\Seeds;
|
||||
|
||||
use App\Models\Configuracion\ConfigVariableModel;
|
||||
use App\Models\Configuracion\MaquinaTareaModel;
|
||||
use CodeIgniter\Database\Seeder;
|
||||
|
||||
class PedidoPodSeeder extends Seeder
|
||||
{
|
||||
public function run()
|
||||
{
|
||||
$m = model(ConfigVariableModel::class);
|
||||
$data = [
|
||||
[
|
||||
"name" => "pod_impresion_dias_tras_confirmacion",
|
||||
"value" => 1,
|
||||
"description" => "Días a los que se establece la fecha de impresion en pedido tras confirmación"
|
||||
],
|
||||
[
|
||||
"name" => "pod_encuadernacion_dias_tras_confirmacion",
|
||||
"value" => 2,
|
||||
"description" => "Días a los que se establece la fecha de encuadernación en pedido tras confirmación"
|
||||
],
|
||||
[
|
||||
"name" => "pod_entrega_real_dias_tras_confirmacion",
|
||||
"value" => 5,
|
||||
"description" => "Días a los que se establece la fecha entrega real en pedido tras confirmación"
|
||||
],
|
||||
[
|
||||
"name" => "pod_embalaje_dias_tras_confirmacion",
|
||||
"value" => 4,
|
||||
"description" => "Días a los que se establece la fecha de encuadernación en pedido tras confirmación"
|
||||
],
|
||||
];
|
||||
foreach ($data as $key => $row) {
|
||||
if($m->getVariable($row['name']) == null)
|
||||
{
|
||||
$m->insert($row);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,7 +1,9 @@
|
||||
<?php
|
||||
namespace App\Entities\Cliente;
|
||||
namespace App\Entities\Clientes;
|
||||
|
||||
use CodeIgniter\Entity;
|
||||
use App\Models\Clientes\ClienteModel;
|
||||
use App\Models\Configuracion\PaisModel;
|
||||
|
||||
class ClienteDireccionesEntity extends \CodeIgniter\Entity\Entity
|
||||
{
|
||||
@ -23,4 +25,29 @@ class ClienteDireccionesEntity extends \CodeIgniter\Entity\Entity
|
||||
"pais_id" => "int",
|
||||
"cp" => "int",
|
||||
];
|
||||
|
||||
public function getClienteNombre(): ?string
|
||||
{
|
||||
if (!$this->cliente_id) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$clienteModel = model(ClienteModel::class);
|
||||
$cliente = $clienteModel->find($this->cliente_id);
|
||||
|
||||
return $cliente ? $cliente->nombre : null;
|
||||
}
|
||||
|
||||
public function getPaisNombre(): ?string
|
||||
{
|
||||
if (!$this->pais_id) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$paisModel = model(PaisModel::class);
|
||||
$pais = $paisModel->find($this->pais_id);
|
||||
|
||||
return $pais ? $pais->nombre : null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -48,6 +48,8 @@ class ClienteEntity extends \CodeIgniter\Entity\Entity
|
||||
"updated_at" => null,
|
||||
"user_created_id" => 1,
|
||||
"user_update_id" => 1,
|
||||
"no_envio_base" => 0,
|
||||
"forzar_rotativa_pod" => 0,
|
||||
];
|
||||
protected $casts = [
|
||||
"comunidad_autonoma_id" => "?int",
|
||||
@ -70,6 +72,8 @@ class ClienteEntity extends \CodeIgniter\Entity\Entity
|
||||
"is_deleted" => "int",
|
||||
"user_created_id" => "int",
|
||||
"user_update_id" => "int",
|
||||
"no_envio_base" => "boolean",
|
||||
"forzar_rotativa_pod" => "boolean",
|
||||
];
|
||||
|
||||
public function comercial() : ?UserEntity
|
||||
|
||||
14
ci4/app/Entities/Configuracion/FestivoEntity.php
Normal file
14
ci4/app/Entities/Configuracion/FestivoEntity.php
Normal file
@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entities\Configuracion;
|
||||
|
||||
use CodeIgniter\Entity\Entity;
|
||||
|
||||
class FestivoEntity extends Entity
|
||||
{
|
||||
protected $attributes = [
|
||||
"id" => null,
|
||||
"date" => null,
|
||||
];
|
||||
protected $casts = [];
|
||||
}
|
||||
@ -31,5 +31,6 @@ class EnvioEntity extends Entity
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'cajas' => 'int',
|
||||
'tipo_envio' => 'string',
|
||||
];
|
||||
}
|
||||
|
||||
@ -1,7 +1,9 @@
|
||||
<?php
|
||||
namespace App\Entities\Presupuestos;
|
||||
|
||||
use App\Entities\Compras\ProveedorEntity;
|
||||
use App\Entities\Tarifas\Acabados\TarifaAcabadoEntity;
|
||||
use App\Models\Compras\ProveedorModel;
|
||||
use App\Models\Configuracion\MaquinaModel;
|
||||
use App\Models\Tarifas\Acabados\TarifaAcabadoModel;
|
||||
use App\Models\Tarifas\Maquinas\TarifaAcabadoMaquinaModel;
|
||||
@ -54,5 +56,13 @@ class PresupuestoAcabadosEntity extends \CodeIgniter\Entity\Entity
|
||||
$m = model(TarifaAcabadoModel::class);
|
||||
return $m->find($this->attributes["tarifa_acabado_id"]);
|
||||
}
|
||||
|
||||
public function proveedor(): ?ProveedorEntity
|
||||
{
|
||||
$proveedor = null;
|
||||
$m = model(ProveedorModel::class);
|
||||
if ($this->attributes["proveedor_id"]) {
|
||||
$proveedor = $m->find($this->attributes["proveedor_id"]);
|
||||
}
|
||||
return $proveedor;
|
||||
}
|
||||
}
|
||||
|
||||
@ -25,6 +25,7 @@ class PresupuestoDireccionesEntity extends \CodeIgniter\Entity\Entity
|
||||
"proveedor_id" => null,
|
||||
"margen" => null,
|
||||
"entregaPieCalle" => null,
|
||||
"is_ferro_prototipo" => null,
|
||||
];
|
||||
protected $casts = [
|
||||
"presupuesto_id" => "int",
|
||||
@ -38,6 +39,7 @@ class PresupuestoDireccionesEntity extends \CodeIgniter\Entity\Entity
|
||||
"margen" => "float",
|
||||
"proveedor_id" => "int",
|
||||
"entregaPieCalle" => "int",
|
||||
"is_ferro_prototipo" => "int",
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@ -1,7 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entities\Presupuestos;
|
||||
|
||||
use App\Entities\Compras\ProveedorEntity;
|
||||
use App\Entities\Tarifas\TarifaEncuadernacionEntity;
|
||||
use App\Models\Compras\ProveedorModel;
|
||||
use App\Models\Configuracion\MaquinaModel;
|
||||
use App\Models\Tarifas\Maquinas\TarifaEncuadernacionMaquinaModel;
|
||||
use App\Models\Tarifas\TarifaEncuadernacionModel;
|
||||
@ -32,10 +35,10 @@ class PresupuestoEncuadernacionesEntity extends \CodeIgniter\Entity\Entity
|
||||
"precio_total" => "float",
|
||||
"margen" => "float",
|
||||
];
|
||||
public function maquinas() : array
|
||||
public function maquinas(): array
|
||||
{
|
||||
$m = model(TarifaEncuadernacionMaquinaModel::class);
|
||||
$tarifa_maquinas = $m->where("tarifa_encuadernacion_id",$this->attributes["tarifa_encuadernado_id"])->findAll();
|
||||
$tarifa_maquinas = $m->where("tarifa_encuadernacion_id", $this->attributes["tarifa_encuadernado_id"])->findAll();
|
||||
$maquinaModel = model(MaquinaModel::class);
|
||||
$maquinas = [];
|
||||
foreach ($tarifa_maquinas as $key => $tarifa_maquina) {
|
||||
@ -43,9 +46,18 @@ class PresupuestoEncuadernacionesEntity extends \CodeIgniter\Entity\Entity
|
||||
}
|
||||
return $maquinas;
|
||||
}
|
||||
public function tarifa() : TarifaEncuadernacionEntity
|
||||
public function tarifa(): TarifaEncuadernacionEntity
|
||||
{
|
||||
$m = model(TarifaEncuadernacionModel::class);
|
||||
return $m->find($this->attributes["tarifa_encuadernado_id"]);
|
||||
}
|
||||
public function proveedor(): ?ProveedorEntity
|
||||
{
|
||||
$proveedor = null;
|
||||
$m = model(ProveedorModel::class);
|
||||
if ($this->attributes["proveedor_id"]) {
|
||||
$proveedor = $m->find($this->attributes["proveedor_id"]);
|
||||
}
|
||||
return $proveedor;
|
||||
}
|
||||
}
|
||||
|
||||
@ -210,35 +210,35 @@ class PresupuestoEntity extends \CodeIgniter\Entity\Entity
|
||||
|
||||
$q = $model->where('presupuesto_id', $this->attributes["id"])->findAll();
|
||||
|
||||
return $q ?? [];
|
||||
}
|
||||
/**
|
||||
* Obtiene las lineas de presupuesto del actual presupuesto
|
||||
*
|
||||
* @return ?PresupuestoLineaEntity
|
||||
*/
|
||||
public function presupuestoLineaImpresion(): ?PresupuestoLineaEntity
|
||||
{
|
||||
$model = model(PresupuestoLineaModel::class);
|
||||
|
||||
$q = $model->where('presupuesto_id', $this->attributes["id"])->whereIn("tipo", ["lp_rot_bn", "lp_rot_color", "lp_color", "lp_colorhq", "lp_bn", "lp_bnhq"])->first();
|
||||
|
||||
return $q;
|
||||
}
|
||||
/**
|
||||
/**
|
||||
* Obtiene las lineas de presupuesto del actual presupuesto
|
||||
*
|
||||
* @return PresupuestoLineaEntity
|
||||
*/
|
||||
public function presupuestoLineaImpresion(): PresupuestoLineaEntity
|
||||
public function presupuestoLineaCubierta(): ?PresupuestoLineaEntity
|
||||
{
|
||||
$model = model(PresupuestoLineaModel::class);
|
||||
|
||||
$q = $model->where('presupuesto_id', $this->attributes["id"])->whereIn("tipo",["lp_rot_bn","lp_rot_color","lp_color","lp_colorhq","lp_bn","lp_bnhq"])->first();
|
||||
$q = $model->where('presupuesto_id', $this->attributes["id"])->whereIn("tipo", ["lp_cubierta"])->first();
|
||||
|
||||
return $q;
|
||||
}
|
||||
/**
|
||||
* Obtiene las lineas de presupuesto del actual presupuesto
|
||||
*
|
||||
* @return PresupuestoLineaEntity
|
||||
*/
|
||||
public function presupuestoLineaCubierta(): PresupuestoLineaEntity
|
||||
{
|
||||
$model = model(PresupuestoLineaModel::class);
|
||||
|
||||
$q = $model->where('presupuesto_id', $this->attributes["id"])->whereIn("tipo",["lp_cubierta"])->first();
|
||||
|
||||
return $q;
|
||||
}
|
||||
/**
|
||||
/**
|
||||
* Obtiene las lineas de presupuesto del actual presupuesto
|
||||
*
|
||||
* @return PresupuestoLineaEntity
|
||||
@ -247,70 +247,81 @@ class PresupuestoEntity extends \CodeIgniter\Entity\Entity
|
||||
{
|
||||
$model = model(PresupuestoLineaModel::class);
|
||||
|
||||
$q = $model->where('presupuesto_id', $this->attributes["id"])->whereIn("tipo",["lp_sobrecubierta"])->first();
|
||||
$q = $model->where('presupuesto_id', $this->attributes["id"])->whereIn("tipo", ["lp_sobrecubierta"])->first();
|
||||
|
||||
return $q;
|
||||
}
|
||||
public function hasSobrecubierta() : bool
|
||||
public function presupuestoLineaGuarda(): ?PresupuestoLineaEntity
|
||||
{
|
||||
$model = model(PresupuestoLineaModel::class);
|
||||
|
||||
$q = $model->where('presupuesto_id', $this->attributes["id"])->whereIn("tipo", ["lp_guardas"])->first();
|
||||
|
||||
return $q;
|
||||
}
|
||||
public function hasSobrecubierta(): bool
|
||||
{
|
||||
$hasSobrecubierta = false;
|
||||
$model = model(PresupuestoLineaModel::class);
|
||||
$q = $model->where('presupuesto_id', $this->attributes["id"])->whereIn("tipo",["lp_sobrecubierta"])->countAllResults();
|
||||
if($q > 0){
|
||||
$q = $model->where('presupuesto_id', $this->attributes["id"])->whereIn("tipo", ["lp_sobrecubierta"])->countAllResults();
|
||||
if ($q > 0) {
|
||||
$hasSobrecubierta = true;
|
||||
}
|
||||
return $hasSobrecubierta;
|
||||
}
|
||||
public function cliente() : ClienteEntity
|
||||
public function cliente(): ?ClienteEntity
|
||||
{
|
||||
$m = model(ClienteModel::class);
|
||||
return $m->find($this->attributes["cliente_id"]);
|
||||
if ($this->attributes['cliente_id']) {
|
||||
|
||||
return $m->find($this->attributes["cliente_id"]);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
public function encuadernaciones(): array
|
||||
{
|
||||
$m = model(PresupuestoEncuadernacionesModel::class);
|
||||
return $m->where("presupuesto_id",$this->attributes["id"])->findAll();
|
||||
return $m->where("presupuesto_id", $this->attributes["id"])->findAll();
|
||||
}
|
||||
public function acabados(): array
|
||||
{
|
||||
$m = model(PresupuestoAcabadosModel::class);
|
||||
return $m->where("presupuesto_id",$this->attributes["id"])->findAll();
|
||||
return $m->where("presupuesto_id", $this->attributes["id"])->findAll();
|
||||
}
|
||||
public function preimpresiones(): array
|
||||
{
|
||||
$m = model(PresupuestoPreimpresionesModel::class);
|
||||
return $m->where("presupuesto_id",$this->attributes["id"])->findAll();
|
||||
return $m->where("presupuesto_id", $this->attributes["id"])->findAll();
|
||||
}
|
||||
public function manipulados(): array
|
||||
{
|
||||
$m = model(PresupuestoManipuladosModel::class);
|
||||
return $m->where("presupuesto_id",$this->attributes["id"])->findAll();
|
||||
return $m->where("presupuesto_id", $this->attributes["id"])->findAll();
|
||||
}
|
||||
public function extras(): array
|
||||
{
|
||||
$m = model(PresupuestoServiciosExtraModel::class);
|
||||
return $m->where("presupuesto_id",$this->attributes["id"])->findAll();
|
||||
return $m->where("presupuesto_id", $this->attributes["id"])->findAll();
|
||||
}
|
||||
public function papel_formato() : PapelFormatoEntity
|
||||
public function papel_formato(): PapelFormatoEntity
|
||||
{
|
||||
$m = model(PapelFormatoModel::class);
|
||||
return $m->find($this->attributes["papel_formato_id"]);
|
||||
}
|
||||
public function files(): array
|
||||
public function files(): array
|
||||
{
|
||||
$m = model(PresupuestoFicheroModel::class);
|
||||
$files = $m->where('presupuesto_id',$this->attributes['id'])->findAll();
|
||||
$files = $m->where('presupuesto_id', $this->attributes['id'])->findAll();
|
||||
return $files ?? [];
|
||||
}
|
||||
public function tipo_presupuesto() : ?TipoPresupuestoEntity
|
||||
public function tipo_presupuesto(): ?TipoPresupuestoEntity
|
||||
{
|
||||
$tipo_presupuesto = null;
|
||||
$m = model(TipoPresupuestoModel::class);
|
||||
if($this->attributes["tipo_impresion_id"]){
|
||||
if ($this->attributes["tipo_impresion_id"]) {
|
||||
$tipo_presupuesto = $m->find($this->attributes['tipo_impresion_id']);
|
||||
}
|
||||
return $tipo_presupuesto;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -194,39 +194,76 @@ class PresupuestoLineaEntity extends \CodeIgniter\Entity\Entity
|
||||
return $m->find($this->attributes['tarifa_impresion_id']);
|
||||
}
|
||||
|
||||
public function get_impresion_logo(){
|
||||
public function get_impresion_logo()
|
||||
{
|
||||
$logo = config(LogoImpresion::class);
|
||||
return $logo->get_logo_path($this->attributes["tipo"]);
|
||||
}
|
||||
public function get_nombre_tarea() : ?string
|
||||
public function get_nombre_tarea(): ?string
|
||||
{
|
||||
$nombre = null;
|
||||
$impresion_bn = ["lp_bn","lp_bnhq","lp_rot_bn"];
|
||||
$impresion_color = ["lp_color","lp_colorhq","lp_rot_color"];
|
||||
$impresion_bn = ["lp_bn", "lp_bnhq", "lp_rot_bn"];
|
||||
$impresion_color = ["lp_color", "lp_colorhq", "lp_rot_color"];
|
||||
$impresion_cubierta = ["lp_cubierta"];
|
||||
$impresion_guardas = ["lp_guardas"];
|
||||
$impresion_sobrecubierta = ["lp_sobrecubierta"];
|
||||
|
||||
$is_bn = in_array($this->attributes["tipo"],$impresion_bn);
|
||||
$is_color = in_array($this->attributes["tipo"],$impresion_color);
|
||||
$is_impresion_cubierta = in_array($this->attributes["tipo"],$impresion_cubierta);
|
||||
$is_impresion_guarda = in_array($this->attributes["tipo"],$impresion_guardas);
|
||||
$is_impresion_sobrecubierta = in_array($this->attributes["tipo"],$impresion_sobrecubierta);
|
||||
$is_bn = in_array($this->attributes["tipo"], $impresion_bn);
|
||||
$is_color = in_array($this->attributes["tipo"], $impresion_color);
|
||||
$is_impresion_cubierta = in_array($this->attributes["tipo"], $impresion_cubierta);
|
||||
$is_impresion_guarda = in_array($this->attributes["tipo"], $impresion_guardas);
|
||||
$is_impresion_sobrecubierta = in_array($this->attributes["tipo"], $impresion_sobrecubierta);
|
||||
|
||||
if($is_bn) $nombre ="Impresión B/N";
|
||||
if($is_color) $nombre ="Impresión color";
|
||||
if($is_impresion_cubierta) $nombre ="Impresión cubierta";
|
||||
if($is_impresion_guarda) $nombre ="Impresión guarda";
|
||||
if($is_impresion_sobrecubierta) $nombre ="Impresión sobrecubierta";
|
||||
if ($is_bn) $nombre = "Impresión B/N";
|
||||
if ($is_color) $nombre = "Impresión color";
|
||||
if ($is_impresion_cubierta) $nombre = "Impresión cubierta";
|
||||
if ($is_impresion_guarda) $nombre = "Impresión guarda";
|
||||
if ($is_impresion_sobrecubierta) $nombre = "Impresión sobrecubierta";
|
||||
|
||||
return $nombre;
|
||||
}
|
||||
public function isRotativa() : bool
|
||||
{
|
||||
return in_array($this->attributes['tipo'],['lp_rot_color','lp_rot_bn']);
|
||||
|
||||
public function isGuarda(): bool
|
||||
{
|
||||
return in_array($this->attributes["tipo"], ["lp_guardas"]);
|
||||
}
|
||||
public function isColor():bool {
|
||||
return in_array($this->attributes['tipo'],['lp_color','lp_colorhq','lp_rot_color']);
|
||||
|
||||
public function isCubierta(): bool
|
||||
{
|
||||
return in_array($this->attributes["tipo"], ["lp_cubierta"]);
|
||||
}
|
||||
public function isSobreCubierta(): bool
|
||||
{
|
||||
return in_array($this->attributes["tipo"], ["lp_sobrecubierta"]);
|
||||
}
|
||||
public function isRotativa(): bool
|
||||
{
|
||||
return in_array($this->attributes['tipo'], ['lp_rot_color', 'lp_rot_bn']);
|
||||
}
|
||||
public function isColor(): bool
|
||||
{
|
||||
return in_array($this->attributes['tipo'], ['lp_color', 'lp_colorhq', 'lp_rot_color']);
|
||||
}
|
||||
public function isBN(): bool
|
||||
{
|
||||
return in_array($this->attributes['tipo'], ["lp_bn", "lp_bnhq", "lp_rot_bn"]);
|
||||
}
|
||||
|
||||
public function tinta(): string
|
||||
{
|
||||
$tinta = "";
|
||||
if ($this->isCubierta()) {
|
||||
$paginas = $this->attributes['paginas'];
|
||||
if ($paginas / 2 == 1) {
|
||||
$tinta = '4/0';
|
||||
}
|
||||
if ($paginas / 2 == 2) {
|
||||
$tinta = '4/4';
|
||||
}
|
||||
} elseif ($this->isColor()) {
|
||||
$tinta = '4/4';
|
||||
} elseif ($this->isBN()) {
|
||||
$tinta = '4/0';
|
||||
}
|
||||
return $tinta;
|
||||
}
|
||||
}
|
||||
|
||||
@ -15,8 +15,15 @@ class OrdenTrabajoDateEntity extends Entity
|
||||
"interior_bn_at" => null,
|
||||
"interior_color_at" => null,
|
||||
"cubierta_at" => null,
|
||||
"sobrecubierta_at" => null, //TODO
|
||||
"guarda_at" => null, //TODO
|
||||
//ACABADO
|
||||
"plastificado_at" => null,
|
||||
"plakene_at" => null, //TODO
|
||||
"retractilado_at"=> null,
|
||||
"estampado_at" => null, //TODO
|
||||
"uvi_at" => null, //TODO
|
||||
//MANIPULADO
|
||||
"encuadernacion_at" => null,
|
||||
"corte_at" => null,
|
||||
"preparacion_interiores_at" => null,
|
||||
@ -24,9 +31,8 @@ class OrdenTrabajoDateEntity extends Entity
|
||||
"cosido_at" => null,
|
||||
"solapa_at" => null,
|
||||
"grapado_at" => null,
|
||||
"retractilado_at"=> null,
|
||||
"retractilado5_at"=> null,
|
||||
"prototipo_at"=> null,
|
||||
"retractilado5_at"=> null, // !DELETE
|
||||
"prototipo_at"=> null, // !DELETE
|
||||
"marcapaginas_at"=> null,
|
||||
"espiral_at"=> null,
|
||||
//FERRO
|
||||
|
||||
@ -30,6 +30,11 @@ class OrdenTrabajoEntity extends Entity
|
||||
"progreso" => 0.00,
|
||||
"estado" => "I",
|
||||
"comentarios" => null,
|
||||
"comment_interior" => null,
|
||||
"comment_cubierta" => null,
|
||||
"comment_encuadernacion" => null,
|
||||
"comment_logistica" => null,
|
||||
"info_solapa_guillotina" => null,
|
||||
"revisar_formato" => null,
|
||||
"revisar_lomo" => null,
|
||||
"revisar_solapa" => null,
|
||||
@ -52,7 +57,12 @@ class OrdenTrabajoEntity extends Entity
|
||||
"tipo_entrada" => "string",
|
||||
"progreso" => "float",
|
||||
"estado" => "string",
|
||||
"comentarios" => "string",
|
||||
"comentarios" => "?string",
|
||||
"comment_interior" => "?string",
|
||||
"comment_cubierta" => "?string",
|
||||
"comment_encuadernacion" => "?string",
|
||||
"comment_logistica" => "?string",
|
||||
"info_solapa_guillotina" => "?string",
|
||||
"revisar_formato" => "bool",
|
||||
"revisar_lomo" => "bool",
|
||||
"revisar_solapa" => "bool",
|
||||
@ -68,7 +78,7 @@ class OrdenTrabajoEntity extends Entity
|
||||
/**
|
||||
* Devuelve las tareas de la orden de trabajo.
|
||||
*
|
||||
* @return array<OrdenTrabajoTarea>
|
||||
* @return array<OrdenTrabajoTareaEntity>
|
||||
*/
|
||||
public function tareas(): array
|
||||
{
|
||||
@ -80,7 +90,22 @@ class OrdenTrabajoEntity extends Entity
|
||||
$m = model(OrdenTrabajoTarea::class);
|
||||
return $m->where("orden_trabajo_id", $this->attributes["id"])->where("presupuesto_linea_id IS NOT NULL", NULL, FALSE)->findAll() ?? [];
|
||||
}
|
||||
/**
|
||||
public function tareas_acabado(): array
|
||||
{
|
||||
$m = model(OrdenTrabajoTarea::class);
|
||||
return $m->where("orden_trabajo_id", $this->attributes["id"])->where("presupuesto_acabado_id IS NOT NULL", NULL, FALSE)->findAll() ?? [];
|
||||
}
|
||||
public function tareas_encuadernado(): array
|
||||
{
|
||||
$m = model(OrdenTrabajoTarea::class);
|
||||
return $m->where("orden_trabajo_id", $this->attributes["id"])->where("presupuesto_encuadernado_id IS NOT NULL", NULL, FALSE)->findAll() ?? [];
|
||||
}
|
||||
public function tareas_manipulado(): array
|
||||
{
|
||||
$m = model(OrdenTrabajoTarea::class);
|
||||
return $m->where("orden_trabajo_id", $this->attributes["id"])->where("presupuesto_manipulado_id IS NOT NULL", NULL, FALSE)->findAll() ?? [];
|
||||
}
|
||||
/**
|
||||
* Devuelve el presupuesto de la orden de trabajo
|
||||
*
|
||||
* @return PresupuestoEntity
|
||||
@ -183,4 +208,5 @@ class OrdenTrabajoEntity extends Entity
|
||||
];
|
||||
return $estados[$this->attributes["estado"]];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -5,6 +5,7 @@ namespace App\Entities\Produccion;
|
||||
use App\Entities\Configuracion\Imposicion;
|
||||
use App\Entities\Configuracion\Maquina;
|
||||
use App\Entities\Presupuestos\PresupuestoAcabadosEntity;
|
||||
use App\Entities\Presupuestos\PresupuestoEncuadernacionesEntity;
|
||||
use App\Entities\Presupuestos\PresupuestoLineaEntity;
|
||||
use App\Entities\Presupuestos\PresupuestoManipuladosEntity;
|
||||
use App\Models\Configuracion\ImposicionModel;
|
||||
@ -12,6 +13,7 @@ use App\Models\Configuracion\MaquinaModel;
|
||||
use App\Models\OrdenTrabajo\OrdenTrabajoModel;
|
||||
use App\Models\OrdenTrabajo\OrdenTrabajoTareaProgressDate;
|
||||
use App\Models\Presupuestos\PresupuestoAcabadosModel;
|
||||
use App\Models\Presupuestos\PresupuestoEncuadernacionesModel;
|
||||
use App\Models\Presupuestos\PresupuestoLineaModel;
|
||||
use App\Models\Presupuestos\PresupuestoManipuladosModel;
|
||||
use CodeIgniter\Entity\Entity;
|
||||
@ -23,6 +25,11 @@ class OrdenTrabajoTareaEntity extends Entity
|
||||
"id" => null,
|
||||
"orden_trabajo_id" => null,
|
||||
"presupuesto_linea_id" => null,
|
||||
"presupuesto_acabado_id" => null,
|
||||
"presupuesto_preimpresion_id" => null,
|
||||
"presupuesto_encuadernado_id" => null,
|
||||
"presupuesto_extra_id" => null,
|
||||
"presupuesto_manipulado_id" => null,
|
||||
"nombre" => null,
|
||||
"orden" => null,
|
||||
"maquina_id" => null,
|
||||
@ -34,8 +41,11 @@ class OrdenTrabajoTareaEntity extends Entity
|
||||
"comment" => null,
|
||||
"click_init" => null,
|
||||
"click_end" => null,
|
||||
"pliego_1" => null,
|
||||
"pliego_1_total" => null,
|
||||
"pliego_2" => null,
|
||||
"pliego_2_total" => null,
|
||||
];
|
||||
protected $datamap = [];
|
||||
protected $dates = ['created_at', 'updated_at', 'deleted_at'];
|
||||
protected $casts = [
|
||||
"id" => "integer",
|
||||
@ -52,6 +62,10 @@ class OrdenTrabajoTareaEntity extends Entity
|
||||
"comment" => "?string",
|
||||
"click_init" => "integer",
|
||||
"click_end" => "integer",
|
||||
"pliego_1" => "integer",
|
||||
"pliego_1_total" => "integer",
|
||||
"pliego_2" => "integer",
|
||||
"pliego_2_total" => "integer",
|
||||
];
|
||||
|
||||
/**
|
||||
@ -89,10 +103,15 @@ class OrdenTrabajoTareaEntity extends Entity
|
||||
*
|
||||
* @return PresupuestoLineaEntity
|
||||
*/
|
||||
public function presupuesto_linea(): PresupuestoLineaEntity
|
||||
public function presupuesto_linea(): ?PresupuestoLineaEntity
|
||||
{
|
||||
$presupuesto_linea = null;
|
||||
$m = model(PresupuestoLineaModel::class);
|
||||
return $m->find($this->attributes["presupuesto_linea_id"]);
|
||||
if ($this->attributes['presupuesto_linea_id']) {
|
||||
|
||||
$presupuesto_linea = $m->find($this->attributes["presupuesto_linea_id"]);
|
||||
}
|
||||
return $presupuesto_linea;
|
||||
}
|
||||
/**
|
||||
* Devuelve la maquina original del presupuesto linea
|
||||
@ -101,17 +120,49 @@ class OrdenTrabajoTareaEntity extends Entity
|
||||
*/
|
||||
public function maquina_presupuesto_linea(): Maquina
|
||||
{
|
||||
return $this->presupuesto_linea()->maquina();
|
||||
return $this->presupuesto_linea()?->maquina();
|
||||
}
|
||||
/**
|
||||
* Devuelve el presupuesto acabado origen de esta tarea
|
||||
*
|
||||
* @return PresupuestoAcabadosEntity
|
||||
*/
|
||||
public function presupuesto_acabado(): PresupuestoAcabadosEntity
|
||||
public function presupuesto_acabado(): ?PresupuestoAcabadosEntity
|
||||
{
|
||||
$presupuesto_acabado = null;
|
||||
$m = model(PresupuestoAcabadosModel::class);
|
||||
return $m->find($this->attributes["presupuesto_linea_id"]);
|
||||
if ($this->attributes["presupuesto_acabado_id"]) {
|
||||
$presupuesto_acabado = $m->find($this->attributes["presupuesto_acabado_id"]);
|
||||
}
|
||||
return $presupuesto_acabado;
|
||||
}
|
||||
/**
|
||||
* Devuelve el presupuesto enducadernacion origen de esta tarea
|
||||
*
|
||||
* @return PresupuestoEncuadernacionesEntity
|
||||
*/
|
||||
public function presupuesto_encuadernacion(): ?PresupuestoEncuadernacionesEntity
|
||||
{
|
||||
$presupuesto_encuadernacion = null;
|
||||
$m = model(PresupuestoEncuadernacionesModel::class);
|
||||
if ($this->attributes["presupuesto_encuadernado_id"]) {
|
||||
$presupuesto_encuadernacion = $m->find($this->attributes["presupuesto_encuadernado_id"]);
|
||||
}
|
||||
return $presupuesto_encuadernacion;
|
||||
}
|
||||
/**
|
||||
* Devuelve el presupuesto acabado origen de esta tarea
|
||||
*
|
||||
* @return ?PresupuestoManipuladosEntity
|
||||
*/
|
||||
public function presupuesto_manipulado(): ?PresupuestoManipuladosEntity
|
||||
{
|
||||
$m = model(PresupuestoManipuladosModel::class);
|
||||
$p = null;
|
||||
if ($this->attributes['presupuesto_manipulado_id']) {
|
||||
$p = $m->find($this->attributes["presupuesto_manipulado_id"]);
|
||||
}
|
||||
return $p;
|
||||
}
|
||||
public function imposicion(): ?Imposicion
|
||||
{
|
||||
@ -127,12 +178,18 @@ class OrdenTrabajoTareaEntity extends Entity
|
||||
$m = model(OrdenTrabajoTareaProgressDate::class);
|
||||
return $m->where('ot_tarea_id', $this->attributes["id"])->findAll() ?? [];
|
||||
}
|
||||
public function lastState() : ?OrdenTrabajoTareaProgressDateEntity
|
||||
{
|
||||
$m = model(OrdenTrabajoTareaProgressDate::class);
|
||||
$progressDates = $m->where('ot_tarea_id', $this->attributes["id"])->orderBy('action_at', 'DESC')->first();
|
||||
return $progressDates;
|
||||
}
|
||||
public function tiempo_trabajado()
|
||||
{
|
||||
$dates = $this->progress_dates();
|
||||
$intervals = [];
|
||||
$init = [];
|
||||
$end = [];
|
||||
$init = null;
|
||||
$end = null;
|
||||
foreach ($dates as $key => $date) {
|
||||
if ($date->estado == "I") {
|
||||
if ($date->action_at) {
|
||||
@ -140,7 +197,7 @@ class OrdenTrabajoTareaEntity extends Entity
|
||||
}
|
||||
}
|
||||
if ($date->estado == "S" || $date->estado == "F") {
|
||||
if ($date->action_at) {
|
||||
if ($date->action_at && $init) {
|
||||
$end = Time::createFromFormat('Y-m-d H:i:s', $date->action_at);
|
||||
$intervals[] = $init->difference($end)->getSeconds();
|
||||
}
|
||||
@ -152,5 +209,33 @@ class OrdenTrabajoTareaEntity extends Entity
|
||||
{
|
||||
return $this->attributes['click_end'] - $this->attributes['click_init'];
|
||||
}
|
||||
|
||||
public function isCosido(): bool
|
||||
{
|
||||
$isTareaCosido = false;
|
||||
$pm = $this->presupuesto_manipulado();
|
||||
if ($pm) {
|
||||
$isTareaCosido = $pm->tarifa()->isCosido();
|
||||
}
|
||||
return $isTareaCosido;
|
||||
}
|
||||
public function isImpresion() : bool
|
||||
{
|
||||
return $this->attributes['presupuesto_linea_id'] != null;
|
||||
}
|
||||
public function isAcabado() : bool
|
||||
{
|
||||
return $this->attributes['presupuesto_acabado_id'] != null;
|
||||
}
|
||||
public function isManipulado() : bool
|
||||
{
|
||||
return $this->attributes['presupuesto_manipulado_id'] != null;
|
||||
}
|
||||
public function isEncuadernado() : bool
|
||||
{
|
||||
return $this->attributes['presupuesto_encuadernado_id'] != null;
|
||||
}
|
||||
public function isCorte() : bool
|
||||
{
|
||||
return $this->attributes['is_corte'];
|
||||
}
|
||||
}
|
||||
|
||||
@ -19,8 +19,13 @@ class OrdenTrabajoUserEntity extends Entity
|
||||
"interior_bn_user_id" => null,
|
||||
"interior_color_user_id" => null,
|
||||
"cubierta_user_id" => null,
|
||||
"sobrecubierta_user_id" => null,
|
||||
"guarda_user_id" => null,
|
||||
//ACABADO
|
||||
"plastificado_user_id" => null,
|
||||
"plakene_user_id" => null,
|
||||
"estampado_user_id" => null,
|
||||
"uvi_user_id" => null,
|
||||
"encuadernacion_user_id" => null,
|
||||
"corte_user_id" => null,
|
||||
"preparacion_interior_user_id" => null,
|
||||
|
||||
@ -24,6 +24,16 @@ class TarifaAcabadoEntity extends \CodeIgniter\Entity\Entity
|
||||
"deleted_at" => null,
|
||||
"created_at" => null,
|
||||
"updated_at" => null,
|
||||
'plastificado' => null,
|
||||
'plakene' => null,
|
||||
'rectractilado' => null,
|
||||
'estampado' => null,
|
||||
'uvi' => null,
|
||||
'plastificado_tipo' => null,
|
||||
'plakene_tipo' => null,
|
||||
'rectractilado_tipo' => null,
|
||||
'estampado_tipo' => null,
|
||||
'uvi_tipo' => null,
|
||||
];
|
||||
protected $casts = [
|
||||
"precio_min" => "float",
|
||||
@ -33,6 +43,16 @@ class TarifaAcabadoEntity extends \CodeIgniter\Entity\Entity
|
||||
"user_created_id" => "int",
|
||||
"user_updated_id" => "int",
|
||||
"is_deleted" => "int",
|
||||
'plastificado' => 'boolean',
|
||||
'plakene' => 'boolean',
|
||||
'rectractilado' => 'boolean',
|
||||
'estampado' => 'boolean',
|
||||
'uvi' => 'boolean',
|
||||
'plastificado_tipo' => '?string',
|
||||
'plakene_tipo' => '?string',
|
||||
'rectractilado_tipo' => '?string',
|
||||
'estampado_tipo' => '?string',
|
||||
'uvi_tipo' => '?string',
|
||||
];
|
||||
/**
|
||||
* Devuelve las maquinas asociadas a esta tarifa de acabado
|
||||
@ -48,6 +68,7 @@ class TarifaAcabadoEntity extends \CodeIgniter\Entity\Entity
|
||||
|
||||
public function isUVI(): bool
|
||||
{
|
||||
return in_array($this->attributes["code"],["R3D","R2D"]);
|
||||
return $this->attributes['uvi'];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -33,4 +33,9 @@ class TarifaManipuladoEntity extends \CodeIgniter\Entity\Entity
|
||||
"user_updated_id" => "int",
|
||||
"is_deleted" => "int",
|
||||
];
|
||||
|
||||
public function isCosido(): bool
|
||||
{
|
||||
return in_array($this->attributes['id'], [3, 17]);
|
||||
}
|
||||
}
|
||||
|
||||
@ -676,6 +676,7 @@ return [
|
||||
"menu_tarifacliente" => "Fees",
|
||||
|
||||
"menu_configuration" => "Settings",
|
||||
"menu_config_holidays" => "Holidays",
|
||||
"menu_calendario" => "Calendar",
|
||||
"menu_paises" => "Countries",
|
||||
"menu_correo" => "Mail",
|
||||
@ -699,7 +700,7 @@ return [
|
||||
|
||||
"menu_digitalizacion" => "Digitalisation",
|
||||
|
||||
"menu_importacion" => "Import",
|
||||
"menu_importadores" => "Import",
|
||||
|
||||
"menu_catalogo" => "Catalogue",
|
||||
"menu_catalogo_libros" => "Books",
|
||||
@ -761,6 +762,7 @@ return [
|
||||
"menu_tarifaimpresion" => "Printing",
|
||||
|
||||
"menu_users" => "Users",
|
||||
"menu_change_session" => "Seleccionar turno",
|
||||
"menu_permission_group" => "Roles and permissions",
|
||||
|
||||
"menu_registration" => "Registration",
|
||||
|
||||
7
ci4/app/Language/en/Festivos.php
Normal file
7
ci4/app/Language/en/Festivos.php
Normal file
@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
|
||||
return [
|
||||
'date' => 'Date',
|
||||
'moduleTitle' => 'Holidays'
|
||||
];
|
||||
@ -1,13 +1,19 @@
|
||||
<?php
|
||||
return [
|
||||
'id' => 'ID',
|
||||
'fechaCreacion' => 'Fecha de creación',
|
||||
"fechaAlbaran" => 'Fecha de albarán',
|
||||
'numEnvio' => 'Número de envío',
|
||||
'cliente' => 'Cliente',
|
||||
'albaran' => 'Albarán',
|
||||
'numAlbaran' => 'Número de albarán',
|
||||
'numPedidos' => 'Número de Pedidos',
|
||||
'unidadesTotal' => 'Unidades Totales',
|
||||
'albaranes' => 'Albaranes',
|
||||
'att' => 'Att',
|
||||
'direccion' => 'Dirección',
|
||||
'cajas' => 'Cajas',
|
||||
'acciones' => 'Acciones',
|
||||
|
||||
'unidades' => 'Unidades',
|
||||
'titulo' => 'Título',
|
||||
@ -28,4 +34,6 @@ return [
|
||||
|
||||
'iva4' => 'IVA 4%',
|
||||
'iva21' => 'IVA 21%',
|
||||
|
||||
'editAlbaran' => 'Editar albarán',
|
||||
];
|
||||
@ -690,6 +690,7 @@ return [
|
||||
"menu_configuration" => "Configuración",
|
||||
"menu_variables" => "Variables sistema",
|
||||
"menu_config_messages" => "Mensajería",
|
||||
"menu_config_holidays" => "Festivos",
|
||||
"menu_error_presupuesto" => "Errores presupuesto",
|
||||
"menu_calendario" => "Calendario",
|
||||
"menu_paises" => "Paises",
|
||||
@ -719,7 +720,9 @@ return [
|
||||
|
||||
"menu_digitalizacion" => "Digitalización",
|
||||
|
||||
"menu_importacion" => "Importación",
|
||||
"menu_importadores" => "Importadores",
|
||||
"menu_importadores_catalogo" => "Desde catálogo",
|
||||
"menu_importadores_bubok" => "Bubok",
|
||||
|
||||
"menu_catalogo" => "Catálogo",
|
||||
"menu_catalogo_libros" => "Libros",
|
||||
|
||||
@ -46,6 +46,8 @@ return [
|
||||
'userCreatedId' => 'User Created ID',
|
||||
'userUpdateId' => 'User Update ID',
|
||||
'vencimiento' => 'Vencimiento',
|
||||
'removeEnvioBase' => 'No añadir Envio Base',
|
||||
'forzarRotativaPod' => 'Forzar rotativa en POD',
|
||||
|
||||
'direccionesEnvio' => 'Direcciones de Envío',
|
||||
|
||||
|
||||
7
ci4/app/Language/es/Festivos.php
Normal file
7
ci4/app/Language/es/Festivos.php
Normal file
@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
|
||||
return [
|
||||
'date' => 'Fecha',
|
||||
'moduleTitle' => 'Festivos'
|
||||
];
|
||||
82
ci4/app/Language/es/Importador.php
Normal file
82
ci4/app/Language/es/Importador.php
Normal file
@ -0,0 +1,82 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'moduleTitle' => 'Importadores',
|
||||
'importadorCatalogoTitle' => 'Importador RA-MA Ediciones S.L.',
|
||||
'importadorBubokTitle' => 'Importador BUBOK Publishing S.L.',
|
||||
'catalogo' => 'catálogo',
|
||||
'input' => 'ISBN',
|
||||
'descripcion' => 'Título',
|
||||
'idlinea' => 'Ref. cliente',
|
||||
'cnt_pedida' => 'Unidades',
|
||||
'precio_compra' => 'Precio Compra',
|
||||
'importar' => 'Importar',
|
||||
'subirArchivoRama' => 'Cargar Excel proporcionado por RA-MA',
|
||||
'subirArchivoBubok' => 'Cargar XML proporcionado por BUBOK',
|
||||
|
||||
'libro' => 'libro',
|
||||
'id' => 'ID',
|
||||
'clienteId' => 'Cliente',
|
||||
'cliente' => 'Cliente',
|
||||
'userCreatedId' => 'Usuario Creador',
|
||||
'userUpdateId' => 'Usuario Actualizador',
|
||||
'portada' => 'Portada',
|
||||
'ancho' => 'Ancho',
|
||||
'alto' => 'Alto',
|
||||
'peso' => 'Peso',
|
||||
'titulo' => 'Título',
|
||||
'autor' => 'Autor',
|
||||
'autorEntidad' => 'Entidad del Autor',
|
||||
'traductor' => 'Traductor',
|
||||
'ilustrador' => 'Ilustrador',
|
||||
'idioma' => 'Idioma',
|
||||
'numEdic' => 'Número de Edición',
|
||||
'edicion' => 'Edición',
|
||||
'fechaDisponibilidad' => 'Fecha de Disponibilidad',
|
||||
'fechaPublic' => 'Fecha de Publicación',
|
||||
'numFotos' => 'Número de Fotos',
|
||||
'numIlustr' => 'Número de Ilustraciones',
|
||||
'numIlustrColor' => 'Ilustraciones a Color',
|
||||
'numIlustrBn' => 'Ilustraciones en Blanco y Negro',
|
||||
'coleccion' => 'Colección',
|
||||
'isbn' => 'ISBN',
|
||||
'ean' => 'EAN',
|
||||
'editorial' => 'Editorial',
|
||||
'resumen' => 'Resumen',
|
||||
'resumenBreve' => 'Resumen Breve',
|
||||
'sello' => 'Sello',
|
||||
'paginas' => 'Páginas',
|
||||
'tipoImpresion' => 'Tipo de Impresión',
|
||||
'seleccionarTipoImpresion' => 'Seleccionar tipo de impresión',
|
||||
'solapasAncho' => 'Ancho de Solapas',
|
||||
'cubiertasAncho' => 'Ancho de Cubiertas',
|
||||
'comentarios' => 'Comentarios',
|
||||
'negroPaginas' => 'Páginas Negras',
|
||||
'negroPapel' => 'Papel Negro',
|
||||
'negroGramaje' => 'Gramaje Negro',
|
||||
'colorPaginas' => 'Páginas a Color',
|
||||
'colorPapel' => 'Papel a Color',
|
||||
'colorGramaje' => 'Gramaje Color',
|
||||
'portadaPaginas' => 'Páginas de Portada',
|
||||
'portadaPapel' => 'Papel de Portada',
|
||||
'portadaGramaje' => 'Gramaje Portada',
|
||||
'portadaAcabado' => 'Acabado Portada',
|
||||
'cubiertaPaginas' => 'Páginas de Cubierta',
|
||||
'cubiertaPapel' => 'Papel de Cubierta',
|
||||
'cubiertaGramaje' => 'Gramaje Cubierta',
|
||||
'cubiertaAcabado' => 'Acabado Cubierta',
|
||||
'encuardenacion' => 'Encuadernación',
|
||||
'ubicacion' => 'Ubicación',
|
||||
'createdAt' => 'Fecha de Creación',
|
||||
'updatedAt' => 'Fecha de Actualización',
|
||||
'deletedAt' => 'Fecha de Eliminación',
|
||||
|
||||
'catalogoLibro' => 'Libro',
|
||||
'catalogoLibroList' => 'Lista de Libros',
|
||||
'datosGenerales' => 'Datos generales del libro',
|
||||
'otrosDatosLibro' => 'Otros datos del libro',
|
||||
'configuracionLibro' => 'Configuración del libro',
|
||||
'ficherosLibro' => 'Ficheros',
|
||||
'created_by_at' => 'Creado:',
|
||||
'updated_by_at' => 'Actualizado:',
|
||||
];
|
||||
@ -9,12 +9,13 @@ return [
|
||||
'albaranes' => 'Albaranes',
|
||||
'envioSimpleMultiple' => 'Envío simple/múltiple',
|
||||
'nuevoEnvio' => 'Nuevo envío',
|
||||
'buscadorPedidosTitle' => 'Código Pedido o ISBN',
|
||||
'buscadorPedidosTitle2' => 'Código Pedido o título',
|
||||
'buscadorPedidosTitle' => 'Código OT o ISBN',
|
||||
'buscadorPedidosTitle2' => 'Código OT o título',
|
||||
'selectDirecciones' => 'Dirección de envio',
|
||||
'listadoEnvios' => 'Listado de envíos',
|
||||
'idEnvio' => 'ID Envío',
|
||||
'numeroPedidos' => 'Nº Pedidos',
|
||||
'numeroOts' => 'Nº OTs',
|
||||
'numeroLineas' => 'Nº Líneas',
|
||||
'att' => 'Att',
|
||||
'direccion' => 'Dirección',
|
||||
@ -28,6 +29,8 @@ return [
|
||||
'backToPanel' => 'Volver al panel',
|
||||
'no' => 'No',
|
||||
'si' => 'Sí',
|
||||
'todos' => 'Todos',
|
||||
'impresoraEtiquetas' => 'Impresora de etiquetas',
|
||||
|
||||
'envio' => 'Envío',
|
||||
'addLineasEnvio' => 'Añadir líneas al envío',
|
||||
|
||||
@ -1,15 +1,25 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
"navs" => [
|
||||
'finalizadas' => 'Finalizadas',
|
||||
'pendientes' => 'Pendientes',
|
||||
'pendientes_ferro' => 'Ferro pendiente',
|
||||
'ferro_ok' => 'Ferro/Prototipo OK',
|
||||
'news' => 'Nuevas',
|
||||
'waiting' => 'En espera',
|
||||
'revision_com' => 'Revisión comercial',
|
||||
'prod' => 'Producción'
|
||||
],
|
||||
"datatable" => [
|
||||
"pedido_id"=> "Pedido ID",
|
||||
"fecha_encuadernacion"=> "Fecha encuadernación",
|
||||
"fecha_impresion"=> "Fecha impresión",
|
||||
"cliente"=> "Cliente",
|
||||
"titulo"=> "Título",
|
||||
"ubicacion"=> "Ubicación",
|
||||
"tirada"=> "Tirada",
|
||||
"impresion"=> "Impresión",
|
||||
"pedido_id" => "Pedido ID",
|
||||
"fecha_encuadernacion" => "Fecha encuadernación",
|
||||
"fecha_impresion" => "Fecha impresión",
|
||||
"cliente" => "Cliente",
|
||||
"titulo" => "Título",
|
||||
"ubicacion" => "Ubicación",
|
||||
"tirada" => "Tirada",
|
||||
"impresion" => "Impresión",
|
||||
"fecha_entrega_at" => "Fecha entrega prevista",
|
||||
"maquina" => "Máquina",
|
||||
"ancho" => "Ancho",
|
||||
@ -31,8 +41,6 @@ return [
|
||||
"pliegos" => "Pliegos",
|
||||
"pliegos_libro" => "Pliegos",
|
||||
"fecha" => "fecha"
|
||||
|
||||
|
||||
],
|
||||
"task" => [
|
||||
"order" => "Orden",
|
||||
@ -43,13 +51,15 @@ return [
|
||||
"maquina_actual" => "Máquina actual",
|
||||
"tiempo_estimado" => "Tiempo estimado",
|
||||
"tiempo" => "Tiempo",
|
||||
"proveedor" => "Proveedor",
|
||||
"imposicion" => "Imposición"
|
||||
],
|
||||
"finalizadas" => "Finalizadas",
|
||||
"pendiente_ferro" => "Ferro pendiente",
|
||||
"pendientes" => "Pendientes",
|
||||
"ferro_ok" => "Ferro ok",
|
||||
"ferro_ok" => "Ferro/Prototipo ok",
|
||||
"envio" => "Envío",
|
||||
"ferro" => "Ferro",
|
||||
"ot" => "Orden trabajo",
|
||||
"ots" => "Órdenes trabajo",
|
||||
"tiempo_procesamiento" => "Tiempo procesamiento",
|
||||
@ -69,6 +79,7 @@ return [
|
||||
"portada" => "portada",
|
||||
"plakene_traslucido" => "Plakene traslúcido",
|
||||
"plastificado_mate" => "Plastificado mate",
|
||||
"plastificado" => "Plastificado",
|
||||
"espiral" => "Espiral",
|
||||
"embalaje" => "Embalaje",
|
||||
"tiempo_consumido" => "Tiempo consumido",
|
||||
@ -79,6 +90,7 @@ return [
|
||||
"preview_pdf" => "Previsualizar PDF",
|
||||
"imprimir_codigo_safekat" => "Imprimir código SAFEKAT",
|
||||
"imprimir_ferro" => "Imprimir ferro",
|
||||
"imprimir_prototipo" => "Prototipo",
|
||||
"planning_rotativa" => "Planificación rotativa",
|
||||
"planning_plana" => "Planificación plana",
|
||||
"solapa" => "Solapa",
|
||||
@ -96,19 +108,23 @@ return [
|
||||
"grapado" => "Grapado",
|
||||
"solapa" => "Solapas",
|
||||
"retractilado" => "Retractilado",
|
||||
"manipulado" => "Entrada manipulado",
|
||||
"retractilado5" => "Retractilado 5",
|
||||
"prototipo" => "Prototipo",
|
||||
"marcapaginas" => "Marcapáginas",
|
||||
//IMPRESION
|
||||
"impresion_bn" => "Impresión BN",
|
||||
"cubierta" => "Cubierta/Portada",
|
||||
"guarda" => "Guarda",
|
||||
"encuadernacion" => "Encuadernación",
|
||||
|
||||
//PREIMPRESION
|
||||
"pre_formato" => "Revisión formato",
|
||||
"pre_lomo" => "Revisión lomo",
|
||||
"pre_solapa" => "Revisión solapa",
|
||||
"pre_codbarras" => "Revisión código barras",
|
||||
"pre_imposicion" => "Revisión imposición",
|
||||
|
||||
|
||||
"iniciada" => "Iniciada",
|
||||
"finalizada" => "Finalizada",
|
||||
"error" => "Error",
|
||||
@ -120,9 +136,10 @@ return [
|
||||
"attr_not_exist" => "El atributo {0,string} no pertenece al modelo Pedido"
|
||||
|
||||
],
|
||||
|
||||
|
||||
"progress_ferro" => "Ferro",
|
||||
"progress_preimpresion" => "Preimpresión",
|
||||
"progress_logistica" => "Ferro/Logística",
|
||||
"progress_logistica" => "Logística",
|
||||
"progress_impresion" => "Impresión",
|
||||
"progress_manipulado" => "Manipulado/Acabado",
|
||||
|
||||
@ -130,6 +147,7 @@ return [
|
||||
"maquinas" => "Máquinas",
|
||||
"tareas_hoy" => "Tareas para HOY",
|
||||
"tareas_all" => "Todas",
|
||||
"tareas_delay" => "Aplazadas",
|
||||
"play_tarea" => "Continuar",
|
||||
"play_pause" => "Pausar",
|
||||
"play_stop" => "Aplazar",
|
||||
@ -137,11 +155,24 @@ return [
|
||||
"cancel" => "Cancelar",
|
||||
|
||||
],
|
||||
'tarea_estados' => [
|
||||
'P' => 'Pendiente',
|
||||
'I' => 'Iniciada',
|
||||
'F' => 'Finalizada',
|
||||
'S' => 'Pausada',
|
||||
'D' => 'Aplazada',
|
||||
'E' => 'Error'
|
||||
],
|
||||
'duplicate_estado_tarea_progress' => "Último estado de la tarea repetido",
|
||||
'task_already_finished' => "La tarea se ha marcado como finalizada.",
|
||||
'print_label' => "Imprimir etiqueta",
|
||||
'click_init' => "Clicks al inicio",
|
||||
'click_end' => "Clicks al final",
|
||||
|
||||
|
||||
];
|
||||
"comentarios" => "Comentarios",
|
||||
"comentariosOt" => "Comentarios orden",
|
||||
"comentariosImpresionInterior" => "Comentarios interior",
|
||||
"comentariosCubierta" => "Comentarios cubierta",
|
||||
"comentariosEncuadernacion" => "Comentarios encuadernación",
|
||||
"comentariosLogistica" => "Comentarios logística",
|
||||
"info_solapa_guillotina" => "Datos solapa y preparación guillotina",
|
||||
];
|
||||
|
||||
@ -67,6 +67,12 @@ return [
|
||||
'vencimientosPermission' => 'Vencimientos',
|
||||
"ticketsSection" => "Tickets",
|
||||
'produccionSection' => 'Producción',
|
||||
'catalogoSection' => 'Catálogo',
|
||||
'importadoresSection' => 'Importadores',
|
||||
'catalogoPermission' => 'Desde catálogo',
|
||||
'bubokPermission' => 'Bubok',
|
||||
|
||||
|
||||
|
||||
'validation' => [
|
||||
'id' => [
|
||||
|
||||
@ -173,6 +173,37 @@ class AlbaranModel extends \App\Models\BaseModel
|
||||
return $albaran_data;
|
||||
}
|
||||
|
||||
|
||||
public function getAlbaranData($albaran_id=null){
|
||||
if (!$albaran_id) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$albaran_data = $this->db->table('albaranes t1')
|
||||
->select("
|
||||
t1.id,
|
||||
t1.att_albaran AS att,
|
||||
t1.direccion_albaran AS direccion,
|
||||
t1.envio_id,
|
||||
t1.numero_albaran AS numero_albaran,
|
||||
DATE_FORMAT(t1.created_at, '%d/%m/%Y') AS fecha_creacion,
|
||||
DATE_FORMAT(t1.fecha_albaran, '%d/%m/%Y') AS fecha_albaran,
|
||||
t1.mostrar_precios AS mostrar_precios,
|
||||
t2.nombre AS cliente,
|
||||
t1.cajas AS cajas
|
||||
")
|
||||
->join('clientes t2', 't1.cliente_id = t2.id', 'left')
|
||||
->where('t1.id', $albaran_id)
|
||||
->where('t1.deleted_at IS NULL')
|
||||
->get()
|
||||
->getResultObject();
|
||||
if (count($albaran_data) == 0) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return $albaran_data[0];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get resource data for creating PDFs.
|
||||
*
|
||||
@ -203,4 +234,25 @@ class AlbaranModel extends \App\Models\BaseModel
|
||||
|
||||
return $builder;
|
||||
}
|
||||
|
||||
public function getDatatableQuery()
|
||||
{
|
||||
$builder = $this->db
|
||||
->table($this->table . " t1")
|
||||
->select(
|
||||
"t1.id, t1.numero_albaran as numero_albaran, t1.envio_id as envio_id, GROUP_CONCAT(DISTINCT t4.id) AS pedidos,
|
||||
t5.nombre as cliente, t1.att_albaran as att, t1.direccion_albaran as direccion, SUM(t2.cantidad) as unidades_total,
|
||||
t1.cajas as cajas"
|
||||
)
|
||||
->join("albaranes_lineas t2", "t1.id = t2.albaran_id", "left")
|
||||
->join("pedidos_linea t3", "t2.pedido_linea_id = t3.id", "left")
|
||||
->join("pedidos t4", "t3.pedido_id = t4.id", "left")
|
||||
->join("clientes t5", "t1.cliente_id = t5.id", "left");
|
||||
|
||||
$builder->where("t1.deleted_at IS NULL");
|
||||
$builder->where("t2.deleted_at IS NULL");
|
||||
$builder->groupBy("t1.id");
|
||||
|
||||
return $builder;
|
||||
}
|
||||
}
|
||||
@ -61,6 +61,8 @@ class ClienteModel extends \App\Models\BaseModel
|
||||
"comentarios",
|
||||
"user_created_id",
|
||||
"user_update_id",
|
||||
"no_envio_base",
|
||||
"forzar_rotativa_pod",
|
||||
];
|
||||
protected $returnType = ClienteEntity::class;
|
||||
protected $useSoftDeletes = true;
|
||||
|
||||
@ -214,4 +214,12 @@ class ProveedorModel extends \App\Models\BaseModel
|
||||
|
||||
return $builder->get()->getResultObject();
|
||||
}
|
||||
public function querySelect(?string $q)
|
||||
{
|
||||
$query = $this->builder()->select(['id','nombre as name']);
|
||||
if($q){
|
||||
$query->like('nombre',$q);
|
||||
}
|
||||
return $query;
|
||||
}
|
||||
}
|
||||
|
||||
72
ci4/app/Models/Configuracion/FestivoModel.php
Executable file
72
ci4/app/Models/Configuracion/FestivoModel.php
Executable file
@ -0,0 +1,72 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Configuracion;
|
||||
|
||||
use App\Entities\Configuracion\FestivoEntity;
|
||||
use App\Models\BaseModel;
|
||||
|
||||
class FestivoModel extends BaseModel
|
||||
{
|
||||
protected $table = "festivos";
|
||||
protected $primaryKey = 'id';
|
||||
|
||||
protected $allowedFields = ["date"];
|
||||
protected $returnType = FestivoEntity::class;
|
||||
protected $useAutoIncrement = true;
|
||||
protected $useSoftDeletes = true;
|
||||
protected $protectFields = true;
|
||||
|
||||
|
||||
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 $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 = [];
|
||||
|
||||
|
||||
|
||||
|
||||
protected $validationRules = [
|
||||
|
||||
"date" => [
|
||||
"label" => "Festivos.date",
|
||||
"rules" => "required|valid_date[Y-m-d]",
|
||||
],
|
||||
|
||||
];
|
||||
|
||||
protected $validationMessages = [
|
||||
"date" => [
|
||||
"valid_date" => "Validation.valid_date",
|
||||
],
|
||||
];
|
||||
|
||||
public function isFestivo($date)
|
||||
{
|
||||
return $this->where('date',$date)->countAllResults() > 0 ? true : false;
|
||||
}
|
||||
|
||||
}
|
||||
@ -427,6 +427,9 @@ class MaquinaModel extends \App\Models\BaseModel
|
||||
->where('tarea_progress.deleted_at', null)
|
||||
->groupBy('lg_maquinas.id')
|
||||
->orderBy('countTareas','DESC');
|
||||
if($maquina_tipo == "impresion"){
|
||||
$query->where('orden_trabajo_tareas.is_corte',0);
|
||||
}
|
||||
|
||||
return $query;
|
||||
}
|
||||
|
||||
@ -37,7 +37,7 @@ class EnvioLineaModel extends Model
|
||||
->select(
|
||||
"t1.id, t1.pedido_id as pedido, t3.id as presupuesto,
|
||||
t3.titulo as titulo, t1.unidades_envio as unidadesEnvio, t1.unidades_envio as unidadesEnvioRaw,
|
||||
t1.unidades_total as unidadesTotal,
|
||||
t1.unidades_total as unidadesTotal, t2.tipo_envio as tipo_envio,
|
||||
IFNULL((
|
||||
SELECT SUM(t_sub.unidades_envio)
|
||||
FROM envios_lineas t_sub
|
||||
|
||||
@ -32,23 +32,44 @@ class EnvioModel extends Model
|
||||
'created_at',
|
||||
'updated_at',
|
||||
'cajas',
|
||||
'tipo_envio',
|
||||
];
|
||||
|
||||
protected $useTimestamps = true;
|
||||
protected $createdField = 'created_at';
|
||||
protected $updatedField = 'updated_at';
|
||||
|
||||
public function getDatatableQuery(): BaseBuilder
|
||||
public function getDatatableQuery($tipo_envio = "estandar"): BaseBuilder
|
||||
{
|
||||
$builder = $this->db
|
||||
->table($this->table . " t1")
|
||||
->select(
|
||||
"t1.id, GROUP_CONCAT(DISTINCT t2.pedido_id) AS pedidos,
|
||||
"t1.id, GROUP_CONCAT(DISTINCT t5.id) AS ots,
|
||||
COUNT(t2.id) AS num_lineas,
|
||||
t1.att, t1.direccion, t1.ciudad, t3.nombre as pais, t1.cp, t1.email, t1.telefono, t1.finalizado"
|
||||
);
|
||||
$builder->join("envios_lineas t2", "t2.envio_id = t1.id", "left");
|
||||
$builder->join("lg_paises t3", "t3.id = t1.pais_id", "left");
|
||||
$builder->join("pedidos t4", "t4.id = t2.pedido_id", "left");
|
||||
$builder->join('ordenes_trabajo t5', 't5.pedido_id = t4.id');
|
||||
$builder->where("t1.tipo_envio", $tipo_envio);
|
||||
|
||||
$builder->groupBy("t1.id");
|
||||
return $builder;
|
||||
}
|
||||
|
||||
public function getDatatableQueryFerroPrototipo(): BaseBuilder
|
||||
{
|
||||
$builder = $this->db
|
||||
->table($this->table . " t1")
|
||||
->select(
|
||||
"t1.id, GROUP_CONCAT(DISTINCT t5.id) AS ots,
|
||||
t1.att, t1.direccion, t1.ciudad, t3.nombre as pais, t1.cp, t1.email, t1.telefono, t1.finalizado"
|
||||
);
|
||||
$builder->join("lg_paises t3", "t3.id = t1.pais_id", "left");
|
||||
$builder->join("pedidos t4", "t4.id = t2.pedido_id", "left");
|
||||
$builder->join('ordenes_trabajo t5', 't5.pedido_id = t4.id');
|
||||
$builder->whereIn("t1.tipo_envio", ["estandar"]);
|
||||
|
||||
$builder->groupBy("t1.id");
|
||||
return $builder;
|
||||
|
||||
@ -22,8 +22,14 @@ class OrdenTrabajoDate extends Model
|
||||
"interior_bn_at",
|
||||
"interior_color_at",
|
||||
"cubierta_at",
|
||||
"sobrecubierta_at", //TODO
|
||||
"guarda_at", //TODO
|
||||
//ACABADO
|
||||
"plastificado_at",
|
||||
"plakene_at", //TODO
|
||||
"retractilado_at",
|
||||
"estampado_at", //TODO
|
||||
"uvi_at", //TODO
|
||||
"encuadernacion_at",
|
||||
"corte_at",
|
||||
"preparacion_interiores_at",
|
||||
@ -31,7 +37,6 @@ class OrdenTrabajoDate extends Model
|
||||
"cosido_at",
|
||||
"solapa_at",
|
||||
"grapado_at",
|
||||
"retractilado_at",
|
||||
"retractilado5_at",
|
||||
"prototipo_at",
|
||||
"marcapaginas_at",
|
||||
|
||||
@ -25,6 +25,11 @@ class OrdenTrabajoModel extends Model
|
||||
"progreso",
|
||||
"estado",
|
||||
"comentarios",
|
||||
"comment_interior",
|
||||
"comment_cubierta",
|
||||
"comment_encuadernacion",
|
||||
"comment_logistica",
|
||||
"info_solapa_guillotina",
|
||||
"revisar_formato",
|
||||
"revisar_lomo",
|
||||
"revisar_solapa",
|
||||
|
||||
@ -32,7 +32,11 @@ class OrdenTrabajoTarea extends Model
|
||||
"tipo_corte",
|
||||
"comment",
|
||||
"click_init",
|
||||
"click_end"
|
||||
"click_end",
|
||||
"pliego_1",
|
||||
"pliego_1_total",
|
||||
"pliego_2",
|
||||
"pliego_2_total"
|
||||
];
|
||||
|
||||
protected bool $allowEmptyInserts = false;
|
||||
|
||||
@ -23,11 +23,18 @@ class OrdenTrabajoUser extends Model
|
||||
"interior_bn_user_id",
|
||||
"interior_color_user_id",
|
||||
"cubierta_user_id",
|
||||
"sobrecubierta_user_id",
|
||||
"guarda_user_id",
|
||||
//ACABADO
|
||||
"plastificado_user_id",
|
||||
"plakene_user_id",
|
||||
"retractilado_user_id",
|
||||
"estampado_user_id",
|
||||
"uvi_user_id",
|
||||
//ENCUADERNADO
|
||||
"encuadernacion_user_id",
|
||||
"corte_user_id",
|
||||
"preparacion_interior_user_id",
|
||||
"corte_user_id",
|
||||
"entrada_manipulado_user_id",
|
||||
"cosido_user_id",
|
||||
"solapa_user_id",
|
||||
|
||||
@ -45,6 +45,7 @@ class PresupuestoDireccionesModel extends \App\Models\BaseModel
|
||||
"proveedor_id",
|
||||
"proveedor",
|
||||
"entregaPieCalle",
|
||||
"is_ferro_prototipo"
|
||||
];
|
||||
|
||||
protected $returnType = "App\Entities\Presupuestos\PresupuestoDireccionesEntity";
|
||||
@ -69,7 +70,8 @@ class PresupuestoDireccionesModel extends \App\Models\BaseModel
|
||||
t1.email AS email, t1.direccion AS direccion, t1.pais_id AS pais_id, t2.nombre AS pais,
|
||||
t1.municipio AS municipio, t1.provincia AS provincia, t1.cp AS cp, t1.telefono AS telefono,
|
||||
t1.peso AS peso, t1.cantidad AS cantidad, t1.precio AS precio, t1.margen AS margen,
|
||||
t1.proveedor_id AS proveedor_id, t1.proveedor AS proveedor, t1.entregaPieCalle AS entregaPieCalle"
|
||||
t1.proveedor_id AS proveedor_id, t1.proveedor AS proveedor, t1.entregaPieCalle AS entregaPieCalle,
|
||||
t1.is_ferro_prototipo AS is_ferro_prototipo"
|
||||
);
|
||||
|
||||
$builder->where('t1.presupuesto_id', $presupuesto_id);
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Tarifas\Acabados;
|
||||
|
||||
class TarifaAcabadoModel extends \App\Models\BaseModel
|
||||
@ -33,6 +34,16 @@ class TarifaAcabadoModel extends \App\Models\BaseModel
|
||||
"is_deleted",
|
||||
"user_created_id",
|
||||
"user_updated_id",
|
||||
'plastificado',
|
||||
'plakene',
|
||||
'rectractilado',
|
||||
'estampado',
|
||||
'uvi',
|
||||
'plastificado_tipo',
|
||||
'plakene_tipo',
|
||||
'rectractilado_tipo',
|
||||
'estampado_tipo',
|
||||
'uvi_tipo'
|
||||
];
|
||||
protected $returnType = 'App\Entities\Tarifas\Acabados\TarifaAcabadoEntity';
|
||||
|
||||
@ -96,9 +107,9 @@ class TarifaAcabadoModel extends \App\Models\BaseModel
|
||||
return empty($search)
|
||||
? $builder
|
||||
: $builder
|
||||
->groupStart()
|
||||
->like("t1.nombre", $search)
|
||||
->groupEnd();
|
||||
->groupStart()
|
||||
->like("t1.nombre", $search)
|
||||
->groupEnd();
|
||||
}
|
||||
|
||||
public function getServiciosAcabadoSelector()
|
||||
|
||||
@ -9,7 +9,7 @@ class EmailService
|
||||
public function send(string $subject, string $body, $recipient): bool
|
||||
{
|
||||
|
||||
$skEnv = env('sk_environment', 'production'); // fallback a producción si no está definido
|
||||
$skEnv = env('SK_ENVIRONMENT', 'production'); // fallback a producción si no está definido
|
||||
|
||||
// Si no estamos en producción, forzar el destinatario a uno fijo
|
||||
if ($skEnv !== 'production') {
|
||||
|
||||
@ -57,7 +57,7 @@ class ImpresoraEtiquetaService extends BaseService
|
||||
return ["impresora" => $impresora, "content" => $th->getMessage(), "status" => $status];
|
||||
}
|
||||
}
|
||||
protected function createEtiqueta(array $data_label = []): ?string
|
||||
public function createEtiqueta(array $data_label = []): ?string
|
||||
{
|
||||
$xml = new DOMDocument('1.0', 'utf-8');
|
||||
$labels = $xml->createElement("labels");
|
||||
@ -76,7 +76,7 @@ class ImpresoraEtiquetaService extends BaseService
|
||||
$xml->appendChild($labels);
|
||||
return $xml->saveXML();
|
||||
}
|
||||
protected function sendToImpresoraEtiqueta(string $name, string $content, ImpresoraEtiquetaEntity $impresoraEtiqueta): bool
|
||||
public function sendToImpresoraEtiqueta(string $name, string $content, ImpresoraEtiquetaEntity $impresoraEtiqueta): bool
|
||||
{
|
||||
$tmpFile = tmpfile();
|
||||
|
||||
|
||||
@ -7,111 +7,6 @@ use Config\Services;
|
||||
|
||||
class LogisticaService
|
||||
{
|
||||
public static function findPedidoOrISBN($search)
|
||||
{
|
||||
$multienvio = false;
|
||||
$direcciones = [];
|
||||
|
||||
$modelPedido = model('App\Models\Pedidos\PedidoModel');
|
||||
|
||||
$search = trim($search);
|
||||
$searchClean = str_replace('-', '', $search);
|
||||
$modelPedido = model('App\Models\Pedidos\PedidoModel');
|
||||
|
||||
$builder = $modelPedido->builder();
|
||||
|
||||
$builder->select([
|
||||
'pedidos.id as pedido_id',
|
||||
'pedidos_linea.id as linea_id',
|
||||
'pedidos_linea.cantidad as cantidad_linea',
|
||||
'presupuestos.id as presupuesto_id',
|
||||
]);
|
||||
|
||||
$builder->join('pedidos_linea', 'pedidos_linea.pedido_id = pedidos.id', 'left');
|
||||
$builder->join('presupuestos', 'presupuestos.id = pedidos_linea.presupuesto_id', 'left');
|
||||
$builder->join('envios_lineas', 'envios_lineas.pedido_id = pedidos_linea.pedido_id', 'left');
|
||||
|
||||
$builder->groupStart()
|
||||
->where('pedidos.id', $search)
|
||||
->whereIn('pedidos.estado', ['finalizado', 'produccion'])
|
||||
->orWhere("REPLACE(presupuestos.isbn, '-', '')", $searchClean)
|
||||
->groupEnd();
|
||||
|
||||
$builder->groupBy('pedidos_linea.id');
|
||||
$builder->having('IFNULL(SUM(envios_lineas.unidades_envio), 0) < cantidad_linea', null, false);
|
||||
|
||||
|
||||
$result = $builder->get()->getResult();
|
||||
|
||||
if (empty($result)) {
|
||||
$response = [
|
||||
'status' => false,
|
||||
'message' => lang('Logistica.errors.notFound'),
|
||||
];
|
||||
return $response;
|
||||
}
|
||||
|
||||
$PresupuestoDireccionesModel = model('App\Models\Presupuestos\PresupuestoDireccionesModel');
|
||||
$numDirecciones = $PresupuestoDireccionesModel->where('presupuesto_id', $result[0]->presupuesto_id)
|
||||
->countAllResults();
|
||||
if ($numDirecciones == 0) {
|
||||
$response = [
|
||||
'status' => false,
|
||||
'message' => lang('Logistica.errors.noAddresses'),
|
||||
];
|
||||
return $response;
|
||||
} else if ($numDirecciones > 1) {
|
||||
$multienvio = true;
|
||||
$dirs = $PresupuestoDireccionesModel->select('direccion')->where('presupuesto_id', $result[0]->presupuesto_id)
|
||||
->findAll();
|
||||
foreach ($dirs as $key => $direccion) {
|
||||
$modelEnvioLineasModel = model('App\Models\Logistica\EnvioLineaModel');
|
||||
$unidades_en_direccion = $modelEnvioLineasModel->select('SUM(envios_lineas.unidades_envio) as unidades_enviadas,
|
||||
envios_lineas.unidades_total')
|
||||
->join('envios', 'envios.id = envios_lineas.envio_id')
|
||||
->where('pedido_id', $result[0]->pedido_id)
|
||||
->where('envios.direccion', $direccion->direccion)
|
||||
->where('envios.finalizado', 1)
|
||||
->groupBy('pedido_id')->get()->getResult();
|
||||
if (count($unidades_en_direccion) == 0 || $unidades_en_direccion[0]->unidades_enviadas < $unidades_en_direccion[0]->unidades_total) {
|
||||
array_push($direcciones, $direccion->direccion);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$response = [
|
||||
'status' => true,
|
||||
'data' => $result[0],
|
||||
];
|
||||
|
||||
if ($multienvio) {
|
||||
$response_envio = [
|
||||
'status' => true,
|
||||
'multienvio' => true,
|
||||
'direcciones' => $direcciones,
|
||||
'pedido_id' => $result[0]->pedido_id,
|
||||
];
|
||||
return $response_envio;
|
||||
}
|
||||
|
||||
|
||||
$direccion = $PresupuestoDireccionesModel->select('direccion')->where('presupuesto_id', $result[0]->presupuesto_id)
|
||||
->first()->direccion;
|
||||
$response_envio = LogisticaService::generateEnvio($result[0]->pedido_id, $direccion);
|
||||
if ($response_envio['status'] == false) {
|
||||
$response = [
|
||||
'status' => false,
|
||||
'message' => $response_envio['message'],
|
||||
];
|
||||
return $response;
|
||||
} else {
|
||||
$response['data']->id_envio = $response_envio['data']['id_envio'];
|
||||
$response['data']->multienvio = false;
|
||||
}
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static function findLineaEnvioPorEnvio(int $envio_id)
|
||||
@ -142,8 +37,8 @@ class LogisticaService
|
||||
// 3. Subconsulta principal
|
||||
$subBuilder = $db->table('pedidos_linea pl')
|
||||
->select("
|
||||
pl.id AS id,
|
||||
CONCAT('[', p.id, '] - ', pr.titulo) AS name,
|
||||
ot.id AS id,
|
||||
CONCAT('[', ot.id, '] - ', pr.titulo) AS name,
|
||||
(
|
||||
SELECT IFNULL(SUM(el.unidades_envio), 0)
|
||||
FROM envios_lineas el
|
||||
@ -183,15 +78,15 @@ class LogisticaService
|
||||
return $builder;
|
||||
}
|
||||
|
||||
public static function findPedidosNewEnvio()
|
||||
public static function findForNewEnvio()
|
||||
{
|
||||
$db = \Config\Database::connect();
|
||||
|
||||
// 3. Subconsulta principal
|
||||
$subBuilder = $db->table('pedidos_linea pl')
|
||||
->select("
|
||||
pl.id AS id,
|
||||
CONCAT('[', p.id, '] - ', pr.titulo) AS name,
|
||||
ot.id AS id,
|
||||
CONCAT('[', ot.id, '] - ', pr.titulo) AS name,
|
||||
(
|
||||
SELECT IFNULL(SUM(el.unidades_envio), 0)
|
||||
FROM envios_lineas el
|
||||
@ -199,6 +94,7 @@ class LogisticaService
|
||||
WHERE el.pedido_id = p.id
|
||||
AND el.presupuesto_id = pr.id
|
||||
AND e.finalizado = 1
|
||||
AND e.tipo_envio = 'estandar'
|
||||
) AS unidades_enviadas,
|
||||
pd.cantidad AS cantidad
|
||||
")
|
||||
@ -220,7 +116,47 @@ class LogisticaService
|
||||
return $builder;
|
||||
}
|
||||
|
||||
public static function findDireccionesNewEnvio($pedido_id, $searchVal = "")
|
||||
public static function findForNewEnvioFerro()
|
||||
{
|
||||
$db = \Config\Database::connect();
|
||||
|
||||
// 3. Subconsulta principal
|
||||
$subBuilder = $db->table('pedidos_linea pl')
|
||||
->select("
|
||||
ot.id AS id,
|
||||
CONCAT('[', ot.id, '] - ', pr.titulo) AS name,
|
||||
p.id as pedido_id,
|
||||
pr.id as presupuesto_id
|
||||
")
|
||||
->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('p.estado', ['finalizado', 'produccion'])
|
||||
->where('ot_dates.pendiente_ferro_at IS NOT NULL')
|
||||
->where('pd.is_ferro_prototipo', 1)
|
||||
->groupBy('pl.id');
|
||||
|
||||
// 4. Envolver y filtrar por unidades pendientes
|
||||
$builder = $db->table("({$subBuilder->getCompiledSelect(false)}) AS sub");
|
||||
$builder->select('id, name');
|
||||
$builder->orderBy('name', 'ASC');
|
||||
|
||||
$builder->where("
|
||||
NOT EXISTS (
|
||||
SELECT 1
|
||||
FROM envios e
|
||||
INNER JOIN envios_lineas le ON le.envio_id = e.id
|
||||
WHERE e.tipo_envio = 'ferro_prototipo'
|
||||
AND (le.pedido_id = sub.pedido_id OR le.presupuesto_id = sub.presupuesto_id)
|
||||
)
|
||||
", null, false);
|
||||
|
||||
return $builder;
|
||||
}
|
||||
|
||||
public static function findDireccionesNewEnvio($ot_id, $searchVal = "")
|
||||
{
|
||||
|
||||
$direcciones = [];
|
||||
@ -231,7 +167,9 @@ class LogisticaService
|
||||
->join('presupuestos pr', 'pr.id=presupuesto_direcciones.presupuesto_id')
|
||||
->join('pedidos_linea pl', 'pl.presupuesto_id = pr.id')
|
||||
->join('pedidos p', 'pl.pedido_id=p.id')
|
||||
->where('p.id', $pedido_id);
|
||||
->join('ordenes_trabajo ot', 'ot.pedido_id = p.id')
|
||||
->where('ot.id', $ot_id)
|
||||
->where("presupuesto_direcciones.is_ferro_prototipo", 0);
|
||||
if ($searchVal != "") {
|
||||
$dirs = $dirs->groupStart()
|
||||
->Like("id", $searchVal)
|
||||
@ -243,10 +181,13 @@ class LogisticaService
|
||||
$unidades_en_direccion = $modelEnvioLineasModel->select('SUM(envios_lineas.unidades_envio) as unidades_enviadas,
|
||||
envios_lineas.unidades_total')
|
||||
->join('envios', 'envios.id = envios_lineas.envio_id')
|
||||
->where('pedido_id', $pedido_id)
|
||||
->join('pedidos_linea', 'pedidos_linea.pedido_id = envios_lineas.pedido_id')
|
||||
->join('pedidos', 'pedidos.id = pedidos_linea.pedido_id')
|
||||
->join('ordenes_trabajo', 'ordenes_trabajo.pedido_id = pedidos.id')
|
||||
->where('ordenes_trabajo.id', $ot_id)
|
||||
->where('envios.direccion', $direccion->direccion)
|
||||
->where('envios.finalizado', 1)
|
||||
->groupBy('pedido_id')->get()->getResult();
|
||||
->groupBy('ordenes_trabajo.pedido_id')->get()->getResult();
|
||||
if (count($unidades_en_direccion) == 0 || $unidades_en_direccion[0]->unidades_enviadas < $unidades_en_direccion[0]->unidades_total) {
|
||||
array_push(
|
||||
$direcciones,
|
||||
@ -301,6 +242,7 @@ class LogisticaService
|
||||
->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')
|
||||
->where('pd.is_ferro_prototipo', 0)
|
||||
->where('p.id', $pedido_id)
|
||||
->whereIn('p.estado', ['finalizado', 'produccion'])
|
||||
->where("TRIM(LOWER(pd.direccion)) = '$direccionNormalizada'", null, false)
|
||||
@ -347,7 +289,7 @@ class LogisticaService
|
||||
|
||||
|
||||
|
||||
public static function generateEnvio($pedido_id, $direccion = null)
|
||||
public static function generateEnvio($ot_id, $direccion = null)
|
||||
{
|
||||
$presupuestoDireccionesModel = model('App\Models\Presupuestos\PresupuestoDireccionesModel');
|
||||
$direccionNormalizada = strtolower(trim($direccion));
|
||||
@ -364,6 +306,7 @@ class LogisticaService
|
||||
presupuesto_direcciones.pais_id,
|
||||
presupuesto_direcciones.cantidad as cantidad_total,
|
||||
presupuestos.cliente_id as cliente_id,
|
||||
ordenes_trabajo.pedido_id as pedido_id,
|
||||
|
||||
(
|
||||
presupuesto_direcciones.cantidad - IFNULL((
|
||||
@ -380,7 +323,9 @@ class LogisticaService
|
||||
->join('pedidos_linea', 'pedidos_linea.presupuesto_id = presupuesto_direcciones.presupuesto_id')
|
||||
->join('pedidos', 'pedidos.id = pedidos_linea.pedido_id')
|
||||
->join('presupuestos', 'pedidos_linea.presupuesto_id = presupuestos.id')
|
||||
->where('pedidos.id', $pedido_id)
|
||||
->join('ordenes_trabajo', 'ordenes_trabajo.pedido_id = pedidos.id')
|
||||
->where('ordenes_trabajo.id', $ot_id)
|
||||
->where('presupuesto_direcciones.is_ferro_prototipo', 0)
|
||||
->like('presupuesto_direcciones.direccion', $direccion)
|
||||
->groupBy('presupuesto_direcciones.id')
|
||||
->first();
|
||||
@ -416,7 +361,7 @@ class LogisticaService
|
||||
$EnvioLineasModel = model('App\Models\Logistica\EnvioLineaModel');
|
||||
$EnvioLineasModel->save([
|
||||
'envio_id' => $idEnvio,
|
||||
'pedido_id' => $pedido_id,
|
||||
'pedido_id' => $datosEnvio->pedido_id,
|
||||
'unidades_envio' => $datosEnvio->cantidad,
|
||||
'unidades_total' => $datosEnvio->cantidad_total,
|
||||
'cajas' => 1,
|
||||
@ -437,6 +382,95 @@ class LogisticaService
|
||||
}
|
||||
|
||||
|
||||
public static function generateEnvioFerro($ot_id)
|
||||
{
|
||||
$presupuestoDireccionesModel = model('App\Models\Presupuestos\PresupuestoDireccionesModel');
|
||||
|
||||
$datosEnvio = $presupuestoDireccionesModel
|
||||
->select("
|
||||
presupuestos.id as presupuesto_id,
|
||||
presupuesto_direcciones.att,
|
||||
presupuesto_direcciones.direccion,
|
||||
presupuesto_direcciones.provincia as ciudad,
|
||||
presupuesto_direcciones.cp,
|
||||
presupuesto_direcciones.telefono,
|
||||
presupuesto_direcciones.email,
|
||||
presupuesto_direcciones.pais_id,
|
||||
presupuesto_direcciones.cantidad as cantidad_total,
|
||||
presupuestos.cliente_id as cliente_id,
|
||||
ordenes_trabajo.pedido_id as pedido_id,
|
||||
")
|
||||
->join('pedidos_linea', 'pedidos_linea.presupuesto_id = presupuesto_direcciones.presupuesto_id')
|
||||
->join('pedidos', 'pedidos.id = pedidos_linea.pedido_id')
|
||||
->join('presupuestos', 'pedidos_linea.presupuesto_id = presupuestos.id')
|
||||
->join('ordenes_trabajo', 'ordenes_trabajo.pedido_id = pedidos.id')
|
||||
->where('ordenes_trabajo.id', $ot_id)
|
||||
->where('presupuesto_direcciones.is_ferro_prototipo', 1)
|
||||
->where("
|
||||
NOT EXISTS (
|
||||
SELECT 1
|
||||
FROM envios e
|
||||
INNER JOIN envios_lineas el ON el.envio_id = e.id
|
||||
WHERE e.tipo_envio = 'ferro_prototipo'
|
||||
AND (el.pedido_id = pedidos.id OR el.presupuesto_id = presupuestos.id)
|
||||
)
|
||||
", null, false) // <= Esta es la parte nueva, importante
|
||||
->groupBy('presupuesto_direcciones.id')
|
||||
->first();
|
||||
|
||||
// Validación si no hay datos o no quedan unidades
|
||||
if (empty($datosEnvio)) {
|
||||
return [
|
||||
'status' => false,
|
||||
'message' => lang('Logistica.errors.noAddresses')
|
||||
];
|
||||
}
|
||||
|
||||
// Crear envío
|
||||
$EnvioModel = model('App\Models\Logistica\EnvioModel');
|
||||
$EnvioModel->set([
|
||||
'cliente_id' => $datosEnvio->cliente_id,
|
||||
'att' => $datosEnvio->att,
|
||||
'direccion' => $datosEnvio->direccion,
|
||||
'ciudad' => $datosEnvio->ciudad,
|
||||
'cp' => $datosEnvio->cp,
|
||||
'telefono' => $datosEnvio->telefono,
|
||||
'email' => $datosEnvio->email,
|
||||
'pais_id' => $datosEnvio->pais_id,
|
||||
'cantidad' => 1,
|
||||
'cajas' => 1,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s'),
|
||||
'tipo_envio' => 'ferro_prototipo',
|
||||
]);
|
||||
$EnvioModel->insert();
|
||||
$idEnvio = $EnvioModel->insertID();
|
||||
|
||||
// Crear línea de envío
|
||||
$EnvioLineasModel = model('App\Models\Logistica\EnvioLineaModel');
|
||||
$EnvioLineasModel->save([
|
||||
'envio_id' => $idEnvio,
|
||||
'pedido_id' => $datosEnvio->pedido_id,
|
||||
'unidades_envio' => 1,
|
||||
'unidades_total' => 1,
|
||||
'cajas' => 1,
|
||||
'unidades_cajas' => 1,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s'),
|
||||
'created_by' => auth()->user()->id,
|
||||
'updated_by' => auth()->user()->id,
|
||||
'presupuesto_id' => (int) $datosEnvio->presupuesto_id
|
||||
]);
|
||||
|
||||
return [
|
||||
'status' => true,
|
||||
'data' => [
|
||||
'id_envio' => $idEnvio,
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static function finalizarEnvio($envio_id, $finalizar_ot = false)
|
||||
{
|
||||
@ -489,24 +523,36 @@ class LogisticaService
|
||||
$cantidad_enviada = $cantidad_enviada[0]->unidades_enviadas;
|
||||
}
|
||||
|
||||
if ($cantidad_enviada + $linea->unidades_envio == $pedido->total_tirada) {
|
||||
if ($envio->tipo_envio == 'ferro_prototipo') {
|
||||
$otModel = model('App\Models\OrdenTrabajo\OrdenTrabajoModel');
|
||||
$ot = $otModel->where('pedido_id', $linea->pedido_id)
|
||||
->first();
|
||||
$ps = (new ProductionService())->init($ot->id);
|
||||
$ps->updateOrdenTrabajoDate([
|
||||
"name" => "envio_at",
|
||||
"envio_at" => date('Y-m-d H:i:s')
|
||||
"name" => "ferro_en_cliente_at",
|
||||
"ferro_en_cliente_at" => date('Y-m-d H:i:s')
|
||||
]);
|
||||
if ($finalizar_ot) {
|
||||
$ps->updateOrdenTrabajo(
|
||||
[
|
||||
"estado" => 'F'
|
||||
]
|
||||
);
|
||||
array_push($ots, $ot->id);
|
||||
} else {
|
||||
if ($cantidad_enviada + $linea->unidades_envio == $pedido->total_tirada) {
|
||||
$otModel = model('App\Models\OrdenTrabajo\OrdenTrabajoModel');
|
||||
$ot = $otModel->where('pedido_id', $linea->pedido_id)
|
||||
->first();
|
||||
$ps = (new ProductionService())->init($ot->id);
|
||||
$ps->updateOrdenTrabajoDate([
|
||||
"name" => "envio_at",
|
||||
"envio_at" => date('Y-m-d H:i:s')
|
||||
]);
|
||||
if ($finalizar_ot) {
|
||||
$ps->updateOrdenTrabajo(
|
||||
[
|
||||
"estado" => 'F'
|
||||
]
|
||||
);
|
||||
array_push($ots, $ot->id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$EnvioModel->update($envio_id, ['finalizado' => 1]);
|
||||
@ -524,4 +570,66 @@ class LogisticaService
|
||||
}
|
||||
return $data_return;
|
||||
}
|
||||
|
||||
public static function generateEtiquetasTitulos($envio, $lineas, $printer, $cajas)
|
||||
{
|
||||
$data = [
|
||||
"printer" => $printer->name,
|
||||
"header" => [
|
||||
"_FORMAT" => "E:PEDIDO.ZPL",
|
||||
"_QUANTITY" => 1,
|
||||
"_PRINBTERNAME" => $printer->name,
|
||||
"_JOBNAME" => "LBL101"
|
||||
],
|
||||
];
|
||||
|
||||
foreach ($lineas as $linea) {
|
||||
$data["labels"][] = [
|
||||
"cliente" => $envio->cliente,
|
||||
"titulo" => "[" . $linea->pedido_id . "] - " . $linea->titulo,
|
||||
"cantidad" => $linea->unidades_envio,
|
||||
"tirada" => $linea->unidades_total,
|
||||
"cajas" => $cajas,
|
||||
"ean" => null,
|
||||
"nombre" => $envio->att,
|
||||
"direccion" => $envio->direccion,
|
||||
"notas" => "",
|
||||
"refcliente" => $linea->refcliente,
|
||||
"npedido" => $linea->pedido_id
|
||||
];
|
||||
}
|
||||
|
||||
$servicioImpresora = new ImpresoraEtiquetaService();
|
||||
$xml = $servicioImpresora->createEtiqueta($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'),
|
||||
'data' => $xml
|
||||
];
|
||||
} else {
|
||||
return [
|
||||
'status' => false,
|
||||
'message' => lang('Logistica.errors.noEtiquetas'),
|
||||
];
|
||||
}
|
||||
|
||||
} else {
|
||||
return [
|
||||
'status' => true,
|
||||
'message' => lang('Logistica.success.imprimirEtiquetas'),
|
||||
'data' => $xml
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -58,7 +58,7 @@ class PresupuestoClienteService extends BaseService
|
||||
if ($total_plana < 0 && $total_rotativa < 0)
|
||||
return [];
|
||||
else {
|
||||
if ($total_plana > $total_rotativa)
|
||||
if ($total_plana > $total_rotativa && $data['forzarRotativa'] == 0)
|
||||
return $plana;
|
||||
else
|
||||
return [$rotativa];
|
||||
|
||||
@ -1983,4 +1983,95 @@ class PresupuestoService extends BaseService
|
||||
|
||||
return $peso;
|
||||
}
|
||||
|
||||
public static function ajustarPresupuesto($id, $precio_unidad = null, $unidades = null, $precio_total = null, $forzar_descuento = false){
|
||||
|
||||
$precio_total_asignado = 0;
|
||||
$precio_unidad_asignado = $precio_unidad;
|
||||
$warning = false;
|
||||
|
||||
$model = model('App\Models\Presupuestos\PresupuestoModel');
|
||||
if($precio_unidad != null && $unidades != null){
|
||||
$precio_total_asignado = round(floatval($precio_unidad) * intval($unidades), 2);
|
||||
}
|
||||
else{
|
||||
$precio_total_asignado = floatval($precio_total);
|
||||
}
|
||||
$presupuesto = $model->find($id);
|
||||
$costes = floatval($presupuesto->total_costes);
|
||||
$envio_base = floatval($presupuesto->envio_base);
|
||||
|
||||
$total_descuento = 0;
|
||||
$total_descuentoPercent = 0;
|
||||
if($costes + $envio_base > $precio_total_asignado){
|
||||
|
||||
if($forzar_descuento){
|
||||
$total_descuento = $costes + $envio_base - $precio_total_asignado;
|
||||
$total_descuentoPercent = round($total_descuento / ($costes + $envio_base) * 100, 2);
|
||||
}
|
||||
else{
|
||||
$precio_total_asignado = round($costes + $envio_base, 2);
|
||||
$precio_unidad_asignado = round($precio_total_asignado / intval($unidades), 4);
|
||||
}
|
||||
$warning = true;
|
||||
}
|
||||
$total_margenes = $precio_total_asignado - $costes - $envio_base < 0 ?
|
||||
0 :
|
||||
$precio_total_asignado - $costes - $envio_base;
|
||||
|
||||
$sumForFactor = floatval($presupuesto->total_coste_papel) + floatval($presupuesto->total_coste_impresion);
|
||||
$sumForFactorPonderado = $sumForFactor + floatval($presupuesto->total_coste_servicios);
|
||||
|
||||
$factor = ($precio_total_asignado - floatval($presupuesto->envio_base)
|
||||
- floatval($presupuesto->total_coste_envios) - floatval($presupuesto->total_margen_envios)) / $sumForFactor;
|
||||
|
||||
$factorPonderado = ($precio_total_asignado - floatval($presupuesto->envio_base)
|
||||
- floatval($presupuesto->total_coste_envios) - floatval($presupuesto->total_margen_envios)) / $sumForFactorPonderado;
|
||||
|
||||
if ($presupuesto) {
|
||||
|
||||
$presupuesto->total_margenes = $total_margenes;
|
||||
$presupuesto->total_aceptado = $precio_total_asignado;
|
||||
$presupuesto->total_aceptado_revisado = $precio_total_asignado;
|
||||
$presupuesto->total_presupuesto = $precio_total_asignado;
|
||||
$presupuesto->total_antes_descuento = $precio_total_asignado - $costes - $envio_base < 0 ?
|
||||
$costes + $envio_base :
|
||||
$precio_total_asignado;
|
||||
$presupuesto->total_precio_unidad = $precio_unidad_asignado;
|
||||
$presupuesto->total_descuento = $total_descuento;
|
||||
$presupuesto->total_descuentoPercent = $total_descuentoPercent;
|
||||
$presupuesto->total_factor = round($factor, 2);
|
||||
$presupuesto->total_factor_ponderado = round($factorPonderado, 2);
|
||||
$model->update($id, $presupuesto);
|
||||
}
|
||||
return [
|
||||
"success" => true,
|
||||
"warning" => $warning,
|
||||
"new_total" => $precio_total_asignado,
|
||||
"new_precio_unidad" => $precio_unidad_asignado,
|
||||
];
|
||||
}
|
||||
|
||||
public static function calcular_merma($tirada, $POD, $formas_lineas_interior = [])
|
||||
{
|
||||
|
||||
$merma = 0;
|
||||
|
||||
if ($tirada > $POD) {
|
||||
$merma = $tirada * 0.1;
|
||||
} else {
|
||||
$merma_lineas = [];
|
||||
foreach ($formas_lineas_interior as $formas_linea) {
|
||||
if ($formas_linea > $tirada)
|
||||
array_push($merma_lineas, $formas_linea - $tirada);
|
||||
else
|
||||
array_push($merma_lineas, $tirada % $formas_linea);
|
||||
}
|
||||
if (count($merma_lineas) > 0)
|
||||
$merma = max($merma_lineas);
|
||||
}
|
||||
|
||||
|
||||
return round($merma, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@ -18,10 +18,13 @@ use App\Entities\Produccion\OrdenTrabajoFileEntity;
|
||||
use App\Entities\Produccion\OrdenTrabajoTareaEntity;
|
||||
use App\Entities\Tarifas\Acabados\TarifaAcabadoEntity;
|
||||
use App\Models\Configuracion\ConfigVariableModel;
|
||||
use App\Models\Configuracion\FestivoModel;
|
||||
use App\Models\Configuracion\MaquinaModel;
|
||||
use App\Models\OrdenTrabajo\OrdenTrabajoFileModel;
|
||||
use App\Models\OrdenTrabajo\OrdenTrabajoTareaProgressDate;
|
||||
use App\Models\Pedidos\PedidoModel;
|
||||
use App\Models\Presupuestos\PresupuestoAcabadosModel;
|
||||
use App\Models\Presupuestos\PresupuestoEncuadernacionesModel;
|
||||
use App\Models\Usuarios\UserModel;
|
||||
use CodeIgniter\Database\BaseBuilder;
|
||||
use CodeIgniter\Database\BaseResult;
|
||||
@ -56,6 +59,7 @@ class ProductionService extends BaseService
|
||||
protected OrdenTrabajoUser $otUser;
|
||||
protected OrdenTrabajoEntity $ot;
|
||||
protected OrdenTrabajoFileModel $otFileModel;
|
||||
protected FestivoModel $festivoModel;
|
||||
protected OrdenTrabajoTareaProgressDate $otTareaProgressDate;
|
||||
protected PedidoModel $pedidoModel;
|
||||
protected UserModel $userModel;
|
||||
@ -63,6 +67,8 @@ class ProductionService extends BaseService
|
||||
protected MaquinaEntity $defaultMaquinaCorte;
|
||||
protected MaquinaModel $maquinaModel;
|
||||
protected OrdenTrabajo $ordenTrabajoConfig;
|
||||
protected PresupuestoAcabadosModel $presupuestoAcabadoModel;
|
||||
protected PresupuestoEncuadernacionesModel $presupuestoEncuadernacionModel;
|
||||
|
||||
|
||||
/**
|
||||
@ -90,7 +96,7 @@ class ProductionService extends BaseService
|
||||
* `tirada <= podValue`
|
||||
* @var boolean
|
||||
*/
|
||||
protected bool $isPOD = false;
|
||||
public bool $isPOD = false;
|
||||
|
||||
/**
|
||||
* Indica si la orden de trabajo contiene gofrado
|
||||
@ -99,12 +105,42 @@ class ProductionService extends BaseService
|
||||
*/
|
||||
public bool $isGofrado = false; //* CHECK DONE
|
||||
/**
|
||||
* Indica si la orden de trabajo contiene gofrado
|
||||
* Indica si la orden de trabajo contiene plastificado
|
||||
* Se usa para mostrar la fecha correspondiente en la vista
|
||||
* TODO Hay que implementar un boolean en `lg_tarifa_acabado` para identificar
|
||||
* @var boolean
|
||||
*/
|
||||
public bool $isGrapado = true; //TODO
|
||||
public bool $isPlastificado = false; //* CHECK DONE
|
||||
/**
|
||||
* Indica si la orden de trabajo contiene retractilado
|
||||
* Se usa para mostrar la fecha correspondiente en la vista
|
||||
* @var boolean
|
||||
*/
|
||||
public bool $isRetractilado = false; //* CHECK DONE
|
||||
/**
|
||||
* Indica si la orden de trabajo contiene gofrado
|
||||
* Se usa para mostrar la fecha correspondiente en la vista
|
||||
* @var boolean
|
||||
*/
|
||||
public bool $isPlakene = false; //* CHECK DONE
|
||||
/**
|
||||
* Indica si la orden de trabajo contiene gofrado
|
||||
* Se usa para mostrar la fecha correspondiente en la vista
|
||||
* @var boolean
|
||||
*/
|
||||
public bool $isEstampado = false; //* CHECK DONE
|
||||
/**
|
||||
* Indica si la orden de trabajo contiene cosido
|
||||
* Se usa para mostrar la fecha correspondiente en la vista y pliegos
|
||||
* @var boolean
|
||||
*/
|
||||
public bool $isCosido = false; //* CHECK DONE
|
||||
/**
|
||||
* Indica si la orden de trabajo contiene gofrado
|
||||
* Se usa para mostrar la fecha correspondiente en la vista
|
||||
* TODO Hay que implementar un boolean en `lg_tarifa_manipulado` para identificar
|
||||
* @var boolean
|
||||
*/
|
||||
public bool $isGrapado = false; //TODO
|
||||
/**
|
||||
* Indica si la orden de trabajo contiene espiral
|
||||
* Se usa para mostrar la fecha correspondiente en la vista
|
||||
@ -112,21 +148,14 @@ class ProductionService extends BaseService
|
||||
* DEFAULT true hasta implementacion
|
||||
* @var boolean
|
||||
*/
|
||||
public bool $isEspiral = true; //TODO
|
||||
public bool $isEspiral = false; //TODO
|
||||
/**
|
||||
* Indica si la orden de trabajo contiene UVI
|
||||
* Se usa para mostrar la fecha correspondiente en la vista
|
||||
* @var boolean
|
||||
*/
|
||||
public bool $isUVI = false; //* CHECK DONE
|
||||
/**
|
||||
* Indica si la orden de trabajo contiene plastificado
|
||||
* Se usa para mostrar la fecha correspondiente en la vista
|
||||
* TODO Hay que implementar un boolean en `lg_tarifa_acabado` para identificar
|
||||
* DEFAULT true hasta implementacion
|
||||
* @var boolean
|
||||
*/
|
||||
public bool $isPlastificado = true; //TODO
|
||||
|
||||
/**
|
||||
* Indica si la orden de trabajo contiene cubierta
|
||||
* Se usa para mostrar la fecha correspondiente en la vista
|
||||
@ -175,7 +204,10 @@ class ProductionService extends BaseService
|
||||
$this->otFileModel = model(OrdenTrabajoFileModel::class);
|
||||
$this->pedidoModel = model(PedidoModel::class);
|
||||
$this->otTareaProgressDate = model(OrdenTrabajoTareaProgressDate::class);
|
||||
$this->festivoModel = model(FestivoModel::class);
|
||||
$this->ordenTrabajoConfig = config('OrdenTrabajo');
|
||||
$this->presupuestoAcabadoModel = model(PresupuestoAcabadosModel::class);
|
||||
$this->presupuestoEncuadernacionModel = model(PresupuestoEncuadernacionesModel::class);
|
||||
$this->statusColor = $this->ordenTrabajoConfig->OT_COLORS["sin_imprimir"];
|
||||
$this->configVariableModel = model(ConfigVariableModel::class);
|
||||
$this->podValue = $this->configVariableModel->getVariable('POD')->value;
|
||||
@ -222,7 +254,6 @@ class ProductionService extends BaseService
|
||||
{
|
||||
return $this->ot;
|
||||
}
|
||||
|
||||
/**
|
||||
* Crea una instancia de la orden de trabajo
|
||||
*
|
||||
@ -248,31 +279,29 @@ class ProductionService extends BaseService
|
||||
$this->storeOrdenTrabajoUsers();
|
||||
$this->storeOrdenTrabajoDates();
|
||||
$this->storeAllTareas();
|
||||
try {
|
||||
$this->updatePodDates();
|
||||
} catch (\Throwable $th) {
|
||||
}
|
||||
$this->updatePedidoEspera();
|
||||
return $this->ot;
|
||||
}
|
||||
|
||||
/**
|
||||
* Inserta las fechas del pedido asociado a la orden de trabajo en `orden_trabajo_tareas`
|
||||
* Si el pedido es POD las fechas se insertan automaticamente usando `createDatesForPOD` y
|
||||
* en base a las variables :
|
||||
* - pod_impresion_dias_tras_confirmacion [fecha_impresion_at]
|
||||
* - pod_encuadernacion_dias_tras_confirmacion [fecha_encuadernacion]
|
||||
* - pod_entrega_real_dias_tras_confirmacion [fecha_impresion_at]
|
||||
* - pod_embalaje_dias_tras_confirmacion [fecha_impresion_at]
|
||||
*
|
||||
* @param OrdenTrabajoEntity $ot
|
||||
* @return integer|boolean|string ID
|
||||
*/
|
||||
protected function storeOrdenTrabajoDates(): int|bool|string
|
||||
{
|
||||
$fecha_encuadernado = Time::now()->addDays(2)->format("Y-m-d");
|
||||
$fecha_entrega_real = Time::now()->addDays(5)->format("Y-m-d");
|
||||
//$fecha_embalaje_at = Time::now()->addDays(4)->format("Y-m-d");
|
||||
$data = [
|
||||
"orden_trabajo_id" => $this->ot->id,
|
||||
"fecha_encuadernado_at" => $fecha_encuadernado,
|
||||
"fecha_entrega_real_at" => $fecha_entrega_real,
|
||||
"fecha_impresion_at" => Time::now()->format("Y-m-d"),
|
||||
//"embalaje_at" => $fecha_embalaje_at,
|
||||
"fecha_entrega_externo" => $this->pedido->fecha_entrega_externo,
|
||||
];
|
||||
$otDateId = $this->otDate->insert($data);
|
||||
$this->otDate->updateUserDateMap($this->ot->id, $data);
|
||||
$otDateId = $this->otDate->insert(["orden_trabajo_id" => $this->ot->id]);
|
||||
return $otDateId;
|
||||
}
|
||||
/**
|
||||
@ -362,7 +391,7 @@ class ProductionService extends BaseService
|
||||
$ot_tareas["maquina_id"] = $p_linea_maquina->id;
|
||||
$ot_tareas["imposicion_id"] = null;
|
||||
$ot_tareas["tiempo_estimado"] = $p_linea->horas_maquina * 3600;
|
||||
$ot_tareas["tiempo_real"] = $p_linea->horas_maquina * 3600; //? Tiempo real se inserta manual?
|
||||
$ot_tareas["tiempo_real"] = 0;
|
||||
$insert_query_result = $this->otTarea->insert($ot_tareas);
|
||||
$ot_tareas = [];
|
||||
$this->storeTareaCorte($p_linea);
|
||||
@ -386,7 +415,7 @@ class ProductionService extends BaseService
|
||||
'maquina_id' => $this->defaultMaquinaCorte->id,
|
||||
'orden' => $this->defaultMaquinaCorte->orden_planning,
|
||||
'tiempo_estimado' => $pLinea->rotativa_tiempo_corte * 60,
|
||||
'tiempo_real' => $pLinea->rotativa_tiempo_corte * 60,
|
||||
'tiempo_real' => 0,
|
||||
'is_corte' => true,
|
||||
'tipo_corte' => "bobina",
|
||||
]);
|
||||
@ -572,6 +601,14 @@ class ProductionService extends BaseService
|
||||
{
|
||||
return view("themes/vuexy/pdfs/orden_trabajo", $this->getDataPdf());
|
||||
}
|
||||
public function getFerroPdf()
|
||||
{
|
||||
return view("themes/vuexy/pdfs/ferro", $this->getDataPdf());
|
||||
}
|
||||
public function getPrototipoPdf()
|
||||
{
|
||||
return view("themes/vuexy/pdfs/prototipo", $this->getDataPdf());
|
||||
}
|
||||
/**
|
||||
* Query para mostrar en datatable
|
||||
*
|
||||
@ -592,6 +629,10 @@ class ProductionService extends BaseService
|
||||
"orden_trabajo_tareas.tiempo_real",
|
||||
"orden_trabajo_tareas.comment",
|
||||
"orden_trabajo_tareas.presupuesto_linea_id",
|
||||
"orden_trabajo_tareas.presupuesto_acabado_id",
|
||||
"orden_trabajo_tareas.presupuesto_manipulado_id",
|
||||
"orden_trabajo_tareas.presupuesto_preimpresion_id",
|
||||
"orden_trabajo_tareas.presupuesto_encuadernado_id",
|
||||
"presupuesto_linea.tipo",
|
||||
|
||||
])
|
||||
@ -813,7 +854,9 @@ class ProductionService extends BaseService
|
||||
"tareas_preimpresion" => $this->tareas_preimpresion(),
|
||||
"tareas_impresion" => $this->tareas_impresion(),
|
||||
"tiempo_procesamiento" => $this->getTiempoProcesamientoHHMM(),
|
||||
"tiempo_total" => $this->getTiempoTotalTareas(),
|
||||
"statusColor" => $this->getOtColorStatus(),
|
||||
"tareaCosido" => $this->getTareaCosido(),
|
||||
];
|
||||
return $summary;
|
||||
}
|
||||
@ -833,6 +876,7 @@ class ProductionService extends BaseService
|
||||
"preimpresiones" => $this->presupuesto->preimpresiones(),
|
||||
"manipulados" => $this->presupuesto->manipulados(),
|
||||
"encuadernaciones" => $this->presupuesto->encuadernaciones(),
|
||||
"encuadernacionCode" => $this->getEncuadernacionCode(),
|
||||
"linea_impresion" => $this->presupuesto->presupuestoLineaImpresion(),
|
||||
"linea_cubierta" => $this->presupuesto->presupuestoLineaCubierta(),
|
||||
"peso_unidad" => $logistica_data["peso_unidad"],
|
||||
@ -842,8 +886,10 @@ class ProductionService extends BaseService
|
||||
"tiempo_impresion" => $this->getTiempoTareasImpresionHHMM(),
|
||||
"colors" => $this->getPdfColors(),
|
||||
"isPOD" => $this->isPOD,
|
||||
"uvi" => $this->getUVI()
|
||||
|
||||
"uvi" => $this->getUVI(),
|
||||
"flags" => $this->getFlags(),
|
||||
"tareaCosido" => $this->getTareaCosido(),
|
||||
"plakene_tipo" => $this->plakene_tipo()
|
||||
];
|
||||
}
|
||||
public function getImposicionTareaImpresion(): ?Imposicion
|
||||
@ -894,27 +940,27 @@ class ProductionService extends BaseService
|
||||
public function getPresupuestoLineaImpresion() {}
|
||||
public function tareas_acabado(): array
|
||||
{
|
||||
$q = $this->otTarea->where("presupuesto_acabado_id IS NOT NULL", NULL, FALSE)->findAll();
|
||||
$q = $this->otTarea->where('orden_trabajo_id', $this->ot->id)->where("presupuesto_acabado_id IS NOT NULL", NULL, FALSE)->findAll();
|
||||
return $q;
|
||||
}
|
||||
public function tareas_impresion(): array
|
||||
{
|
||||
$q = $this->otTarea->where("presupuesto_linea_id IS NOT NULL", NULL, FALSE)->findAll();
|
||||
$q = $this->otTarea->where('orden_trabajo_id', $this->ot->id)->where("presupuesto_linea_id IS NOT NULL", NULL, FALSE)->findAll();
|
||||
return $q;
|
||||
}
|
||||
public function tareas_encuadernacion(): array
|
||||
{
|
||||
$q = $this->otTarea->where("presupuesto_encuadernado_id IS NOT NULL", NULL, FALSE)->findAll();
|
||||
$q = $this->otTarea->where('orden_trabajo_id', $this->ot->id)->where("presupuesto_encuadernado_id IS NOT NULL", NULL, FALSE)->findAll();
|
||||
return $q;
|
||||
}
|
||||
public function tareas_preimpresion(): array
|
||||
{
|
||||
$q = $this->otTarea->where("presupuesto_preimpresion_id IS NOT NULL", NULL, FALSE)->findAll();
|
||||
$q = $this->otTarea->where('orden_trabajo_id', $this->ot->id)->where("presupuesto_preimpresion_id IS NOT NULL", NULL, FALSE)->findAll();
|
||||
return $q;
|
||||
}
|
||||
public function tareas_manipulado(): array
|
||||
{
|
||||
$q = $this->otTarea->where("presupuesto_manipulado_id IS NOT NULL", NULL, FALSE)->findAll();
|
||||
$q = $this->otTarea->where('orden_trabajo_id', $this->ot->id)->where("presupuesto_manipulado_id IS NOT NULL", NULL, FALSE)->findAll();
|
||||
return $q;
|
||||
}
|
||||
/**========================================================================
|
||||
@ -929,6 +975,18 @@ class ProductionService extends BaseService
|
||||
}
|
||||
return $this->otTarea->update($tarea_id, $data);
|
||||
}
|
||||
public function updateOrdenTrabajoTareaPliegos($data_pliegos): bool
|
||||
{
|
||||
$flag = false;
|
||||
$tareas = $this->ot->tareas();
|
||||
foreach ($tareas as $key => $tarea) {
|
||||
if ($tarea->isCosido()) {
|
||||
$flag = $this->otTarea->update($tarea->id, $data_pliegos);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return $flag;
|
||||
}
|
||||
public function storeOrdenTrabajoTareaProgressDate($data): bool
|
||||
{
|
||||
$data["action_at"] = Time::now()->format('Y-m-d H:i:s');
|
||||
@ -942,6 +1000,18 @@ class ProductionService extends BaseService
|
||||
throw new Exception(lang('Produccion.task_already_finished'));
|
||||
}
|
||||
}
|
||||
if (isset($data['estado'])) {
|
||||
if ($data['estado'] == 'F') {
|
||||
$tareaEntity = $this->otTarea->find($data['ot_tarea_id']);
|
||||
$this->init($tareaEntity->orden_trabajo_id);
|
||||
$dateName = $this->getOrdenTrabajoTareaDate($tareaEntity);
|
||||
$dataDate = [
|
||||
'name' => $dateName,
|
||||
];
|
||||
$dataDate[$dateName] = Time::now()->format('Y-m-d');
|
||||
$this->updateOrdenTrabajoDate($dataDate);
|
||||
}
|
||||
}
|
||||
return $this->otTareaProgressDate->insert($data);
|
||||
}
|
||||
public function getTareaLastState($tarea_id)
|
||||
@ -956,6 +1026,12 @@ class ProductionService extends BaseService
|
||||
$data["action_at"] = Time::now()->format('Y-m-d H:i:s');
|
||||
$data["action_user_id"] = auth()->user()->id;
|
||||
$status = $this->otTareaProgressDate->where('ot_tarea_id', $orden_trabajo_tarea_id)->delete();
|
||||
if ($status) {
|
||||
$tareaEntity = $this->otTarea->find($orden_trabajo_tarea_id);
|
||||
$this->init($tareaEntity->orden_trabajo_id);
|
||||
$dateName = $this->getOrdenTrabajoTareaDate($tareaEntity);
|
||||
$this->emptyOrdenTrabajoDate($this->ot->id, $dateName);
|
||||
}
|
||||
if ($status) {
|
||||
$response = $this->storeOrdenTrabajoTareaProgressDate($data);
|
||||
}
|
||||
@ -1334,27 +1410,50 @@ class ProductionService extends BaseService
|
||||
}
|
||||
public function getTiempoProcesamientoHHMM(): ?string
|
||||
{
|
||||
$time_tareas_seconds = array_map(fn($q) => $q->tiempo_estimado ?? 0, $this->ot->tareas());
|
||||
$seconds = array_sum($time_tareas_seconds);
|
||||
return float_seconds_to_hhmm_string($seconds);
|
||||
try {
|
||||
$time_tareas_seconds = array_map(fn($q) => $q->tiempo_estimado ?? 0, $this->ot->tareas());
|
||||
$seconds = array_sum($time_tareas_seconds);
|
||||
return float_seconds_to_hhmm_string($seconds);
|
||||
} catch (\Throwable $th) {
|
||||
return '00:00';
|
||||
}
|
||||
}
|
||||
public function getTiempoTareasImpresionHHMM(): string
|
||||
{
|
||||
$tareas_impresion = $this->ot->tareas_impresion();
|
||||
$tiempo_seconds = 0;
|
||||
foreach ($tareas_impresion as $key => $tarea) {
|
||||
if ($tarea->is_corte == false) {
|
||||
$tiempo_seconds += $tarea->tiempo_estimado;
|
||||
try {
|
||||
$tareas_impresion = $this->ot->tareas_impresion();
|
||||
$tiempo_seconds = 0;
|
||||
foreach ($tareas_impresion as $key => $tarea) {
|
||||
if ($tarea->is_corte == false) {
|
||||
$tiempo_seconds += $tarea->tiempo_estimado;
|
||||
}
|
||||
}
|
||||
return float_seconds_to_hhmm_string($tiempo_seconds);
|
||||
} catch (\Throwable $th) {
|
||||
return '00:00';
|
||||
}
|
||||
}
|
||||
public function getTiempoTotalTareas(): string
|
||||
{
|
||||
try {
|
||||
$tareas = $this->ot->tareas();
|
||||
$tiempo_seconds = 0;
|
||||
foreach ($tareas as $key => $tarea) {
|
||||
if ($tarea->tiempo_real) {
|
||||
$tiempo_seconds += $tarea->tiempo_real;
|
||||
}
|
||||
}
|
||||
return float_seconds_to_hhmm_string($tiempo_seconds);
|
||||
} catch (\Throwable $th) {
|
||||
return '00:00';
|
||||
}
|
||||
return float_seconds_to_hhmm_string($tiempo_seconds);
|
||||
}
|
||||
public function getUVI(): ?TarifaAcabadoEntity
|
||||
{
|
||||
$uvi = null;
|
||||
$acabados = $this->presupuesto->acabados();
|
||||
foreach ($acabados as $key => $acabado) {
|
||||
if ($acabado->tarifa()->isUVI()) {
|
||||
if ($acabado->tarifa()->uvi) {
|
||||
$uvi = $acabado->tarifa();
|
||||
}
|
||||
}
|
||||
@ -1470,8 +1569,11 @@ class ProductionService extends BaseService
|
||||
{
|
||||
$code = "";
|
||||
$encuadernaciones = $this->presupuesto->encuadernaciones();
|
||||
if (isset($encuadernaciones[0])) {
|
||||
$code = $encuadernaciones[0]->tarifa()->code;
|
||||
foreach ($encuadernaciones as $key => $value) {
|
||||
$code = $value->tarifa()->code;
|
||||
if ($code) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return $code;
|
||||
}
|
||||
@ -1506,58 +1608,68 @@ class ProductionService extends BaseService
|
||||
}
|
||||
public function getPapelImpresionBackgroundColor()
|
||||
{
|
||||
$papel = $this->presupuesto->presupuestoLineaImpresion()->papel_generico();
|
||||
$color = $this->ordenTrabajoConfig->OT_PAPEL_COLOR['default'];
|
||||
$papel_code = $papel->code_ot;
|
||||
if ($papel_code) {
|
||||
if (strpos($papel_code, "BCLOF")) {
|
||||
$color = $this->ordenTrabajoConfig->OT_PAPEL_COLOR['blanco'];
|
||||
}
|
||||
if (strpos($papel_code, "AH") && $papel->code == "OFF2") {
|
||||
$color = $this->ordenTrabajoConfig->OT_PAPEL_COLOR['ahuesado'];
|
||||
}
|
||||
if (strpos($papel_code, "MARF")) {
|
||||
$color = $this->ordenTrabajoConfig->OT_PAPEL_COLOR['marfil'];
|
||||
}
|
||||
if (strpos($papel_code, "VOLAH")) {
|
||||
$color = $this->ordenTrabajoConfig->OT_PAPEL_COLOR['volumen_ahuesado'];
|
||||
}
|
||||
if ($papel_code == "EM") {
|
||||
$color = $this->ordenTrabajoConfig->OT_PAPEL_COLOR['estucado_mate'];
|
||||
}
|
||||
if ($papel_code == "CGE") {
|
||||
$color = $this->ordenTrabajoConfig->OT_PAPEL_COLOR['cartulina'];
|
||||
}
|
||||
}
|
||||
if ($this->presupuesto->presupuestoLineaImpresion()) {
|
||||
|
||||
return $color;
|
||||
$papel = $this->presupuesto->presupuestoLineaImpresion()->papel_generico();
|
||||
$color = $this->ordenTrabajoConfig->OT_PAPEL_COLOR['default'];
|
||||
$papel_code = $papel->code_ot;
|
||||
if ($papel_code) {
|
||||
if (strpos($papel_code, "BCLOF")) {
|
||||
$color = $this->ordenTrabajoConfig->OT_PAPEL_COLOR['blanco'];
|
||||
}
|
||||
if (strpos($papel_code, "AH") && $papel->code == "OFF2") {
|
||||
$color = $this->ordenTrabajoConfig->OT_PAPEL_COLOR['ahuesado'];
|
||||
}
|
||||
if (strpos($papel_code, "MARF")) {
|
||||
$color = $this->ordenTrabajoConfig->OT_PAPEL_COLOR['marfil'];
|
||||
}
|
||||
if (strpos($papel_code, "VOLAH")) {
|
||||
$color = $this->ordenTrabajoConfig->OT_PAPEL_COLOR['volumen_ahuesado'];
|
||||
}
|
||||
if ($papel_code == "EM") {
|
||||
$color = $this->ordenTrabajoConfig->OT_PAPEL_COLOR['estucado_mate'];
|
||||
}
|
||||
if ($papel_code == "CGE") {
|
||||
$color = $this->ordenTrabajoConfig->OT_PAPEL_COLOR['cartulina'];
|
||||
}
|
||||
}
|
||||
|
||||
return $color;
|
||||
} else {
|
||||
return $this->ordenTrabajoConfig->OT_PAPEL_COLOR['blanco'];
|
||||
}
|
||||
}
|
||||
public function getPapelImpresionCubiertaBackgroundColor()
|
||||
{
|
||||
$papel = $this->presupuesto->presupuestoLineaCubierta()->papel_generico();
|
||||
$color = $this->ordenTrabajoConfig->OT_PAPEL_COLOR['default'];
|
||||
$papel_code = $papel->code_ot;
|
||||
if ($papel_code) {
|
||||
if (strpos($papel_code, "BCLOF")) {
|
||||
$color = $this->ordenTrabajoConfig->OT_PAPEL_COLOR['blanco'];
|
||||
}
|
||||
if (strpos($papel_code, "AH") && $papel->code == "OFF2") {
|
||||
$color = $this->ordenTrabajoConfig->OT_PAPEL_COLOR['ahuesado'];
|
||||
}
|
||||
if (strpos($papel_code, "MARF")) {
|
||||
$color = $this->ordenTrabajoConfig->OT_PAPEL_COLOR['marfil'];
|
||||
}
|
||||
if (strpos($papel_code, "VOLAH")) {
|
||||
$color = $this->ordenTrabajoConfig->OT_PAPEL_COLOR['volumen_ahuesado'];
|
||||
}
|
||||
if ($papel_code == "EM") {
|
||||
$color = $this->ordenTrabajoConfig->OT_PAPEL_COLOR['estucado_mate'];
|
||||
}
|
||||
if ($papel_code == "CGE") {
|
||||
$color = $this->ordenTrabajoConfig->OT_PAPEL_COLOR['cartulina'];
|
||||
if ($this->presupuesto->presupuestoLineaCubierta()) {
|
||||
|
||||
$papel = $this->presupuesto->presupuestoLineaCubierta()->papel_generico();
|
||||
$color = $this->ordenTrabajoConfig->OT_PAPEL_COLOR['default'];
|
||||
$papel_code = $papel->code_ot;
|
||||
if ($papel_code) {
|
||||
if (strpos($papel_code, "BCLOF")) {
|
||||
$color = $this->ordenTrabajoConfig->OT_PAPEL_COLOR['blanco'];
|
||||
}
|
||||
if (strpos($papel_code, "AH") && $papel->code == "OFF2") {
|
||||
$color = $this->ordenTrabajoConfig->OT_PAPEL_COLOR['ahuesado'];
|
||||
}
|
||||
if (strpos($papel_code, "MARF")) {
|
||||
$color = $this->ordenTrabajoConfig->OT_PAPEL_COLOR['marfil'];
|
||||
}
|
||||
if (strpos($papel_code, "VOLAH")) {
|
||||
$color = $this->ordenTrabajoConfig->OT_PAPEL_COLOR['volumen_ahuesado'];
|
||||
}
|
||||
if ($papel_code == "EM") {
|
||||
$color = $this->ordenTrabajoConfig->OT_PAPEL_COLOR['estucado_mate'];
|
||||
}
|
||||
if ($papel_code == "CGE") {
|
||||
$color = $this->ordenTrabajoConfig->OT_PAPEL_COLOR['cartulina'];
|
||||
}
|
||||
}
|
||||
return $color;
|
||||
} else {
|
||||
return $this->ordenTrabajoConfig->OT_PAPEL_COLOR['blanco'];
|
||||
}
|
||||
return $color;
|
||||
}
|
||||
public function getPlastificadoColor()
|
||||
{
|
||||
@ -1566,21 +1678,10 @@ class ProductionService extends BaseService
|
||||
foreach ($acabados as $key => $acabado) {
|
||||
$tarifa_acabado = $acabado->tarifa();
|
||||
if ($tarifa_acabado->code) {
|
||||
$plastificado_code = $tarifa_acabado->code;
|
||||
if ($plastificado_code == "BRIL") {
|
||||
$color = $this->ordenTrabajoConfig->OT_PLASTIFICADO_COLOR['BRIL'];
|
||||
}
|
||||
if ($plastificado_code == "MATE") {
|
||||
$color = $this->ordenTrabajoConfig->OT_PLASTIFICADO_COLOR['MATE'];
|
||||
}
|
||||
if ($plastificado_code == "ANTI") {
|
||||
$color = $this->ordenTrabajoConfig->OT_PLASTIFICADO_COLOR['ANTIRAYADO'];
|
||||
}
|
||||
if ($plastificado_code == "SAND") {
|
||||
$color = $this->ordenTrabajoConfig->OT_PLASTIFICADO_COLOR['SANDY'];
|
||||
}
|
||||
if ($plastificado_code == "GOF") {
|
||||
$color = $this->ordenTrabajoConfig->OT_PLASTIFICADO_COLOR['GOFRADO'];
|
||||
if ($tarifa_acabado->plastificado) {
|
||||
if (isset($this->ordenTrabajoConfig->OT_PLASTIFICADO_COLOR[$tarifa_acabado->plastificado_tipo])) {
|
||||
$color = $this->ordenTrabajoConfig->OT_PLASTIFICADO_COLOR[$tarifa_acabado->plastificado_tipo];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1611,14 +1712,20 @@ class ProductionService extends BaseService
|
||||
$this->color();
|
||||
return [
|
||||
"isGofrado" => $this->gofrado(),
|
||||
"isEspiral" => $this->isEspiral,
|
||||
"isEspiral" => $this->isEspiral, //TODO
|
||||
"isPlastificado" => $this->plastificado(),
|
||||
"isPlakene" => $this->plakene(),
|
||||
"isEstampado" => $this->estampado(),
|
||||
"isRetractilado" => $this->retractilado(),
|
||||
"isUVI" => $this->uvi(),
|
||||
"isPlastificado" => $this->isPlastificado,
|
||||
"isCubierta" => $this->cubierta(),
|
||||
"isSobrecubierta" => $this->sobreCubierta(),
|
||||
"isGuarda" => $this->guarda(),
|
||||
"isColor" => $this->isColor,
|
||||
"isBN" => $this->isBN,
|
||||
"isCorte" => $this->corte(),
|
||||
"isGrapado" => $this->isGrapado
|
||||
"isGrapado" => $this->isGrapado,
|
||||
"isCosido" => $this->cosido(),
|
||||
];
|
||||
}
|
||||
public function gofrado(): bool
|
||||
@ -1638,6 +1745,89 @@ class ProductionService extends BaseService
|
||||
$this->isGofrado = $flag;
|
||||
return $this->isGofrado;
|
||||
}
|
||||
public function plakene(): bool
|
||||
{
|
||||
$flag = false;
|
||||
$acabados = $this->presupuesto->acabados();
|
||||
foreach ($acabados as $key => $acabado) {
|
||||
$tarifa_acabado = $acabado->tarifa();
|
||||
if ($tarifa_acabado->plakene) {
|
||||
$flag = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
$this->isPlakene = $flag;
|
||||
return $this->isPlakene;
|
||||
}
|
||||
public function retractilado(): bool
|
||||
{
|
||||
$flag = false;
|
||||
$acabados = $this->presupuesto->acabados();
|
||||
foreach ($acabados as $key => $acabado) {
|
||||
$tarifa_acabado = $acabado->tarifa();
|
||||
if ($tarifa_acabado->rectractilado) {
|
||||
$flag = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
$this->isRetractilado = $flag;
|
||||
return $this->isRetractilado;
|
||||
}
|
||||
public function plakene_tipo(): ?string
|
||||
{
|
||||
$tipo = "";
|
||||
$acabados = $this->presupuesto->acabados();
|
||||
foreach ($acabados as $key => $acabado) {
|
||||
$tarifa_acabado = $acabado->tarifa();
|
||||
if ($tarifa_acabado->plakene) {
|
||||
$tipo = $tarifa_acabado->plakene_tipo;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return $tipo;
|
||||
}
|
||||
public function plastificado(): bool
|
||||
{
|
||||
$flag = false;
|
||||
$acabados = $this->presupuesto->acabados();
|
||||
foreach ($acabados as $key => $acabado) {
|
||||
$tarifa_acabado = $acabado->tarifa();
|
||||
if ($tarifa_acabado->plastificado) {
|
||||
$flag = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
$this->isPlastificado = $flag;
|
||||
return $this->isPlastificado;
|
||||
}
|
||||
public function estampado(): bool
|
||||
{
|
||||
$flag = false;
|
||||
$acabados = $this->presupuesto->acabados();
|
||||
foreach ($acabados as $key => $acabado) {
|
||||
$tarifa_acabado = $acabado->tarifa();
|
||||
if ($tarifa_acabado->estampado) {
|
||||
$flag = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
$this->isEstampado = $flag;
|
||||
return $this->isEstampado;
|
||||
}
|
||||
public function cosido(): bool
|
||||
{
|
||||
$flag = false;
|
||||
$manipulados = $this->presupuesto->manipulados();
|
||||
foreach ($manipulados as $key => $manipulado) {
|
||||
$tarifa_manipulado = $manipulado->tarifa();
|
||||
if ($tarifa_manipulado->isCosido()) {
|
||||
$flag = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
$this->isCosido = $flag;
|
||||
return $this->isCosido;
|
||||
}
|
||||
public function uvi(): bool
|
||||
{
|
||||
$flag = false;
|
||||
@ -1656,6 +1846,24 @@ class ProductionService extends BaseService
|
||||
}
|
||||
return $this->isCubierta;
|
||||
}
|
||||
public function sobreCubierta(): bool
|
||||
{
|
||||
$flag = false;
|
||||
$lineaCubierta = $this->presupuesto->presupuestoLineaSobreCubierta();
|
||||
if ($lineaCubierta) {
|
||||
$flag = true;
|
||||
}
|
||||
return $flag;
|
||||
}
|
||||
public function guarda(): bool
|
||||
{
|
||||
$flag = false;
|
||||
$lineaCubierta = $this->presupuesto->presupuestoLineaGuarda();
|
||||
if ($lineaCubierta) {
|
||||
$flag = true;
|
||||
}
|
||||
return $flag;
|
||||
}
|
||||
public function color(): bool
|
||||
{
|
||||
$linea_impresion = $this->presupuesto->presupuestoLineaImpresion();
|
||||
@ -1694,10 +1902,7 @@ class ProductionService extends BaseService
|
||||
"orden_trabajo_tareas.id as ot_tarea_id",
|
||||
"pedidos.fecha_impresion",
|
||||
"orden_trabajo_tareas.nombre as tareaName",
|
||||
"presupuestos.titulo as presupuesto_titulo",
|
||||
"orden_trabajo_tareas.maquina_id",
|
||||
"lg_papel_impresion.nombre as papel_impresion",
|
||||
"presupuesto_linea.gramaje as papel_gramaje",
|
||||
"tarea_progress.estado as tareaEstado"
|
||||
])
|
||||
->join("orden_trabajo_tareas", "orden_trabajo_tareas.orden_trabajo_id = ordenes_trabajo.id", "left")
|
||||
@ -1714,21 +1919,14 @@ class ProductionService extends BaseService
|
||||
'tarea_progress.ot_tarea_id = orden_trabajo_tareas.id',
|
||||
'left'
|
||||
)
|
||||
->join("presupuesto_linea", "presupuesto_linea.id = orden_trabajo_tareas.presupuesto_linea_id", "left")
|
||||
->join("presupuestos", "presupuestos.id = presupuesto_linea.presupuesto_id", "right")
|
||||
->join("pedidos", "pedidos.id = ordenes_trabajo.pedido_id", "right")
|
||||
->join("lg_papel_formato", "lg_papel_formato.id = presupuestos.papel_formato_id", "left")
|
||||
->join("lg_maquinas", "lg_maquinas.id = orden_trabajo_tareas.maquina_id", "left")
|
||||
->join("lg_papel_impresion", "lg_papel_impresion.id = presupuesto_linea.papel_impresion_id", "left")
|
||||
->groupStart()
|
||||
->orWhere('orden_trabajo_tareas.maquina_id', $maquina_id)
|
||||
->orWhere('presupuesto_linea.maquina_id', $maquina_id)
|
||||
->groupEnd()
|
||||
->where('orden_trabajo_tareas.maquina_id', $maquina_id)
|
||||
// ->where('pedidos.fecha_impresion IS NOT NULL', null, false)
|
||||
->where("orden_trabajo_tareas.deleted_at", null)
|
||||
->where("tarea_progress.estado", 'P')
|
||||
->orderBy("pedidos.fecha_impresion", "ASC")
|
||||
->groupBy('orden_trabajo_tareas.nombre');
|
||||
->groupBy('orden_trabajo_tareas.id');
|
||||
|
||||
return $q;
|
||||
}
|
||||
@ -1737,4 +1935,254 @@ class ProductionService extends BaseService
|
||||
$url = route_to("viewProduccionMaquinistaTareaView", $id);
|
||||
return "<a type='button' href='$url' class='maquina-btn btn btn-primary btn-md'><span class='ti ti-arrow-big-right'></span></a>";
|
||||
}
|
||||
public function getTareaCosido(): ?OrdenTrabajoTareaEntity
|
||||
{
|
||||
$tareaCosido = null;
|
||||
$tareas = $this->ot->tareas();
|
||||
foreach ($tareas as $key => $tarea) {
|
||||
if ($tarea->isCosido()) {
|
||||
$tareaCosido = $tarea;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return $tareaCosido;
|
||||
}
|
||||
public function createDatesForPOD(): array
|
||||
{
|
||||
$podDates = [
|
||||
'fecha_encuadernado' => null,
|
||||
'fecha_entrega_real' => null,
|
||||
'fecha_embalaje' => null,
|
||||
'fecha_impresion' => null,
|
||||
];
|
||||
try {
|
||||
$impresionDays = $this->configVariableModel->getVariable('pod_impresion_dias_tras_confirmacion')->value;
|
||||
$encuadernadoDays = $this->configVariableModel->getVariable('pod_encuadernacion_dias_tras_confirmacion')->value;
|
||||
$entregaRealDays = $this->configVariableModel->getVariable('pod_entrega_real_dias_tras_confirmacion')->value;
|
||||
$embalajeDays = $this->configVariableModel->getVariable('pod_embalaje_dias_tras_confirmacion')->value;
|
||||
$totalDays = array_sum([$impresionDays, $encuadernadoDays, $entregaRealDays, $embalajeDays]);
|
||||
$dates = $this->generateWorkdaysFromToday($totalDays);
|
||||
for ($i = 0; $i < count($dates); $i++) {
|
||||
if ($i == $impresionDays) {
|
||||
$podDates['fecha_impresion'] = $dates[$i];
|
||||
}
|
||||
if ($i == $encuadernadoDays) {
|
||||
$podDates['fecha_encuadernado'] = $dates[$i];
|
||||
}
|
||||
if ($i == $entregaRealDays) {
|
||||
$podDates['fecha_entrega_real'] = $dates[$i];
|
||||
}
|
||||
if ($i == $embalajeDays) {
|
||||
$podDates['fecha_embalaje'] = $dates[$i];
|
||||
}
|
||||
}
|
||||
return $podDates;
|
||||
} catch (\Throwable $th) {
|
||||
return ["error" => $th->getMessage()];
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Devuelve un array con la longitud `$count` con las fechas que corresponde con días laborales.
|
||||
* Menos fines de semana y festivos.
|
||||
*
|
||||
* @param integer $count
|
||||
* @return array <str,YYYY-MM-DD>
|
||||
*/
|
||||
public function generateWorkdaysFromToday(int $count): array
|
||||
{
|
||||
$current = Time::now();
|
||||
$workdays = [];
|
||||
|
||||
while (count($workdays) < $count) {
|
||||
$dayOfWeek = $current->format('N'); // 1 (Lunes) to 7 (Domingo)
|
||||
|
||||
if ($dayOfWeek < 6) { // Lunes a Viernes
|
||||
$date = $current->format('Y-m-d 00:00:00');
|
||||
if ($this->festivoModel->isFestivo($date) == false) {
|
||||
$workdays[] = $date;
|
||||
}
|
||||
}
|
||||
|
||||
$current = $current->addDays(1);
|
||||
}
|
||||
|
||||
return $workdays;
|
||||
}
|
||||
public function updatePodDates(): bool
|
||||
{
|
||||
$dates = $this->createDatesForPOD();
|
||||
return $this->pedidoModel->update($this->pedido->id, $dates);
|
||||
}
|
||||
public function getProveedorTarea($tarea_id)
|
||||
{
|
||||
$proveedor = null;
|
||||
$tareaEntity = $this->otTarea->find($tarea_id);
|
||||
if ($tareaEntity) {
|
||||
$proveedorEncuadernado = $tareaEntity->presupuesto_encuadernacion();
|
||||
$proveedorAcabado = $tareaEntity->presupuesto_acabado();
|
||||
if ($proveedorEncuadernado) {
|
||||
$proveedor = $proveedorEncuadernado->proveedor();
|
||||
} elseif ($proveedorAcabado) {
|
||||
$proveedor = $proveedorAcabado->proveedor();
|
||||
} else {
|
||||
$proveedor = null;
|
||||
}
|
||||
}
|
||||
return ["tarea" => $tareaEntity, "proveedor" => $proveedor];
|
||||
}
|
||||
public function updateProveedorLinea($tarea_id, $proveedor_id)
|
||||
{
|
||||
$status = false;
|
||||
$tareaEntity = $this->otTarea->find($tarea_id);
|
||||
$presupuestoEncuadernado = $tareaEntity->presupuesto_encuadernacion();
|
||||
$presupuestoAcabado = $tareaEntity->presupuesto_acabado();
|
||||
if ($presupuestoEncuadernado) {
|
||||
$status = $this->presupuestoEncuadernacionModel->update($presupuestoEncuadernado->id, ['proveedor_id' => $proveedor_id]);
|
||||
} elseif ($presupuestoAcabado) {
|
||||
$status = $this->presupuestoAcabadoModel->update($presupuestoAcabado->id, ['proveedor_id' => $proveedor_id]);
|
||||
} else {
|
||||
$status = null;
|
||||
}
|
||||
return $status;
|
||||
}
|
||||
public function otTareaImpresionWithDates()
|
||||
{
|
||||
$tareasImpresion = $this->ot->tareas_impresion();
|
||||
$data = [];
|
||||
foreach ($tareasImpresion as $key => $tareaImpresion) {
|
||||
if ($tareaImpresion->is_corte) {
|
||||
$data[$tareaImpresion->id] = 'corte_at';
|
||||
continue;
|
||||
}
|
||||
$presupuestoLineaEntity = $tareaImpresion->presupuesto_linea();
|
||||
if ($presupuestoLineaEntity) {
|
||||
if ($presupuestoLineaEntity->isGuarda()) {
|
||||
$data[$tareaImpresion->id] = 'guarda_at';
|
||||
} elseif ($presupuestoLineaEntity->isCubierta()) {
|
||||
$data[$tareaImpresion->id] = 'cubierta_at';
|
||||
} elseif ($presupuestoLineaEntity->isColor()) {
|
||||
$data[$tareaImpresion->id] = 'interior_color_at';
|
||||
} elseif ($presupuestoLineaEntity->isBN()) {
|
||||
$data[$tareaImpresion->id] = 'interior_bn_at';
|
||||
} elseif ($presupuestoLineaEntity->isSobreCubierta()) {
|
||||
$data[$tareaImpresion->id] = 'sobrecubierta_at';
|
||||
}
|
||||
}
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
public function tareaImpresionDate($tarea): string
|
||||
{
|
||||
|
||||
$dateName = "";
|
||||
$presupuestoLineaEntity = $tarea->presupuesto_linea();
|
||||
if ($presupuestoLineaEntity) {
|
||||
if ($presupuestoLineaEntity->isGuarda()) {
|
||||
$dateName = 'guarda_at';
|
||||
} elseif ($presupuestoLineaEntity->isCubierta()) {
|
||||
$dateName = 'cubierta_at';
|
||||
} elseif ($presupuestoLineaEntity->isColor()) {
|
||||
$dateName = 'interior_color_at';
|
||||
} elseif ($presupuestoLineaEntity->isBN()) {
|
||||
$dateName = 'interior_bn_at';
|
||||
} elseif ($presupuestoLineaEntity->isSobreCubierta()) {
|
||||
$dateName = 'sobrecubierta_at';
|
||||
}
|
||||
if ($tarea->is_corte) {
|
||||
$dateName = 'corte_at';
|
||||
}
|
||||
}
|
||||
return $dateName;
|
||||
}
|
||||
public function otTareaAcabadoWithDates()
|
||||
{
|
||||
$tareasAcabado = $this->ot->tareas_acabado();
|
||||
$data = [];
|
||||
foreach ($tareasAcabado as $key => $tareasAcabado) {
|
||||
$tarifaAcabado = $tareasAcabado->presupuesto_acabado()?->tarifa();
|
||||
if ($tarifaAcabado) {
|
||||
if ($tarifaAcabado->plastificado) {
|
||||
$data[$tareasAcabado->id] = 'plastificado_at';
|
||||
}
|
||||
if ($tarifaAcabado->rectractilado) {
|
||||
$data[$tareasAcabado->id] = 'rectractilado_at';
|
||||
}
|
||||
if ($tarifaAcabado->estampado) {
|
||||
$data[$tareasAcabado->id] = 'estampado_at';
|
||||
}
|
||||
if ($tarifaAcabado->uvi) {
|
||||
$data[$tareasAcabado->id] = 'uvi_at';
|
||||
}
|
||||
}
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
public function tareaAcabadoDate($tarea): string
|
||||
{
|
||||
|
||||
$dateName = "";
|
||||
$tarifaAcabado = $tarea->presupuesto_acabado()?->tarifa();;
|
||||
if ($tarifaAcabado) {
|
||||
if ($tarifaAcabado->plastificado) {
|
||||
$dateName = 'plastificado_at';
|
||||
}
|
||||
if ($tarifaAcabado->rectractilado) {
|
||||
$dateName = 'rectractilado_at';
|
||||
}
|
||||
if ($tarifaAcabado->plakene) {
|
||||
$dateName = 'plakene_at';
|
||||
}
|
||||
if ($tarifaAcabado->estampado) {
|
||||
$dateName = 'estampado_at';
|
||||
}
|
||||
if ($tarifaAcabado->uvi) {
|
||||
$dateName = 'uvi_at';
|
||||
}
|
||||
}
|
||||
return $dateName;
|
||||
}
|
||||
public function otTareaEncuadernadoWithDates()
|
||||
{
|
||||
$tareas = $this->ot->tareas_encuadernado();
|
||||
$data = [];
|
||||
foreach ($tareas as $key => $tarea) {
|
||||
$data[$tarea->id] = "encuadernacion_at";
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function otTareaManipuladooWithDates()
|
||||
{
|
||||
$tareas = $this->ot->tareas_manipulado();
|
||||
$data = [];
|
||||
foreach ($tareas as $key => $tarea) {
|
||||
$data[$tarea->id] = "entrada_manipulado_at";
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
public function getOrdenTrabajoTareaDates(): array
|
||||
{
|
||||
$dates = [];
|
||||
foreach ($this->ot->tareas() as $key => $tarea) {
|
||||
$dates[] = $this->getOrdenTrabajoTareaDate($tarea);
|
||||
}
|
||||
return array_unique($dates);
|
||||
}
|
||||
public function getOrdenTrabajoTareaDate(OrdenTrabajoTareaEntity $tarea): ?string
|
||||
{
|
||||
$dateName = null;
|
||||
if ($tarea->isImpresion()) {
|
||||
$dateName = $this->tareaImpresionDate($tarea);
|
||||
}
|
||||
if ($tarea->isAcabado()) {
|
||||
$dateName = $this->tareaAcabadoDate($tarea);
|
||||
}
|
||||
if ($tarea->isManipulado()) {
|
||||
$dateName = "entrada_manipulado_at";
|
||||
}
|
||||
if ($tarea->isEncuadernado()) {
|
||||
$dateName = "encuadernacion_at";
|
||||
}
|
||||
return $dateName;
|
||||
}
|
||||
}
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
</div>
|
||||
<div class="col-md-6 mb-2">
|
||||
<p class="mb-0">Clicks</p>
|
||||
<h4 class="mb-0" id="clicks-info"><?= $ot_tarea->click_tarea ?></h4>
|
||||
<h4 class="mb-0" id="clicks-info"><?= $ot_tarea->click_end - $ot_tarea->click_init ?></h4>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@ -6,9 +6,6 @@
|
||||
<th><?= lang('ID') ?></th>
|
||||
<th><?= lang('Produccion.task.task') ?></th>
|
||||
<th><?= lang('Produccion.task.estado') ?></th>
|
||||
<th><?= lang('Produccion.datatable.titulo') ?></th>
|
||||
<th><?= lang('Produccion.datatable.papel') ?></th>
|
||||
<th><?= lang('Produccion.datatable.gramaje') ?></th>
|
||||
<th><?= lang('Produccion.datatable.fecha_impresion') ?></th>
|
||||
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
||||
</tr>
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<div class="table-responsive">
|
||||
|
||||
<table id="<?= $id ?>" class="table table-hover">
|
||||
<table id="<?= $id ?>" class="table table-hover table-sm">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= lang('Produccion.task.order') ?></th>
|
||||
@ -8,6 +8,7 @@
|
||||
<th><?= lang('Produccion.task.maquina_presupuesto') ?></th>
|
||||
<th><?= lang('Produccion.task.maquina_actual') ?></th>
|
||||
<th><?= lang('Produccion.task.imposicion') ?></th>
|
||||
<th><?= lang('Produccion.task.proveedor') ?></th>
|
||||
<th><?= lang('Produccion.task.tiempo_estimado') ?></th>
|
||||
<th><?= lang('Produccion.task.tiempo') ?></th>
|
||||
<th></th>
|
||||
|
||||
@ -521,6 +521,28 @@
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="form-check">
|
||||
<label for="removeEnvioBase" class="form-check-label">
|
||||
<input type="checkbox" id="removeEnvioBase"
|
||||
name="no_envio_base" value="1"
|
||||
class="form-check-input"<?= $clienteEntity->no_envio_base == true ? 'checked' : ''; ?>>
|
||||
<?= lang('Clientes.removeEnvioBase') ?>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="form-check">
|
||||
<label for="rotativaPOD" class="form-check-label">
|
||||
<input type="checkbox" id="rotativaPOD"
|
||||
name="forzar_rotativa_pod" value="1"
|
||||
class="form-check-input"<?= $clienteEntity->forzar_rotativa_pod == true ? 'checked' : ''; ?>>
|
||||
<?= lang('Clientes.forzarRotativaPod') ?>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row g-3 mb-3">
|
||||
<div class="col-md-3">
|
||||
<div class="form-check">
|
||||
<label for="tiradaFlexible" class="form-check-label">
|
||||
|
||||
@ -0,0 +1,64 @@
|
||||
<?= $this->include('themes/_commonPartialsBs/select2bs5') ?>
|
||||
<?= $this->include('themes/_commonPartialsBs/datatables') ?>
|
||||
<?= $this->include('themes/_commonPartialsBs/sweetalert') ?>
|
||||
<?= $this->include('themes/_commonPartialsBs/_confirm2delete') ?>
|
||||
<?= $this->extend('themes/vuexy/main/defaultlayout') ?>
|
||||
<?= $this->section('content'); ?>
|
||||
<div class="container-fluid h-100">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
<div class="card card-info">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title"><?= lang('Festivos.moduleTitle') ?></h3>
|
||||
</div>
|
||||
<!--//.card-header -->
|
||||
<div class="card-body m-10 section-block" id="festivoCard">
|
||||
<?= view('themes/_commonPartialsBs/_alertBoxes'); ?>
|
||||
<div id="calendar"></div>
|
||||
<!--//.card-footer -->
|
||||
</div>
|
||||
<!--//.card -->
|
||||
</div>
|
||||
<!--//.col -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!--//.row -->
|
||||
|
||||
<?= $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/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 src="<?= site_url('themes/vuexy/vendor/libs/fullcalendar/dist/index.global.min.js') ?>"></script>
|
||||
<script src="<?= site_url('themes/vuexy/vendor/libs/fullcalendar/packages/core/locales-all.global.min.js') ?>"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="module" src="<?= site_url("/assets/js/safekat/pages/configuracion/festivo/index.js") ?>"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
0
ci4/app/Views/themes/vuexy/form/importador/.delete
Normal file
0
ci4/app/Views/themes/vuexy/form/importador/.delete
Normal file
@ -0,0 +1,103 @@
|
||||
<?= $this->include('themes/_commonPartialsBs/datatables') ?>
|
||||
<?= $this->include('themes/_commonPartialsBs/sweetalert') ?>
|
||||
<?= $this->extend('themes/vuexy/main/defaultlayout') ?>
|
||||
|
||||
<?= $this->section('content'); ?>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
<div class="card card-info">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title"><?= lang('Importador.importadorBubokTitle') ?></h3>
|
||||
</div><!--//.card-header -->
|
||||
|
||||
<form id="catalogoLibroForm" class="card-body" method="post" action="#">
|
||||
<?= csrf_field() ?>
|
||||
|
||||
<!-- card-body -->
|
||||
<div class="card-body">
|
||||
|
||||
<?= view('themes/_commonPartialsBs/_alertBoxes'); ?>
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-6 mb-3">
|
||||
<label for="xmlFile"
|
||||
class="form-label"><?= lang('Importador.subirArchivoBubok') ?? 'Subir archivo XML' ?></label>
|
||||
<input type="file" id="xmlFile" accept=".xml" class="form-control">
|
||||
</div>
|
||||
<div class="col-md-4 mb-3 d-flex align-items-end">
|
||||
<button type="button" id="importBtn" class="btn btn-success w-100">
|
||||
<i class="fas fa-file-import me-2"></i> <?= lang('Importador.importar') ?? 'Importar' ?>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12 mb-3">
|
||||
|
||||
<table id="xmlTable" class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><input type="checkbox" id="selectAll" /></th>
|
||||
<th>Referencia</th>
|
||||
<th>Título</th>
|
||||
<th>Tamaño</th>
|
||||
<th>Páginas</th>
|
||||
<th>Tirada</th>
|
||||
<th>Interior</th>
|
||||
<th>Notas</th>
|
||||
<th>Acciones</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th></th> <!-- No filtro para checkbox -->
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th> <!-- No filtro para notas -->
|
||||
<th></th> <!-- No filtro para acciones -->
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div><!--//.card-body -->
|
||||
<div class="card-footer">
|
||||
|
||||
</div><!--//.card-footer -->
|
||||
</div><!--//.card -->
|
||||
</div><!--//.col -->
|
||||
</div><!--//.row -->
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
|
||||
|
||||
<?= $this->section('css') ?>
|
||||
<link rel="stylesheet"
|
||||
href="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.bootstrap5.min.css") ?>">
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/libs/sweetalert2/sweetalert2.css') ?>" />
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
|
||||
<?= $this->section('additionalExternalJs') ?>
|
||||
<script
|
||||
src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/dataTables.buttons.min.js") ?>"></script>
|
||||
<script
|
||||
src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.bootstrap5.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.html5.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.print.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/jszip/jszip.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/pdfmake/pdfmake.min.js") ?>"
|
||||
crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/pdfmake/vfs_fonts.js") ?>"></script>
|
||||
<script src="<?= site_url('themes/vuexy/vendor/libs/sweetalert2/sweetalert2.js') ?>"></script>
|
||||
<script type="module" src="<?= site_url("assets/js/safekat/pages/importadores/bubok/bubok_tool.js") ?>"></script>
|
||||
<?= $this->endSection() ?>
|
||||
@ -0,0 +1,106 @@
|
||||
<?= $this->include('themes/_commonPartialsBs/datatables') ?>
|
||||
<?= $this->include('themes/_commonPartialsBs/sweetalert') ?>
|
||||
<?= $this->extend('themes/vuexy/main/defaultlayout') ?>
|
||||
|
||||
<?= $this->section('content'); ?>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
<div class="card card-info">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title"><?= lang('Importador.importadorCatalogoTitle') ?></h3>
|
||||
</div><!--//.card-header -->
|
||||
|
||||
<form id="catalogoLibroForm" class="card-body" method="post" action="#">
|
||||
<?= csrf_field() ?>
|
||||
|
||||
<!-- card-body -->
|
||||
<div class="card-body">
|
||||
|
||||
<?= view('themes/_commonPartialsBs/_alertBoxes'); ?>
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-6 mb-3">
|
||||
<label for="excelFile"
|
||||
class="form-label"><?= lang('Importador.subirArchivoRama') ?? 'Subir archivo Excel' ?></label>
|
||||
<input type="file" class="form-control" id="excelFile" name="excelFile"
|
||||
accept=".xlsx, .xls">
|
||||
</div>
|
||||
|
||||
<div class="col-md-4 mb-3 d-flex align-items-end">
|
||||
<button type="button" id="importBtn" class="btn btn-success w-100">
|
||||
<i class="fas fa-file-import me-2"></i> <?= lang('Importador.importar') ?? 'Importar' ?>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12 mb-3">
|
||||
|
||||
<table id="excelTable" class="table table-striped table-hover" style="width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><input type="checkbox" id="selectAll"></th> <!-- Checkbox general -->
|
||||
<th><?= lang('Importador.input') ?></th>
|
||||
<th><?= lang('Importador.idlinea') ?></th>
|
||||
<th><?= lang('Importador.descripcion') ?></th>
|
||||
<th><?= lang('Importador.cnt_pedida') ?></th>
|
||||
<th><?= lang('Importador.precio_compra') ?></th>
|
||||
<th>Notas</th> <!-- Comentarios -->
|
||||
<th><?= lang('Basic.global.Action') ?></th>
|
||||
<!-- Acciones (importar/eliminar) -->
|
||||
</tr>
|
||||
<tr> <!-- Segunda fila para filtros -->
|
||||
<th></th> <!-- No filtro en checkbox -->
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th> <!-- No filtro en notas -->
|
||||
<th></th> <!-- No filtro en acciones -->
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div><!--//.card-body -->
|
||||
<div class="card-footer">
|
||||
|
||||
</div><!--//.card-footer -->
|
||||
</div><!--//.card -->
|
||||
</div><!--//.col -->
|
||||
</div><!--//.row -->
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
|
||||
|
||||
<?= $this->section('css') ?>
|
||||
<link rel="stylesheet"
|
||||
href="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.bootstrap5.min.css") ?>">
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/libs/sweetalert2/sweetalert2.css') ?>" />
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
|
||||
<?= $this->section('additionalExternalJs') ?>
|
||||
<script
|
||||
src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/dataTables.buttons.min.js") ?>"></script>
|
||||
<script
|
||||
src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.bootstrap5.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.html5.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.print.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/jszip/jszip.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/pdfmake/pdfmake.min.js") ?>"
|
||||
crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/pdfmake/vfs_fonts.js") ?>"></script>
|
||||
<script src="<?= site_url('themes/vuexy/vendor/libs/sweetalert2/sweetalert2.js') ?>"></script>
|
||||
<script src="https://cdn.sheetjs.com/xlsx-latest/package/dist/xlsx.full.min.js"></script>
|
||||
<script type="module" src="<?= site_url("assets/js/safekat/pages/importadores/catalogo/catalogo_tool.js") ?>"></script>
|
||||
<?= $this->endSection() ?>
|
||||
@ -0,0 +1,35 @@
|
||||
<?= $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 id="albaranContainer" class="card-body">
|
||||
|
||||
<input type="hidden" id="id" value="<?= $albaranId ?>">
|
||||
|
||||
<?= view("themes/_commonPartialsBs/_alertBoxes") ?>
|
||||
|
||||
</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/albaranes/edit.js") ?>"></script>
|
||||
<?= $this->endSection() ?>
|
||||
@ -0,0 +1,65 @@
|
||||
<?= $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") ?>
|
||||
|
||||
<table id="tableOfAlbaranes" class="table table-striped table-hover w-100">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= lang('Albaran.id') ?></th>
|
||||
<th><?= lang('Albaran.numAlbaran') ?></th>
|
||||
<th><?= lang('Albaran.numEnvio') ?></th>
|
||||
<th><?= lang('Albaran.numPedidos') ?></th>
|
||||
<th><?= lang('Albaran.cliente') ?></th>
|
||||
<th><?= lang('Albaran.att') ?></th>
|
||||
<th><?= lang('Albaran.direccion') ?></th>
|
||||
<th><?= lang('Albaran.unidadesTotal') ?></th>
|
||||
<th><?= lang('Albaran.cajas') ?></th>
|
||||
<th><?= lang('Albaran.acciones') ?? 'Acciones' ?></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><input type="text" class="form-control albaran-filter" name="id"></th>
|
||||
<th><input type="text" class="form-control albaran-filter" name="numero_albaran"></th>
|
||||
<th><input type="text" class="form-control albaran-filter" name="envio_id"></th>
|
||||
<th><input type="text" class="form-control albaran-filter-pedidos" name="pedidos"></th>
|
||||
<th><input type="text" class="form-control albaran-filter" name="cliente"></th>
|
||||
<th><input type="text" class="form-control albaran-filter" name="att"></th>
|
||||
<th><input type="text" class="form-control albaran-filter" name="direccion"></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
</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/albaranes/list.js") ?>"></script>
|
||||
<?= $this->endSection() ?>
|
||||
@ -9,14 +9,16 @@
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4><?= $boxTitle ?> <?= ($envioEntity->finalizado == 0)?'':'<span class="badge text-bg-success fw-lg">FINALIZADO</span>' ?></h4>
|
||||
<h4><?= $boxTitle ?>
|
||||
<?= ($envioEntity->tipo_envio == 'ferro_prototipo') ? '<span class="badge text-bg-warning fw-lg">FERRO</span>':'' ?>
|
||||
<?= ($envioEntity->finalizado == 0) ? '' : '<span class="badge text-bg-success fw-lg">FINALIZADO</span>' ?>
|
||||
</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
|
||||
<?= view("themes/_commonPartialsBs/_alertBoxes") ?>
|
||||
|
||||
<input type="hidden" id="id" name="id" value="<?= $envioEntity->id ?>">
|
||||
<input type="hidden" id="nextCaja" name="next_caja" value="<?= $envioEntity->nextCaja ?>">
|
||||
|
||||
<div class="accordion accordion-bordered">
|
||||
<div class="card accordion-item active mb-5">
|
||||
@ -112,7 +114,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if ($envioEntity->finalizado == 0): ?>
|
||||
<?php if ($envioEntity->finalizado == 0 && $envioEntity->tipo_envio=='estandar'): ?>
|
||||
<div class="accordion accordion-bordered">
|
||||
<div class="card accordion-item active mb-5">
|
||||
<h4 class="accordion-header px-4 py-3">
|
||||
@ -162,7 +164,7 @@
|
||||
<div class="d-flex flex-row">
|
||||
<p><?= lang('Logistica.buttonsActions') ?></p>
|
||||
</div>
|
||||
<div class="d-flex flex-row mb-3">
|
||||
<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">
|
||||
@ -170,7 +172,7 @@
|
||||
<i class="ti ti-select"></i>
|
||||
</button>
|
||||
</div>
|
||||
<?php if ($envioEntity->finalizado == 0): ?>
|
||||
<?php if ($envioEntity->finalizado == 0 && $envioEntity->tipo_envio=='estandar'): ?>
|
||||
<div class="col-sm-2 px-3">
|
||||
<button id="btnEliminarLineas" name="btnEliminarLineas" tabindex="1"
|
||||
class="btn btn-danger w-100">
|
||||
@ -194,6 +196,22 @@
|
||||
</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 ($envioEntity->impresoras as $impresora): ?>
|
||||
<option value="<?= $impresora->id ?>">
|
||||
<?= $impresora->name ?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
|
||||
@ -288,9 +306,8 @@
|
||||
<?= lang("Logistica.codigoSeguimiento") ?>
|
||||
</label>
|
||||
<input type="text" id="codigoSeguimiento" name="codigo_seguimiento" tabindex="1"
|
||||
maxlength="100" class="form-control"
|
||||
<?= ($envioEntity->finalizado == 0) ? "" : "readonly" ?>
|
||||
value="<?= old('codigo_seguimiento', $envioEntity->codigo_seguimiento) ?>">
|
||||
maxlength="100" class="form-control" <?= ($envioEntity->finalizado == 0) ? '' : 'readonly' ?>
|
||||
value="<?= esc(old('codigo_seguimiento', $envioEntity->codigo_seguimiento)) ?>">
|
||||
</div>
|
||||
<div class="col-sm-3 px-3">
|
||||
<label for="empresaMensajeria" class="form-label">
|
||||
@ -319,6 +336,7 @@
|
||||
<ti class="ti ti-check"></ti>
|
||||
</button>
|
||||
</div>
|
||||
<?php if ($envioEntity->tipo_envio=='estandar'): ?>
|
||||
<div class="col-sm-3 px-3">
|
||||
<button id="finalizarEnvioYOTs" name="finalizar_envio_ots" tabindex="1"
|
||||
class="btn btn-primary mt-4 w-100 btn-finalizar">
|
||||
@ -326,6 +344,7 @@
|
||||
<ti class="ti ti-checks"></ti>
|
||||
</button>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -1,97 +0,0 @@
|
||||
<?= $this->include("themes/_commonPartialsBs/sweetalert") ?>
|
||||
<?= $this->include('themes/_commonPartialsBs/datatables') ?>
|
||||
<?= $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.nuevoEnvio") ?>
|
||||
</h4>
|
||||
|
||||
<div id="accordionNuevoEnvioTip" class="accordion-collapse collapse show">
|
||||
<div class="accordion-body px-4 py-3">
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="mb-1 col-sm-4">
|
||||
<label for="buscadorPedidos" class="form-label">
|
||||
<?= lang("Logistica.buscadorPedidosTitle") ?>
|
||||
</label>
|
||||
<input id="buscadorPedidos" name="buscador_pedidos" tabindex="1" maxlength="50"
|
||||
class="form-control" value="">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="card accordion-item active">
|
||||
<h4 class="accordion-header px-4 py-3">
|
||||
<?= lang("Logistica.listadoEnvios") ?>
|
||||
</h4>
|
||||
|
||||
<div id="accordionListadoEnviosTip" class="accordion-collapse collapse show">
|
||||
<div class="accordion-body px-4 py-3">
|
||||
|
||||
<div class="row">
|
||||
<table id="tableOfEnvios" class="table table-striped table-hover w-100">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= lang('Logistica.idEnvio') ?? 'ID Envío' ?></th>
|
||||
<th><?= lang('Logistica.numeroPedidos') ?? 'Nº Pedidos' ?></th>
|
||||
<th><?= lang('Logistica.numeroLineas') ?? 'Nº Líneas' ?></th>
|
||||
<th><?= lang('Logistica.att') ?? 'Att' ?></th>
|
||||
<th><?= lang('Logistica.direccion') ?? 'Dirección' ?></th>
|
||||
<th><?= lang('Logistica.ciudad') ?? 'Ciudad' ?></th>
|
||||
<th><?= lang('Logistica.pais') ?? 'País' ?></th>
|
||||
<th><?= lang('Logistica.cp') ?? 'CP' ?></th>
|
||||
<th><?= lang('Logistica.email') ?? 'Email' ?></th>
|
||||
<th><?= lang('Logistica.telefono') ?? 'Teléfono' ?></th>
|
||||
<th><?= lang('Logistica.finalizado') ?? 'Finalizado' ?></th>
|
||||
<th><?= lang('Logistica.acciones') ?? 'Acciones' ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-3">
|
||||
<button type="button" class="btn btn-secondary" id="btnImprimirEtiquetas"
|
||||
onclick="window.location.href='<?= route_to('LogisticaPanel') ?>'">
|
||||
<?= lang('Logistica.backToPanel') ?>
|
||||
</button>
|
||||
</div>
|
||||
</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/envio.js") ?>"></script>
|
||||
<?= $this->endSection() ?>
|
||||
@ -12,6 +12,8 @@
|
||||
</div>
|
||||
<div class="card-body">
|
||||
|
||||
<input type="hidden" id="tipo_envio" value="<?= $tipo_envio ?>" />
|
||||
|
||||
<?= view("themes/_commonPartialsBs/_alertBoxes") ?>
|
||||
|
||||
<div class="card accordion-item active mb-5">
|
||||
@ -71,7 +73,7 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= lang('Logistica.idEnvio') ?? 'ID Envío' ?></th>
|
||||
<th><?= lang('Logistica.numeroPedidos') ?? 'Nº Pedidos' ?></th>
|
||||
<th><?= lang('Logistica.numeroOts') ?? 'Nº OTs' ?></th>
|
||||
<th><?= lang('Logistica.numeroLineas') ?? 'Nº Líneas' ?></th>
|
||||
<th><?= lang('Logistica.att') ?? 'Att' ?></th>
|
||||
<th><?= lang('Logistica.direccion') ?? 'Dirección' ?></th>
|
||||
@ -83,6 +85,26 @@
|
||||
<th><?= lang('Logistica.finalizado') ?? 'Finalizado' ?></th>
|
||||
<th><?= 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><input type="text" class="form-control envio-filter" name="ciudad"></th>
|
||||
<th><input type="text" class="form-control envio-filter" name="pais"></th>
|
||||
<th><input type="text" class="form-control envio-filter" name="cp"></th>
|
||||
<th><input type="text" class="form-control envio-filter" name="email"></th>
|
||||
<th><input type="text" class="form-control envio-filter" name="telefono"></th>
|
||||
<th>
|
||||
<select class="form-control envio-filter-select" name="finalizado">
|
||||
<option value=""><?= lang('Logistica.todos')?></option>
|
||||
<option value="0"><?= lang('Basic.global.no') ?></option>
|
||||
<option value="1"><?= lang('Basic.global.yes') ?></option>
|
||||
</select>
|
||||
</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
<img src="<?= site_url("assets/img/logistica/envios.jpg") ?>" alt="Envíos">
|
||||
<div><span><?= lang("Logistica.gestionEnvios"); ?></span></div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<div class="item" onclick="location.href='<?= route_to('gestionEnviosFerros') ?>'">
|
||||
<img src="<?= site_url("assets/img/logistica/envios_ferros.png") ?>" alt="Envío de Ferros/Prototipos">
|
||||
<div><span><?= lang("Logistica.envioFerros"); ?></span></div>
|
||||
</div>
|
||||
@ -25,7 +25,7 @@
|
||||
<img src="<?= site_url("assets/img/logistica/impresionEtiquetas.jpg") ?>" alt="Etiquetas de títulos">
|
||||
<div><span><?= lang("Logistica.etiquetasTitulos"); ?></span></div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<div class="item" onclick="location.href='<?= route_to('albaranesList') ?>'">
|
||||
<img src="<?= site_url("assets/img/logistica/albaranes.png") ?>" alt="Albaranes">
|
||||
<div><span><?= lang("Logistica.albaranes"); ?></span></div>
|
||||
</div>
|
||||
|
||||
@ -26,6 +26,9 @@ use Config\App;
|
||||
<li class="nav-item">
|
||||
<button type="button" class="nav-link" role="tab" id="navs-top-align-facturas-tab" data-bs-toggle="tab" data-bs-target="#navs-top-align-facturas"><?=lang('App.menu_facturas')?></button>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<button type="button" class="nav-link" role="tab" id="navs-top-align-ot-tab" data-bs-toggle="tab" data-bs-target="#navs-top-align-ots"><?=lang('Produccion.ots')?></button>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
<div class="tab-content" id="message-datatables-container">
|
||||
@ -41,7 +44,9 @@ use Config\App;
|
||||
</div>
|
||||
<div class="tab-pane fade show" id="navs-top-align-facturas">
|
||||
<?= view("themes/vuexy/components/tables/messages_table", ["id" => "tableFacturaMessages"]) ?>
|
||||
|
||||
</div>
|
||||
<div class="tab-pane fade show" id="navs-top-align-ots">
|
||||
<?= view("themes/vuexy/components/tables/messages_table", ["id" => "tableOtMessages"]) ?>
|
||||
</div>
|
||||
</div>
|
||||
<!--//.card -->
|
||||
|
||||
@ -39,6 +39,7 @@
|
||||
<th class="lp-header"><?= lang('PresupuestosDirecciones.costePrecio') ?></th>
|
||||
<th class="lp-header"><?= lang('Tarifaacabado.margen') ?></th>
|
||||
<th class="lp-header">Pallets?</th>
|
||||
<th class="lp-header">Ferro o Prototipo?</th>
|
||||
<th style="min-width:120px !important;" class="lp-header"><?= lang('Basic.global.Action') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
@ -60,6 +61,7 @@
|
||||
<button id="insertar_direccion" type="button" class="btn btn-secondary waves-effect waves-light float-start"><?= lang("Presupuestos.insertar")?></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div> <!-- //.accordion-body -->
|
||||
</div> <!-- //.accordion-collapse -->
|
||||
</div> <!-- //.accordion-item -->
|
||||
|
||||
@ -8,6 +8,15 @@
|
||||
<div class="modal-body">
|
||||
|
||||
<div id='error-tarifa'></div>
|
||||
|
||||
<div class="mb-3" id="direccionFerroProto">
|
||||
<label for="dirFerroProto" class="form-label">
|
||||
Dirección Ferro o Prototipo
|
||||
</label>
|
||||
<input type="checkbox" id="dirFerroProto" class="form-check-input">
|
||||
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="add_clientedAdd" class="form-label">
|
||||
<?= lang('PresupuestosDirecciones.clientedAdd') ?>*
|
||||
|
||||
@ -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">
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="table-responsive">
|
||||
|
||||
<table class="table-maquinista table table-hover text-dark" style="width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= lang('ID') ?></th>
|
||||
<th><?= lang('Users.firstName') ?></th>
|
||||
<th><?= lang('Users.lastName') ?></th>
|
||||
<th><?= lang('Users.email') ?></th>
|
||||
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php if (count($maquinistas) > 0): ?>
|
||||
|
||||
<?php foreach ($maquinistas as $key => $maquinista): ?>
|
||||
<tr>
|
||||
<td><?= $maquinista->id ?></td>
|
||||
<td><?= $maquinista->first_name ?></td>
|
||||
<td><?= $maquinista->last_name ?></td>
|
||||
<td><?= $maquinista->getEmail() ?></td>
|
||||
<td style="color: white;">
|
||||
<a type="button" href="<?= route_to("maquinistaChangeUserSession", $maquinista->id) ?>" class="btn btn-lg btn-primary h-100 w-100">Mi turno</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
<?php else: ?>
|
||||
<tr class="text-center">
|
||||
<td colspan="5">No hay usuarios para cambiar turno</td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</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') ?>" />
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
<?= $this->section("additionalExternalJs") ?>
|
||||
<script src="<?= site_url("themes/vuexy/vendor/libs/formvalidation/dist/js/FormValidation.js") ?>"></script>
|
||||
<script src="<?= site_url("themes/vuexy/vendor/libs/formvalidation/dist/js/plugins/Bootstrap5.min.js") ?>"></script>
|
||||
<script src="<?= site_url("themes/vuexy/vendor/libs/formvalidation/dist/js/plugins/AutoFocus.min.js") ?>"></script>
|
||||
<?= $this->endSection() ?>
|
||||
@ -23,11 +23,11 @@
|
||||
<?= $maquina["nombre"] ?>
|
||||
<?php if ($maquina["countTareas"] > 0): ?>
|
||||
<span class="badge rounded-pill badge-center h-px-20 w-px-20 bg-secondary ms-1_5"><?= $maquina["countTareas"] ?></span>
|
||||
<? endif; ?>
|
||||
<?php endif; ?>
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
<? endforeach; ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -44,11 +44,11 @@
|
||||
<?= $maquina["nombre"] ?>
|
||||
<?php if ($maquina["countTareas"] > 0): ?>
|
||||
<span class="badge rounded-pill badge-center h-px-20 w-px-20 bg-secondary ms-1_5"><?= $maquina["countTareas"] ?></span>
|
||||
<? endif; ?>
|
||||
<?php endif; ?>
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
<? endforeach; ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -65,11 +65,11 @@
|
||||
<?= $maquina["nombre"] ?>
|
||||
<?php if ($maquina["countTareas"] > 0): ?>
|
||||
<span class="badge rounded-pill badge-center h-px-20 w-px-20 bg-secondary ms-1_5"><?= $maquina["countTareas"] ?></span>
|
||||
<? endif; ?>
|
||||
<?php endif; ?>
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
<? endforeach; ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -18,6 +18,8 @@ use CodeIgniter\I18n\Time;
|
||||
<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>
|
||||
</div>
|
||||
<div class="col-md-6 col-xs-12 justify-content-end d-flex">
|
||||
|
||||
@ -1,6 +1,195 @@
|
||||
<div class="accordion accordion-bordered mt-3" id="accordionComentarios">
|
||||
<div class="card accordion-item active">
|
||||
<h2 class="accordion-header" id="headingOne">
|
||||
<button type="button" class="accordion-button" data-bs-toggle="collapse"
|
||||
data-bs-target="#accordionComentariosTip" aria-expanded="false"
|
||||
aria-controls="accordionComentariosTip">
|
||||
<div class="d-flex flex-row justify-content-start align-items-stretch gap-2">
|
||||
<span><i class="ti-quote ti-md ti"></i></span>
|
||||
<h4> <?= lang('Produccion.comentarios') ?> </h4>
|
||||
</div>
|
||||
</button>
|
||||
</h2>
|
||||
|
||||
<div class="cold-md-12 mt-3">
|
||||
<!-- Comment text area-->
|
||||
<label for="ot-comment" class="form-label"><h4><?= @lang("Produccion.comments") ?></h4></label>
|
||||
<textarea rows=5 cols="10" type="text" class="form-control w-100" name="comentarios" id="ot-comment"></textarea>
|
||||
</div>
|
||||
<div id="accordionComentariosTip" class="accordion-collapse collapse show"
|
||||
data-bs-parent="#accordionComentarios">
|
||||
<div class="accordion-body">
|
||||
<div class="nav-align-top mb-4">
|
||||
<ul class="nav nav-pills mb-3" role="tablist">
|
||||
<li class="nav-item">
|
||||
<button
|
||||
type="button"
|
||||
class="nav-link active"
|
||||
role="tab"
|
||||
data-bs-toggle="tab"
|
||||
data-bs-target="#comentarios-ot"
|
||||
aria-controls="comentarios-ot"
|
||||
aria-selected="true">
|
||||
<?= lang("Produccion.comentariosOt") ?>
|
||||
|
||||
</button>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<button
|
||||
type="button"
|
||||
class="nav-link"
|
||||
role="tab"
|
||||
data-bs-toggle="tab"
|
||||
data-bs-target="#comentarios-interior"
|
||||
aria-controls="comentarios-interior"
|
||||
aria-selected="true">
|
||||
<?= lang("Produccion.comentariosImpresionInterior") ?>
|
||||
|
||||
</button>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<button
|
||||
type="button"
|
||||
class="nav-link"
|
||||
role="tab"
|
||||
data-bs-toggle="tab"
|
||||
data-bs-target="#comentarios-cubierta"
|
||||
aria-controls="comentarios-cubierta"
|
||||
aria-selected="false">
|
||||
<?= lang("Produccion.comentariosCubierta") ?>
|
||||
|
||||
</button>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<button
|
||||
type="button"
|
||||
class="nav-link"
|
||||
role="tab"
|
||||
data-bs-toggle="tab"
|
||||
data-bs-target="#comentarios-encuadernacion"
|
||||
aria-controls="comentarios-encuadernacion"
|
||||
aria-selected="false">
|
||||
<?= lang("Produccion.comentariosEncuadernacion") ?>
|
||||
|
||||
</button>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<button
|
||||
type="button"
|
||||
class="nav-link"
|
||||
role="tab"
|
||||
data-bs-toggle="tab"
|
||||
data-bs-target="#comentarios-logistica"
|
||||
aria-controls="comentarios-logistica"
|
||||
aria-selected="false">
|
||||
<?= lang("Produccion.comentariosLogistica") ?>
|
||||
|
||||
</button>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<button
|
||||
type="button"
|
||||
class="nav-link"
|
||||
role="tab"
|
||||
data-bs-toggle="tab"
|
||||
data-bs-target="#info-solapa-guillotina"
|
||||
aria-controls="info-solapa-guillotina"
|
||||
aria-selected="false">
|
||||
<?= lang("Produccion.info_solapa_guillotina") ?>
|
||||
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tab-content border border-container">
|
||||
<div class="tab-pane fade show active" id="comentarios-ot" role="tabpanel">
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-lg-12 px-4">
|
||||
<div class="mb-3">
|
||||
<textarea
|
||||
rows="3"
|
||||
name="comentarios"
|
||||
class="ot-comment w-100"
|
||||
style="height: 10em;"
|
||||
class="form-control"><?= $ot->comentarios ?></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="comentarios-interior" role="tabpanel">
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-lg-12 px-4">
|
||||
<div class="mb-3">
|
||||
<textarea
|
||||
rows="3"
|
||||
name="comment_interior"
|
||||
class="ot-comment w-100"
|
||||
style="height: 10em;"
|
||||
class="form-control"><?= $ot->comment_interior ?></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="comentarios-cubierta" role="tabpanel">
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-lg-12 px-4">
|
||||
<div class="mb-3">
|
||||
<textarea
|
||||
rows="3"
|
||||
name="comment_cubierta"
|
||||
class="ot-comment w-100"
|
||||
style="height: 10em;"
|
||||
class="form-control"><?= $ot->comment_cubierta ?></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="comentarios-encuadernacion" role="tabpanel">
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-lg-12 px-4">
|
||||
<div class="mb-3">
|
||||
<textarea
|
||||
rows="3"
|
||||
name="comment_encuadernacion"
|
||||
class="ot-comment w-100"
|
||||
style="height: 10em;"
|
||||
class="form-control"><?= $ot->comment_encuadernacion ?></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="comentarios-logistica" role="tabpanel">
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-lg-12 px-4">
|
||||
<div class="mb-3">
|
||||
<textarea
|
||||
rows="3"
|
||||
name="comment_logistica"
|
||||
class="ot-comment w-100"
|
||||
style="height: 10em;"
|
||||
class="form-control"><?= $ot->comment_logistica ?></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="tab-pane fade" id="info-solapa-guillotina" role="tabpanel">
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-lg-12 px-4">
|
||||
<div class="mb-3">
|
||||
<textarea
|
||||
rows="3"
|
||||
name="info_solapa_guillotina"
|
||||
class="ot-comment w-100"
|
||||
style="height: 10em;"
|
||||
class="form-control"><?= $ot->info_solapa_guillotina ?></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> <!-- //.accordion-body -->
|
||||
</div> <!-- //.accordion-collapse -->
|
||||
</div> <!-- //.accordion-item -->
|
||||
</div> <!-- //.accordion -->
|
||||
@ -42,9 +42,17 @@
|
||||
<span class="ti-sm ti ti-truck-delivery me-1"></span>
|
||||
Pedido
|
||||
</a>
|
||||
<a type="button" class="btn btn-danger btn-block mb-1" target="__blank" href="<?= "/produccion/ordentrabajo/pdf/" . $modelId ?>">
|
||||
<span class="ti-sm ti ti-file me-1"></span>
|
||||
PDF</a>
|
||||
<?php if ($presupuesto->ferro == 1): ?>
|
||||
<?php if ($ot->dates()->ferro_ok_at != null): ?>
|
||||
<a type="button" class="btn btn-danger btn-block mb-1" target="__blank" href="<?= "/produccion/ordentrabajo/pdf/" . $modelId ?>">
|
||||
<span class="ti-sm ti ti-file me-1"></span>
|
||||
PDF</a>
|
||||
<?php endif; ?>
|
||||
<?php else: ?>
|
||||
<a type="button" class="btn btn-danger btn-block mb-1" target="__blank" href="<?= "/produccion/ordentrabajo/pdf/" . $modelId ?>">
|
||||
<span class="ti-sm ti ti-file me-1"></span>
|
||||
PDF</a>
|
||||
<?php endif; ?>
|
||||
<a type="button" href="<?= route_to('getOrdenTrabajoBarCode', $modelId) ?>" class="btn btn-secondary btn-block mb-1" download><span class="ti-sm ti ti-barcode me-1"></span><?= @lang("Produccion.imprimir_codigo_safekat") ?></a>
|
||||
|
||||
|
||||
|
||||
@ -21,200 +21,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-3">
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100">
|
||||
<h4><?= lang("Produccion.progress_impresion") ?></h4>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $flags["isBN"] ? "" : "d-none" ?>">
|
||||
<label for="ot-impresion-color" class="form-label"><?= @lang("Produccion.impresion_bn") ?></label>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="interior_bn_at" id="ot-impresion-bn" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
|
||||
</div>
|
||||
<div class="form-text"><?= $user_dates["interior_bn_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
|
||||
|
||||
</div>
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $flags["isColor"] ? "" : "d-none" ?>"">
|
||||
<label for=" ot-impresion-color" class="form-label"><?= @lang("Produccion.impresion_color") ?></label>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="interior_color_at" id="ot-impresion-color" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
|
||||
</div>
|
||||
<div class="form-text"><?= $user_dates["interior_color_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
|
||||
|
||||
</div>
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $flags["isCubierta"] ? "" : "d-none" ?>">
|
||||
<label for="ot-portada" class="form-label"><?= @lang("Produccion.cubierta") ?></label>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="cubierta_at" id="ot-portada" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
|
||||
</div>
|
||||
<div class="form-text"><?= $user_dates["cubierta_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $flags["isPlastificado"] ? "" : "d-none" ?>">
|
||||
<label for="ot-plastificado-mate" class="form-label"><?= @lang("Produccion.plastificado_mate") ?></label>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="plastificado_at" id="ot-plastificado-mate" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
|
||||
</div>
|
||||
<div class="form-text"><?= $user_dates["plastificado_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100">
|
||||
<h4><?= lang("Produccion.progress_manipulado") ?></h4>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $presupuesto->cosido ? "" : "d-none" ?>">
|
||||
<label for="ot-prep-cosido" class="form-label"><?= @lang("Produccion.cosido") ?></label>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="cosido_at" id="ot-prep-cosido" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
|
||||
</div>
|
||||
<div class="form-text"><?= $user_dates["cosido_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
|
||||
</div>
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $flags["isGrapado"] ? "" : "d-none" ?>">
|
||||
<label for="ot-prep-grapado" class="form-label"><?= @lang("Produccion.grapado") ?></label>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="grapado_at" id="ot-prep-grapado" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
|
||||
</div>
|
||||
<div class="form-text"><?= $user_dates["grapado_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
|
||||
</div>
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $presupuesto->solapas ? "" : "d-none" ?>">
|
||||
<label for="ot-prep-solapa" class="form-label"><?= @lang("Produccion.solapa") ?></label>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="solapa_at" id="ot-prep-solapa" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
|
||||
</div>
|
||||
<div class="form-text"><?= $user_dates["solapa_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
|
||||
</div>
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $presupuesto->retractilado ? "" : "d-none" ?>">
|
||||
<label for="ot-prep-retractilado" class="form-label"><?= @lang("Produccion.retractilado") ?></label>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="retractilado_at" id="ot-prep-retractilado" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
|
||||
</div>
|
||||
<div class="form-text"><?= $user_dates["retractilado_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
|
||||
</div>
|
||||
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $presupuesto->retractilado5 ? "" : "d-none" ?>">
|
||||
<label for="ot-prep-retractilado5" class="form-label"><?= @lang("Produccion.retractilado5") ?></label>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="retractilado5_at" id="ot-prep-retractilado5" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
|
||||
</div>
|
||||
<div class="form-text"><?= $user_dates["retractilado5_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
|
||||
</div>
|
||||
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $presupuesto->prototipo ? "" : "d-none" ?>">
|
||||
<label for="ot-prep-prototipo" class="form-label"><?= @lang("Produccion.prototipo") ?></label>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="prototipo_at" id="ot-prep-prototipo" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
|
||||
</div>
|
||||
<div class="form-text"><?= $user_dates["prototipo_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
|
||||
</div>
|
||||
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $presupuesto->marcapaginas ? "" : "d-none" ?>">
|
||||
<label for="ot-prep-marcapaginas" class="form-label"><?= @lang("Produccion.marcapaginas") ?></label>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="marcapaginas_at" id="ot-prep-marcapaginas" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
|
||||
</div>
|
||||
<div class="form-text"><?= $user_dates["marcapaginas_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
|
||||
</div>
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $flags["isCorte"] ? "" : "d-none" ?>">
|
||||
<label for="ot-prep-guillotina" class="form-label"><?= @lang("Produccion.guillotina") ?></label>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="corte_at" id="ot-prep-guillotina" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
|
||||
</div>
|
||||
<div class="form-text"><?= $user_dates["corte_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
|
||||
|
||||
</div>
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $flags["isEspiral"] ? "" : "d-none" ?>">
|
||||
<label for="ot-espiral" class="form-label"><?= @lang("Produccion.espiral") ?></label>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="espiral_at" id="ot-espiral" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
|
||||
</div>
|
||||
<div class="form-text"> <?= $user_dates["espiral_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100">
|
||||
<h4><?= lang("Produccion.progress_logistica") ?></h4>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $presupuesto->ferro ? "" : "d-none" ?>">
|
||||
<label for="ot-pendiente-ferro" class="form-label"><?= @lang("Produccion.pendiente_ferro") ?></label>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control ot-date" name="pendiente_ferro_at" placeholder="DD/MM/YYYY" id="ot-pendiente-ferro" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
|
||||
</div>
|
||||
<div class="form-text"><?= $user_dates["pendiente_ferro_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
|
||||
|
||||
</div>
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $presupuesto->ferro ? "" : "d-none" ?>">
|
||||
<label for="ot-ferro-cliente" class="form-label"><?= @lang("Produccion.ferro_cliente") ?></label>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control ot-date" name="ferro_en_cliente_at" placeholder="DD/MM/YYYY" id="ot-ferro-cliente" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
|
||||
</div>
|
||||
<div class="form-text"><?= $user_dates["ferro_en_cliente_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
|
||||
</div>
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $presupuesto->ferro ? "" : "d-none" ?>">
|
||||
<label for="ot-ferro-ok" class="form-label"><?= @lang("Produccion.ferro_ok") ?></label>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control ot-date" name="ferro_ok_at" placeholder="DD/MM/YYYY" id="ot-ferro-ok" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
|
||||
</div>
|
||||
<div class="form-text"><?= $user_dates["ferro_ok_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
|
||||
|
||||
</div>
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100">
|
||||
<label for="ot-embalaje" class="form-label"><?= @lang("Produccion.embalaje") ?></label>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="embalaje_at" id="ot-embalaje" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
|
||||
</div>
|
||||
<div class="form-text"><?= $user_dates["embalaje_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
|
||||
|
||||
</div>
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100">
|
||||
<label for="ot-envio" class="form-label"><?= @lang("Produccion.envio") ?></label>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="envio_at" id="ot-envio" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
|
||||
</div>
|
||||
<div class="form-text"><?= $user_dates["envio_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="col-md-3 <?= $user_dates["pre_formato_at"] || $user_dates["pre_lomo_at"] || $user_dates["pre_solapa_at"] || $user_dates["pre_codbarras_at"] || $user_dates["pre_imposicion_at"] ? "" : "d-none" ?>">
|
||||
<!-- PREIMPRESION -->
|
||||
<!-- Preformato -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100">
|
||||
@ -269,13 +76,256 @@
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3 <?= $presupuesto->ferro ? "" : "d-none" ?>">
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100">
|
||||
<h4><?= lang("Produccion.progress_ferro") ?></h4>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $presupuesto->ferro ? "" : "d-none" ?>">
|
||||
<label for="ot-pendiente-ferro" class="form-label"><?= @lang("Produccion.pendiente_ferro") ?></label>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control ot-date" name="pendiente_ferro_at" placeholder="DD/MM/YYYY" id="ot-pendiente-ferro" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
|
||||
</div>
|
||||
<div class="form-text"><?= $user_dates["pendiente_ferro_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
|
||||
|
||||
</div>
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $presupuesto->ferro ? "" : "d-none" ?>">
|
||||
<label for="ot-ferro-cliente" class="form-label"><?= @lang("Produccion.ferro_cliente") ?></label>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control ot-date" name="ferro_en_cliente_at" placeholder="DD/MM/YYYY" id="ot-ferro-cliente" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
|
||||
</div>
|
||||
<div class="form-text"><?= $user_dates["ferro_en_cliente_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
|
||||
</div>
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $presupuesto->ferro ? "" : "d-none" ?>">
|
||||
<label for="ot-ferro-ok" class="form-label"><?= @lang("Produccion.ferro_ok") ?></label>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control ot-date" name="ferro_ok_at" placeholder="DD/MM/YYYY" id="ot-ferro-ok" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
|
||||
</div>
|
||||
<div class="form-text"><?= $user_dates["ferro_ok_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100">
|
||||
<h4><?= lang("Produccion.progress_impresion") ?></h4>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $flags["isBN"] ? "" : "d-none" ?>">
|
||||
<label for="ot-impresion-color" class="form-label"><?= @lang("Produccion.impresion_bn") ?></label>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="interior_bn_at" id="ot-impresion-bn" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
|
||||
</div>
|
||||
<div class="form-text"><?= $user_dates["interior_bn_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
|
||||
|
||||
</div>
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $flags["isColor"] ? "" : "d-none" ?>"">
|
||||
<label for=" ot-impresion-color" class="form-label"><?= @lang("Produccion.impresion_color") ?></label>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="interior_color_at" id="ot-impresion-color" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
|
||||
</div>
|
||||
<div class="form-text"><?= $user_dates["interior_color_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
|
||||
|
||||
</div>
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $flags["isCubierta"] ? "" : "d-none" ?>">
|
||||
<label for="ot-cubierta" class="form-label"><?= @lang("Produccion.cubierta") ?></label>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="cubierta_at" id="ot-cubierta" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
|
||||
</div>
|
||||
<div class="form-text"><?= $user_dates["cubierta_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
|
||||
|
||||
</div>
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $flags["isSobrecubierta"] ? "" : "d-none" ?>">
|
||||
<label for="ot-sobrecubierta" class="form-label"><?= @lang("Produccion.sobrecubierta") ?></label>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="sobrecubierta_at" id="ot-sobrecubierta" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
|
||||
</div>
|
||||
<div class="form-text"><?= $user_dates["sobrecubierta_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
|
||||
|
||||
</div>
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $flags["isGuarda"] ? "" : "d-none" ?>">
|
||||
<label for="ot-guarda" class="form-label"><?= @lang("Produccion.guarda") ?></label>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="guarda_at" id="ot-guarda" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
|
||||
</div>
|
||||
<div class="form-text"><?= $user_dates["guarda_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100">
|
||||
<h4 class="text-truncate"><?= lang("Produccion.progress_manipulado") ?></h4>
|
||||
</div>
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $flags["isPlastificado"] ? "" : "d-none" ?>">
|
||||
<label for="ot-plastificado" class="form-label"><?= @lang("Produccion.plastificado") ?></label>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="plastificado_at" id="ot-plastificado" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
|
||||
</div>
|
||||
<div class="form-text"><?= $user_dates["plastificado_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
|
||||
|
||||
</div>
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $flags["isPlakene"] ? "" : "d-none" ?>">
|
||||
<label for="ot-plakene" class="form-label"><?= @lang("Produccion.plakene") ?></label>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="plakene_at" id="ot-plakene" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
|
||||
</div>
|
||||
<div class="form-text"><?= $user_dates["plakene_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
|
||||
|
||||
</div>
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $flags["isRetractilado"] ? "" : "d-none" ?>">
|
||||
<label for="ot-retractilado" class="form-label"><?= @lang("Produccion.retractilado") ?></label>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="retractilado_at" id="ot-retractilado" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
|
||||
</div>
|
||||
<div class="form-text"><?= $user_dates["retractilado_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
|
||||
|
||||
</div>
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $flags["isUVI"] ? "" : "d-none" ?>">
|
||||
<label for="ot-uvi" class="form-label"><?= @lang("Produccion.uvi") ?></label>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="uvi_at" id="ot-uvi" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
|
||||
</div>
|
||||
<div class="form-text"><?= $user_dates["uvi_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
|
||||
|
||||
</div>
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $flags["isEstampado"] ? "" : "d-none" ?>">
|
||||
<label for="ot-estampado" class="form-label"><?= @lang("Produccion.estampado") ?></label>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="estampado_at" id="ot-estampado" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
|
||||
</div>
|
||||
<div class="form-text"><?= $user_dates["estampado_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
|
||||
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $presupuesto->cosido ? "" : "d-none" ?>">
|
||||
<label for="ot-prep-cosido" class="form-label"><?= @lang("Produccion.cosido") ?></label>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="cosido_at" id="ot-prep-cosido" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
|
||||
</div>
|
||||
<div class="form-text"><?= $user_dates["cosido_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
|
||||
</div>
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $flags["isGrapado"] ? "" : "d-none" ?>">
|
||||
<label for="ot-prep-grapado" class="form-label"><?= @lang("Produccion.grapado") ?></label>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="grapado_at" id="ot-prep-grapado" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
|
||||
</div>
|
||||
<div class="form-text"><?= $user_dates["grapado_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
|
||||
</div>
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $presupuesto->solapas ? "" : "d-none" ?>">
|
||||
<label for="ot-prep-solapa" class="form-label"><?= @lang("Produccion.solapa") ?></label>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="solapa_at" id="ot-prep-solapa" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
|
||||
</div>
|
||||
<div class="form-text"><?= $user_dates["solapa_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
|
||||
</div>
|
||||
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $presupuesto->marcapaginas ? "" : "d-none" ?>">
|
||||
<label for="ot-prep-marcapaginas" class="form-label"><?= @lang("Produccion.marcapaginas") ?></label>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="marcapaginas_at" id="ot-prep-marcapaginas" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
|
||||
</div>
|
||||
<div class="form-text"><?= $user_dates["marcapaginas_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
|
||||
</div>
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $flags["isCorte"] ? "" : "d-none" ?>">
|
||||
<label for="ot-prep-guillotina" class="form-label"><?= @lang("Produccion.guillotina") ?></label>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="corte_at" id="ot-prep-guillotina" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
|
||||
</div>
|
||||
<div class="form-text"><?= $user_dates["corte_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
|
||||
|
||||
</div>
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= count($ot->tareas_manipulado()) > 0 ? "" : "d-none" ?>">
|
||||
<label for="ot-manipulado" class="form-label"><?= @lang("Produccion.manipulado") ?></label>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="entrada_manipulado_at" id="ot-manipulado" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
|
||||
</div>
|
||||
<div class="form-text"> <?= $user_dates["entrada_manipulado_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
|
||||
|
||||
</div>
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= count($ot->tareas_encuadernado()) > 0 ? "" : "d-none" ?>">
|
||||
<label for="ot-encuadernacion" class="form-label"><?= @lang("Produccion.encuadernacion") ?></label>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="encuadernacion_at" id="ot-encuadernacion" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
|
||||
</div>
|
||||
<div class="form-text"> <?= $user_dates["encuadernacion_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100">
|
||||
<h4><?= lang("Produccion.progress_logistica") ?></h4>
|
||||
</div>
|
||||
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100">
|
||||
<label for="ot-embalaje" class="form-label"><?= @lang("Produccion.embalaje") ?></label>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="embalaje_at" id="ot-embalaje" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
|
||||
</div>
|
||||
<div class="form-text"><?= $user_dates["embalaje_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
|
||||
|
||||
</div>
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100">
|
||||
<label for="ot-envio" class="form-label"><?= @lang("Produccion.envio") ?></label>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="envio_at" id="ot-envio" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
|
||||
</div>
|
||||
<div class="form-text"><?= $user_dates["envio_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="row">
|
||||
<p><?= @lang("Produccion.tiempo_estimado") ?> : <?= $tiempo_estimado ?> (HH:MM)</p>
|
||||
<span><?= @lang("Produccion.tiempo_estimado") ?>(HH:MM)</span>
|
||||
<span class="tiempo-estimado"> <?= $tiempo_estimado ?></span>
|
||||
</div>
|
||||
<div class="row">
|
||||
<p><?= @lang("Produccion.tiempo_consumido") ?> :</p>
|
||||
<span><?= @lang("Produccion.tiempo_consumido") ?>(HH:MM)</span>
|
||||
<span id="tiempo-total"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
|
||||
<div id="accordionOtTasksTip" class="accordion-collapse collapse show" data-bs-parent="#accordionOtTasks">
|
||||
<div class="accordion-body">
|
||||
<div class="card text-center">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<div class="nav-align-top">
|
||||
<ul class="nav nav-pills" role="tablist">
|
||||
@ -34,7 +34,23 @@
|
||||
<div class="tab-content p-0">
|
||||
<!-- TAREAS -->
|
||||
<div class="tab-pane fade show active" id="nav-ot-task-general" role="tabpanel">
|
||||
<div class="row text-start">
|
||||
<div class="row justify-content-end">
|
||||
<div class="col-md-4">
|
||||
<?php if ($flags["isCosido"] && $tareaCosido): ?>
|
||||
<div class="form-group text-start">
|
||||
<label for="">Pliegos</label>
|
||||
<div class="d-flex flex-row justify-content-start align-items-center gap-2">
|
||||
<input type="text" id="pliegos-1" class="form-control ot-pliegos" name="pliego_1" value="<?= $tareaCosido->pliego_1 ?>">
|
||||
<span>de</span>
|
||||
<input type="text" id="pliegos-1-total" class="form-control ot-pliegos" name="pliego_1_total" value="<?= $tareaCosido->pliego_1_total ?>">
|
||||
<input type="text" id="pliegos-2" class="form-control ot-pliegos" name="pliego_2" value="<?= $tareaCosido->pliego_2 ?>">
|
||||
<span>de</span>
|
||||
<input type="text" id="pliegos-2-total" class="form-control ot-pliegos" name="pliego_2_total" value="<?= $tareaCosido->pliego_2_total ?>">
|
||||
<button type="button" id="btn-update-pliegos" class="btn btn-primary"><span class="ti ti-device-floppy"></span></button>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
|
||||
<?= view("themes/vuexy/components/tables/ot_task_table", ["id" => "ot-task-table"]) ?>
|
||||
@ -43,6 +59,7 @@
|
||||
|
||||
<div class="row d-flex flex-row justify-content-between align-items-center mt-2 gap-2">
|
||||
<div class="col-md-3 text-start">
|
||||
|
||||
<!-- <button type="button" class="btn btn-primary btn-md align-items-center" id="btn-add-tarea"><span class="ti ti-plus ti-sm me-1"></span> Insertar tarea</button> -->
|
||||
</div>
|
||||
<div class="col-md-3 gap-2 text-end">
|
||||
|
||||
@ -45,9 +45,17 @@
|
||||
href="<?= "/produccion/ordentrabajo/pdf/" . $modelId ?>">
|
||||
<span class="ti-sm ti ti-eye me-1"></span>
|
||||
<?= @lang("Produccion.preview_pdf") ?></a>
|
||||
<?php if ($presupuesto->ferro): ?>
|
||||
<a type="button" class="btn btn-primary btn-block mb-1" target="__blank"
|
||||
href="<?= "/produccion/ordentrabajo/pdf/ferro/" . $modelId ?>">
|
||||
<span class="ti-sm ti ti-download me-1"></span>
|
||||
<?= @lang("Produccion.imprimir_ferro") ?></a>
|
||||
<?php endif; ?>
|
||||
<?php if ($presupuesto->prototipo): ?>
|
||||
<button type="button"
|
||||
class="btn btn-primary btn-block mb-1 beta"><?= @lang("Produccion.imprimir_ferro") ?></button>
|
||||
<a type="button" class="btn btn-primary btn-block mb-1" target="__blank"
|
||||
href="<?= "/produccion/ordentrabajo/pdf/prototipo/" . $modelId ?>">
|
||||
<span class="ti-sm ti ti-download me-1"></span>
|
||||
<?= @lang("Produccion.prototipo") ?></a>
|
||||
<?php endif; ?>
|
||||
<a type="button" href="<?= route_to('getOrdenTrabajoBarCode', $modelId) ?>"
|
||||
class="btn btn-secondary btn-block mb-1"
|
||||
|
||||
@ -11,17 +11,30 @@
|
||||
<div class="nav-tabs-shadow nav-align-top">
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
<li class="nav-item">
|
||||
<button type="button" class="nav-link" role="tab" id="navs-top-align-finalizados-tab" data-bs-toggle="tab" data-bs-target="#navs-top-align-finalizados"><?= lang("Produccion.finalizadas") ?></button>
|
||||
<button type="button" class="nav-link" role="tab" id="navs-top-align-news-tab" data-bs-toggle="tab" data-bs-target="#navs-top-align-news"><?= lang("Produccion.navs.news") ?></button>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<button type="button" class="nav-link active" role="tab" id="navs-top-align-pendientes-tab" data-bs-toggle="tab" data-bs-target="#navs-top-align-pendientes"><?= lang("Produccion.pendientes") ?></button>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<button type="button" class="nav-link" role="tab" id="navs-top-align-waiting-tab" data-bs-toggle="tab" data-bs-target="#navs-top-align-waiting"><?= lang("Produccion.navs.waiting") ?></button>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<button type="button" class="nav-link" role="tab" id="navs-top-align-ferro-pendiente-tab" data-bs-toggle="tab" data-bs-target="#navs-top-align-ferro-pendiente"><?= lang("Produccion.pendiente_ferro") ?></button>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<button type="button" class="nav-link" role="tab" id="navs-top-align-ferro-ok-tab" data-bs-toggle="tab" data-bs-target="#navs-top-align-ferro-ok"><?= lang("Produccion.ferro_ok") ?></button>
|
||||
</li>
|
||||
|
||||
<li class="nav-item d-none">
|
||||
<button type="button" class="nav-link" role="tab" id="navs-top-align-revision-com-tab" data-bs-toggle="tab" data-bs-target="#navs-top-align-revision-com"><?= lang("Produccion.navs.revision_com") ?></button>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<button type="button" class="nav-link" role="tab" id="navs-top-align-prod-tab" data-bs-toggle="tab" data-bs-target="#navs-top-align-prod"><?= lang("Produccion.navs.prod") ?></button>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<button type="button" class="nav-link" role="tab" id="navs-top-align-finalizados-tab" data-bs-toggle="tab" data-bs-target="#navs-top-align-finalizados"><?= lang("Produccion.finalizadas") ?></button>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tab-content" id="ots-datatables-container">
|
||||
<div class="tab-pane fade show" id="navs-top-align-finalizados">
|
||||
@ -36,6 +49,19 @@
|
||||
<div class="tab-pane fade show" id="navs-top-align-ferro-ok">
|
||||
<?= view("themes/vuexy/components/tables/ot_table.php", ["id" => "ot-datatable-ferro-ok"]) ?>
|
||||
</div>
|
||||
<div class="tab-pane fade show" id="navs-top-align-news">
|
||||
<?= view("themes/vuexy/components/tables/ot_table.php", ["id" => "ot-datatable-news"]) ?>
|
||||
</div>
|
||||
<div class="tab-pane fade show" id="navs-top-align-waiting">
|
||||
<?= view("themes/vuexy/components/tables/ot_table.php", ["id" => "ot-datatable-waiting"]) ?>
|
||||
</div>
|
||||
<div class="tab-pane fade show" id="navs-top-align-revision-com">
|
||||
<?= view("themes/vuexy/components/tables/ot_table.php", ["id" => "ot-datatable-revision-com"]) ?>
|
||||
</div>
|
||||
<div class="tab-pane fade show" id="navs-top-align-prod">
|
||||
<?= view("themes/vuexy/components/tables/ot_table.php", ["id" => "ot-datatable-prod"]) ?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--//.card -->
|
||||
</div>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user