mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
imposiciones
This commit is contained in:
@ -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]);
|
||||
}
|
||||
}
|
||||
|
||||
@ -134,4 +134,18 @@ class OrdenTrabajoEntity extends Entity
|
||||
{
|
||||
return $this->pedidoEsperaBy();
|
||||
}
|
||||
public function getPortadaPath(): ?string
|
||||
{
|
||||
helper('filesystem');
|
||||
$path = $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,10 @@ class OrdenTrabajoTareaEntity extends Entity
|
||||
$m = model(PresupuestoAcabadosModel::class);
|
||||
return $m->find($this->attributes["presupuesto_linea_id"]);
|
||||
}
|
||||
public function imposicion() : ?Imposicion
|
||||
{
|
||||
$m = model(ImposicionModel::class);
|
||||
return $m->find($this->attributes["imposicion_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