style: format currency output in Order model for consistency

This commit is contained in:
Yoga Pangestu 2026-04-30 17:03:31 +07:00
parent 7d4368f774
commit 4df6c215ad

View File

@ -43,42 +43,42 @@ protected function casts(): array
protected function cogsFormatted(): Attribute
{
return Attribute::make(
get: fn() => 'Rp ' . number_format($this->cogs, 0, ',', '.'),
get: fn () => 'Rp '.number_format($this->cogs, 0, ',', '.'),
);
}
protected function subtotalFormatted(): Attribute
{
return Attribute::make(
get: fn() => 'Rp ' . number_format($this->subtotal, 0, ',', '.'),
get: fn () => 'Rp '.number_format($this->subtotal, 0, ',', '.'),
);
}
protected function discountFormatted(): Attribute
{
return Attribute::make(
get: fn() => 'Rp ' . number_format($this->discount, 0, ',', '.'),
get: fn () => 'Rp '.number_format($this->discount, 0, ',', '.'),
);
}
protected function paymentFormatted(): Attribute
{
return Attribute::make(
get: fn() => 'Rp ' . number_format($this->payment, 0, ',', '.'),
get: fn () => 'Rp '.number_format($this->payment, 0, ',', '.'),
);
}
protected function totalFormatted(): Attribute
{
return Attribute::make(
get: fn() => 'Rp ' . number_format($this->total, 0, ',', '.'),
get: fn () => 'Rp '.number_format($this->total, 0, ',', '.'),
);
}
protected function createdAtFormatted(): Attribute
{
return Attribute::make(
get: fn() => $this->created_at->translatedFormat('d F Y H:i'),
get: fn () => $this->created_at->translatedFormat('d F Y H:i'),
);
}