diff --git a/app/Models/Payroll.php b/app/Models/Payroll.php index c49d753..771b594 100644 --- a/app/Models/Payroll.php +++ b/app/Models/Payroll.php @@ -41,28 +41,28 @@ protected function casts(): array protected function baseSalaryFormatted(): Attribute { return Attribute::make( - get: fn () => $this->base_salary ? 'Rp '.number_format($this->base_salary, 0, ',', '.') : null, + get: fn () => 'Rp '.number_format($this->base_salary, 0, ',', '.'), ); } protected function bonusFormatted(): Attribute { return Attribute::make( - get: fn () => $this->bonus ? 'Rp '.number_format($this->bonus, 0, ',', '.') : null, + get: fn () => 'Rp '.number_format($this->bonus, 0, ',', '.'), ); } protected function deductionFormatted(): Attribute { return Attribute::make( - get: fn () => $this->deduction ? 'Rp '.number_format($this->deduction, 0, ',', '.') : null, + get: fn () => 'Rp '.number_format($this->deduction, 0, ',', '.'), ); } protected function totalSalaryFormatted(): Attribute { return Attribute::make( - get: fn () => $this->total_salary ? 'Rp '.number_format($this->total_salary, 0, ',', '.') : null, + get: fn () => 'Rp '.number_format($this->total_salary, 0, ',', '.'), ); } diff --git a/app/Models/PayrollAdjustment.php b/app/Models/PayrollAdjustment.php index be7f135..13027b8 100644 --- a/app/Models/PayrollAdjustment.php +++ b/app/Models/PayrollAdjustment.php @@ -31,7 +31,7 @@ protected function casts(): array protected function amountFormatted(): Attribute { return Attribute::make( - get: fn () => $this->amount ? 'Rp '.number_format($this->amount, 0, ',', '.') : null, + get: fn () => 'Rp '.number_format($this->amount, 0, ',', '.'), ); } diff --git a/resources/js/components/cards/payroll-card.tsx b/resources/js/components/cards/payroll-card.tsx index 6b39453..b917fca 100644 --- a/resources/js/components/cards/payroll-card.tsx +++ b/resources/js/components/cards/payroll-card.tsx @@ -19,30 +19,30 @@ export function PayrollCard({ payroll, onClick, className }: PayrollCardProps) { return (
- + {payroll.user?.name} {payroll.is_paid ? 'Lunas' : 'Pending'}
- + {payroll.total_salary_formatted}
@@ -54,17 +54,29 @@ export function PayrollCard({ payroll, onClick, className }: PayrollCardProps) { {payroll.base_salary_formatted} {payroll.adjustments?.map((adj, idx) => ( -
+
{adj.description} - - {adj.type === 'bonus' ? '+' : '-'}{adj.amount_formatted} + + {adj.type === 'bonus' ? '+' : '-'} + {adj.amount_formatted}
))}
-
+
Periode - {payroll.period_month_formatted} + + {payroll.period_month_formatted} +