10.April 2026

This commit is contained in:
Kevin Adametz 2026-04-10 17:15:27 +02:00
parent a00c42e770
commit f58c709945
208 changed files with 19280 additions and 2914 deletions

View file

@ -256,11 +256,23 @@ class UserAbo extends Model
return $this->attributes['cancel_date'] ? Carbon::parse($this->attributes['cancel_date'])->format(\Util::formatDateDB()) : '';
}
public function getFormattedAmount()
public function getFormattedAmount(): string
{
return isset($this->attributes['amount']) ? Util::formatNumber($this->attributes['amount'] / 100) : '';
}
public function getTotalPoints(): float
{
return $this->user_abo_items
->where('comp', 0)
->sum(fn ($item) => ($item->product?->points ?? 0) * $item->qty);
}
public function getFormattedTotalPoints(): string
{
return Util::formatNumber($this->getTotalPoints());
}
public function getIsForFormated()
{
return $this->attributes['is_for'] === 'me' ? '<span class="badge badge-outline-warning-dark">'.__('tables.adviser').'</span>' : '<span class="badge badge-outline-info">'.__('tables.customer').'</span>';