imposiciones

This commit is contained in:
amazuecos
2025-04-12 23:53:48 +02:00
parent 41159d1588
commit ba9c4dc339
19 changed files with 293 additions and 453 deletions

View File

@ -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]);
}
}

View File

@ -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]);
}
}