Merge branch 'main' into 'feat/catalogo'

Main

See merge request jjimenez/safekat!718
This commit is contained in:
Ignacio Martinez Navajas
2025-04-21 12:07:04 +00:00
547 changed files with 2700 additions and 1216 deletions

0
ci4/app/Entities/Chat/ChatDepartmentEntity.php Normal file → Executable file
View File

0
ci4/app/Entities/Chat/ChatDepartmentUserEntity.php Normal file → Executable file
View File

0
ci4/app/Entities/Chat/ChatEntity.php Normal file → Executable file
View File

0
ci4/app/Entities/Chat/ChatMessageEntity.php Normal file → Executable file
View File

0
ci4/app/Entities/Chat/ChatNotificationEntity.php Normal file → Executable file
View File

0
ci4/app/Entities/Chat/ChatUserEntity.php Normal file → Executable file
View File

View File

@ -1,6 +1,8 @@
<?php
namespace App\Entities\Configuracion;
use App\Models\Configuracion\ImposicionEsquemaModel;
use CodeIgniter\Entity;
class Imposicion extends \CodeIgniter\Entity\Entity
@ -13,19 +15,36 @@ class Imposicion extends \CodeIgniter\Entity\Entity
"orientacion" => null,
"maquina" => null,
"etiqueta" => null,
"imposicion_esquema_id" => null
];
protected $casts = [
"ancho" => "int",
"alto" => "int",
"unidades" => "?int",
"imposicion_esquema_id" => "?int"
];
public function getFullName() : string
public function getFullName(): string
{
$ancho_x_alto = $this->attributes["ancho"] ."x". $this->attributes["alto"];
$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]);
return implode("_", [$ancho_x_alto, $unidades, $orientacion]);
}
public function withImposicionEsquema(): self
{
$this->attributes["imposicion_esquema"] = $this->imposicion_esquema();
return $this;
}
public function imposicion_esquema(): ?ImposicionEsquemaEntity
{
$esquema = null;
if ($this->attributes["imposicion_esquema_id"]) {
$m = model(ImposicionEsquemaModel::class);
$esquema = $m->find($this->attributes["imposicion_esquema_id"]);
}
return $esquema;
}
}

View File

@ -0,0 +1,26 @@
<?php
namespace App\Entities\Configuracion;
use CodeIgniter\Entity\Entity;
class ImposicionEsquemaEntity extends Entity
{
protected $attributes = [
"name" => null,
"rows" => null,
"columns" => null,
"orientacion"=> null,
"rotativa"=> null,
"cosido"=> null,
"svg_schema"=> null
];
protected $dates = ['created_at', 'updated_at', 'deleted_at'];
protected $casts = [
"name" => "string",
"rows" => "integer",
"columns" => "integer",
"rotativa"=> "boolean",
"cosido"=> "boolean",
];
}

View File

View File

View File

0
ci4/app/Entities/Configuracion/UbicacionesEntity.php Normal file → Executable file
View File

0
ci4/app/Entities/Facturas/FacturaEntity.php Normal file → Executable file
View File

0
ci4/app/Entities/Facturas/FacturaLineaEntity.php Normal file → Executable file
View File

0
ci4/app/Entities/Facturas/FacturaPagoEntity.php Normal file → Executable file
View File

0
ci4/app/Entities/Mensajeria/ConversacionEntity.php Normal file → Executable file
View File

0
ci4/app/Entities/Mensajeria/ParticipanteEntity.php Normal file → Executable file
View File

0
ci4/app/Entities/Pedidos/AlbaranEntity.php Normal file → Executable file
View File

0
ci4/app/Entities/Pedidos/AlbaranLineaEntity.php Normal file → Executable file
View File

0
ci4/app/Entities/Pedidos/PedidoEntity.php Normal file → Executable file
View File

0
ci4/app/Entities/Pedidos/PedidoLineaEntity.php Normal file → Executable file
View File

View File

@ -54,4 +54,5 @@ class PresupuestoAcabadosEntity extends \CodeIgniter\Entity\Entity
$m = model(TarifaAcabadoModel::class);
return $m->find($this->attributes["tarifa_acabado_id"]);
}
}

View File

@ -4,8 +4,10 @@ namespace App\Entities\Presupuestos;
use App\Entities\Clientes\ClienteEntity;
use App\Entities\Configuracion\PapelFormatoEntity;
use App\Entities\Configuracion\TipoPresupuestoEntity;
use App\Models\Clientes\ClienteModel;
use App\Models\Configuracion\PapelFormatoModel;
use App\Models\Configuracion\TipoPresupuestoModel;
use App\Models\Presupuestos\PresupuestoAcabadosModel;
use App\Models\Presupuestos\PresupuestoEncuadernacionesModel;
use App\Models\Presupuestos\PresupuestoFicheroModel;
@ -300,4 +302,15 @@ class PresupuestoEntity extends \CodeIgniter\Entity\Entity
$files = $m->where('presupuesto_id',$this->attributes['id'])->findAll();
return $files ?? [];
}
public function tipo_presupuesto() : ?TipoPresupuestoEntity
{
$tipo_presupuesto = null;
$m = model(TipoPresupuestoModel::class);
if($this->attributes["tipo_impresion_id"]){
$tipo_presupuesto = $m->find($this->attributes['tipo_impresion_id']);
}
return $tipo_presupuesto;
}
}

View File

View File

1
ci4/app/Entities/Produccion/OrdenTrabajoDateEntity.php Normal file → Executable file
View File

@ -28,6 +28,7 @@ class OrdenTrabajoDateEntity extends Entity
"retractilado5_at"=> null,
"prototipo_at"=> null,
"marcapaginas_at"=> null,
"espiral_at"=> null,
//FERRO
"pendiente_ferro_at" => null,
"ferro_en_cliente_at" => null,

35
ci4/app/Entities/Produccion/OrdenTrabajoEntity.php Normal file → Executable file
View File

@ -74,6 +74,11 @@ class OrdenTrabajoEntity extends Entity
$m = model(OrdenTrabajoTarea::class);
return $m->where("orden_trabajo_id", $this->attributes["id"])->findAll();
}
public function tareas_impresion(): array
{
$m = model(OrdenTrabajoTarea::class);
return $m->where("orden_trabajo_id", $this->attributes["id"])->where("presupuesto_linea_id IS NOT NULL", NULL, FALSE)->findAll() ?? [];
}
/**
* Devuelve el pedido de la orden de trabajo
*
@ -116,6 +121,14 @@ class OrdenTrabajoEntity extends Entity
$barcodeData = $barcode->getBarcode($this->pedido()->presupuesto()->id);
return base64_encode($renderer->render($barcodeData, 200, 50));
}
public function getBarCodeFile()
{
$barcode = new TypeCode128();
$renderer = new PngRenderer();
$renderer->setBackgroundColor([255, 255, 255]); // Give a color blue for the background, default is transparent. Give it as 3 times 0-255 values for red, green and blue.
$barcodeData = $barcode->getBarcode($this->pedido()->presupuesto()->id);
return ($renderer->render($barcodeData, 200, 50));
}
public function files(): array
{
$m = model(OrdenTrabajoFileModel::class);
@ -139,13 +152,25 @@ class OrdenTrabajoEntity extends Entity
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;
if ($this->attributes["portada_path"]) {
if ($path) {
if (file_exists($path)) {
$portada_path = $path;
} else {
$portada_path = null;
}
}
}
return $portada_path;
}
public function getEstadoText(): string
{
$estados = [
"E" => lang('Produccion.error'),
"I" => lang('Produccion.iniciada'),
"F" => lang('Produccion.finalizada'),
"PM" => lang("Produccion.pendiente_material")
];
return $estados[$this->attributes["estado"]];
}
}

0
ci4/app/Entities/Produccion/OrdenTrabajoFileEntity.php Normal file → Executable file
View File

View File

View File

2
ci4/app/Entities/Produccion/OrdenTrabajoUserEntity.php Normal file → Executable file
View File

@ -32,6 +32,8 @@ class OrdenTrabajoUserEntity extends Entity
"retractilado5_user_id" => null,
"prototipo_user_id" => null,
"marcapaginas_user_id" => null,
"espiral_user_id" => null,
//FERRO
"pendiente_ferro_user_id" => null,
"ferro_en_cliente_user_id" => null,

0
ci4/app/Entities/Sistema/ActivityEntity.php Normal file → Executable file
View File

0
ci4/app/Entities/Sistema/SettingsEntity.php Normal file → Executable file
View File

0
ci4/app/Entities/Soporte/TicketEntity.php Normal file → Executable file
View File

0
ci4/app/Entities/Soporte/TicketRespuestaEntity.php Normal file → Executable file
View File

View File

View File

@ -45,4 +45,9 @@ class TarifaAcabadoEntity extends \CodeIgniter\Entity\Entity
$ta_maquinas = $m->where('tarifa_acabado_id',$this->attributes['id'])->findAll();
return array_map(fn(TarifaAcabadoMaquinaEntity $ta_maquina) => $ta_maquina->maquina(),$ta_maquinas);
}
public function isUVI(): bool
{
return in_array($this->attributes["code"],["R3D","R2D"]);
}
}

View File

View File

View File

View File

View File

View File

0
ci4/app/Entities/Usuarios/GroupEntity.php Normal file → Executable file
View File

0
ci4/app/Entities/Usuarios/GroupsUsersEntity.php Normal file → Executable file
View File

0
ci4/app/Entities/Usuarios/PermisosEntity.php Normal file → Executable file
View File

0
ci4/app/Entities/Wiki/WikiContentEntity.php Normal file → Executable file
View File

0
ci4/app/Entities/Wiki/WikiFileEntity.php Normal file → Executable file
View File

0
ci4/app/Entities/Wiki/WikiPageEntity.php Normal file → Executable file
View File

0
ci4/app/Entities/Wiki/WikiSectionEntity.php Normal file → Executable file
View File

0
ci4/app/Entities/Wiki/WikiSectionRoleEntity.php Normal file → Executable file
View File