Merge branch 'main' into 'feat/catalogo'

Main

See merge request jjimenez/safekat!718
This commit is contained in:
Ignacio Martinez Navajas
2025-04-21 12:07:04 +00:00
547 changed files with 2700 additions and 1216 deletions

0
ci4/app/Config/Auth.php Normal file → Executable file
View File

0
ci4/app/Config/AuthGroups.php Normal file → Executable file
View File

0
ci4/app/Config/AuthJWT.php Normal file → Executable file
View File

0
ci4/app/Config/AuthToken.php Normal file → Executable file
View File

0
ci4/app/Config/CURLRequest.php Normal file → Executable file
View File

0
ci4/app/Config/Feature.php Normal file → Executable file
View File

0
ci4/app/Config/Kint.php Normal file → Executable file
View File

0
ci4/app/Config/LogoImpresion.php Normal file → Executable file
View File

59
ci4/app/Config/OrdenTrabajo.php Normal file → Executable file
View File

@ -25,6 +25,7 @@ class OrdenTrabajo extends BaseConfig
"retractilado5_at" => "retractilado5_user_id",
"prototipo_at" => "prototipo_user_id",
"marcapaginas_at" => "marcapaginas_user_id",
"espiral_at" => "espiral_user_id",
//FERRO
"pendiente_ferro_at" => "pendiente_ferro_user_id",
"ferro_en_cliente_at" => "ferro_en_cliente_user_id",
@ -57,12 +58,66 @@ class OrdenTrabajo extends BaseConfig
"cosido" => "#FF0B55",
"grapado" => "#FEBA17",
"encuadernado" => "#FEBA17",
"corte" => "#67AE6E"
"corte" => "#67AE6E"
];
public array $OT_WEEK_COLOR_DAY = [
["bg" => "#FFFFFF", "color" => "black"],
["bg" => "yellow", "color" => "black"],
["bg" => "purple", "color" => "white"],
["bg" => "orange", "color" => "white"],
["bg" => "blue", "color" => "black"],
["bg" => "pink", "color" => "black"],
["bg" => "#FFFFFF", "color" => "black"],
];
public array $OT_ENCUADERNACION_COLOR = [
"RF" => ["bg" => "#FF9900", "color" => "white"],
"RFS" => ["bg" => "#FF9900", "color" => "white"],
"RCHV" => ["bg" => "#FF9900", "color" => "blue"],
"RCHVS" => ["bg" => "#FF9900", "color" => "blue"],
"CC2" => ["bg" => "#104861", "color" => "yellow"],
"CC2S" => ["bg" => "#104861", "color" => "yellow"],
"TDF" => ["bg" => "#E49EDD", "color" => "white"],
"TDC" => ["bg" => "#E49EDD", "color" => "blue"],
"default" => ["bg" => "#FFFF00", "color" => "red"],
];
public array $OT_BACKGROUND_COLOR = [
"ferro_digital" => ["bg" => "#BFBFBF","color" => "black"],
"ferro" => ["bg" => "#BFBFBF","color" => "black"],
"prototipo" => ["bg" => "#BFBFBF","color" => "black"],
"pod" => ["bg" => "#47D359","color" => "black"],
"inaplazable" => ["bg" => "red","color" => "white"],
"default" => ["bg" => "#FFFFFF","color" => "black"]
];
public array $OT_PAPEL_COLOR =
[
"blanco" => ["bg" => "#FFFFFF", "color" => "black"],
"ahuesado" => ["bg" => "#FFF2CC", "color" => "black"],
"marfil" => ["bg" => "#FFD966", "color" => "black"],
"volumen_ahuesado" => ["bg" => "#BF8F00", "color" => "black"],
"estucado_mate" => ["bg" => "#BDD7EE", "color" => "black"],
"cartulina" => ["bg" => "#C6E0B4", "color" => "black"],
"default" => ["bg" => "#FFCCFF", "color" => "black"],
];
public array $OT_PLASTIFICADO_COLOR =
[
"BRIL" => ["bg" => "#00B0F0", "color" => "white"],
"MATE" => ["bg" => "#FF0000", "color" => "white"],
"SOFT_TOUCH" => ["bg" => "#00B050", "color" => "white"],
"SANDY" => ["bg" => "#782170", "color" => "white"],
"ANTIRAYADO" => ["bg" => "#E97132", "color" => "white"],
"GOFRADO" => ["bg" => "#FFFF00", "color" => "black"],
"default" => ["bg" => "#FFFFFF", "color" => "black"],
];
public array $OT_IMPRESION_INTERIOR_PPAL_COLOR =
[
"ROTATIVA" => ["bg" => "white", "color" => "red"],
"POD" => ["bg" => "white", "color" => "#47D359"],
"GENERAL" => ["bg" => "white", "color" => "#A02B93"],
"default" => ["bg" => "white", "color" => "black"],
];
public function __construct()
{
parent::__construct();
}
}

0
ci4/app/Config/PedidoXML.php Normal file → Executable file
View File

0
ci4/app/Config/Publisher.php Normal file → Executable file
View File

0
ci4/app/Config/RBAC/.gitkeep Normal file → Executable file
View File

28
ci4/app/Config/Routes.php Normal file → Executable file
View File

@ -32,7 +32,7 @@ $routes->group('activity', ['namespace' => 'App\Controllers\Sistema'], function
* --------------------------------------------------------------------
*/
// Carga archivos de rutas por dominio
// Carga archivos de rutas por dominio
foreach (glob(APPPATH . 'Config/Routes/*Routes.php') as $routeFile) {
require $routeFile;
}
@ -146,17 +146,24 @@ $routes->group('tipologiaslibros', ['namespace' => 'App\Controllers\Configuracio
$routes->group('imposiciones', ['namespace' => 'App\Controllers\Configuracion'], function ($routes) {
$routes->get('', 'Imposiciones::index', ['as' => 'imposicionList']);
$routes->get('add', 'Imposiciones::add', ['as' => 'newImposicion']);
$routes->post('add', 'Imposiciones::add', ['as' => 'createImposicion']);
$routes->get('add/esquema', 'Imposiciones::add_esquema', ['as' => 'newImposicionEsquema']);
$routes->get('find/(:num)', 'Imposiciones::find_imposicion/$1', ['as' => 'findImposicion']);
$routes->get('esquema/find/(:num)', 'Imposiciones::find_imposicion_esquema/$1', ['as' => 'findImposicionEsquema']);
$routes->post('create', 'Imposiciones::create', ['as' => 'ajaxCreateImposicion']);
$routes->put('(:num)/update', 'Imposiciones::update/$1', ['as' => 'ajaxUpdateImposicion']);
$routes->post('(:num)/edit', 'Imposiciones::edit/$1', ['as' => 'updateImposicion']);
$routes->post('datatable', 'Imposiciones::datatable', ['as' => 'dataTableOfImposiciones']);
$routes->post('esquema/create', 'Imposiciones::create_imposicion_esquema', ['as' => 'ajaxCreateImposicionEsquema']);
$routes->post('(:num)', 'Imposiciones::update/$1', ['as' => 'ajaxUpdateImposicion']);
$routes->post('esquema/(:num)', 'Imposiciones::update_imposicion_esquema/$1', ['as' => 'ajaxUpdateImposicionEsquema']);
$routes->delete('(:num)', 'Imposiciones::delete/$1', ['as' => 'deleteImposicion']);
$routes->delete('esquema/(:num)', 'Imposiciones::delete_imposicion_esquema/$1', ['as' => 'deleteImposicionEsquema']);
$routes->get('edit/(:num)', 'Imposiciones::edit/$1', ['as' => 'updateImposicionForm']);
$routes->get('esquema/edit/(:num)', 'Imposiciones::edit_imposicion_esquema/$1', ['as' => 'updateImposicionEsquemaForm']);
$routes->get('datatable', 'Imposiciones::datatable', ['as' => 'dataTableOfImposiciones']);
$routes->get('esquema/datatable', 'Imposiciones::datatable_imposicion_esquema', ['as' => 'dataTableOfEsquemaImposiciones']);
$routes->post('allmenuitems', 'Imposiciones::allItemsSelect', ['as' => 'select2ItemsOfImposiciones']);
$routes->post('menuitems', 'Imposiciones::menuItems', ['as' => 'menuItemsOfImposiciones']);
$routes->get('select', 'Imposiciones::selectImposicion', ['as' => 'selectImposicion']);
$routes->get('esquema/select', 'Imposiciones::selectImposicionEsquema', ['as' => 'selectImposicionEsquema']);
});
$routes->resource('imposiciones', ['namespace' => 'App\Controllers\Configuracion', 'controller' => 'Imposiciones', 'except' => 'show,new,create,update']);
$routes->group('papelimpresiontipologias', ['namespace' => 'App\Controllers\Configuracion'], function ($routes) {
$routes->get('add', 'Papelimpresiontipologias::add', ['as' => 'newPapelImpresionTipologia']);
@ -753,6 +760,7 @@ $routes->group('produccion', ['namespace' => 'App\Controllers\Produccion'], func
*========================**/
$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"]);
/**======================
* PDF
*========================**/
@ -770,15 +778,17 @@ $routes->group('produccion', ['namespace' => 'App\Controllers\Produccion'], func
$routes->get('rotativa/datatable', 'Ordentrabajo::planning_rotativa_datatable');
$routes->get('plana/datatable', 'Ordentrabajo::planning_plana_datatable');
$routes->post('tarea/toggle/corte/(:num)', 'Ordentrabajo::tarea_toggle_corte/$1');
});
$routes->group('maquinista', ['namespace' => 'App\Controllers\Produccion'], function ($routes) {
$routes->get('maquinas/view', 'Ordentrabajo::maquinista_maquinas_view', ['as' => 'viewProduccionMaquinistaMaquinas']);
$routes->get('colas/view', 'Ordentrabajo::maquinista_colas_view', ['as' => 'viewProduccionMaquinistaColas']);
});
});
});
$routes->group('logistica', ['namespace' => 'App\Controllers\Logistica'], function ($routes) {
$routes->get('print/label/test', 'LogisticaController::print_test_label');
});
/*

0
ci4/app/Config/Routes/ApiRoutes.php Normal file → Executable file
View File

0
ci4/app/Config/Routes/ComprasRoutes.php Normal file → Executable file
View File

0
ci4/app/Config/Routes/ConfiguracionRoutes.php Normal file → Executable file
View File

0
ci4/app/Config/Routes/PresupuestosRoutes.php Normal file → Executable file
View File

0
ci4/app/Config/Routes/TarifasRoutes.php Normal file → Executable file
View File

0
ci4/app/Config/Routing.php Normal file → Executable file
View File

0
ci4/app/Config/Safekat.php Normal file → Executable file
View File

0
ci4/app/Config/Session.php Normal file → Executable file
View File

0
ci4/app/Config/Toolbar.php Normal file → Executable file
View File

0
ci4/app/Config/Wiki/WikiRoutes.php Normal file → Executable file
View File

0
ci4/app/Controllers/API/ImprimelibrosApi.php Normal file → Executable file
View File

0
ci4/app/Controllers/BaseResourceController.php Normal file → Executable file
View File

0
ci4/app/Controllers/Chat/ChatController.php Normal file → Executable file
View File

0
ci4/app/Controllers/Clientes/Clienteusuarios.php Normal file → Executable file
View File

0
ci4/app/Controllers/Configuracion/ConfigErrores.php Normal file → Executable file
View File

0
ci4/app/Controllers/Configuracion/ConfigVariables.php Normal file → Executable file
View File

0
ci4/app/Controllers/Configuracion/FormasPago.php Normal file → Executable file
View File

View File

@ -2,37 +2,41 @@
namespace App\Controllers\Configuracion;
use App\Controllers\BaseController;
use App\Controllers\BaseResourceController;
use App\Models\Collection;
use App\Entities\Configuracion\Imposicion;
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 Imposiciones extends \App\Controllers\BaseResourceController
class Imposiciones extends BaseController
{
protected $modelName = ImposicionModel::class;
protected $format = 'json';
protected static $singularObjectName = 'Imposicion';
protected static $singularObjectNameCc = 'imposicion';
protected static $pluralObjectName = 'Imposiciones';
protected static $pluralObjectNameCc = 'imposiciones';
protected ImposicionModel $model;
protected ImposicionEsquemaModel $imposicionEsquemaModel;
protected static $controllerSlug = 'imposiciones';
protected $format = 'json';
protected static $viewPath = 'themes/vuexy/form/configuracion/imposiciones/';
protected $indexRoute = 'imposicionList';
protected array $viewData = [];
protected Validation $validation;
public function initController(\CodeIgniter\HTTP\RequestInterface $request, \CodeIgniter\HTTP\ResponseInterface $response, \Psr\Log\LoggerInterface $logger)
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
{
$this->viewData['pageTitle'] = lang('Imposiciones.moduleTitle');
$this->viewData['usingSweetAlert'] = true;
$this->model = model($this->modelName);
$this->validation = service("validation");
$this->imposicionEsquemaModel = model(ImposicionEsquemaModel::class);
parent::initController($request, $response, $logger);
}
@ -47,7 +51,10 @@ class Imposiciones extends \App\Controllers\BaseResourceController
'usingServerSideDataTable' => true,
];
$this->viewData['breadcrumb'] = [
['title' => lang("App.menu_imposiciones"), 'route' => route_to("imposicionList"), 'active' => true],
];
$viewData = array_merge($this->viewData, $viewData); // merge any possible values from the parent controller class
return view(static::$viewPath . 'viewImposicionList', $viewData);
@ -56,234 +63,153 @@ class Imposiciones extends \App\Controllers\BaseResourceController
public function add()
{
$this->viewData['breadcrumb'] = [
['title' => lang("App.menu_imposiciones"), 'route' => route_to("imposicionList"), 'active' => true],
if ($this->request->getPost()) :
$nullIfEmpty = true; // !(phpversion() >= '8.1');
$postData = $this->request->getPost();
$sanitizedData = $this->sanitized($postData, $nullIfEmpty);
$noException = true;
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
if ($this->canValidate()) :
try {
$successfulResult = $this->model->skipValidation(true)->save($sanitizedData);
} catch (\Exception $e) {
$noException = false;
$this->dealWithException($e);
}
else:
$this->viewData['errorMessage'] = lang('Basic.global.formErr1', [lang('Basic.global.record')]);
$this->session->setFlashdata('formErrors', $this->model->errors());
endif;
$thenRedirect = true; // Change this to false if you want your user to stay on the form after submission
endif;
if ($noException && $successfulResult) :
$id = $this->model->db->insertID();
$message = lang('Basic.global.saveSuccess', [lang('Basic.global.record')]) . '.';
if ($thenRedirect) :
if (!empty($this->indexRoute)) :
return redirect()->to(route_to($this->indexRoute))->with('sweet-success', $message);
else:
return $this->redirect2listView('sweet-success', $message);
endif;
else:
$this->session->setFlashData('sweet-success', $message);
endif;
endif; // $noException && $successfulResult
endif; // ($requestMethod === 'post')
$this->viewData['imposicion'] = isset($sanitizedData) ? new Imposicion($sanitizedData) : new Imposicion();
$this->viewData['orientacionList'] = $this->getOrientacionOptions();
$this->viewData['formAction'] = route_to('createImposicion');
$this->viewData['boxTitle'] = lang('Basic.global.addNew') . ' ' . lang('Imposiciones.moduleTitle') . ' ' . lang('Basic.global.addNewSuffix');
return $this->displayForm(__METHOD__);
} // end function add()
public function edit($requestedId = null)
];
return view(static::$viewPath . 'viewImposicionNewForm', $this->viewData);
}
public function add_esquema()
{
$this->viewData['breadcrumb'] = [
['title' => lang("App.menu_imposiciones"), 'route' => route_to("imposicionList"), 'active' => true],
];
$this->viewData["imposicion_esquema"] = null;
if ($requestedId == null) :
return $this->redirect2listView();
endif;
$id = filter_var($requestedId, FILTER_SANITIZE_URL);
$imposicion = $this->model->find($id);
return view(static::$viewPath . 'viewImposicionEsquemaForm', $this->viewData);
}
public function edit($imposicion_id = null)
{
if ($imposicion_id) {
$this->viewData["imposicion"] = $this->model->find($imposicion_id);
$this->viewData['breadcrumb'] = [
['title' => lang("App.menu_imposiciones"), 'route' => route_to("imposicionList"), 'active' => false],
['title' => $this->viewData["imposicion"]->full_name, 'route' => route_to("updateImposicionForm", $imposicion_id), 'active' => true],
if ($imposicion == false) :
$message = lang('Basic.global.notFoundWithIdErr', [mb_strtolower(lang('Imposiciones.imposicion')), $id]);
return $this->redirect2listView('sweet-error', $message);
endif;
];
}
return view(static::$viewPath . 'viewImposicionForm', $this->viewData);
}
public function edit_imposicion_esquema($imposicion_esquema_id = null)
{
if ($imposicion_esquema_id) {
$this->viewData["imposicion_esquema"] = $this->imposicionEsquemaModel->find($imposicion_esquema_id);
$this->viewData['breadcrumb'] = [
['title' => lang("App.menu_imposiciones"), 'route' => route_to("imposicionList"), 'active' => false],
['title' => $this->viewData["imposicion_esquema"]->name, 'route' => route_to("updateImposicionEsquemaForm", $imposicion_esquema_id), 'active' => true],
if ($this->request->getPost()) :
$nullIfEmpty = true; // !(phpversion() >= '8.1');
$postData = $this->request->getPost();
$sanitizedData = $this->sanitized($postData, $nullIfEmpty);
$noException = true;
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
if ($this->canValidate()) :
try {
$successfulResult = $this->model->skipValidation(true)->update($id, $sanitizedData);
} catch (\Exception $e) {
$noException = false;
$this->dealWithException($e);
}
else:
$this->viewData['warningMessage'] = lang('Basic.global.formErr1', [mb_strtolower(lang('Imposiciones.imposicion'))]);
$this->session->setFlashdata('formErrors', $this->model->errors());
endif;
$imposicion->fill($sanitizedData);
$thenRedirect = false;
endif;
if ($noException && $successfulResult) :
$id = $imposicion->id ?? $id;
$message = lang('Basic.global.updateSuccess', [lang('Basic.global.record')]) . '.';
if ($thenRedirect) :
if (!empty($this->indexRoute)) :
return redirect()->to(route_to($this->indexRoute))->with('sweet-success', $message);
else:
return $this->redirect2listView('sweet-success', $message);
endif;
else:
$this->session->setFlashData('sweet-success', $message);
endif;
endif; // $noException && $successfulResult
endif; // ($requestMethod === 'post')
$this->viewData['imposicion'] = $imposicion;
$this->viewData['orientacionList'] = $this->getOrientacionOptions();
$this->viewData['formAction'] = route_to('updateImposicion', $id);
$this->viewData['boxTitle'] = lang('Basic.global.edit2') . ' ' . lang('Imposiciones.moduleTitle') . ' ' . lang('Basic.global.edit3');
return $this->displayForm(__METHOD__, $id);
} // end function edit(...)
];
}
return view(static::$viewPath . 'viewImposicionEsquemaForm', $this->viewData);
}
public function update($imposicion_id = null)
{
if ($imposicion_id) {
$bodyData = $this->request->getPost();
if(isset($bodyData["imposicion_esquema_id"])){
if($bodyData["imposicion_esquema_id"] == ""){
$bodyData["imposicion_esquema_id"] = null;
}
}
$status = $this->model->update($imposicion_id, $bodyData);
if ($status) {
$imposicionEntity = $this->model->find($imposicion_id);
} else {
return $this->response->setJSON(["message" => lang("App.global_alert_save_error"), "errors" => $this->model->errors(), "status" => true])->setStatusCode(400);
}
return $this->response->setJSON(["message" => lang("App.global_alert_save_success"), "status" => $status, "data" => $imposicionEntity]);
} else {
return $this->response->setJSON(["message" => lang("App.global_alert_save_error"), "message" => "", "status" => false])->setStatusCode(400);
}
}
public function update_imposicion_esquema($imposicion_esquema_id = null)
{
if ($imposicion_esquema_id) {
$bodyData = $this->request->getPost();
$status = $this->imposicionEsquemaModel->update($imposicion_esquema_id, $bodyData);
if ($status) {
$imposicionEsquemaEntity = $this->imposicionEsquemaModel->find($imposicion_esquema_id);
} else {
return $this->response->setJSON(["message" => lang("App.global_alert_save_error"), "errors" => $this->imposicionEsquemaModel->errors(), "status" => true])->setStatusCode(400);
}
return $this->response->setJSON(["message" => lang("App.global_alert_save_success"), "status" => $status, "data" => $imposicionEsquemaEntity]);
} else {
return $this->response->setJSON(["message" => lang("App.global_alert_save_error"), "message" => "", "status" => false])->setStatusCode(400);
}
}
public function delete($imposicion_id = null)
{
$status = $this->model->delete($imposicion_id);
return $this->response->setJSON(["message" => lang("App.user_alert_delete"), "status" => true]);
}
public function delete_imposicion_esquema($imposicion_esquema_id = null)
{
$status = $this->imposicionEsquemaModel->delete($imposicion_esquema_id);
return $this->response->setJSON(["message" => lang("App.user_alert_delete"), "status" => $status]);
}
public function datatable()
{
if ($this->request->isAJAX()) {
$reqData = $this->request->getPost();
if (!isset($reqData['draw']) || !isset($reqData['columns'])) {
$errstr = 'No data available in response to this specific request.';
$response = $this->respond(Collection::datatable([], 0, 0, $errstr), 400, $errstr);
return $response;
}
$start = $reqData['start'] ?? 0;
$length = $reqData['length'] ?? 5;
$search = $reqData['search']['value'];
$requestedOrder = $reqData['order']['0']['column'] ?? 1;
$order = ImposicionModel::SORTABLE[$requestedOrder > 0 ? $requestedOrder : 1];
$dir = $reqData['order']['0']['dir'] ?? 'asc';
$resourceData = $this->model->getResource($search)->orderBy($order, $dir)->limit($length, $start)->get()->getResultObject();
return $this->respond(Collection::datatable(
$resourceData,
$this->model->getResource()->countAllResults(),
$this->model->getResource($search)->countAllResults()
));
} else {
return $this->failUnauthorized('Invalid request', 403);
}
$q = $this->model->queryDatatable();
return DataTable::of($q)
->add('esquema', fn($q) => ["imposicionId" => $q->id,"esquemaId" => $q->esquemaId, "esquemaName" => $q->esquemaName])
->add(
'action',
fn($q) => "<div class='btn-group btn-group-md gap-2 w-100 d-flex justify-space-between'>" . ImposicionModel::datatable_buttons($q->id) . "</div>"
)
->toJson(true);
}
public function allItemsSelect()
public function datatable_imposicion_esquema()
{
if ($this->request->isAJAX()) {
$onlyActiveOnes = true;
$reqVal = $this->request->getPost('val') ?? 'id';
$menu = $this->model->getAllForMenu($reqVal . ', ancho', 'ancho', $onlyActiveOnes, false);
$nonItem = new \stdClass;
$nonItem->id = '';
$nonItem->ancho = '- ' . lang('Basic.global.None') . ' -';
array_unshift($menu, $nonItem);
$newTokenHash = csrf_hash();
$csrfTokenName = csrf_token();
$data = [
'menu' => $menu,
$csrfTokenName => $newTokenHash
];
return $this->respond($data);
} else {
return $this->failUnauthorized('Invalid request', 403);
}
}
public function menuItems()
{
if ($this->request->isAJAX()) {
$searchStr = goSanitize($this->request->getPost('searchTerm'))[0];
$reqId = goSanitize($this->request->getPost('id'))[0];
$reqText = goSanitize($this->request->getPost('text'))[0];
$onlyActiveOnes = false;
$columns2select = [$reqId ?? 'id', $reqText ?? 'ancho'];
$onlyActiveOnes = false;
$menu = $this->model->getSelect2MenuItems($columns2select, $columns2select[1], $onlyActiveOnes, $searchStr);
$nonItem = new \stdClass;
$nonItem->id = '';
$nonItem->text = '- ' . lang('Basic.global.None') . ' -';
array_unshift($menu, $nonItem);
$newTokenHash = csrf_hash();
$csrfTokenName = csrf_token();
$data = [
'menu' => $menu,
$csrfTokenName => $newTokenHash
];
return $this->respond($data);
} else {
return $this->failUnauthorized('Invalid request', 403);
}
$q = $this->imposicionEsquemaModel->queryDatatable();
return DataTable::of($q)
->add(
'action',
fn($q) => "<div class='btn-group btn-group-md gap-2'>" . ImposicionEsquemaModel::datatable_buttons($q->id) . "</div>"
)
->toJson(true);
}
protected function getOrientacionOptions()
{
$orientacionOptions = [
'' => lang('Basic.global.pleaseSelect'),
'H' => 'H',
'V' => 'V',
];
return $orientacionOptions;
}
public function selectImposicion()
{
$data = $this->model->querySelect($this->request->getGet('q'));
return $this->response->setJSON($data);
}
public function selectImposicionEsquema()
{
$data = $this->imposicionEsquemaModel->querySelect($this->request->getGet('q'));
return $this->response->setJSON($data);
}
public function find_imposicion(int $imposicion_id)
{
$imposicionEntity = $this->model->find($imposicion_id)->withImposicionEsquema();
return $this->response->setJSON($imposicionEntity);
}
public function find_imposicion_esquema(int $imposicion_esquema_id)
{
$imposicionEsquemaEntity = $this->imposicionEsquemaModel->find($imposicion_esquema_id);
return $this->response->setJSON($imposicionEsquemaEntity);
}
public function create()
{
$bodyData = $this->request->getPost();
$createdId = $this->model->insert($bodyData);
if ($createdId) {
return $this->response->setJSON(["message" => lang("App.global_alert_save_success"), "status" => true]);
} else {
return $this->response->setJSON(["message" => lang("App.global_alert_save_error"), "errors" => $this->model->errors(), "status" => true])->setStatusCode(400);
}
}
public function create_imposicion_esquema()
{
$bodyData = $this->request->getPost();
$createdId = $this->imposicionEsquemaModel->insert($bodyData);
if ($createdId) {
return $this->response->setJSON(["message" => lang("App.global_alert_save_success"), "status" => true]);
} else {
return $this->response->setJSON(["message" => lang("App.global_alert_save_error"), "errors" => $this->imposicionEsquemaModel->errors(), "status" => true])->setStatusCode(400);
}
}
}

0
ci4/app/Controllers/Configuracion/MaquinaTarea.php Normal file → Executable file
View File

0
ci4/app/Controllers/Configuracion/SeriesFacturas.php Normal file → Executable file
View File

0
ci4/app/Controllers/Configuracion/Ubicaciones.php Normal file → Executable file
View File

0
ci4/app/Controllers/Excel/PrintGiros.php Normal file → Executable file
View File

0
ci4/app/Controllers/Excel/PrintLineas.php Normal file → Executable file
View File

0
ci4/app/Controllers/Facturacion/FacturasLineas.php Normal file → Executable file
View File

0
ci4/app/Controllers/Facturacion/FacturasPagos.php Normal file → Executable file
View File

0
ci4/app/Controllers/Logistica/LogisticaController.php Normal file → Executable file
View File

0
ci4/app/Controllers/Mensajeria/MensajesDirectos.php Normal file → Executable file
View File

0
ci4/app/Controllers/Pdf/PrintAlbaranes.php Normal file → Executable file
View File

0
ci4/app/Controllers/Pdf/PrintFacturas.php Normal file → Executable file
View File

0
ci4/app/Controllers/Pedidos/Albaran.php Normal file → Executable file
View File

0
ci4/app/Controllers/Presupuestos/Buscador.php Normal file → Executable file
View File

View File

0
ci4/app/Controllers/Presupuestos/Presupuestoadmin.php Normal file → Executable file
View File

View File

View File

@ -152,8 +152,13 @@ class Ordentrabajo extends BaseController
$this->viewData["presupuesto"] = $this->produccionService->getPresupuesto();
$this->viewData["cliente"] = $this->produccionService->getCliente();
$this->viewData["ot"] = $this->produccionService->getOrdenTrabajo();
$this->viewData["is_finalizada"] = $this->produccionService->getOrdenTrabajo()->estado == "F";
$this->viewData["user_dates"] = $this->produccionService->userDates();
$this->viewData["pedido_user_dates"] = $this->produccionService->pedidoUserDates();
$this->viewData["colors"] = $this->produccionService->getPdfColors();
$this->viewData["tiempo_estimado"] = $this->produccionService->getTiempoProcesamientoHHMM();
$this->viewData["flags"] = $this->produccionService->getFlags();
return view(static::$viewPath . $this->editRoute, $this->viewData);
}
@ -168,7 +173,7 @@ class Ordentrabajo extends BaseController
->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", $q->fecha_encuadernado_at)->format("d/m/Y") : ""
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);
@ -183,7 +188,7 @@ class Ordentrabajo extends BaseController
->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", $q->fecha_encuadernado_at)->format("d/m/Y") : ""
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);
@ -198,7 +203,7 @@ class Ordentrabajo extends BaseController
->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", $q->fecha_encuadernado_at)->format("d/m/Y") : ""
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);
@ -213,7 +218,7 @@ class Ordentrabajo extends BaseController
->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", $q->fecha_encuadernado_at)->format("d/m/Y") : ""
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);
@ -438,4 +443,16 @@ class Ordentrabajo extends BaseController
$color = $this->produccionService->init($orden_trabajo_id)->getOtColorStatus();
return $this->response->setJSON(["color" => $color]);
}
public function imprimir_codigo_safekat(int $orden_trabajo_id)
{
helper('file');
$barcode = $this->produccionService->init($orden_trabajo_id)->getFileBarCode();
return $this->response
->setHeader('Content-Type', 'image/png')
->setHeader('Content-Disposition', "attachment; filename=CodigoBarrasOT_{$orden_trabajo_id}.png")
->setBody($barcode);
}
public function maquinista_maquinas_view(){}
public function maquinista_colas_view(){}
}

0
ci4/app/Controllers/Sistema/Actividad.php Normal file → Executable file
View File

0
ci4/app/Controllers/Sistema/AuthAPIController.php Normal file → Executable file
View File

0
ci4/app/Controllers/Sistema/Intranet.php Normal file → Executable file
View File

0
ci4/app/Controllers/Soporte/Ticketcontroller.php Normal file → Executable file
View File

View File

View File

View File

View File

0
ci4/app/Controllers/Utiles.php Normal file → Executable file
View File

0
ci4/app/Controllers/Wiki/WikiController.php Normal file → Executable file
View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

Some files were not shown because too many files have changed in this diff Show More