Agregando calculo de efectivo

This commit is contained in:
2025-01-12 13:30:13 -03:00
parent 7bb61017de
commit 332467f767
8 changed files with 214 additions and 43 deletions

View File

@@ -12,17 +12,30 @@ class Efectivo extends Model
protected $table = 'efectivos';
public function getTotal(): Attribute {
protected $fillable = [
'veinte_mil',
'diez_mil',
'cinco_mil',
'dos_mil',
'mil',
'quinientos',
'cien',
'cincuenta',
'diez',
];
public function total(): Attribute
{
return Attribute::get(function () {
return $this->veinte_mil
+ $this->diez_mil
+ $this->cinco_mil
+ $this->dos_mil
+ $this->mil
+ $this->quinientos
+ $this->cien
+ $this->cincuenta
+ $this->diez;
return $this->veinte_mil
+ $this->diez_mil
+ $this->cinco_mil
+ $this->dos_mil
+ $this->mil
+ $this->quinientos
+ $this->cien
+ $this->cincuenta
+ $this->diez;
});
}
}