{{-- Main Content Grid --}}
@php
// Calculate maximum rows to ensure all tables identify with the same height
// Natural rows for Cash Detail is 8 (7 denoms + 1 coin)
$maxRows = max($salesmanData->count(), $bankSlipsData->count(), 8);
$maxRows2 = max($bankTransfersData->count(), $chequesData->count(), 1);
@endphp
{{-- 1. Salesman Cash --}}
Salesman Cash
| Sr.# |
Salesman |
Amount |
@php $totalSalesmanAmount = 0; @endphp
@forelse($salesmanData as $index => $data)
@php $totalSalesmanAmount += $data->amount; @endphp
| {{ $loop->iteration }} |
{{ $data->salesman_name }} |
{{ $data->amount > 0 ? number_format($data->amount, 0) : '-' }} |
@empty
| No data found |
@endforelse
{{-- Filler rows --}}
@for($i = $salesmanData->count(); $i < $maxRows; $i++)
| |
|
|
@endfor
| Total: |
{{ number_format($totalSalesmanAmount, 0) }} |
{{-- 2. Cash Detail --}}
Cash Detail
| Sr.# |
Denom |
Qty |
Value |
@php
$grandTotalCash = 0;
$denomsList = [5000, 1000, 500, 100, 50, 20, 10];
$sr = 1;
@endphp
@foreach($denomsList as $val)
@php
$qty = $denominations[$val] ?? 0;
$subtotal = $qty * $val;
$grandTotalCash += $subtotal;
@endphp
| {{ $sr++ }} |
{{ $val }} |
{{ $qty > 0 ? $qty : '-' }} |
{{ $qty > 0 ? number_format($subtotal, 0) : '-' }} |
@endforeach
{{-- Coins --}}
@php
$coins = $denominations['coins'] ?? 0;
$grandTotalCash += $coins;
@endphp
| {{ $sr++ }} |
Coins |
- |
{{ $coins > 0 ? number_format($coins, 0) : '-' }} |
{{-- Filler rows --}}
@for($i = 8; $i < $maxRows; $i++)
| |
|
|
|
@endfor
| Total: |
{{ number_format($grandTotalCash, 0) }} |
{{-- 3. Bank Slips --}}
Bank Slips
| Sr.# |
Salesman |
Amount |
@php $totalBankSlips = 0; @endphp
@forelse($bankSlipsData as $index => $slip)
@php $totalBankSlips += $slip->amount; @endphp
| {{ $loop->iteration }} |
{{ $slip->salesman_name }} |
{{ $slip->amount > 0 ? number_format($slip->amount, 2) : '-' }} |
@empty
| No bank slips |
@endforelse
{{-- Filler rows --}}
@for($i = $bankSlipsData->count(); $i < $maxRows; $i++)
| |
|
|
@endfor
| Total: |
{{ number_format($totalBankSlips, 2) }} |
{{-- Grand Total Summary --}}
Grand Total (Salesman Cash + Bank Slips):
{{ number_format($totalSalesmanAmount + $totalBankSlips, 2) }}
{{-- Row 2: Bank Transfers + Cheques --}}
{{-- 4. Bank Transfers --}}
Bank Transfers
| Sr.# |
Salesman |
Amount |
@php $totalBankTransfers = 0; @endphp
@forelse($bankTransfersData as $row)
@php $totalBankTransfers += $row->amount; @endphp
| {{ $loop->iteration }} |
{{ $row->salesman_name }} |
{{ $row->amount > 0 ? number_format($row->amount, 2) : '-' }} |
@empty
| No bank transfers |
@endforelse
@for($i = $bankTransfersData->count(); $i < $maxRows2; $i++)
| |
|
|
@endfor
| Total: |
{{ number_format($totalBankTransfers, 2) }} |
{{-- 5. Cheques --}}
Cheques
| Sr.# |
Salesman |
Amount |
@php $totalCheques = 0; @endphp
@forelse($chequesData as $row)
@php $totalCheques += $row->amount; @endphp
| {{ $loop->iteration }} |
{{ $row->salesman_name }} |
{{ $row->amount > 0 ? number_format($row->amount, 2) : '-' }} |
@empty
| No cheques |
@endforelse
@for($i = $chequesData->count(); $i < $maxRows2; $i++)
| |
|
|
@endfor
| Total: |
{{ number_format($totalCheques, 2) }} |
{{-- Grand Total Row 2: Bank Transfers + Cheques --}}
Grand Total (Bank Transfers + Cheques):
{{ number_format($totalBankTransfers + $totalCheques, 2) }}
{{-- Overall Grand Total --}}
Overall Grand Total (Cash + Bank Slips + Bank Transfers + Cheques):
{{ number_format($totalSalesmanAmount + $totalBankSlips + $totalBankTransfers + $totalCheques, 2) }}