Cambios revisados en controles
This commit is contained in:
@ -15,6 +15,9 @@ class Model extends \Model
|
||||
if (strpos(get_called_class(), 'Incoviba\\common\\') !== false) {
|
||||
return;
|
||||
}
|
||||
if ($this->container->get('settings')->app->offline) {
|
||||
return;
|
||||
}
|
||||
$user = Auth::User()->id;
|
||||
$orm = $this->orm;
|
||||
$ref = new \ReflectionObject($orm);
|
||||
|
@ -24,7 +24,7 @@ class EstadoProyecto extends Model
|
||||
}
|
||||
public function fecha()
|
||||
{
|
||||
return Carbon::parse($this->fecha, config('app.timezone'));
|
||||
return Carbon::parse($this->fecha, $this->container->get('settings')->app->timezone);
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
@ -229,6 +229,9 @@ class Proyecto extends Model
|
||||
}
|
||||
$ventas = $ventas->find_many();
|
||||
$this->ventas = $ventas;
|
||||
foreach ($this->ventas as &$venta) {
|
||||
$venta->setContainer($this->container);
|
||||
}
|
||||
}
|
||||
return $this->ventas;
|
||||
}
|
||||
@ -249,6 +252,9 @@ class Proyecto extends Model
|
||||
->find_many()
|
||||
;
|
||||
$this->resciliaciones = $resciliaciones;
|
||||
foreach ($this->resciliaciones as &$venta) {
|
||||
$venta->setContainer($this->container);
|
||||
}
|
||||
}
|
||||
return $this->resciliaciones;
|
||||
}
|
||||
@ -267,6 +273,9 @@ class Proyecto extends Model
|
||||
->find_many()
|
||||
;
|
||||
$this->escrituras = $ventas;
|
||||
foreach ($this->escrituras as &$venta) {
|
||||
$venta->setContainer($this->container);
|
||||
}
|
||||
}
|
||||
return $this->escrituras;
|
||||
}
|
||||
@ -291,6 +300,9 @@ class Proyecto extends Model
|
||||
return $dif;
|
||||
});
|
||||
$this->entregas = $entregas;
|
||||
foreach ($this->entregas as &$venta) {
|
||||
$venta->setContainer($this->container);
|
||||
}
|
||||
}
|
||||
return $this->entregas;
|
||||
}
|
||||
|
@ -69,7 +69,7 @@ class Cierre extends Model
|
||||
public function fecha(\DateTime $fecha = null)
|
||||
{
|
||||
if ($fecha == null) {
|
||||
return Carbon::parse($this->fecha, 'America/Santiago');//, config('app.timezone'));
|
||||
return Carbon::parse($this->fecha, $this->container->get('settings')->app->timezone);//, config('app.timezone'));
|
||||
}
|
||||
$this->fecha = $fecha->format('Y-m-d');
|
||||
}
|
||||
|
@ -56,7 +56,7 @@ class Pago extends Model
|
||||
}
|
||||
public function fecha()
|
||||
{
|
||||
return Carbon::parse($this->fecha, config('app.timezone'));
|
||||
return Carbon::parse($this->fecha, $this->container->get('settings')->app->timezone);
|
||||
}
|
||||
public function uf()
|
||||
{
|
||||
|
@ -21,7 +21,9 @@ class Propiedad extends Model
|
||||
|
||||
public function unidad()
|
||||
{
|
||||
return $this->belongs_to(Unidad::class, 'unidad_principal')->findOne();
|
||||
$unidad = $this->belongs_to(Unidad::class, 'unidad_principal')->findOne();
|
||||
$unidad->setContainer($this->container);
|
||||
return $unidad;
|
||||
}
|
||||
protected $unidades;
|
||||
public function unidades() {
|
||||
|
@ -28,7 +28,9 @@ class Unidad extends Model
|
||||
{
|
||||
public function proyecto()
|
||||
{
|
||||
return $this->belongs_to(Proyecto::class, 'proyecto')->findOne();
|
||||
$proyecto = $this->belongs_to(Proyecto::class, 'proyecto')->findOne();
|
||||
$proyecto->setContainer($this->container);
|
||||
return $proyecto;
|
||||
}
|
||||
protected $propiedad;
|
||||
public function propiedad()
|
||||
|
@ -48,7 +48,9 @@ class Venta extends Model
|
||||
}
|
||||
public function propiedad()
|
||||
{
|
||||
return $this->belongs_to(Propiedad::class, 'propiedad')->findOne();
|
||||
$propiedad = $this->belongs_to(Propiedad::class, 'propiedad')->findOne();
|
||||
$propiedad->setContainer($this->container);
|
||||
return $propiedad;
|
||||
}
|
||||
public function bonoPie()
|
||||
{
|
||||
|
Reference in New Issue
Block a user