Merge branch 'feat/ot-new-features' into 'main'

Features:

See merge request jjimenez/safekat!761
This commit is contained in:
Alvaro
2025-05-01 04:16:42 +00:00
52 changed files with 2407 additions and 693 deletions

View File

@ -12,8 +12,14 @@ class OrdenTrabajo extends BaseConfig
"interior_bn_at" => "interior_bn_user_id",
"interior_color_at" => "interior_color_user_id",
"cubierta_at" => "cubierta_user_id",
"sobrecubierta_at" => "sobrecubierta_user_id", //TODO
"guarda_at" => "guarda_user_id", //TODO
//ACABADO
"plastificado_at" => "plastificado_user_id",
"plakene_at" => "plakene_user_id", //TODO
"retractilado_at" => "retractilado_user_id",
"estampado_at" => "estampado_user_id", //TODO
"uvi_at" => "uvi_user_id", //TODO
"encuadernacion_at" => "encuadernacion_user_id",
"corte_at" => "corte_user_id",
"preparacion_interiores_at" => "preparacion_interior_user_id",
@ -21,7 +27,6 @@ class OrdenTrabajo extends BaseConfig
"cosido_at" => "cosido_user_id",
"grapado_at" => "grapado_user_id",
"solapa_at" => "solapa_user_id",
"retractilado_at" => "retractilado_user_id",
"retractilado5_at" => "retractilado5_user_id",
"prototipo_at" => "prototipo_user_id",
"marcapaginas_at" => "marcapaginas_user_id",
@ -100,9 +105,9 @@ class OrdenTrabajo extends BaseConfig
];
public array $OT_PLASTIFICADO_COLOR =
[
"BRIL" => ["bg" => "#00B0F0", "color" => "white"],
"BRILLO" => ["bg" => "#00B0F0", "color" => "white"],
"MATE" => ["bg" => "#FF0000", "color" => "white"],
"SOFT_TOUCH" => ["bg" => "#00B050", "color" => "white"],
"SOFT" => ["bg" => "#00B050", "color" => "white"],
"SANDY" => ["bg" => "#782170", "color" => "white"],
"ANTIRAYADO" => ["bg" => "#E97132", "color" => "white"],
"GOFRADO" => ["bg" => "#FFFF00", "color" => "black"],

View File

@ -754,6 +754,7 @@ $routes->group('produccion', ['namespace' => 'App\Controllers\Produccion'], func
$routes->get('tareas/datatable/(:num)', 'Ordentrabajo::tareas_datatable/$1', ['as' => 'datatableTareasOrdenTrabajo']);
$routes->get("tarea/progress/(:num)", "Ordentrabajo::get_orden_trabajo_progress_date/$1");
$routes->get('tarea/(:num)', 'Ordentrabajo::find_tarea/$1');
$routes->get('tarea/dates/(:num)','Ordentrabajo::get_orden_trabajo_tareas_dates/$1');
/**======================
* UPDATES
*========================**/
@ -771,6 +772,7 @@ $routes->group('produccion', ['namespace' => 'App\Controllers\Produccion'], func
$routes->get("color/(:num)", 'Ordentrabajo::get_orden_trabajo_color_status/$1');
$routes->post("update/tarea/progress", "Ordentrabajo::store_orden_trabajo_progress_date");
$routes->post("update/tarea/pliegos", "Ordentrabajo::update_orden_trabajo_pliegos");
$routes->post("update/tarea/proveedor", "Ordentrabajo::update_presupuesto_tarea_proveedor");
$routes->delete("tarea/progress/(:num)", "Ordentrabajo::delete_orden_trabajo_progress_date/$1");
/**======================
@ -783,6 +785,8 @@ $routes->group('produccion', ['namespace' => 'App\Controllers\Produccion'], func
* PDF
*========================**/
$routes->get('pdf/(:num)', 'Ordentrabajo::get_pdf/$1');
$routes->get('pdf/ferro/(:num)', 'Ordentrabajo::get_ferro_pdf/$1');
$routes->get('pdf/prototipo/(:num)', 'Ordentrabajo::get_prototipo_pdf/$1');
$routes->get('portada/(:num)', 'Ordentrabajo::get_portada_img/$1');
$routes->group('planning', ['namespace' => 'App\Controllers\Produccion'], function ($routes) {
$routes->get('select/maquina/rotativa', 'Ordentrabajo::select_maquina_planning_rot');

View File

@ -184,4 +184,15 @@ class Validation extends BaseConfig
"label" => "maquina",
],
];
public array $proveedor_tarea =
[
"proveedor_id" => [
"rules" => "required|integer",
"label" => "Proveedor",
],
"orden_trabajo_tarea_id" => [
"rules" => "required|integer",
"label" => "Tarea",
],
];
}

View File

@ -3,6 +3,7 @@
namespace App\Controllers\Produccion;
use App\Controllers\BaseController;
use App\Models\Compras\ProveedorModel;
use App\Models\Configuracion\MaquinaModel;
use App\Models\OrdenTrabajo\OrdenTrabajoModel;
use App\Models\OrdenTrabajo\OrdenTrabajoTarea;
@ -28,6 +29,7 @@ class Ordentrabajo extends BaseController
protected OrdenTrabajoModel $otModel;
protected OrdenTrabajoUser $otUserModel;
protected OrdenTrabajoTarea $otTarea;
protected ProveedorModel $proveedorModel;
protected MaquinaModel $maquinaModel;
protected UserModel $userModel;
protected Validation $validation;
@ -45,6 +47,7 @@ class Ordentrabajo extends BaseController
$this->produccionService = new ProductionService();
$this->otTarea = model(OrdenTrabajoTarea::class);
$this->maquinaModel = model(MaquinaModel::class);
$this->proveedorModel = model(ProveedorModel::class);
$this->validation = service("validation");
helper("time");
parent::initController($request, $response, $logger);
@ -138,6 +141,18 @@ class Ordentrabajo extends BaseController
return $this->response->setJSON(["errors" => $this->validation->getErrors()])->setStatusCode(400);
}
}
public function update_presupuesto_tarea_proveedor(){
$bodyData = $this->request->getPost();
$validated = $this->validation->run($bodyData, "proveedor_tarea");
if ($validated) {
$validatedData = $this->validation->getValidated();
$r = $this->produccionService->updateProveedorLinea($validatedData['orden_trabajo_tarea_id'], $validatedData['proveedor_id']);
return $this->response->setJSON(["message" => lang("App.global_alert_save_success"), "status" => $r]);
} else {
return $this->response->setJSON(["errors" => $this->validation->getErrors()])->setStatusCode(400);
}
}
public function reset_orden_trabajo_date()
{
$bodyData = $this->request->getPost();
@ -305,6 +320,7 @@ class Ordentrabajo extends BaseController
->edit("orden", fn($q) => ["id" => $q->id, "orden" => $q->orden])
->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))
->add("proveedor", fn($q) => $this->produccionService->getProveedorTarea($q->id))
->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);
@ -313,6 +329,14 @@ class Ordentrabajo extends BaseController
{
return $this->produccionService->init($orden_trabajo_id)->getPdf();
}
public function get_ferro_pdf($orden_trabajo_id)
{
return $this->produccionService->init($orden_trabajo_id)->getFerroPdf();
}
public function get_prototipo_pdf($orden_trabajo_id)
{
return $this->produccionService->init($orden_trabajo_id)->getPrototipoPdf();
}
public function upload_orden_trabajo_portada()
{
try {
@ -572,7 +596,6 @@ class Ordentrabajo extends BaseController
}
public function delete_orden_trabajo_progress_date(int $orden_trabajo_tarea_id)
{
$status = $this->produccionService->deleteOrdenTrabajoTareaProgressDates($orden_trabajo_tarea_id);
return $this->response->setJSON(["message" => lang("App.global_alert_save_success"), "status" => $status]);
}
@ -598,4 +621,9 @@ class Ordentrabajo extends BaseController
}
}
public function get_orden_trabajo_tareas_dates($orden_trabajo_id)
{
$data = $this->produccionService->init($orden_trabajo_id)->getOrdenTrabajoTareaDates();
return $this->response->setJSON(["data" => $data ]);
}
}

View File

@ -0,0 +1,68 @@
<?php
namespace App\Database\Migrations;
use CodeIgniter\Database\Migration;
class AlterTarifasAcabadoAddBoleanColumns extends Migration
{
protected array $COLUMNS = [
'plastificado' => [
'type' => 'BOOLEAN',
'default' => false,
],
'plakene' => [
'type' => 'BOOLEAN',
'default' => false,
],
'rectractilado' => [
'type' => 'BOOLEAN',
'default' => false,
],
'estampado' => [
'type' => 'BOOLEAN',
'default' => false,
],
'uvi' => [
'type' => 'BOOLEAN',
'default' => false,
],
'plastificado_tipo' => [
'type' => 'ENUM',
'constraint' => ['BRILLO','MATE','SANDY','GOFRADO','SOFT','ANTIRAYADO'],
'null' => true,
],
'plakene_tipo' => [
'type' => 'ENUM',
'constraint' => ['TRASLUCIDO','MATE','NEGRO'],
'null' => true,
],
'rectractilado_tipo' => [
'type' => 'ENUM',
'constraint' => ['1','3','5'],
'null' => true,
],
'estampado_tipo' => [
'type' => 'ENUM',
'constraint' => ['ORO','PLATA','COBRE','BRONCE'],
'null' => true,
],
'uvi_tipo' => [
'type' => 'ENUM',
'constraint' => ['2D','3D','BRAILLE'],
'null' => true,
]
];
public function up()
{
$this->forge->addColumn('lg_tarifa_acabado',$this->COLUMNS);
}
public function down()
{
$this->forge->dropColumn('lg_tarifa_acabado',array_keys($this->COLUMNS));
}
}

View File

@ -0,0 +1,43 @@
<?php
namespace App\Database\Migrations;
use CodeIgniter\Database\Migration;
class AlterOrdenesTrabajoAddCommentColumns extends Migration
{
protected array $COLUMNS = [
'comment_interior' => [
'type' => 'LONGTEXT',
'null' => true
],
'comment_cubierta' => [
'type' => 'LONGTEXT',
'null' => true
],
'comment_encuadernacion' => [
'type' => 'LONGTEXT',
'null' => true
],
'comment_logistica' => [
'type' => 'LONGTEXT',
'null' => true
],
"info_solapa_guillotina" => [
'type' => 'LONGTEXT',
'null' => true
]
];
public function up()
{
$this->forge->addColumn('ordenes_trabajo',$this->COLUMNS);
}
public function down()
{
$this->forge->dropColumn('ordenes_trabajo',array_keys($this->COLUMNS));
}
}

View File

@ -0,0 +1,82 @@
<?php
namespace App\Database\Migrations;
use CodeIgniter\Database\Migration;
use CodeIgniter\Database\RawSql;
class AddOrdenTrabajoDatesManipuladoImpresion extends Migration
{
protected array $DATES = [
"sobrecubierta_at" => [
"type" => "DATE",
"null" => true,
],
"guarda_at" => [
"type" => "DATE",
"null" => true,
],
"plakene_at" => [
"type" => "DATE",
"null" => true,
],
"estampado_at" => [
"type" => "DATE",
"null" => true,
],
"uvi_at" => [
"type" => "DATE",
"null" => true,
],
];
protected array $USERS = [
"sobrecubierta_user_id" => [
"type" => "INT",
"unsigned" => true,
"constraint" => 10,
"null" => true,
],
"guarda_user_id" => [
"type" => "INT",
"unsigned" => true,
"constraint" => 10,
"null" => true,
],
"plakene_user_id" => [
"type" => "INT",
"unsigned" => true,
"constraint" => 10,
"null" => true,
],
"estampado_user_id" => [
"type" => "INT",
"unsigned" => true,
"constraint" => 10,
"null" => true,
],
"uvi_user_id" => [
"type" => "INT",
"unsigned" => true,
"constraint" => 10,
"null" => true,
],
];
public function up()
{
$this->forge->addColumn("orden_trabajo_dates", $this->DATES);
$this->forge->addColumn("orden_trabajo_users", $this->USERS);
foreach ($this->USERS as $key => $value) {
$this->forge->addForeignKey([$key],"users",["id"]);
}
}
public function down()
{
$this->forge->dropColumn("orden_trabajo_dates", array_keys($this->DATES));
$this->forge->dropColumn("orden_trabajo_users", array_keys($this->USERS));
}
}

View File

@ -1,7 +1,9 @@
<?php
namespace App\Entities\Presupuestos;
use App\Entities\Compras\ProveedorEntity;
use App\Entities\Tarifas\Acabados\TarifaAcabadoEntity;
use App\Models\Compras\ProveedorModel;
use App\Models\Configuracion\MaquinaModel;
use App\Models\Tarifas\Acabados\TarifaAcabadoModel;
use App\Models\Tarifas\Maquinas\TarifaAcabadoMaquinaModel;
@ -54,5 +56,13 @@ class PresupuestoAcabadosEntity extends \CodeIgniter\Entity\Entity
$m = model(TarifaAcabadoModel::class);
return $m->find($this->attributes["tarifa_acabado_id"]);
}
public function proveedor(): ?ProveedorEntity
{
$proveedor = null;
$m = model(ProveedorModel::class);
if ($this->attributes["proveedor_id"]) {
$proveedor = $m->find($this->attributes["proveedor_id"]);
}
return $proveedor;
}
}

View File

@ -1,7 +1,10 @@
<?php
namespace App\Entities\Presupuestos;
use App\Entities\Compras\ProveedorEntity;
use App\Entities\Tarifas\TarifaEncuadernacionEntity;
use App\Models\Compras\ProveedorModel;
use App\Models\Configuracion\MaquinaModel;
use App\Models\Tarifas\Maquinas\TarifaEncuadernacionMaquinaModel;
use App\Models\Tarifas\TarifaEncuadernacionModel;
@ -32,10 +35,10 @@ class PresupuestoEncuadernacionesEntity extends \CodeIgniter\Entity\Entity
"precio_total" => "float",
"margen" => "float",
];
public function maquinas() : array
public function maquinas(): array
{
$m = model(TarifaEncuadernacionMaquinaModel::class);
$tarifa_maquinas = $m->where("tarifa_encuadernacion_id",$this->attributes["tarifa_encuadernado_id"])->findAll();
$tarifa_maquinas = $m->where("tarifa_encuadernacion_id", $this->attributes["tarifa_encuadernado_id"])->findAll();
$maquinaModel = model(MaquinaModel::class);
$maquinas = [];
foreach ($tarifa_maquinas as $key => $tarifa_maquina) {
@ -43,9 +46,18 @@ class PresupuestoEncuadernacionesEntity extends \CodeIgniter\Entity\Entity
}
return $maquinas;
}
public function tarifa() : TarifaEncuadernacionEntity
public function tarifa(): TarifaEncuadernacionEntity
{
$m = model(TarifaEncuadernacionModel::class);
return $m->find($this->attributes["tarifa_encuadernado_id"]);
}
public function proveedor(): ?ProveedorEntity
{
$proveedor = null;
$m = model(ProveedorModel::class);
if ($this->attributes["proveedor_id"]) {
$proveedor = $m->find($this->attributes["proveedor_id"]);
}
return $proveedor;
}
}

View File

@ -210,7 +210,7 @@ class PresupuestoEntity extends \CodeIgniter\Entity\Entity
$q = $model->where('presupuesto_id', $this->attributes["id"])->findAll();
return $q;
return $q ?? [];
}
/**
* Obtiene las lineas de presupuesto del actual presupuesto
@ -251,6 +251,14 @@ class PresupuestoEntity extends \CodeIgniter\Entity\Entity
return $q;
}
public function presupuestoLineaGuarda(): ?PresupuestoLineaEntity
{
$model = model(PresupuestoLineaModel::class);
$q = $model->where('presupuesto_id', $this->attributes["id"])->whereIn("tipo", ["lp_guardas"])->first();
return $q;
}
public function hasSobrecubierta(): bool
{
$hasSobrecubierta = false;

View File

@ -222,6 +222,7 @@ class PresupuestoLineaEntity extends \CodeIgniter\Entity\Entity
return $nombre;
}
public function isGuarda(): bool
{
return in_array($this->attributes["tipo"], ["lp_guardas"]);

View File

@ -15,8 +15,15 @@ class OrdenTrabajoDateEntity extends Entity
"interior_bn_at" => null,
"interior_color_at" => null,
"cubierta_at" => null,
"sobrecubierta_at" => null, //TODO
"guarda_at" => null, //TODO
//ACABADO
"plastificado_at" => null,
"plakene_at" => null, //TODO
"retractilado_at"=> null,
"estampado_at" => null, //TODO
"uvi_at" => null, //TODO
//MANIPULADO
"encuadernacion_at" => null,
"corte_at" => null,
"preparacion_interiores_at" => null,
@ -24,9 +31,8 @@ class OrdenTrabajoDateEntity extends Entity
"cosido_at" => null,
"solapa_at" => null,
"grapado_at" => null,
"retractilado_at"=> null,
"retractilado5_at"=> null,
"prototipo_at"=> null,
"retractilado5_at"=> null, // !DELETE
"prototipo_at"=> null, // !DELETE
"marcapaginas_at"=> null,
"espiral_at"=> null,
//FERRO

View File

@ -30,6 +30,11 @@ class OrdenTrabajoEntity extends Entity
"progreso" => 0.00,
"estado" => "I",
"comentarios" => null,
"comment_interior" => null,
"comment_cubierta" => null,
"comment_encuadernacion" => null,
"comment_logistica" => null,
"info_solapa_guillotina" => null,
"revisar_formato" => null,
"revisar_lomo" => null,
"revisar_solapa" => null,
@ -52,7 +57,12 @@ class OrdenTrabajoEntity extends Entity
"tipo_entrada" => "string",
"progreso" => "float",
"estado" => "string",
"comentarios" => "string",
"comentarios" => "?string",
"comment_interior" => "?string",
"comment_cubierta" => "?string",
"comment_encuadernacion" => "?string",
"comment_logistica" => "?string",
"info_solapa_guillotina" => "?string",
"revisar_formato" => "bool",
"revisar_lomo" => "bool",
"revisar_solapa" => "bool",
@ -80,7 +90,22 @@ class OrdenTrabajoEntity extends Entity
$m = model(OrdenTrabajoTarea::class);
return $m->where("orden_trabajo_id", $this->attributes["id"])->where("presupuesto_linea_id IS NOT NULL", NULL, FALSE)->findAll() ?? [];
}
/**
public function tareas_acabado(): array
{
$m = model(OrdenTrabajoTarea::class);
return $m->where("orden_trabajo_id", $this->attributes["id"])->where("presupuesto_acabado_id IS NOT NULL", NULL, FALSE)->findAll() ?? [];
}
public function tareas_encuadernado(): array
{
$m = model(OrdenTrabajoTarea::class);
return $m->where("orden_trabajo_id", $this->attributes["id"])->where("presupuesto_encuadernado_id IS NOT NULL", NULL, FALSE)->findAll() ?? [];
}
public function tareas_manipulado(): array
{
$m = model(OrdenTrabajoTarea::class);
return $m->where("orden_trabajo_id", $this->attributes["id"])->where("presupuesto_manipulado_id IS NOT NULL", NULL, FALSE)->findAll() ?? [];
}
/**
* Devuelve el presupuesto de la orden de trabajo
*
* @return PresupuestoEntity
@ -183,4 +208,5 @@ class OrdenTrabajoEntity extends Entity
];
return $estados[$this->attributes["estado"]];
}
}

View File

@ -5,6 +5,7 @@ namespace App\Entities\Produccion;
use App\Entities\Configuracion\Imposicion;
use App\Entities\Configuracion\Maquina;
use App\Entities\Presupuestos\PresupuestoAcabadosEntity;
use App\Entities\Presupuestos\PresupuestoEncuadernacionesEntity;
use App\Entities\Presupuestos\PresupuestoLineaEntity;
use App\Entities\Presupuestos\PresupuestoManipuladosEntity;
use App\Models\Configuracion\ImposicionModel;
@ -12,6 +13,7 @@ use App\Models\Configuracion\MaquinaModel;
use App\Models\OrdenTrabajo\OrdenTrabajoModel;
use App\Models\OrdenTrabajo\OrdenTrabajoTareaProgressDate;
use App\Models\Presupuestos\PresupuestoAcabadosModel;
use App\Models\Presupuestos\PresupuestoEncuadernacionesModel;
use App\Models\Presupuestos\PresupuestoLineaModel;
use App\Models\Presupuestos\PresupuestoManipuladosModel;
use CodeIgniter\Entity\Entity;
@ -23,6 +25,11 @@ class OrdenTrabajoTareaEntity extends Entity
"id" => null,
"orden_trabajo_id" => null,
"presupuesto_linea_id" => null,
"presupuesto_acabado_id" => null,
"presupuesto_preimpresion_id" => null,
"presupuesto_encuadernado_id" => null,
"presupuesto_extra_id" => null,
"presupuesto_manipulado_id" => null,
"nombre" => null,
"orden" => null,
"maquina_id" => null,
@ -96,10 +103,15 @@ class OrdenTrabajoTareaEntity extends Entity
*
* @return PresupuestoLineaEntity
*/
public function presupuesto_linea(): PresupuestoLineaEntity
public function presupuesto_linea(): ?PresupuestoLineaEntity
{
$presupuesto_linea = null;
$m = model(PresupuestoLineaModel::class);
return $m->find($this->attributes["presupuesto_linea_id"]);
if ($this->attributes['presupuesto_linea_id']) {
$presupuesto_linea = $m->find($this->attributes["presupuesto_linea_id"]);
}
return $presupuesto_linea;
}
/**
* Devuelve la maquina original del presupuesto linea
@ -108,17 +120,35 @@ class OrdenTrabajoTareaEntity extends Entity
*/
public function maquina_presupuesto_linea(): Maquina
{
return $this->presupuesto_linea()->maquina();
return $this->presupuesto_linea()?->maquina();
}
/**
* Devuelve el presupuesto acabado origen de esta tarea
*
* @return PresupuestoAcabadosEntity
*/
public function presupuesto_acabado(): PresupuestoAcabadosEntity
public function presupuesto_acabado(): ?PresupuestoAcabadosEntity
{
$presupuesto_acabado = null;
$m = model(PresupuestoAcabadosModel::class);
return $m->find($this->attributes["presupuesto_linea_id"]);
if ($this->attributes["presupuesto_acabado_id"]) {
$presupuesto_acabado = $m->find($this->attributes["presupuesto_acabado_id"]);
}
return $presupuesto_acabado;
}
/**
* Devuelve el presupuesto enducadernacion origen de esta tarea
*
* @return PresupuestoEncuadernacionesEntity
*/
public function presupuesto_encuadernacion(): ?PresupuestoEncuadernacionesEntity
{
$presupuesto_encuadernacion = null;
$m = model(PresupuestoEncuadernacionesModel::class);
if ($this->attributes["presupuesto_encuadernado_id"]) {
$presupuesto_encuadernacion = $m->find($this->attributes["presupuesto_encuadernado_id"]);
}
return $presupuesto_encuadernacion;
}
/**
* Devuelve el presupuesto acabado origen de esta tarea
@ -152,8 +182,8 @@ class OrdenTrabajoTareaEntity extends Entity
{
$dates = $this->progress_dates();
$intervals = [];
$init = [];
$end = [];
$init = null;
$end = null;
foreach ($dates as $key => $date) {
if ($date->estado == "I") {
if ($date->action_at) {
@ -161,7 +191,7 @@ class OrdenTrabajoTareaEntity extends Entity
}
}
if ($date->estado == "S" || $date->estado == "F") {
if ($date->action_at) {
if ($date->action_at && $init) {
$end = Time::createFromFormat('Y-m-d H:i:s', $date->action_at);
$intervals[] = $init->difference($end)->getSeconds();
}
@ -182,4 +212,24 @@ class OrdenTrabajoTareaEntity extends Entity
}
return $isTareaCosido;
}
public function isImpresion() : bool
{
return $this->attributes['presupuesto_linea_id'] != null;
}
public function isAcabado() : bool
{
return $this->attributes['presupuesto_acabado_id'] != null;
}
public function isManipulado() : bool
{
return $this->attributes['presupuesto_manipulado_id'] != null;
}
public function isEncuadernado() : bool
{
return $this->attributes['presupuesto_encuadernado_id'] != null;
}
public function isCorte() : bool
{
return $this->attributes['is_corte'];
}
}

View File

@ -19,8 +19,13 @@ class OrdenTrabajoUserEntity extends Entity
"interior_bn_user_id" => null,
"interior_color_user_id" => null,
"cubierta_user_id" => null,
"sobrecubierta_user_id" => null,
"guarda_user_id" => null,
//ACABADO
"plastificado_user_id" => null,
"plakene_user_id" => null,
"estampado_user_id" => null,
"uvi_user_id" => null,
"encuadernacion_user_id" => null,
"corte_user_id" => null,
"preparacion_interior_user_id" => null,

View File

@ -24,6 +24,16 @@ class TarifaAcabadoEntity extends \CodeIgniter\Entity\Entity
"deleted_at" => null,
"created_at" => null,
"updated_at" => null,
'plastificado' => false,
'plakene' => false,
'rectractilado' => false,
'estampado' => false,
'uvi' => false,
'plastificado_tipo' => null,
'plakene_tipo' => null,
'rectractilado_tipo' => null,
'estampado_tipo' => null,
'uvi_tipo' => null,
];
protected $casts = [
"precio_min" => "float",
@ -33,6 +43,16 @@ class TarifaAcabadoEntity extends \CodeIgniter\Entity\Entity
"user_created_id" => "int",
"user_updated_id" => "int",
"is_deleted" => "int",
'plastificado' => 'boolean',
'plakene' => 'boolean',
'rectractilado' => 'boolean',
'estampado' => 'boolean',
'uvi' => 'boolean',
'plastificado_tipo' => '?string',
'plakene_tipo' => '?string',
'rectractilado_tipo' => '?string',
'estampado_tipo' => '?string',
'uvi_tipo' => '?string',
];
/**
* Devuelve las maquinas asociadas a esta tarifa de acabado
@ -48,6 +68,7 @@ class TarifaAcabadoEntity extends \CodeIgniter\Entity\Entity
public function isUVI(): bool
{
return in_array($this->attributes["code"],["R3D","R2D"]);
return $this->attributes['uvi'];
}
}

View File

@ -43,12 +43,13 @@ return [
"maquina_actual" => "Máquina actual",
"tiempo_estimado" => "Tiempo estimado",
"tiempo" => "Tiempo",
"proveedor" => "Proveedor",
"imposicion" => "Imposición"
],
"finalizadas" => "Finalizadas",
"pendiente_ferro" => "Ferro pendiente",
"pendientes" => "Pendientes",
"ferro_ok" => "Ferro ok",
"ferro_ok" => "Ferro/Prototipo ok",
"envio" => "Envío",
"ferro" => "Ferro",
"ot" => "Orden trabajo",
@ -70,6 +71,7 @@ return [
"portada" => "portada",
"plakene_traslucido" => "Plakene traslúcido",
"plastificado_mate" => "Plastificado mate",
"plastificado" => "Plastificado",
"espiral" => "Espiral",
"embalaje" => "Embalaje",
"tiempo_consumido" => "Tiempo consumido",
@ -80,6 +82,7 @@ return [
"preview_pdf" => "Previsualizar PDF",
"imprimir_codigo_safekat" => "Imprimir código SAFEKAT",
"imprimir_ferro" => "Imprimir ferro",
"imprimir_prototipo" => "Prototipo",
"planning_rotativa" => "Planificación rotativa",
"planning_plana" => "Planificación plana",
"solapa" => "Solapa",
@ -97,12 +100,16 @@ return [
"grapado" => "Grapado",
"solapa" => "Solapas",
"retractilado" => "Retractilado",
"manipulado" => "Entrada manipulado",
"retractilado5" => "Retractilado 5",
"prototipo" => "Prototipo",
"marcapaginas" => "Marcapáginas",
//IMPRESION
"impresion_bn" => "Impresión BN",
"cubierta" => "Cubierta/Portada",
"guarda" => "Guarda",
"encuadernacion" => "Encuadernación",
//PREIMPRESION
"pre_formato" => "Revisión formato",
"pre_lomo" => "Revisión lomo",
@ -144,6 +151,11 @@ return [
'print_label' => "Imprimir etiqueta",
'click_init' => "Clicks al inicio",
'click_end' => "Clicks al final",
"comentarios" => "Comentarios",
"comentariosOt" => "Comentarios orden",
"comentariosImpresionInterior" => "Comentarios interior",
"comentariosCubierta" => "Comentarios cubierta",
"comentariosEncuadernacion" => "Comentarios encuadernación",
"comentariosLogistica" => "Comentarios logística",
"info_solapa_guillotina" => "Datos solapa y preparación guillotina",
];

View File

@ -214,4 +214,12 @@ class ProveedorModel extends \App\Models\BaseModel
return $builder->get()->getResultObject();
}
public function querySelect(?string $q)
{
$query = $this->builder()->select(['id','nombre as name']);
if($q){
$query->like('nombre',$q);
}
return $query;
}
}

View File

@ -427,6 +427,9 @@ class MaquinaModel extends \App\Models\BaseModel
->where('tarea_progress.deleted_at', null)
->groupBy('lg_maquinas.id')
->orderBy('countTareas','DESC');
if($maquina_tipo == "impresion"){
$query->where('orden_trabajo_tareas.is_corte',0);
}
return $query;
}

View File

@ -22,8 +22,14 @@ class OrdenTrabajoDate extends Model
"interior_bn_at",
"interior_color_at",
"cubierta_at",
"sobrecubierta_at", //TODO
"guarda_at", //TODO
//ACABADO
"plastificado_at",
"plakene_at", //TODO
"retractilado_at",
"estampado_at", //TODO
"uvi_at", //TODO
"encuadernacion_at",
"corte_at",
"preparacion_interiores_at",
@ -31,7 +37,6 @@ class OrdenTrabajoDate extends Model
"cosido_at",
"solapa_at",
"grapado_at",
"retractilado_at",
"retractilado5_at",
"prototipo_at",
"marcapaginas_at",

View File

@ -25,6 +25,11 @@ class OrdenTrabajoModel extends Model
"progreso",
"estado",
"comentarios",
"comment_interior",
"comment_cubierta",
"comment_encuadernacion",
"comment_logistica",
"info_solapa_guillotina",
"revisar_formato",
"revisar_lomo",
"revisar_solapa",

View File

@ -23,11 +23,18 @@ class OrdenTrabajoUser extends Model
"interior_bn_user_id",
"interior_color_user_id",
"cubierta_user_id",
"sobrecubierta_user_id",
"guarda_user_id",
//ACABADO
"plastificado_user_id",
"plakene_user_id",
"retractilado_user_id",
"estampado_user_id",
"uvi_user_id",
//ENCUADERNADO
"encuadernacion_user_id",
"corte_user_id",
"preparacion_interior_user_id",
"corte_user_id",
"entrada_manipulado_user_id",
"cosido_user_id",
"solapa_user_id",

View File

@ -1,4 +1,5 @@
<?php
namespace App\Models\Tarifas\Acabados;
class TarifaAcabadoModel extends \App\Models\BaseModel
@ -33,6 +34,16 @@ class TarifaAcabadoModel extends \App\Models\BaseModel
"is_deleted",
"user_created_id",
"user_updated_id",
'plastificado',
'plakene',
'rectractilado',
'estampado',
'uvi',
'plastificado_tipo',
'plakene_tipo',
'rectractilado_tipo',
'estampado_tipo',
'uvi_tipo'
];
protected $returnType = 'App\Entities\Tarifas\Acabados\TarifaAcabadoEntity';
@ -96,9 +107,9 @@ class TarifaAcabadoModel extends \App\Models\BaseModel
return empty($search)
? $builder
: $builder
->groupStart()
->like("t1.nombre", $search)
->groupEnd();
->groupStart()
->like("t1.nombre", $search)
->groupEnd();
}
public function getServiciosAcabadoSelector()

View File

@ -23,6 +23,8 @@ use App\Models\Configuracion\MaquinaModel;
use App\Models\OrdenTrabajo\OrdenTrabajoFileModel;
use App\Models\OrdenTrabajo\OrdenTrabajoTareaProgressDate;
use App\Models\Pedidos\PedidoModel;
use App\Models\Presupuestos\PresupuestoAcabadosModel;
use App\Models\Presupuestos\PresupuestoEncuadernacionesModel;
use App\Models\Usuarios\UserModel;
use CodeIgniter\Database\BaseBuilder;
use CodeIgniter\Database\BaseResult;
@ -65,6 +67,8 @@ class ProductionService extends BaseService
protected MaquinaEntity $defaultMaquinaCorte;
protected MaquinaModel $maquinaModel;
protected OrdenTrabajo $ordenTrabajoConfig;
protected PresupuestoAcabadosModel $presupuestoAcabadoModel;
protected PresupuestoEncuadernacionesModel $presupuestoEncuadernacionModel;
/**
@ -100,7 +104,24 @@ class ProductionService extends BaseService
* @var boolean
*/
public bool $isGofrado = false; //* CHECK DONE
/**
* Indica si la orden de trabajo contiene plastificado
* Se usa para mostrar la fecha correspondiente en la vista
* @var boolean
*/
public bool $isPlastificado = false; //* CHECK DONE
/**
* Indica si la orden de trabajo contiene gofrado
* Se usa para mostrar la fecha correspondiente en la vista
* @var boolean
*/
public bool $isPlakene = false; //* CHECK DONE
/**
* Indica si la orden de trabajo contiene gofrado
* Se usa para mostrar la fecha correspondiente en la vista
* @var boolean
*/
public bool $isEstampado = false; //* CHECK DONE
/**
* Indica si la orden de trabajo contiene cosido
* Se usa para mostrar la fecha correspondiente en la vista y pliegos
@ -110,10 +131,10 @@ class ProductionService extends BaseService
/**
* Indica si la orden de trabajo contiene gofrado
* Se usa para mostrar la fecha correspondiente en la vista
* TODO Hay que implementar un boolean en `lg_tarifa_acabado` para identificar
* TODO Hay que implementar un boolean en `lg_tarifa_manipulado` para identificar
* @var boolean
*/
public bool $isGrapado = true; //TODO
public bool $isGrapado = false; //TODO
/**
* Indica si la orden de trabajo contiene espiral
* Se usa para mostrar la fecha correspondiente en la vista
@ -121,21 +142,14 @@ class ProductionService extends BaseService
* DEFAULT true hasta implementacion
* @var boolean
*/
public bool $isEspiral = true; //TODO
public bool $isEspiral = false; //TODO
/**
* Indica si la orden de trabajo contiene UVI
* Se usa para mostrar la fecha correspondiente en la vista
* @var boolean
*/
public bool $isUVI = false; //* CHECK DONE
/**
* Indica si la orden de trabajo contiene plastificado
* Se usa para mostrar la fecha correspondiente en la vista
* TODO Hay que implementar un boolean en `lg_tarifa_acabado` para identificar
* DEFAULT true hasta implementacion
* @var boolean
*/
public bool $isPlastificado = true; //TODO
/**
* Indica si la orden de trabajo contiene cubierta
* Se usa para mostrar la fecha correspondiente en la vista
@ -186,6 +200,8 @@ class ProductionService extends BaseService
$this->otTareaProgressDate = model(OrdenTrabajoTareaProgressDate::class);
$this->festivoModel = model(FestivoModel::class);
$this->ordenTrabajoConfig = config('OrdenTrabajo');
$this->presupuestoAcabadoModel = model(PresupuestoAcabadosModel::class);
$this->presupuestoEncuadernacionModel = model(PresupuestoEncuadernacionesModel::class);
$this->statusColor = $this->ordenTrabajoConfig->OT_COLORS["sin_imprimir"];
$this->configVariableModel = model(ConfigVariableModel::class);
$this->podValue = $this->configVariableModel->getVariable('POD')->value;
@ -365,7 +381,7 @@ class ProductionService extends BaseService
$ot_tareas["maquina_id"] = $p_linea_maquina->id;
$ot_tareas["imposicion_id"] = null;
$ot_tareas["tiempo_estimado"] = $p_linea->horas_maquina * 3600;
$ot_tareas["tiempo_real"] = 0;
$ot_tareas["tiempo_real"] = 0;
$insert_query_result = $this->otTarea->insert($ot_tareas);
$ot_tareas = [];
$this->storeTareaCorte($p_linea);
@ -575,6 +591,14 @@ class ProductionService extends BaseService
{
return view("themes/vuexy/pdfs/orden_trabajo", $this->getDataPdf());
}
public function getFerroPdf()
{
return view("themes/vuexy/pdfs/ferro", $this->getDataPdf());
}
public function getPrototipoPdf()
{
return view("themes/vuexy/pdfs/prototipo", $this->getDataPdf());
}
/**
* Query para mostrar en datatable
*
@ -595,6 +619,10 @@ class ProductionService extends BaseService
"orden_trabajo_tareas.tiempo_real",
"orden_trabajo_tareas.comment",
"orden_trabajo_tareas.presupuesto_linea_id",
"orden_trabajo_tareas.presupuesto_acabado_id",
"orden_trabajo_tareas.presupuesto_manipulado_id",
"orden_trabajo_tareas.presupuesto_preimpresion_id",
"orden_trabajo_tareas.presupuesto_encuadernado_id",
"presupuesto_linea.tipo",
])
@ -837,6 +865,7 @@ class ProductionService extends BaseService
"preimpresiones" => $this->presupuesto->preimpresiones(),
"manipulados" => $this->presupuesto->manipulados(),
"encuadernaciones" => $this->presupuesto->encuadernaciones(),
"encuadernacionCode" => $this->getEncuadernacionCode(),
"linea_impresion" => $this->presupuesto->presupuestoLineaImpresion(),
"linea_cubierta" => $this->presupuesto->presupuestoLineaCubierta(),
"peso_unidad" => $logistica_data["peso_unidad"],
@ -847,7 +876,9 @@ class ProductionService extends BaseService
"colors" => $this->getPdfColors(),
"isPOD" => $this->isPOD,
"uvi" => $this->getUVI(),
"flags" => $this->getFlags(),
"tareaCosido" => $this->getTareaCosido(),
"plakene_tipo" => $this->plakene_tipo()
];
}
public function getImposicionTareaImpresion(): ?Imposicion
@ -958,6 +989,18 @@ class ProductionService extends BaseService
throw new Exception(lang('Produccion.task_already_finished'));
}
}
if(isset($data['estado'])){
if($data['estado'] == 'F'){
$tareaEntity = $this->otTarea->find($data['ot_tarea_id']);
$this->init($tareaEntity->orden_trabajo_id);
$dateName = $this->getOrdenTrabajoTareaDate($tareaEntity);
$dataDate = [
'name' => $dateName,
];
$dataDate[$dateName] = Time::now()->format('Y-m-d');
$this->updateOrdenTrabajoDate($dataDate);
}
}
return $this->otTareaProgressDate->insert($data);
}
public function getTareaLastState($tarea_id)
@ -972,6 +1015,12 @@ class ProductionService extends BaseService
$data["action_at"] = Time::now()->format('Y-m-d H:i:s');
$data["action_user_id"] = auth()->user()->id;
$status = $this->otTareaProgressDate->where('ot_tarea_id', $orden_trabajo_tarea_id)->delete();
if($status){
$tareaEntity = $this->otTarea->find($orden_trabajo_tarea_id);
$this->init($tareaEntity->orden_trabajo_id);
$dateName = $this->getOrdenTrabajoTareaDate($tareaEntity);
$this->emptyOrdenTrabajoDate($this->ot->id,$dateName);
}
if ($status) {
$response = $this->storeOrdenTrabajoTareaProgressDate($data);
}
@ -1374,7 +1423,7 @@ class ProductionService extends BaseService
$uvi = null;
$acabados = $this->presupuesto->acabados();
foreach ($acabados as $key => $acabado) {
if ($acabado->tarifa()->isUVI()) {
if ($acabado->tarifa()->uvi) {
$uvi = $acabado->tarifa();
}
}
@ -1490,8 +1539,11 @@ class ProductionService extends BaseService
{
$code = "";
$encuadernaciones = $this->presupuesto->encuadernaciones();
if (isset($encuadernaciones[0])) {
$code = $encuadernaciones[0]->tarifa()->code;
foreach ($encuadernaciones as $key => $value) {
$code = $value->tarifa()->code;
if ($code) {
break;
}
}
return $code;
}
@ -1596,21 +1648,10 @@ class ProductionService extends BaseService
foreach ($acabados as $key => $acabado) {
$tarifa_acabado = $acabado->tarifa();
if ($tarifa_acabado->code) {
$plastificado_code = $tarifa_acabado->code;
if ($plastificado_code == "BRIL") {
$color = $this->ordenTrabajoConfig->OT_PLASTIFICADO_COLOR['BRIL'];
}
if ($plastificado_code == "MATE") {
$color = $this->ordenTrabajoConfig->OT_PLASTIFICADO_COLOR['MATE'];
}
if ($plastificado_code == "ANTI") {
$color = $this->ordenTrabajoConfig->OT_PLASTIFICADO_COLOR['ANTIRAYADO'];
}
if ($plastificado_code == "SAND") {
$color = $this->ordenTrabajoConfig->OT_PLASTIFICADO_COLOR['SANDY'];
}
if ($plastificado_code == "GOF") {
$color = $this->ordenTrabajoConfig->OT_PLASTIFICADO_COLOR['GOFRADO'];
if ($tarifa_acabado->plastificado) {
if (isset($this->ordenTrabajoConfig->OT_PLASTIFICADO_COLOR[$tarifa_acabado->plastificado_tipo])) {
$color = $this->ordenTrabajoConfig->OT_PLASTIFICADO_COLOR[$tarifa_acabado->plastificado_tipo];
}
}
}
}
@ -1641,10 +1682,15 @@ class ProductionService extends BaseService
$this->color();
return [
"isGofrado" => $this->gofrado(),
"isEspiral" => $this->isEspiral,
"isEspiral" => $this->isEspiral, //TODO
"isPlastificado" => $this->plastificado(),
"isPlakene" => $this->plakene(),
"isEstampado" => $this->estampado(),
"isRetractilado" => $this->retractilado(),
"isUVI" => $this->uvi(),
"isPlastificado" => $this->isPlastificado,
"isCubierta" => $this->cubierta(),
"isSobrecubierta" => $this->sobreCubierta(),
"isGuarda" => $this->guarda(),
"isColor" => $this->isColor,
"isBN" => $this->isBN,
"isCorte" => $this->corte(),
@ -1669,6 +1715,75 @@ class ProductionService extends BaseService
$this->isGofrado = $flag;
return $this->isGofrado;
}
public function plakene(): bool
{
$flag = false;
$acabados = $this->presupuesto->acabados();
foreach ($acabados as $key => $acabado) {
$tarifa_acabado = $acabado->tarifa();
if ($tarifa_acabado->plakene) {
$flag = true;
break;
}
}
$this->isPlakene = $flag;
return $this->isPlakene;
}
public function retractilado(): bool
{
$flag = false;
$acabados = $this->presupuesto->acabados();
foreach ($acabados as $key => $acabado) {
$tarifa_acabado = $acabado->tarifa();
if ($tarifa_acabado->retractilado) {
$flag = true;
break;
}
}
$this->isPlakene = $flag;
return $this->isPlakene;
}
public function plakene_tipo(): ?string
{
$tipo = "";
$acabados = $this->presupuesto->acabados();
foreach ($acabados as $key => $acabado) {
$tarifa_acabado = $acabado->tarifa();
if ($tarifa_acabado->plakene) {
$tipo = $tarifa_acabado->plakene_tipo;
break;
}
}
return $tipo;
}
public function plastificado(): bool
{
$flag = false;
$acabados = $this->presupuesto->acabados();
foreach ($acabados as $key => $acabado) {
$tarifa_acabado = $acabado->tarifa();
if ($tarifa_acabado->plastificado) {
$flag = true;
break;
}
}
$this->isPlastificado = $flag;
return $this->isPlastificado;
}
public function estampado(): bool
{
$flag = false;
$acabados = $this->presupuesto->acabados();
foreach ($acabados as $key => $acabado) {
$tarifa_acabado = $acabado->tarifa();
if ($tarifa_acabado->estampado) {
$flag = true;
break;
}
}
$this->isEstampado = $flag;
return $this->isEstampado;
}
public function cosido(): bool
{
$flag = false;
@ -1701,6 +1816,24 @@ class ProductionService extends BaseService
}
return $this->isCubierta;
}
public function sobreCubierta(): bool
{
$flag = false;
$lineaCubierta = $this->presupuesto->presupuestoLineaSobreCubierta();
if ($lineaCubierta) {
$flag = true;
}
return $flag;
}
public function guarda(): bool
{
$flag = false;
$lineaCubierta = $this->presupuesto->presupuestoLineaGuarda();
if ($lineaCubierta) {
$flag = true;
}
return $flag;
}
public function color(): bool
{
$linea_impresion = $this->presupuesto->presupuestoLineaImpresion();
@ -1739,10 +1872,7 @@ class ProductionService extends BaseService
"orden_trabajo_tareas.id as ot_tarea_id",
"pedidos.fecha_impresion",
"orden_trabajo_tareas.nombre as tareaName",
"presupuestos.titulo as presupuesto_titulo",
"orden_trabajo_tareas.maquina_id",
"lg_papel_impresion.nombre as papel_impresion",
"presupuesto_linea.gramaje as papel_gramaje",
"tarea_progress.estado as tareaEstado"
])
->join("orden_trabajo_tareas", "orden_trabajo_tareas.orden_trabajo_id = ordenes_trabajo.id", "left")
@ -1759,21 +1889,14 @@ class ProductionService extends BaseService
'tarea_progress.ot_tarea_id = orden_trabajo_tareas.id',
'left'
)
->join("presupuesto_linea", "presupuesto_linea.id = orden_trabajo_tareas.presupuesto_linea_id", "left")
->join("presupuestos", "presupuestos.id = presupuesto_linea.presupuesto_id", "right")
->join("pedidos", "pedidos.id = ordenes_trabajo.pedido_id", "right")
->join("lg_papel_formato", "lg_papel_formato.id = presupuestos.papel_formato_id", "left")
->join("lg_maquinas", "lg_maquinas.id = orden_trabajo_tareas.maquina_id", "left")
->join("lg_papel_impresion", "lg_papel_impresion.id = presupuesto_linea.papel_impresion_id", "left")
->groupStart()
->orWhere('orden_trabajo_tareas.maquina_id', $maquina_id) //!TODO
->orWhere('presupuesto_linea.maquina_id', $maquina_id)
->groupEnd()
->where('orden_trabajo_tareas.maquina_id', $maquina_id)
// ->where('pedidos.fecha_impresion IS NOT NULL', null, false)
->where("orden_trabajo_tareas.deleted_at", null)
->where("tarea_progress.estado", 'P')
->orderBy("pedidos.fecha_impresion", "ASC")
->groupBy('orden_trabajo_tareas.nombre');
->groupBy('orden_trabajo_tareas.id');
return $q;
}
@ -1860,4 +1983,176 @@ class ProductionService extends BaseService
$dates = $this->createDatesForPOD();
return $this->pedidoModel->update($this->pedido->id, $dates);
}
public function getProveedorTarea($tarea_id)
{
$proveedor = null;
$tareaEntity = $this->otTarea->find($tarea_id);
if ($tareaEntity) {
$proveedorEncuadernado = $tareaEntity->presupuesto_encuadernacion();
$proveedorAcabado = $tareaEntity->presupuesto_acabado();
if ($proveedorEncuadernado) {
$proveedor = $proveedorEncuadernado->proveedor();
} elseif ($proveedorAcabado) {
$proveedor = $proveedorAcabado->proveedor();
} else {
$proveedor = null;
}
}
return ["tarea" => $tareaEntity, "proveedor" => $proveedor];
}
public function updateProveedorLinea($tarea_id, $proveedor_id)
{
$status = false;
$tareaEntity = $this->otTarea->find($tarea_id);
$presupuestoEncuadernado = $tareaEntity->presupuesto_encuadernacion();
$presupuestoAcabado = $tareaEntity->presupuesto_acabado();
if ($presupuestoEncuadernado) {
$status = $this->presupuestoEncuadernacionModel->update($presupuestoEncuadernado->id, ['proveedor_id' => $proveedor_id]);
} elseif ($presupuestoAcabado) {
$status = $this->presupuestoAcabadoModel->update($presupuestoAcabado->id, ['proveedor_id' => $proveedor_id]);
} else {
$status = null;
}
return $status;
}
public function otTareaImpresionWithDates()
{
$tareasImpresion = $this->ot->tareas_impresion();
$data = [];
foreach ($tareasImpresion as $key => $tareaImpresion) {
if ($tareaImpresion->is_corte) {
$data[$tareaImpresion->id] = 'corte_at';
continue;
}
$presupuestoLineaEntity = $tareaImpresion->presupuesto_linea();
if ($presupuestoLineaEntity) {
if ($presupuestoLineaEntity->isGuarda()) {
$data[$tareaImpresion->id] = 'guarda_at';
} elseif ($presupuestoLineaEntity->isCubierta()) {
$data[$tareaImpresion->id] = 'cubierta_at';
} elseif ($presupuestoLineaEntity->isColor()) {
$data[$tareaImpresion->id] = 'interior_color_at';
} elseif ($presupuestoLineaEntity->isBN()) {
$data[$tareaImpresion->id] = 'interior_bn_at';
} elseif ($presupuestoLineaEntity->isSobreCubierta()) {
$data[$tareaImpresion->id] = 'sobrecubierta_at';
}
}
}
return $data;
}
public function tareaImpresionDate($tarea): string
{
$dateName = "";
$presupuestoLineaEntity = $tarea->presupuesto_linea();
if ($presupuestoLineaEntity) {
if ($presupuestoLineaEntity->isGuarda()) {
$dateName = 'guarda_at';
} elseif ($presupuestoLineaEntity->isCubierta()) {
$dateName = 'cubierta_at';
} elseif ($presupuestoLineaEntity->isColor()) {
$dateName = 'interior_color_at';
} elseif ($presupuestoLineaEntity->isBN()) {
$dateName = 'interior_bn_at';
} elseif ($presupuestoLineaEntity->isSobreCubierta()) {
$dateName = 'sobrecubierta_at';
}
if ($tarea->is_corte) {
$dateName = 'corte_at';
}
}
return $dateName;
}
public function otTareaAcabadoWithDates()
{
$tareasAcabado = $this->ot->tareas_acabado();
$data = [];
foreach ($tareasAcabado as $key => $tareasAcabado) {
$tarifaAcabado = $tareasAcabado->presupuesto_acabado()?->tarifa();
if ($tarifaAcabado) {
if ($tarifaAcabado->plastificado) {
$data[$tareasAcabado->id] = 'plastificado_at';
}
if ($tarifaAcabado->rectractilado) {
$data[$tareasAcabado->id] = 'rectractilado_at';
}
if ($tarifaAcabado->estampado) {
$data[$tareasAcabado->id] = 'estampado_at';
}
if ($tarifaAcabado->uvi) {
$data[$tareasAcabado->id] = 'uvi_at';
}
}
}
return $data;
}
public function tareaAcabadoDate($tarea): string
{
$dateName = "";
$tarifaAcabado = $tarea->presupuesto_acabado()?->tarifa();;
if ($tarifaAcabado) {
if ($tarifaAcabado->plastificado) {
$dateName = 'plastificado_at';
}
if ($tarifaAcabado->rectractilado) {
$dateName = 'rectractilado_at';
}
if ($tarifaAcabado->plakene) {
$dateName = 'plakene_at';
}
if ($tarifaAcabado->estampado) {
$dateName = 'estampado_at';
}
if ($tarifaAcabado->uvi) {
$dateName = 'uvi_at';
}
}
return $dateName;
}
public function otTareaEncuadernadoWithDates()
{
$tareas = $this->ot->tareas_encuadernado();
$data = [];
foreach ($tareas as $key => $tarea) {
$data[$tarea->id] = "encuadernacion_at";
}
return $data;
}
public function otTareaManipuladooWithDates()
{
$tareas = $this->ot->tareas_manipulado();
$data = [];
foreach ($tareas as $key => $tarea) {
$data[$tarea->id] = "entrada_manipulado_at";
}
return $data;
}
public function getOrdenTrabajoTareaDates(): array
{
$dates = [];
foreach ($this->ot->tareas() as $key => $tarea) {
$dates[] = $this->getOrdenTrabajoTareaDate($tarea);
}
return array_unique($dates);
}
public function getOrdenTrabajoTareaDate(OrdenTrabajoTareaEntity $tarea): ?string
{
$dateName = null;
if ($tarea->isImpresion()) {
$dateName = $this->tareaImpresionDate($tarea);
}
if ($tarea->isAcabado()) {
$dateName = $this->tareaAcabadoDate($tarea);
}
if ($tarea->isManipulado()) {
$dateName = "entrada_manipulado_at";
}
if ($tarea->isEncuadernado()) {
$dateName = "encuadernacion_at";
}
return $dateName;
}
}

View File

@ -6,9 +6,6 @@
<th><?= lang('ID') ?></th>
<th><?= lang('Produccion.task.task') ?></th>
<th><?= lang('Produccion.task.estado') ?></th>
<th><?= lang('Produccion.datatable.titulo') ?></th>
<th><?= lang('Produccion.datatable.papel') ?></th>
<th><?= lang('Produccion.datatable.gramaje') ?></th>
<th><?= lang('Produccion.datatable.fecha_impresion') ?></th>
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
</tr>

View File

@ -1,6 +1,6 @@
<div class="table-responsive">
<table id="<?= $id ?>" class="table table-hover">
<table id="<?= $id ?>" class="table table-hover table-sm">
<thead>
<tr>
<th><?= lang('Produccion.task.order') ?></th>
@ -8,6 +8,7 @@
<th><?= lang('Produccion.task.maquina_presupuesto') ?></th>
<th><?= lang('Produccion.task.maquina_actual') ?></th>
<th><?= lang('Produccion.task.imposicion') ?></th>
<th><?= lang('Produccion.task.proveedor') ?></th>
<th><?= lang('Produccion.task.tiempo_estimado') ?></th>
<th><?= lang('Produccion.task.tiempo') ?></th>
<th></th>

View File

@ -1,6 +1,195 @@
<div class="accordion accordion-bordered mt-3" id="accordionComentarios">
<div class="card accordion-item active">
<h2 class="accordion-header" id="headingOne">
<button type="button" class="accordion-button" data-bs-toggle="collapse"
data-bs-target="#accordionComentariosTip" aria-expanded="false"
aria-controls="accordionComentariosTip">
<div class="d-flex flex-row justify-content-start align-items-stretch gap-2">
<span><i class="ti-quote ti-md ti"></i></span>
<h4> <?= lang('Produccion.comentarios') ?> </h4>
</div>
</button>
</h2>
<div class="cold-md-12 mt-3">
<!-- Comment text area-->
<label for="ot-comment" class="form-label"><h4><?= @lang("Produccion.comments") ?></h4></label>
<textarea rows=5 cols="10" type="text" class="form-control w-100" name="comentarios" id="ot-comment"></textarea>
</div>
<div id="accordionComentariosTip" class="accordion-collapse collapse show"
data-bs-parent="#accordionComentarios">
<div class="accordion-body">
<div class="nav-align-top mb-4">
<ul class="nav nav-pills mb-3" role="tablist">
<li class="nav-item">
<button
type="button"
class="nav-link active"
role="tab"
data-bs-toggle="tab"
data-bs-target="#comentarios-ot"
aria-controls="comentarios-ot"
aria-selected="true">
<?= lang("Produccion.comentariosOt") ?>
</button>
</li>
<li class="nav-item">
<button
type="button"
class="nav-link"
role="tab"
data-bs-toggle="tab"
data-bs-target="#comentarios-interior"
aria-controls="comentarios-interior"
aria-selected="true">
<?= lang("Produccion.comentariosImpresionInterior") ?>
</button>
</li>
<li class="nav-item">
<button
type="button"
class="nav-link"
role="tab"
data-bs-toggle="tab"
data-bs-target="#comentarios-cubierta"
aria-controls="comentarios-cubierta"
aria-selected="false">
<?= lang("Produccion.comentariosCubierta") ?>
</button>
</li>
<li class="nav-item">
<button
type="button"
class="nav-link"
role="tab"
data-bs-toggle="tab"
data-bs-target="#comentarios-encuadernacion"
aria-controls="comentarios-encuadernacion"
aria-selected="false">
<?= lang("Produccion.comentariosEncuadernacion") ?>
</button>
</li>
<li class="nav-item">
<button
type="button"
class="nav-link"
role="tab"
data-bs-toggle="tab"
data-bs-target="#comentarios-logistica"
aria-controls="comentarios-logistica"
aria-selected="false">
<?= lang("Produccion.comentariosLogistica") ?>
</button>
</li>
<li class="nav-item">
<button
type="button"
class="nav-link"
role="tab"
data-bs-toggle="tab"
data-bs-target="#info-solapa-guillotina"
aria-controls="info-solapa-guillotina"
aria-selected="false">
<?= lang("Produccion.info_solapa_guillotina") ?>
</button>
</li>
</ul>
<div class="tab-content border border-container">
<div class="tab-pane fade show active" id="comentarios-ot" role="tabpanel">
<div class="row">
<div class="col-md-12 col-lg-12 px-4">
<div class="mb-3">
<textarea
rows="3"
name="comentarios"
class="ot-comment w-100"
style="height: 10em;"
class="form-control"><?= $ot->comentarios ?></textarea>
</div>
</div>
</div>
</div>
<div class="tab-pane fade" id="comentarios-interior" role="tabpanel">
<div class="row">
<div class="col-md-12 col-lg-12 px-4">
<div class="mb-3">
<textarea
rows="3"
name="comment_interior"
class="ot-comment w-100"
style="height: 10em;"
class="form-control"><?= $ot->comment_interior ?></textarea>
</div>
</div>
</div>
</div>
<div class="tab-pane fade" id="comentarios-cubierta" role="tabpanel">
<div class="row">
<div class="col-md-12 col-lg-12 px-4">
<div class="mb-3">
<textarea
rows="3"
name="comment_cubierta"
class="ot-comment w-100"
style="height: 10em;"
class="form-control"><?= $ot->comment_cubierta ?></textarea>
</div>
</div>
</div>
</div>
<div class="tab-pane fade" id="comentarios-encuadernacion" role="tabpanel">
<div class="row">
<div class="col-md-12 col-lg-12 px-4">
<div class="mb-3">
<textarea
rows="3"
name="comment_encuadernacion"
class="ot-comment w-100"
style="height: 10em;"
class="form-control"><?= $ot->comment_encuadernacion ?></textarea>
</div>
</div>
</div>
</div>
<div class="tab-pane fade" id="comentarios-logistica" role="tabpanel">
<div class="row">
<div class="col-md-12 col-lg-12 px-4">
<div class="mb-3">
<textarea
rows="3"
name="comment_logistica"
class="ot-comment w-100"
style="height: 10em;"
class="form-control"><?= $ot->comment_logistica ?></textarea>
</div>
</div>
</div>
</div>
<div class="tab-pane fade" id="info-solapa-guillotina" role="tabpanel">
<div class="row">
<div class="col-md-12 col-lg-12 px-4">
<div class="mb-3">
<textarea
rows="3"
name="info_solapa_guillotina"
class="ot-comment w-100"
style="height: 10em;"
class="form-control"><?= $ot->info_solapa_guillotina ?></textarea>
</div>
</div>
</div>
</div>
</div>
</div>
</div> <!-- //.accordion-body -->
</div> <!-- //.accordion-collapse -->
</div> <!-- //.accordion-item -->
</div> <!-- //.accordion -->

View File

@ -42,9 +42,17 @@
<span class="ti-sm ti ti-truck-delivery me-1"></span>
Pedido
</a>
<a type="button" class="btn btn-danger btn-block mb-1" target="__blank" href="<?= "/produccion/ordentrabajo/pdf/" . $modelId ?>">
<span class="ti-sm ti ti-file me-1"></span>
PDF</a>
<?php if ($presupuesto->ferro == 1): ?>
<?php if ($ot->dates()->ferro_ok_at != null): ?>
<a type="button" class="btn btn-danger btn-block mb-1" target="__blank" href="<?= "/produccion/ordentrabajo/pdf/" . $modelId ?>">
<span class="ti-sm ti ti-file me-1"></span>
PDF</a>
<?php endif; ?>
<?php else: ?>
<a type="button" class="btn btn-danger btn-block mb-1" target="__blank" href="<?= "/produccion/ordentrabajo/pdf/" . $modelId ?>">
<span class="ti-sm ti ti-file me-1"></span>
PDF</a>
<?php endif; ?>
<a type="button" href="<?= route_to('getOrdenTrabajoBarCode', $modelId) ?>" class="btn btn-secondary btn-block mb-1" download><span class="ti-sm ti ti-barcode me-1"></span><?= @lang("Produccion.imprimir_codigo_safekat") ?></a>

View File

@ -21,7 +21,7 @@
</div>
</div>
<div class="row">
<div class="col-md-3 <?= $user_dates["pre_formato_at"]||$user_dates["pre_lomo_at"]||$user_dates["pre_solapa_at"]||$user_dates["pre_codbarras_at"]||$user_dates["pre_imposicion_at"] ? "" : "d-none" ?>">
<div class="col-md-3 <?= $user_dates["pre_formato_at"] || $user_dates["pre_lomo_at"] || $user_dates["pre_solapa_at"] || $user_dates["pre_codbarras_at"] || $user_dates["pre_imposicion_at"] ? "" : "d-none" ?>">
<!-- PREIMPRESION -->
<!-- Preformato -->
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100">
@ -136,30 +136,90 @@
</div>
<!-- Progress -->
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $flags["isCubierta"] ? "" : "d-none" ?>">
<label for="ot-portada" class="form-label"><?= @lang("Produccion.cubierta") ?></label>
<label for="ot-cubierta" class="form-label"><?= @lang("Produccion.cubierta") ?></label>
<div class="input-group">
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="cubierta_at" id="ot-portada" data-input <?= $is_finalizada ? "disabled" : "" ?>>
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="cubierta_at" id="ot-cubierta" data-input <?= $is_finalizada ? "disabled" : "" ?>>
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
</div>
<div class="form-text"><?= $user_dates["cubierta_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
</div>
<!-- Progress -->
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $flags["isSobrecubierta"] ? "" : "d-none" ?>">
<label for="ot-sobrecubierta" class="form-label"><?= @lang("Produccion.sobrecubierta") ?></label>
<div class="input-group">
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="sobrecubierta_at" id="ot-sobrecubierta" data-input <?= $is_finalizada ? "disabled" : "" ?>>
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
</div>
<div class="form-text"><?= $user_dates["sobrecubierta_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
</div>
<!-- Progress -->
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $flags["isGuarda"] ? "" : "d-none" ?>">
<label for="ot-guarda" class="form-label"><?= @lang("Produccion.guarda") ?></label>
<div class="input-group">
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="guarda_at" id="ot-guarda" data-input <?= $is_finalizada ? "disabled" : "" ?>>
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
</div>
<div class="form-text"><?= $user_dates["guarda_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
</div>
</div>
<div class="col-md-3">
<!-- Progress -->
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100">
<h4 class="text-truncate"><?= lang("Produccion.progress_manipulado") ?></h4>
</div>
<!-- Progress -->
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $flags["isPlastificado"] ? "" : "d-none" ?>">
<label for="ot-plastificado-mate" class="form-label"><?= @lang("Produccion.plastificado_mate") ?></label>
<label for="ot-plastificado" class="form-label"><?= @lang("Produccion.plastificado") ?></label>
<div class="input-group">
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="plastificado_at" id="ot-plastificado-mate" data-input <?= $is_finalizada ? "disabled" : "" ?>>
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="plastificado_at" id="ot-plastificado" data-input <?= $is_finalizada ? "disabled" : "" ?>>
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
</div>
<div class="form-text"><?= $user_dates["plastificado_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
</div>
</div>
<div class="col-md-3">
<!-- Progress -->
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100">
<h4><?= lang("Produccion.progress_manipulado") ?></h4>
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $flags["isPlakene"] ? "" : "d-none" ?>">
<label for="ot-plakene" class="form-label"><?= @lang("Produccion.plakene") ?></label>
<div class="input-group">
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="plakene_at" id="ot-plakene" data-input <?= $is_finalizada ? "disabled" : "" ?>>
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
</div>
<div class="form-text"><?= $user_dates["plakene_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
</div>
<!-- Progress -->
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $flags["isRetractilado"] ? "" : "d-none" ?>">
<label for="ot-retractilado" class="form-label"><?= @lang("Produccion.retractilado") ?></label>
<div class="input-group">
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="retractilado_at" id="ot-retractilado" data-input <?= $is_finalizada ? "disabled" : "" ?>>
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
</div>
<div class="form-text"><?= $user_dates["retractilado_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
</div>
<!-- Progress -->
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $flags["isUVI"] ? "" : "d-none" ?>">
<label for="ot-uvi" class="form-label"><?= @lang("Produccion.uvi") ?></label>
<div class="input-group">
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="uvi_at" id="ot-uvi" data-input <?= $is_finalizada ? "disabled" : "" ?>>
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
</div>
<div class="form-text"><?= $user_dates["uvi_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
</div>
<!-- Progress -->
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $flags["isEstampado"] ? "" : "d-none" ?>">
<label for="ot-estampado" class="form-label"><?= @lang("Produccion.estampado") ?></label>
<div class="input-group">
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="estampado_at" id="ot-estampado" data-input <?= $is_finalizada ? "disabled" : "" ?>>
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
</div>
<div class="form-text"><?= $user_dates["estampado_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
</div>
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $presupuesto->cosido ? "" : "d-none" ?>">
<label for="ot-prep-cosido" class="form-label"><?= @lang("Produccion.cosido") ?></label>
@ -187,35 +247,6 @@
</div>
<div class="form-text"><?= $user_dates["solapa_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
</div>
<!-- Progress -->
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $presupuesto->retractilado ? "" : "d-none" ?>">
<label for="ot-prep-retractilado" class="form-label"><?= @lang("Produccion.retractilado") ?></label>
<div class="input-group">
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="retractilado_at" id="ot-prep-retractilado" data-input <?= $is_finalizada ? "disabled" : "" ?>>
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
</div>
<div class="form-text"><?= $user_dates["retractilado_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
</div>
<!-- Progress -->
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $presupuesto->retractilado5 ? "" : "d-none" ?>">
<label for="ot-prep-retractilado5" class="form-label"><?= @lang("Produccion.retractilado5") ?></label>
<div class="input-group">
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="retractilado5_at" id="ot-prep-retractilado5" data-input <?= $is_finalizada ? "disabled" : "" ?>>
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
</div>
<div class="form-text"><?= $user_dates["retractilado5_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
</div>
<!-- Progress -->
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $presupuesto->prototipo ? "" : "d-none" ?>">
<label for="ot-prep-prototipo" class="form-label"><?= @lang("Produccion.prototipo") ?></label>
<div class="input-group">
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="prototipo_at" id="ot-prep-prototipo" data-input <?= $is_finalizada ? "disabled" : "" ?>>
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
</div>
<div class="form-text"><?= $user_dates["prototipo_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
</div>
<!-- Progress -->
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $presupuesto->marcapaginas ? "" : "d-none" ?>">
@ -237,13 +268,23 @@
</div>
<!-- Progress -->
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $flags["isEspiral"] ? "" : "d-none" ?>">
<label for="ot-espiral" class="form-label"><?= @lang("Produccion.espiral") ?></label>
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= count($ot->tareas_encuadernado()) > 0 ? "" : "d-none" ?>">
<label for="ot-manipulado" class="form-label"><?= @lang("Produccion.manipulado") ?></label>
<div class="input-group">
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="espiral_at" id="ot-espiral" data-input <?= $is_finalizada ? "disabled" : "" ?>>
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="entrada_manipulado_at" id="ot-manipulado" data-input <?= $is_finalizada ? "disabled" : "" ?>>
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
</div>
<div class="form-text"> <?= $user_dates["espiral_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
<div class="form-text"> <?= $user_dates["entrada_manipulado_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
</div>
<!-- Progress -->
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= count($ot->tareas_encuadernado()) > 0 ? "" : "d-none" ?>">
<label for="ot-encuadernacion" class="form-label"><?= @lang("Produccion.encuadernacion") ?></label>
<div class="input-group">
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="encuadernacion_at" id="ot-encuadernacion" data-input <?= $is_finalizada ? "disabled" : "" ?>>
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
</div>
<div class="form-text"> <?= $user_dates["encuadernacion_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
</div>
</div>

View File

@ -45,9 +45,17 @@
href="<?= "/produccion/ordentrabajo/pdf/" . $modelId ?>">
<span class="ti-sm ti ti-eye me-1"></span>
<?= @lang("Produccion.preview_pdf") ?></a>
<?php if ($presupuesto->ferro): ?>
<a type="button" class="btn btn-primary btn-block mb-1" target="__blank"
href="<?= "/produccion/ordentrabajo/pdf/ferro/" . $modelId ?>">
<span class="ti-sm ti ti-download me-1"></span>
<?= @lang("Produccion.imprimir_ferro") ?></a>
<?php endif; ?>
<?php if ($presupuesto->prototipo): ?>
<button type="button"
class="btn btn-primary btn-block mb-1 beta"><?= @lang("Produccion.imprimir_ferro") ?></button>
<a type="button" class="btn btn-primary btn-block mb-1" target="__blank"
href="<?= "/produccion/ordentrabajo/pdf/prototipo/" . $modelId ?>">
<span class="ti-sm ti ti-download me-1"></span>
<?= @lang("Produccion.prototipo") ?></a>
<?php endif; ?>
<a type="button" href="<?= route_to('getOrdenTrabajoBarCode', $modelId) ?>"
class="btn btn-secondary btn-block mb-1"

View File

@ -3,7 +3,7 @@
/**
* MAQUINISTA MENU
*/
if (auth()->user()->inGroup('maquina')) {
if (auth()->user()->inGroup('maquina','admin')) {
?>
<!-- Catalogue -->
<li class="menu-item">

View File

@ -1,7 +1,7 @@
<table>
<tr class="encuadernacion">
<th >Encuadernacion</th>
<th class="cell-50"></th>
<th class="cell-50"><?=$presupuesto->solapas > 0 ? "Solapas" : ""?></th>
<th class="cell-50"></th>
<th class="cell-50"></th>
<th class="cell-50"></th>
@ -10,10 +10,13 @@
<th class="cell-50">Marcapáginas</th>
</tr>
<?php if (count($encuadernaciones) > 0): ?>
<?php foreach ($encuadernaciones as $key => $value): ?>
<tr style="color: red;">
<td><?= $value->tarifa()->nombre ?></td>
<td></td>
<td><?= $encuadernacion->tarifa()->nombre ?></td>
<?php if ($presupuesto->solapas > 0): ?>
<td><?= "SI ($presupuesto->solapas_ancho mm.)" ?></td>
<?php else: ?>
<td></td>
<?php endif; ?>
<td></td>
<td></td>
<td></td>
@ -21,7 +24,6 @@
<td><?= $presupuesto->retractilado ? "SI" : "NO" ?></td>
<td><?= $presupuesto->marcapaginas ? "SI" : "NO" ?></td>
</tr>
<?php endforeach; ?>
<?php else: ?>
<tr style="color: red;">
<td colspan="7">Sin encuadernación</td>

View File

@ -1,30 +0,0 @@
<table>
<tr class="encuadernacion">
<th >Encuadernacion</th>
<th class="cell-50">Solapas</th>
<th class="cell-50"></th>
<th class="cell-50"></th>
<th class="cell-50"></th>
<th class="cell-50"></th>
<th class="cell-50">Retractilado</th>
<th class="cell-50">Marcapáginas</th>
</tr>
<?php if (count($encuadernaciones) > 0): ?>
<?php foreach ($encuadernaciones as $key => $value): ?>
<tr style="color: red;">
<td><?= $value->tarifa()->nombre ?></td>
<td><?= $presupuesto->solapas ? "SI ($presupuesto->solapas_ancho mm.)" : "NO" ?></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td><?= $presupuesto->retractilado ? "SI" : "NO" ?></td>
<td><?= $presupuesto->marcapaginas ? "SI" : "NO" ?></td>
</tr>
<?php endforeach; ?>
<?php else: ?>
<tr style="color: red;">
<td colspan="7">Sin encuadernación</td>
</tr>
<?php endif; ?>
</table>

View File

@ -9,17 +9,15 @@
<th class="cell-50">Retractilado</th>
</tr>
<?php if (count($encuadernaciones) > 0): ?>
<?php foreach ($encuadernaciones as $key => $value): ?>
<tr style="color: red;">
<td><?= $value->tarifa()->nombre ?></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td><?= $encuadernacion->tarifa()->nombre ?></td>
<td>Plástico</td>
<td></td>
<td><?= $flags['isPlakene'] ? "SI" : "NO" ?></td>
<td><?= $plakene_tipo ?? "" ?></td>
<td><?= $encuadernacion->proveedor() ? $encuadernacion->proveedor()->nombre : "" ?></td>
<td><?= $presupuesto->retractilado ? "SI" : "NO" ?></td>
</tr>
<?php endforeach; ?>
<?php else: ?>
<tr style="color: red;">
<td colspan="7">Sin encuadernación</td>

View File

@ -3,25 +3,27 @@
<th>Encuadernacion</th>
<th class="cell-50">Pliegos</th>
<th class="cell-50">Pliegos</th>
<th class="cell-50"></th>
<th class="cell-50"><?=$presupuesto->solapas > 0 ? "Solapas" : ""?></th>
<th class="cell-50">Sobrecubierta</th>
<th class="cell-50">Guardas</th>
<th class="cell-50">Retractilado</th>
<th class="cell-50">Marcapáginas</th>
</tr>
<?php if (count($encuadernaciones) > 0): ?>
<?php foreach ($encuadernaciones as $key => $value): ?>
<tr style="color: red;">
<td><?= $value->tarifa()->nombre ?></td>
<td><?=$tareaCosido->pliego_1." de ".$tareaCosido->pliego_1_total?></td>
<td><?=$tareaCosido->pliego_2." de ".$tareaCosido->pliego_2_total?></td>
<td></td>
<td><?= $encuadernacion->tarifa()->nombre ?></td>
<td><?= $tareaCosido->pliego_1 . " de " . $tareaCosido->pliego_1_total ?></td>
<td><?= $tareaCosido->pliego_2 . " de " . $tareaCosido->pliego_2_total ?></td>
<?php if ($presupuesto->solapas > 0): ?>
<td><?= "SI ($presupuesto->solapas_ancho mm.)" ?></td>
<?php else: ?>
<td>NO</td>
<?php endif; ?>
<td><?= $presupuesto->hasSobrecubierta() ? "SI" : "NO" ?></td>
<td><?= $presupuesto->guardas ? "SI" : "NO" ?></td>
<td><?= $presupuesto->retractilado ? "SI" : "NO" ?></td>
<td><?= $presupuesto->marcapaginas ? "SI" : "NO" ?></td>
</tr>
<?php endforeach; ?>
<?php else: ?>
<tr style="color: red;">
<td colspan="7">Sin encuadernación</td>

View File

@ -1,30 +0,0 @@
<table>
<tr class="encuadernacion">
<th>Encuadernacion</th>
<th class="cell-50">Pliegos</th>
<th class="cell-50">Pliegos</th>
<th class="cell-50">Solapas</th>
<th class="cell-50">Sobrecubierta</th>
<th class="cell-50">Guardas</th>
<th class="cell-50">Retractilado</th>
<th class="cell-50">Marcapáginas</th>
</tr>
<?php if (count($encuadernaciones) > 0): ?>
<?php foreach ($encuadernaciones as $key => $value): ?>
<tr style="color: red;">
<td><?= $value->tarifa()->nombre ?></td>
<td><?=$tareaCosido->pliego_1." de ".$tareaCosido->pliego_1_total?></td>
<td><?=$tareaCosido->pliego_2." de ".$tareaCosido->pliego_2_total?></td>
<td><?= $presupuesto->solapas ? "SI ($presupuesto->solapas_ancho mm.)" : "NO" ?></td>
<td><?= $presupuesto->hasSobrecubierta() ? "SI" : "NO" ?></td>
<td><?= $presupuesto->guardas ? "SI" : "NO" ?></td>
<td><?= $presupuesto->retractilado ? "SI" : "NO" ?></td>
<td><?= $presupuesto->marcapaginas ? "SI" : "NO" ?></td>
</tr>
<?php endforeach; ?>
<?php else: ?>
<tr style="color: red;">
<td colspan="7">Sin encuadernación</td>
</tr>
<?php endif; ?>
</table>

View File

@ -1,7 +1,7 @@
<table>
<tr class="encuadernacion">
<th >Encuadernacion</th>
<th class="cell-50"></th>
<th class="cell-50"><?=$presupuesto->solapas > 0 ? "Solapas" : ""?></th>
<th class="cell-50"></th>
<th class="cell-50"></th>
<th class="cell-50">Sobrecubierta</th>
@ -10,10 +10,13 @@
<th class="cell-50">Marcapáginas</th>
</tr>
<?php if (count($encuadernaciones) > 0): ?>
<?php foreach ($encuadernaciones as $key => $value): ?>
<tr style="color: red;">
<td><?= $value->tarifa()->nombre ?></td>
<td></td>
<td><?= $encuadernacion->tarifa()->nombre ?></td>
<?php if ($encuadernacion->solapas > 0): ?>
<td><?= "SI ($presupuesto->solapas_ancho mm.)" ?></td>
<?php else: ?>
<td></td>
<?php endif; ?>
<td></td>
<td></td>
<td><?= $presupuesto->hasSobrecubierta() ? "SI" : "NO" ?></td>
@ -21,7 +24,6 @@
<td><?= $presupuesto->retractilado ? "SI" : "NO" ?></td>
<td><?= $presupuesto->marcapaginas ? "SI" : "NO" ?></td>
</tr>
<?php endforeach; ?>
<?php else: ?>
<tr style="color: red;">
<td colspan="7">Sin encuadernación</td>

View File

@ -1,30 +0,0 @@
<table>
<tr class="encuadernacion">
<th >Encuadernacion</th>
<th class="cell-50">Solapas</th>
<th class="cell-50"></th>
<th class="cell-50"></th>
<th class="cell-50">Sobrecubierta</th>
<th class="cell-50">Guardas</th>
<th class="cell-50">Retractilado</th>
<th class="cell-50">Marcapáginas</th>
</tr>
<?php if (count($encuadernaciones) > 0): ?>
<?php foreach ($encuadernaciones as $key => $value): ?>
<tr style="color: red;">
<td><?= $value->tarifa()->nombre ?></td>
<td><?= $presupuesto->solapas ? "SI ($presupuesto->solapas_ancho mm.)" : "NO" ?></td>
<td></td>
<td></td>
<td><?= $presupuesto->hasSobrecubierta() ? "SI" : "NO" ?></td>
<td><?= $presupuesto->guardas ? "SI" : "NO" ?></td>
<td><?= $presupuesto->retractilado ? "SI" : "NO" ?></td>
<td><?= $presupuesto->marcapaginas ? "SI" : "NO" ?></td>
</tr>
<?php endforeach; ?>
<?php else: ?>
<tr style="color: red;">
<td colspan="7">Sin encuadernación</td>
</tr>
<?php endif; ?>
</table>

View File

@ -1,36 +0,0 @@
<table>
<tr>
<th class="encuadernacion">Encuadernacion</th>
<th class="cell-50">Pliegos</th>
<th class="cell-50">Pliegos</th>
<th class="cell-50">Guardas</th>
<th class="cell-50">Guardas Impresion</th>
<th class="cell-50">Cabezada</th>
<th class="cell-50">Lomo</th>
</tr>
<?php if (count($encuadernaciones) > 0): ?>
<?php foreach ($encuadernaciones as $key => $value): ?>
<tr style="color: red;">
<td><?= $value->tarifa()->nombre ?></td>
<td><?=$tareaCosido->pliego_1." de ".$tareaCosido->pliego_1_total?></td>
<td><?=$tareaCosido->pliego_2." de ".$tareaCosido->pliego_2_total?></td>
<td></td>
<td></td>
<td>Color/NO</td>
<td>Recto/Redondo</td>
</tr>
<tr>
<td class="encuadernacion" colspan="1">Sobrecubierta</td>
<td style="color:red" colspan="2"><?= $linea_impresion->isSobreCubierta() ? "SI" : "NO" ?></td>
<td class="encuadernacion">Retractilado</td>
<td style="color:red"><?= $presupuesto->retractilado ? "SI" : "NO" ?></td>
<td class="encuadernacion">Marcapáginas</td>
<td style="color:red"><?= $presupuesto->marcapaginas ? "SI" : "NO" ?></td>
</tr>
<?php endforeach; ?>
<?php else: ?>
<tr style="color: red;">
<td colspan="7">Sin encuadernación</td>
</tr>
<?php endif; ?>
</table>

View File

@ -0,0 +1,48 @@
<table>
<tr>
<th class="encuadernacion">Encuadernacion</th>
<th class="cell-50">Pliegos</th>
<th class="cell-50">Pliegos</th>
<th class="cell-50">Guardas</th>
<th class="cell-50">Guardas Impresion</th>
<th class="cell-50">Cabezada</th>
<th class="cell-50">Lomo</th>
</tr>
<?php if (count($encuadernaciones) > 0): ?>
<tr style="color: red;">
<td><?= $encuadernacion->tarifa()->nombre ?></td>
<?php if ($tareaCosido): ?>
<td><?= $tareaCosido->pliego_1 . " de " . $tareaCosido->pliego_1_total ?></td>
<td><?= $tareaCosido->pliego_2 . " de " . $tareaCosido->pliego_2_total ?></td>
<?php else: ?>
<td><?= "___de___" ?></td>
<td><?= "___de___" ?></td>
<?php endif; ?>
<!-- Guardas -->
<?php if ($presupuesto->presupuestoLineaGuarda()): ?>
<td><?= $presupuesto->presupuestoLineaGuarda()->papel_generico()?->code ?></td>
<td><?= $presupuesto->presupuestoLineaGuarda()->paginas_impresion > 0 ? "SI" : "NO" ?></td>
<?php else: ?>
<td>?</td>
<td><?= $presupuesto->presupuestoLineaGuarda()->paginas_impresion > 0 ? "SI" : "NO" ?>></td>
<?php endif; ?>
<!-- Cabezada -->
<td><?= $presupuesto->cabezada ? "COLOR" : "NO" ?></td>
<!-- Lomo -->
<td><?= $presupuesto->lomo_redondo ? "REDONDO" : "RECTO" ?></td>
</tr>
<tr>
<td class="encuadernacion" colspan="1">Sobrecubierta</td>
<td style="color:red" colspan="2"><?= $linea_impresion->isSobreCubierta() ? "SI" : "NO" ?></td>
<td class="encuadernacion">Retractilado</td>
<td style="color:red"><?= $presupuesto->retractilado ? "SI" : "NO" ?></td>
<td class="encuadernacion">Marcapáginas</td>
<td style="color:red"><?= $presupuesto->marcapaginas ? "SI" : "NO" ?></td>
</tr>
<?php else: ?>
<tr style="color: red;">
<td colspan="7">Sin encuadernación</td>
</tr>
<?php endif; ?>
</table>

View File

@ -1,6 +1,6 @@
<table>
<tr class="encuadernacion">
<th >Encuadernacion</th>
<th>Encuadernacion</th>
<th class="cell-50">Guardas</th>
<th class="cell-50">Guardas Imp.</th>
<th class="cell-50">Cabezada</th>
@ -10,18 +10,27 @@
<th class="cell-50">Marcapáginas</th>
</tr>
<?php if (count($encuadernaciones) > 0): ?>
<?php foreach ($encuadernaciones as $key => $value): ?>
<tr style="color: red;">
<td><?= $value->tarifa()->nombre ?></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td><?= $encuadernacion->tarifa()->nombre ?></td>
<!-- Guardas -->
<?php if ($presupuesto->presupuestoLineaGuarda()): ?>
<td><?= $presupuesto->presupuestoLineaGuarda()->papel_generico()?->nombre ?></td>
<td><?= $presupuesto->presupuestoLineaGuarda()->paginas_impresion > 0 ? "SI" : "NO" ?>></td>
<?php else: ?>
<td>?</td>
<td><?= $presupuesto->presupuestoLineaGuarda()->paginas_impresion > 0 ? "SI" : "NO" ?>></td>
<?php endif; ?>
<!-- Cabezada -->
<td><?= $presupuesto->cabezada ? "COLOR" : "NO" ?></td>
<!-- Lomo -->
<td><?= $presupuesto->lomo_redondo ? "REDONDO" : "RECTO" ?></td>
<!-- Sobrecubierta -->
<td><?= $linea_impresion->isSobreCubierta() ? "SI" : "NO" ?></td>
<!-- Retractilado -->
<td><?= $presupuesto->retractilado ? "SI" : "NO" ?></td>
<!-- Marcapaginas -->
<td><?= $presupuesto->marcapaginas ? "SI" : "NO" ?></td>
</tr>
<?php endforeach; ?>
<?php else: ?>
<tr style="color: red;">
<td colspan="7">Sin encuadernación</td>

View File

@ -1,26 +1,21 @@
<table>
<caption>
WIO
</caption>
<tr class="encuadernacion">
<th class="cell-50">Encuadernacion</th>
<th class="cell-50">Color</th>
<th class="cell-50">Tipo</th>
<th class="cell-50">Plakenes</th>
<th class="cell-50">Plakene</th>
<th class="cell-50">Externo</th>
<th class="cell-50">Retractilado</th>
</tr>
<?php if (count($encuadernaciones) > 0): ?>
<?php foreach ($encuadernaciones as $key => $value): ?>
<tr style="color: red;">
<td><?= $value->tarifa()->nombre ?></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td><?= $encuadernacion->tarifa()->nombre ?></td>
<td>Metálico</td>
<td><?= $flags['isPlakene'] ? "SI" : "NO" ?></td>
<td><?= $plakene_tipo ?? "" ?></td>
<td><?= $encuadernacion->proveedor() ? $encuadernacion->proveedor()->nombre : "" ?></td>
<td><?= $presupuesto->retractilado ? "SI" : "NO" ?></td>
</tr>
<?php endforeach; ?>
<?php else: ?>
<tr style="color: red;">
<td colspan="7">Sin encuadernación</td>

View File

@ -10,9 +10,8 @@
<th class="cell-50">Marcapáginas</th>
</tr>
<?php if (count($encuadernaciones) > 0): ?>
<?php foreach ($encuadernaciones as $key => $value): ?>
<tr style="color: red;">
<td><?= $value->tarifa()->nombre ?></td>
<td><?= $encuadernacion->tarifa()->nombre ?></td>
<td></td>
<td></td>
<td></td>
@ -21,7 +20,6 @@
<td><?= $presupuesto->retractilado ? "SI" : "NO" ?></td>
<td><?= $presupuesto->marcapaginas ? "SI" : "NO" ?></td>
</tr>
<?php endforeach; ?>
<?php else: ?>
<tr style="color: red;">
<td colspan="7">Sin encuadernación</td>

View File

@ -0,0 +1,305 @@
<?php
use CodeIgniter\I18n\Time;
$session = session();
$settings = $session->get('settings');
?>
<!DOCTYPE html>
<html
lang="<?= $session->get('lang') ?>"
data-assets-path="<?= site_url('themes/vuexy/') ?>"
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Icons -->
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/fonts/fontawesome.css') ?>" />
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/fonts/tabler-icons.css') ?>" />
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/fonts/flag-icons.css') ?>" />
<!-- Core CSS -->
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/css/rtl/core.css') ?>" />
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/css/rtl/theme-semi-dark.css') ?>" />
<link rel="stylesheet" href="<?= site_url('themes/vuexy/css/safekat.css') ?>" />
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/css/pages/app-chat.css') ?>">
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/libs/flatpickr/flatpickr.css') ?>" />
<link rel="icon" type="image/x-icon" href="<?= site_url('themes/vuexy/img/favicon/favicon.ico') ?>" />
<link rel="stylesheet" href="<?= site_url('themes/vuexy/css/pdf.ot.css') ?>">
<title><?= $presupuesto->titulo ?>[OT:<?= $ot->id ?>]</title>
</head>
<body>
<div class="col-md-12 pdf-wrapper" data-id="<?= $ot->id . "_FERRO_" . "_" . $presupuesto->id . "_" . $presupuesto->titulo ?>">
<div class="row">
<div class="col-12 d-flex justify-content-between align-items-center">
<h5><?= $presupuesto->titulo ?></h5>
<span class="fs-medium"><strong><?= Time::now()->format("d/m/Y H:i:s") ?></strong></span>
</div>
</div>
</div>
<div class="row mb-2 d-flex flex align-items-stretch">
<div class="col-2">
<?php if ($ot->full_path): ?>
<img class="portada-img border-secondary img-thumbnail img-fluid" src="<?= $ot->full_path ? "data:image/png;base64," . base64_encode(file_get_contents($ot->full_path)) : '/assets/img/portada_not_found.png' ?>" />
<?php else: ?>
<img class="portada-img border-secondary img-thumbnail img-fluid" src="/assets/img/portada_not_found.png" />
<?php endif; ?>
</div>
<div class="col-10 py-2 rounded border-1 border-secondary" style="background-color: <?= $colors["general"]["bg"] ?>;color:<?= $colors["general"]["color"] ?>;">
<div class="row">
<div class="col-8">
<div class="px-2 d-flex flex justify-content-between align-items-center" style="background-color: <?= $colors["week_day"]["bg"] ?>;color:<?= $colors["week_day"]["color"] ?>;">
<span><strong><?= $pedido->fecha_encuadernado ? week_day_humanize(Time::createFromFormat("Y-m-d H:i:s", $pedido->fecha_encuadernado)->getDayOfWeek() - 1, true) : "" ?></strong></span>
<span><strong>Comercial:</strong> <?= $cliente->first_name . " " . $cliente->comercial()->last_name ?> </span>
</div>
</div>
<div class="col-4">
<div class="px-2 d-flex flex justify-content-center align-items-center w-100">
<span class="w-100 text-center" style="background-color: <?= $colors["impresion_interior_ppal"]["bg"] ?>;color:<?= $colors["impresion_interior_ppal"]["color"] ?>;">
<?php if ($isPOD): ?>
<strong>POD</strong>
<?php elseif ($presupuesto->presupuestoLineaImpresion()->isRotativa()): ?>
<strong>ROTATIVA</strong>
<?php else: ?>
<strong>GENERAL</strong>
<?php endif; ?>
</span>
</div>
</div>
</div>
<div class="row p-2">
<div class="col-3 h-100">
<div class="row px-2 mt-2 h-100">
<table class="h-100 bg-white">
<tr>
<th class="bg-white">IN</th>
<td class="t-cell bg-white"><?= $ubicacion ?></td>
</tr>
<tr>
<th>PORT.</th>
<td class="t-cell bg-white"><?= $ubicacion ?></td>
</tr>
<tr>
<th>ACABAD.</th>
<td class="t-cell bg-white"><?= $ubicacion ?></td>
</tr>
<tr>
<th>ENCUAD.</th>
<td class="t-cell bg-white"><?= $ubicacion ?></td>
</tr>
<tr>
<th>MANIPUL.</th>
<td class="t-cell bg-white"><?= $ubicacion ?></td>
</tr>
</table>
</div>
</div>
<div class="col-5">
<div class="row">
<div class="col-12 w-50 text-center" style="background-color: <?= $colors["ot"]["bg"] ?>;color:<?= $colors["ot"]["color"] ?>;">
<strong><?= $encuadernacionCode ?></strong>
</div>
</div>
<div class="row h-75">
<div class="col-6 square text-center" style="background-color: <?= $colors["papel_interior"]["bg"] ?>;color:<?= $colors["papel_interior"]["color"] ?>;">
<?= $linea_impresion?->papel_impresion()->papel_code_ot ?>
</div>
<div class="col-6 square text-center <?= $linea_impresion->isColor() ? "cmyk" : "bn" ?>">
<?= $tiempo_impresion ?>
</div>
<div class="col-6 square text-center" style="background-color: <?= $colors["papel_cubierta"]["bg"] ?>;color:<?= $colors["papel_cubierta"]["color"] ?>;">
<?= $linea_cubierta?->papel_impresion()->papel_code_ot ?>
</div>
<div class="col-6 square text-center" style="background-color: <?= $colors["plastificado"]["bg"] ?>;color:<?= $colors["plastificado"]["color"] ?>;">
<?= isset($acabados[0]) ? $acabados[0]->tarifa()->code : "" ?>
</div>
<?php foreach ($acabados as $key => $acabado): ?>
<?php if ($acabado->tarifa()->isUVI()): ?>
<div class="col-6 square offset-md-6 text-center" style="background-color:<?= $acabado->tarifa()->code == "R2D" ? "#4D93D9" : "#0070C0" ?>;color:white;">
+ <?= $acabado->tarifa()->code ?>
</div>
<?php endif; ?>
<?php endforeach; ?>
</div>
</div>
<div class="col-4" style="background-color: <?= $colors["ot"]["bg"] ?>">
<div class="row h-100">
<div class="col-12 h-50 d-flex flex align-items-center justify-content-center">
<span class="fs-large" style="color:<?= $colors["ot"]["color"] ?>;"><strong><?= $ot->id ?></strong></span>
</div>
<div class="col-12 h-50 d-flex flex align-items-center justify-content-center bg-white">
<img class="img-fluid" src="data:image/png;base64,<?= $ot->bar_code ?>" alt="barcode" />
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-8">
<table class="h-50">
<tr>
<th>IDSK</th>
<td class="t-cell">
</td>
</tr>
<tr>
<th>CLIENTE</th>
<td class="t-cell">
<?= $cliente->alias ?>
</td>
</tr>
<tr>
<th>TITULO</th>
<td class="t-cell">
<?= $presupuesto->titulo ?>
</td>
</tr>
<tr>
<th>ISBN</th>
<td class="t-cell"><?= $presupuesto->isbn ?></td>
</tr>
<tr>
<th>PEDIDO CLIENTE</th>
<td class="t-cell"><?= $pedido->id ?></td>
</tr>
</table>
</div>
<div class="col-4">
<div class="col-12 d-flex justify-content-center" style="width: 100%">
<?php if ($imposicion): ?>
<?php if ($imposicion->imposicion_esquema()): ?>
<?= $imposicion->imposicion_esquema()->svg_schema ?>
<?php endif; ?>
<?php endif; ?>
</div>
<div class="col-12">
<div class="imposicion">
<table>
<tr>
<th class="w-50">Imposicion</th>
<td><?= $imposicion?->full_name ?? "" ?></td>
</tr>
</table>
</div>
</div>
</div>
</div>
<div class="row mb-2">
<div class="section-title impresion">IMP. INTERIOR</div>
<div class="col-12">
<div>
<table>
<tr>
<th class="t-header" style="width: 10%;"><?= lang('Produccion.size') ?></th>
<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 text-center"> 1 </td>
<th class="t-header" style="width: 10%;"><?= lang('Produccion.tipo') ?></th>
<td class="t-cell text-center"> <?= $presupuesto->tipo_presupuesto()?->codigo ?? "" ?> </td>
<th class="t-header" style="width: 10%;"><?= lang('Produccion.lomo') ?></th>
<td class="t-cell text-center"> <?= number_format($presupuesto->lomo_cubierta, 2, ',', '.') ?> </td>
</tr>
</table>
<table>
<tr>
<td rowspan="3" class="row-logo-impresion"><img src="<?= site_url($linea_impresion->get_impresion_logo()) ?>" width="35px" height="35px"></td>
<th>Páginas</th>
<th>Ejemplares</th>
<th>Tintas</th>
<th>Formas</th>
<th>Máquina</th>
<th>Clics</th>
<th>Tiempo</th>
</tr>
<tr>
<td><?= $presupuesto->paginas ?></td> <!-- Páginas libro -->
<td> 1 </td>
<td><?= $linea_impresion->tinta() ?></td>
<td><?= json_decode($linea_impresion->formas)->formas ?></td>
<td><strong><?= $linea_impresion->maquina()->nombre ?></strong></td>
<td><?= $linea_impresion->rotativa_clicks_libro ?></td>
<td><?= float_seconds_to_hhmm_string($linea_impresion->horas_maquina * 3600 / $presupuesto->tirada) ?></td>
</tr>
<tr>
<td colspan="4"><?= $linea_impresion->papel_impresion ?></td>
<td><?= $linea_impresion->papel_impresion()->gramaje . " " . "gr" ?></td>
<td colspan="2">
<?php if ($linea_impresion->isRotativa()): ?>
<?= number_format($linea_impresion->rotativa_metros_libro, 2, ',', '.') ?> metros
<?php endif; ?>
</td>
</tr>
</table>
</div>
<div class="comments <?=$ot->comment_interior ? '' : 'd-none' ?>">
<div class="flex-row impresion">Comentarios impresión interior</div>
<div class="comment-content w-100">
<p>
<?= $ot->comment_interior ?>
</p>
</div>
</div>
</div>
</div>
<div class="row mb-2">
<div class="section-title">LOGISTICA</div>
<div class="col-12">
<table>
<tr>
<th>Peso Unidad</th>
<th>Peso Pedido</th>
<th>Corte Pie</th>
</tr>
<tr>
<td><?= number_format($peso_unidad, 2, ',', '.') ?> gr</td>
<td><?= $peso_unidad > 1000 ? number_format($peso_unidad / 1000, 2, ',', '.') . " kg" : number_format($peso_unidad, 2, ',', '.') . " gr" ?> </td>
<td>-</td>
</tr>
</table>
<div class="comments <?=$ot->comment_logistica ? '' : 'd-none' ?>">
<div class="flex-row">Comentarios logistica:</div>
<div class="comment-content">
<p>
<?= $ot->comment_logistica ?>
</p>
</div>
</div>
</div>
</div>
<div class="col-md-12 d-flex justify-content-center align-items-center">
<span class="footer">&copy; 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>
<script src="<?= site_url('themes/vuexy/vendor/libs/popper/popper.js') ?>"></script>
<script src="<?= site_url('themes/vuexy/vendor/js/bootstrap.js') ?>"></script>
<script src="<?= site_url('themes/vuexy/vendor/libs/flatpickr/flatpickr.js') ?>"></script>
<script src="<?= site_url('themes/vuexy/vendor/libs/perfect-scrollbar/perfect-scrollbar.js') ?>"></script>
<script src="<?= site_url('themes/vuexy/vendor/libs/hammer/hammer.js') ?>"></script>
<script src="<?= site_url('themes/vuexy/vendor/js/menu.js') ?>"></script>
<script src="<?= site_url('assets/js/safekat/pages/pdf/otDownload.js') ?>"></script>
</body>
</html>

View File

@ -32,376 +32,382 @@ $settings = $session->get('settings');
</head>
<body>
<div class="col-md-12 pdf-wrapper" data-id="<?= $ot->id . "_" . "_" . $presupuesto->id . "_" . $presupuesto->titulo ?>">
<div class="row">
<div class="col-12 d-flex justify-content-between align-items-center">
<h5><?= $presupuesto->titulo ?></h5>
<span class="fs-medium"><strong><?= Time::now()->format("d/m/Y H:i:s") ?></strong></span>
</div>
</div>
</div>
<div class="row mb-2 d-flex flex align-items-stretch">
<div class="col-2">
<?php if ($ot->full_path): ?>
<img class="portada-img border-secondary img-thumbnail img-fluid" src="<?= $ot->full_path ? "data:image/png;base64," . base64_encode(file_get_contents($ot->full_path)) : '/assets/img/portada_not_found.png' ?>" />
<?php else: ?>
<img class="portada-img border-secondary img-thumbnail img-fluid" src="/assets/img/portada_not_found.png" />
<?php endif; ?>
</div>
<div class="col-10 py-2 rounded border-1 border-secondary" style="background-color: <?= $colors["general"]["bg"] ?>;color:<?= $colors["general"]["color"] ?>;">
<div>
<div class="col-md-12 pdf-wrapper" data-id="<?= $ot->id . "_" . "_" . $presupuesto->id . "_" . $presupuesto->titulo ?>">
<div class="row">
<div class="col-8">
<div class="px-2 d-flex flex justify-content-between align-items-center" style="background-color: <?= $colors["week_day"]["bg"] ?>;color:<?= $colors["week_day"]["color"] ?>;">
<span><strong><?= $pedido->fecha_encuadernado ? week_day_humanize(Time::createFromFormat("Y-m-d H:i:s", $pedido->fecha_encuadernado)->getDayOfWeek() - 1, true) : "" ?></strong></span>
<span><strong>Comercial:</strong> <?= $cliente->first_name . " " . $cliente->comercial()->last_name ?> </span>
</div>
</div>
<div class="col-4">
<div class="px-2 d-flex flex justify-content-center align-items-center w-100">
<span class="w-100 text-center" style="background-color: <?= $colors["impresion_interior_ppal"]["bg"] ?>;color:<?= $colors["impresion_interior_ppal"]["color"] ?>;">
<?php if ($isPOD): ?>
<strong>POD</strong>
<?php elseif ($presupuesto->presupuestoLineaImpresion()->isRotativa()): ?>
<strong>ROTATIVA</strong>
<?php else: ?>
<strong>GENERAL</strong>
<?php endif; ?>
</span>
</div>
</div>
</div>
<div class="row p-2">
<div class="col-3 h-100">
<div class="row px-2 d-flex flex justify-content-between align-items-center">
<div class="col-6 w-100 text-center">
<span id="fecha_encuadernado_at" style="color:<?= $colors["general"]["color"] ?>;"><strong><?= $pedido->fecha_encuadernado ? Time::createFromFormat("Y-m-d H:i:s", $pedido->fecha_encuadernado)->format('d/m/Y') : "" ?></strong></span>
</div>
</div>
<div class="row px-2 mt-2 h-100">
<table class="h-100">
<tr>
<th>IN</th>
<td class="t-cell bg-white"><?= $ubicacion ?></td>
</tr>
<tr>
<th>PORT.</th>
<td class="t-cell bg-white"><?= $ubicacion ?></td>
</tr>
<tr>
<th>ACABAD.</th>
<td class="t-cell bg-white"><?= $ubicacion ?></td>
</tr>
<tr>
<th>ENCUAD.</th>
<td class="t-cell bg-white"><?= $ubicacion ?></td>
</tr>
<tr>
<th>MANIPUL.</th>
<td class="t-cell bg-white"><?= $ubicacion ?></td>
</tr>
</table>
</div>
</div>
<div class="col-5">
<div class="row">
<div class="col-12 w-50 text-center" style="background-color: <?= $colors["ot"]["bg"] ?>;color:<?= $colors["ot"]["color"] ?>;">
<strong><?= isset($encuadernaciones[0]) ? $encuadernaciones[0]->tarifa()->code ?? "" : "" ?></strong>
</div>
</div>
<div class="row h-75">
<div class="col-6 square text-center" style="background-color: <?= $colors["papel_interior"]["bg"] ?>;color:<?= $colors["papel_interior"]["color"] ?>;">
<?= $linea_impresion?->papel_impresion()->papel_code_ot ?>
</div>
<div class="col-6 square text-center <?= $linea_impresion->isColor() ? "cmyk" : "bn" ?>">
<?= $tiempo_impresion ?>
</div>
<div class="col-6 square text-center" style="background-color: <?= $colors["papel_cubierta"]["bg"] ?>;color:<?= $colors["papel_cubierta"]["color"] ?>;">
<?= $linea_cubierta?->papel_impresion()->papel_code_ot ?>
</div>
<div class="col-6 square text-center" style="background-color: <?= $colors["plastificado"]["bg"] ?>;color:<?= $colors["plastificado"]["color"] ?>;">
<?= isset($acabados[0]) ? $acabados[0]->tarifa()->code : "" ?>
</div>
<?php foreach ($acabados as $key => $acabado): ?>
<?php if ($acabado->tarifa()->isUVI()): ?>
<div class="col-6 square offset-md-6 text-center" style="background-color:<?= $acabado->tarifa()->code == "R2D" ? "#4D93D9" : "#0070C0" ?>;color:white;">
+ <?= $acabado->tarifa()->code ?>
</div>
<?php endif; ?>
<?php endforeach; ?>
</div>
</div>
<div class="col-4" style="background-color: <?= $colors["ot"]["bg"] ?>">
<div class="row h-100">
<div class="col-12 h-50 d-flex flex align-items-center justify-content-center">
<span class="fs-large" style="color:<?= $colors["ot"]["color"] ?>;"><strong><?= $ot->id ?></strong></span>
</div>
<div class="col-12 h-50 d-flex flex align-items-center justify-content-center bg-white">
<img class="img-fluid" src="data:image/png;base64,<?= $ot->bar_code ?>" alt="barcode" />
</div>
</div>
<div class="col-12 d-flex justify-content-between align-items-center">
<h5><?= $presupuesto->titulo ?></h5>
<span class="fs-medium"><strong><?= Time::now()->format("d/m/Y H:i:s") ?></strong></span>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-8">
<table class="h-50">
<tr>
<th>IDSK</th>
<td class="t-cell">
<div class="row mb-2 d-flex flex align-items-stretch">
<div class="col-2">
<?php if ($ot->full_path): ?>
<img class="portada-img border-secondary img-thumbnail img-fluid" src="<?= $ot->full_path ? "data:image/png;base64," . base64_encode(file_get_contents($ot->full_path)) : '/assets/img/portada_not_found.png' ?>" />
<?php else: ?>
<img class="portada-img border-secondary img-thumbnail img-fluid" src="/assets/img/portada_not_found.png" />
</td>
</tr>
<tr>
<th>CLIENTE</th>
<td class="t-cell">
<?= $cliente->alias ?>
</td>
</tr>
<tr>
<th>TITULO</th>
<td class="t-cell">
<?= $presupuesto->titulo ?>
</td>
</tr>
<tr>
<th>ISBN</th>
<td class="t-cell"><?= $presupuesto->isbn ?></td>
</tr>
<tr>
<th>PEDIDO CLIENTE</th>
<td class="t-cell"><?= $pedido->id ?></td>
</tr>
</table>
</div>
<div class="col-4">
<div class="col-12 d-flex justify-content-center" style="width: 100%">
<?php if ($imposicion): ?>
<?php if ($imposicion->imposicion_esquema()): ?>
<?= $imposicion->imposicion_esquema()->svg_schema ?>
<?php endif; ?>
<?php endif; ?>
</div>
<div class="col-12">
<div class="imposicion">
<table>
<tr>
<th class="w-50">Imposicion</th>
<td><?= $imposicion?->full_name ?? "" ?></td>
</tr>
</table>
<div class="col-10 py-2 rounded border-1 border-secondary" style="background-color: <?= $colors["general"]["bg"] ?>;color:<?= $colors["general"]["color"] ?>;">
<div class="row">
<div class="col-8">
<div class="px-2 d-flex flex justify-content-between align-items-center" style="background-color: <?= $colors["week_day"]["bg"] ?>;color:<?= $colors["week_day"]["color"] ?>;">
<span><strong><?= $pedido->fecha_encuadernado ? week_day_humanize(Time::createFromFormat("Y-m-d H:i:s", $pedido->fecha_encuadernado)->getDayOfWeek() - 1, true) : "" ?></strong></span>
<span><strong>Comercial:</strong> <?= $cliente->first_name . " " . $cliente->comercial()->last_name ?> </span>
</div>
</div>
<div class="col-4">
<div class="px-2 d-flex flex justify-content-center align-items-center w-100">
<span class="w-100 text-center" style="background-color: <?= $colors["impresion_interior_ppal"]["bg"] ?>;color:<?= $colors["impresion_interior_ppal"]["color"] ?>;">
<?php if ($isPOD): ?>
<strong>POD</strong>
<?php elseif ($presupuesto->presupuestoLineaImpresion()->isRotativa()): ?>
<strong>ROTATIVA</strong>
<?php else: ?>
<strong>GENERAL</strong>
<?php endif; ?>
</span>
</div>
</div>
</div>
<div class="row p-2">
<div class="col-3 h-100">
<div class="row px-2 d-flex flex justify-content-between align-items-center">
<div class="col-6 w-100 text-center">
<span id="fecha_encuadernado_at" style="color:<?= $colors["general"]["color"] ?>;"><strong><?= $pedido->fecha_encuadernado ? Time::createFromFormat("Y-m-d H:i:s", $pedido->fecha_encuadernado)->format('d/m/Y') : "" ?></strong></span>
</div>
</div>
<div class="row px-2 mt-2 h-100">
<table class="h-100 bg-white">
<tr>
<th class="bg-white">IN</th>
<td class="t-cell bg-white"><?= $ubicacion ?></td>
</tr>
<tr>
<th>PORT.</th>
<td class="t-cell bg-white"><?= $ubicacion ?></td>
</tr>
<tr>
<th>ACABAD.</th>
<td class="t-cell bg-white"><?= $ubicacion ?></td>
</tr>
<tr>
<th>ENCUAD.</th>
<td class="t-cell bg-white"><?= $ubicacion ?></td>
</tr>
<tr>
<th>MANIPUL.</th>
<td class="t-cell bg-white"><?= $ubicacion ?></td>
</tr>
</table>
</div>
</div>
<div class="col-5">
<div class="row">
<div class="col-12 w-50 text-center" style="background-color: <?= $colors["ot"]["bg"] ?>;color:<?= $colors["ot"]["color"] ?>;">
<strong><?= $encuadernacionCode ?></strong>
</div>
</div>
<div class="row h-75">
<div class="col-6 square text-center" style="background-color: <?= $colors["papel_interior"]["bg"] ?>;color:<?= $colors["papel_interior"]["color"] ?>;">
<?= $linea_impresion?->papel_impresion()->papel_code_ot ?>
</div>
<div class="col-6 square text-center <?= $linea_impresion->isColor() ? "cmyk" : "bn" ?>">
<?= $tiempo_impresion ?>
</div>
<div class="col-6 square text-center" style="background-color: <?= $colors["papel_cubierta"]["bg"] ?>;color:<?= $colors["papel_cubierta"]["color"] ?>;">
<?= $linea_cubierta?->papel_impresion()->papel_code_ot ?>
</div>
<div class="col-6 square text-center" style="background-color: <?= $colors["plastificado"]["bg"] ?>;color:<?= $colors["plastificado"]["color"] ?>;">
<?= isset($acabados[0]) ? $acabados[0]->tarifa()->code : "" ?>
</div>
<?php foreach ($acabados as $key => $acabado): ?>
<?php if ($acabado->tarifa()->isUVI()): ?>
<div class="col-6 square offset-md-6 text-center" style="background-color:<?= $acabado->tarifa()->code == "R2D" ? "#4D93D9" : "#0070C0" ?>;color:white;">
+ <?= $acabado->tarifa()->code ?>
</div>
<?php endif; ?>
<?php endforeach; ?>
</div>
</div>
<div class="col-4" style="background-color: <?= $colors["ot"]["bg"] ?>">
<div class="row h-100">
<div class="col-12 h-50 d-flex flex align-items-center justify-content-center">
<span class="fs-large" style="color:<?= $colors["ot"]["color"] ?>;"><strong><?= $ot->id ?></strong></span>
</div>
<div class="col-12 h-50 d-flex flex align-items-center justify-content-center bg-white">
<img class="img-fluid" src="data:image/png;base64,<?= $ot->bar_code ?>" alt="barcode" />
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row mb-2">
<div class="section-title impresion">IMP. INTERIOR</div>
<div class="col-12">
<div>
<table>
<div class="row">
<div class="col-8">
<table class="h-50">
<tr>
<th class="t-header" style="width: 10%;"><?= lang('Produccion.size') ?></th>
<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 text-center"> <?= $presupuesto->tirada ?> + <?= $presupuesto->merma ?> </td>
<th class="t-header" style="width: 10%;"><?= lang('Produccion.tipo') ?></th>
<td class="t-cell text-center"> <?= $presupuesto->tipo_presupuesto()?->codigo ?? "" ?> </td>
<th class="t-header" style="width: 10%;"><?= lang('Produccion.lomo') ?></th>
<td class="t-cell text-center"> <?= number_format($presupuesto->lomo_cubierta, 2, ',', '.') ?> </td>
</tr>
</table>
<table>
<tr>
<td rowspan="3" class="row-logo-impresion"><img src="<?= site_url($linea_impresion->get_impresion_logo()) ?>" width="35px" height="35px"></td>
<th>Páginas</th>
<th>Ejemplares</th>
<th>Tintas</th>
<th>Formas</th>
<th>Máquina</th>
<th>Clics</th>
<th>Tiempo</th>
<th>IDSK</th>
<td class="t-cell">
</td>
</tr>
<tr>
<td><?= $presupuesto->paginas ?></td> <!-- Páginas libro -->
<td><?= $presupuesto->tirada ?> </td>
<td><?= $linea_impresion->tinta() ?></td>
<td><?= json_decode($linea_impresion->formas)->formas ?></td>
<td><strong><?= $linea_impresion->maquina()->nombre ?></strong></td>
<td><?= $linea_impresion->rotativa_clicks_total ?></td>
<td><?= float_seconds_to_hhmm_string($linea_impresion->horas_maquina * 3600) ?></td>
<th>CLIENTE</th>
<td class="t-cell">
<?= $cliente->alias ?>
</td>
</tr>
<tr>
<td colspan="4"><?= $linea_impresion->papel_impresion ?></td>
<td><?= $linea_impresion->papel_impresion()->gramaje . " " . "gr" ?></td>
<td colspan="2">
<?php if ($linea_impresion->isRotativa()): ?>
<?= number_format($linea_impresion->rotativa_metros_total, 2, ',', '.') ?> metros
<?php endif; ?>
<th>TITULO</th>
<td class="t-cell">
<?= $presupuesto->titulo ?>
</td>
</tr>
<tr>
<th>ISBN</th>
<td class="t-cell"><?= $presupuesto->isbn ?></td>
</tr>
<tr>
<th>PEDIDO CLIENTE</th>
<td class="t-cell"><?= $pedido->id ?></td>
</tr>
</table>
</div>
<div class="comments">
<div class="flex-row impresion">Comentarios impresión interior</div>
<div class="comment-content w-100">
<p>
</p>
<br />
<p>
</p>
<div class="col-4">
<div class="col-12 d-flex justify-content-center" style="width: 100%">
<?php if ($imposicion): ?>
<?php if ($imposicion->imposicion_esquema()): ?>
<?= $imposicion->imposicion_esquema()->svg_schema ?>
<?php endif; ?>
<?php endif; ?>
</div>
<div class="col-12">
<div class="imposicion">
<table>
<tr>
<th class="w-50">Imposicion</th>
<td><?= $imposicion?->full_name ?? "" ?></td>
</tr>
</table>
</div>
</div>
</div>
</div>
</div>
<?php if ($linea_cubierta): ?>
<div class="row mb-2">
<div class="section-title cubierta">IMP. CUBIERTA</div>
<div class="section-title impresion">IMP. INTERIOR</div>
<div class="col-12">
<div>
<table>
<tr>
<th class="t-header" style="width: 10%;"><?= lang('Produccion.size') ?></th>
<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 text-center"> <?= $presupuesto->tirada ?> + <?= $presupuesto->merma ?> </td>
<th class="t-header" style="width: 10%;"><?= lang('Produccion.tipo') ?></th>
<td class="t-cell text-center"> <?= $presupuesto->tipo_presupuesto()?->codigo ?? "" ?> </td>
<th class="t-header" style="width: 10%;"><?= lang('Produccion.lomo') ?></th>
<td class="t-cell text-center"> <?= number_format($presupuesto->lomo_cubierta, 2, ',', '.') ?> </td>
</tr>
</table>
<table>
<tr>
<td rowspan="3" class="row-logo-impresion"><img src="<?= site_url($linea_impresion->get_impresion_logo()) ?>" width="35px" height="35px"></td>
<th>Páginas</th>
<th>Ejemplares</th>
<th>Tintas</th>
<th>Formas</th>
<th>Máquina</th>
<th>Clics</th>
<th>Tiempo</th>
</tr>
<tr>
<td><?= $presupuesto->paginas ?></td> <!-- Páginas libro -->
<td><?= $presupuesto->tirada ?> </td>
<td><?= $linea_impresion->tinta() ?></td>
<td><?= json_decode($linea_impresion->formas)->formas ?></td>
<td><strong><?= $linea_impresion->maquina()->nombre ?></strong></td>
<td><?= $linea_impresion->rotativa_clicks_total ?></td>
<td><?= float_seconds_to_hhmm_string($linea_impresion->horas_maquina * 3600) ?></td>
</tr>
<tr>
<td colspan="4"><?= $linea_impresion->papel_impresion ?></td>
<td><?= $linea_impresion->papel_impresion()->gramaje . " " . "gr" ?></td>
<td colspan="2">
<?php if ($linea_impresion->isRotativa()): ?>
<?= number_format($linea_impresion->rotativa_metros_total, 2, ',', '.') ?> metros
<?php endif; ?>
</td>
</tr>
</table>
</div>
<div class="comments <?=$ot->comment_interior ? '' : 'd-none' ?>">
<div class="flex-row impresion"><?= lang('Produccion.comentariosImpresionInterior') ?></div>
<div class=" w-100">
<p>
<?= $ot->comment_interior ?>
</p>
</div>
</div>
</div>
</div>
<?php if ($linea_cubierta): ?>
<div class="row mb-2">
<div class="section-title cubierta">IMP. CUBIERTA</div>
<div class="col-12">
<table>
<tr>
<td rowspan="3" class="row-logo-impresion"><img src="<?= site_url($linea_cubierta->get_impresion_logo()) ?>" width="35px" height="35px"></td>
<th>Tintas</th>
<th>Ejemplares</th>
<th>Maquina</th>
<th>Marcapaginas</th>
<th>Tiempo</th>
</tr>
<tr>
<td><?= $linea_cubierta->tinta() ?></td>
<td><?= $presupuesto->tirada ?></td>
<td><strong><?= $linea_cubierta->maquina()->nombre ?></strong></td>
<td><?= $presupuesto->marcapaginas ? "SI" : "NO" ?></td>
<td><?= float_seconds_to_hhmm_string($linea_cubierta->horas_maquina * 3600) ?></td>
</tr>
<tr>
<td colspan="1"><?= json_decode($linea_cubierta->formas)->maquina_ancho ?>x<?= json_decode($linea_cubierta->formas)->maquina_alto ?></td>
<td colspan="1"><?= $papel_formato->ancho ?>x<?= $papel_formato->alto ?></td>
<td colspan="2"><?= $linea_cubierta->papel_impresion ?></td>
<td colspan="2"><?= $linea_cubierta->papel_impresion()->gramaje . " " . "gr" ?></td>
</tr>
</table>
<div class="comments <?=$ot->comment_cubierta ? '' : 'd-none' ?>">
<div class="flex-row cubierta"><?= lang('Produccion.comentariosCubierta') ?></div>
<div class="">
<p>
<?= $ot->comment_cubierta ?>
</p>
</div>
</div>
</div>
</div>
<?php endif; ?>
<div class="row">
<div class="section-title encuadernacion">ACABADOS/ENCUADERNACIÓN</div>
<div class="col-12">
<div class="col-1 w-10 mb-2 text-center" style="background-color: <?= $colors["ot"]["bg"] ?>;color:<?= $colors["ot"]["color"] ?>;">
<span class="fs-bold"><?= $encuadernacionCode ?></span>
</div>
<table>
<?php foreach ($acabados as $key => $acabado): ?>
<tr>
<td class="w-10 encuadernacion">Plastificado</td>
<td><?= $acabado->tarifa()->nombre ?></td>
<td class="encuadernacion bg-encuadernacion" style="width: 100px;">UVI</td>
<td style="color:red;width:100px" class="bg-encuadernacion"> <?= $uvi ? 'SI' : "NO" ?> </td>
<td class="encuadernacion bg-encuadernacion" style="width: 100px;">EXTERNO:</td>
<td class="bg-encuadernacion" style="width: 100px;"><?= $acabado->proveedor() ? $acabado->proveedor()->nombre : "" ?></td>
</tr>
<tr>
<td class="text-start" colspan="2"><?=$ot->info_solapa_guillotina?></td>
<td></td>
<td></td>
<td class="t-header">CORTE PIE:</td>
<td></td>
</tr>
<?php endforeach; ?>
</table>
<?php
foreach ($encuadernaciones as $key => $encuadernacion) {
$encuadernacion_code = $encuadernacion->tarifa()->code;
try {
if ($encuadernacion_code) {
echo view("/themes/vuexy/pdfs/encuadernados/$encuadernacion_code.php", ["encuadernacion" => $encuadernacion]);
} else {
echo view("/themes/vuexy/pdfs/encuadernados/default.php", ["encuadernacion" => $encuadernacion]);
}
} catch (\Throwable $th) {
$error_message = $th->getMessage();
echo "<span style='color:red'>No se ha podido renderizar la tabla de encuadernación</span>";
// echo "<br><span style='color:red'>$error_message</span>";
}
}
?>
<?php if (count($encuadernaciones) > 0): ?>
<div class="comments <?=$ot->comment_encuadernacion ? '' : 'd-none' ?>" >
<div class="flex-row encuadernacion"><?= lang('Produccion.comentariosEncuadernacion') ?></div>
<div class="">
<p>
<?= $ot->comment_encuadernacion ?>
</p>
</div>
</div>
<?php endif; ?>
</div>
</div>
<div class="row mb-2">
<div class="section-title">LOGISTICA</div>
<div class="col-12">
<table>
<tr>
<td rowspan="3" class="row-logo-impresion"><img src="<?= site_url($linea_cubierta->get_impresion_logo()) ?>" width="35px" height="35px"></td>
<th>Tintas</th>
<th>Ejemplares</th>
<th>Maquina</th>
<th>Marcapaginas</th>
<th>Tiempo</th>
<th>Peso Unidad</th>
<th>Peso Pedido</th>
<th>Cajas</th>
<th>Corte Pie</th>
</tr>
<tr>
<td><?= $linea_cubierta->tinta() ?></td>
<td><?= $presupuesto->tirada ?></td>
<td><strong><?= $linea_cubierta->maquina()->nombre ?></strong></td>
<td><?= $presupuesto->marcapaginas ? "SI" : "NO" ?></td>
<td><?= float_seconds_to_hhmm_string($linea_cubierta->horas_maquina * 3600) ?></td>
</tr>
<tr>
<td colspan="1"><?= json_decode($linea_cubierta->formas)->maquina_ancho ?>x<?= json_decode($linea_cubierta->formas)->maquina_alto ?></td>
<td colspan="1"><?= $papel_formato->ancho ?>x<?= $papel_formato->alto ?></td>
<td colspan="2"><?= $linea_cubierta->papel_impresion ?></td>
<td colspan="2"><?= $linea_cubierta->papel_impresion()->gramaje . " " . "gr" ?></td>
<td><?= number_format($peso_unidad, 2, ',', '.') ?> gr</td>
<td><?= $peso_pedido > 1000 ? number_format($peso_pedido / 1000, 2, ',', '.') . " kg" : number_format($peso_pedido, 2, ',', '.') . " gr" ?> </td>
<td>-</td>
<td>-</td>
</tr>
</table>
<div class="comments">
<div class="flex-row cubierta">Comentarios cubierta</div>
<div class="comment-content">
<div class="comments <?=$ot->comment_logistica ? '' : 'd-none' ?>">
<div class="flex-row logistica"><?= lang('Produccion.comentariosLogistica') ?></div>
<div class="">
<p>
<?= $ot->comment_logistica ?>
</p>
</div>
</div>
</div>
</div>
<?php endif; ?>
<div class="row mb-2">
<div class="section-title encuadernacion">ENCUADERNACIÓN</div>
<div class="col-12">
<div class="col-1 w-10 mb-2 text-center" style="background-color: <?= $colors["ot"]["bg"] ?>;color:<?= $colors["ot"]["color"] ?>;">
<span class="fs-bold"><?= isset($encuadernaciones[0]) ? $encuadernaciones[0]->tarifa()->code ?? "" : "" ?></span>
</div>
<table>
<tr>
<td class="w-10 encuadernacion">Plastificado</td>
<td><?= $acabados[0]->tarifa()->nombre ?></td>
<td class="encuadernacion bg-encuadernacion" style="width: 100px;">UVI</td>
<td style="color:red;width:100px" class="bg-encuadernacion"> <?= $uvi ? 'SI' : "NO" ?> </td>
<td class="encuadernacion bg-encuadernacion" style="width: 100px;">EXTERNO:</td>
<td class="bg-encuadernacion" style="width: 100px;"></td>
</tr>
<tr>
<td class="text-start" colspan="2">Meter datos de solapas y preparación guillotina</td>
<td></td>
<td></td>
<td class="t-header">CORTE PIE:</td>
<td></td>
</tr>
</table>
<?php
foreach ($encuadernaciones as $key => $encuadernacion) {
$encuadernacion_code = $encuadernacion->tarifa()->code;
try {
if ($encuadernacion_code) {
echo view("/themes/vuexy/pdfs/encuadernados/$encuadernacion_code.php");
} else {
echo view("/themes/vuexy/pdfs/encuadernados/default.php");
}
} catch (\Throwable $th) {
$error_message = $th->getMessage();
echo view("/themes/vuexy/pdfs/encuadernados/default.php");
echo "<span style='color:red'>No se ha podido renderizar la tabla de encuadernación</span>";
// echo "<br><span style='color:red'>$error_message</span>";
}
}
?>
<?php if (count($encuadernaciones) > 0): ?>
<div class="comments">
<div class="flex-row encuadernacion">Comentarios encuadernacion:</div>
<div class="comment-content">
<p>
</p>
</div>
</div>
<?php endif; ?>
<div class="col-md-12 d-flex justify-content-center align-items-center">
<span class="footer">&copy; 2024 SAFEKAT. Todos los derechos reservados.</span>
</div>
</div>
<div class="row mb-2">
<div class="section-title">LOGISTICA</div>
<div class="col-12">
<table>
<tr>
<th>Peso Unidad</th>
<th>Peso Pedido</th>
<th>Cajas</th>
<th>Corte Pie</th>
</tr>
<tr>
<td><?= number_format($peso_unidad, 2, ',', '.') ?> gr</td>
<td><?= $peso_pedido > 1000 ? number_format($peso_pedido / 1000, 2, ',', '.') . " kg" : number_format($peso_pedido, 2, ',', '.') . " gr" ?> </td>
<td>-</td>
<td>-</td>
</tr>
</table>
<div class="comments">
<div class="flex-row">Comentarios logistica:</div>
<div class="comment-content">
<p>
</p>
</div>
</div>
</div>
</div>
<div class="col-md-12 d-flex justify-content-center align-items-center">
<span class="footer">&copy; 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>
<script src="<?= site_url('themes/vuexy/vendor/libs/popper/popper.js') ?>"></script>
<script src="<?= site_url('themes/vuexy/vendor/js/bootstrap.js') ?>"></script>
<script src="<?= site_url('themes/vuexy/vendor/libs/flatpickr/flatpickr.js') ?>"></script>
<script src="<?= site_url('themes/vuexy/vendor/libs/perfect-scrollbar/perfect-scrollbar.js') ?>"></script>
<script src="<?= site_url('themes/vuexy/vendor/libs/hammer/hammer.js') ?>"></script>
<script src="<?= site_url('themes/vuexy/vendor/js/menu.js') ?>"></script>
<script src="<?= site_url('assets/js/safekat/pages/pdf/otDownload.js') ?>"></script>
</div>
</body>
<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>
<script src="<?= site_url('themes/vuexy/vendor/libs/popper/popper.js') ?>"></script>
<script src="<?= site_url('themes/vuexy/vendor/js/bootstrap.js') ?>"></script>
<script src="<?= site_url('themes/vuexy/vendor/libs/flatpickr/flatpickr.js') ?>"></script>
<script src="<?= site_url('themes/vuexy/vendor/libs/perfect-scrollbar/perfect-scrollbar.js') ?>"></script>
<script src="<?= site_url('themes/vuexy/vendor/libs/hammer/hammer.js') ?>"></script>
<script src="<?= site_url('themes/vuexy/vendor/js/menu.js') ?>"></script>
<script src="<?= site_url('assets/js/safekat/pages/pdf/otDownload.js') ?>"></script>
</html>

View File

@ -0,0 +1,410 @@
<?php
use CodeIgniter\I18n\Time;
$session = session();
$settings = $session->get('settings');
?>
<!DOCTYPE html>
<html
lang="<?= $session->get('lang') ?>"
data-assets-path="<?= site_url('themes/vuexy/') ?>"
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Icons -->
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/fonts/fontawesome.css') ?>" />
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/fonts/tabler-icons.css') ?>" />
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/fonts/flag-icons.css') ?>" />
<!-- Core CSS -->
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/css/rtl/core.css') ?>" />
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/css/rtl/theme-semi-dark.css') ?>" />
<link rel="stylesheet" href="<?= site_url('themes/vuexy/css/safekat.css') ?>" />
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/css/pages/app-chat.css') ?>">
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/libs/flatpickr/flatpickr.css') ?>" />
<link rel="icon" type="image/x-icon" href="<?= site_url('themes/vuexy/img/favicon/favicon.ico') ?>" />
<link rel="stylesheet" href="<?= site_url('themes/vuexy/css/pdf.ot.css') ?>">
<title><?= $presupuesto->titulo ?>[OT:<?= $ot->id ?>]</title>
</head>
<body>
<div class="col-md-12 pdf-wrapper" data-id="<?= $ot->id . "_PROTOTIPO_" . "_" . $presupuesto->id . "_" . $presupuesto->titulo ?>">
<div class="row">
<div class="col-12 d-flex justify-content-between align-items-center">
<h5><?= $presupuesto->titulo ?></h5>
<span class="fs-medium"><strong><?= Time::now()->format("d/m/Y H:i:s") ?></strong></span>
</div>
</div>
</div>
<div class="row mb-2 d-flex flex align-items-stretch">
<div class="col-2">
<?php if ($ot->full_path): ?>
<img class="portada-img border-secondary img-thumbnail img-fluid" src="<?= $ot->full_path ? "data:image/png;base64," . base64_encode(file_get_contents($ot->full_path)) : '/assets/img/portada_not_found.png' ?>" />
<?php else: ?>
<img class="portada-img border-secondary img-thumbnail img-fluid" src="/assets/img/portada_not_found.png" />
<?php endif; ?>
</div>
<div class="col-10 py-2 rounded border-1 border-secondary" style="background-color: <?= $colors["general"]["bg"] ?>;color:<?= $colors["general"]["color"] ?>;">
<div class="row">
<div class="col-8">
<div class="px-2 d-flex flex justify-content-between align-items-center" style="background-color: <?= $colors["week_day"]["bg"] ?>;color:<?= $colors["week_day"]["color"] ?>;">
<span><strong><?= $pedido->fecha_encuadernado ? week_day_humanize(Time::createFromFormat("Y-m-d H:i:s", $pedido->fecha_encuadernado)->getDayOfWeek() - 1, true) : "" ?></strong></span>
<span><strong>Comercial:</strong> <?= $cliente->first_name . " " . $cliente->comercial()->last_name ?> </span>
</div>
</div>
<div class="col-4">
<div class="px-2 d-flex flex justify-content-center align-items-center w-100">
<span class="w-100 text-center" style="background-color: <?= $colors["impresion_interior_ppal"]["bg"] ?>;color:<?= $colors["impresion_interior_ppal"]["color"] ?>;">
<?php if ($isPOD): ?>
<strong>POD</strong>
<?php elseif ($presupuesto->presupuestoLineaImpresion()->isRotativa()): ?>
<strong>ROTATIVA</strong>
<?php else: ?>
<strong>GENERAL</strong>
<?php endif; ?>
</span>
</div>
</div>
</div>
<div class="row p-2">
<div class="col-3 h-100">
<div class="row px-2 d-flex flex justify-content-between align-items-center">
<div class="col-6 w-100 text-center">
<span id="fecha_encuadernado_at" style="color:<?= $colors["general"]["color"] ?>;"><strong><?= $pedido->fecha_encuadernado ? Time::createFromFormat("Y-m-d H:i:s", $pedido->fecha_encuadernado)->format('d/m/Y') : "" ?></strong></span>
</div>
</div>
<div class="row px-2 mt-2 h-100">
<table class="h-100 bg-white">
<tr>
<th class="bg-white">IN</th>
<td class="t-cell bg-white"><?= $ubicacion ?></td>
</tr>
<tr>
<th>PORT.</th>
<td class="t-cell bg-white"><?= $ubicacion ?></td>
</tr>
<tr>
<th>ACABAD.</th>
<td class="t-cell bg-white"><?= $ubicacion ?></td>
</tr>
<tr>
<th>ENCUAD.</th>
<td class="t-cell bg-white"><?= $ubicacion ?></td>
</tr>
<tr>
<th>MANIPUL.</th>
<td class="t-cell bg-white"><?= $ubicacion ?></td>
</tr>
</table>
</div>
</div>
<div class="col-5">
<div class="row">
<div class="col-12 w-50 text-center" style="background-color: <?= $colors["ot"]["bg"] ?>;color:<?= $colors["ot"]["color"] ?>;">
<strong><?= $encuadernacionCode ?></strong>
</div>
</div>
<div class="row h-75">
<div class="col-6 square text-center" style="background-color: <?= $colors["papel_interior"]["bg"] ?>;color:<?= $colors["papel_interior"]["color"] ?>;">
<?= $linea_impresion?->papel_impresion()->papel_code_ot ?>
</div>
<div class="col-6 square text-center <?= $linea_impresion->isColor() ? "cmyk" : "bn" ?>">
<?= $tiempo_impresion ?>
</div>
<div class="col-6 square text-center" style="background-color: <?= $colors["papel_cubierta"]["bg"] ?>;color:<?= $colors["papel_cubierta"]["color"] ?>;">
<?= $linea_cubierta?->papel_impresion()->papel_code_ot ?>
</div>
<div class="col-6 square text-center" style="background-color: <?= $colors["plastificado"]["bg"] ?>;color:<?= $colors["plastificado"]["color"] ?>;">
<?= isset($acabados[0]) ? $acabados[0]->tarifa()->code : "" ?>
</div>
<?php foreach ($acabados as $key => $acabado): ?>
<?php if ($acabado->tarifa()->isUVI()): ?>
<div class="col-6 square offset-md-6 text-center" style="background-color:<?= $acabado->tarifa()->code == "R2D" ? "#4D93D9" : "#0070C0" ?>;color:white;">
+ <?= $acabado->tarifa()->code ?>
</div>
<?php endif; ?>
<?php endforeach; ?>
</div>
</div>
<div class="col-4" style="background-color: <?= $colors["ot"]["bg"] ?>">
<div class="row h-100">
<div class="col-12 h-50 d-flex flex align-items-center justify-content-center">
<span class="fs-large" style="color:<?= $colors["ot"]["color"] ?>;"><strong><?= $ot->id ?></strong></span>
</div>
<div class="col-12 h-50 d-flex flex align-items-center justify-content-center bg-white">
<img class="img-fluid" src="data:image/png;base64,<?= $ot->bar_code ?>" alt="barcode" />
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-8">
<table class="h-50">
<tr>
<th>IDSK</th>
<td class="t-cell">
</td>
</tr>
<tr>
<th>CLIENTE</th>
<td class="t-cell">
<?= $cliente->alias ?>
</td>
</tr>
<tr>
<th>TITULO</th>
<td class="t-cell">
<?= $presupuesto->titulo ?>
</td>
</tr>
<tr>
<th>ISBN</th>
<td class="t-cell"><?= $presupuesto->isbn ?></td>
</tr>
<tr>
<th>PEDIDO CLIENTE</th>
<td class="t-cell"><?= $pedido->id ?></td>
</tr>
</table>
</div>
<div class="col-4">
<div class="col-12 d-flex justify-content-center" style="width: 100%">
<?php if ($imposicion): ?>
<?php if ($imposicion->imposicion_esquema()): ?>
<?= $imposicion->imposicion_esquema()->svg_schema ?>
<?php endif; ?>
<?php endif; ?>
</div>
<div class="col-12">
<div class="imposicion">
<table>
<tr>
<th class="w-50">Imposicion</th>
<td><?= $imposicion?->full_name ?? "" ?></td>
</tr>
</table>
</div>
</div>
</div>
</div>
<div class="row mb-2">
<div class="section-title impresion">IMP. INTERIOR</div>
<div class="col-12">
<div>
<table>
<tr>
<th class="t-header" style="width: 10%;"><?= lang('Produccion.size') ?></th>
<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 text-center"> <?= $presupuesto->tirada/$presupuesto->tirada ?> </td>
<th class="t-header" style="width: 10%;"><?= lang('Produccion.tipo') ?></th>
<td class="t-cell text-center"> <?= $presupuesto->tipo_presupuesto()?->codigo ?? "" ?> </td>
<th class="t-header" style="width: 10%;"><?= lang('Produccion.lomo') ?></th>
<td class="t-cell text-center"> <?= number_format($presupuesto->lomo_cubierta, 2, ',', '.') ?> </td>
</tr>
</table>
<table>
<tr>
<td rowspan="3" class="row-logo-impresion"><img src="<?= site_url($linea_impresion->get_impresion_logo()) ?>" width="35px" height="35px"></td>
<th>Páginas</th>
<th>Ejemplares</th>
<th>Tintas</th>
<th>Formas</th>
<th>Máquina</th>
<th>Clics</th>
<th>Tiempo</th>
</tr>
<tr>
<td><?= $presupuesto->paginas ?></td> <!-- Páginas libro -->
<td><?= $presupuesto->tirada / $presupuesto->tirada ?> </td>
<td><?= $linea_impresion->tinta() ?></td>
<td><?= json_decode($linea_impresion->formas)->formas ?></td>
<td><strong><?= $linea_impresion->maquina()->nombre ?></strong></td>
<td><?= $linea_impresion->rotativa_clicks_libro ?></td>
<td><?= float_seconds_to_hhmm_string($linea_impresion->horas_maquina * 3600 / $presupuesto->tirada) ?></td>
</tr>
<tr>
<td colspan="4"><?= $linea_impresion->papel_impresion ?></td>
<td><?= $linea_impresion->papel_impresion()->gramaje . " " . "gr" ?></td>
<td colspan="2">
<?php if ($linea_impresion->isRotativa()): ?>
<?= number_format($linea_impresion->rotativa_metros_libro, 2, ',', '.') ?> metros
<?php endif; ?>
</td>
</tr>
</table>
</div>
<div class="comments <?=$ot->comment_interior ? '' : 'd-none' ?>">
<div class="flex-row impresion"><?= lang('Produccion.comentariosImpresionInterior') ?></div>
<div class="comment-content w-100">
<p>
<?= $ot->comment_interior ?>
</p>
</div>
</div>
</div>
</div>
<?php if ($linea_cubierta): ?>
<div class="row mb-2">
<div class="section-title cubierta">IMP. CUBIERTA</div>
<div class="col-12">
<table>
<tr>
<td rowspan="3" class="row-logo-impresion"><img src="<?= site_url($linea_cubierta->get_impresion_logo()) ?>" width="35px" height="35px"></td>
<th>Tintas</th>
<th>Ejemplares</th>
<th>Maquina</th>
<th>Marcapaginas</th>
<th>Tiempo</th>
</tr>
<tr>
<td><?= $linea_cubierta->tinta() ?></td>
<td><?= $presupuesto->tirada/$presupuesto->tirada ?></td>
<td><strong><?= $linea_cubierta->maquina()->nombre ?></strong></td>
<td><?= $presupuesto->marcapaginas ? "SI" : "NO" ?></td>
<td><?= float_seconds_to_hhmm_string($linea_cubierta->horas_maquina * 3600/$presupuesto->tirada) ?></td>
</tr>
<tr>
<td colspan="1"><?= json_decode($linea_cubierta->formas)->maquina_ancho ?>x<?= json_decode($linea_cubierta->formas)->maquina_alto ?></td>
<td colspan="1"><?= $papel_formato->ancho ?>x<?= $papel_formato->alto ?></td>
<td colspan="2"><?= $linea_cubierta->papel_impresion ?></td>
<td colspan="2"><?= $linea_cubierta->papel_impresion()->gramaje . " " . "gr" ?></td>
</tr>
</table>
<div class="comments <?=$ot->comment_cubierta ? '' : 'd-none' ?>">
<div class="flex-row cubierta"><?= lang('Produccion.comentariosCubierta') ?></div>
<div class="comment-content">
<p>
<?= $ot->comment_cubierta ?>
</p>
</div>
</div>
</div>
</div>
<?php endif; ?>
<div class="row mb-2">
<div class="section-title encuadernacion">ACABADOS/ENCUADERNACIÓN</div>
<div class="col-12">
<div class="col-1 w-10 mb-2 text-center" style="background-color: <?= $colors["ot"]["bg"] ?>;color:<?= $colors["ot"]["color"] ?>;">
<span class="fs-bold"><?= $encuadernacionCode ?></span>
</div>
<table>
<?php foreach ($acabados as $key => $acabado): ?>
<tr>
<td class="w-10 encuadernacion">Plastificado</td>
<td><?= $acabado->tarifa()->nombre ?></td>
<td class="encuadernacion bg-encuadernacion" style="width: 100px;">UVI</td>
<td style="color:red;width:100px" class="bg-encuadernacion"> <?= $uvi ? 'SI' : "NO" ?> </td>
<td class="encuadernacion bg-encuadernacion" style="width: 100px;">EXTERNO:</td>
<td class="bg-encuadernacion" style="width: 100px;"><?= $acabado->proveedor() ? $acabado->proveedor()->nombre : "" ?></td>
</tr>
<tr>
<td class="text-start" colspan="2"><?=$ot->info_solapa_guillotina?></td>
<td></td>
<td></td>
<td class="t-header">CORTE PIE:</td>
<td></td>
</tr>
<?php endforeach; ?>
</table>
<?php
foreach ($encuadernaciones as $key => $encuadernacion) {
$encuadernacion_code = $encuadernacion->tarifa()->code;
try {
if ($encuadernacion_code) {
echo view("/themes/vuexy/pdfs/encuadernados/$encuadernacion_code.php", ["encuadernacion" => $encuadernacion]);
} else {
echo view("/themes/vuexy/pdfs/encuadernados/default.php", ["encuadernacion" => $encuadernacion]);
}
} catch (\Throwable $th) {
$error_message = $th->getMessage();
echo "<span style='color:red'>No se ha podido renderizar la tabla de encuadernación</span>";
// echo "<br><span style='color:red'>$error_message</span>";
}
}
?>
<?php if (count($encuadernaciones) > 0): ?>
<div class="comments <?=$ot->comment_encuadernacion ? '' : 'd-none' ?>">
<div class="flex-row encuadernacion"><?= lang('Produccion.comentariosEncuadernacion') ?></div>
<div class="comment-content">
<p>
<?= $ot->comment_encuadernacion ?>
</p>
</div>
</div>
<?php endif; ?>
</div>
</div>
<div class="row mb-2">
<div class="section-title">LOGISTICA</div>
<div class="col-12">
<table>
<tr>
<th>Peso Unidad</th>
<th>Peso Pedido</th>
<th>Corte Pie</th>
</tr>
<tr>
<td><?= number_format($peso_unidad, 2, ',', '.') ?> gr</td>
<td><?= $peso_unidad > 1000 ? number_format($peso_unidad / 1000, 2, ',', '.') . " kg" : number_format($peso_unidad, 2, ',', '.') . " gr" ?> </td>
<td>-</td>
</tr>
</table>
<div class="comments">
<div class="flex-row logistica"><?= lang('Produccion.comentariosLogistica') ?></div>
<div class="comment-content">
<p>
<?= $ot->comment_logistica ?>
</p>
</div>
</div>
</div>
</div>
<div class="col-md-12 d-flex justify-content-center align-items-center">
<span class="footer">&copy; 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>
<script src="<?= site_url('themes/vuexy/vendor/libs/popper/popper.js') ?>"></script>
<script src="<?= site_url('themes/vuexy/vendor/js/bootstrap.js') ?>"></script>
<script src="<?= site_url('themes/vuexy/vendor/libs/flatpickr/flatpickr.js') ?>"></script>
<script src="<?= site_url('themes/vuexy/vendor/libs/perfect-scrollbar/perfect-scrollbar.js') ?>"></script>
<script src="<?= site_url('themes/vuexy/vendor/libs/hammer/hammer.js') ?>"></script>
<script src="<?= site_url('themes/vuexy/vendor/js/menu.js') ?>"></script>
<script src="<?= site_url('assets/js/safekat/pages/pdf/otDownload.js') ?>"></script>
</body>
</html>

View File

@ -11,9 +11,9 @@ class MaquinistaTareaList {
{ data: 'otId', searchable: false, sortable: false },
{ data: 'tareaName', searchable: false, sortable: false },
{ data: 'tareaEstado', searchable: false, sortable: false,render : this.renderStado.bind(this)},
{ data: 'presupuesto_titulo', searchable: false, sortable: false },
{ data: 'papel_impresion', searchable: false, sortable: false },
{ data: 'papel_gramaje', searchable: false, sortable: false },
// { data: 'presupuesto_titulo', searchable: false, sortable: false },
// { data: 'papel_impresion', searchable: false, sortable: false },
// { data: 'papel_gramaje', searchable: false, sortable: false },
{ data: 'fecha_impresion', searchable: false, sortable: false },
{ data: 'action', searchable: false, sortable: false, width: "20rem" },
]

View File

@ -1,6 +1,6 @@
import Ajax from '../../../components/ajax.js'
import { alertConfirmAction } from '../../../components/alerts/sweetAlert.js'
import { alertConfirmAction, alertError, alertSuccess } from '../../../components/alerts/sweetAlert.js'
class MaquinistaTareaView {
constructor(domItem) {
this.item = domItem
@ -84,7 +84,7 @@ class MaquinistaTareaView {
handleUpdateClickInputError(error) {
popErrorAlert(error)
}
updateContentClick(clicks){
updateContentClick(clicks) {
this.item.find('#clicks-info').empty().html(clicks)
}
handleDeleteTareaProgress() {
@ -155,11 +155,13 @@ class MaquinistaTareaView {
window.location.href = '/produccion/ordentrabajo/maquinista/maquinas/view'
}
this.showBasedOnStatus(response.data.status)
alertSuccess(response.message, null, { position: 'top' }).fire()
}
this.actionLoader(false)
}
handleUpdateTareaProgressError(error) {
popErrorAlert(error.error)
alertError(error.error, null, { position: 'top' }).fire()
this.actionLoader(false)
}

View File

@ -1,7 +1,7 @@
$(() => {
var opt = {
margin: 2,
filename: "PDF_OrdenTrabajo_" + $(".pdf-wrapper").data("id") + ".pdf",
filename: $(".pdf-wrapper").data("id") + ".pdf",
image: { type: 'jpeg', quality: 1 },
html2canvas: { scale: 4 },
jsPDF: { unit: 'mm', format: 'a4', orientation: 'portrait' }

View File

@ -28,15 +28,35 @@ class OrdenTrabajo {
this.otEstado = this.item.find("#ot-estado");
this.datatableColumns = [
{ data: 'orden', searchable: true, sortable: true, render: this._renderOrdenTarea.bind(this), width: "10%" },
{ 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', searchable: false, sortable: false, render: this._renderImposicionSelectTable.bind(this) },
{ data: 'orden', searchable: true, sortable: true, render: this._renderOrdenTarea.bind(this) },
{ data: 'nombre', searchable: true, sortable: true },
{
data: 'maquina_presupuesto_linea', searchable: true, sortable: true, render: (d) => {
if (d) {
return `
<div class="btn-group dropstart">
<button class="btn btn-primary btn-xs dropdown-toggle" type="button" data-bs-toggle="dropdown">
<i class="ti ti-printer ti-xs"></i>
</button>
<ul class="dropdown-menu">
<li> <a class="dropdown-item" href="javascript:void(0);">${d}</a> </li>
</ul>
</div>
`
} else {
return "";
}
}
},
{ data: 'maquina_tarea', searchable: false, sortable: false, render: this._renderMaquinaSelectTable.bind(this), width: "10%" },
{ data: 'imposicion', searchable: false, sortable: false, render: this._renderImposicionSelectTable.bind(this), width: "10%" },
{ data: 'proveedor', searchable: false, sortable: false, render: this._renderProveedorSelectTable.bind(this), width: "10%" },
{ data: 'tiempo_estimado', searchable: false, sortable: false },
{ data: 'tiempo_real', searchable: false, sortable: false },
{
data: 'action', searchable: false, sortable: false, width: "10%", render: this._renderActionCell.bind(this)
data: 'action', searchable: false, sortable: false, width: "5%", render: this._renderActionCell.bind(this)
},
]
@ -76,27 +96,40 @@ class OrdenTrabajo {
this.pendienteFerro = new DatePicker(this.otForm.find("#ot-pendiente-ferro"), option)
this.ferroCliente = new DatePicker(this.otForm.find("#ot-ferro-cliente"), option)
this.ferroOk = new DatePicker(this.otForm.find("#ot-ferro-ok"), option)
this.plakeneTraslucido = new DatePicker(this.otForm.find("#ot-plakene-traslucido"), option)
// this.plakeneTraslucido = new DatePicker(this.otForm.find("#ot-plakene-traslucido"), option)
this.impresionColor = new DatePicker(this.otForm.find("#ot-impresion-color"), option)
this.impresionBN = new DatePicker(this.otForm.find("#ot-impresion-bn"), option)
this.cubierta = new DatePicker(this.otForm.find("#ot-cubierta"), option)
this.sobrecubierta = new DatePicker(this.otForm.find("#ot-sobrecubierta"), option)
this.guarda = new DatePicker(this.otForm.find("#ot-guarda"), option)
this.portada = new DatePicker(this.otForm.find("#ot-portada"), option)
this.plastificadoMate = new DatePicker(this.otForm.find("#ot-plastificado-mate"), option)
this.plastificado = new DatePicker(this.otForm.find("#ot-plastificado"), option)
this.plakene = new DatePicker(this.otForm.find("#ot-plakene"), option)
this.retractilado = new DatePicker(this.otForm.find("#ot-retractilado"), option)
this.estampado = new DatePicker(this.otForm.find("#ot-estampado"), option)
this.uvi = new DatePicker(this.otForm.find("#ot-uvi"), option)
this.encuadernacion = new DatePicker(this.otForm.find("#ot-encuadernacion"), option)
this.entradaManipulado = new DatePicker(this.otForm.find("#ot-manipulado"), option)
this.prepGuillotina = new DatePicker(this.otForm.find("#ot-prep-guillotina"), option)
this.prepCosido = new DatePicker(this.otForm.find("#ot-prep-cosido"), option)
this.prepGrapado = new DatePicker(this.otForm.find("#ot-prep-grapado"), option)
this.prepSolapa = new DatePicker(this.otForm.find("#ot-prep-solapa"), option)
this.prepPrototipo = new DatePicker(this.otForm.find("#ot-prep-prototipo"), option)
// this.prepPrototipo = new DatePicker(this.otForm.find("#ot-prep-prototipo"), option)
this.prepMarcapaginas = new DatePicker(this.otForm.find("#ot-prep-marcapaginas"), option)
this.prepRetractilado = new DatePicker(this.otForm.find("#ot-prep-retractilado"), option)
this.prepRetractilado5 = new DatePicker(this.otForm.find("#ot-prep-retractilado5"), option)
this.espiral = new DatePicker(this.otForm.find("#ot-espiral"), option)
// this.espiral = new DatePicker(this.otForm.find("#ot-espiral"), option)
this.embalaje = new DatePicker(this.otForm.find("#ot-embalaje"), option)
this.envio = new DatePicker(this.otForm.find("#ot-envio"), option)
@ -115,6 +148,7 @@ class OrdenTrabajo {
}
eventTareas() {
this.otForm.on("change", ".select-maquina-tarea-datatable", this.handleTareaChange.bind(this))
this.otForm.on("change", ".select-proveedor-tarea-datatable", this.handleUpdateProveedor.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) => {
@ -133,6 +167,7 @@ class OrdenTrabajo {
unbindEventTareas() {
this.otForm.off("change", ".select-maquina-tarea-datatable")
this.otForm.off("change", ".select-imposicion-tarea-datatable")
this.otForm.off("change", ".select-proveedor-tarea-datatable")
this.otForm.off("change", ".orden-tarea")
this.otForm.off("click", ".increase-order")
this.otForm.off("click", ".decrease-order")
@ -153,7 +188,7 @@ class OrdenTrabajo {
this.item.on("click", "#btn-reset-tareas", this.handleResetTareasDeleteConfirmation.bind(this))
this.otForm.on("click", ".ot-tarea-comment", this.handleNoteTarea.bind(this))
$("#btn-update-tarea-comment").on("click", this.handleTareaNoteSubmit.bind(this))
this.otForm.on("change", "#ot-comment", this.handleOtComment.bind(this))
this.otForm.on("change", ".ot-comment", this.handleOtComment.bind(this))
$("#btn-update-pliegos").on('click', this.handleUpdatePliegos.bind(this))
this._handleGetData()
@ -208,6 +243,16 @@ class OrdenTrabajo {
return render
}
_renderProveedorSelectTable(d, t) {
if (d.proveedor) {
let render = `<select id="select-proveedor-tarea-${d.tarea.id}" data-proveedor-id="${d.proveedor.id}" data-proveedor-tipo="${d.proveedor.tipo_id}" data-id="${d.tarea.id}" name="proveedor_id" class="select2 form-select select-proveedor-tarea-datatable" ${this.isOtFinalizada ? "disabled" : ""}>
<option value="${d.proveedor.id}" selected="selected">${d.proveedor.nombre ?? ''}</option>
</select>`
return render
} else {
return "";
}
}
_renderActionCell(d, t) {
let cell = `<div class="d-flex justify-content-start align-items-center gap-1">
@ -222,7 +267,7 @@ class OrdenTrabajo {
return `
<div class="d-flex justify-content-between aling-items-center gap-2 orden-tarea-cell">
<input type="text" style="min-width:5rem" data-id="${d.id}" class="form-control form-control-sm orden-tarea mr-2" name="orden" value="${d.orden}" ${this.isOtFinalizada ? "disabled" : ""}>
<input type="text" style="min-width:2rem" data-id="${d.id}" class="form-control form-control-sm orden-tarea mr-2" name="orden" value="${d.orden}" ${this.isOtFinalizada ? "disabled" : ""}>
<div class="btn-group-vertical">
<button type="button" class="btn btn-primary btn-outlined btn-xs increase-order"><i class="ti ti-chevron-up ti-xs"></i></button>
<button type="button" class="btn btn-primary btn-xs decrease-order" data-id="${d.id}"><i class="ti ti-chevron-down ti-xs"></i></button>
@ -232,6 +277,10 @@ class OrdenTrabajo {
}
createSelectMaquinaTarea() {
try {
$('.select-proveedor-tarea-datatable').each((index, element) => {
console.log(element)
this.createSelectProveedor($(element))
})
this.summaryData.tasks.forEach(async (element) => {
let selectItem = this.item.find("#select-maquina-tarea-" + element.id);
if (element.presupuesto_linea_id && element.is_corte == false) this.createSelectMaquinaImpresion(selectItem)
@ -262,6 +311,7 @@ class OrdenTrabajo {
}
});
} catch (error) {
console.error(error)
} finally {
this.eventTareas()
@ -270,7 +320,7 @@ class OrdenTrabajo {
}
createSelectMaquinaAcabado(selectItem) {
let maquina_id = selectItem.data("maquina-id")
let maquinaSelects = new ClassSelect(selectItem, `/tarifas/maquinas/acabado/select`, "Seleccione una maquina", true);
let maquinaSelects = new ClassSelect(selectItem, `/tarifas/maquinas/acabado/select`, "Seleccione un máquina", true);
maquinaSelects.init();
if (maquina_id) {
maquinaSelects.setVal(maquina_id)
@ -278,6 +328,24 @@ class OrdenTrabajo {
maquinaSelects.reset()
}
}
createSelectProveedor(selectItem) {
try {
let proveedor_id = selectItem.data("proveedor-id")
let tipo = selectItem.data("proveedor-tipo")
let proveedorSelect = new ClassSelect(selectItem, `/compras/proveedores/getProveedores`, "Seleccione una proveedor", true, { tipo_id: tipo }, this.tareasTableItem);
proveedorSelect.init();
if (proveedor_id) {
proveedorSelect.setVal(proveedor_id)
} else {
proveedorSelect.reset()
}
} catch (error) {
console.error(error)
}
}
createSelectMaquinaManipulado(selectItem) {
let maquina_id = selectItem.data("maquina-id")
let maquinaSelects = new ClassSelect(selectItem, `/tarifas/maquinas/manipulado/select`, "Seleccione una maquina", true);
@ -416,21 +484,33 @@ class OrdenTrabajo {
this.ferroCliente.setDate(this.summaryData.dates.ferro_en_cliente_at)
this.ferroOk.setDate(this.summaryData.dates.ferro_ok_at)
// this.plakeneTraslucido.setDate(this.summaryData.dates.fecha_impresion_at)
this.impresionColor.setDate(this.summaryData.dates.interior_color_at)
/**IMPRESION */
this.impresionBN.setDate(this.summaryData.dates.interior_bn_at)
this.portada.setDate(this.summaryData.dates.cubierta_at)
this.plastificadoMate.setDate(this.summaryData.dates.plastificado_at)
this.impresionColor.setDate(this.summaryData.dates.interior_color_at)
this.cubierta.setDate(this.summaryData.dates.cubierta_at)
this.sobrecubierta.setDate(this.summaryData.dates.sobrecubierta_at)
this.guarda.setDate(this.summaryData.dates.guarda_at)
/**ACABADO */
this.plastificado.setDate(this.summaryData.dates.plastificado_at)
this.plakene.setDate(this.summaryData.dates.plakene_at)
this.retractilado.setDate(this.summaryData.dates.retractilado_at)
this.estampado.setDate(this.summaryData.dates.estampado_at)
this.uvi.setDate(this.summaryData.dates.uvi_at)
/** ENCUADERNACION */
this.encuadernacion.setDate(this.summaryData.dates.encuadernacion_at)
this.prepGuillotina.setDate(this.summaryData.dates.corte_at)
this.prepCosido.setDate(this.summaryData.dates.cosido_at)
this.prepSolapa.setDate(this.summaryData.dates.solapa_at)
this.prepGrapado.setDate(this.summaryData.dates.grapado_at)
this.prepPrototipo.setDate(this.summaryData.dates.prototipo_at)
this.entradaManipulado.setDate(this.summaryData.dates.entrada_manipulado_at)
// this.prepCosido.setDate(this.summaryData.dates.cosido_at)
// this.prepSolapa.setDate(this.summaryData.dates.solapa_at)
// this.prepGrapado.setDate(this.summaryData.dates.grapado_at)
// this.prepPrototipo.setDate(this.summaryData.dates.prototipo_at)
this.prepMarcapaginas.setDate(this.summaryData.dates.marcapaginas_at)
this.prepRetractilado.setDate(this.summaryData.dates.retractilado_at)
this.prepRetractilado5.setDate(this.summaryData.dates.retractilado5_at)
this.espiral.setDate(this.summaryData.dates.fecha_impresion_at)
// 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);
@ -485,17 +565,18 @@ class OrdenTrabajo {
}
handleTareaChangeError(error) { }
handleOtComment(event) {
let name = $(event.currentTarget).attr("name")
let data = {
"orden_trabajo_id": this.modelId,
"name": name,
}
data[name] = $(event.currentTarget).val()
const ajax = new Ajax(
"/produccion/ordentrabajo/update",
{
"orden_trabajo_id": this.modelId,
"name": $(event.currentTarget).attr("name"),
"comentarios": $(event.currentTarget).val()
},
data,
null,
(response) => {
this._handleGetData();
alertSuccess(response.message).fire()
},
null
@ -864,6 +945,24 @@ class OrdenTrabajo {
ajax.post()
}
handleUpdateProveedor(event) {
let orden_trabajo_tarea_id = $(event.currentTarget).data('id')
let actualValue = $(event.currentTarget).val()
let ajax = new Ajax(`/produccion/ordentrabajo/update/tarea/proveedor`,
{
orden_trabajo_tarea_id: orden_trabajo_tarea_id,
proveedor_id: actualValue
},
null,
(response) => {
alertSuccess(response.message).fire()
},
(error) => {
alertError(error.message).fire()
})
ajax.post()
}
}

View File

@ -5,5 +5,5 @@
font-size : 20px;
}
.table-maquinista td{
height : 10rem;
height : 7rem;
}

View File

@ -18,7 +18,7 @@ html {
width: 210mm;
height: 297mm;
max-width: 210mm;
font-size: 11px;
font-size: 8px;
max-height: 297mm;
background-color: white;
}
@ -91,7 +91,7 @@ body {
}
.section-title {
font-weight: bold;
margin-bottom: 10px;
margin-bottom: 4px;
}
.cubierta {
color: #007bff;
@ -105,31 +105,29 @@ body {
.comments {
color: #555;
font-style: italic;
font-size : 12px;
margin-top: 0.2rem;
}
.comment-content {
line-height: 0;
width: 100%;
height: 50px;
border: solid;
border-width: 1px;
margin-left : 0.2rem;
font-style: normal;
color : black;
font-size: 10px;
}
table {
width: 100%;
margin-bottom: 5px;
margin-bottom: 2px;
font-size: 10px;
}
th, td {
border: 0.01px solid black;
}
table td {
text-align: center;
}
table,
th,
td {
border: 0.1px solid rgb(0, 0, 0);
border-collapse: collapse;
}
table th {
font-weight: bold;
@ -139,11 +137,7 @@ table th {
table td {
font-weight: bold;
}
.comments {
color: #555;
font-style: italic;
margin-top: 0.2rem;
}
.t-header {
color: black;
width: 25%;