mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
fechas pedido and imposiciones
This commit is contained in:
@ -33,6 +33,13 @@ class OrdenTrabajo extends BaseConfig
|
||||
"pre_imposicion_at" => "pre_imposicion_user_id",
|
||||
|
||||
];
|
||||
public array $DATE_USER_MAPPING_PEDIDO = [
|
||||
"inaplazable" => "inaplazable_change_user_id",
|
||||
"fecha_entrega_real" => "fecha_entrega_real_change_user_id",
|
||||
"fecha_impresion" => "fecha_impresion_change_user_id",
|
||||
"fecha_encuadernado" => "fecha_encuadernado_change_user_id",
|
||||
"fecha_entrega_externo" => "fecha_entrega_externo_change_user_id",
|
||||
];
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
|
||||
@ -735,6 +735,8 @@ $routes->group('produccion', ['namespace' => 'App\Controllers\Produccion'], func
|
||||
*========================**/
|
||||
$routes->post("update/tarea", 'Ordentrabajo::update_orden_trabajo_tarea');
|
||||
$routes->post("update/date", 'Ordentrabajo::update_orden_trabajo_date');
|
||||
$routes->post("update/pedido/date", 'Ordentrabajo::update_orden_trabajo_pedido_date');
|
||||
$routes->post("update/pedido", 'Ordentrabajo::update_orden_trabajo_pedido');
|
||||
$routes->post("update/user", 'Ordentrabajo::update_orden_trabajo_user');
|
||||
$routes->post("update", 'Ordentrabajo::update_orden_trabajo');
|
||||
$routes->post("upload/portada", 'Ordentrabajo::upload_orden_trabajo_portada');
|
||||
|
||||
@ -118,7 +118,26 @@ class Ordentrabajo extends BaseController
|
||||
return $this->response->setJSON(["errors" => $this->validation->getErrors()])->setStatusCode(400);
|
||||
}
|
||||
}
|
||||
|
||||
public function update_orden_trabajo_pedido_date()
|
||||
{
|
||||
try {
|
||||
$bodyData = $this->request->getPost();
|
||||
$r = $this->produccionService->init($bodyData["orden_trabajo_id"])->updateOrdenTrabajoPedidoDate($bodyData);
|
||||
return $this->response->setJSON(["message" => lang("App.global_alert_save_success"), "status" => $r["status"], "user" => $r["user"], "data" => $bodyData]);
|
||||
} catch (\Throwable $th) {
|
||||
return $this->response->setJSON(["errors" => $th->getMessage(), "status" => false])->setStatusCode(500);
|
||||
}
|
||||
}
|
||||
public function update_orden_trabajo_pedido()
|
||||
{
|
||||
try {
|
||||
$bodyData = $this->request->getPost();
|
||||
$r = $this->produccionService->init($bodyData["orden_trabajo_id"])->updateOrdenTrabajoPedido($bodyData);
|
||||
return $this->response->setJSON(["message" => lang("App.global_alert_save_success"), "status" => $r,"data" => $bodyData]);
|
||||
} catch (\Throwable $th) {
|
||||
return $this->response->setJSON(["errors" => $th->getMessage(), "status" => false])->setStatusCode(500);
|
||||
}
|
||||
}
|
||||
public function edit($orden_trabajo_id)
|
||||
{
|
||||
// Breadcrumbs
|
||||
@ -132,6 +151,8 @@ class Ordentrabajo extends BaseController
|
||||
$this->viewData["cliente"] = $this->produccionService->getCliente();
|
||||
$this->viewData["ot"] = $this->produccionService->getOrdenTrabajo();
|
||||
$this->viewData["user_dates"] = $this->produccionService->userDates();
|
||||
$this->viewData["pedido_user_dates"] = $this->produccionService->pedidoUserDates();
|
||||
|
||||
return view(static::$viewPath . $this->editRoute, $this->viewData);
|
||||
}
|
||||
|
||||
@ -233,8 +254,7 @@ 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 ])
|
||||
|
||||
->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)
|
||||
@ -244,7 +264,6 @@ class Ordentrabajo extends BaseController
|
||||
public function upload_orden_trabajo_portada()
|
||||
{
|
||||
try {
|
||||
//code...
|
||||
$file = $this->request->getFile("portada_file");
|
||||
$bodyData = $this->request->getPost();
|
||||
$id = $bodyData["orden_trabajo_id"];
|
||||
@ -252,6 +271,12 @@ class Ordentrabajo extends BaseController
|
||||
$fullpath = null;
|
||||
if ($file->isValid() && !$file->hasMoved()) {
|
||||
$fullpath = $file->store('ordenes_trabajo_portadas');
|
||||
$otEntity = $this->otModel->find($id);
|
||||
if ($otEntity->portada_path) {
|
||||
if (file_exists($otEntity->full_path)) {
|
||||
unlink($otEntity->full_path);
|
||||
}
|
||||
}
|
||||
$r = $this->otModel->update($id, ["portada_path" => $fullpath]);
|
||||
}
|
||||
return $this->response->setJSON(["message" => "Portada subida", "data" => $r]);
|
||||
@ -259,7 +284,7 @@ class Ordentrabajo extends BaseController
|
||||
if ($fullpath) {
|
||||
delete_files($fullpath);
|
||||
}
|
||||
return $this->response->setJSON(["message" => "Portada error", "error" => $th->getMessage()])->setStatusCode($th->getCode());
|
||||
return $this->response->setJSON(["message" => "Portada error", "error" => $th->getMessage()])->setStatusCode(500);
|
||||
}
|
||||
}
|
||||
public function delete_orden_trabajo_portada($orden_trabajo_id)
|
||||
@ -283,7 +308,7 @@ class Ordentrabajo extends BaseController
|
||||
try {
|
||||
$ot = $this->otModel->find($orden_trabajo_id);
|
||||
if ($ot->portada_path) {
|
||||
$filePath = WRITEPATH . 'uploads/' . $ot->portada_path;
|
||||
$filePath = $ot->full_path;
|
||||
if (file_exists($filePath)) {
|
||||
|
||||
$mimeType = mime_content_type($filePath);
|
||||
|
||||
@ -6,9 +6,11 @@ use App\Entities\Produccion\OrdenTrabajoEntity;
|
||||
use App\Models\OrdenTrabajo\OrdenTrabajoModel;
|
||||
use App\Entities\Clientes\ClienteEntity;
|
||||
use App\Entities\Configuracion\UbicacionesEntity;
|
||||
use App\Entities\Usuarios\UserEntity;
|
||||
use App\Models\Clientes\ClienteModel;
|
||||
use App\Models\Pedidos\PedidoLineaModel;
|
||||
use App\Models\Presupuestos\PresupuestoModel;
|
||||
use App\Models\Usuarios\UserModel;
|
||||
use CodeIgniter\Entity;
|
||||
|
||||
class PedidoEntity extends \CodeIgniter\Entity\Entity
|
||||
@ -40,6 +42,12 @@ class PedidoEntity extends \CodeIgniter\Entity\Entity
|
||||
protected $casts = [
|
||||
"total_precio" => "float",
|
||||
"total_tirada" => "float",
|
||||
"inaplazable" => "bool",
|
||||
"fecha_entrega_real_change_user_id" => "?integer",
|
||||
"fecha_impresion_change_user_id" => "?integer",
|
||||
"fecha_encuadernado_change_user_id" => "?integer",
|
||||
"fecha_entrega_change_externo_user_id" => "?integer",
|
||||
"inaplazable_change_user_id" => "?integer",
|
||||
];
|
||||
/**
|
||||
* Devuelve la entidad `PedidoEntity` con sus relaciones
|
||||
@ -91,4 +99,16 @@ class PedidoEntity extends \CodeIgniter\Entity\Entity
|
||||
$pre = $pm->find($pedido_linea->presupuesto_id);
|
||||
return $m->find($pre->cliente_id);
|
||||
}
|
||||
public function userBy(string $key): ?UserEntity
|
||||
{
|
||||
$user = null;
|
||||
if (isset($this->attributes[$key])) {
|
||||
|
||||
if ($this->attributes[$key]) {
|
||||
$m = model(UserModel::class);
|
||||
$user = $m->find($this->attributes[$key]);
|
||||
}
|
||||
}
|
||||
return $user;
|
||||
}
|
||||
}
|
||||
|
||||
@ -225,4 +225,8 @@ class PresupuestoLineaEntity extends \CodeIgniter\Entity\Entity
|
||||
{
|
||||
return in_array($this->attributes['tipo'],['lp_rot_color','lp_rot_bn']);
|
||||
}
|
||||
public function isColor():bool {
|
||||
return in_array($this->attributes['tipo'],['lp_color','lp_colorhq','lp_rot_color']);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -134,10 +134,10 @@ class OrdenTrabajoEntity extends Entity
|
||||
{
|
||||
return $this->pedidoEsperaBy();
|
||||
}
|
||||
public function getPortadaPath(): ?string
|
||||
public function getFullPath(): ?string
|
||||
{
|
||||
helper('filesystem');
|
||||
$path = $this->attributes["portada_path"];
|
||||
$path = WRITEPATH . 'uploads/' . $this->attributes["portada_path"];
|
||||
$portada_path = null;
|
||||
if($path){
|
||||
if(file_exists($path)){
|
||||
|
||||
@ -110,7 +110,11 @@ class OrdenTrabajoTareaEntity extends Entity
|
||||
public function imposicion() : ?Imposicion
|
||||
{
|
||||
$m = model(ImposicionModel::class);
|
||||
return $m->find($this->attributes["imposicion_id"]);
|
||||
$imposicion = null;
|
||||
if($this->attributes["imposicion_id"]){
|
||||
$imposicion = $m->find($this->attributes["imposicion_id"]);
|
||||
}
|
||||
return $imposicion;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -99,7 +99,9 @@ return [
|
||||
|
||||
|
||||
"errors" => [
|
||||
"date_not_exist" => "Esta fecha no existe en el modelo."
|
||||
"date_not_exist" => "Esta fecha no existe en el modelo",
|
||||
"attr_not_exist" => "El atributo {0,string} no pertenece al modelo Pedido"
|
||||
|
||||
]
|
||||
|
||||
|
||||
|
||||
@ -5,6 +5,7 @@ namespace App\Models\OrdenTrabajo;
|
||||
use App\Entities\Produccion\OrdenTrabajoDateEntity;
|
||||
use CodeIgniter\Database\MySQLi\Builder;
|
||||
use CodeIgniter\Model;
|
||||
use Config\OrdenTrabajo;
|
||||
|
||||
class OrdenTrabajoDate extends Model
|
||||
{
|
||||
@ -107,22 +108,8 @@ class OrdenTrabajoDate extends Model
|
||||
return $data;
|
||||
}
|
||||
public function updateUserDateMap($orden_trabajo_id,$data){
|
||||
$mapping = [
|
||||
"fecha_encuadernado_at" => "encuadernacion_user_id",
|
||||
// "fecha_externo_at" => "null",
|
||||
"fecha_impresion_at" => null,
|
||||
"pendiente_ferro_at" => "pendiente_ferro_user_id",
|
||||
"ferro_en_cliente_at" => "ferro_en_cliente_user_id",
|
||||
"ferro_ok_at" => "ferro_ok_user_id",
|
||||
"interior_bn_at" => "interior_bn_user_id",
|
||||
"interior_color_at" => "interior_color_user_id",
|
||||
"preparacion_interiores_at" => "preparacion_interior_user_id",
|
||||
"cubierta_at" => "cubierta_user_id",
|
||||
"plastificado_at" => "plastificado_user_id",
|
||||
"corte_at" => "corte_user_id",
|
||||
"embalaje_at" => "embalaje_user_id",
|
||||
"entrada_manipulado_at" => "entrada_manipulado_user_id"
|
||||
];
|
||||
$ordenTrabajoConfig = new OrdenTrabajo();
|
||||
$mapping = $ordenTrabajoConfig->DATE_USER_MAPPING;
|
||||
$otUser = model(OrdenTrabajoUser::class);
|
||||
$auth_user_id = auth()->user()->id;
|
||||
foreach ($data as $key => $value) {
|
||||
|
||||
@ -19,6 +19,7 @@ use App\Entities\Produccion\OrdenTrabajoTareaEntity;
|
||||
use App\Models\Configuracion\ConfigVariableModel;
|
||||
use App\Models\Configuracion\MaquinaModel;
|
||||
use App\Models\OrdenTrabajo\OrdenTrabajoFileModel;
|
||||
use App\Models\Pedidos\PedidoModel;
|
||||
use App\Models\Usuarios\UserModel;
|
||||
use CodeIgniter\Database\BaseBuilder;
|
||||
use CodeIgniter\Database\BaseResult;
|
||||
@ -43,6 +44,7 @@ class ProductionService extends BaseService
|
||||
protected OrdenTrabajoUser $otUser;
|
||||
protected OrdenTrabajoEntity $ot;
|
||||
protected OrdenTrabajoFileModel $otFileModel;
|
||||
protected PedidoModel $pedidoModel;
|
||||
protected UserModel $userModel;
|
||||
protected string $defaultMaquinaCorteName = 'HT-1000';
|
||||
protected MaquinaEntity $defaultMaquinaCorte;
|
||||
@ -70,6 +72,7 @@ class ProductionService extends BaseService
|
||||
$this->otUser = model(OrdenTrabajoUser::class);
|
||||
$this->userModel = model(UserModel::class);
|
||||
$this->otFileModel = model(OrdenTrabajoFileModel::class);
|
||||
$this->pedidoModel = model(PedidoModel::class);
|
||||
$this->ordenTrabajoConfig = config('OrdenTrabajo');
|
||||
}
|
||||
public function init(int $orden_trabajo_id): self
|
||||
@ -627,6 +630,7 @@ class ProductionService extends BaseService
|
||||
"tareas_encuadernacion" => $this->tareas_encuadernacion(),
|
||||
"tareas_preimpresion" => $this->tareas_preimpresion(),
|
||||
"tareas_impresion" => $this->tareas_impresion(),
|
||||
"tiempo_procesamiento" => $this->getTiempoProcesamientoHHMM(),
|
||||
];
|
||||
return $summary;
|
||||
}
|
||||
@ -650,7 +654,9 @@ class ProductionService extends BaseService
|
||||
"linea_cubierta" => $this->presupuesto->presupuestoLineaCubierta(),
|
||||
"peso_unidad" => $logistica_data["peso_unidad"],
|
||||
"peso_pedido" => $logistica_data["peso_pedido"],
|
||||
"imposicion" => $this->getImposicionTareaImpresion()
|
||||
"imposicion" => $this->getImposicionTareaImpresion(),
|
||||
"tiempo_procesamiento" => $this->getTiempoProcesamientoHHMM(),
|
||||
|
||||
];
|
||||
}
|
||||
public function getImposicionTareaImpresion(): ?Imposicion
|
||||
@ -658,10 +664,10 @@ class ProductionService extends BaseService
|
||||
$imposicion = null;
|
||||
$impresionInteriorBnImposicion = $this->getTareaImpresionInteriorBn()?->imposicion();
|
||||
$impresionInteriorColorImposicion = $this->getTareaImpresionInteriorColor()?->imposicion();
|
||||
if($impresionInteriorBnImposicion){
|
||||
if ($impresionInteriorBnImposicion) {
|
||||
$imposicion = $impresionInteriorBnImposicion;
|
||||
}
|
||||
if($impresionInteriorColorImposicion){
|
||||
if ($impresionInteriorColorImposicion) {
|
||||
$imposicion = $impresionInteriorColorImposicion;
|
||||
}
|
||||
return $imposicion;
|
||||
@ -755,16 +761,45 @@ class ProductionService extends BaseService
|
||||
} else {
|
||||
$result = ["user" => null, "status" => false];
|
||||
}
|
||||
$this->updateProgress();
|
||||
return $result;
|
||||
}
|
||||
public function updateOrdenTrabajoPedidoDate($data): array
|
||||
{
|
||||
$status = false;
|
||||
$user = auth()->user();
|
||||
$row = [];
|
||||
$pedidoDatesUser = $this->ordenTrabajoConfig->DATE_USER_MAPPING_PEDIDO;
|
||||
$attrPedido = $data["name"];
|
||||
if (isset($pedidoDatesUser[$attrPedido])) {
|
||||
$row[$attrPedido] = Time::createFromFormat("Y-m-d", $data[$attrPedido])->format('Y-m-d 00:00:00');
|
||||
$attrUserPedido = $pedidoDatesUser[$attrPedido];
|
||||
$row[$attrUserPedido] = $user->id;
|
||||
$status = $this->pedidoModel->update($this->pedido->id, $row);
|
||||
$this->updateProgress();
|
||||
} else {
|
||||
throw new Exception(lang('Produccion.errors.attr_not_exist', [$attrPedido]));
|
||||
}
|
||||
|
||||
return [
|
||||
"user" => $user,
|
||||
"status" => $status
|
||||
];
|
||||
}
|
||||
public function updateOrdenTrabajo($data): bool
|
||||
{
|
||||
if(isset($data["is_pedido_espera"])){
|
||||
if (isset($data["is_pedido_espera"])) {
|
||||
$data["pedido_espera_by"] = auth()->user()->id;
|
||||
}
|
||||
return $this->otModel->update($this->ot->id, $data);
|
||||
}
|
||||
public function updateOrdenTrabajoPedido($data)
|
||||
{
|
||||
if (isset($data["inaplazable"])) {
|
||||
$data[$this->ordenTrabajoConfig->DATE_USER_MAPPING_PEDIDO["inaplazable"]] = auth()->user()->id;
|
||||
}
|
||||
return $this->pedidoModel->update($this->pedido->id, $data);
|
||||
}
|
||||
/**========================================================================
|
||||
* RELATION METHODS
|
||||
*========================================================================**/
|
||||
@ -1022,18 +1057,60 @@ class ProductionService extends BaseService
|
||||
}
|
||||
return $status;
|
||||
}
|
||||
public function userDates() : array
|
||||
public function userDates(): array
|
||||
{
|
||||
$userDates = [];
|
||||
foreach ($this->ordenTrabajoConfig->DATE_USER_MAPPING as $key => $value) {
|
||||
$otUserEntity = $this->otUser->where("orden_trabajo_id",$this->ot->id)->first();
|
||||
$otUserEntity = $this->otUser->where("orden_trabajo_id", $this->ot->id)->first();
|
||||
$userEntity = $otUserEntity->userBy($value);
|
||||
if($userEntity){
|
||||
if ($userEntity) {
|
||||
$userDates[$key] = $userEntity->full_name;
|
||||
}else{
|
||||
} else {
|
||||
$userDates[$key] = null;
|
||||
}
|
||||
}
|
||||
return $userDates;
|
||||
}
|
||||
public function pedidoUserDates(): array
|
||||
{
|
||||
$pedidoUserDates = [];
|
||||
foreach ($this->ordenTrabajoConfig->DATE_USER_MAPPING_PEDIDO as $key => $value) {
|
||||
$userEntity = $this->pedido->userBy($value);
|
||||
if ($userEntity) {
|
||||
$pedidoUserDates[$key] = $userEntity->full_name;
|
||||
} else {
|
||||
$pedidoUserDates[$key] = null;
|
||||
}
|
||||
}
|
||||
return $pedidoUserDates;
|
||||
}
|
||||
public function getTiempoProcesamientoHHMM(): string
|
||||
{
|
||||
$time_tareas_seconds = array_map(fn($q) => $q->tiempo_estimado ?? 0, $this->ot->tareas());
|
||||
$seconds = array_sum($time_tareas_seconds);
|
||||
return float_seconds_to_hhmm_string($seconds);
|
||||
}
|
||||
public function updateProgress(): bool
|
||||
{
|
||||
$userDates = $this->ordenTrabajoConfig->DATE_USER_MAPPING;
|
||||
$pedidoUserDates = $this->ordenTrabajoConfig->DATE_USER_MAPPING_PEDIDO;
|
||||
|
||||
$fill_dates = 0;
|
||||
$status = false;
|
||||
$total = count($userDates) + count($pedidoUserDates);
|
||||
if ($this->ot->estado != "F") {
|
||||
foreach ($userDates as $key => $value) {
|
||||
if ($this->ot->dates()->{$key} != null) $fill_dates++;
|
||||
}
|
||||
foreach ($pedidoUserDates as $key => $value) {
|
||||
if ($this->pedido->{$key} != null) $fill_dates++;
|
||||
}
|
||||
|
||||
$progreso = (float) $fill_dates / $total * 100;
|
||||
$status = $this->otModel->update($this->ot->id, ["progreso" => round($progreso,2)]);
|
||||
}else{
|
||||
$status = $this->otModel->update($this->ot->id, ["progreso" => 100]);
|
||||
}
|
||||
return $status;
|
||||
}
|
||||
}
|
||||
|
||||
@ -15,27 +15,33 @@
|
||||
<div class="row">
|
||||
<!-- Date 1-->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2">
|
||||
<label for="ot-tiempo-procesamiento" class="form-label"><?= @lang("Produccion.tiempo_procesamiento") ?></label>
|
||||
<label for="ot-tiempo-procesamiento" class="form-label"><?= @lang("Produccion.tiempo_procesamiento") ?> (HH:MM)</label>
|
||||
<input type="text" class="form-control" name="tiempo_procesamiento" placeholder="HH:MM" id="ot-tiempo-procesamiento" data-input disabled>
|
||||
</div>
|
||||
<!-- Date 2-->
|
||||
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2">
|
||||
<label for="ot-fecha-entrega" class="form-label"><?= @lang("Produccion.fecha_impresion") ?></label>
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="fecha_impresion_at" id="ot-fecha-impresion" data-input>
|
||||
<input type="text" class="form-control ot-pedido" placeholder="DD/MM/YYYY" name="fecha_impresion" id="ot-fecha-impresion" data-input>
|
||||
<div class="form-text"><?= $pedido_user_dates["fecha_impresion"] ?></div>
|
||||
|
||||
|
||||
</div>
|
||||
<!-- Date 2-->
|
||||
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2">
|
||||
<label for="ot-fecha-entrega" class="form-label"><?= @lang("Produccion.fecha_encuadernado") ?></label>
|
||||
<input type="date" class="form-control ot-date" placeholder="DD/MM/YYYY" name="fecha_encuadernado_at" id="ot-fecha-encuadernado" data-input />
|
||||
<input type="date" class="form-control ot-pedido" placeholder="DD/MM/YYYY" name="fecha_encuadernado" id="ot-fecha-encuadernado" data-input />
|
||||
<div class="form-text"><?= $pedido_user_dates["fecha_encuadernado"] ?></div>
|
||||
|
||||
</div>
|
||||
<!-- Date 4-->
|
||||
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2">
|
||||
<label for="ot-fecha-entrega" class="form-label"><?= @lang("Produccion.fecha_entrega_externo") ?></label>
|
||||
<input type="date" class="form-control ot-date" placeholder="DD/MM/YYYY" name="fecha_entrega_externo" id="ot-fecha-entrega-externo" data-input />
|
||||
<input type="date" class="form-control ot-pedido" placeholder="DD/MM/YYYY" name="fecha_entrega_externo" id="ot-fecha-entrega-externo" data-input />
|
||||
<div class="form-text"><?= $pedido_user_dates["fecha_entrega_externo"] ?></div>
|
||||
|
||||
</div>
|
||||
<!-- Date 5-->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2">
|
||||
@ -43,12 +49,13 @@
|
||||
<div>
|
||||
|
||||
<label for="ot-fecha-entrega" class="form-label"><?= @lang("Produccion.fecha_entrega_real") ?></label>
|
||||
<input type="date" class="form-control ot-date" placeholder="DD/MM/YYYY" name="fecha_entrega_real_at" id="ot-fecha-entrega-real" data-input />
|
||||
<input type="date" class="form-control ot-pedido" placeholder="DD/MM/YYYY" name="fecha_entrega_real" id="ot-fecha-entrega-real" data-input />
|
||||
<div class="form-text"><?= $pedido_user_dates["fecha_entrega_real"] ?></div>
|
||||
</div>
|
||||
<div class="d-flex flex-column">
|
||||
|
||||
<label class="switch switch-danger switch-lg mt-1">
|
||||
<input type="checkbox" class="switch-input ot-preview" name="fecha_entrega_warning" />
|
||||
<input type="checkbox" class="switch-input ot-pedido-check" name="inaplazable" />
|
||||
<span class="switch-toggle-slider">
|
||||
<span class="switch-on">
|
||||
<i class="ti ti-alert-triangle"></i>
|
||||
@ -59,6 +66,7 @@
|
||||
</span>
|
||||
<span class="switch-label fw-large">Inaplazable</span>
|
||||
</label>
|
||||
<div class="form-text"><?= $pedido_user_dates["inaplazable"] ?></div>
|
||||
<label class="switch switch-lg mt-1">
|
||||
<input type="checkbox" class="switch-input ot-preview" name="fecha_entrega_warning_revised" />
|
||||
<span class="switch-toggle-slider">
|
||||
|
||||
@ -15,7 +15,7 @@
|
||||
<div class="col-md-8">
|
||||
<div class="card-body">
|
||||
<h1 class="card-title mb-0">[<?= $presupuesto->id ?>]<?= $presupuesto->titulo ?></h1>
|
||||
<h4 class="card-title mb-0 text-secondary"><?= $cliente->nombre ?></h4>
|
||||
<h4 class="card-title mb-0 text-secondary"><?= $cliente->nombre ?> (<?= $cliente->alias ?>)</h4>
|
||||
<h3 class="card-title mb-3">OT : <?= $ot->id ?></h3>
|
||||
<div class="d-flex align-items-center">
|
||||
<div class="card-info">
|
||||
|
||||
@ -15,7 +15,7 @@
|
||||
<div class="row">
|
||||
<div class="col-md-12 mb-3">
|
||||
<label class="form-label" for="ot-progress-bar-parent"><?= @lang("App.progress") ?></label>
|
||||
<div class="progress" id="ot-progress-bar-parent">
|
||||
<div class="progress" style="height: 25px;" id="ot-progress-bar-parent">
|
||||
<div id="ot-progress-bar" class="progress-bar" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100"></div>
|
||||
</div>
|
||||
</div>
|
||||
@ -26,34 +26,34 @@
|
||||
<!-- Preformato -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100">
|
||||
<label for="ot-preformato-btn" class="form-label"><?= @lang("Produccion.pre_formato") ?></label>
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="pre_formato_at" id="ot-preformato-btn">
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="pre_formato_at" id="ot-preformato-date">
|
||||
<div class="form-text"><?=$user_dates["pre_formato_at"]?></div>
|
||||
</div>
|
||||
<!-- Prelomo -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100">
|
||||
<label for="ot-prelomo-btn" class="form-label"><?= @lang("Produccion.pre_lomo") ?></label>
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="pre_lomo_at" id="ot-prelomo-btn">
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="pre_lomo_at" id="ot-prelomo-date">
|
||||
<div class="form-text"><?=$user_dates["pre_lomo_at"]?></div>
|
||||
|
||||
</div>
|
||||
<!-- Presolapa -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100">
|
||||
<label for="ot-presolapa-btn" class="form-label"><?= @lang("Produccion.pre_solapa") ?></label>
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="pre_solapa_at" id="ot-presolapa-btn">
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="pre_solapa_at" id="ot-presolapa-date">
|
||||
<div class="form-text"><?=$user_dates["pre_solapa_at"]?></div>
|
||||
|
||||
</div>
|
||||
<!-- Precodbarras -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100">
|
||||
<label for="ot-precodbarras-btn" class="form-label"><?= @lang("Produccion.pre_codbarras") ?></label>
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="pre_codbarras_at" id="ot-precodbarras-btn">
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="pre_codbarras_at" id="ot-precodbarras-date">
|
||||
<div class="form-text"><?=$user_dates["pre_codbarras_at"]?></div>
|
||||
|
||||
</div>
|
||||
<!-- Preimposicion -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100">
|
||||
<label for="ot-preimposicion-btn" class="form-label"><?= @lang("Produccion.pre_imposicion") ?></label>
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="pre_imposicion_at" id="ot-preimposicion-btn">
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="pre_imposicion_at" id="ot-preimposicion-date">
|
||||
<div class="form-text"><?=$user_dates["pre_imposicion_at"]?></div>
|
||||
|
||||
</div>
|
||||
@ -62,7 +62,7 @@
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100">
|
||||
<label for="ot-impresion-color" class="form-label"><?= @lang("Produccion.impresion_bn") ?></label>
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="interior_bn_at" id="ot-impresion-btn">
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="interior_bn_at" id="ot-impresion-bn">
|
||||
<div class="form-text"><?=$user_dates["interior_bn_at"]?></div>
|
||||
|
||||
</div>
|
||||
@ -139,7 +139,7 @@
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100">
|
||||
<label for="ot-embalaje" class="form-label"><?= @lang("Produccion.embalaje") ?></label>
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="embalaje_at" id="ot-embalaje">
|
||||
<div class="form-text"><span class="badge text-bg-primary"><?=$user_dates["embalaje_at"]?></span></div>
|
||||
<div class="form-text"><?=$user_dates["embalaje_at"]?></div>
|
||||
|
||||
</div>
|
||||
<!-- Progress -->
|
||||
|
||||
@ -50,7 +50,7 @@ $settings = $session->get('settings');
|
||||
<div class="row">
|
||||
<div class="col-8">
|
||||
<div class="px-2 d-flex flex justify-content-between align-items-center mb-2 border boder-1 border-dark bg-primary text-white rounded-pill bordered border-secondary">
|
||||
<span><strong><?= $dates?->fecha_encuadernado_at ? week_day_humanize(Time::createFromFormat("Y-m-d", $dates?->fecha_encuadernado_at)->getDayOfWeek(), true) : "" ?></strong></span>
|
||||
<span><strong><?= $pedido->fecha_encuadernado ? week_day_humanize(Time::createFromFormat("Y-m-d H:i:s", $pedido->fecha_encuadernado)->getDayOfWeek(), true) : "" ?></strong></span>
|
||||
<span><strong>Comercial:</strong> <?= $cliente->first_name . " " . $cliente->comercial()->last_name ?> </span>
|
||||
</div>
|
||||
</div>
|
||||
@ -64,8 +64,8 @@ $settings = $session->get('settings');
|
||||
<div class="row p-2">
|
||||
<div class="col-4 h-100">
|
||||
<div class="row px-2 d-flex flex justify-content-between align-items-center">
|
||||
<div class="col-6 w-75 border border-1 border-dark text-center <?= $ot->fecha_entrega_warning ? "bg-danger" : "bg-secondary" ?> ">
|
||||
<span class="text-white" id="fecha_encuadernado_at"><strong><?= $dates?->fecha_encuadernado_at ? Time::createFromFormat("Y-m-d", $dates?->fecha_encuadernado_at)?->format("d/m/Y") : "" ?></strong></span>
|
||||
<div class="col-6 w-75 border border-1 border-dark text-center <?= $ot->fecha_entrega_warning ? "bg-danger" : "bg-white" ?> ">
|
||||
<span class="<?= $ot->fecha_entrega_warning ? "text-white" : "text-black" ?>" id="fecha_encuadernado_at"><strong><?= $pedido->fecha_encuadernado ? Time::createFromFormat("Y-m-d H:i:s", $pedido->fecha_encuadernado)->format('d/m/Y') : "" ?></strong></span>
|
||||
</div>
|
||||
<div class="col-6 w-25 border border-1 border-dark text-center bg-secondary text-white">
|
||||
<strong><?=isset($encuadernaciones[0]) ? $encuadernaciones[0]->tarifa()->code ?? "?" : "?" ?></strong>
|
||||
@ -102,8 +102,8 @@ $settings = $session->get('settings');
|
||||
<div class="col-6 h-50 square text-center text-dark bg-white border border-right border-dark">
|
||||
<?= $linea_impresion->papel_impresion()->papel_code_ot ?>
|
||||
</div>
|
||||
<div class="col-6 h-50 square text-center text-dark bg-secondary border border-right border-dark">
|
||||
0:3
|
||||
<div class="col-6 h-50 square text-center <?=$linea_impresion->isColor() ? "cmyk" : "bn" ?> border border-right border-dark">
|
||||
<?= $tiempo_procesamiento ?>
|
||||
</div>
|
||||
<div class="col-6 h-50 square bg-primary text-center text-white border border-right border-dark">
|
||||
<?= $linea_cubierta->papel_impresion()->papel_code_ot ?>
|
||||
@ -128,7 +128,7 @@ $settings = $session->get('settings');
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="row">
|
||||
<div class="col-8">
|
||||
<table class="h-50">
|
||||
<tr>
|
||||
@ -186,8 +186,8 @@ $settings = $session->get('settings');
|
||||
<div class="imposicion">
|
||||
<table>
|
||||
<tr>
|
||||
<th>Imposicion</th>
|
||||
<td><?= $imposicion->full_name ?></td>
|
||||
<th class="w-50">Imposicion</th>
|
||||
<td><?= $imposicion?->full_name ?? "" ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
@ -201,13 +201,13 @@ $settings = $session->get('settings');
|
||||
<table>
|
||||
<tr>
|
||||
<th class="t-header" style="width: 10%;"><?=lang('Produccion.size')?></th>
|
||||
<td class="t-cell"> ?? </td>
|
||||
<td class="t-cell text-center"> <?= $papel_formato->ancho ?>x<?= $papel_formato->alto ?> </td>
|
||||
<th class="t-header" style="width: 10%;"><?=lang('Produccion.ejemplares')?></th>
|
||||
<td class="t-cell"> <?=$presupuesto->tirada ?> </td>
|
||||
<td class="t-cell text-center"> <?=$presupuesto->tirada ?> </td>
|
||||
<th class="t-header" style="width: 10%;"><?=lang('Produccion.tipo')?></th>
|
||||
<td class="t-cell"> <?=$presupuesto->tipo ?> </td>
|
||||
<td class="t-cell text-center"> <?=$linea_impresion->tipo ?> </td>
|
||||
<th class="t-header" style="width: 10%;"><?=lang('Produccion.lomo')?></th>
|
||||
<td class="t-cell"> <?=$presupuesto->lomo_cubierta ?> </td>
|
||||
<td class="t-cell text-center"> <?=number_format($presupuesto->lomo_cubierta,2,',','.') ?> </td>
|
||||
</tr>
|
||||
</table>
|
||||
<table>
|
||||
@ -294,13 +294,13 @@ $settings = $session->get('settings');
|
||||
<table>
|
||||
<tr>
|
||||
<th class="t-header" style="width: 10%;">Plastificado</th>
|
||||
<td class="t-cell"><?= $acabados[0]->tarifa()->nombre ?></td>
|
||||
<td class="t-cell text-center"><?= $acabados[0]->tarifa()->nombre ?></td>
|
||||
<th class="t-header" style="width: 10%;">UVI</th>
|
||||
<td class="t-cell"> ?? </td>
|
||||
<td class="t-cell text-center"> ?? </td>
|
||||
<th class="t-header" style="width: 10%;">Máquina</th>
|
||||
<td class="t-cell"><?= implode("/", array_map(fn($q) => $q->nombre, $acabados[0]->maquinas())) ?> </td>
|
||||
<th class="t-header" style="width: 10%;">Operario</th>
|
||||
<td class="t-cell"><?= $ot->users()?->plastificado_by?->getFullName() ?? null ?> </td>
|
||||
<td class="t-cell text-center"><?= implode("/", array_map(fn($q) => $q->nombre, $acabados[0]->maquinas())) ?> </td>
|
||||
<th class="t-header " style="width: 10%;">Operario</th>
|
||||
<td class="t-cell text-center"><?= $ot->users()?->plastificado_by?->getFullName() ?? null ?> </td>
|
||||
</tr>
|
||||
</table>
|
||||
<table>
|
||||
@ -372,7 +372,7 @@ $settings = $session->get('settings');
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12 d-flex justify-content-center align-items-center">
|
||||
<span>© 2024 SAFEKAT. Todos los derechos reservados.</span>
|
||||
<span class="footer">© 2024 SAFEKAT. Todos los derechos reservados.</span>
|
||||
</div>
|
||||
<script src=<?= site_url("themes/vuexy/vendor/libs/html2pdf/html2pdf.bundle.min.js") ?>></script>
|
||||
<script src="<?= site_url('themes/vuexy/vendor/libs/jquery/jquery.js') ?>"></script>
|
||||
|
||||
Reference in New Issue
Block a user