old models

This commit is contained in:
2019-12-23 18:01:23 -03:00
parent 50c2bb0f15
commit f67ab72e2a
72 changed files with 4625 additions and 0 deletions

View File

@ -0,0 +1,30 @@
<?php
namespace Incoviba\old\Venta;
use Carbon\Carbon;
use Incoviba\Common\Alias\OldModel as Model;
/**
* @property int $id
* @property Cierre $cierre
* @property TipoEstadoCierre $tipo
* @property \DateTime $fecha
*/
class EstadoCierre extends Model
{
public function cierre()
{
return $this->belongsTo(Cierre::class, 'cierre')->findOne();
}
public function tipo()
{
return $this->belongsTo(TipoEstadoCierre::class, 'tipo')->findOne();
}
public function fecha(\DateTime $fecha = null)
{
if ($fecha == null) {
return Carbon::parse($this->fecha, config('app.timezone'));
}
$this->fecha = $fecha->format('Y-m-d');
}
}