@php $isDoneList = ($listType ?? 'pending') === 'done'; @endphp @if(!$isDoneList)
@csrf @endif
@if(!$isDoneList) @else @endif @if($isDoneList) @endif @if($isDoneList) @if(empty($isDeliveryOrders)) @endif @endif @forelse($data as $index => $result) @php $remaining = (float) ($result->NetAmount ?? 0); $paidTotal = (float) ($result->PaidAmount ?? 0); if ($paidTotal <= 0 && $isDoneList) { $paidTotal = max(0, (float) ($result->SubTotal ?? 0) - (float) ($result->Advance ?? 0) - $remaining); } if ($isDoneList && empty($isDeliveryOrders)) { $makeOrderDone = isSaleBillMakeOrderDone($result->MakeOrder ?? null); $workCompleteDone = isSaleBillWorkComplete($result->WorkComplete ?? null); } @endphp @if(!$isDoneList) @else @endif @if($isDoneList) @endif @if($isDoneList) @if(empty($isDeliveryOrders)) @endif @endif @empty @endforelse
Work Completed#Bill No Bill Date Delivery Date Patient Name Mob Bill Amount AdvancePaid AmountBalanceMake Order Work CompletedAction
{{ $index + 1 }}{{$result->BillNo}} {{date("d/m/Y", strtotime(str_replace('-', '/',$result->SaleDate)))}} {{ $result->DeliveryDate ? date("d/m/Y", strtotime(str_replace('-', '/',$result->DeliveryDate))) : '' }} {{$result->PatientName}} {{$result->MobileNo}} ₹{{number_format($result->SubTotal,2)}} ₹{{number_format($result->Advance ?? 0,2)}}₹{{number_format($paidTotal,2)}}₹{{number_format($remaining,2)}} @if($makeOrderDone) @else @endif @if($workCompleteDone) @else @endif @if($remaining > 0) @else — @endif
@if($isDoneList) @if(!empty($isDeliveryOrders)) No spect ready for deliver with pending balance in selected date range. @else No work completed bills in selected date range. @endif @else No pending work bills in selected date range. @endif
@if(!$isDoneList)
@endif