@if ($type != 'Zero Payment') @endif @php $from = \Carbon\Carbon::parse(request()->from_date)->format('Y-m-d 00:00:00'); $to = \Carbon\Carbon::parse(request()->to_date)->format('Y-m-d 23:59:59'); $totalBill = 0; $totalPayment = 0; $totalDiscount = 0; $sl = 1; @endphp {{-- dd($list) --}} @foreach ($list as $row) @if ($type == 'Zero Payment') {{-- @if ($row->total_paid_amount == 0) --}} {{-- --}} @php $sl += 1; @endphp {{-- @endif --}} @else @php $totalBill += $bill; $totalPayment += $payment; $totalDiscount += $discount; @endphp @endif @endforeach @if ($type != 'Zero Payment') @endif
# CID Username Name POPTotal Bill paid Bill discount Bill
{{ $sl }} CID: {{ $row->id }} {{ $row->userid ?? '' }} {{ $row->clientsinfo->clients_name ?? '' }} {{ $row->pop->popname ?? '' }} {{ number_format((float) $row->customerAccount->dueAmount, 2, '.', '') }}
{{ $loop->iteration }} CID: {{ $row->id }} {{ $row->userid ?? '' }} {{ $row->clientsinfo->clients_name ?? '' }} {{ $row->pop->popname ?? '' }} @php $bill = 0; @endphp @foreach ($row->generatedBill as $item) @if ($item->created_at >= $from && $item->created_at <= $to) @php $bill += $item->bill_amount ?? 0; @endphp @endif @endforeach {{ number_format((float) $bill, 2, '.', '') }} @php $payment = 0; @endphp @foreach ($row->paymentBill as $item) @if ($item->created_at >= $from && $item->created_at <= $to) @php $payment += $item->paid_amount ?? 0; @endphp @endif @endforeach {{ number_format((float) $payment, 2, '.', '') }} @php $discount = 0; @endphp @foreach ($row->paymentBill as $item) @if ($item->created_at >= $from && $item->created_at <= $to) @php $discount += $item->discount_amount ?? 0; @endphp @endif @endforeach {{ number_format((float) $discount, 2, '.', '') }}
Total {{ number_format((float) $totalBill, 2, '.', '') }} {{ number_format((float) $totalPayment, 2, '.', '') }} {{ number_format((float) $totalDiscount, 2, '.', '') }}