mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Merge branch 'main' into 'feat/catalogo'
Main See merge request jjimenez/safekat!707
This commit is contained in:
@ -36,7 +36,9 @@ class ChatDepartmentEntity extends Entity
|
||||
$chatDepartmentUsers = $m->where('chat_department_id',$this->attributes['id'])
|
||||
->where('pedido_id',null)
|
||||
->where('factura_id',null)
|
||||
->where('presupuesto_id',null)->findAll();
|
||||
->where('presupuesto_id',null)
|
||||
->where('orden_trabajo_id',null)
|
||||
->findAll();
|
||||
return $chatDepartmentUsers;
|
||||
}
|
||||
/**
|
||||
@ -62,6 +64,9 @@ class ChatDepartmentEntity extends Entity
|
||||
case 'factura':
|
||||
$m->where('pedido_id',$modelFkId);
|
||||
break;
|
||||
case 'ot':
|
||||
$m->where('orden_trabajo_id',$modelFkId);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@ -20,6 +20,7 @@ class ChatDepartmentUserEntity extends Entity
|
||||
"pedido_id" => null,
|
||||
"factura_id" => null,
|
||||
"presupuesto_id" => null,
|
||||
"orden_trabajo_id" => null,
|
||||
];
|
||||
|
||||
|
||||
@ -29,6 +30,7 @@ class ChatDepartmentUserEntity extends Entity
|
||||
"pedido_id" => "?integer",
|
||||
"factura_id" => "?integer",
|
||||
"presupuesto_id" => "?integer",
|
||||
"orden_trabajo_id" => "?integer",
|
||||
];
|
||||
|
||||
public function user() : ?UserEntity
|
||||
|
||||
@ -5,11 +5,13 @@ namespace App\Entities\Chat;
|
||||
use App\Entities\Facturas\FacturaEntity;
|
||||
use App\Entities\Pedidos\PedidoEntity;
|
||||
use App\Entities\Presupuestos\PresupuestoEntity;
|
||||
use App\Entities\Produccion\OrdenTrabajoEntity;
|
||||
use App\Entities\Usuarios\UserEntity;
|
||||
use App\Models\Chat\ChatDeparmentModel;
|
||||
use App\Models\Chat\ChatMessageModel;
|
||||
use App\Models\ChatUser;
|
||||
use App\Models\Facturas\FacturaModel;
|
||||
use App\Models\OrdenTrabajo\OrdenTrabajoModel;
|
||||
use App\Models\Pedidos\PedidoModel;
|
||||
use App\Models\Presupuestos\PresupuestoModel;
|
||||
use App\Models\Usuarios\UserModel;
|
||||
@ -25,6 +27,7 @@ class ChatEntity extends Entity
|
||||
"pedido_id" => null,
|
||||
"presupuesto_id" => null,
|
||||
"factura_id" => null,
|
||||
"orden_trabajo_id" => null,
|
||||
"title" => null
|
||||
];
|
||||
|
||||
@ -34,6 +37,7 @@ class ChatEntity extends Entity
|
||||
"pedido_id" => "?integer",
|
||||
"presupuesto_id" => "?integer",
|
||||
"factura_id" => "?integer",
|
||||
"orden_trabajo_id" => "?integer",
|
||||
"title" => "string"
|
||||
];
|
||||
|
||||
@ -71,6 +75,11 @@ class ChatEntity extends Entity
|
||||
$m = model(FacturaEntity::class);
|
||||
return $m->find($this->attributes['factura_id']);
|
||||
}
|
||||
public function orden_trabajo(): ?OrdenTrabajoEntity
|
||||
{
|
||||
$m = model(OrdenTrabajoModel::class);
|
||||
return $m->find($this->attributes['orden_trabajo_id']);
|
||||
}
|
||||
public function messages(): ?array
|
||||
{
|
||||
$m = model(ChatMessageModel::class);
|
||||
@ -100,12 +109,14 @@ class ChatEntity extends Entity
|
||||
$models = [
|
||||
"presupuesto_id" => model(PresupuestoModel::class),
|
||||
"pedido_id" => model(PedidoModel::class),
|
||||
"factura_id" => model(FacturaModel::class)
|
||||
"factura_id" => model(FacturaModel::class),
|
||||
"orden_trabajo_id" => model(OrdenTrabajoModel::class),
|
||||
];
|
||||
$fks = [
|
||||
"presupuesto_id" => $this->attributes["presupuesto_id"],
|
||||
"pedido_id" => $this->attributes["pedido_id"],
|
||||
"factura_id" => $this->attributes["factura_id"],
|
||||
"orden_trabajo_id" => $this->attributes["orden_trabajo"],
|
||||
];
|
||||
foreach ($fks as $key => $fk) {
|
||||
if ($fk) {
|
||||
@ -123,6 +134,7 @@ class ChatEntity extends Entity
|
||||
"presupuesto" => $this->attributes["presupuesto_id"],
|
||||
"pedido" => $this->attributes["pedido_id"],
|
||||
"factura" => $this->attributes["factura_id"],
|
||||
"ot" => $this->attributes["orden_trabajo_id"],
|
||||
];
|
||||
foreach ($fks as $key => $fk) {
|
||||
if ($fk) {
|
||||
|
||||
@ -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,45 @@
|
||||
|
||||
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,
|
||||
"cosido_at" => null,
|
||||
"solapa_at" => null,
|
||||
"grapado_at" => null,
|
||||
"retractilado_at"=> null,
|
||||
"retractilado5_at"=> null,
|
||||
"prototipo_at"=> null,
|
||||
"marcapaginas_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 +48,52 @@ 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"
|
||||
|
||||
];
|
||||
protected $casts = [];
|
||||
|
||||
public function sinImprimirStatus(): bool
|
||||
{
|
||||
return !(
|
||||
$this->attributes['interior_bn_at'] == null
|
||||
&& $this->attributes['interior_color_at'] == null
|
||||
&& $this->attributes['cubierta_at'] == null
|
||||
);
|
||||
}
|
||||
public function impresionInteriorStatus():bool
|
||||
{
|
||||
return $this->attributes['interior_bn_at']|| $this->attributes['interior_color_at'];
|
||||
}
|
||||
public function impresionCubiertaStatus():bool
|
||||
{
|
||||
return $this->attributes['cubierta_at'] != null;
|
||||
}
|
||||
public function plastificadoStatus():bool
|
||||
{
|
||||
return $this->attributes['plastificado_at'] != null;
|
||||
}
|
||||
public function encuadernadoStatus():bool
|
||||
{
|
||||
return $this->attributes['encuadernacion_at'] != null;
|
||||
}
|
||||
public function preparacionInterioresStatus():bool
|
||||
{
|
||||
return $this->attributes['preparacion_interiores_at'] != null;
|
||||
}
|
||||
public function corteStatus():bool
|
||||
{
|
||||
return $this->attributes['corte_at'] != null;
|
||||
}
|
||||
public function cosidoStatus():bool
|
||||
{
|
||||
return $this->attributes['cosido_at'] != null;
|
||||
}
|
||||
public function grapadoStatus():bool
|
||||
{
|
||||
return $this->attributes['grapado_at'] != null;
|
||||
}
|
||||
public function solapaStatus():bool
|
||||
{
|
||||
return $this->attributes['solapa_at'] != null;
|
||||
}
|
||||
}
|
||||
|
||||
@ -21,21 +21,21 @@ class OrdenTrabajoEntity extends Entity
|
||||
"pedido_id" => null,
|
||||
"user_created_id" => null,
|
||||
"user_updated_id" => null,
|
||||
"fecha_entrega_warning" => false,
|
||||
"fecha_entrega_warning_revised" => false,
|
||||
"fecha_entrega_warning" => null,
|
||||
"fecha_entrega_warning_revised" => null,
|
||||
"total_tirada" => null,
|
||||
"total_precio" => null,
|
||||
"tipo_entrada" => "out",
|
||||
"progreso" => 0.00,
|
||||
"estado" => "I",
|
||||
"comentarios" => null,
|
||||
"revisar_formato" => false,
|
||||
"revisar_lomo" => false,
|
||||
"revisar_solapa" => false,
|
||||
"revisar_isbn" => false,
|
||||
"revisar_codigo_barras" => false,
|
||||
"realizar_imposicion" => false,
|
||||
"enviar_impresion" => false,
|
||||
"revisar_formato" => null,
|
||||
"revisar_lomo" => null,
|
||||
"revisar_solapa" => null,
|
||||
"revisar_isbn" => null,
|
||||
"revisar_codigo_barras" => null,
|
||||
"realizar_imposicion" => null,
|
||||
"enviar_impresion" => null,
|
||||
"portada_path" => null,
|
||||
"is_pedido_espera" => null,
|
||||
"pedido_espera_by" => null,
|
||||
@ -87,12 +87,12 @@ class OrdenTrabajoEntity extends Entity
|
||||
public function dates(): ?OrdenTrabajoDateEntity
|
||||
{
|
||||
$m = model(OrdenTrabajoDate::class);
|
||||
return $m->where('orden_trabajo_id',$this->attributes["id"])->first();
|
||||
return $m->where('orden_trabajo_id', $this->attributes["id"])->first();
|
||||
}
|
||||
public function users(): ?OrdenTrabajoUserEntity
|
||||
{
|
||||
$m = model(OrdenTrabajoUser::class);
|
||||
return $m->where('orden_trabajo_id',$this->attributes["id"])->first();
|
||||
return $m->where('orden_trabajo_id', $this->attributes["id"])->first();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -109,24 +109,24 @@ class OrdenTrabajoEntity extends Entity
|
||||
$this->attributes["dates"] = $ot_dates->fill($data);
|
||||
return $this;
|
||||
}
|
||||
public function getBarCode() : string
|
||||
public function getBarCode(): string
|
||||
{
|
||||
$barcode = new TypeCode128();
|
||||
$renderer = new PngRenderer();
|
||||
$barcodeData = $barcode->getBarcode($this->pedido()->presupuesto()->id);
|
||||
return base64_encode($renderer->render($barcodeData,200, 50));
|
||||
return base64_encode($renderer->render($barcodeData, 200, 50));
|
||||
}
|
||||
public function files() : array
|
||||
public function files(): array
|
||||
{
|
||||
$m = model(OrdenTrabajoFileModel::class);
|
||||
return $m->where('orden_trabajo_id',$this->attributes['id'])->findAll() ?? [];
|
||||
return $m->where('orden_trabajo_id', $this->attributes['id'])->findAll() ?? [];
|
||||
}
|
||||
public function pedidoEsperaBy() : ?UserEntity
|
||||
public function pedidoEsperaBy(): ?UserEntity
|
||||
{
|
||||
$m = model(UserModel::class);
|
||||
if($this->attributes['pedido_espera_by']){
|
||||
if ($this->attributes['pedido_espera_by']) {
|
||||
return $m->findById($this->attributes['pedido_espera_by']);
|
||||
}else{
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@ -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,42 @@ 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,
|
||||
"cosido_user_id" => null,
|
||||
"solapa_user_id" => null,
|
||||
"grapado_user_id" => null,
|
||||
"retractilado_user_id" => null,
|
||||
"retractilado5_user_id" => null,
|
||||
"prototipo_user_id" => null,
|
||||
"marcapaginas_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 +80,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])) {
|
||||
@ -78,7 +92,7 @@ class OrdenTrabajoUserEntity extends Entity
|
||||
}
|
||||
return $user;
|
||||
}
|
||||
public function getPlastificadoBy() : ?UserEntity
|
||||
public function getPlastificadoBy(): ?UserEntity
|
||||
{
|
||||
return $this->userBy('plastificado_user_id');
|
||||
}
|
||||
|
||||
@ -33,6 +33,14 @@ class TarifaEncuadernacionEntity extends \CodeIgniter\Entity\Entity
|
||||
"user_updated_id" => "int",
|
||||
"is_deleted" => "int",
|
||||
];
|
||||
|
||||
public function getNameInitials(): string
|
||||
{
|
||||
$words = explode(" ",$this->attributes["nombre"]);
|
||||
$words_initial = array_map(fn($w) => substr(strtoupper($w),0,1),$words);
|
||||
return implode("",$words_initial);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user