Merge branch 'develop'
This commit is contained in:
@ -305,10 +305,27 @@ class Cierre extends Model
|
||||
$estado->save();
|
||||
}
|
||||
}
|
||||
public function abandonar(\DateTime $fecha) {
|
||||
$tipo = model(TipoEstadoCierre::class)->where('descripcion', 'abandonado')->findOne();
|
||||
$data = [
|
||||
'cierre' => $this->id,
|
||||
'tipo' => $tipo->id
|
||||
];
|
||||
$estado = (new Factory(EstadoCierre::class))->where($data)->find();
|
||||
if (!$estado) {
|
||||
$data['fecha'] = $fecha->format('Y-m-d');
|
||||
$estado = model(EstadoCierre::class)->create($data);
|
||||
$estado->setContainer($this->container);
|
||||
$estado->save();
|
||||
}
|
||||
}
|
||||
protected $promesa;
|
||||
public function promesa()
|
||||
{
|
||||
if ($this->promesa == null) {
|
||||
if (!$this->unidadPrincipal()) {
|
||||
$this->promesa = false;
|
||||
}
|
||||
if ($this->promesa === null) {
|
||||
$propiedad = model(Propiedad::class)->where('unidad_principal', $this->unidadPrincipal()->unidad)->findOne();
|
||||
if (!$propiedad) {
|
||||
$this->promesa = false;
|
||||
|
@ -75,7 +75,7 @@ class Venta extends Model
|
||||
}
|
||||
public function fecha()
|
||||
{
|
||||
return Carbon::parse($this->fecha, new \DateTimeZone(config('app.timezone')));
|
||||
return Carbon::parse($this->fecha, $this->container->get('settings')->app->timezone);
|
||||
}
|
||||
public function proyecto()
|
||||
{
|
||||
|
Reference in New Issue
Block a user