M.D.S

Sales Register           فروخت رجسٹر

As At {{ date('M d, Y') }}

@foreach ($salesByCustomer as $customerId => $customerSales) @php $total_bori = 0; $total_weight = 0; $total_rate = 0; @endphp @foreach ($customerSales as $sale) @foreach ($sale->salesItemsDetails as $item) @php $total_bori += (int) $item->bori; $total_weight += (int) $item->weight; $total_rate += (int) $item->rate; @endphp @endforeach @endforeach @endforeach
مال بوری وزن ریٹ قیمت کیش وصول باقیہ

{{ $customerSales->first()->customer->customer_name_urdu ?? 'Unknown Customer' }}

{{ $item->productChildCate->name_urdu ?? null }} {{ $item->bori }} {{ $item->weight }} {{ $item->rate }} {{ $item->amount }}
{{ $total_bori }} {{ $total_weight }} {{ $total_rate }} {{ $customerSales->sum(fn($sale) => $sale->salesItemsDetails->sum(fn($i) => $i->amount)) }} {{ $customerTotals[$customerId]['total_paid'] ?? 0 }} {{ $customerTotals[$customerId]['total_balance'] ?? 0 }}
کل جمع (Grand Total) {{ number_format( $salesByCustomer->flatMap(fn($customerSales) => $customerSales->flatMap(fn($sale) => $sale->salesItemsDetails))->sum('bori'), ) }} {{ number_format( $salesByCustomer->flatMap(fn($customerSales) => $customerSales->flatMap(fn($sale) => $sale->salesItemsDetails))->sum('weight'), ) }} {{ number_format( $salesByCustomer->flatMap(fn($customerSales) => $customerSales->flatMap(fn($sale) => $sale->salesItemsDetails))->sum('rate'), ) }} {{ number_format( $salesByCustomer->flatMap(fn($customerSales) => $customerSales->flatMap(fn($sale) => $sale->salesItemsDetails))->sum('amount'), ) }} {{ number_format(collect($customerTotals)->sum('total_paid')) }} {{ number_format(collect($customerTotals)->sum('total_balance')) }}