imposiciones

This commit is contained in:
amazuecos
2025-04-12 23:53:48 +02:00
parent 41159d1588
commit ba9c4dc339
19 changed files with 293 additions and 453 deletions

View File

@ -1,4 +1,6 @@
<?php namespace App\Controllers\Configuracion;
<?php
namespace App\Controllers\Configuracion;
use App\Controllers\BaseResourceController;
@ -56,7 +58,7 @@ class Imposiciones extends \App\Controllers\BaseResourceController
{
if ($this->request->getPost()) :
@ -130,7 +132,7 @@ class Imposiciones extends \App\Controllers\BaseResourceController
return $this->redirect2listView('sweet-error', $message);
endif;
if ($this->request->getPost()) :
@ -279,6 +281,9 @@ class Imposiciones extends \App\Controllers\BaseResourceController
];
return $orientacionOptions;
}
public function selectImposicion()
{
$data = $this->model->querySelect($this->request->getGet('q'));
return $this->response->setJSON($data);
}
}

View File

@ -141,7 +141,7 @@ class Ordentrabajo extends BaseController
$q = $this->otModel->getDatatableQuery()->where("ordenes_trabajo.estado", "F");
// return $this->response->setJSON($q->get()->getResultArray());
return DataTable::of($q)
->add("logo", fn($q) => site_url($logo->get_logo_path($q->presupuesto_linea_tipo)))
->add("logo", fn($q) => ["logo" => site_url($logo->get_logo_path($q->presupuesto_linea_tipo)), "imposicion" => $q->imposicion_name])
->edit(
"fecha_encuadernado_at",
fn($q) => $q->fecha_encuadernado_at ? Time::createFromFormat("Y-m-d", $q->fecha_encuadernado_at)->format("d/m/Y") : ""
@ -156,7 +156,7 @@ class Ordentrabajo extends BaseController
$q = $this->otModel->getDatatableQuery()->whereIn("ordenes_trabajo.estado", ["I", "PM"]);
// return $this->response->setJSON($q->get()->getResultArray());
return DataTable::of($q)
->add("logo", fn($q) => site_url($logo->get_logo_path($q->presupuesto_linea_tipo)))
->add("logo", fn($q) => ["logo" => site_url($logo->get_logo_path($q->presupuesto_linea_tipo)), "imposicion" => $q->imposicion_name])
->edit(
"fecha_encuadernado_at",
fn($q) => $q->fecha_encuadernado_at ? Time::createFromFormat("Y-m-d", $q->fecha_encuadernado_at)->format("d/m/Y") : ""
@ -171,7 +171,7 @@ class Ordentrabajo extends BaseController
$q = $this->otModel->getDatatableQuery()->where("ferro_ok_at", null);
// return $this->response->setJSON($q->get()->getResultArray());
return DataTable::of($q)
->add("logo", fn($q) => site_url($logo->get_logo_path($q->presupuesto_linea_tipo)))
->add("logo", fn($q) => ["logo" => site_url($logo->get_logo_path($q->presupuesto_linea_tipo)), "imposicion" => $q->imposicion_name])
->edit(
"fecha_encuadernado_at",
fn($q) => $q->fecha_encuadernado_at ? Time::createFromFormat("Y-m-d", $q->fecha_encuadernado_at)->format("d/m/Y") : ""
@ -186,7 +186,7 @@ class Ordentrabajo extends BaseController
$q = $this->otModel->getDatatableQuery()->where("ferro_ok_at is NOT NULL", NULL, FALSE);
// return $this->response->setJSON($q->get()->getResultArray());
return DataTable::of($q)
->add("logo", fn($q) => site_url($logo->get_logo_path($q->presupuesto_linea_tipo)))
->add("logo", fn($q) => ["logo" => site_url($logo->get_logo_path($q->presupuesto_linea_tipo)), "imposicion" => $q->imposicion_name])
->edit(
"fecha_encuadernado_at",
fn($q) => $q->fecha_encuadernado_at ? Time::createFromFormat("Y-m-d", $q->fecha_encuadernado_at)->format("d/m/Y") : ""
@ -232,6 +232,8 @@ class Ordentrabajo extends BaseController
->edit("tiempo_estimado", fn($q) => float_seconds_to_hhmm_string($q->tiempo_estimado))
->edit("tiempo_real", fn($q) => float_seconds_to_hhmm_string($q->tiempo_real))
->edit("maquina_tarea", fn($q) => ["id" => $q->id, "maquina_id" => $q->maquina_tarea, "maquina_name" => $q->maquina_nombre])
->add("imposicion", fn($q) => ["id" => $q->id, "imposicion_id" => $q->imposicion_id, "name" => $q->imposicion_name,"is_presupuesto_linea" => $q->presupuesto_linea_id ? true : false ])
->toJson(true);
}
public function get_pdf($orden_trabajo_id)
@ -296,7 +298,6 @@ class Ordentrabajo extends BaseController
}
} catch (\Throwable $th) {
return $this->response->setJSON(["message" => "Portada error", "error" => $th->getMessage()])->setStatusCode(500);
}
}
public function planning_rotativa_datatable()