mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
ots
This commit is contained in:
@ -6,6 +6,7 @@ use App\Entities\Pedidos\PedidoEntity;
|
||||
use App\Models\Collection;
|
||||
use App\Models\Pedidos\PedidoModel;
|
||||
use App\Services\PedidoXMLService;
|
||||
use App\Services\ProductionService;
|
||||
|
||||
class Pedido extends \App\Controllers\BaseResourceController
|
||||
{
|
||||
@ -388,9 +389,14 @@ class Pedido extends \App\Controllers\BaseResourceController
|
||||
// $xml_service = new PedidoXMLService($this->model);
|
||||
return $this->respond($data);
|
||||
}
|
||||
|
||||
public function pedidoToProduction(int $pedido_id){
|
||||
|
||||
|
||||
public function to_produccion($pedido_id)
|
||||
{
|
||||
$serviceProduction = service('production');
|
||||
$pedido = $this->model->find($pedido_id);
|
||||
$serviceProduction->setPedido($pedido);
|
||||
return $this->respond()->setJSON($serviceProduction->createOrdenTrabajo());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -2,8 +2,10 @@
|
||||
|
||||
namespace App\Controllers\Produccion;
|
||||
use App\Controllers\BaseController;
|
||||
use App\Models\OrdenTrabajo\OrdenTrabajoModel;
|
||||
use CodeIgniter\HTTP\RequestInterface;
|
||||
use CodeIgniter\HTTP\ResponseInterface;
|
||||
use Hermawan\DataTables\DataTable;
|
||||
use Psr\Log\LoggerInterface;
|
||||
|
||||
class Ordentrabajo extends BaseController
|
||||
@ -11,7 +13,7 @@ class Ordentrabajo extends BaseController
|
||||
protected $format = 'json';
|
||||
protected array $viewData = [];
|
||||
|
||||
|
||||
protected OrdenTrabajoModel $otModel;
|
||||
protected static $viewPath = 'themes/vuexy/form/produccion/';
|
||||
protected static $controllerSlug = "orden-trabajo";
|
||||
protected $indexRoute = 'viewOrdenTrabajoList';
|
||||
@ -19,6 +21,7 @@ class Ordentrabajo extends BaseController
|
||||
|
||||
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
|
||||
{
|
||||
$this->otModel = model(OrdenTrabajoModel::class);
|
||||
parent::initController($request, $response, $logger);
|
||||
}
|
||||
|
||||
@ -52,19 +55,13 @@ class Ordentrabajo extends BaseController
|
||||
return view(static::$viewPath . $this->editRoute, $this->viewData);
|
||||
}
|
||||
|
||||
public function cien()
|
||||
{
|
||||
echo 'Orden trabajo 100%';
|
||||
}
|
||||
|
||||
public function finalizado()
|
||||
{
|
||||
echo 'Orden trabajo finalizado';
|
||||
}
|
||||
|
||||
public function pendiente()
|
||||
{
|
||||
echo 'Orden trabajo pendiente';
|
||||
public function datatable(){
|
||||
|
||||
$q = $this->otModel->getDatatableQuery();
|
||||
// return $this->response->setJSON($q->get()->getResultArray());
|
||||
return DataTable::of($q)
|
||||
->add("action" ,fn($q) => $q->id)
|
||||
->toJson(true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user