[WIP] Store Limit

This commit is contained in:
R
2022-12-05 04:30:00 +07:00
parent 2d5c7b571e
commit f5372e5d0a
19 changed files with 525 additions and 76 deletions

View File

@@ -11,7 +11,9 @@ class LimitJournal extends Model
protected $fillable = [
'journalable',
'mutation',
'previous_balance',
'total_credit',
'total_debit',
'type',
'balance',
'description',
@@ -21,4 +23,15 @@ class LimitJournal extends Model
{
return $this->morphTo();
}
public function setTotalCreditAttribute($value)
{
$this->attributes['total_credit'] = empty($value) ? 0 : $value;
}
public function setTotalDebitAttribute($value)
{
$this->attributes['total_debit'] = empty($value) ? 0 : $value;
}
}