Estimate

Estimate No: {{ $estimate->estimate_no }} Company: {{ $estimate->company_name ?: '-' }} Title: {{ $estimate->title ?: '-' }}
Date: {{ $estimate->estimate_date ? \Carbon\Carbon::parse($estimate->estimate_date)->format('d-m-Y') : '-' }} Month: {{ $estimate->month ? \Carbon\Carbon::parse($estimate->month . '-01')->format('F-Y') : '-' }} Employees: {{ $estimate->estimateDetails->whereNotNull('employee_name')->filter(fn ($detail) => trim($detail->employee_name) !== '')->count() }}
@php // Rates come from the per-row slabs ("9+9" => CGST 9, SGST 9); distinct values are listed together $trimRate = fn ($rate) => rtrim(rtrim(number_format((float) $rate, 2, '.', ''), '0'), '.'); $cgstRates = $estimate->estimateDetails->map(fn ($d) => explode('+', (string) $d->sgst_cgst_slab)[0] ?? null); $sgstRates = $estimate->estimateDetails->map(fn ($d) => explode('+', (string) $d->sgst_cgst_slab)[1] ?? null); $igstRates = $estimate->estimateDetails->pluck('igst_slab'); $rateLabel = fn ($rates) => ($list = $rates->filter(fn ($r) => $r !== null && $r !== '')->map($trimRate)->unique()->values())->isEmpty() ? '' : ' (' . $list->implode('% / ') . '%)'; @endphp @forelse($estimate->estimateDetails as $index => $detail) @empty @endforelse
# Employee Category Pay Days Gross Salary Employee PF Employee ESI Net Pay Employer PF Employer ESI CTC Service Charge Sub Total CGST{{ $rateLabel($cgstRates) }} SGST{{ $rateLabel($sgstRates) }} IGST{{ $rateLabel($igstRates) }} Cess Grand Total
{{ $index + 1 }} {{ $detail->employee_name ?: '-' }} {{ $detail->category ?: '-' }} {{ $detail->pay_days }} {{ number_format((float) $detail->earned_gross, 2) }} {{ number_format((float) $detail->employee_pf, 2) }} {{ number_format((float) $detail->employee_esi, 2) }} {{ number_format((float) $detail->net_pay, 2) }} {{ number_format((float) $detail->employer_pf, 2) }} {{ number_format((float) $detail->employer_esi, 2) }} {{ number_format((float) $detail->ctc, 2) }} {{ number_format((float) $detail->service_charge, 2) }} {{ number_format((float) $detail->sub_total, 2) }} {{ number_format((float) $detail->cgst, 2) }} {{ number_format((float) $detail->sgst, 2) }} {{ number_format((float) $detail->igst, 2) }} {{ number_format((float) $detail->cess_amount, 2) }} {{ number_format((float) $detail->total_cost, 2) }}
No employee details found.