@php $UserId = Session::get('UserId'); @endphp {{-- --}} @php $i = 1; $total = 0; $total1 = 0; @endphp @foreach($data as $result) @php $total += $result->Amount; if ($result->InvMoneyReceived == 1) { $total1 += $result->Amount; } $bgcolor = match(true) { $result['InvCheckout'] == 1 => "background-color: green;color:white;", $result['InvMoneyReceived'] == 1 => "background-color: yellow;", default => "background-color: blue;color:white;" }; @endphp {{-- --}} @php $i++; @endphp @endforeach {{-- --}} {{-- --}} {{-- --}}
#Sr No Mrd. No Patient Name Investigation Name Amount Date Action
{{ $i }} {{ $result->MrdNo }} {{ strtoupper(strtolower($result->PatientName)) }} {{ $result->InvStName }} {{ number_format($result->Amount, 2) }} {{ date("d-m-Y", strtotime(str_replace('-', '/', $result->VisitDate))) }} @if($UserId == 58) @endif
{{$i}} Total Amount ₹{{ number_format($total, 2) }}
{{$i+1}} Received Amount ₹{{ number_format($total1, 2) }}
{{$i+2}} Not Received Amount ₹{{ number_format($total-$total1, 2) }}