mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Merge branch 'main' into 'feat/listados_cliente_form'
Main See merge request jjimenez/safekat!629
This commit is contained in:
@ -363,6 +363,7 @@ class Maquinas extends \App\Controllers\BaseResourceController
|
||||
$r = $this->model->getSelectQuery($this->request->getGet("q"));
|
||||
return $this->response->setJSON($r);
|
||||
}
|
||||
|
||||
protected function getMaquinaListItems($selId = null)
|
||||
{
|
||||
$data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Maquinas.maquina'))])];
|
||||
@ -402,5 +403,9 @@ class Maquinas extends \App\Controllers\BaseResourceController
|
||||
}
|
||||
|
||||
}
|
||||
public function find_maquina(int $maquina_id){
|
||||
$maquinaEntity = $this->model->find($maquina_id);
|
||||
return $this->response->setJSON($maquinaEntity);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -138,7 +138,7 @@ class Ordentrabajo extends BaseController
|
||||
->add("logo", fn($q) => site_url($logo->get_logo_path($q->presupuesto_linea_tipo)))
|
||||
->edit(
|
||||
"fecha_encuadernado_at",
|
||||
fn($q) => Time::createFromFormat("Y-m-d", $q->fecha_encuadernado_at)->format("d/m/Y")
|
||||
fn($q) => $q->fecha_encuadernado_at ? Time::createFromFormat("Y-m-d", $q->fecha_encuadernado_at)->format("d/m/Y") : ""
|
||||
)
|
||||
->add("action", fn($q) => $q->id)
|
||||
->toJson(true);
|
||||
@ -153,7 +153,7 @@ class Ordentrabajo extends BaseController
|
||||
->add("logo", fn($q) => site_url($logo->get_logo_path($q->presupuesto_linea_tipo)))
|
||||
->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", $q->fecha_encuadernado_at)->format("d/m/Y") : ""
|
||||
)
|
||||
->add("action", fn($q) => $q->id)
|
||||
->toJson(true);
|
||||
@ -168,7 +168,7 @@ class Ordentrabajo extends BaseController
|
||||
->add("logo", fn($q) => site_url($logo->get_logo_path($q->presupuesto_linea_tipo)))
|
||||
->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", $q->fecha_encuadernado_at)->format("d/m/Y") : ""
|
||||
)
|
||||
->add("action", fn($q) => $q->id)
|
||||
->toJson(true);
|
||||
@ -183,7 +183,7 @@ class Ordentrabajo extends BaseController
|
||||
->add("logo", fn($q) => site_url($logo->get_logo_path($q->presupuesto_linea_tipo)))
|
||||
->edit(
|
||||
"fecha_encuadernado_at",
|
||||
fn($q) => Time::createFromFormat("Y-m-d", $q->fecha_encuadernado_at)->format("d/m/Y")
|
||||
fn($q) => $q->fecha_encuadernado_at ? Time::createFromFormat("Y-m-d", $q->fecha_encuadernado_at)->format("d/m/Y") : ""
|
||||
)
|
||||
->add("action", fn($q) => $q->id)
|
||||
->toJson(true);
|
||||
@ -253,6 +253,22 @@ class Ordentrabajo extends BaseController
|
||||
return $this->response->setJSON(["message" => "Portada error", "error" => $th->getMessage()])->setStatusCode($th->getCode());
|
||||
}
|
||||
}
|
||||
public function delete_orden_trabajo_portada($orden_trabajo_id)
|
||||
{
|
||||
try {
|
||||
helper('filesystem');
|
||||
$otEntity = $this->otModel->find($orden_trabajo_id);
|
||||
$pathActualFile = $otEntity->portada_path;
|
||||
$fullPath = WRITEPATH . 'uploads/' . $pathActualFile;
|
||||
if(file_exists($fullPath)){
|
||||
delete_files($fullPath);
|
||||
}
|
||||
$r = $this->otModel->update($otEntity->id, ["portada_path" => null]);
|
||||
return $this->response->setJSON(["message" => "Portada eliminada", "data" => $r]);
|
||||
} catch (\Throwable $th) {
|
||||
return $this->response->setStatusCode(500)->setJSON(["message" => "Portada error", "error" => $th->getMessage()]);
|
||||
}
|
||||
}
|
||||
public function get_portada_img($orden_trabajo_id)
|
||||
{
|
||||
$ot = $this->otModel->find($orden_trabajo_id);
|
||||
@ -273,8 +289,7 @@ class Ordentrabajo extends BaseController
|
||||
return DataTable::of($q)
|
||||
->edit("fecha_entrega_real_at", fn($q) => $q->fecha_entrega_real_at ? Time::createFromFormat("Y-m-d", $q->fecha_entrega_real_at)->format("d/m/Y") : "")
|
||||
->add("metros_check", fn($q) => $q->otId)
|
||||
->add("corte", fn($q) => $q->otId)
|
||||
|
||||
->add("corte", fn($q) => ["otId" => $q->otId,"tipo_corte" => $this->produccionService->ordenTrabajoTareaCorte($q->otId)])
|
||||
->add("action", fn($q) => $q)
|
||||
->toJson(true);
|
||||
}
|
||||
@ -287,4 +302,30 @@ class Ordentrabajo extends BaseController
|
||||
->add("action", fn($q) => $q)
|
||||
->toJson(true);
|
||||
}
|
||||
public function select_maquina_planning_rot(){
|
||||
$q = $this->request->getGet('q');
|
||||
$result = $this->produccionService->querySelectMaquinaPlanningRotativa($q);
|
||||
return $this->response->setJSON($result);
|
||||
}
|
||||
public function select_papel_planning_rot(){
|
||||
$q = $this->request->getGet('q');
|
||||
$result = $this->produccionService->querySelectPapelPlanningRot($q);
|
||||
return $this->response->setJSON($result);
|
||||
}
|
||||
public function select_maquina_planning_plana(){
|
||||
$q = $this->request->getGet('q');
|
||||
$result = $this->produccionService->querySelectMaquinaPlanningPlana($q);
|
||||
return $this->response->setJSON($result);
|
||||
}
|
||||
public function select_papel_planning_plana(){
|
||||
$q = $this->request->getGet('q');
|
||||
$result = $this->produccionService->querySelectPapelPlanningPlana($q);
|
||||
return $this->response->setJSON($result);
|
||||
}
|
||||
public function tarea_toggle_corte($orden_trabajo_id)
|
||||
{
|
||||
$status = $this->produccionService->tareaUpdateMaquinaCorte($orden_trabajo_id);
|
||||
return $this->response->setJSON(["message" => lang("App.global_alert_save_success"), "status" => $status ]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user