@php $globalIndex = 0; @endphp
@foreach ($sales as $customerName => $customerBills)
@if ($globalIndex % 2 == 0)
@endif
{{ $customerName }}
Report Date: {{ now()->format('d/m/y') }}
| مال |
قیمت |
وزن |
بوری |
@php
$totalCustomerAmount = 0;
$totalPaidAmount = 0;
$totalCustomerBori = 0;
$totalCustomerWeight = 0;
$finalBalance = 0;
foreach ($customerBills as $sale) {
$totalCustomerAmount += (float) ($sale->total_amount ?? 0);
$totalPaidAmount += (float) ($sale->paid_amount ?? 0);
$finalBalance += (float) ($sale->balance ?? 0);
foreach ($sale->salesItemsDetails as $item) {
$totalCustomerBori += (int) ($item->bori ?? 0);
$totalCustomerWeight += (float) ($item->weight ?? 0);
}
}
$previousBalance = $totalCustomerAmount + $totalPaidAmount - $finalBalance;
@endphp
@foreach ($customerBills as $sale)
@foreach ($sale->salesItemsDetails as $item)
| {{ $item->productChildCate?->name_urdu ?? '-' }} |
{{ number_format((int) ($item->amount ?? 0), 0) }} |
{{ number_format($item->weight ?? 0, 1) }} |
{{ $item->bori ?? 0 }} |
@endforeach
@endforeach
| ٹوٹل |
{{ number_format($totalCustomerAmount, 0) }} |
{{ number_format($totalCustomerWeight, 1) }} |
{{ $totalCustomerBori }} |
| {{ number_format($totalCustomerAmount, 0) }} |
بنام (موجودہ بل) |
| {{ number_format($previousBalance, 0) }} |
سابِقہ بیلنس |
| {{ number_format($finalBalance, 0) }} |
حالیہ بیلنس (ٹوٹل) |
@php $globalIndex++; @endphp
@if ($globalIndex % 2 == 0 || $loop->last)
@endif
@if ($globalIndex % 6 == 0 && !$loop->last)
@endif
@endforeach