Limpieza e intento de modernizar informe de ventas
This commit is contained in:
33
src/nuevo/Common/M2.php
Normal file
33
src/nuevo/Common/M2.php
Normal file
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
namespace Incoviba\nuevo\Common;
|
||||
|
||||
use App\Alias\NewModel;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Aldarien
|
||||
* @property int id
|
||||
* @property double util
|
||||
* @property double logia
|
||||
* @property double terraza
|
||||
* @property double cubierta
|
||||
* @property double terreno
|
||||
*
|
||||
*/
|
||||
class M2 extends NewModel
|
||||
{
|
||||
protected static $_table = 'm2s';
|
||||
|
||||
public function unidades()
|
||||
{
|
||||
return $this->has_many(\Incoviba\nuevo\Proyecto\UnidadProyecto::class, 'm2_id')->findMany();
|
||||
}
|
||||
public function vendibles()
|
||||
{
|
||||
return $this->util + $this->logia + $this->terraza / 2 + $this->cubierta / 3;
|
||||
}
|
||||
public function total()
|
||||
{
|
||||
return $this->util + $this->logia + $this->terraza + $this->cubierta;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user