Container
This commit is contained in:
@ -69,7 +69,7 @@ class Cierre extends Model
|
||||
public function fecha(\DateTime $fecha = null)
|
||||
{
|
||||
if ($fecha == null) {
|
||||
return Carbon::parse($this->fecha, $this->container->get('settings')->app->timezone);//, config('app.timezone'));
|
||||
return Carbon::parse($this->fecha, $this->container->get('settings')->app->timezone);
|
||||
}
|
||||
$this->fecha = $fecha->format('Y-m-d');
|
||||
}
|
||||
@ -234,7 +234,7 @@ class Cierre extends Model
|
||||
if (isset($input->subrelacionado) and $input->subrelacionado) {
|
||||
$this->relacionado = 2;
|
||||
}
|
||||
$fecha = Carbon::today(config('app.timezone'));
|
||||
$fecha = Carbon::today($this->container->get('settings')->app->timezone);
|
||||
$this->new($fecha);
|
||||
|
||||
$data = [
|
||||
@ -350,7 +350,7 @@ class Cierre extends Model
|
||||
return ($this->relacionado == 2) ? true : false;
|
||||
}
|
||||
public function periodo() {
|
||||
$today = Carbon::today(config('app.timezone'));
|
||||
$today = Carbon::today($this->container->get('settings')->app->timezone);
|
||||
$dif = $today->diffInDays($this->fecha());
|
||||
return $dif;
|
||||
}
|
||||
@ -360,6 +360,6 @@ class Cierre extends Model
|
||||
if ($this->propietario()) {
|
||||
$arr['propietario'] = $this->propietario()->asArray();
|
||||
}
|
||||
return $arr;
|
||||
return $arr;
|
||||
}
|
||||
}
|
||||
|
@ -23,7 +23,7 @@ class EstadoCierre extends Model
|
||||
public function fecha(\DateTime $fecha = null)
|
||||
{
|
||||
if ($fecha == null) {
|
||||
return Carbon::parse($this->fecha, config('app.timezone'));
|
||||
return Carbon::parse($this->fecha, $this->container->get('settings')->app->timezone);
|
||||
}
|
||||
$this->fecha = $fecha->format('Y-m-d');
|
||||
}
|
||||
|
@ -14,14 +14,14 @@ use Carbon\Carbon;
|
||||
*
|
||||
*/
|
||||
class EstadoPago extends Model
|
||||
{
|
||||
{
|
||||
public function tipo()
|
||||
{
|
||||
return $this->belongs_to(TipoEstadoPago::class, 'estado')->findOne();
|
||||
}
|
||||
public function fecha()
|
||||
{
|
||||
return Carbon::parse($this->fecha, config('app.timezone'));
|
||||
return Carbon::parse($this->fecha, $this->container->get('settings')->app->timezone);
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
@ -19,7 +19,7 @@ class EstadoPrecio extends Model
|
||||
public function fecha($fecha = null)
|
||||
{
|
||||
if ($fecha == null) {
|
||||
return Carbon::parse($this->fecha, config('app.timezone'));
|
||||
return Carbon::parse($this->fecha, $this->container->get('settings')->app->timezone);
|
||||
}
|
||||
if (is_a($fecha, \DateTime::class)) {
|
||||
$fecha = $fecha->format('Y-m-d');
|
||||
|
@ -19,7 +19,7 @@ class EstadoUnidadBloqueada extends Model
|
||||
public function fecha(\DateTime $fecha = null)
|
||||
{
|
||||
if ($fecha == null) {
|
||||
return Carbon::parse($this->fecha, config('app.timezone'));
|
||||
return Carbon::parse($this->fecha, $this->container->get('settings')->app->timezone);
|
||||
}
|
||||
$this->fecha = $fecha->format('Y-m-d');
|
||||
}
|
||||
|
@ -22,6 +22,6 @@ class EstadoVenta extends Model
|
||||
}
|
||||
public function fecha()
|
||||
{
|
||||
return Carbon::parse($this->fecha, config('app.timezone'));
|
||||
return Carbon::parse($this->fecha, $this->container->get('settings')->app->timezone);
|
||||
}
|
||||
}
|
||||
|
@ -61,7 +61,7 @@ class Pago extends Model
|
||||
public function uf()
|
||||
{
|
||||
if ($this->uf == 0) {
|
||||
$uf = uf($this->fecha);
|
||||
$uf = $this->container->get('uf')($this->fecha);
|
||||
if (!$uf or $uf->total == 0) {
|
||||
return 1;
|
||||
}
|
||||
|
@ -196,7 +196,7 @@ class Pie extends Model
|
||||
public function uf()
|
||||
{
|
||||
if ($this->uf == 0) {
|
||||
$uf = uf($this->fecha);
|
||||
$uf = $this->container->get('uf')($this->fecha);
|
||||
if (!$uf) {
|
||||
return 1;
|
||||
}
|
||||
|
@ -420,7 +420,7 @@ class Venta extends Model
|
||||
{
|
||||
if ($this->uf == null) {
|
||||
$f = $this->fecha();
|
||||
$uf = uf($f);
|
||||
$uf = $this->container->get('uf')($f);
|
||||
if ($uf == null) {
|
||||
return 1;
|
||||
}
|
||||
|
Reference in New Issue
Block a user