{{-- PO NO. 245--}}

{{ $company }} PASSENGER MANIFEST

Trip: {{ $from }} - {{ $to }}
Date :
{{ $tripDate }} {{ $departure }}
Bus : {{ $bus }} - {{ $label }}
Driver/ Conductor :
@php $gross_collection = 0; $comission_collection = 0; $net_collection = 0; @endphp @foreach($manifest_summary ?? '' as $i => $summary) @endforeach
S/N Sub Route Branch Tickets MPESA TIGOPESA AIRTEL HALOPESA LIPA # Tickets Collection Expenses
{{$i+1}} {{$summary->origin}} - {{$summary->destination}} @php $branch = DB::table('booking_histories') ->where('booking_histories.schedule_id', '=', $id) ->where('booking_histories.sub_route_id', '=', $summary->sub_route_id) ->where('booking_histories.status', '=', 3) ->count('booking_histories.count'); if($branch > 0){ echo $branch; } @endphp @if($from == $summary->origin && $to == $summary->destination) @php $mpesa = DB::table('transactions') ->where('transactions.schedule_id', '=', $id) ->where('transactions.channel', '=', 'MPESA') ->where('transactions.txn_status', '=', 'PAID ONLINE') ->sum('transactions.ticket_units'); if($mpesa > 0){ echo $mpesa; } @endphp @endif @if($from == $summary->origin && $to == $summary->destination) @php $tigopesa = DB::table('transactions') ->where('transactions.schedule_id', '=', $id) ->where('transactions.channel', '=', 'TIGOPESA') ->where('transactions.txn_status', '=', 'PAID ONLINE') ->sum('transactions.ticket_units'); if($tigopesa > 0){ echo $tigopesa; } @endphp @endif @if($from == $summary->origin && $to == $summary->destination) @php $airtel = DB::table('transactions') ->where('transactions.schedule_id', '=', $id) ->where('transactions.channel', '=', 'AIRTEL') ->where('transactions.txn_status', '=', 'PAID ONLINE') ->sum('transactions.ticket_units'); if($airtel > 0){ echo $airtel; } @endphp @endif @if($from == $summary->origin && $to == $summary->destination) @php $halopesa = DB::table('transactions') ->where('transactions.schedule_id', '=', $id) ->where('transactions.channel', '=', 'HALOPESA') ->where('transactions.txn_status', '=', 'PAID ONLINE') ->sum('transactions.ticket_units'); if($halopesa > 0){ echo $halopesa; } @endphp @endif @php $lipa = DB::table('booking_histories') ->where('booking_histories.schedule_id', '=', $id) ->where('booking_histories.sub_route_id', '=', $summary->sub_route_id) ->where('booking_histories.status', '=', 6) ->count('booking_histories.count'); if($lipa > 0){ echo $lipa; } @endphp {{$summary->tickets}} {{number_format($summary->amount, 2)}}
Total: {{ $count_summary }} {{number_format($bookings_gross_collection, 2)}}


{{-- --}} {{-- --}} {{-- --}} @foreach($bookings ?? '' as $i => $booking) {{-- --}} @endforeach {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- --}}
S/N Passenger Seat Ticket Contact Origin DestinationIssuedAgentAgentBookedFare Exps Net
{{$i+1}} {{$booking->fullname}} @php if($booking->gender == "Male" && $booking->age == "Adult"){ echo "(M-A)"; }else if($booking->gender == "Female" && $booking->age == "Adult"){ echo "(F-A)"; }else if($booking->gender == "Male" && $booking->age == "Child"){ echo "(M-C)"; }else if($booking->gender == "Female" && $booking->age == "Child"){ echo "(F-C)"; } @endphp {{ \App\Models\BusSeat::where(['id' => $booking->seat_id])->first()->naming }} {{$booking->reference}} {{$booking->msisdn}} @php if($booking->sub_route_id == null){ $pA = \App\Models\Route::where(['id' => $booking->schedule->route_id])->first()->start_point; $pB = \App\Models\Route::where(['id' => $booking->schedule->route_id])->first()->end_point; $pointA = \App\Models\Cities::where(['id' => $pA])->first()->city; $pointB = \App\Models\Cities::where(['id' => $pB])->first()->city; echo $pointA; }else{ $from = \App\Models\SubRoute::where(['id' => $booking->sub_route_id])->first()->pointA; $to = \App\Models\SubRoute::where(['id' => $booking->sub_route_id])->first()->pointB; echo $from; } @endphp @php if($booking->sub_route_id == null){ $pA = \App\Models\Route::where(['id' => $booking->schedule->route_id])->first()->start_point; $pB = \App\Models\Route::where(['id' => $booking->schedule->route_id])->first()->end_point; $pointA = \App\Models\Cities::where(['id' => $pA])->first()->city; $pointB = \App\Models\Cities::where(['id' => $pB])->first()->city; echo $pointB; }else{ $from = \App\Models\SubRoute::where(['id' => $booking->sub_route_id])->first()->pointA; $to = \App\Models\SubRoute::where(['id' => $booking->sub_route_id])->first()->pointB; echo $to; } @endphp @php $agent = \App\Models\Agent::where(['id' => $booking->agent_id])->first()->name; echo $agent; @endphp {{$booking->booking_date}} @php $fare = $booking->fare; echo number_format($fare, 0); $gross_collection += $fare; @endphp @php $fare = $booking->fare; $agent = $booking->agent_id; $totalFare = \App\Models\SubRoute::where(['id' => $booking->sub_route_id])->first()->price; $agent_conf_commission = \Illuminate\Support\Facades\DB::table('booking_histories') ->where('id', $booking->id)->value('agent_company_configuration_id'); $sub_route_commission = \Illuminate\Support\Facades\DB::table('booking_histories') ->where('id', $booking->id)->value('sub_route_price_commission_configuration_id'); $get_agent_conf_commission = \Illuminate\Support\Facades\DB::table('agent_company_configurations') ->where('id', $agent_conf_commission)->value('commission_status'); $get_sub_route_commission = \Illuminate\Support\Facades\DB::table('subroute_price_commission_configurations') ->where('id', $sub_route_commission)->value('commission'); if($get_agent_conf_commission == 2){ if($fare >= $totalFare){ echo number_format($get_sub_route_commission, 0); $comission_collection += $get_sub_route_commission; }else{ $comission_collection += 0; echo 0; } }else{ $comission_collection += 0; } @endphp @php $agent = $booking->agent_id; $fare = $booking->fare; $fareMax = \App\Models\SubRoute::where(['id' => $booking->sub_route_id])->first()->fare; $price = \App\Models\SubRoute::where(['id' => $booking->sub_route_id])->first()->price; $agent_conf_commission = \Illuminate\Support\Facades\DB::table('booking_histories') ->where('id', $booking->id)->value('agent_company_configuration_id'); $sub_route_commission = \Illuminate\Support\Facades\DB::table('booking_histories') ->where('id', $booking->id)->value('sub_route_price_commission_configuration_id'); $get_agent_conf_commission = \Illuminate\Support\Facades\DB::table('agent_company_configurations') ->where('id', $agent_conf_commission)->value('commission_status'); $get_sub_route_commission = \Illuminate\Support\Facades\DB::table('subroute_price_commission_configurations') ->where('id', $sub_route_commission)->value('commission'); if($get_agent_conf_commission == 2){ if($fare >= $price){ $netPrice = ($booking->fare) - $get_sub_route_commission; echo number_format($netPrice, 0); $net_collection += $netPrice; }else{ $netPrice = ($booking->fare) - 0; echo number_format($netPrice, 0); $net_collection += $netPrice; } }else{ $netPrice = ($booking->fare) - 0; echo number_format($netPrice, 0); $net_collection += $netPrice; } @endphp
Driver: Conductor: Total: {{number_format($gross_collection, 0)}} {{number_format($comission_collection, 0)}} {{number_format($net_collection, 0)}}{{number_format($bookings_gross_collection, 2)}}{{number_format($bookings_comission, 2)}}{{number_format($bookings_gross_collection - $bookings_comission)}}

TOTAL COLLECTION :

EXPENSES :

NET COLLECTION :

PARCEL & LUGGAGES :

______________________________________________________________________________________________
Powered By: TiketiGala - https://www.aboodbus.co.tz