@extends('admin.layout.app') @section('title', 'Laborer Ledger (Summary)') @section('body')
{{-- Title --}}
Laborer Ledger (Summary)
Balance = Work − (Payments + Expenses)
{{-- Filters + Export (compact toolbar) --}}
Reset {{-- Export dropdown --}} {{-- Print --}}
{{-- Page body --}}
Range: {{ request('from') ?: 'Start' }} — {{ request('to') ?: 'Now' }} @if (request('laborer_id')) • Filter: {{ optional($laborers->firstWhere('id', request('laborer_id')))->name }} @endif
@forelse($rows as $i => $r) @php $bal = (float) $r->balance; $isNeg = $bal < 0; $balClass = $isNeg ? 'amount-bal-neg' : 'amount-bal-pos'; $rowClass = $isNeg ? 'neg-row' : ''; $rate = isset($r->hourly_rate) ? $r->hourly_rate : $r->hourly_wage ?? 0; @endphp @empty @endforelse @php $tbal = (float) ($totals['balance'] ?? 0); $tbalClass = $tbal >= 0 ? 'amount-bal-pos' : 'amount-bal-neg'; $tfootRowClass = $tbal < 0 ? 'neg-row' : ''; @endphp
# Laborer Hourly Rate Days Hours OT Hours Total Work Payments Expenses Balance
{{ $i + 1 }} {{ $r->name }} {{ number_format((float) $rate, 2) }} {{ (int) $r->days_count }} {{ number_format((float) $r->total_hours, 2) }} {{ number_format((float) $r->total_ot_hours, 2) }} {{ number_format((float) $r->total_work, 2) }} {{ number_format((float) $r->payment, 2) }} {{ number_format((float) $r->expense, 2) }} {{ number_format($bal, 2) }}
No records found.
TOTAL {{ (int) ($totals['days'] ?? 0) }} {{ number_format((float) ($totals['hours'] ?? 0), 2) }} {{ number_format((float) ($totals['ot_hours'] ?? 0), 2) }} {{ number_format((float) ($totals['work'] ?? 0), 2) }} {{ number_format((float) ($totals['payment'] ?? 0), 2) }} {{ number_format((float) ($totals['expense'] ?? 0), 2) }} {{ number_format($tbal, 2) }}
{{-- Export Libraries --}} @endsection