mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Merge branch 'feat/sk-40/sk-37' into 'main'
Feat/sk 40/sk 37 See merge request jjimenez/safekat!700
This commit is contained in:
49
ci4/app/Config/OrdenTrabajo.php
Normal file
49
ci4/app/Config/OrdenTrabajo.php
Normal file
@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
namespace Config;
|
||||
|
||||
use CodeIgniter\Config\BaseConfig;
|
||||
|
||||
class OrdenTrabajo extends BaseConfig
|
||||
{
|
||||
|
||||
public array $DATE_USER_MAPPING = [
|
||||
//IMPRESION
|
||||
"interior_bn_at" => "interior_bn_user_id",
|
||||
"interior_color_at" => "interior_color_user_id",
|
||||
"cubierta_at" => "cubierta_user_id",
|
||||
//ACABADO
|
||||
"plastificado_at" => "plastificado_user_id",
|
||||
"encuadernacion_at" => "encuadernacion_user_id",
|
||||
"corte_at" => "corte_user_id",
|
||||
"preparacion_interiores_at" => "preparacion_interior_user_id",
|
||||
"entrada_manipulado_at" => "entrada_manipulado_user_id",
|
||||
//FERRO
|
||||
"pendiente_ferro_at" => "pendiente_ferro_user_id",
|
||||
"ferro_en_cliente_at" => "ferro_en_cliente_user_id",
|
||||
"ferro_ok_at" => "ferro_ok_user_id",
|
||||
//ENVIO
|
||||
"embalaje_at" => "embalaje_user_id",
|
||||
"envio_at" => "envio_user_id",
|
||||
//PREIMPRESION
|
||||
"pre_formato_at" => "pre_formato_user_id",
|
||||
"pre_lomo_at" => "pre_lomo_user_id",
|
||||
"pre_solapa_at" => "pre_solapa_user_id",
|
||||
"pre_codbarras_at" => "pre_codbarras_user_id",
|
||||
"pre_imposicion_at" => "pre_imposicion_user_id",
|
||||
|
||||
];
|
||||
public array $DATE_USER_MAPPING_PEDIDO = [
|
||||
"inaplazable" => "inaplazable_change_user_id",
|
||||
"fecha_entrega_real" => "fecha_entrega_real_change_user_id",
|
||||
"fecha_impresion" => "fecha_impresion_change_user_id",
|
||||
"fecha_encuadernado" => "fecha_encuadernado_change_user_id",
|
||||
"fecha_entrega_externo" => "fecha_entrega_externo_change_user_id",
|
||||
];
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
}
|
||||
@ -153,6 +153,8 @@ $routes->group('imposiciones', ['namespace' => 'App\Controllers\Configuracion'],
|
||||
$routes->post('datatable', 'Imposiciones::datatable', ['as' => 'dataTableOfImposiciones']);
|
||||
$routes->post('allmenuitems', 'Imposiciones::allItemsSelect', ['as' => 'select2ItemsOfImposiciones']);
|
||||
$routes->post('menuitems', 'Imposiciones::menuItems', ['as' => 'menuItemsOfImposiciones']);
|
||||
$routes->get('select', 'Imposiciones::selectImposicion', ['as' => 'selectImposicion']);
|
||||
|
||||
});
|
||||
$routes->resource('imposiciones', ['namespace' => 'App\Controllers\Configuracion', 'controller' => 'Imposiciones', 'except' => 'show,new,create,update']);
|
||||
|
||||
@ -733,6 +735,8 @@ $routes->group('produccion', ['namespace' => 'App\Controllers\Produccion'], func
|
||||
*========================**/
|
||||
$routes->post("update/tarea", 'Ordentrabajo::update_orden_trabajo_tarea');
|
||||
$routes->post("update/date", 'Ordentrabajo::update_orden_trabajo_date');
|
||||
$routes->post("update/pedido/date", 'Ordentrabajo::update_orden_trabajo_pedido_date');
|
||||
$routes->post("update/pedido", 'Ordentrabajo::update_orden_trabajo_pedido');
|
||||
$routes->post("update/user", 'Ordentrabajo::update_orden_trabajo_user');
|
||||
$routes->post("update", 'Ordentrabajo::update_orden_trabajo');
|
||||
$routes->post("upload/portada", 'Ordentrabajo::upload_orden_trabajo_portada');
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
<?php namespace App\Controllers\Configuracion;
|
||||
<?php
|
||||
|
||||
namespace App\Controllers\Configuracion;
|
||||
|
||||
|
||||
use App\Controllers\BaseResourceController;
|
||||
@ -279,6 +281,9 @@ class Imposiciones extends \App\Controllers\BaseResourceController
|
||||
];
|
||||
return $orientacionOptions;
|
||||
}
|
||||
|
||||
|
||||
public function selectImposicion()
|
||||
{
|
||||
$data = $this->model->querySelect($this->request->getGet('q'));
|
||||
return $this->response->setJSON($data);
|
||||
}
|
||||
}
|
||||
|
||||
@ -118,7 +118,26 @@ class Ordentrabajo extends BaseController
|
||||
return $this->response->setJSON(["errors" => $this->validation->getErrors()])->setStatusCode(400);
|
||||
}
|
||||
}
|
||||
|
||||
public function update_orden_trabajo_pedido_date()
|
||||
{
|
||||
try {
|
||||
$bodyData = $this->request->getPost();
|
||||
$r = $this->produccionService->init($bodyData["orden_trabajo_id"])->updateOrdenTrabajoPedidoDate($bodyData);
|
||||
return $this->response->setJSON(["message" => lang("App.global_alert_save_success"), "status" => $r["status"], "user" => $r["user"], "data" => $bodyData]);
|
||||
} catch (\Throwable $th) {
|
||||
return $this->response->setJSON(["errors" => $th->getMessage(), "status" => false])->setStatusCode(500);
|
||||
}
|
||||
}
|
||||
public function update_orden_trabajo_pedido()
|
||||
{
|
||||
try {
|
||||
$bodyData = $this->request->getPost();
|
||||
$r = $this->produccionService->init($bodyData["orden_trabajo_id"])->updateOrdenTrabajoPedido($bodyData);
|
||||
return $this->response->setJSON(["message" => lang("App.global_alert_save_success"), "status" => $r,"data" => $bodyData]);
|
||||
} catch (\Throwable $th) {
|
||||
return $this->response->setJSON(["errors" => $th->getMessage(), "status" => false])->setStatusCode(500);
|
||||
}
|
||||
}
|
||||
public function edit($orden_trabajo_id)
|
||||
{
|
||||
// Breadcrumbs
|
||||
@ -131,6 +150,9 @@ class Ordentrabajo extends BaseController
|
||||
$this->viewData["presupuesto"] = $this->produccionService->getPresupuesto();
|
||||
$this->viewData["cliente"] = $this->produccionService->getCliente();
|
||||
$this->viewData["ot"] = $this->produccionService->getOrdenTrabajo();
|
||||
$this->viewData["user_dates"] = $this->produccionService->userDates();
|
||||
$this->viewData["pedido_user_dates"] = $this->produccionService->pedidoUserDates();
|
||||
|
||||
return view(static::$viewPath . $this->editRoute, $this->viewData);
|
||||
}
|
||||
|
||||
@ -141,7 +163,7 @@ class Ordentrabajo extends BaseController
|
||||
$q = $this->otModel->getDatatableQuery()->where("ordenes_trabajo.estado", "F");
|
||||
// return $this->response->setJSON($q->get()->getResultArray());
|
||||
return DataTable::of($q)
|
||||
->add("logo", fn($q) => site_url($logo->get_logo_path($q->presupuesto_linea_tipo)))
|
||||
->add("logo", fn($q) => ["logo" => site_url($logo->get_logo_path($q->presupuesto_linea_tipo)), "imposicion" => $q->imposicion_name])
|
||||
->edit(
|
||||
"fecha_encuadernado_at",
|
||||
fn($q) => $q->fecha_encuadernado_at ? Time::createFromFormat("Y-m-d", $q->fecha_encuadernado_at)->format("d/m/Y") : ""
|
||||
@ -156,7 +178,7 @@ class Ordentrabajo extends BaseController
|
||||
$q = $this->otModel->getDatatableQuery()->whereIn("ordenes_trabajo.estado", ["I", "PM"]);
|
||||
// return $this->response->setJSON($q->get()->getResultArray());
|
||||
return DataTable::of($q)
|
||||
->add("logo", fn($q) => site_url($logo->get_logo_path($q->presupuesto_linea_tipo)))
|
||||
->add("logo", fn($q) => ["logo" => site_url($logo->get_logo_path($q->presupuesto_linea_tipo)), "imposicion" => $q->imposicion_name])
|
||||
->edit(
|
||||
"fecha_encuadernado_at",
|
||||
fn($q) => $q->fecha_encuadernado_at ? Time::createFromFormat("Y-m-d", $q->fecha_encuadernado_at)->format("d/m/Y") : ""
|
||||
@ -171,7 +193,7 @@ class Ordentrabajo extends BaseController
|
||||
$q = $this->otModel->getDatatableQuery()->where("ferro_ok_at", null);
|
||||
// return $this->response->setJSON($q->get()->getResultArray());
|
||||
return DataTable::of($q)
|
||||
->add("logo", fn($q) => site_url($logo->get_logo_path($q->presupuesto_linea_tipo)))
|
||||
->add("logo", fn($q) => ["logo" => site_url($logo->get_logo_path($q->presupuesto_linea_tipo)), "imposicion" => $q->imposicion_name])
|
||||
->edit(
|
||||
"fecha_encuadernado_at",
|
||||
fn($q) => $q->fecha_encuadernado_at ? Time::createFromFormat("Y-m-d", $q->fecha_encuadernado_at)->format("d/m/Y") : ""
|
||||
@ -186,7 +208,7 @@ class Ordentrabajo extends BaseController
|
||||
$q = $this->otModel->getDatatableQuery()->where("ferro_ok_at is NOT NULL", NULL, FALSE);
|
||||
// return $this->response->setJSON($q->get()->getResultArray());
|
||||
return DataTable::of($q)
|
||||
->add("logo", fn($q) => site_url($logo->get_logo_path($q->presupuesto_linea_tipo)))
|
||||
->add("logo", fn($q) => ["logo" => site_url($logo->get_logo_path($q->presupuesto_linea_tipo)), "imposicion" => $q->imposicion_name])
|
||||
->edit(
|
||||
"fecha_encuadernado_at",
|
||||
fn($q) => $q->fecha_encuadernado_at ? Time::createFromFormat("Y-m-d", $q->fecha_encuadernado_at)->format("d/m/Y") : ""
|
||||
@ -232,6 +254,7 @@ class Ordentrabajo extends BaseController
|
||||
->edit("tiempo_estimado", fn($q) => float_seconds_to_hhmm_string($q->tiempo_estimado))
|
||||
->edit("tiempo_real", fn($q) => float_seconds_to_hhmm_string($q->tiempo_real))
|
||||
->edit("maquina_tarea", fn($q) => ["id" => $q->id, "maquina_id" => $q->maquina_tarea, "maquina_name" => $q->maquina_nombre])
|
||||
->add("imposicion", fn($q) => ["id" => $q->id, "imposicion_id" => $q->imposicion_id, "name" => $q->imposicion_name, "is_presupuesto_linea" => $q->presupuesto_linea_id ? true : false])
|
||||
->toJson(true);
|
||||
}
|
||||
public function get_pdf($orden_trabajo_id)
|
||||
@ -241,7 +264,6 @@ class Ordentrabajo extends BaseController
|
||||
public function upload_orden_trabajo_portada()
|
||||
{
|
||||
try {
|
||||
//code...
|
||||
$file = $this->request->getFile("portada_file");
|
||||
$bodyData = $this->request->getPost();
|
||||
$id = $bodyData["orden_trabajo_id"];
|
||||
@ -249,6 +271,12 @@ class Ordentrabajo extends BaseController
|
||||
$fullpath = null;
|
||||
if ($file->isValid() && !$file->hasMoved()) {
|
||||
$fullpath = $file->store('ordenes_trabajo_portadas');
|
||||
$otEntity = $this->otModel->find($id);
|
||||
if ($otEntity->portada_path) {
|
||||
if (file_exists($otEntity->full_path)) {
|
||||
unlink($otEntity->full_path);
|
||||
}
|
||||
}
|
||||
$r = $this->otModel->update($id, ["portada_path" => $fullpath]);
|
||||
}
|
||||
return $this->response->setJSON(["message" => "Portada subida", "data" => $r]);
|
||||
@ -256,7 +284,7 @@ class Ordentrabajo extends BaseController
|
||||
if ($fullpath) {
|
||||
delete_files($fullpath);
|
||||
}
|
||||
return $this->response->setJSON(["message" => "Portada error", "error" => $th->getMessage()])->setStatusCode($th->getCode());
|
||||
return $this->response->setJSON(["message" => "Portada error", "error" => $th->getMessage()])->setStatusCode(500);
|
||||
}
|
||||
}
|
||||
public function delete_orden_trabajo_portada($orden_trabajo_id)
|
||||
@ -280,7 +308,7 @@ class Ordentrabajo extends BaseController
|
||||
try {
|
||||
$ot = $this->otModel->find($orden_trabajo_id);
|
||||
if ($ot->portada_path) {
|
||||
$filePath = WRITEPATH . 'uploads/' . $ot->portada_path;
|
||||
$filePath = $ot->full_path;
|
||||
if (file_exists($filePath)) {
|
||||
|
||||
$mimeType = mime_content_type($filePath);
|
||||
@ -296,7 +324,6 @@ class Ordentrabajo extends BaseController
|
||||
}
|
||||
} catch (\Throwable $th) {
|
||||
return $this->response->setJSON(["message" => "Portada error", "error" => $th->getMessage()])->setStatusCode(500);
|
||||
|
||||
}
|
||||
}
|
||||
public function planning_rotativa_datatable()
|
||||
|
||||
@ -19,4 +19,13 @@ class Imposicion extends \CodeIgniter\Entity\Entity
|
||||
"alto" => "int",
|
||||
"unidades" => "?int",
|
||||
];
|
||||
|
||||
public function getFullName() : string
|
||||
{
|
||||
$ancho_x_alto = $this->attributes["ancho"] ."x". $this->attributes["alto"];
|
||||
$unidades = $this->attributes["unidades"] ?? "";
|
||||
$orientacion = $this->attributes["orientacion"] ?? "";
|
||||
return implode("_",[$ancho_x_alto,$unidades,$orientacion]);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,9 +2,11 @@
|
||||
namespace App\Entities\Configuracion;
|
||||
|
||||
use App\Models\Configuracion\MaquinasPapelesImpresionModel;
|
||||
use App\Models\Configuracion\PapelGenericoModel;
|
||||
use App\Models\Configuracion\PapelImpresionMargenModel;
|
||||
use App\Models\Configuracion\PapelImpresionTipologiaModel;
|
||||
use CodeIgniter\Entity;
|
||||
use CodeIgniter\Model;
|
||||
|
||||
class PapelImpresion extends \CodeIgniter\Entity\Entity
|
||||
{
|
||||
@ -68,4 +70,15 @@ class PapelImpresion extends \CodeIgniter\Entity\Entity
|
||||
$m = model(PapelImpresionMargenModel::class);
|
||||
return $m->asArray()->where('papel_impresion_id',$this->attributes["id"])->findAll();
|
||||
}
|
||||
public function papel_generico() : ?PapelGenerico
|
||||
{
|
||||
$m = model(PapelGenericoModel::class);
|
||||
return $m->find($this->attributes["papel_generico_id"]);
|
||||
}
|
||||
public function getPapelCodeOt() : ?string
|
||||
{
|
||||
$code_ot = $this->papel_generico()->code_ot;
|
||||
$gramaje = $this->attributes["gramaje"];
|
||||
return implode(" ",[$code_ot,$gramaje]);
|
||||
}
|
||||
}
|
||||
|
||||
@ -6,9 +6,11 @@ use App\Entities\Produccion\OrdenTrabajoEntity;
|
||||
use App\Models\OrdenTrabajo\OrdenTrabajoModel;
|
||||
use App\Entities\Clientes\ClienteEntity;
|
||||
use App\Entities\Configuracion\UbicacionesEntity;
|
||||
use App\Entities\Usuarios\UserEntity;
|
||||
use App\Models\Clientes\ClienteModel;
|
||||
use App\Models\Pedidos\PedidoLineaModel;
|
||||
use App\Models\Presupuestos\PresupuestoModel;
|
||||
use App\Models\Usuarios\UserModel;
|
||||
use CodeIgniter\Entity;
|
||||
|
||||
class PedidoEntity extends \CodeIgniter\Entity\Entity
|
||||
@ -40,6 +42,12 @@ class PedidoEntity extends \CodeIgniter\Entity\Entity
|
||||
protected $casts = [
|
||||
"total_precio" => "float",
|
||||
"total_tirada" => "float",
|
||||
"inaplazable" => "bool",
|
||||
"fecha_entrega_real_change_user_id" => "?integer",
|
||||
"fecha_impresion_change_user_id" => "?integer",
|
||||
"fecha_encuadernado_change_user_id" => "?integer",
|
||||
"fecha_entrega_change_externo_user_id" => "?integer",
|
||||
"inaplazable_change_user_id" => "?integer",
|
||||
];
|
||||
/**
|
||||
* Devuelve la entidad `PedidoEntity` con sus relaciones
|
||||
@ -91,4 +99,16 @@ class PedidoEntity extends \CodeIgniter\Entity\Entity
|
||||
$pre = $pm->find($pedido_linea->presupuesto_id);
|
||||
return $m->find($pre->cliente_id);
|
||||
}
|
||||
public function userBy(string $key): ?UserEntity
|
||||
{
|
||||
$user = null;
|
||||
if (isset($this->attributes[$key])) {
|
||||
|
||||
if ($this->attributes[$key]) {
|
||||
$m = model(UserModel::class);
|
||||
$user = $m->find($this->attributes[$key]);
|
||||
}
|
||||
}
|
||||
return $user;
|
||||
}
|
||||
}
|
||||
|
||||
@ -225,4 +225,8 @@ class PresupuestoLineaEntity extends \CodeIgniter\Entity\Entity
|
||||
{
|
||||
return in_array($this->attributes['tipo'],['lp_rot_color','lp_rot_bn']);
|
||||
}
|
||||
public function isColor():bool {
|
||||
return in_array($this->attributes['tipo'],['lp_color','lp_colorhq','lp_rot_color']);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,34 +2,38 @@
|
||||
|
||||
namespace App\Entities\Produccion;
|
||||
|
||||
use App\Models\Usuarios\UserModel;
|
||||
use CodeIgniter\Entity\Entity;
|
||||
use Exception;
|
||||
|
||||
class OrdenTrabajoDateEntity extends Entity
|
||||
{
|
||||
protected $attributes = [
|
||||
"orden_trabajo_id" => null,
|
||||
"fecha_entrada_at" => null,
|
||||
"fecha_entrega_change_at" => null,
|
||||
"fecha_entrega_real_at" => null,
|
||||
"fecha_entrega_real_warning" => null,
|
||||
"fecha_impresion_at" => null,
|
||||
"fecha_encuadernado_at" => null,
|
||||
"fecha_externo_at" => null,
|
||||
"fecha_entrega_warning" => null,
|
||||
"fecha_entrega_warning_revised" => null,
|
||||
"pendiente_ferro_at" => null,
|
||||
"ferro_en_cliente_at" => null,
|
||||
"ferro_ok_at" => null,
|
||||
//IMPRESION
|
||||
"interior_bn_at" => null,
|
||||
"interior_color_at" => null,
|
||||
"preparacion_interiores_at" => null,
|
||||
"cubierta_at" => null,
|
||||
//ACABADO
|
||||
"plastificado_at" => null,
|
||||
"encuadernacion_at" => null,
|
||||
"corte_at" => null,
|
||||
"preparacion_interiores_at" => null,
|
||||
"entrada_manipulado_at" => null,
|
||||
//FERRO
|
||||
"pendiente_ferro_at" => null,
|
||||
"ferro_en_cliente_at" => null,
|
||||
"ferro_ok_at" => null,
|
||||
//ENVIO
|
||||
"embalaje_at" => null,
|
||||
"envio_at" => null,
|
||||
"entrada_manipulado_at" => null
|
||||
//PREIMPRESION
|
||||
"pre_formato_at" => null,
|
||||
"pre_lomo_at" => null,
|
||||
"pre_solapa_at" => null,
|
||||
"pre_codbarras_at" => null,
|
||||
"pre_imposicion_at" => null,
|
||||
|
||||
];
|
||||
protected $datamap = [];
|
||||
@ -37,51 +41,11 @@ class OrdenTrabajoDateEntity extends Entity
|
||||
'created_at',
|
||||
'updated_at',
|
||||
'deleted_at',
|
||||
// 'fecha_entrega_at',
|
||||
// 'fecha_entrega_change_at',
|
||||
// 'fecha_entrega_real_at',
|
||||
// 'fecha_entrega_real_warning',
|
||||
// 'fecha_impresion_at',
|
||||
// 'fecha_encuadernado_at',
|
||||
// 'fecha_externo_at',
|
||||
// 'fecha_entrega_warning',
|
||||
// 'fecha_entrega_warning_revised',
|
||||
// 'pendiente_ferro_at',
|
||||
// 'ferro_en_cliente_at',
|
||||
// 'ferro_ok_at',
|
||||
// 'interior_bn_at',
|
||||
// 'interior_color_at',
|
||||
// 'preparacion_interiores_at',
|
||||
// 'cubierta_at',
|
||||
// 'plastificado_at',
|
||||
// 'encuadernacion_at',
|
||||
// 'corte_at',
|
||||
// 'embalaje_at',
|
||||
// 'envio_at',
|
||||
// 'entrada_manipulado_at'
|
||||
|
||||
];
|
||||
protected $casts = [
|
||||
// "fecha_entrada_at" => "?datetime",
|
||||
// "fecha_entrega_change_at" => "?datetime",
|
||||
// "fecha_entrega_real_at" => "?datetime",
|
||||
// "fecha_entrega_real_warning" => "?bool",
|
||||
// "fecha_impresion_at" => "?datetime",
|
||||
// "fecha_encuadernado_at" => "?datetime",
|
||||
// "fecha_externo_at" => "?datetime",
|
||||
// "fecha_entrega_warning" => "?bool",
|
||||
// "fecha_entrega_warning_revised" => "?bool",
|
||||
// "pendiente_ferro_at" => "?datetime",
|
||||
// "ferro_en_cliente_at" => "?datetime",
|
||||
// "ferro_ok_at" => "?datetime",
|
||||
// "interior_bn_at" => "?datetime",
|
||||
// "interior_color_at" => "?datetime",
|
||||
// "preparacion_interiores_at" => "?datetime",
|
||||
// "cubierta_at" => "?datetime",
|
||||
// "plastificado_at" => "?datetime",
|
||||
// "encuadernacion_at" => "?datetime",
|
||||
// "corte_at" => "?datetime",
|
||||
// "embalaje_at" => "?datetime",
|
||||
// "envio_at" => "?datetime",
|
||||
// "entrada_manipulado_at" => "?datetime"
|
||||
];
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -134,4 +134,18 @@ class OrdenTrabajoEntity extends Entity
|
||||
{
|
||||
return $this->pedidoEsperaBy();
|
||||
}
|
||||
public function getFullPath(): ?string
|
||||
{
|
||||
helper('filesystem');
|
||||
$path = WRITEPATH . 'uploads/' . $this->attributes["portada_path"];
|
||||
$portada_path = null;
|
||||
if($path){
|
||||
if(file_exists($path)){
|
||||
$portada_path = $path;
|
||||
}else{
|
||||
$portada_path = null;
|
||||
}
|
||||
}
|
||||
return $portada_path;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,10 +2,12 @@
|
||||
|
||||
namespace App\Entities\Produccion;
|
||||
|
||||
use App\Entities\Configuracion\Imposicion;
|
||||
use App\Entities\Configuracion\Maquina;
|
||||
use App\Entities\Presupuestos\PresupuestoAcabadosEntity;
|
||||
use App\Entities\Presupuestos\PresupuestoLineaEntity;
|
||||
use App\Entities\Presupuestos\PresupuestoManipuladosEntity;
|
||||
use App\Models\Configuracion\ImposicionModel;
|
||||
use App\Models\Configuracion\MaquinaModel;
|
||||
use App\Models\OrdenTrabajo\OrdenTrabajoModel;
|
||||
use App\Models\Presupuestos\PresupuestoAcabadosModel;
|
||||
@ -105,5 +107,14 @@ class OrdenTrabajoTareaEntity extends Entity
|
||||
$m = model(PresupuestoAcabadosModel::class);
|
||||
return $m->find($this->attributes["presupuesto_linea_id"]);
|
||||
}
|
||||
public function imposicion() : ?Imposicion
|
||||
{
|
||||
$m = model(ImposicionModel::class);
|
||||
$imposicion = null;
|
||||
if($this->attributes["imposicion_id"]){
|
||||
$imposicion = $m->find($this->attributes["imposicion_id"]);
|
||||
}
|
||||
return $imposicion;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -15,28 +15,35 @@ class OrdenTrabajoUserEntity extends Entity
|
||||
"orden_trabajo_id" => null,
|
||||
"user_created_id" => null,
|
||||
"user_update_id" => null,
|
||||
"inaplazable_revised_change_user_id" => null,
|
||||
"ferro_disponible_hecho_user_id" => null,
|
||||
"ferro_disponible_ok_user_id" => null,
|
||||
"ferro_entregado_user_id" => null,
|
||||
"pendiente_ferro_user_id" => null,
|
||||
"ferro_en_cliente_user_id" => null,
|
||||
"ferro_ok_user_id" => null,
|
||||
//IMPRESION
|
||||
"interior_bn_user_id" => null,
|
||||
"interior_color_user_id" => null,
|
||||
"preparacion_interior_user_id" => null,
|
||||
"cubierta_user_id" => null,
|
||||
//ACABADO
|
||||
"plastificado_user_id" => null,
|
||||
"encuadernacion_user_id" => null,
|
||||
"corte_user_id" => null,
|
||||
"embalaje_user_id" => null,
|
||||
"preparacion_interior_user_id" => null,
|
||||
"entrada_manipulado_user_id" => null,
|
||||
//FERRO
|
||||
"pendiente_ferro_user_id" => null,
|
||||
"ferro_en_cliente_user_id" => null,
|
||||
"ferro_ok_user_id" => null,
|
||||
//ENVIO
|
||||
"embalaje_user_id" => null,
|
||||
"envio_user_id" => null,
|
||||
//PREIMPRESION
|
||||
"pre_formato_user_id" => null,
|
||||
"pre_lomo_user_id" => null,
|
||||
"pre_solapa_user_id" => null,
|
||||
"pre_codbarras_user_id" => null,
|
||||
"pre_imposicion_user_id" => null,
|
||||
"pre_imprimir_user_id" => null
|
||||
//UNUSED
|
||||
"inaplazable_revised_change_user_id" => null,//!DELETE
|
||||
"ferro_disponible_hecho_user_id" => null,//!DELETE
|
||||
"ferro_entregado_user_id" => null,//!DELETE
|
||||
"pre_imprimir_user_id" => null, //!DELETE
|
||||
"ferro_disponible_ok_user_id" => null, //!DELETE
|
||||
];
|
||||
// protected array $casts = [
|
||||
// "orden_trabajo_id" => "integer",
|
||||
@ -66,7 +73,7 @@ class OrdenTrabajoUserEntity extends Entity
|
||||
// "pre_imprimir_user_id" => "?integer"
|
||||
// ];
|
||||
|
||||
protected function userBy(string $key): ?UserEntity
|
||||
public function userBy(string $key): ?UserEntity
|
||||
{
|
||||
$user = null;
|
||||
if (isset($this->attributes[$key])) {
|
||||
|
||||
@ -34,5 +34,13 @@ class TarifaEncuadernacionEntity extends \CodeIgniter\Entity\Entity
|
||||
"is_deleted" => "int",
|
||||
];
|
||||
|
||||
public function getNameInitials(): string
|
||||
{
|
||||
$words = explode(" ",$this->attributes["nombre"]);
|
||||
$words_initial = array_map(fn($w) => substr(strtoupper($w),0,1),$words);
|
||||
return implode("",$words_initial);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -39,7 +39,8 @@ return [
|
||||
"maquina_presupuesto" => "Máquina presupuesto",
|
||||
"maquina_actual" => "Máquina actual",
|
||||
"tiempo_estimado" => "Tiempo estimado",
|
||||
"tiempo" => "Tiempo"
|
||||
"tiempo" => "Tiempo",
|
||||
"imposicion" => "Imposición"
|
||||
],
|
||||
"finalizadas" => "Finalizadas",
|
||||
"pendiente_ferro" => "Ferro pendiente",
|
||||
@ -56,7 +57,7 @@ return [
|
||||
"fecha_entrega_estimada" => "Fecha entrega estimada",
|
||||
"formato" => "Formato",
|
||||
"paginas" => "Páginas",
|
||||
"guillotina" => "Guillotina",
|
||||
"guillotina" => "Guillotina/Corte",
|
||||
"tirada" => "Tirada",
|
||||
"merma" => "Merma",
|
||||
"pendiente_ferro" => "Pendiente ferro",
|
||||
@ -79,6 +80,30 @@ return [
|
||||
"solapa" => "Solapa",
|
||||
"papel_gramajes" => "Papel y gramajes",
|
||||
"estado" => "Estado",
|
||||
"pedido_espera" => "Pedido en espera"
|
||||
"pedido_espera" => "Pedido en espera",
|
||||
"imposicion_no_label" => "Sin etiqueta",
|
||||
"pliegos_de" => "pliegos de",
|
||||
"size" => "Tamaño",
|
||||
"ejemplares" => "Ejemplares",
|
||||
"tipo" => "Tipo",
|
||||
"lomo" => "Lomo",
|
||||
//IMPRESION
|
||||
"impresion_bn" => "Impresión BN",
|
||||
"cubierta" => "Cubierta/Portada",
|
||||
//PREIMPRESION
|
||||
"pre_formato" => "Revisión formato",
|
||||
"pre_lomo" => "Revisión lomo",
|
||||
"pre_solapa" => "Revisión solapa",
|
||||
"pre_codbarras" => "Revisión código barras",
|
||||
"pre_imposicion" => "Revisión imposición",
|
||||
|
||||
|
||||
"errors" => [
|
||||
"date_not_exist" => "Esta fecha no existe en el modelo",
|
||||
"attr_not_exist" => "El atributo {0,string} no pertenece al modelo Pedido"
|
||||
|
||||
]
|
||||
|
||||
|
||||
|
||||
];
|
||||
@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Configuracion;
|
||||
|
||||
class ImposicionModel extends \App\Models\BaseModel
|
||||
@ -112,4 +113,20 @@ class ImposicionModel extends \App\Models\BaseModel
|
||||
->orLike("t1.etiqueta", $search)
|
||||
->groupEnd();
|
||||
}
|
||||
|
||||
public function querySelect(?string $q)
|
||||
{
|
||||
$query = $this->builder()->select([
|
||||
"id",
|
||||
"CONCAT(lg_imposiciones.ancho,'x',lg_imposiciones.alto,'_',COALESCE(lg_imposiciones.unidades,'NULL'),'_',COALESCE(lg_imposiciones.orientacion,'NULL')) as name",
|
||||
"COALESCE(lg_imposiciones.etiqueta,'" . lang("Produccion.imposicion_no_label") . "') as description"
|
||||
]);
|
||||
if ($q) {
|
||||
$query->orLike("CONCAT(lg_imposiciones.ancho,'x',lg_imposiciones.alto)", $q);
|
||||
$query->orLike("lg_imposiciones.etiqueta", $q);
|
||||
}
|
||||
return $query
|
||||
->orderBy('id', 'ASC')
|
||||
->get()->getResultArray();
|
||||
}
|
||||
}
|
||||
|
||||
@ -5,6 +5,7 @@ namespace App\Models\OrdenTrabajo;
|
||||
use App\Entities\Produccion\OrdenTrabajoDateEntity;
|
||||
use CodeIgniter\Database\MySQLi\Builder;
|
||||
use CodeIgniter\Model;
|
||||
use Config\OrdenTrabajo;
|
||||
|
||||
class OrdenTrabajoDate extends Model
|
||||
{
|
||||
@ -17,25 +18,29 @@ class OrdenTrabajoDate extends Model
|
||||
protected $allowedFields = [
|
||||
"orden_trabajo_id",
|
||||
"fecha_entrada_at",
|
||||
"fecha_entrega_at",
|
||||
"fecha_entrega_real_at",
|
||||
"fecha_entrega_change_at",
|
||||
"fecha_impresion_at",
|
||||
"fecha_encuadernado_at",
|
||||
"fecha_externo_at",
|
||||
"pendiente_ferro_at",
|
||||
"ferro_en_cliente_at",
|
||||
"ferro_ok_at",
|
||||
//IMPRESION
|
||||
"interior_bn_at",
|
||||
"interior_color_at",
|
||||
"preparacion_interiores_at",
|
||||
"cubierta_at",
|
||||
//ACABADO
|
||||
"plastificado_at",
|
||||
"encuadernacion_at",
|
||||
"corte_at",
|
||||
"preparacion_interiores_at",
|
||||
"entrada_manipulado_at",
|
||||
//FERRO
|
||||
"pendiente_ferro_at",
|
||||
"ferro_en_cliente_at",
|
||||
"ferro_ok_at",
|
||||
//ENVIO
|
||||
"embalaje_at",
|
||||
"envio_at",
|
||||
"entrada_manipulado_at"
|
||||
//PREIMPRESION
|
||||
"pre_formato_at",
|
||||
"pre_lomo_at",
|
||||
"pre_solapa_at",
|
||||
"pre_codbarras_at",
|
||||
"pre_imposicion_at"
|
||||
];
|
||||
|
||||
protected bool $allowEmptyInserts = false;
|
||||
@ -103,22 +108,8 @@ class OrdenTrabajoDate extends Model
|
||||
return $data;
|
||||
}
|
||||
public function updateUserDateMap($orden_trabajo_id,$data){
|
||||
$mapping = [
|
||||
"fecha_encuadernado_at" => "encuadernacion_user_id",
|
||||
// "fecha_externo_at" => "null",
|
||||
"fecha_impresion_at" => null,
|
||||
"pendiente_ferro_at" => "pendiente_ferro_user_id",
|
||||
"ferro_en_cliente_at" => "ferro_en_cliente_user_id",
|
||||
"ferro_ok_at" => "ferro_ok_user_id",
|
||||
"interior_bn_at" => "interior_bn_user_id",
|
||||
"interior_color_at" => "interior_color_user_id",
|
||||
"preparacion_interiores_at" => "preparacion_interior_user_id",
|
||||
"cubierta_at" => "cubierta_user_id",
|
||||
"plastificado_at" => "plastificado_user_id",
|
||||
"corte_at" => "corte_user_id",
|
||||
"embalaje_at" => "embalaje_user_id",
|
||||
"entrada_manipulado_at" => "entrada_manipulado_user_id"
|
||||
];
|
||||
$ordenTrabajoConfig = new OrdenTrabajo();
|
||||
$mapping = $ordenTrabajoConfig->DATE_USER_MAPPING;
|
||||
$otUser = model(OrdenTrabajoUser::class);
|
||||
$auth_user_id = auth()->user()->id;
|
||||
foreach ($data as $key => $value) {
|
||||
|
||||
@ -82,7 +82,9 @@ class OrdenTrabajoModel extends Model
|
||||
"tipos_presupuestos.codigo as tipo_presupuesto_impresion",
|
||||
"ordenes_trabajo.progreso",
|
||||
"presupuesto_linea.tipo as presupuesto_linea_tipo",
|
||||
"orden_trabajo_dates.ferro_ok_at"
|
||||
"orden_trabajo_dates.ferro_ok_at",
|
||||
"CONCAT(lg_imposiciones.ancho,'x',lg_imposiciones.alto,'_',COALESCE(lg_imposiciones.unidades,'NULL'),'_',COALESCE(lg_imposiciones.orientacion,'NULL')) as imposicion_name"
|
||||
|
||||
])
|
||||
->join("orden_trabajo_dates","orden_trabajo_dates.orden_trabajo_id = ordenes_trabajo.id","left")
|
||||
->join("pedidos","pedidos.id = ordenes_trabajo.pedido_id","left")
|
||||
@ -92,6 +94,9 @@ class OrdenTrabajoModel extends Model
|
||||
->join("clientes","clientes.id = presupuestos.cliente_id","left")
|
||||
->join("tipos_presupuestos","presupuestos.tipo_impresion_id = tipos_presupuestos.id","left")
|
||||
->join("ubicaciones","ubicaciones.id = pedidos_linea.ubicacion_id","left")
|
||||
->join("orden_trabajo_tareas","orden_trabajo_tareas.orden_trabajo_id = ordenes_trabajo.id","left")
|
||||
->join("lg_imposiciones","lg_imposiciones.id = orden_trabajo_tareas.imposicion_id","left")
|
||||
|
||||
->whereIn("presupuesto_linea.tipo",["lp_bn","lp_bnhq","lp_rot_bn","lp_color","lp_colorhq","lp_rot_color"])
|
||||
->where("ordenes_trabajo.deleted_at",null)
|
||||
->groupBy("ordenes_trabajo.id");
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
namespace App\Models\OrdenTrabajo;
|
||||
|
||||
use App\Entities\Produccion\OrdenTrabajoUserEntity;
|
||||
use App\Models\Usuarios\UserModel;
|
||||
use CodeIgniter\Database\MySQLi\Builder;
|
||||
use CodeIgniter\Model;
|
||||
|
||||
@ -18,28 +19,35 @@ class OrdenTrabajoUser extends Model
|
||||
"orden_trabajo_id",
|
||||
"user_created_id",
|
||||
"user_update_id",
|
||||
"inaplazable_revised_change_user_id",
|
||||
"ferro_disponible_hecho_user_id",
|
||||
"ferro_disponible_ok_user_id",
|
||||
"ferro_entregado_user_id",
|
||||
"pendiente_ferro_user_id",
|
||||
"ferro_en_cliente_user_id",
|
||||
"ferro_ok_user_id",
|
||||
//IMPRESION
|
||||
"interior_bn_user_id",
|
||||
"interior_color_user_id",
|
||||
"preparacion_interior_user_id",
|
||||
"cubierta_user_id",
|
||||
//ACABADO
|
||||
"plastificado_user_id",
|
||||
"encuadernacion_user_id",
|
||||
"corte_user_id",
|
||||
"embalaje_user_id",
|
||||
"preparacion_interior_user_id",
|
||||
"entrada_manipulado_user_id",
|
||||
//FERRO
|
||||
"pendiente_ferro_user_id",
|
||||
"ferro_en_cliente_user_id",
|
||||
"ferro_ok_user_id",
|
||||
//ENVIO
|
||||
"embalaje_user_id",
|
||||
"envio_user_id",
|
||||
//PREIMPRESION
|
||||
"pre_formato_user_id",
|
||||
"pre_lomo_user_id",
|
||||
"pre_solapa_user_id",
|
||||
"pre_codbarras_user_id",
|
||||
"pre_imposicion_user_id",
|
||||
"pre_imprimir_user_id"
|
||||
//UNUSED
|
||||
"inaplazable_revised_change_user_id",//!DELETE
|
||||
"ferro_disponible_hecho_user_id",//!DELETE
|
||||
"ferro_entregado_user_id",//!DELETE
|
||||
"pre_imprimir_user_id", //!DELETE
|
||||
"ferro_disponible_ok_user_id", //!DELETE
|
||||
];
|
||||
|
||||
protected bool $allowEmptyInserts = false;
|
||||
@ -73,5 +81,4 @@ class OrdenTrabajoUser extends Model
|
||||
protected $afterDelete = [];
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
namespace App\Services;
|
||||
|
||||
use App\Entities\Clientes\ClienteEntity;
|
||||
use App\Entities\Configuracion\Imposicion;
|
||||
use App\Entities\Pedidos\PedidoEntity;
|
||||
use App\Entities\Presupuestos\PresupuestoEntity;
|
||||
use App\Entities\Presupuestos\PresupuestoLineaEntity;
|
||||
@ -18,12 +19,14 @@ use App\Entities\Produccion\OrdenTrabajoTareaEntity;
|
||||
use App\Models\Configuracion\ConfigVariableModel;
|
||||
use App\Models\Configuracion\MaquinaModel;
|
||||
use App\Models\OrdenTrabajo\OrdenTrabajoFileModel;
|
||||
use App\Models\Pedidos\PedidoModel;
|
||||
use App\Models\Usuarios\UserModel;
|
||||
use CodeIgniter\Database\BaseBuilder;
|
||||
use CodeIgniter\Database\BaseResult;
|
||||
use CodeIgniter\Database\Exceptions\DatabaseException;
|
||||
use CodeIgniter\HTTP\Files\UploadedFile;
|
||||
use CodeIgniter\I18n\Time;
|
||||
use Config\OrdenTrabajo;
|
||||
use Exception;
|
||||
|
||||
/**
|
||||
@ -41,26 +44,12 @@ class ProductionService extends BaseService
|
||||
protected OrdenTrabajoUser $otUser;
|
||||
protected OrdenTrabajoEntity $ot;
|
||||
protected OrdenTrabajoFileModel $otFileModel;
|
||||
protected PedidoModel $pedidoModel;
|
||||
protected UserModel $userModel;
|
||||
protected string $defaultMaquinaCorteName = 'HT-1000';
|
||||
protected MaquinaEntity $defaultMaquinaCorte;
|
||||
protected MaquinaModel $maquinaModel;
|
||||
protected array $MAPPING_DATE_USER = [
|
||||
"fecha_encuadernado_at" => "encuadernacion_user_id",
|
||||
// "fecha_externo_at" => "null",
|
||||
"fecha_impresion_at" => null,
|
||||
"pendiente_ferro_at" => "pendiente_ferro_user_id",
|
||||
"ferro_en_cliente_at" => "ferro_en_cliente_user_id",
|
||||
"ferro_ok_at" => "ferro_ok_user_id",
|
||||
"interior_bn_at" => "interior_bn_user_id",
|
||||
"interior_color_at" => "interior_color_user_id",
|
||||
"preparacion_interiores_at" => "preparacion_interior_user_id",
|
||||
"cubierta_at" => "cubierta_user_id",
|
||||
"plastificado_at" => "plastificado_user_id",
|
||||
"corte_at" => "corte_user_id",
|
||||
"embalaje_at" => "embalaje_user_id",
|
||||
"entrada_manipulado_at" => "entrada_manipulado_user_id"
|
||||
];
|
||||
protected OrdenTrabajo $ordenTrabajoConfig;
|
||||
|
||||
/**
|
||||
* Pedido Entity
|
||||
@ -83,6 +72,8 @@ class ProductionService extends BaseService
|
||||
$this->otUser = model(OrdenTrabajoUser::class);
|
||||
$this->userModel = model(UserModel::class);
|
||||
$this->otFileModel = model(OrdenTrabajoFileModel::class);
|
||||
$this->pedidoModel = model(PedidoModel::class);
|
||||
$this->ordenTrabajoConfig = config('OrdenTrabajo');
|
||||
}
|
||||
public function init(int $orden_trabajo_id): self
|
||||
{
|
||||
@ -414,9 +405,12 @@ class ProductionService extends BaseService
|
||||
"orden_trabajo_tareas.maquina_id as maquina_tarea",
|
||||
"lg_maquinas.nombre as maquina_nombre",
|
||||
"lg_imposiciones.id as imposicion_id",
|
||||
"CONCAT(lg_imposiciones.ancho,'x',lg_imposiciones.alto,'_',COALESCE(lg_imposiciones.unidades,'NULL'),'_',COALESCE(lg_imposiciones.orientacion,'NULL'),'_',COALESCE(lg_imposiciones.etiqueta,'')) as imposicion_name",
|
||||
"orden_trabajo_tareas.tiempo_estimado",
|
||||
"orden_trabajo_tareas.tiempo_real",
|
||||
"orden_trabajo_tareas.comment",
|
||||
"orden_trabajo_tareas.presupuesto_linea_id",
|
||||
"presupuesto_linea.tipo",
|
||||
|
||||
])
|
||||
->join("orden_trabajo_tareas", "orden_trabajo_tareas.orden_trabajo_id = ordenes_trabajo.id", "left")
|
||||
@ -623,6 +617,7 @@ class ProductionService extends BaseService
|
||||
"pedido" => $this->pedido,
|
||||
"presupuesto" => $this->presupuesto,
|
||||
"dates" => $this->ot->dates(),
|
||||
"user_dates" => $this->userDates(),
|
||||
"tasks" => $this->ot->tareas(),
|
||||
"acabados" => $this->presupuesto->acabados(),
|
||||
"preimpresiones" => $this->presupuesto->preimpresiones(),
|
||||
@ -635,6 +630,7 @@ class ProductionService extends BaseService
|
||||
"tareas_encuadernacion" => $this->tareas_encuadernacion(),
|
||||
"tareas_preimpresion" => $this->tareas_preimpresion(),
|
||||
"tareas_impresion" => $this->tareas_impresion(),
|
||||
"tiempo_procesamiento" => $this->getTiempoProcesamientoHHMM(),
|
||||
];
|
||||
return $summary;
|
||||
}
|
||||
@ -657,39 +653,55 @@ class ProductionService extends BaseService
|
||||
"linea_impresion" => $this->presupuesto->presupuestoLineaImpresion(),
|
||||
"linea_cubierta" => $this->presupuesto->presupuestoLineaCubierta(),
|
||||
"peso_unidad" => $logistica_data["peso_unidad"],
|
||||
"peso_pedido" => $logistica_data["peso_pedido"]
|
||||
"peso_pedido" => $logistica_data["peso_pedido"],
|
||||
"imposicion" => $this->getImposicionTareaImpresion(),
|
||||
"tiempo_procesamiento" => $this->getTiempoProcesamientoHHMM(),
|
||||
|
||||
];
|
||||
}
|
||||
public function getTareaImpresionSobreCubierta(): array
|
||||
public function getImposicionTareaImpresion(): ?Imposicion
|
||||
{
|
||||
$imposicion = null;
|
||||
$impresionInteriorBnImposicion = $this->getTareaImpresionInteriorBn()?->imposicion();
|
||||
$impresionInteriorColorImposicion = $this->getTareaImpresionInteriorColor()?->imposicion();
|
||||
if ($impresionInteriorBnImposicion) {
|
||||
$imposicion = $impresionInteriorBnImposicion;
|
||||
}
|
||||
if ($impresionInteriorColorImposicion) {
|
||||
$imposicion = $impresionInteriorColorImposicion;
|
||||
}
|
||||
return $imposicion;
|
||||
}
|
||||
public function getTareaImpresionSobreCubierta(): ?OrdenTrabajoTareaEntity
|
||||
{
|
||||
$q = $this->otTarea->select('orden_trabajo_tareas.*')
|
||||
->join("presupuesto_linea", "presupuesto_linea.id = orden_trabajo_tareas.presupuesto_linea_id", "left")
|
||||
->where("orden_trabajo_tareas.orden_trabajo_id", $this->ot->id)
|
||||
->whereIn("presupuesto_linea.tipo", ["lp_sobrecubierta"])->findAll();
|
||||
->whereIn("presupuesto_linea.tipo", ["lp_sobrecubierta"])->first();
|
||||
return $q;
|
||||
}
|
||||
public function getTareaImpresionCubierta(): array
|
||||
public function getTareaImpresionCubierta(): ?OrdenTrabajoTareaEntity
|
||||
{
|
||||
$q = $this->otTarea->select('orden_trabajo_tareas.*')
|
||||
->join("presupuesto_linea", "presupuesto_linea.id = orden_trabajo_tareas.presupuesto_linea_id", "left")
|
||||
->where("orden_trabajo_tareas.orden_trabajo_id", $this->ot->id)
|
||||
->whereIn("presupuesto_linea.tipo", ["lp_cubierta"])->findAll();
|
||||
->whereIn("presupuesto_linea.tipo", ["lp_cubierta"])->first();
|
||||
return $q;
|
||||
}
|
||||
public function getTareaImpresionInteriorBn(): array
|
||||
public function getTareaImpresionInteriorBn(): ?OrdenTrabajoTareaEntity
|
||||
{
|
||||
$q = $this->otTarea->select('orden_trabajo_tareas.*')
|
||||
->join("presupuesto_linea", "presupuesto_linea.id = orden_trabajo_tareas.presupuesto_linea_id", "left")
|
||||
->where("orden_trabajo_tareas.orden_trabajo_id", $this->ot->id)
|
||||
->whereIn("presupuesto_linea.tipo", ["lp_rot_bn", "lp_bn", "lp_bnhq"])->findAll();
|
||||
->whereIn("presupuesto_linea.tipo", ["lp_rot_bn", "lp_bn", "lp_bnhq"])->first();
|
||||
return $q;
|
||||
}
|
||||
public function getTareaImpresionInteriorColor(): array
|
||||
public function getTareaImpresionInteriorColor(): ?OrdenTrabajoTareaEntity
|
||||
{
|
||||
$q = $this->otTarea->select('orden_trabajo_tareas.*')
|
||||
->join("presupuesto_linea", "presupuesto_linea.id = orden_trabajo_tareas.presupuesto_linea_id", "left")
|
||||
->where("orden_trabajo_tareas.orden_trabajo_id", $this->ot->id)
|
||||
->whereIn("presupuesto_linea.tipo", ["lp_rot_color", "lp_color", "lp_colorhq"])->findAll();
|
||||
->whereIn("presupuesto_linea.tipo", ["lp_rot_color", "lp_color", "lp_colorhq"])->first();
|
||||
return $q;
|
||||
}
|
||||
public function getPresupuestoLineaImpresion() {}
|
||||
@ -739,8 +751,8 @@ class ProductionService extends BaseService
|
||||
->update($data);
|
||||
$this->otDate->updateUserDateMap($this->ot->id, $data);
|
||||
$ot_users = $this->ot->users();
|
||||
if (isset($this->MAPPING_DATE_USER[$data["name"]])) {
|
||||
$user_id = $ot_users->{$this->MAPPING_DATE_USER[$data["name"]]};
|
||||
if (isset($this->ordenTrabajoConfig->DATE_USER_MAPPING[$data["name"]])) {
|
||||
$user_id = $ot_users->{$this->ordenTrabajoConfig->DATE_USER_MAPPING[$data["name"]]};
|
||||
$user = $this->userModel->find($user_id);
|
||||
if ($user_id) {
|
||||
$result = ["user" => null, "status" => false];
|
||||
@ -749,16 +761,45 @@ class ProductionService extends BaseService
|
||||
} else {
|
||||
$result = ["user" => null, "status" => false];
|
||||
}
|
||||
$this->updateProgress();
|
||||
return $result;
|
||||
}
|
||||
public function updateOrdenTrabajoPedidoDate($data): array
|
||||
{
|
||||
$status = false;
|
||||
$user = auth()->user();
|
||||
$row = [];
|
||||
$pedidoDatesUser = $this->ordenTrabajoConfig->DATE_USER_MAPPING_PEDIDO;
|
||||
$attrPedido = $data["name"];
|
||||
if (isset($pedidoDatesUser[$attrPedido])) {
|
||||
$row[$attrPedido] = Time::createFromFormat("Y-m-d", $data[$attrPedido])->format('Y-m-d 00:00:00');
|
||||
$attrUserPedido = $pedidoDatesUser[$attrPedido];
|
||||
$row[$attrUserPedido] = $user->id;
|
||||
$status = $this->pedidoModel->update($this->pedido->id, $row);
|
||||
$this->updateProgress();
|
||||
} else {
|
||||
throw new Exception(lang('Produccion.errors.attr_not_exist', [$attrPedido]));
|
||||
}
|
||||
|
||||
return [
|
||||
"user" => $user,
|
||||
"status" => $status
|
||||
];
|
||||
}
|
||||
public function updateOrdenTrabajo($data): bool
|
||||
{
|
||||
if(isset($data["is_pedido_espera"])){
|
||||
if (isset($data["is_pedido_espera"])) {
|
||||
$data["pedido_espera_by"] = auth()->user()->id;
|
||||
}
|
||||
return $this->otModel->update($this->ot->id, $data);
|
||||
}
|
||||
public function updateOrdenTrabajoPedido($data)
|
||||
{
|
||||
if (isset($data["inaplazable"])) {
|
||||
$data[$this->ordenTrabajoConfig->DATE_USER_MAPPING_PEDIDO["inaplazable"]] = auth()->user()->id;
|
||||
}
|
||||
return $this->pedidoModel->update($this->pedido->id, $data);
|
||||
}
|
||||
/**========================================================================
|
||||
* RELATION METHODS
|
||||
*========================================================================**/
|
||||
@ -1016,4 +1057,60 @@ class ProductionService extends BaseService
|
||||
}
|
||||
return $status;
|
||||
}
|
||||
public function userDates(): array
|
||||
{
|
||||
$userDates = [];
|
||||
foreach ($this->ordenTrabajoConfig->DATE_USER_MAPPING as $key => $value) {
|
||||
$otUserEntity = $this->otUser->where("orden_trabajo_id", $this->ot->id)->first();
|
||||
$userEntity = $otUserEntity->userBy($value);
|
||||
if ($userEntity) {
|
||||
$userDates[$key] = $userEntity->full_name;
|
||||
} else {
|
||||
$userDates[$key] = null;
|
||||
}
|
||||
}
|
||||
return $userDates;
|
||||
}
|
||||
public function pedidoUserDates(): array
|
||||
{
|
||||
$pedidoUserDates = [];
|
||||
foreach ($this->ordenTrabajoConfig->DATE_USER_MAPPING_PEDIDO as $key => $value) {
|
||||
$userEntity = $this->pedido->userBy($value);
|
||||
if ($userEntity) {
|
||||
$pedidoUserDates[$key] = $userEntity->full_name;
|
||||
} else {
|
||||
$pedidoUserDates[$key] = null;
|
||||
}
|
||||
}
|
||||
return $pedidoUserDates;
|
||||
}
|
||||
public function getTiempoProcesamientoHHMM(): string
|
||||
{
|
||||
$time_tareas_seconds = array_map(fn($q) => $q->tiempo_estimado ?? 0, $this->ot->tareas());
|
||||
$seconds = array_sum($time_tareas_seconds);
|
||||
return float_seconds_to_hhmm_string($seconds);
|
||||
}
|
||||
public function updateProgress(): bool
|
||||
{
|
||||
$userDates = $this->ordenTrabajoConfig->DATE_USER_MAPPING;
|
||||
$pedidoUserDates = $this->ordenTrabajoConfig->DATE_USER_MAPPING_PEDIDO;
|
||||
|
||||
$fill_dates = 0;
|
||||
$status = false;
|
||||
$total = count($userDates) + count($pedidoUserDates);
|
||||
if ($this->ot->estado != "F") {
|
||||
foreach ($userDates as $key => $value) {
|
||||
if ($this->ot->dates()->{$key} != null) $fill_dates++;
|
||||
}
|
||||
foreach ($pedidoUserDates as $key => $value) {
|
||||
if ($this->pedido->{$key} != null) $fill_dates++;
|
||||
}
|
||||
|
||||
$progreso = (float) $fill_dates / $total * 100;
|
||||
$status = $this->otModel->update($this->ot->id, ["progreso" => round($progreso,2)]);
|
||||
}else{
|
||||
$status = $this->otModel->update($this->ot->id, ["progreso" => 100]);
|
||||
}
|
||||
return $status;
|
||||
}
|
||||
}
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
<th><?= lang('Produccion.task.task') ?></th>
|
||||
<th><?= lang('Produccion.task.maquina_presupuesto') ?></th>
|
||||
<th><?= lang('Produccion.task.maquina_actual') ?></th>
|
||||
<!-- <th><?= lang('Produccion.task.imposicion_id') ?></th> -->
|
||||
<th><?= lang('Produccion.task.imposicion') ?></th>
|
||||
<th><?= lang('Produccion.task.tiempo_estimado') ?></th>
|
||||
<th><?= lang('Produccion.task.tiempo') ?></th>
|
||||
<th></th>
|
||||
|
||||
@ -15,27 +15,33 @@
|
||||
<div class="row">
|
||||
<!-- Date 1-->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2">
|
||||
<label for="ot-tiempo-procesamiento" class="form-label"><?= @lang("Produccion.tiempo_procesamiento") ?></label>
|
||||
<label for="ot-tiempo-procesamiento" class="form-label"><?= @lang("Produccion.tiempo_procesamiento") ?> (HH:MM)</label>
|
||||
<input type="text" class="form-control" name="tiempo_procesamiento" placeholder="HH:MM" id="ot-tiempo-procesamiento" data-input disabled>
|
||||
</div>
|
||||
<!-- Date 2-->
|
||||
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2">
|
||||
<label for="ot-fecha-entrega" class="form-label"><?= @lang("Produccion.fecha_impresion") ?></label>
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="fecha_impresion_at" id="ot-fecha-impresion" data-input>
|
||||
<input type="text" class="form-control ot-pedido" placeholder="DD/MM/YYYY" name="fecha_impresion" id="ot-fecha-impresion" data-input>
|
||||
<div class="form-text"><?= $pedido_user_dates["fecha_impresion"] ?></div>
|
||||
|
||||
|
||||
</div>
|
||||
<!-- Date 2-->
|
||||
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2">
|
||||
<label for="ot-fecha-entrega" class="form-label"><?= @lang("Produccion.fecha_encuadernado") ?></label>
|
||||
<input type="date" class="form-control ot-date" placeholder="DD/MM/YYYY" name="fecha_encuadernado_at" id="ot-fecha-encuadernado" data-input />
|
||||
<input type="date" class="form-control ot-pedido" placeholder="DD/MM/YYYY" name="fecha_encuadernado" id="ot-fecha-encuadernado" data-input />
|
||||
<div class="form-text"><?= $pedido_user_dates["fecha_encuadernado"] ?></div>
|
||||
|
||||
</div>
|
||||
<!-- Date 4-->
|
||||
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2">
|
||||
<label for="ot-fecha-entrega" class="form-label"><?= @lang("Produccion.fecha_entrega_externo") ?></label>
|
||||
<input type="date" class="form-control ot-date" placeholder="DD/MM/YYYY" name="fecha_entrega_externo" id="ot-fecha-entrega-externo" data-input />
|
||||
<input type="date" class="form-control ot-pedido" placeholder="DD/MM/YYYY" name="fecha_entrega_externo" id="ot-fecha-entrega-externo" data-input />
|
||||
<div class="form-text"><?= $pedido_user_dates["fecha_entrega_externo"] ?></div>
|
||||
|
||||
</div>
|
||||
<!-- Date 5-->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2">
|
||||
@ -43,12 +49,13 @@
|
||||
<div>
|
||||
|
||||
<label for="ot-fecha-entrega" class="form-label"><?= @lang("Produccion.fecha_entrega_real") ?></label>
|
||||
<input type="date" class="form-control ot-date" placeholder="DD/MM/YYYY" name="fecha_entrega_real_at" id="ot-fecha-entrega-real" data-input />
|
||||
<input type="date" class="form-control ot-pedido" placeholder="DD/MM/YYYY" name="fecha_entrega_real" id="ot-fecha-entrega-real" data-input />
|
||||
<div class="form-text"><?= $pedido_user_dates["fecha_entrega_real"] ?></div>
|
||||
</div>
|
||||
<div class="d-flex flex-column">
|
||||
|
||||
<label class="switch switch-danger switch-lg mt-1">
|
||||
<input type="checkbox" class="switch-input ot-preview" name="fecha_entrega_warning" />
|
||||
<input type="checkbox" class="switch-input ot-pedido-check" name="inaplazable" />
|
||||
<span class="switch-toggle-slider">
|
||||
<span class="switch-on">
|
||||
<i class="ti ti-alert-triangle"></i>
|
||||
@ -59,6 +66,7 @@
|
||||
</span>
|
||||
<span class="switch-label fw-large">Inaplazable</span>
|
||||
</label>
|
||||
<div class="form-text"><?= $pedido_user_dates["inaplazable"] ?></div>
|
||||
<label class="switch switch-lg mt-1">
|
||||
<input type="checkbox" class="switch-input ot-preview" name="fecha_entrega_warning_revised" />
|
||||
<span class="switch-toggle-slider">
|
||||
|
||||
@ -15,7 +15,7 @@
|
||||
<div class="col-md-8">
|
||||
<div class="card-body">
|
||||
<h1 class="card-title mb-0">[<?= $presupuesto->id ?>]<?= $presupuesto->titulo ?></h1>
|
||||
<h4 class="card-title mb-0 text-secondary"><?= $cliente->nombre ?></h4>
|
||||
<h4 class="card-title mb-0 text-secondary"><?= $cliente->nombre ?> (<?= $cliente->alias ?>)</h4>
|
||||
<h3 class="card-title mb-3">OT : <?= $ot->id ?></h3>
|
||||
<div class="d-flex align-items-center">
|
||||
<div class="card-info">
|
||||
|
||||
@ -15,75 +15,142 @@
|
||||
<div class="row">
|
||||
<div class="col-md-12 mb-3">
|
||||
<label class="form-label" for="ot-progress-bar-parent"><?= @lang("App.progress") ?></label>
|
||||
<div class="progress" id="ot-progress-bar-parent">
|
||||
<div class="progress" style="height: 25px;" id="ot-progress-bar-parent">
|
||||
<div id="ot-progress-bar" class="progress-bar" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<!-- PREIMPRESION -->
|
||||
<!-- Preformato -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100">
|
||||
<label for="ot-preformato-btn" class="form-label"><?= @lang("Produccion.pre_formato") ?></label>
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="pre_formato_at" id="ot-preformato-date">
|
||||
<div class="form-text"><?=$user_dates["pre_formato_at"]?></div>
|
||||
</div>
|
||||
<!-- Prelomo -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100">
|
||||
<label for="ot-prelomo-btn" class="form-label"><?= @lang("Produccion.pre_lomo") ?></label>
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="pre_lomo_at" id="ot-prelomo-date">
|
||||
<div class="form-text"><?=$user_dates["pre_lomo_at"]?></div>
|
||||
|
||||
</div>
|
||||
<!-- Presolapa -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100">
|
||||
<label for="ot-presolapa-btn" class="form-label"><?= @lang("Produccion.pre_solapa") ?></label>
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="pre_solapa_at" id="ot-presolapa-date">
|
||||
<div class="form-text"><?=$user_dates["pre_solapa_at"]?></div>
|
||||
|
||||
</div>
|
||||
<!-- Precodbarras -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100">
|
||||
<label for="ot-precodbarras-btn" class="form-label"><?= @lang("Produccion.pre_codbarras") ?></label>
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="pre_codbarras_at" id="ot-precodbarras-date">
|
||||
<div class="form-text"><?=$user_dates["pre_codbarras_at"]?></div>
|
||||
|
||||
</div>
|
||||
<!-- Preimposicion -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100">
|
||||
<label for="ot-preimposicion-btn" class="form-label"><?= @lang("Produccion.pre_imposicion") ?></label>
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="pre_imposicion_at" id="ot-preimposicion-date">
|
||||
<div class="form-text"><?=$user_dates["pre_imposicion_at"]?></div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2">
|
||||
<label for="ot-pendiente-ferro" class="form-label"><?= @lang("Produccion.pendiente_ferro") ?></label>
|
||||
<input type="text" class="form-control ot-date" name="pendiente_ferro_at" placeholder="DD/MM/YYYY" id="ot-pendiente-ferro">
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100">
|
||||
<label for="ot-impresion-color" class="form-label"><?= @lang("Produccion.impresion_bn") ?></label>
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="interior_bn_at" id="ot-impresion-bn">
|
||||
<div class="form-text"><?=$user_dates["interior_bn_at"]?></div>
|
||||
|
||||
</div>
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2">
|
||||
<label for="ot-ferro-cliente" class="form-label"><?= @lang("Produccion.ferro_cliente") ?></label>
|
||||
<input type="text" class="form-control ot-date" name="ferro_en_cliente_at" placeholder="DD/MM/YYYY" id="ot-ferro-cliente">
|
||||
</div>
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2">
|
||||
<label for="ot-ferro-ok" class="form-label"><?= @lang("Produccion.ferro_ok") ?></label>
|
||||
<input type="text" class="form-control ot-date" name="ferro_ok_at" placeholder="DD/MM/YYYY" id="ot-ferro-ok">
|
||||
</div>
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2">
|
||||
<label for="ot-plakene-traslucido" class="form-label"><?= @lang("Produccion.plakene_traslucido") ?></label>
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="plakene_taslucido_at" id="ot-plakene-traslucido">
|
||||
</div>
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2">
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100">
|
||||
<label for="ot-impresion-color" class="form-label"><?= @lang("Produccion.impresion_color") ?></label>
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="interior_color_at" id="ot-impresion-color">
|
||||
<div class="form-text"><?=$user_dates["interior_color_at"]?></div>
|
||||
|
||||
</div>
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2">
|
||||
<label for="ot-portada" class="form-label"><?= @lang("Produccion.portada") ?></label>
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100">
|
||||
<label for="ot-portada" class="form-label"><?= @lang("Produccion.cubierta") ?></label>
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="cubierta_at" id="ot-portada">
|
||||
<div class="form-text"><?=$user_dates["cubierta_at"]?></div>
|
||||
|
||||
</div>
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2">
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100">
|
||||
<label for="ot-plakene-traslucido" class="form-label"><?= @lang("Produccion.plakene_traslucido") ?></label>
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="plakene_taslucido_at" id="ot-plakene-traslucido">
|
||||
<div class="form-text"></div>
|
||||
|
||||
</div>
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100">
|
||||
<label for="ot-plastificado-mate" class="form-label"><?= @lang("Produccion.plastificado_mate") ?></label>
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="plastificado_at" id="ot-plastificado-mate">
|
||||
<div class="form-text"><?=$user_dates["plastificado_at"]?></div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
|
||||
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2">
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100">
|
||||
<label for="ot-prep-guillotina" class="form-label"><?= @lang("Produccion.guillotina") ?></label>
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="corte_at" id="ot-prep-guillotina">
|
||||
<div class="form-text"><?=$user_dates["corte_at"]?></div>
|
||||
|
||||
</div>
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2">
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100">
|
||||
<label for="ot-espiral" class="form-label"><?= @lang("Produccion.espiral") ?></label>
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="espiral_at" id="ot-espiral">
|
||||
<div class="form-text"></div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100">
|
||||
<label for="ot-pendiente-ferro" class="form-label"><?= @lang("Produccion.pendiente_ferro") ?></label>
|
||||
<input type="text" class="form-control ot-date" name="pendiente_ferro_at" placeholder="DD/MM/YYYY" id="ot-pendiente-ferro">
|
||||
<div class="form-text"><?=$user_dates["pendiente_ferro_at"]?></div>
|
||||
|
||||
</div>
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2">
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100">
|
||||
<label for="ot-ferro-cliente" class="form-label"><?= @lang("Produccion.ferro_cliente") ?></label>
|
||||
<input type="text" class="form-control ot-date" name="ferro_en_cliente_at" placeholder="DD/MM/YYYY" id="ot-ferro-cliente">
|
||||
<div class="form-text"><?=$user_dates["ferro_en_cliente_at"]?></div>
|
||||
|
||||
</div>
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100">
|
||||
<label for="ot-ferro-ok" class="form-label"><?= @lang("Produccion.ferro_ok") ?></label>
|
||||
<input type="text" class="form-control ot-date" name="ferro_ok_at" placeholder="DD/MM/YYYY" id="ot-ferro-ok">
|
||||
<div class="form-text"><?=$user_dates["ferro_ok_at"]?></div>
|
||||
|
||||
</div>
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100">
|
||||
<label for="ot-embalaje" class="form-label"><?= @lang("Produccion.embalaje") ?></label>
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="embalaje_at" id="ot-embalaje">
|
||||
<div class="form-text"><?=$user_dates["embalaje_at"]?></div>
|
||||
|
||||
</div>
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2">
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100">
|
||||
<label for="ot-envio" class="form-label"><?= @lang("Produccion.envio") ?></label>
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="envio_at" id="ot-envio">
|
||||
<div class="form-text"><?=$user_dates["envio_at"]?></div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- <div class="col-xs-12 col-md-4 col-lg-4 mb-2">
|
||||
<label for="ot-estado" class="form-label"><?= @lang("Produccion.estado") ?></label>
|
||||
<select class="form-control ot-preview" name="estado" id="ot-estado">
|
||||
<option value="I">INICIADA</option>
|
||||
<option value="E">ERROR</option>
|
||||
<option value="P">PENDIENTE</option>
|
||||
</select>
|
||||
</div> -->
|
||||
|
||||
</div>
|
||||
<div class="row">
|
||||
|
||||
@ -52,6 +52,8 @@
|
||||
|
||||
<?= $this->section('css') ?>
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/libs/formvalidation/dist/css/formValidation.min.css') ?>" />
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/css/ot.css') ?>" />
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
<?= $this->section("additionalExternalJs") ?>
|
||||
|
||||
@ -44,13 +44,13 @@ $settings = $session->get('settings');
|
||||
</div>
|
||||
<div class="row mb-2 d-flex flex align-items-stretch">
|
||||
<div class="col-2">
|
||||
<img class="portada-img border-secondary img-thumbnail img-fluid" src="<?= $ot->portada_path ? "data:image/png;base64,".base64_encode(file_get_contents(WRITEPATH . "uploads/" . $ot->portada_path)): '/assets/img/portada_not_found.png' ?>" />
|
||||
<img class="portada-img border-secondary img-thumbnail img-fluid" src="<?= $ot->portada_path ? "data:image/png;base64," . base64_encode(file_get_contents(WRITEPATH . "uploads/" . $ot->portada_path)) : '/assets/img/portada_not_found.png' ?>" />
|
||||
</div>
|
||||
<div class="col-10 <?= $ot->fecha_entrega_warning ? "bg-danger" : "bg-secondary" ?> py-2 rounded border-1 border-secondary">
|
||||
<div class="row">
|
||||
<div class="col-8">
|
||||
<div class="px-2 d-flex flex justify-content-between align-items-center mb-2 border boder-1 border-dark bg-primary text-white rounded-pill bordered border-secondary">
|
||||
<span><strong><?= $dates->fecha_encuadernado_at ? week_day_humanize(Time::createFromFormat("Y-m-d", $dates->fecha_encuadernado_at)->getDayOfWeek(), true) : "" ?></strong></span>
|
||||
<span><strong><?= $pedido->fecha_encuadernado ? week_day_humanize(Time::createFromFormat("Y-m-d H:i:s", $pedido->fecha_encuadernado)->getDayOfWeek(), true) : "" ?></strong></span>
|
||||
<span><strong>Comercial:</strong> <?= $cliente->first_name . " " . $cliente->comercial()->last_name ?> </span>
|
||||
</div>
|
||||
</div>
|
||||
@ -64,11 +64,11 @@ $settings = $session->get('settings');
|
||||
<div class="row p-2">
|
||||
<div class="col-4 h-100">
|
||||
<div class="row px-2 d-flex flex justify-content-between align-items-center">
|
||||
<div class="col-6 w-75 border border-1 border-dark text-center <?= $ot->fecha_entrega_warning ? "bg-danger" : "bg-secondary" ?> ">
|
||||
<span class="text-white" id="fecha_encuadernado_at"><strong><?= $dates->fecha_encuadernado_at ? Time::createFromFormat("Y-m-d", $dates->fecha_encuadernado_at)?->format("d/m/Y") : "" ?></strong></span>
|
||||
<div class="col-6 w-75 border border-1 border-dark text-center <?= $ot->fecha_entrega_warning ? "bg-danger" : "bg-white" ?> ">
|
||||
<span class="<?= $ot->fecha_entrega_warning ? "text-white" : "text-black" ?>" id="fecha_encuadernado_at"><strong><?= $pedido->fecha_encuadernado ? Time::createFromFormat("Y-m-d H:i:s", $pedido->fecha_encuadernado)->format('d/m/Y') : "" ?></strong></span>
|
||||
</div>
|
||||
<div class="col-6 w-25 border border-1 border-dark text-center bg-secondary text-white">
|
||||
<strong>RF</strong>
|
||||
<strong><?=isset($encuadernaciones[0]) ? $encuadernaciones[0]->tarifa()->code ?? "?" : "?" ?></strong>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row px-2 mt-2 h-100">
|
||||
@ -99,17 +99,17 @@ $settings = $session->get('settings');
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<div class="row h-100">
|
||||
<div class="col-6 h-50 square text-center text-dark bg-secondary border border-right border-dark">
|
||||
BCLF 100
|
||||
<div class="col-6 h-50 square text-center text-dark bg-white border border-right border-dark">
|
||||
<?= $linea_impresion->papel_impresion()->papel_code_ot ?>
|
||||
</div>
|
||||
<div class="col-6 h-50 square text-center text-dark bg-secondary border border-right border-dark">
|
||||
0:3
|
||||
<div class="col-6 h-50 square text-center <?=$linea_impresion->isColor() ? "cmyk" : "bn" ?> border border-right border-dark">
|
||||
<?= $tiempo_procesamiento ?>
|
||||
</div>
|
||||
<div class="col-6 h-50 square bg-primary text-center text-white border border-right border-dark">
|
||||
EM 300
|
||||
<?= $linea_cubierta->papel_impresion()->papel_code_ot ?>
|
||||
</div>
|
||||
<div class="col-6 h-50 square bg-blue text-center text-dark bg-secondary border border-right border-dark">
|
||||
BRILLO
|
||||
<?= isset($acabados[0]) ? $acabados[0]->tarifa()->code : "" ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -128,28 +128,28 @@ $settings = $session->get('settings');
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="row">
|
||||
<div class="col-8">
|
||||
<table class="h-100">
|
||||
<table class="h-50">
|
||||
<tr>
|
||||
<th>Cliente</th>
|
||||
<td class="t-cell ">
|
||||
<th >Cliente</th>
|
||||
<td class="t-cell">
|
||||
<?= $cliente->nombre ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Titulo</th>
|
||||
<td class="t-cell ">
|
||||
<th >Titulo</th>
|
||||
<td class="t-cell">
|
||||
<?= $presupuesto->titulo ?>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<th>ISBN</th>
|
||||
<th >ISBN</th>
|
||||
<td class="t-cell"><?= $presupuesto->isbn ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>CIF</th>
|
||||
<th >CIF</th>
|
||||
<td class="t-cell"><?= $cliente->cif ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -186,8 +186,8 @@ $settings = $session->get('settings');
|
||||
<div class="imposicion">
|
||||
<table>
|
||||
<tr>
|
||||
<th>Imposicion</th>
|
||||
<td>??</td>
|
||||
<th class="w-50">Imposicion</th>
|
||||
<td><?= $imposicion?->full_name ?? "" ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
@ -198,6 +198,18 @@ $settings = $session->get('settings');
|
||||
<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 ?> </td>
|
||||
<th class="t-header" style="width: 10%;"><?=lang('Produccion.tipo')?></th>
|
||||
<td class="t-cell text-center"> <?=$linea_impresion->tipo ?> </td>
|
||||
<th class="t-header" style="width: 10%;"><?=lang('Produccion.lomo')?></th>
|
||||
<td class="t-cell 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>
|
||||
@ -282,13 +294,13 @@ $settings = $session->get('settings');
|
||||
<table>
|
||||
<tr>
|
||||
<th class="t-header" style="width: 10%;">Plastificado</th>
|
||||
<td class="t-cell"><?= $acabados[0]->tarifa()->nombre ?></td>
|
||||
<td class="t-cell text-center"><?= $acabados[0]->tarifa()->nombre ?></td>
|
||||
<th class="t-header" style="width: 10%;">UVI</th>
|
||||
<td class="t-cell"> ?? </td>
|
||||
<td class="t-cell text-center"> ?? </td>
|
||||
<th class="t-header" style="width: 10%;">Máquina</th>
|
||||
<td class="t-cell"><?= implode("/", array_map(fn($q) => $q->nombre, $acabados[0]->maquinas())) ?> </td>
|
||||
<th class="t-header" style="width: 10%;">Operario</th>
|
||||
<td class="t-cell"><?= $ot->users()->plastificado_by?->getFullName() ?? null ?> </td>
|
||||
<td class="t-cell text-center"><?= implode("/", array_map(fn($q) => $q->nombre, $acabados[0]->maquinas())) ?> </td>
|
||||
<th class="t-header " style="width: 10%;">Operario</th>
|
||||
<td class="t-cell text-center"><?= $ot->users()?->plastificado_by?->getFullName() ?? null ?> </td>
|
||||
</tr>
|
||||
</table>
|
||||
<table>
|
||||
@ -307,7 +319,7 @@ $settings = $session->get('settings');
|
||||
<td><?= $value->tarifa()->nombre ?></td>
|
||||
<td><?= $presupuesto->solapas ? "SI" : "NO" ?></td>
|
||||
<td><?= $presupuesto->hasSobrecubierta() ? "SI" : "NO" ?></td>
|
||||
<td> <?= $linea_impresion->pliegos_libro?>/<?=$linea_impresion->pliegos_pedido?> </td>
|
||||
<td>_____<?=" ".lang("Produccion.pliegos_de")." "?>_____</td>
|
||||
<td><?= $presupuesto->guardas ? "SI" : "NO" ?></td>
|
||||
<td><?= $presupuesto->retractilado ? "SI" : "NO" ?></td>
|
||||
<td><?= $presupuesto->marcapaginas ? "SI" : "NO" ?></td>
|
||||
@ -360,7 +372,7 @@ $settings = $session->get('settings');
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12 d-flex justify-content-center align-items-center">
|
||||
<span>© 2024 SAFEKAT. Todos los derechos reservados.</span>
|
||||
<span class="footer">© 2024 SAFEKAT. Todos los derechos reservados.</span>
|
||||
</div>
|
||||
<script src=<?= site_url("themes/vuexy/vendor/libs/html2pdf/html2pdf.bundle.min.js") ?>></script>
|
||||
<script src="<?= site_url('themes/vuexy/vendor/libs/jquery/jquery.js') ?>"></script>
|
||||
|
||||
@ -14,11 +14,14 @@ class OrdenTrabajoDatatable {
|
||||
{ data: 'cliente_nombre', searchable: false, sortable: false },
|
||||
{ data: 'presupuesto_titulo', searchable: false, sortable: false },
|
||||
{ data: 'ubicacion_nombre', searchable: false, sortable: false },
|
||||
{ data: 'total_tirada', searchable: false, sortable: false ,render : (d) => `<span class="autonumeric">${d}</span>`},
|
||||
{ data: 'total_tirada', searchable: false, sortable: false, render: (d) => `<span class="autonumeric">${d}</span>` },
|
||||
{ data: 'tipo_presupuesto_impresion', searchable: false, sortable: false },
|
||||
{
|
||||
data: 'logo', searchable: false, sortable: false, render: (d, t) => {
|
||||
return `<img src="${d}" width="30px" height="30px" alt="logo-impresion" />`
|
||||
return `<div class="logo-container">
|
||||
<img class="d-block" src="${d.logo}" width="45px" height="45px" alt="logo-impresion" />
|
||||
${d.imposicion ? `<span class="imposicion-overlay-image">${d.imposicion ?? ""}</span>` : ''}
|
||||
</div>`
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -50,7 +53,7 @@ class OrdenTrabajoDatatable {
|
||||
bottomStart: 'info',
|
||||
bottomEnd: 'paging'
|
||||
},
|
||||
columnDefs : [
|
||||
columnDefs: [
|
||||
{ className: 'dt-center', targets: '_all' },
|
||||
],
|
||||
serverSide: true,
|
||||
@ -71,7 +74,7 @@ class OrdenTrabajoDatatable {
|
||||
bottomStart: 'info',
|
||||
bottomEnd: 'paging'
|
||||
},
|
||||
columnDefs : [
|
||||
columnDefs: [
|
||||
{ className: 'dt-center', targets: '_all' },
|
||||
],
|
||||
serverSide: true,
|
||||
|
||||
@ -4,7 +4,7 @@ $(() => {
|
||||
margin: 2,
|
||||
filename: "PDF_OrdenTrabajo_" + $(".pdf-wrapper").data("id") + ".pdf",
|
||||
image: { type: 'jpeg', quality: 1 },
|
||||
html2canvas: { scale: 3 },
|
||||
html2canvas: { scale: 4 },
|
||||
jsPDF: { unit: 'mm', format: 'a4', orientation: 'portrait' }
|
||||
};
|
||||
let elementToPdf = $('body')[0]
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import Ajax from "../../components/ajax.js"
|
||||
import ClassSelect from "../../components/select2.js";
|
||||
import DatePicker from "../../components/datepicker.js";
|
||||
import { alertConfirmationDelete, alertSuccess } from "../../components/alerts/sweetAlert.js";
|
||||
import { alertConfirmAction, alertConfirmationDelete, alertSuccess } from "../../components/alerts/sweetAlert.js";
|
||||
import Modal from "../../components/modal.js"
|
||||
import FileUploadDropzone from '../../components/forms/fileUploadDropzone.js';
|
||||
class OrdenTrabajo {
|
||||
@ -26,7 +26,7 @@ class OrdenTrabajo {
|
||||
{ data: 'nombre', searchable: true, sortable: true, width: "20%" },
|
||||
{ data: 'maquina_presupuesto_linea', searchable: true, sortable: true, width: "20%" },
|
||||
{ data: 'maquina_tarea', searchable: false, sortable: false, render: this._renderMaquinaSelectTable.bind(this), width: "20%" },
|
||||
// { data: 'imposicion_id', searchable: false, sortable: false },
|
||||
{ data: 'imposicion', searchable: false, sortable: false, render: this._renderImposicionSelectTable.bind(this) },
|
||||
{ data: 'tiempo_estimado', searchable: false, sortable: false },
|
||||
{ data: 'tiempo_real', searchable: false, sortable: false },
|
||||
{
|
||||
@ -42,13 +42,13 @@ class OrdenTrabajo {
|
||||
nameId: "orden_trabajo_id",
|
||||
getUri: '/produccion/ordentrabajo/get_files',
|
||||
postUri: '/produccion/ordentrabajo/upload_files',
|
||||
resourcePath : 'orden_trabajo/' + this.modelId
|
||||
resourcePath: 'orden_trabajo/' + this.modelId
|
||||
}
|
||||
if ($(this.configUploadDropzone.domElement).length > 0) {
|
||||
this.fileUploadDropzone = new FileUploadDropzone(this.configUploadDropzone)
|
||||
}
|
||||
}
|
||||
initDropFiles(){
|
||||
initDropFiles() {
|
||||
if ($(this.configUploadDropzone.domElement).length > 0) {
|
||||
this.fileUploadDropzone.init()
|
||||
}
|
||||
@ -60,13 +60,7 @@ class OrdenTrabajo {
|
||||
dateFormat: "Y-m-d",
|
||||
allowInput: true,
|
||||
}
|
||||
this.tiempoProcesamiento = new DatePicker(this.otForm.find("#ot-tiempo-procesamiento"), {
|
||||
dateFormat: "H:i",
|
||||
enableTime: true,
|
||||
noCalendar: true,
|
||||
time_24hr: true,
|
||||
allowInput: true,
|
||||
})
|
||||
this.tiempoProcesamiento = this.otForm.find("#ot-tiempo-procesamiento")
|
||||
this.fechaImpresion = new DatePicker(this.otForm.find("#ot-fecha-impresion"), option)
|
||||
this.fechaEncuadernado = new DatePicker(this.otForm.find("#ot-fecha-encuadernado"), option)
|
||||
this.fechaEntregaExterno = new DatePicker(this.otForm.find("#ot-fecha-entrega-externo"), option)
|
||||
@ -78,6 +72,8 @@ class OrdenTrabajo {
|
||||
this.ferroOk = new DatePicker(this.otForm.find("#ot-ferro-ok"), 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.portada = new DatePicker(this.otForm.find("#ot-portada"), option)
|
||||
this.plastificadoMate = new DatePicker(this.otForm.find("#ot-plastificado-mate"), option)
|
||||
this.prepGuillotina = new DatePicker(this.otForm.find("#ot-prep-guillotina"), option)
|
||||
@ -85,11 +81,23 @@ class OrdenTrabajo {
|
||||
this.embalaje = new DatePicker(this.otForm.find("#ot-embalaje"), option)
|
||||
this.envio = new DatePicker(this.otForm.find("#ot-envio"), option)
|
||||
|
||||
//REVISION PREIMPRESION
|
||||
this.preFormatoAt = new DatePicker(this.otForm.find("#ot-preformato-date"), option)
|
||||
this.preLomoAt = new DatePicker(this.otForm.find("#ot-prelomo-date"), option)
|
||||
this.preSolapaAt = new DatePicker(this.otForm.find("#ot-presolapa-date"), option)
|
||||
this.preCodBarrasAt = new DatePicker(this.otForm.find("#ot-precodbarras-date"), option)
|
||||
this.preImposicionAt = new DatePicker(this.otForm.find("#ot-preimposicion-date"), option)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
eventTareas() {
|
||||
this.otForm.on("change", ".select-maquina-tarea-datatable", this.handleTareaChange.bind(this))
|
||||
this.otForm.on("change", ".orden-tarea", this.handleTareaChange.bind(this))
|
||||
this.otForm.on("change", ".select-imposicion-tarea-datatable", this.handleTareaChange.bind(this))
|
||||
this.otForm.on("click", ".increase-order", (event) => {
|
||||
const input_orden_tarea = $(event.currentTarget).parent().parent().find('.orden-tarea')
|
||||
let actual_value = parseInt(input_orden_tarea.val())
|
||||
@ -105,6 +113,7 @@ class OrdenTrabajo {
|
||||
}
|
||||
unbindEventTareas() {
|
||||
this.otForm.off("change", ".select-maquina-tarea-datatable")
|
||||
this.otForm.off("change", ".select-imposicion-tarea-datatable")
|
||||
this.otForm.off("change", ".orden-tarea")
|
||||
this.otForm.off("click", ".increase-order")
|
||||
this.otForm.off("click", ".decrease-order")
|
||||
@ -117,7 +126,7 @@ class OrdenTrabajo {
|
||||
this.tareasTableItem.on("xhr.dt", this.unbindEventTareas.bind(this))
|
||||
this.otForm.on("click", "#btn-upload-portada", this.handleUploadPortada.bind(this))
|
||||
this.otForm.on("click", "#btn-delete-portada", this.handleDeletePortada.bind(this))
|
||||
this.otForm.on("click", "#btn-finalizar-orden-pedido", this.handleFinalizarPedido.bind(this))
|
||||
this.btnFinalizarPedido.on("click", this.handleFinalizarPedido.bind(this))
|
||||
this.tareasTableItem.on("click", ".ot-tarea-btn-delete", this.handleTareaDeleteConfirmation.bind(this))
|
||||
this.item.on("click", "#btn-reset-tareas", this.handleResetTareasDeleteConfirmation.bind(this))
|
||||
this.otForm.on("click", ".ot-tarea-comment", this.handleNoteTarea.bind(this))
|
||||
@ -172,6 +181,14 @@ class OrdenTrabajo {
|
||||
<option value="${d.maquina_id}" selected="selected">${d.maquina_name ?? ''}</option>
|
||||
</select>`
|
||||
|
||||
}
|
||||
_renderImposicionSelectTable(d, t) {
|
||||
|
||||
let render = `<select id="select-imposicion-tarea-${d.id}" data-imposicion-id="${d.imposicion_id}" data-id="${d.id}" name="imposicion_id" class="select2 form-select select-imposicion-tarea-datatable ${d.imposicion_id ? '' : 'is-invalid'}">
|
||||
<option value="${d.imposicion_id}" selected="selected">${d.name ?? ''}</option>
|
||||
</select>`
|
||||
return render
|
||||
|
||||
}
|
||||
_renderActionCell(d, t) {
|
||||
|
||||
@ -195,7 +212,6 @@ class OrdenTrabajo {
|
||||
}
|
||||
createSelectMaquinaTarea() {
|
||||
try {
|
||||
console.log("Create selects")
|
||||
this.summaryData.tasks.forEach(element => {
|
||||
let selectItem = this.item.find("#select-maquina-tarea-" + element.id);
|
||||
if (element.presupuesto_linea_id && element.is_corte == false) this.createSelectMaquinaImpresion(selectItem)
|
||||
@ -204,6 +220,26 @@ class OrdenTrabajo {
|
||||
if (element.presupuesto_manipulado_id || element.is_corte) this.createSelectMaquinaManipulado(selectItem)
|
||||
if (element.presupuesto_preimpresion_id) this.createSelectMaquinaAll(selectItem)
|
||||
if (element.presupuesto_extra_id) this.createSelectMaquinaAll(selectItem)
|
||||
if (this.summaryData.impresion_interior_bn) {
|
||||
let isTareaImpresionInteriorBN = this.summaryData.impresion_interior_bn?.presupuesto_linea_id == element.presupuesto_linea_id
|
||||
if (isTareaImpresionInteriorBN) {
|
||||
let selectItemImposicion = this.item.find("#select-imposicion-tarea-" + element.id);
|
||||
this.createSelectImposicion(selectItemImposicion)
|
||||
} else {
|
||||
let selectItemImposicion = this.item.find("#select-imposicion-tarea-" + element.id);
|
||||
selectItemImposicion.addClass("d-none");
|
||||
}
|
||||
}
|
||||
if (this.summaryData.impresion_interior_color) {
|
||||
let isTareaImpresionInteriorColor = this.summaryData.impresion_interior_color?.presupuesto_linea_id == element.presupuesto_linea_id
|
||||
if (isTareaImpresionInteriorColor) {
|
||||
let selectItemImposicion = this.item.find("#select-imposicion-tarea-" + element.id);
|
||||
this.createSelectImposicion(selectItemImposicion)
|
||||
} else {
|
||||
let selectItemImposicion = this.item.find("#select-imposicion-tarea-" + element.id);
|
||||
selectItemImposicion.addClass("d-none");
|
||||
}
|
||||
}
|
||||
});
|
||||
} catch (error) {
|
||||
} finally {
|
||||
@ -262,6 +298,25 @@ class OrdenTrabajo {
|
||||
maquinaSelects.reset()
|
||||
}
|
||||
}
|
||||
createSelectImposicion(selectItem) {
|
||||
let imposicionId = selectItem.data("imposicion-id")
|
||||
let imposicionSelect = new ClassSelect(selectItem, `/imposiciones/select`, "Seleccione una imposición", true);
|
||||
|
||||
imposicionSelect.config.templateResult = (state) => {
|
||||
let $state = $(`
|
||||
<div class="d-flex flex-column justify-content-start align-items-start gap-1">
|
||||
<span class="item-text">${state.text}</span>
|
||||
<span class="badge text-bg-secondary">${state.desc ?? ''}</span>
|
||||
</div>`)
|
||||
return $state;
|
||||
}
|
||||
imposicionSelect.init();
|
||||
if (imposicionId) {
|
||||
imposicionSelect.setVal(imposicionId)
|
||||
} else {
|
||||
imposicionSelect.reset()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -277,6 +332,8 @@ class OrdenTrabajo {
|
||||
try {
|
||||
this.summaryData = data
|
||||
this.otForm.off("change", ".ot-date")
|
||||
this.otForm.off("change", ".ot-pedido")
|
||||
this.otForm.off("change", ".ot-pedido-check")
|
||||
this.otForm.off("change", ".ot-preview")
|
||||
this.fillOtDetails()
|
||||
this.fillOtDates()
|
||||
@ -286,6 +343,8 @@ class OrdenTrabajo {
|
||||
|
||||
} finally {
|
||||
this.otForm.on("change", ".ot-date", this.handleDateChange.bind(this))
|
||||
this.otForm.on("change", ".ot-pedido", this.handlePedidoChange.bind(this))
|
||||
this.otForm.on("change", ".ot-pedido-check", this.handlePedidoCheckChange.bind(this))
|
||||
this.otForm.on("change", ".ot-preview", this.handlePreimpresionReviewChange.bind(this))
|
||||
Notiflix.Block.remove('.section-block');
|
||||
|
||||
@ -305,41 +364,48 @@ class OrdenTrabajo {
|
||||
this.otForm.find("[name=revisar_codigo_barras]").prop("checked", this.summaryData.ot.revisar_codigo_barras)
|
||||
this.otForm.find("[name=realizar_imposicion]").prop("checked", this.summaryData.ot.realizar_imposicion)
|
||||
this.otForm.find("[name=enviar_impresion]").prop("checked", this.summaryData.ot.enviar_impresion)
|
||||
this.otForm.find("[name=inaplazable]").prop("checked", this.summaryData.pedido.inaplazable)
|
||||
|
||||
|
||||
|
||||
}
|
||||
fillOtDetails() {
|
||||
const progreso = this.summaryData.ot.progreso
|
||||
// this.otForm.find("#ot-progress-bar").attr('aria-valuenow', progreso).text(progreso + "%").css("width", progreso + "%")
|
||||
// this.otForm.find("#ot-paginas").text(this.summaryData.presupuesto.paginas)
|
||||
// this.otForm.find("#ot-tirada").text(this.summaryData.presupuesto.tirada)
|
||||
// this.otForm.find("#ot-merma").text(this.summaryData.presupuesto.merma)
|
||||
this.otForm.find("#ot-progress-bar").attr('aria-valuenow', progreso).text(progreso + "%").css("width", progreso + "%")
|
||||
}
|
||||
fillOtDates() {
|
||||
this.fechaImpresion.setDate(this.summaryData.dates.fecha_impresion_at)
|
||||
this.fechaEncuadernado.setDate(this.summaryData.dates.fecha_encuadernado_at)
|
||||
// this.fechaEntregaExterno.setDate(this.summaryData.dates.fecha_entrega_externo_)
|
||||
this.fechaEntregaReal.setDate(this.summaryData.dates.fecha_entrega_real_at)
|
||||
this.fechaEntregaEstimada.setDate(this.summaryData.dates.fecha_entrega_at)
|
||||
this.fechaImpresion.setDate(this.summaryData.pedido.fecha_impresion)
|
||||
this.fechaEncuadernado.setDate(this.summaryData.pedido.fecha_encuadernado)
|
||||
this.fechaEntregaExterno.setDate(this.summaryData.pedido.fecha_entrega_externo)
|
||||
this.fechaEntregaReal.setDate(this.summaryData.pedido.fecha_entrega_real)
|
||||
// this.fechaEntregaEstimada.setDate(this.summaryData.pedido.fecha_entrega_at)
|
||||
|
||||
this.pendienteFerro.setDate(this.summaryData.dates.pendiente_ferro_at)
|
||||
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)
|
||||
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.prepGuillotina.setDate(this.summaryData.dates.corte_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);
|
||||
if(this.summaryData.ot.pedido_espera_by){
|
||||
this.pedidoEnEsperaBy.text([this.summaryData.ot.pedido_espera_by.first_name,this.summaryData.ot.pedido_espera_by.last_name].join(" "))
|
||||
}else{
|
||||
this.pedidoEnEsperaCheck.prop("checked", this.summaryData.ot.is_pedido_espera);
|
||||
this.tiempoProcesamiento.val(this.summaryData.tiempo_procesamiento);
|
||||
if (this.summaryData.ot.pedido_espera_by) {
|
||||
this.pedidoEnEsperaBy.text([this.summaryData.ot.pedido_espera_by.first_name, this.summaryData.ot.pedido_espera_by.last_name].join(" "))
|
||||
} else {
|
||||
this.pedidoEnEsperaBy.text("");
|
||||
}
|
||||
this.otEstado.val(this.summaryData.ot.estado)
|
||||
this.preFormatoAt.setDate(this.summaryData.dates.pre_formato_at)
|
||||
this.preLomoAt.setDate(this.summaryData.dates.pre_lomo_at)
|
||||
this.preSolapaAt.setDate(this.summaryData.dates.pre_solapa_at)
|
||||
this.preCodBarrasAt.setDate(this.summaryData.dates.pre_codbarras_at)
|
||||
this.preImposicionAt.setDate(this.summaryData.dates.pre_imposicion_at)
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -349,7 +415,6 @@ class OrdenTrabajo {
|
||||
const data = {}
|
||||
data[key] = $(event.currentTarget).val()
|
||||
data["orden_trabajo_tarea_id"] = $(event.currentTarget).data("id")
|
||||
console.log(data);
|
||||
const ajax = new Ajax(
|
||||
"/produccion/ordentrabajo/update/tarea",
|
||||
data,
|
||||
@ -379,7 +444,6 @@ class OrdenTrabajo {
|
||||
}
|
||||
handleTareaChangeError(error) { }
|
||||
handleOtComment(event) {
|
||||
console.log($(event.currentTarget).val())
|
||||
const ajax = new Ajax(
|
||||
"/produccion/ordentrabajo/update",
|
||||
{
|
||||
@ -405,7 +469,6 @@ class OrdenTrabajo {
|
||||
data[key] = $(event.currentTarget).val()
|
||||
data["orden_trabajo_id"] = this.modelId
|
||||
data["name"] = key;
|
||||
console.log(data)
|
||||
const ajax = new Ajax(
|
||||
"/produccion/ordentrabajo/update/date",
|
||||
data,
|
||||
@ -426,6 +489,36 @@ class OrdenTrabajo {
|
||||
}
|
||||
}
|
||||
handleDateChangeError(errors) { }
|
||||
handlePedidoChange(event) {
|
||||
const key = $(event.currentTarget).attr("name")
|
||||
const data = {}
|
||||
const element = $(event.currentTarget);
|
||||
data[key] = $(event.currentTarget).val()
|
||||
data["orden_trabajo_id"] = this.modelId
|
||||
data["name"] = key;
|
||||
const ajax = new Ajax(
|
||||
"/produccion/ordentrabajo/update/pedido/date",
|
||||
data,
|
||||
null,
|
||||
this.handleDateChangeSuccess.bind(this, element),
|
||||
this.handleDateChangeError.bind(this)
|
||||
)
|
||||
ajax.post();
|
||||
}
|
||||
handlePedidoCheckChange(event) {
|
||||
const key = $(event.currentTarget).attr("name")
|
||||
const data = {}
|
||||
data[key] = $(event.currentTarget).is(":checked") ? 1 : 0
|
||||
data["orden_trabajo_id"] = this.modelId
|
||||
const ajax = new Ajax(
|
||||
"/produccion/ordentrabajo/update/pedido",
|
||||
data,
|
||||
null,
|
||||
this.handlePreimpresionReviewChangeSuccess.bind(this),
|
||||
this.handlePreimpresionReviewChangeError.bind(this)
|
||||
)
|
||||
ajax.post();
|
||||
}
|
||||
handlePreimpresionReviewChange(event) {
|
||||
const key = $(event.currentTarget).attr("name")
|
||||
const data = {}
|
||||
@ -534,8 +627,13 @@ class OrdenTrabajo {
|
||||
this.handleEstadoChangeSuccess.bind(this),
|
||||
this.handleEstadoChangeError.bind(this)
|
||||
);
|
||||
alertConfirmAction("Esta acción marcará la orden de trabjao como FINALIZADA")
|
||||
.then(result => {
|
||||
if (result.isConfirmed) {
|
||||
ajax.post()
|
||||
}
|
||||
})
|
||||
}
|
||||
handleEstadoChangeSuccess(response) {
|
||||
popSuccessAlert(response.message)
|
||||
this.alertOrdenTrabajo.removeClass("alert-info").addClass("alert-success")
|
||||
|
||||
17
httpdocs/themes/vuexy/css/ot.css
Normal file
17
httpdocs/themes/vuexy/css/ot.css
Normal file
@ -0,0 +1,17 @@
|
||||
.imposicion-overlay-image
|
||||
{
|
||||
position: absolute;
|
||||
top: 75%;
|
||||
left: 25%;
|
||||
transform: translate(-10%, -10%);
|
||||
background-color:rgb(255, 255, 255);
|
||||
color: black;
|
||||
font-size: 11px;
|
||||
text-align: center;
|
||||
border : 1px solid;
|
||||
|
||||
}
|
||||
.logo-container{
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
}
|
||||
@ -1,348 +0,0 @@
|
||||
@page {
|
||||
size: A4;
|
||||
margin: 0;
|
||||
}
|
||||
@media print {
|
||||
body,html {
|
||||
width: 210mm;
|
||||
height: 297mm;
|
||||
max-width: 210mm;
|
||||
max-height: 297mm;
|
||||
print-color-adjust: exact;
|
||||
}
|
||||
/* ... the rest of the rules ... */
|
||||
}
|
||||
html {
|
||||
font-family: Arial, sans-serif;
|
||||
width: 210mm;
|
||||
height: 297mm;
|
||||
max-width: 210mm;
|
||||
font-size : 11px;
|
||||
max-height: 297mm;
|
||||
background-color: #f9f9f9;
|
||||
}
|
||||
body{
|
||||
border: 0px solid;
|
||||
padding: 20px;
|
||||
max-width: 210mm;
|
||||
max-height: 297mm;
|
||||
|
||||
}
|
||||
.cubierta{
|
||||
color: #007bff;
|
||||
}
|
||||
.encuadernacion{
|
||||
color: green;
|
||||
}
|
||||
.impresion{
|
||||
color: #ff4000;
|
||||
}
|
||||
.container {
|
||||
width: 100%;
|
||||
width: 210mm;
|
||||
height: 297mm;
|
||||
background: #fff;
|
||||
padding: 20px;
|
||||
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
||||
border: 2px solid;
|
||||
|
||||
}
|
||||
.header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
.cover{
|
||||
display: flex;
|
||||
justify-content: start;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
margin-top: 10px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.portada-info{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
width: 100%;
|
||||
}
|
||||
.impresion-tipo-row{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-items: center;
|
||||
justify-content: end;
|
||||
width: 100%;
|
||||
height: 5mm;
|
||||
margin: 2px;
|
||||
}
|
||||
.portada-row{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-items: center;
|
||||
justify-content: space-between;
|
||||
background-color: #4ba0fccc;
|
||||
width: 100%;
|
||||
height: 5mm;
|
||||
border: solid 2px;
|
||||
margin: 2px;
|
||||
border-color: black;
|
||||
|
||||
}
|
||||
.portada-row-2{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-items: center;
|
||||
width: 100%;
|
||||
height: 35mm;
|
||||
margin: 2px;
|
||||
border: 2px solid;
|
||||
border-color: black;
|
||||
|
||||
}
|
||||
.portada{
|
||||
height: 40mm;
|
||||
}
|
||||
.presupuesto-title{
|
||||
color: #007bff;
|
||||
font-size: medium;
|
||||
line-height: 0;
|
||||
}
|
||||
.pl-2{
|
||||
padding-left: 0.5rem;
|
||||
}
|
||||
.pr-2{
|
||||
padding-right: 0.5rem;
|
||||
}
|
||||
.pt-2{
|
||||
padding-top: 0.5rem;
|
||||
}
|
||||
.flex-row{
|
||||
display: flex;
|
||||
width: 100%;
|
||||
justify-content: start;
|
||||
align-items: flex-start;
|
||||
}
|
||||
.date{
|
||||
padding-left: 0.5rem;
|
||||
padding-top: 0px;
|
||||
width: 100%;
|
||||
line-height: 0px;
|
||||
stroke-width: 5px;
|
||||
font-size: medium;
|
||||
}
|
||||
#presupuesto-section{
|
||||
width: 100%;
|
||||
}
|
||||
.flex-col{
|
||||
display: flex;
|
||||
padding: 0;
|
||||
flex-direction: column;
|
||||
}
|
||||
.cliente-title{
|
||||
color: red;
|
||||
font-size: medium;
|
||||
stroke-width: 10px;
|
||||
line-height: 0px;
|
||||
}
|
||||
|
||||
.header .title {
|
||||
font-size: 24px;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.section {
|
||||
margin-top: 0.5rem;
|
||||
border-top: 1px solid #ddd;
|
||||
padding-top: 0.2rem;
|
||||
}
|
||||
.section-title {
|
||||
font-weight: bold;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
margin-bottom: 5px;
|
||||
font-size: 12px;
|
||||
}
|
||||
table th, table td {
|
||||
border: 2px solid #000000;
|
||||
text-align: center;
|
||||
}
|
||||
table th {
|
||||
background-color: #f4f4f4;
|
||||
font-weight: bold;
|
||||
}
|
||||
table td{
|
||||
font-weight: bold;
|
||||
}
|
||||
.comments {
|
||||
color: #555;
|
||||
font-style: italic;
|
||||
margin-top: 0.2rem;
|
||||
}
|
||||
.comment-content {
|
||||
line-height: 0;
|
||||
width: 100%;
|
||||
height: 50px;
|
||||
border: solid;
|
||||
border-width: 1px;
|
||||
}
|
||||
.footer {
|
||||
text-align: center;
|
||||
margin-top: 0.5rem;
|
||||
|
||||
font-size: 14px;
|
||||
color: #777;
|
||||
}
|
||||
.row-logo-impresion{
|
||||
text-align: center;
|
||||
}
|
||||
.portada-img{
|
||||
border: black;
|
||||
border-style: solid;
|
||||
border-width: 2px;
|
||||
height: 40mm;
|
||||
width: 100px;
|
||||
max-width: 30mm;
|
||||
border: 2px solid;
|
||||
border-color: black;
|
||||
border-radius: 5%;
|
||||
}
|
||||
.portada-text{
|
||||
color: white;
|
||||
}
|
||||
|
||||
.t-header{
|
||||
color: black;
|
||||
width: 25%;
|
||||
}
|
||||
.t-cell{
|
||||
background-color: white;
|
||||
color: black;
|
||||
text-align: start;
|
||||
padding-left: 0.2rem;
|
||||
}
|
||||
.t-row{
|
||||
font-size: 10px;
|
||||
}
|
||||
.esquema{
|
||||
display: flex;
|
||||
justify-content:flex-end;
|
||||
width: 100%;
|
||||
justify-items: flex-end;
|
||||
|
||||
}
|
||||
.pagina-imposicion-outer-start{
|
||||
border-top: 2px solid;
|
||||
border-left: 2px solid;
|
||||
border-bottom: 2px solid;
|
||||
width: 50px;
|
||||
height: 100px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.pagina-imposicion-outer-end{
|
||||
border-top: 2px solid;
|
||||
border-right: 2px solid;
|
||||
border-bottom: 2px solid;
|
||||
width: 50px;
|
||||
height: 100px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.pagina-imposicion-outer{
|
||||
border-top: 2px solid;
|
||||
border-bottom: 2px solid;
|
||||
width: 50px;
|
||||
height: 100px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.pagina-imposicion-inner{
|
||||
border: 2px solid;
|
||||
font-size: 25px;
|
||||
width: 40px;
|
||||
height: 90px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
}
|
||||
.square-wrapper{
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2,1fr);
|
||||
margin-left: 5px;
|
||||
|
||||
}
|
||||
.square{
|
||||
width: 100px;
|
||||
height: 50px;
|
||||
font-size: 14px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-weight: bold;
|
||||
}
|
||||
.cod{
|
||||
width: 150px;
|
||||
height: 100px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background-color: orange;
|
||||
margin-left : 20px;
|
||||
color: white;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
font-weight: bold;
|
||||
}
|
||||
.cod-code{
|
||||
font-weight: bold;
|
||||
color: white;
|
||||
}
|
||||
.esquema-imposicion-wrapper{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
margin-left: 2rem;
|
||||
gap: 10px;
|
||||
}
|
||||
.imposicion{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 200px;
|
||||
}
|
||||
.imposicion td{
|
||||
font-size: large;
|
||||
}
|
||||
.cod-barras{
|
||||
width: 150px;
|
||||
height: 80px;
|
||||
text-align : center;
|
||||
background-color: white;
|
||||
align-content: center;
|
||||
}
|
||||
.cod-barras img {
|
||||
padding : 1px;
|
||||
}
|
||||
.bg-white{
|
||||
background-color: white;
|
||||
color: black;
|
||||
}
|
||||
.bg-red{
|
||||
background-color: red;
|
||||
color: white;
|
||||
}
|
||||
.bg-gray{
|
||||
background-color: gray;
|
||||
color:white
|
||||
}
|
||||
.bg-blue{
|
||||
background-color: blue;
|
||||
color: white;
|
||||
}
|
||||
@ -35,11 +35,12 @@ body{
|
||||
border: 2px solid;
|
||||
}
|
||||
.square{
|
||||
font-size: 14px;
|
||||
align-items: center;
|
||||
align-content : center;
|
||||
justify-content: center;
|
||||
font-weight: bold;
|
||||
font-size : 20px;
|
||||
|
||||
}
|
||||
.esquema{
|
||||
display: flex;
|
||||
@ -126,18 +127,24 @@ body{
|
||||
|
||||
table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
margin-bottom: 5px;
|
||||
font-size: 12px;
|
||||
font-size: 10px;
|
||||
}
|
||||
table th, table td {
|
||||
border: 2px solid #000000;
|
||||
|
||||
table td {
|
||||
text-align: center;
|
||||
}
|
||||
table,th,td{
|
||||
border: 0.1px solid rgb(0, 0, 0);
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
table th {
|
||||
background-color: #f4f4f4;
|
||||
font-weight: bold;
|
||||
color : black;
|
||||
text-align: center;
|
||||
|
||||
}
|
||||
table td{
|
||||
font-weight: bold;
|
||||
@ -158,6 +165,23 @@ table td{
|
||||
padding-left: 0.2rem;
|
||||
}
|
||||
.t-row{
|
||||
font-size: 10px;
|
||||
font-size: 8px;
|
||||
width : 100%;
|
||||
}
|
||||
.bicolor{
|
||||
background: linear-gradient( to right, #00b5fc 0%, #00b5fc 45%, #000000 55%, #000000 100%);
|
||||
color: white;
|
||||
}
|
||||
.cmyk{
|
||||
background-image: url('/themes/vuexy/img/safekat/presupuestos/cmyk.png')
|
||||
background-size: 110px;
|
||||
text-shadow: 0px 0px 1px black;
|
||||
stroke:black;
|
||||
}
|
||||
.bn{
|
||||
background : black;
|
||||
color: white;
|
||||
}
|
||||
.footer{
|
||||
font-size : 10px
|
||||
}
|
||||
BIN
httpdocs/themes/vuexy/img/safekat/presupuestos/cmyk.png
Normal file
BIN
httpdocs/themes/vuexy/img/safekat/presupuestos/cmyk.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.0 KiB |
Reference in New Issue
Block a user