@php $globalIndex = 0; @endphp @foreach ($sales as $customerName => $customerBills) {{-- Naya row shuru karein har 2 customers ke baad --}} @if ($globalIndex % 2 == 0)
@endif

{{ $customerName }}

{{-- Date range dikhane ke liye (Optional) --}}

Report Date: {{ now()->format('d/m/y') }}

@php $totalCustomerAmount = 0; $totalCustomerBori = 0; $totalCustomerWeight = 0; // Sabeqa balance aakhri sale se uthayenge $lastSale = $customerBills->last(); $sabeqaBalance = (float) str_replace(',', '', $lastSale->customerBalance()); @endphp @foreach ($customerBills as $sale) @php $totalCustomerAmount += (float) str_replace(',', '', $sale->total_amount); @endphp @foreach ($sale->salesItemsDetails as $item) @php $totalCustomerBori += $item->bori; $totalCustomerWeight += $item->weight; @endphp @endforeach @endforeach
مال قیمت وزن بوری
{{ $item->productChildCate?->name_urdu }} {{ number_format((int) $item->amount, 0) }} {{ $item->weight }} {{ $item->bori }}
{{ number_format($totalCustomerAmount, 0) }} {{ $totalCustomerWeight }} {{ $totalCustomerBori }} ٹوٹل
{{ number_format($totalCustomerAmount, 0) }} بنام (موجودہ بل)
{{ number_format($sabeqaBalance, 0) }} سابِقہ بیلنس
{{ number_format($totalCustomerAmount + $sabeqaBalance, 0) }} حالیہ بیلنس (ٹوٹل)
@php $globalIndex++; @endphp @if ($globalIndex % 2 == 0 || $loop->last)
@endif @if ($globalIndex % 6 == 0 && !$loop->last)
@endif @endforeach