Move charge actions to ChargeController, implemented charge delete

This commit is contained in:
2024-07-26 12:33:42 +10:00
parent 756f550b43
commit 9380850395
7 changed files with 107 additions and 70 deletions

View File

@@ -70,7 +70,7 @@ class Charge extends Model
/* ATTRIBUTES */
public function getNameAttribute()
public function getNameAttribute(): string
{
return sprintf('%s %s',
$this->description,
@@ -93,4 +93,14 @@ class Charge extends Model
{
return Arr::get(InvoiceItem::type,$this->type);
}
/**
* Is this charge processable
*
* @return bool
*/
public function getUnprocessedAttribute(): bool
{
return $this->active && (! $this->processed);
}
}