{{-- Month-by-month account: $ledger rows from User::salaryLedger(), $thisMonth from User::salarySummaryFor(now()). --}} @use('App\Enums\PaymentType') @use('App\Models\Payment') @php $currency = $employee->currency(); // Salary and advance always get a column because they make up the month's pay; the other types appear once something was paid under them. $columns = collect(PaymentType::cases())->filter(fn (PaymentType $type): bool => $type->countsTowardsSalary() || $ledger->contains(fn (array $row): bool => $row['by_type'][$type->value] > 0)); @endphp
{{ __('One line per month: what was paid under each type, the total, and what is still left of the salary. Salary and advances count towards the month.') }}
{{ __('No salary or payments recorded yet.') }}
@else| {{ __('Month') }} | {{ __('Salary due') }} | @foreach ($columns as $type){{ $type->label() }} | @endforeach{{ __('Total paid') }} | {{ __('Remaining') }} | {{ __('Status') }} |
|---|---|---|---|---|---|
| {{ $row['month']->format('F Y') }} @if ($loop->first) {{ __('this month') }} @endif | {{ $row['salary'] > 0 ? Payment::formatMoney($row['salary'], $currency) : '—' }} | @foreach ($columns as $type) @php $amount = $row['by_type'][$type->value]; @endphp{{ $amount > 0 ? Payment::formatMoney($amount, $currency) : '—' }} | @endforeach{{ $row['total'] > 0 ? Payment::formatMoney($row['total'], $currency) : '—' }} | {{ $row['remaining'] > 0 ? Payment::formatMoney($row['remaining'], $currency) : '—' }} |
|