mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
ots
This commit is contained in:
62
ci4/app/Entities/Produccion/OrdenTrabajoDateEntity.php
Normal file
62
ci4/app/Entities/Produccion/OrdenTrabajoDateEntity.php
Normal file
@ -0,0 +1,62 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entities\Produccion;
|
||||
|
||||
use CodeIgniter\Entity\Entity;
|
||||
|
||||
class OrdenTrabajoDateEntity extends Entity
|
||||
{
|
||||
protected $attributes = [
|
||||
"fecha_entrada_at" => null,
|
||||
"fecha_entrega_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,
|
||||
"interior_bn_at" => null,
|
||||
"interior_color_at" => null,
|
||||
"preparacion_interiores_at" => null,
|
||||
"cubierta_at" => null,
|
||||
"plastificado_at" => null,
|
||||
"encuadernacion_at" => null,
|
||||
"corte_at" => null,
|
||||
"embalaje_at" => null,
|
||||
"envio_at" => null,
|
||||
"entrada_manipulado_at" => null
|
||||
|
||||
];
|
||||
protected $datamap = [];
|
||||
protected $dates = ['created_at', 'updated_at', 'deleted_at'];
|
||||
protected $casts = [
|
||||
"fecha_entrada_at" => "?datetime",
|
||||
"fecha_entrega_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"
|
||||
];
|
||||
}
|
||||
@ -1,6 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entities\Produccion;
|
||||
|
||||
use App\Database\Migrations\OrdenTrabajoDatesTable;
|
||||
use App\Entities\Pedidos\PedidoEntity;
|
||||
use App\Models\OrdenTrabajo\OrdenTrabajoTarea;
|
||||
use App\Models\Pedidos\PedidoModel;
|
||||
use CodeIgniter\Entity\Entity;
|
||||
|
||||
|
||||
@ -8,107 +13,61 @@ class OrdenTrabajoEntity extends Entity
|
||||
{
|
||||
protected $attributes = [
|
||||
"pedido_id" => null,
|
||||
"maquina_orden_negro_id" => null,
|
||||
"maquina_orden_color_id" => null,
|
||||
"maquina_orden_portada_id" => null,
|
||||
"maquina_orden_cubierta_id" => null,
|
||||
"negro_forma_id" => null,
|
||||
"color_forma_id" => null,
|
||||
"portada_forma_id" => null,
|
||||
"cubierta_forma_id" => null,
|
||||
"tirada" => null,
|
||||
"negro_pliegos_pedido" => null,
|
||||
"color_pliegos_pedido" => null,
|
||||
"portada_pliegos_pedido" => null,
|
||||
"cubierta_pliegos_pedido" => null,
|
||||
"negro_clicks_pedido" => null,
|
||||
"color_clicks_pedido" => null,
|
||||
"portada_clicks_pedido" => null,
|
||||
"cubierta_clicks_pedido" => null,
|
||||
"pliegos1" => null,
|
||||
"paginas1" => null,
|
||||
"pliegos2" => null,
|
||||
"paginas2" => null,
|
||||
"negro_proveedor_nombre" => null,
|
||||
"color_proveedor_nombre" => null,
|
||||
"portada_proveedor_nombre" => null,
|
||||
"corte_pie" => null,
|
||||
"lomo" => null,
|
||||
"tipo_entrada" => null,
|
||||
"fecha_entrega_real_warning" => null,
|
||||
"fecha_entrega_warning" => null,
|
||||
"fecha_entrega_warning_revised" => null,
|
||||
"ferro_disponible" => null,
|
||||
"ferro_disponible_thread_id" => null,
|
||||
"ferro_cp" => null,
|
||||
"ferro_proveedor" => null,
|
||||
"ferro_tracking" => null,
|
||||
"pre_formato" => null,
|
||||
"pre_lomo" => null,
|
||||
"pre_solapa" => null,
|
||||
"pre_isbn" => null,
|
||||
"pre_codbarras" => null,
|
||||
"pre_imposicion" => null,
|
||||
"pre_imprimir" => null,
|
||||
"pre_faltan_materiales" => null,
|
||||
"pre_faltan_materiales_note" => null,
|
||||
"progreso" => null,
|
||||
"message_production_send" => null,
|
||||
"finalizado" => null,
|
||||
"comentarios" => null
|
||||
"user_created_id" => null,
|
||||
"user_updated_id" => null,
|
||||
"total_tirada" => null,
|
||||
"total_precio" => null,
|
||||
"tipo_entrada" => "out",
|
||||
"progreso" => 0.00,
|
||||
"estado" => "I",
|
||||
"comentarios" => null,
|
||||
];
|
||||
protected $casts = [
|
||||
"pedido_id" => 'integer',
|
||||
"maquina_orden_negro_id" => '?integer',
|
||||
"maquina_orden_color_id" => '?integer',
|
||||
"maquina_orden_portada_id" => '?integer',
|
||||
"maquina_orden_cubierta_id" => '?integer',
|
||||
"negro_forma_id" => '?integer',
|
||||
"color_forma_id" => '?integer',
|
||||
"portada_forma_id" => '?integer',
|
||||
"cubierta_forma_id" => '?integer',
|
||||
"tirada" => 'integer',
|
||||
"negro_pliegos_pedido" => '?integer',
|
||||
"color_pliegos_pedido" => 'string',
|
||||
"portada_pliegos_pedido" => 'string',
|
||||
"cubierta_pliegos_pedido" => 'string',
|
||||
"negro_clicks_pedido" => '?integer',
|
||||
"color_clicks_pedido" => '?integer',
|
||||
"portada_clicks_pedido" => '?integer',
|
||||
"cubierta_clicks_pedido" => null,
|
||||
"pliegos1" => '?integer',
|
||||
"paginas1" => '?integer',
|
||||
"pliegos2" => '?integer',
|
||||
"paginas2" => '?integer',
|
||||
"negro_proveedor_nombre" => null,
|
||||
"color_proveedor_nombre" => null,
|
||||
"portada_proveedor_nombre" => null,
|
||||
"corte_pie" => null,
|
||||
"lomo" => null,
|
||||
"tipo_entrada" => 'string',
|
||||
"fecha_entrega_real_warning" => 'boolean',
|
||||
"fecha_entrega_warning" => 'boolean',
|
||||
"fecha_entrega_warning_revised" => 'boolean',
|
||||
"ferro_disponible" => 'boolean',
|
||||
"ferro_disponible_thread_id" => '?integer',
|
||||
"ferro_cp" => '?string',
|
||||
"ferro_proveedor" => '?string',
|
||||
"ferro_tracking" => '?string',
|
||||
"pre_formato" => '?string',
|
||||
"pre_lomo" => '?string',
|
||||
"pre_solapa" => '?string',
|
||||
"pre_isbn" => '?string',
|
||||
"pre_codbarras" => '?string',
|
||||
"pre_imposicion" => '?string',
|
||||
"pre_imprimir" => 'boolean',
|
||||
"pre_faltan_materiales" => 'boolean',
|
||||
"pre_faltan_materiales_note" => '?string',
|
||||
"progreso" => 'float',
|
||||
"message_production_send" => 'boolean',
|
||||
"finalizado" => 'boolean',
|
||||
"comentarios" => 'string'
|
||||
"pedido_id" => "integer",
|
||||
"user_created_id" => "integer",
|
||||
"user_updated_id" => "?integer",
|
||||
"total_tirada" => "float",
|
||||
"total_precio" => "float",
|
||||
"tipo_entrada" => "string",
|
||||
"progreso" => "float",
|
||||
"estado" => "string",
|
||||
"comentarios" => "string",
|
||||
];
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Devuelve las tareas de la orden de trabajo.
|
||||
*
|
||||
* @return array<OrdenTrabajoTarea>
|
||||
*/
|
||||
public function tareas(): array
|
||||
{
|
||||
$m = model(OrdenTrabajoTarea::class);
|
||||
return $m->where("orden_trabajo_id", $this->attributes["id"])->findAll();
|
||||
}
|
||||
/**
|
||||
* Devuelve el pedido de la orden de trabajo
|
||||
*
|
||||
* @return PedidoEntity
|
||||
*/
|
||||
public function pedido(): PedidoEntity
|
||||
{
|
||||
$m = model(PedidoModel::class);
|
||||
return $m->find($this->attributes["pedido_id"]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Almacena en la tabla `orden_trabajo_dates` las fechas correspondientes del pedido.
|
||||
* Se almacenan en una tabla externa porque puede haber modificaciones de estas fechas
|
||||
* en la orden del trabajo, pero en el pedido quedarán fijas.
|
||||
*
|
||||
* @todo Falta implementacion
|
||||
* @return boolean
|
||||
*/
|
||||
public function storeDates($data): self
|
||||
{
|
||||
$ot_dates = new OrdenTrabajoDateEntity();
|
||||
$this->attributes["dates"] = $ot_dates->fill($data);
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entities\Produccion;
|
||||
|
||||
use CodeIgniter\Entity\Entity;
|
||||
|
||||
class OrdenTrabajoMaquetacionEntity extends Entity
|
||||
{
|
||||
protected $datamap = [];
|
||||
protected $dates = ['created_at', 'updated_at', 'deleted_at'];
|
||||
protected $casts = [];
|
||||
}
|
||||
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entities\Produccion;
|
||||
|
||||
use CodeIgniter\Entity\Entity;
|
||||
|
||||
class OrdenTrabajoMaquetacionMovimientoEntity extends Entity
|
||||
{
|
||||
protected $datamap = [];
|
||||
protected $dates = ['created_at', 'updated_at', 'deleted_at'];
|
||||
protected $casts = [];
|
||||
}
|
||||
88
ci4/app/Entities/Produccion/OrdenTrabajoTareaEntity.php
Normal file
88
ci4/app/Entities/Produccion/OrdenTrabajoTareaEntity.php
Normal file
@ -0,0 +1,88 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entities\Produccion;
|
||||
|
||||
use App\Entities\Configuracion\Maquina;
|
||||
use App\Entities\Presupuestos\PresupuestoLineaEntity;
|
||||
use App\Models\Configuracion\MaquinaModel;
|
||||
use App\Models\OrdenTrabajo\OrdenTrabajoModel;
|
||||
use App\Models\Presupuestos\PresupuestoLineaModel;
|
||||
use CodeIgniter\Entity\Entity;
|
||||
|
||||
class OrdenTrabajoTareaEntity extends Entity
|
||||
{
|
||||
protected $attributes = [
|
||||
"id" => null,
|
||||
"orden_trabajo_id" => null,
|
||||
"presupuesto_linea_id" => null,
|
||||
"nombre" => null,
|
||||
"orden" => null,
|
||||
"maquina_id" => null,
|
||||
"imposicion_id" => null,
|
||||
"tiempo_estimado" => null,
|
||||
"tiempo_real" => null,
|
||||
];
|
||||
protected $datamap = [];
|
||||
protected $dates = ['created_at', 'updated_at', 'deleted_at'];
|
||||
protected $casts = [
|
||||
"id" => "integer",
|
||||
"orden_trabajo_id" => "integer",
|
||||
"presupuesto_linea_id" => "?integer",
|
||||
"nombre" => "string",
|
||||
"orden" => "integer",
|
||||
"maquina_id" => "?integer",
|
||||
"imposicion_id" => "?integer",
|
||||
"tiempo_estimado" => "?float",
|
||||
"tiempo_real" => "?float"
|
||||
];
|
||||
|
||||
/**
|
||||
* Orden de trabajo de la tarea
|
||||
*
|
||||
* @return OrdenTrabajoEntity
|
||||
*/
|
||||
public function orden_trabajo() : OrdenTrabajoEntity
|
||||
{
|
||||
$m = model(OrdenTrabajoModel::class);
|
||||
return $m->find($this->attributes["orden_trabajo_id"]);
|
||||
}
|
||||
/**
|
||||
* Tarea orden de trabajo con orden de trabajo
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function withOrdenTrabajo() : self
|
||||
{
|
||||
$this->attributes["orden_trabajo"] = $this->orden_trabajo();
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Devuelve la maquina actual de esta tarea
|
||||
*
|
||||
* @return Maquina
|
||||
*/
|
||||
public function maquina_actual() : Maquina
|
||||
{
|
||||
$m = model(MaquinaModel::class);
|
||||
return $m->find($this->attributes["maquina_id"]);
|
||||
}
|
||||
/**
|
||||
* Devuelve el presupuesto linea origen de esta tarea
|
||||
*
|
||||
* @return PresupuestoLineaEntity
|
||||
*/
|
||||
public function presupuesto_linea() : PresupuestoLineaEntity
|
||||
{
|
||||
$m = model(PresupuestoLineaModel::class);
|
||||
return $m->find($this->attributes["presupuesto_linea_id"]);
|
||||
}
|
||||
/**
|
||||
* Devuelve la maquina original del presupuesto linea
|
||||
*
|
||||
* @return Maquina
|
||||
*/
|
||||
public function maquina_presupuesto_linea() : Maquina
|
||||
{
|
||||
return $this->presupuesto_linea()->maquina();
|
||||
}
|
||||
}
|
||||
12
ci4/app/Entities/Produccion/OrdenTrabajoUserEntity.php
Normal file
12
ci4/app/Entities/Produccion/OrdenTrabajoUserEntity.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entities\Produccion;
|
||||
|
||||
use CodeIgniter\Entity\Entity;
|
||||
|
||||
class OrdenTrabajoUserEntity extends Entity
|
||||
{
|
||||
protected $datamap = [];
|
||||
protected $dates = ['created_at', 'updated_at', 'deleted_at'];
|
||||
protected $casts = [];
|
||||
}
|
||||
Reference in New Issue
Block a user