Merge branch 'fix/logistica-controller' into 'main'

fix logistica controller

See merge request jjimenez/safekat!641
This commit is contained in:
Alvaro
2025-04-02 16:43:48 +00:00
2 changed files with 1 additions and 34 deletions

View File

@ -977,9 +977,7 @@ $routes->group('soporte', ['namespace' => 'App\Controllers\Soporte'], function (
$routes->get('image/(:segment)', 'Ticketcontroller::image/$1');
});
$routes->group('logistica', ['namespace' => 'App\Controllers\Logistica'], function ($routes) {
$routes->get('panel', 'Logisticacontroller::panel', ['as' => 'LogisticaPanel']);
});
$routes->group('produccion', ['namespace' => 'App\Controllers\Produccion'], function ($routes) {
$routes->group('ordentrabajo', ['namespace' => 'App\Controllers\Produccion'], function ($routes) {

View File

@ -1,31 +0,0 @@
<?php
namespace App\Controllers\Logistica;
use App\Controllers\BaseController;
use App\Services\ImpresoraEtiquetaService;
use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface;
use Psr\Log\LoggerInterface;
class LogisticaController extends BaseController
{
protected ImpresoraEtiquetaService $impresoraEtiquetaService;
protected string $locale;
protected array $viewData;
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
{
$this->impresoraEtiquetaService = service('impresora_etiqueta');
$this->locale = session()->get('lang');
parent::initController($request, $response, $logger);
}
public function print_test_label()
{
$etiquetaData = $this->impresoraEtiquetaService->test();
$responseMessage = $etiquetaData["status"] ? "OK" : "ERROR";
return $this->response->setJSON(["message" => $responseMessage, "data" => $etiquetaData, "status" => $etiquetaData["status"]]);
}
}