mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
feat confirm alert pedido to produccion
This commit is contained in:
@ -395,8 +395,13 @@ class Pedido extends \App\Controllers\BaseResourceController
|
||||
$serviceProduction = service('production');
|
||||
$pedido = $this->model->find($pedido_id);
|
||||
$serviceProduction->setPedido($pedido);
|
||||
$r = $serviceProduction->createOrdenTrabajo();
|
||||
return $this->respond()->setJSON($r);
|
||||
if($pedido->orden_trabajo()){
|
||||
return $this->response->setJSON(["data"=>$pedido->orden_trabajo(),"message" => "Ya existe una orden de trabajo para este pedido"]);
|
||||
|
||||
}else{
|
||||
$r = $serviceProduction->createOrdenTrabajo();
|
||||
return $this->response->setJSON(["data"=>$r,"message" => "Orden trabajo creada correctamente"]);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user