Container
This commit is contained in:
@ -8,7 +8,7 @@ use Incoviba\nuevo\Proyecto\Proyecto;
|
||||
use Incoviba\Common\Definition\hasEstado;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author Aldarien
|
||||
* @property int $id
|
||||
* @property Proyecto $proyecto_id
|
||||
@ -24,9 +24,9 @@ use Incoviba\Common\Definition\hasEstado;
|
||||
class Cierre extends NewModel
|
||||
{
|
||||
use hasEstado;
|
||||
|
||||
|
||||
protected static $_table = 'cierres';
|
||||
|
||||
|
||||
public function proyecto()
|
||||
{
|
||||
return $this->belongsTo(Proyecto::class, 'proyecto_id')->findOne();
|
||||
@ -45,15 +45,15 @@ class Cierre extends NewModel
|
||||
}
|
||||
public function fecha()
|
||||
{
|
||||
return Carbon::parse($this->fecha, config('app.timezone'));
|
||||
return Carbon::parse($this->fecha, $this->container->get('settings')->app->timezone);
|
||||
}
|
||||
public function pie($type = 'ufs')
|
||||
{
|
||||
if ($type == 'ufs') {
|
||||
return $this->pie;
|
||||
}
|
||||
$uf = uf($this->fecha());
|
||||
$uf = $this->container->get('uf')($this->fecha());
|
||||
return $this->pie * $uf->uf->value;
|
||||
}
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
Reference in New Issue
Block a user