This commit is contained in:
2021-12-06 22:10:41 -03:00
parent 10b2485cfd
commit 8ef4ab1c7d
41 changed files with 1256 additions and 57 deletions

View File

@ -1,6 +1,7 @@
<?php
namespace Contabilidad;
use DateTime;
use Carbon\Carbon;
use ProVM\Common\Alias\Model;
@ -8,7 +9,7 @@ use ProVM\Common\Alias\Model;
* @property int $id
* @property Cuenta $debito_id
* @property Cuenta $credito_id
* @property \DateTime $fecha
* @property DateTime $fecha
* @property string $glosa
* @property string $detalle
* @property double $valor
@ -31,7 +32,7 @@ class Transaccion extends Model {
}
return $this->credito;
}
public function fecha(\DateTime $fecha = null) {
public function fecha(DateTime $fecha = null) {
if ($fecha === null) {
return Carbon::parse($this->fecha);
}
@ -43,7 +44,7 @@ class Transaccion extends Model {
$arr['debito'] = $this->debito()->toArray();
$arr['credito'] = $this->credito()->toArray();
$arr['fechaFormateada'] = $this->fecha()->format('d-m-Y');
$arr['valorFormateado'] = '$' . number_format($this->valor, 0, ',', '.');
$arr['valorFormateado'] = $this->debito()->moneda()->format($this->valor);
return $arr;
}
}