mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
zip pdf download
This commit is contained in:
@ -243,6 +243,7 @@ class Ordentrabajo extends BaseController
|
||||
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)
|
||||
->add("pdf_check", fn($q) => $q->id)
|
||||
->toJson(true);
|
||||
}
|
||||
public function datatable_pendientes()
|
||||
@ -258,6 +259,7 @@ class Ordentrabajo extends BaseController
|
||||
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)
|
||||
->add("pdf_check", fn($q) => $q->id)
|
||||
->toJson(true);
|
||||
}
|
||||
public function datatable_ferro_pendiente()
|
||||
@ -273,6 +275,7 @@ class Ordentrabajo extends BaseController
|
||||
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)
|
||||
->add("pdf_check", fn($q) => $q->id)
|
||||
->toJson(true);
|
||||
}
|
||||
public function datatable_ferro_ok()
|
||||
@ -288,6 +291,7 @@ class Ordentrabajo extends BaseController
|
||||
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)
|
||||
->add("pdf_check", fn($q) => $q->id)
|
||||
->toJson(true);
|
||||
}
|
||||
public function datatable_news()
|
||||
@ -302,6 +306,7 @@ class Ordentrabajo extends BaseController
|
||||
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)
|
||||
->add("pdf_check", fn($q) => $q->id)
|
||||
->toJson(true);
|
||||
}
|
||||
public function datatable_prod()
|
||||
@ -316,6 +321,7 @@ class Ordentrabajo extends BaseController
|
||||
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)
|
||||
->add("pdf_check", fn($q) => $q->id)
|
||||
->toJson(true);
|
||||
}
|
||||
public function datatable_waiting()
|
||||
@ -330,6 +336,7 @@ class Ordentrabajo extends BaseController
|
||||
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)
|
||||
->add("pdf_check", fn($q) => $q->id)
|
||||
->toJson(true);
|
||||
}
|
||||
public function datatable_revision_com()
|
||||
@ -344,6 +351,7 @@ class Ordentrabajo extends BaseController
|
||||
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)
|
||||
->add("pdf_check", fn($q) => $q->id)
|
||||
->toJson(true);
|
||||
}
|
||||
public function papel_gramaje_datatable()
|
||||
@ -641,7 +649,7 @@ class Ordentrabajo extends BaseController
|
||||
$this->viewData['ot_tarea'] = $otTareaEntity;
|
||||
$this->viewData['ot'] = $otTareaEntity->orden_trabajo();
|
||||
$this->viewData['presupuesto'] = $this->viewData['ot']->presupuesto();
|
||||
|
||||
|
||||
$this->viewData['impresoras'] = $impresoras;
|
||||
$this->viewData['breadcrumb'] = [
|
||||
['title' => lang("Produccion.maquinista.maquinas"), 'route' => route_to("viewProduccionMaquinistaMaquinas"), 'active' => false],
|
||||
@ -784,8 +792,8 @@ class Ordentrabajo extends BaseController
|
||||
);
|
||||
$tareaEntity = $this->otTarea->find($tareaId);
|
||||
$tiempo_trabajado = $tareaEntity->tiempo_trabajado();
|
||||
$responseData['tiempo_total_estimado']+=$tareaEntity->tiempo_estimado;
|
||||
$responseData['tiempo_total_real']+=$tiempo_trabajado;
|
||||
$responseData['tiempo_total_estimado'] += $tareaEntity->tiempo_estimado;
|
||||
$responseData['tiempo_total_real'] += $tiempo_trabajado;
|
||||
$responseData["estado"] = $validatedData["estado"];
|
||||
$tareaEntity->tiempo_real = $tiempo_trabajado / count($validatedData['tareas']);
|
||||
$tareaEntity->click_init = $validatedData['click_init'] / count($validatedData['tareas']);
|
||||
@ -823,7 +831,7 @@ class Ordentrabajo extends BaseController
|
||||
$validatedData = $this->validation->getValidated();
|
||||
|
||||
foreach ($validatedData['ordenes_trabajo'] as $key => $orden_trabajo_id) {
|
||||
$maquinaOtTarea = $this->maquinaOtTareaModel->where('orden_trabajo_id', $orden_trabajo_id)->where('maquina_id', $validatedData['maquina_id'])->where('deleted_at',null)->countAllResults();
|
||||
$maquinaOtTarea = $this->maquinaOtTareaModel->where('orden_trabajo_id', $orden_trabajo_id)->where('maquina_id', $validatedData['maquina_id'])->where('deleted_at', null)->countAllResults();
|
||||
if ($maquinaOtTarea) {
|
||||
continue;
|
||||
}
|
||||
@ -855,17 +863,15 @@ class Ordentrabajo extends BaseController
|
||||
$tarea->click_init = $bodyData['click_init'];
|
||||
$tarea->click_end = $bodyData['click_end'];
|
||||
$totalTareas[] = $tarea;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
foreach ($totalTareas as $key => $tarea) {
|
||||
$tiempo_trabajado = $tarea->tiempo_trabajado();
|
||||
$tarea->tiempo_real = $tiempo_trabajado / count($totalTareas);
|
||||
$tarea->click_init = $tarea->click_init / count($totalTareas);
|
||||
$tarea->click_end = $tarea->click_end / count($totalTareas);
|
||||
$tiempo_trabajado = $tarea->tiempo_trabajado();
|
||||
$tarea->tiempo_real = $tiempo_trabajado / count($totalTareas);
|
||||
$tarea->click_init = $tarea->click_init / count($totalTareas);
|
||||
$tarea->click_end = $tarea->click_end / count($totalTareas);
|
||||
|
||||
$this->otTarea->save($tarea);
|
||||
$this->otTarea->save($tarea);
|
||||
}
|
||||
if ($estado == "F") {
|
||||
$this->maquinaOtTareaModel->where('maquina_id', $maquina_id)->delete();
|
||||
@ -875,7 +881,7 @@ class Ordentrabajo extends BaseController
|
||||
}
|
||||
public function delete_maquina_orden_trabajo_tarea($maquina_orden_trabajo_tarea_id)
|
||||
{
|
||||
|
||||
|
||||
$status = $this->maquinaOtTareaModel->delete($maquina_orden_trabajo_tarea_id);
|
||||
return $this->response->setJSON(["message" => lang("App.user_alert_delete"), "status" => $status]);
|
||||
}
|
||||
@ -889,7 +895,7 @@ class Ordentrabajo extends BaseController
|
||||
$this->produccionService->deleteOrdenTrabajoTareaProgressDates($tarea->id);
|
||||
}
|
||||
}
|
||||
$status = $this->maquinaOtTareaModel->where('maquina_id',$maquina_id)->delete();
|
||||
$status = $this->maquinaOtTareaModel->where('maquina_id', $maquina_id)->delete();
|
||||
return $this->response->setJSON(["message" => lang("App.user_alert_delete"), "status" => $status]);
|
||||
}
|
||||
|
||||
@ -916,23 +922,22 @@ class Ordentrabajo extends BaseController
|
||||
$tareas = $this->produccionService->init($maquina_ot->orden_trabajo_id)
|
||||
->getTareasWithMaquina($maquina_id, ['P', 'I', 'S', 'D']);
|
||||
foreach ($tareas as $key => $tarea) {
|
||||
$responseData['tiempo_total_estimado']+= $tarea->tiempo_estimado;
|
||||
$responseData['tiempo_total_real']+= $tarea->tiempo_real;
|
||||
$responseData['tiempo_total_estimado'] += $tarea->tiempo_estimado;
|
||||
$responseData['tiempo_total_real'] += $tarea->tiempo_real;
|
||||
$responseData["estado"] = $tarea->lastState()->estado;
|
||||
if($tarea->presupuesto_linea_id){
|
||||
if ($tarea->presupuesto_linea_id) {
|
||||
$responseData["clicks_total"] += $tarea->presupuesto_linea()->rotativa_clicks_total;
|
||||
$responseData["tirada_total"] += $tarea->orden_trabajo()->presupuesto()->tirada;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
$responseData['tiempo_total_estimado'] = float_seconds_to_hhmmss_string($responseData['tiempo_total_estimado']);
|
||||
$responseData['tiempo_total_real'] = float_seconds_to_hhmmss_string($responseData['tiempo_total_real']);
|
||||
return $this->response->setJSON($responseData);
|
||||
|
||||
}
|
||||
|
||||
public function printPackagingLabels(){
|
||||
public function printPackagingLabels()
|
||||
{
|
||||
|
||||
$ot_id = $this->request->getPost('ot_id') ?? null;
|
||||
$unidades_caja = $this->request->getPost('unidades_caja') ?? null;
|
||||
@ -963,4 +968,8 @@ class Ordentrabajo extends BaseController
|
||||
|
||||
return $this->response->setJSON($result);
|
||||
}
|
||||
public function get_ot_pdf_content($orden_trabajo_id)
|
||||
{
|
||||
return $this->produccionService->init($orden_trabajo_id)->getPdfContent();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user