FIX: DateInterval

This commit is contained in:
Juan Pablo Vial
2022-03-07 21:23:21 -03:00
parent 5fefdd94b0
commit 301a4c7302

View File

@ -3,6 +3,7 @@ namespace App\Service\Informe\Contabilidad;
use DateTimeInterface;
use DateTimeImmutable;
use DateInterval;
use Incoviba\old\Proyecto\Proyecto;
use Incoviba\old\Venta\Venta;
use Incoviba\old\Venta\Pago;
@ -33,7 +34,7 @@ class Resumen
}
protected function startOfYear(DateTimeInterface $up_to)
{
return new DateTimeImmutable((clone $up_to)->sub('P1Y')->format('31-12-Y'));
return new DateTimeImmutable((clone $up_to)->sub(new DateInterval('P1Y'))->format('31-12-Y'));
}
protected function defaultValueDate(DateTimeInterface $up_to)
{