style: format currency output in Order model for consistency
This commit is contained in:
parent
7d4368f774
commit
4df6c215ad
@ -43,42 +43,42 @@ protected function casts(): array
|
|||||||
protected function cogsFormatted(): Attribute
|
protected function cogsFormatted(): Attribute
|
||||||
{
|
{
|
||||||
return Attribute::make(
|
return Attribute::make(
|
||||||
get: fn() => 'Rp ' . number_format($this->cogs, 0, ',', '.'),
|
get: fn () => 'Rp '.number_format($this->cogs, 0, ',', '.'),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function subtotalFormatted(): Attribute
|
protected function subtotalFormatted(): Attribute
|
||||||
{
|
{
|
||||||
return Attribute::make(
|
return Attribute::make(
|
||||||
get: fn() => 'Rp ' . number_format($this->subtotal, 0, ',', '.'),
|
get: fn () => 'Rp '.number_format($this->subtotal, 0, ',', '.'),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function discountFormatted(): Attribute
|
protected function discountFormatted(): Attribute
|
||||||
{
|
{
|
||||||
return Attribute::make(
|
return Attribute::make(
|
||||||
get: fn() => 'Rp ' . number_format($this->discount, 0, ',', '.'),
|
get: fn () => 'Rp '.number_format($this->discount, 0, ',', '.'),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function paymentFormatted(): Attribute
|
protected function paymentFormatted(): Attribute
|
||||||
{
|
{
|
||||||
return Attribute::make(
|
return Attribute::make(
|
||||||
get: fn() => 'Rp ' . number_format($this->payment, 0, ',', '.'),
|
get: fn () => 'Rp '.number_format($this->payment, 0, ',', '.'),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function totalFormatted(): Attribute
|
protected function totalFormatted(): Attribute
|
||||||
{
|
{
|
||||||
return Attribute::make(
|
return Attribute::make(
|
||||||
get: fn() => 'Rp ' . number_format($this->total, 0, ',', '.'),
|
get: fn () => 'Rp '.number_format($this->total, 0, ',', '.'),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function createdAtFormatted(): Attribute
|
protected function createdAtFormatted(): Attribute
|
||||||
{
|
{
|
||||||
return Attribute::make(
|
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'),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user