diff --git a/ci4/app/Controllers/Configuracion/Imposiciones.php b/ci4/app/Controllers/Configuracion/Imposiciones.php
index 9fabc2c1..58986982 100755
--- a/ci4/app/Controllers/Configuracion/Imposiciones.php
+++ b/ci4/app/Controllers/Configuracion/Imposiciones.php
@@ -1,4 +1,6 @@
-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);
+ }
}
diff --git a/ci4/app/Controllers/Produccion/Ordentrabajo.php b/ci4/app/Controllers/Produccion/Ordentrabajo.php
index 103befb3..ef39f38a 100755
--- a/ci4/app/Controllers/Produccion/Ordentrabajo.php
+++ b/ci4/app/Controllers/Produccion/Ordentrabajo.php
@@ -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()
diff --git a/ci4/app/Entities/Configuracion/Imposicion.php b/ci4/app/Entities/Configuracion/Imposicion.php
index 0acdc41c..fcb0ddaa 100755
--- a/ci4/app/Entities/Configuracion/Imposicion.php
+++ b/ci4/app/Entities/Configuracion/Imposicion.php
@@ -19,4 +19,13 @@ class Imposicion extends \CodeIgniter\Entity\Entity
"alto" => "int",
"unidades" => "?int",
];
+
+ public function getFullName() : string
+ {
+ $ancho_x_alto = $this->attributes["ancho"] ."x". $this->attributes["alto"];
+ $unidades = $this->attributes["unidades"] ?? "";
+ $orientacion = $this->attributes["orientacion"] ?? "";
+ return implode("_",[$ancho_x_alto,$unidades,$orientacion]);
+
+ }
}
diff --git a/ci4/app/Entities/Configuracion/PapelImpresion.php b/ci4/app/Entities/Configuracion/PapelImpresion.php
index d977764c..617a3ec7 100755
--- a/ci4/app/Entities/Configuracion/PapelImpresion.php
+++ b/ci4/app/Entities/Configuracion/PapelImpresion.php
@@ -2,9 +2,11 @@
namespace App\Entities\Configuracion;
use App\Models\Configuracion\MaquinasPapelesImpresionModel;
+use App\Models\Configuracion\PapelGenericoModel;
use App\Models\Configuracion\PapelImpresionMargenModel;
use App\Models\Configuracion\PapelImpresionTipologiaModel;
use CodeIgniter\Entity;
+use CodeIgniter\Model;
class PapelImpresion extends \CodeIgniter\Entity\Entity
{
@@ -68,4 +70,15 @@ class PapelImpresion extends \CodeIgniter\Entity\Entity
$m = model(PapelImpresionMargenModel::class);
return $m->asArray()->where('papel_impresion_id',$this->attributes["id"])->findAll();
}
+ public function papel_generico() : ?PapelGenerico
+ {
+ $m = model(PapelGenericoModel::class);
+ return $m->find($this->attributes["papel_generico_id"]);
+ }
+ public function getPapelCodeOt() : ?string
+ {
+ $code_ot = $this->papel_generico()->code_ot;
+ $gramaje = $this->attributes["gramaje"];
+ return implode(" ",[$code_ot,$gramaje]);
+ }
}
diff --git a/ci4/app/Entities/Produccion/OrdenTrabajoEntity.php b/ci4/app/Entities/Produccion/OrdenTrabajoEntity.php
index 67861987..e60a9671 100644
--- a/ci4/app/Entities/Produccion/OrdenTrabajoEntity.php
+++ b/ci4/app/Entities/Produccion/OrdenTrabajoEntity.php
@@ -134,4 +134,18 @@ class OrdenTrabajoEntity extends Entity
{
return $this->pedidoEsperaBy();
}
+ public function getPortadaPath(): ?string
+ {
+ helper('filesystem');
+ $path = $this->attributes["portada_path"];
+ $portada_path = null;
+ if($path){
+ if(file_exists($path)){
+ $portada_path = $path;
+ }else{
+ $portada_path = null;
+ }
+ }
+ return $portada_path;
+ }
}
diff --git a/ci4/app/Entities/Produccion/OrdenTrabajoTareaEntity.php b/ci4/app/Entities/Produccion/OrdenTrabajoTareaEntity.php
index b11c9812..946b3819 100644
--- a/ci4/app/Entities/Produccion/OrdenTrabajoTareaEntity.php
+++ b/ci4/app/Entities/Produccion/OrdenTrabajoTareaEntity.php
@@ -2,10 +2,12 @@
namespace App\Entities\Produccion;
+use App\Entities\Configuracion\Imposicion;
use App\Entities\Configuracion\Maquina;
use App\Entities\Presupuestos\PresupuestoAcabadosEntity;
use App\Entities\Presupuestos\PresupuestoLineaEntity;
use App\Entities\Presupuestos\PresupuestoManipuladosEntity;
+use App\Models\Configuracion\ImposicionModel;
use App\Models\Configuracion\MaquinaModel;
use App\Models\OrdenTrabajo\OrdenTrabajoModel;
use App\Models\Presupuestos\PresupuestoAcabadosModel;
@@ -105,5 +107,10 @@ class OrdenTrabajoTareaEntity extends Entity
$m = model(PresupuestoAcabadosModel::class);
return $m->find($this->attributes["presupuesto_linea_id"]);
}
+ public function imposicion() : ?Imposicion
+ {
+ $m = model(ImposicionModel::class);
+ return $m->find($this->attributes["imposicion_id"]);
+ }
}
diff --git a/ci4/app/Entities/Tarifas/TarifaEncuadernacionEntity.php b/ci4/app/Entities/Tarifas/TarifaEncuadernacionEntity.php
index b8d01575..608ebf37 100755
--- a/ci4/app/Entities/Tarifas/TarifaEncuadernacionEntity.php
+++ b/ci4/app/Entities/Tarifas/TarifaEncuadernacionEntity.php
@@ -33,6 +33,14 @@ class TarifaEncuadernacionEntity extends \CodeIgniter\Entity\Entity
"user_updated_id" => "int",
"is_deleted" => "int",
];
+
+ public function getNameInitials(): string
+ {
+ $words = explode(" ",$this->attributes["nombre"]);
+ $words_initial = array_map(fn($w) => substr(strtoupper($w),0,1),$words);
+ return implode("",$words_initial);
+ }
+
}
diff --git a/ci4/app/Language/es/Produccion.php b/ci4/app/Language/es/Produccion.php
index 98e81d76..603f21b3 100644
--- a/ci4/app/Language/es/Produccion.php
+++ b/ci4/app/Language/es/Produccion.php
@@ -39,7 +39,8 @@ return [
"maquina_presupuesto" => "Máquina presupuesto",
"maquina_actual" => "Máquina actual",
"tiempo_estimado" => "Tiempo estimado",
- "tiempo" => "Tiempo"
+ "tiempo" => "Tiempo",
+ "imposicion" => "Imposición"
],
"finalizadas" => "Finalizadas",
"pendiente_ferro" => "Ferro pendiente",
@@ -79,6 +80,13 @@ return [
"solapa" => "Solapa",
"papel_gramajes" => "Papel y gramajes",
"estado" => "Estado",
- "pedido_espera" => "Pedido en espera"
+ "pedido_espera" => "Pedido en espera",
+ "imposicion_no_label" => "Sin etiqueta",
+ "pliegos_de" => "pliegos de",
+ "size" => "Tamaño",
+ "ejemplares" => "Ejemplares",
+ "tipo" => "Tipo",
+ "lomo" => "Lomo"
+
];
\ No newline at end of file
diff --git a/ci4/app/Models/Configuracion/ImposicionModel.php b/ci4/app/Models/Configuracion/ImposicionModel.php
index e9473566..b21def73 100755
--- a/ci4/app/Models/Configuracion/ImposicionModel.php
+++ b/ci4/app/Models/Configuracion/ImposicionModel.php
@@ -1,4 +1,5 @@
groupStart()
- ->like("t1.id", $search)
- ->orlike("t1.ancho", $search)
- ->orLike("t1.alto", $search)
- ->orLike("t1.unidades", $search)
- ->orLike("t1.orientacion", $search)
- ->orLike("t1.maquina", $search)
- ->orLike("t1.etiqueta", $search)
- ->orlike("t1.id", $search)
- ->orLike("t1.ancho", $search)
- ->orLike("t1.alto", $search)
- ->orLike("t1.unidades", $search)
- ->orLike("t1.orientacion", $search)
- ->orLike("t1.maquina", $search)
- ->orLike("t1.etiqueta", $search)
- ->groupEnd();
+ ->groupStart()
+ ->like("t1.id", $search)
+ ->orlike("t1.ancho", $search)
+ ->orLike("t1.alto", $search)
+ ->orLike("t1.unidades", $search)
+ ->orLike("t1.orientacion", $search)
+ ->orLike("t1.maquina", $search)
+ ->orLike("t1.etiqueta", $search)
+ ->orlike("t1.id", $search)
+ ->orLike("t1.ancho", $search)
+ ->orLike("t1.alto", $search)
+ ->orLike("t1.unidades", $search)
+ ->orLike("t1.orientacion", $search)
+ ->orLike("t1.maquina", $search)
+ ->orLike("t1.etiqueta", $search)
+ ->groupEnd();
+ }
+
+ public function querySelect(?string $q)
+ {
+ $query = $this->builder()->select([
+ "id",
+ "CONCAT(lg_imposiciones.ancho,'x',lg_imposiciones.alto,'_',COALESCE(lg_imposiciones.unidades,'NULL'),'_',COALESCE(lg_imposiciones.orientacion,'NULL')) as name",
+ "COALESCE(lg_imposiciones.etiqueta,'" . lang("Produccion.imposicion_no_label") . "') as description"
+ ]);
+ if ($q) {
+ $query->orLike("CONCAT(lg_imposiciones.ancho,'x',lg_imposiciones.alto)", $q);
+ $query->orLike("lg_imposiciones.etiqueta", $q);
+ }
+ return $query
+ ->orderBy('id', 'ASC')
+ ->get()->getResultArray();
}
}
diff --git a/ci4/app/Models/OrdenTrabajo/OrdenTrabajoModel.php b/ci4/app/Models/OrdenTrabajo/OrdenTrabajoModel.php
index 713a925f..2554d37f 100644
--- a/ci4/app/Models/OrdenTrabajo/OrdenTrabajoModel.php
+++ b/ci4/app/Models/OrdenTrabajo/OrdenTrabajoModel.php
@@ -82,7 +82,9 @@ class OrdenTrabajoModel extends Model
"tipos_presupuestos.codigo as tipo_presupuesto_impresion",
"ordenes_trabajo.progreso",
"presupuesto_linea.tipo as presupuesto_linea_tipo",
- "orden_trabajo_dates.ferro_ok_at"
+ "orden_trabajo_dates.ferro_ok_at",
+ "CONCAT(lg_imposiciones.ancho,'x',lg_imposiciones.alto,'_',COALESCE(lg_imposiciones.unidades,'NULL'),'_',COALESCE(lg_imposiciones.orientacion,'NULL')) as imposicion_name"
+
])
->join("orden_trabajo_dates","orden_trabajo_dates.orden_trabajo_id = ordenes_trabajo.id","left")
->join("pedidos","pedidos.id = ordenes_trabajo.pedido_id","left")
@@ -92,6 +94,9 @@ class OrdenTrabajoModel extends Model
->join("clientes","clientes.id = presupuestos.cliente_id","left")
->join("tipos_presupuestos","presupuestos.tipo_impresion_id = tipos_presupuestos.id","left")
->join("ubicaciones","ubicaciones.id = pedidos_linea.ubicacion_id","left")
+ ->join("orden_trabajo_tareas","orden_trabajo_tareas.orden_trabajo_id = ordenes_trabajo.id","left")
+ ->join("lg_imposiciones","lg_imposiciones.id = orden_trabajo_tareas.imposicion_id","left")
+
->whereIn("presupuesto_linea.tipo",["lp_bn","lp_bnhq","lp_rot_bn","lp_color","lp_colorhq","lp_rot_color"])
->where("ordenes_trabajo.deleted_at",null)
->groupBy("ordenes_trabajo.id");
diff --git a/ci4/app/Services/ProductionService.php b/ci4/app/Services/ProductionService.php
index 8c9286cd..0a325cf9 100644
--- a/ci4/app/Services/ProductionService.php
+++ b/ci4/app/Services/ProductionService.php
@@ -3,6 +3,7 @@
namespace App\Services;
use App\Entities\Clientes\ClienteEntity;
+use App\Entities\Configuracion\Imposicion;
use App\Entities\Pedidos\PedidoEntity;
use App\Entities\Presupuestos\PresupuestoEntity;
use App\Entities\Presupuestos\PresupuestoLineaEntity;
@@ -414,9 +415,12 @@ class ProductionService extends BaseService
"orden_trabajo_tareas.maquina_id as maquina_tarea",
"lg_maquinas.nombre as maquina_nombre",
"lg_imposiciones.id as imposicion_id",
+ "CONCAT(lg_imposiciones.ancho,'x',lg_imposiciones.alto,'_',COALESCE(lg_imposiciones.unidades,'NULL'),'_',COALESCE(lg_imposiciones.orientacion,'NULL'),'_',COALESCE(lg_imposiciones.etiqueta,'')) as imposicion_name",
"orden_trabajo_tareas.tiempo_estimado",
"orden_trabajo_tareas.tiempo_real",
"orden_trabajo_tareas.comment",
+ "orden_trabajo_tareas.presupuesto_linea_id",
+ "presupuesto_linea.tipo",
])
->join("orden_trabajo_tareas", "orden_trabajo_tareas.orden_trabajo_id = ordenes_trabajo.id", "left")
@@ -657,39 +661,53 @@ class ProductionService extends BaseService
"linea_impresion" => $this->presupuesto->presupuestoLineaImpresion(),
"linea_cubierta" => $this->presupuesto->presupuestoLineaCubierta(),
"peso_unidad" => $logistica_data["peso_unidad"],
- "peso_pedido" => $logistica_data["peso_pedido"]
+ "peso_pedido" => $logistica_data["peso_pedido"],
+ "imposicion" => $this->getImposicionTareaImpresion()
];
}
- public function getTareaImpresionSobreCubierta(): array
+ public function getImposicionTareaImpresion(): ?Imposicion
+ {
+ $imposicion = null;
+ $impresionInteriorBnImposicion = $this->getTareaImpresionInteriorBn()?->imposicion();
+ $impresionInteriorColorImposicion = $this->getTareaImpresionInteriorColor()?->imposicion();
+ if($impresionInteriorBnImposicion){
+ $imposicion = $impresionInteriorBnImposicion;
+ }
+ if($impresionInteriorColorImposicion){
+ $imposicion = $impresionInteriorColorImposicion;
+ }
+ return $imposicion;
+ }
+ public function getTareaImpresionSobreCubierta(): ?OrdenTrabajoTareaEntity
{
$q = $this->otTarea->select('orden_trabajo_tareas.*')
->join("presupuesto_linea", "presupuesto_linea.id = orden_trabajo_tareas.presupuesto_linea_id", "left")
->where("orden_trabajo_tareas.orden_trabajo_id", $this->ot->id)
- ->whereIn("presupuesto_linea.tipo", ["lp_sobrecubierta"])->findAll();
+ ->whereIn("presupuesto_linea.tipo", ["lp_sobrecubierta"])->first();
return $q;
}
- public function getTareaImpresionCubierta(): array
+ public function getTareaImpresionCubierta(): ?OrdenTrabajoTareaEntity
{
$q = $this->otTarea->select('orden_trabajo_tareas.*')
->join("presupuesto_linea", "presupuesto_linea.id = orden_trabajo_tareas.presupuesto_linea_id", "left")
->where("orden_trabajo_tareas.orden_trabajo_id", $this->ot->id)
- ->whereIn("presupuesto_linea.tipo", ["lp_cubierta"])->findAll();
+ ->whereIn("presupuesto_linea.tipo", ["lp_cubierta"])->first();
return $q;
}
- public function getTareaImpresionInteriorBn(): array
+ public function getTareaImpresionInteriorBn(): ?OrdenTrabajoTareaEntity
{
$q = $this->otTarea->select('orden_trabajo_tareas.*')
->join("presupuesto_linea", "presupuesto_linea.id = orden_trabajo_tareas.presupuesto_linea_id", "left")
->where("orden_trabajo_tareas.orden_trabajo_id", $this->ot->id)
- ->whereIn("presupuesto_linea.tipo", ["lp_rot_bn", "lp_bn", "lp_bnhq"])->findAll();
+ ->whereIn("presupuesto_linea.tipo", ["lp_rot_bn", "lp_bn", "lp_bnhq"])->first();
return $q;
}
- public function getTareaImpresionInteriorColor(): array
+ public function getTareaImpresionInteriorColor(): ?OrdenTrabajoTareaEntity
{
$q = $this->otTarea->select('orden_trabajo_tareas.*')
->join("presupuesto_linea", "presupuesto_linea.id = orden_trabajo_tareas.presupuesto_linea_id", "left")
->where("orden_trabajo_tareas.orden_trabajo_id", $this->ot->id)
- ->whereIn("presupuesto_linea.tipo", ["lp_rot_color", "lp_color", "lp_colorhq"])->findAll();
+ ->whereIn("presupuesto_linea.tipo", ["lp_rot_color", "lp_color", "lp_colorhq"])->first();
return $q;
}
public function getPresupuestoLineaImpresion() {}
diff --git a/ci4/app/Views/themes/vuexy/components/tables/ot_task_table.php b/ci4/app/Views/themes/vuexy/components/tables/ot_task_table.php
index cc9e048c..60dc55d3 100644
--- a/ci4/app/Views/themes/vuexy/components/tables/ot_task_table.php
+++ b/ci4/app/Views/themes/vuexy/components/tables/ot_task_table.php
@@ -7,7 +7,7 @@
= lang('Produccion.task.task') ?> |
= lang('Produccion.task.maquina_presupuesto') ?> |
= lang('Produccion.task.maquina_actual') ?> |
-
+ = lang('Produccion.task.imposicion') ?> |
= lang('Produccion.task.tiempo_estimado') ?> |
= lang('Produccion.task.tiempo') ?> |
|
diff --git a/ci4/app/Views/themes/vuexy/form/produccion/viewOrdenTrabajoList.php b/ci4/app/Views/themes/vuexy/form/produccion/viewOrdenTrabajoList.php
index 8fd39828..08de4ce3 100644
--- a/ci4/app/Views/themes/vuexy/form/produccion/viewOrdenTrabajoList.php
+++ b/ci4/app/Views/themes/vuexy/form/produccion/viewOrdenTrabajoList.php
@@ -52,6 +52,8 @@
= $this->section('css') ?>
+
+
= $this->endSection() ?>
= $this->section("additionalExternalJs") ?>
diff --git a/ci4/app/Views/themes/vuexy/pdfs/orden_trabajo.php b/ci4/app/Views/themes/vuexy/pdfs/orden_trabajo.php
index 753a17f5..9c8adc56 100644
--- a/ci4/app/Views/themes/vuexy/pdfs/orden_trabajo.php
+++ b/ci4/app/Views/themes/vuexy/pdfs/orden_trabajo.php
@@ -44,13 +44,13 @@ $settings = $session->get('settings');
-

portada_path)): '/assets/img/portada_not_found.png' ?>" />
+

portada_path)) : '/assets/img/portada_not_found.png' ?>" />
py-2 rounded border-1 border-secondary">
- = $dates->fecha_encuadernado_at ? week_day_humanize(Time::createFromFormat("Y-m-d", $dates->fecha_encuadernado_at)->getDayOfWeek(), true) : "" ?>
+ = $dates?->fecha_encuadernado_at ? week_day_humanize(Time::createFromFormat("Y-m-d", $dates?->fecha_encuadernado_at)->getDayOfWeek(), true) : "" ?>
Comercial: = $cliente->first_name . " " . $cliente->comercial()->last_name ?>
@@ -64,52 +64,52 @@ $settings = $session->get('settings');
-
">
- = $dates->fecha_encuadernado_at ? Time::createFromFormat("Y-m-d", $dates->fecha_encuadernado_at)?->format("d/m/Y") : "" ?>
-
-
- RF
-
+
">
+ = $dates?->fecha_encuadernado_at ? Time::createFromFormat("Y-m-d", $dates?->fecha_encuadernado_at)?->format("d/m/Y") : "" ?>
+
+
+ =isset($encuadernaciones[0]) ? $encuadernaciones[0]->tarifa()->code ?? "?" : "?" ?>
+
-
-
-
- | = $ubicacion ?> |
-
-
-
- | = $ubicacion ?> |
-
-
-
- | = $ubicacion ?> |
-
-
-
- | = $ubicacion ?> |
-
-
-
- | = $ubicacion ?> |
-
-
+
+
+
+ | = $ubicacion ?> |
+
+
+
+ | = $ubicacion ?> |
+
+
+
+ | = $ubicacion ?> |
+
+
+
+ | = $ubicacion ?> |
+
+
+
+ | = $ubicacion ?> |
+
+
-
- BCLF 100
+
+ = $linea_impresion->papel_impresion()->papel_code_ot ?>
0:3
- EM 300
+ = $linea_cubierta->papel_impresion()->papel_code_ot ?>
- BRILLO
+ = isset($acabados[0]) ? $acabados[0]->tarifa()->code : "" ?>
@@ -130,26 +130,26 @@ $settings = $session->get('settings');
-
+
- | Cliente |
-
+ | Cliente |
+
= $cliente->nombre ?>
|
- | Titulo |
-
+ | Titulo |
+
= $presupuesto->titulo ?>
|
- | ISBN |
+ ISBN |
= $presupuesto->isbn ?> |
- | CIF |
+ CIF |
= $cliente->cif ?> |
@@ -187,7 +187,7 @@ $settings = $session->get('settings');
| Imposicion |
- ?? |
+ = $imposicion->full_name ?> |
@@ -198,6 +198,18 @@ $settings = $session->get('settings');
IMP. INTERIOR
+
+
+
+ | ?? |
+
+ =$presupuesto->tirada ?> |
+
+ =$presupuesto->tipo ?> |
+
+ =$presupuesto->lomo_cubierta ?> |
+
+
) ?>) |
@@ -288,7 +300,7 @@ $settings = $session->get('settings');
= implode("/", array_map(fn($q) => $q->nombre, $acabados[0]->maquinas())) ?> |
- = $ot->users()->plastificado_by?->getFullName() ?? null ?> |
+ = $ot->users()?->plastificado_by?->getFullName() ?? null ?> |
@@ -307,7 +319,7 @@ $settings = $session->get('settings');
| = $value->tarifa()->nombre ?> |
= $presupuesto->solapas ? "SI" : "NO" ?> |
= $presupuesto->hasSobrecubierta() ? "SI" : "NO" ?> |
- = $linea_impresion->pliegos_libro?>/=$linea_impresion->pliegos_pedido?> |
+ _____=" ".lang("Produccion.pliegos_de")." "?>_____ |
= $presupuesto->guardas ? "SI" : "NO" ?> |
= $presupuesto->retractilado ? "SI" : "NO" ?> |
= $presupuesto->marcapaginas ? "SI" : "NO" ?> |
diff --git a/httpdocs/assets/js/safekat/components/datatables/otDatatable.js b/httpdocs/assets/js/safekat/components/datatables/otDatatable.js
index d5c2f089..d3e9dd80 100644
--- a/httpdocs/assets/js/safekat/components/datatables/otDatatable.js
+++ b/httpdocs/assets/js/safekat/components/datatables/otDatatable.js
@@ -14,11 +14,14 @@ class OrdenTrabajoDatatable {
{ data: 'cliente_nombre', searchable: false, sortable: false },
{ data: 'presupuesto_titulo', searchable: false, sortable: false },
{ data: 'ubicacion_nombre', searchable: false, sortable: false },
- { data: 'total_tirada', searchable: false, sortable: false ,render : (d) => `${d}`},
+ { data: 'total_tirada', searchable: false, sortable: false, render: (d) => `${d}` },
{ data: 'tipo_presupuesto_impresion', searchable: false, sortable: false },
{
data: 'logo', searchable: false, sortable: false, render: (d, t) => {
- return `
`
+ return `
+

+ ${d.imposicion ? `
${d.imposicion ?? ""}` : ''}
+
`
}
},
{
@@ -50,7 +53,7 @@ class OrdenTrabajoDatatable {
bottomStart: 'info',
bottomEnd: 'paging'
},
- columnDefs : [
+ columnDefs: [
{ className: 'dt-center', targets: '_all' },
],
serverSide: true,
@@ -71,7 +74,7 @@ class OrdenTrabajoDatatable {
bottomStart: 'info',
bottomEnd: 'paging'
},
- columnDefs : [
+ columnDefs: [
{ className: 'dt-center', targets: '_all' },
],
serverSide: true,
diff --git a/httpdocs/assets/js/safekat/pages/pdf/otDownload.js b/httpdocs/assets/js/safekat/pages/pdf/otDownload.js
index e350cdaf..d8eb9caa 100644
--- a/httpdocs/assets/js/safekat/pages/pdf/otDownload.js
+++ b/httpdocs/assets/js/safekat/pages/pdf/otDownload.js
@@ -1,12 +1,12 @@
$(() => {
- console.log("PDF")
- var opt = {
- margin: 2,
- filename: "PDF_OrdenTrabajo_" + $(".pdf-wrapper").data("id") + ".pdf",
- image: { type: 'jpeg', quality: 1 },
- html2canvas: { scale: 3 },
- jsPDF: { unit: 'mm', format: 'a4', orientation: 'portrait' }
- };
- let elementToPdf = $('body')[0]
- html2pdf().set(opt).from(elementToPdf).save()
+ // console.log("PDF")
+ // var opt = {
+ // margin: 2,
+ // filename: "PDF_OrdenTrabajo_" + $(".pdf-wrapper").data("id") + ".pdf",
+ // image: { type: 'jpeg', quality: 1 },
+ // html2canvas: { scale: 3 },
+ // jsPDF: { unit: 'mm', format: 'a4', orientation: 'portrait' }
+ // };
+ // let elementToPdf = $('body')[0]
+ // html2pdf().set(opt).from(elementToPdf).save()
})
\ No newline at end of file
diff --git a/httpdocs/assets/js/safekat/pages/produccion/ot.js b/httpdocs/assets/js/safekat/pages/produccion/ot.js
index 029abab2..335483c9 100644
--- a/httpdocs/assets/js/safekat/pages/produccion/ot.js
+++ b/httpdocs/assets/js/safekat/pages/produccion/ot.js
@@ -26,7 +26,7 @@ class OrdenTrabajo {
{ data: 'nombre', searchable: true, sortable: true, width: "20%" },
{ data: 'maquina_presupuesto_linea', searchable: true, sortable: true, width: "20%" },
{ data: 'maquina_tarea', searchable: false, sortable: false, render: this._renderMaquinaSelectTable.bind(this), width: "20%" },
- // { data: 'imposicion_id', searchable: false, sortable: false },
+ { data: 'imposicion', searchable: false, sortable: false, render: this._renderImposicionSelectTable.bind(this) },
{ data: 'tiempo_estimado', searchable: false, sortable: false },
{ data: 'tiempo_real', searchable: false, sortable: false },
{
@@ -42,13 +42,13 @@ class OrdenTrabajo {
nameId: "orden_trabajo_id",
getUri: '/produccion/ordentrabajo/get_files',
postUri: '/produccion/ordentrabajo/upload_files',
- resourcePath : 'orden_trabajo/' + this.modelId
+ resourcePath: 'orden_trabajo/' + this.modelId
}
if ($(this.configUploadDropzone.domElement).length > 0) {
this.fileUploadDropzone = new FileUploadDropzone(this.configUploadDropzone)
}
}
- initDropFiles(){
+ initDropFiles() {
if ($(this.configUploadDropzone.domElement).length > 0) {
this.fileUploadDropzone.init()
}
@@ -90,6 +90,7 @@ class OrdenTrabajo {
eventTareas() {
this.otForm.on("change", ".select-maquina-tarea-datatable", this.handleTareaChange.bind(this))
this.otForm.on("change", ".orden-tarea", this.handleTareaChange.bind(this))
+ this.otForm.on("change", ".select-imposicion-tarea-datatable", this.handleTareaChange.bind(this))
this.otForm.on("click", ".increase-order", (event) => {
const input_orden_tarea = $(event.currentTarget).parent().parent().find('.orden-tarea')
let actual_value = parseInt(input_orden_tarea.val())
@@ -105,6 +106,7 @@ class OrdenTrabajo {
}
unbindEventTareas() {
this.otForm.off("change", ".select-maquina-tarea-datatable")
+ this.otForm.off("change", ".select-imposicion-tarea-datatable")
this.otForm.off("change", ".orden-tarea")
this.otForm.off("click", ".increase-order")
this.otForm.off("click", ".decrease-order")
@@ -172,6 +174,14 @@ class OrdenTrabajo {
`
+ }
+ _renderImposicionSelectTable(d, t) {
+
+ let render = ``
+ return render
+
}
_renderActionCell(d, t) {
@@ -204,6 +214,26 @@ class OrdenTrabajo {
if (element.presupuesto_manipulado_id || element.is_corte) this.createSelectMaquinaManipulado(selectItem)
if (element.presupuesto_preimpresion_id) this.createSelectMaquinaAll(selectItem)
if (element.presupuesto_extra_id) this.createSelectMaquinaAll(selectItem)
+ if (this.summaryData.impresion_interior_bn) {
+ let isTareaImpresionInteriorBN = this.summaryData.impresion_interior_bn?.presupuesto_linea_id == element.presupuesto_linea_id
+ if (isTareaImpresionInteriorBN) {
+ let selectItemImposicion = this.item.find("#select-imposicion-tarea-" + element.id);
+ this.createSelectImposicion(selectItemImposicion)
+ } else {
+ let selectItemImposicion = this.item.find("#select-imposicion-tarea-" + element.id);
+ selectItemImposicion.addClass("d-none");
+ }
+ }
+ if (this.summaryData.impresion_interior_color) {
+ let isTareaImpresionInteriorColor = this.summaryData.impresion_interior_color?.presupuesto_linea_id == element.presupuesto_linea_id
+ if (isTareaImpresionInteriorColor) {
+ let selectItemImposicion = this.item.find("#select-imposicion-tarea-" + element.id);
+ this.createSelectImposicion(selectItemImposicion)
+ } else {
+ let selectItemImposicion = this.item.find("#select-imposicion-tarea-" + element.id);
+ selectItemImposicion.addClass("d-none");
+ }
+ }
});
} catch (error) {
} finally {
@@ -262,6 +292,25 @@ class OrdenTrabajo {
maquinaSelects.reset()
}
}
+ createSelectImposicion(selectItem) {
+ let imposicionId = selectItem.data("imposicion-id")
+ let imposicionSelect = new ClassSelect(selectItem, `/imposiciones/select`, "Seleccione una imposición", true);
+
+ imposicionSelect.config.templateResult = (state) => {
+ let $state = $(`
+
+ ${state.text}
+ ${state.desc ?? ''}
+
`)
+ return $state;
+ }
+ imposicionSelect.init();
+ if (imposicionId) {
+ imposicionSelect.setVal(imposicionId)
+ } else {
+ imposicionSelect.reset()
+ }
+ }
@@ -294,7 +343,7 @@ class OrdenTrabajo {
}
handleSummaryError(error) {
Notiflix.Block.remove('.section-block');
- }
+ }
fillPreimpresionReview() {
this.otForm.find("[name=fecha_entrega_warning]").prop("checked", this.summaryData.ot.fecha_entrega_warning)
this.otForm.find("[name=fecha_entrega_warning_revised]").prop("checked", this.summaryData.ot.fecha_entrega_warning_revised)
@@ -333,10 +382,10 @@ class OrdenTrabajo {
this.espiral.setDate(this.summaryData.dates.fecha_impresion_at)
this.embalaje.setDate(this.summaryData.dates.embalaje_at)
this.envio.setDate(this.summaryData.dates.envio_at)
- this.pedidoEnEsperaCheck.prop("checked",this.summaryData.ot.is_pedido_espera);
- if(this.summaryData.ot.pedido_espera_by){
- this.pedidoEnEsperaBy.text([this.summaryData.ot.pedido_espera_by.first_name,this.summaryData.ot.pedido_espera_by.last_name].join(" "))
- }else{
+ this.pedidoEnEsperaCheck.prop("checked", this.summaryData.ot.is_pedido_espera);
+ if (this.summaryData.ot.pedido_espera_by) {
+ this.pedidoEnEsperaBy.text([this.summaryData.ot.pedido_espera_by.first_name, this.summaryData.ot.pedido_espera_by.last_name].join(" "))
+ } else {
this.pedidoEnEsperaBy.text("");
}
this.otEstado.val(this.summaryData.ot.estado)
diff --git a/httpdocs/themes/vuexy/css/ot.css b/httpdocs/themes/vuexy/css/ot.css
new file mode 100644
index 00000000..0cc848be
--- /dev/null
+++ b/httpdocs/themes/vuexy/css/ot.css
@@ -0,0 +1,17 @@
+.imposicion-overlay-image
+{
+ position: absolute;
+ top: 75%;
+ left: 25%;
+ transform: translate(-10%, -10%);
+ background-color:rgb(255, 255, 255);
+ color: black;
+ font-size: 11px;
+ text-align: center;
+ border : 1px solid;
+
+}
+.logo-container{
+ position: relative;
+ display: inline-block;
+}
\ No newline at end of file
diff --git a/httpdocs/themes/vuexy/css/pdf.ot copy.css b/httpdocs/themes/vuexy/css/pdf.ot copy.css
deleted file mode 100644
index 1e75c6d8..00000000
--- a/httpdocs/themes/vuexy/css/pdf.ot copy.css
+++ /dev/null
@@ -1,348 +0,0 @@
-@page {
- size: A4;
- margin: 0;
- }
- @media print {
- body,html {
- width: 210mm;
- height: 297mm;
- max-width: 210mm;
- max-height: 297mm;
- print-color-adjust: exact;
- }
- /* ... the rest of the rules ... */
- }
-html {
- font-family: Arial, sans-serif;
- width: 210mm;
- height: 297mm;
- max-width: 210mm;
- font-size : 11px;
- max-height: 297mm;
- background-color: #f9f9f9;
-}
-body{
- border: 0px solid;
- padding: 20px;
- max-width: 210mm;
- max-height: 297mm;
-
-}
-.cubierta{
- color: #007bff;
-}
-.encuadernacion{
- color: green;
-}
-.impresion{
- color: #ff4000;
-}
-.container {
- width: 100%;
- width: 210mm;
- height: 297mm;
- background: #fff;
- padding: 20px;
- box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
- border: 2px solid;
-
-}
-.header {
- display: flex;
- justify-content: space-between;
- align-items: center;
-}
-.cover{
- display: flex;
- justify-content: start;
- align-items: center;
- gap: 10px;
- margin-top: 10px;
- margin-bottom: 10px;
-}
-.portada-info{
- display: flex;
- flex-direction: column;
- width: 100%;
-}
-.impresion-tipo-row{
- display: flex;
- align-items: center;
- justify-items: center;
- justify-content: end;
- width: 100%;
- height: 5mm;
- margin: 2px;
-}
-.portada-row{
- display: flex;
- align-items: center;
- justify-items: center;
- justify-content: space-between;
- background-color: #4ba0fccc;
- width: 100%;
- height: 5mm;
- border: solid 2px;
- margin: 2px;
- border-color: black;
-
-}
-.portada-row-2{
- display: flex;
- align-items: center;
- justify-items: center;
- width: 100%;
- height: 35mm;
- margin: 2px;
- border: 2px solid;
- border-color: black;
-
-}
-.portada{
- height: 40mm;
-}
-.presupuesto-title{
- color: #007bff;
- font-size: medium;
- line-height: 0;
-}
-.pl-2{
- padding-left: 0.5rem;
-}
-.pr-2{
- padding-right: 0.5rem;
-}
-.pt-2{
- padding-top: 0.5rem;
-}
-.flex-row{
- display: flex;
- width: 100%;
- justify-content: start;
- align-items: flex-start;
-}
-.date{
- padding-left: 0.5rem;
- padding-top: 0px;
- width: 100%;
- line-height: 0px;
- stroke-width: 5px;
- font-size: medium;
-}
-#presupuesto-section{
- width: 100%;
-}
-.flex-col{
- display: flex;
- padding: 0;
- flex-direction: column;
-}
-.cliente-title{
- color: red;
- font-size: medium;
- stroke-width: 10px;
- line-height: 0px;
-}
-
-.header .title {
- font-size: 24px;
- font-weight: bold;
- color: #333;
-}
-
-.section {
- margin-top: 0.5rem;
- border-top: 1px solid #ddd;
- padding-top: 0.2rem;
-}
-.section-title {
- font-weight: bold;
- margin-bottom: 10px;
-}
-table {
- width: 100%;
- border-collapse: collapse;
- margin-bottom: 5px;
- font-size: 12px;
-}
-table th, table td {
- border: 2px solid #000000;
- text-align: center;
-}
-table th {
- background-color: #f4f4f4;
- font-weight: bold;
-}
-table td{
- font-weight: bold;
-}
-.comments {
- color: #555;
- font-style: italic;
- margin-top: 0.2rem;
-}
-.comment-content {
- line-height: 0;
- width: 100%;
- height: 50px;
- border: solid;
- border-width: 1px;
-}
-.footer {
- text-align: center;
- margin-top: 0.5rem;
-
- font-size: 14px;
- color: #777;
-}
-.row-logo-impresion{
- text-align: center;
-}
-.portada-img{
- border: black;
- border-style: solid;
- border-width: 2px;
- height: 40mm;
- width: 100px;
- max-width: 30mm;
- border: 2px solid;
- border-color: black;
- border-radius: 5%;
-}
-.portada-text{
- color: white;
-}
-
-.t-header{
- color: black;
- width: 25%;
-}
-.t-cell{
- background-color: white;
- color: black;
- text-align: start;
- padding-left: 0.2rem;
-}
-.t-row{
- font-size: 10px;
-}
-.esquema{
- display: flex;
- justify-content:flex-end;
- width: 100%;
- justify-items: flex-end;
-
-}
-.pagina-imposicion-outer-start{
- border-top: 2px solid;
- border-left: 2px solid;
- border-bottom: 2px solid;
- width: 50px;
- height: 100px;
- display: flex;
- align-items: center;
- justify-content: center;
-}
-.pagina-imposicion-outer-end{
- border-top: 2px solid;
- border-right: 2px solid;
- border-bottom: 2px solid;
- width: 50px;
- height: 100px;
- display: flex;
- align-items: center;
- justify-content: center;
-}
-.pagina-imposicion-outer{
- border-top: 2px solid;
- border-bottom: 2px solid;
- width: 50px;
- height: 100px;
- display: flex;
- align-items: center;
- justify-content: center;
-}
-.pagina-imposicion-inner{
- border: 2px solid;
- font-size: 25px;
- width: 40px;
- height: 90px;
- display: flex;
- align-items: center;
- justify-content: center;
-
-}
-.square-wrapper{
- display: grid;
- grid-template-columns: repeat(2,1fr);
- margin-left: 5px;
-
-}
-.square{
- width: 100px;
- height: 50px;
- font-size: 14px;
- display: flex;
- align-items: center;
- justify-content: center;
- font-weight: bold;
-}
-.cod{
- width: 150px;
- height: 100px;
- display: flex;
- flex-direction: column;
- background-color: orange;
- margin-left : 20px;
- color: white;
- align-items: center;
- justify-content: space-between;
- font-weight: bold;
-}
-.cod-code{
- font-weight: bold;
- color: white;
-}
-.esquema-imposicion-wrapper{
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
- margin-left: 2rem;
- gap: 10px;
-}
-.imposicion{
- display: flex;
- align-items: center;
- justify-content: center;
- width: 200px;
-}
-.imposicion td{
- font-size: large;
-}
-.cod-barras{
- width: 150px;
- height: 80px;
- text-align : center;
- background-color: white;
- align-content: center;
-}
-.cod-barras img {
- padding : 1px;
-}
-.bg-white{
- background-color: white;
- color: black;
-}
-.bg-red{
- background-color: red;
- color: white;
-}
-.bg-gray{
- background-color: gray;
- color:white
-}
-.bg-blue{
- background-color: blue;
- color: white;
-}