@foreach($items as $client_inquiry_item) {{--*/ $route = $client_inquiry_item->getRoute() /*--}} @if($route) {{--*/ $route_cargo_details =$route->routeCargoDetails() /*--}} {{--*/ $route_cargo_detail = $route_cargo_details->whereType($client_inquiry_item->cargo_type)->first() /*--}} @else {{--*/ $route_cargo_detail = [] /*--}} @endif @if($client_inquiry_item->cargo_type =="LOOSE_CARGO") @endif @if($client_inquiry_item->cargo_type =='TANKERS') @endif @if($client_inquiry_item->cargo_type =="LOOSE_CARGO" && $route_cargo_detail->is_returning) @endif @if($client_inquiry_item->cargo_type =='TANKERS') @endif @if($route_cargo_detail->is_returning) {{-- @foreach($route_cargo_detail->routeReturningCargoDetails as $route_returning_cargo_detail)--}} {{--@endforeach--}} @endif @if($client_inquiry_item->cargo_type =='TANKERS') @endif @if($route_cargo_detail->is_returning) {{--@foreach($route_cargo_detail->routeReturningCargoDetails as $route_returning_cargo_detail)--}} {{--@endforeach--}} @endif @if($client_inquiry_item->cargo_type =='TANKERS') @endif @if($route_cargo_detail->is_returning) {{--@foreach($route_cargo_detail->routeReturningCargoDetails as $route_returning_cargo_detail)--}} {{--@endforeach--}} @endif @if($client_inquiry_item->cargo_type =='TANKERS') @endif @if($route_cargo_detail->is_returning) {{-- @foreach($route_cargo_detail->routeReturningCargoDetails as $route_returning_cargo_detail)--}} {{--@endforeach--}} @endif @if($client_inquiry_item->cargo_type =='TANKERS') @endif @if($route_cargo_detail->is_returning) {{-- @foreach($route_cargo_detail->routeReturningCargoDetails as $route_returning_cargo_detail)--}} {{--@endforeach--}} @endif @if($client_inquiry_item->cargo_type =='TANKERS') @endif @if($route_cargo_detail->is_returning) {{-- @foreach($route_cargo_detail->routeReturningCargoDetails as $route_returning_cargo_detail)--}} {{--@endforeach--}} @endif @if($client_inquiry_item->cargo_type =='TANKERS') @endif @if($route_cargo_detail->is_returning) {{-- @foreach($route_cargo_detail->routeReturningCargoDetails as $route_returning_cargo_detail)--}} {{--@endforeach--}} @endif @if($client_inquiry_item->cargo_type =='TANKERS') @endif @if($route_cargo_detail->is_returning) {{-- @foreach($route_cargo_detail->routeReturningCargoDetails as $route_returning_cargo_detail)--}} {{--@endforeach--}} @endif @if($client_inquiry_item->cargo_type =='TANKERS') @endif @if($route_cargo_detail->is_returning) {{-- @foreach($route_cargo_detail->routeReturningCargoDetails as $route_returning_cargo_detail)--}} {{--@endforeach--}} @endif @if($client_inquiry_item->cargo_type =='TANKERS') @endif @if($route_cargo_detail->is_returning) {{-- @foreach($route_cargo_detail->routeReturningCargoDetails as $route_returning_cargo_detail)--}} {{--@endforeach--}} @endif @if($route_cargo_detail->is_returning) @endif @if($route_cargo_detail->is_returning) @endif @foreach($client_inquiry_item->loading_expenses as $l) @if($client_inquiry_item->cargo_type =='TANKERS') @endif @if($route_cargo_detail->is_returning) @endif @endforeach @if($route_cargo_detail->is_returning) @endif @foreach($client_inquiry_item->border_expenses as $b) @if($client_inquiry_item->cargo_type =='TANKERS') @endif @if($route_cargo_detail->is_returning) @endif @endforeach @foreach($client_inquiry_item->forecasting_expenses as $l) @if($client_inquiry_item->cargo_type =='TANKERS') @endif @if($route_cargo_detail->is_returning) @endif @endforeach @foreach($client_inquiry_item->route_expenses as $route_expense) @if($client_inquiry_item->cargo_type =='TANKERS') @endif @if($route_cargo_detail->is_returning) @endif @endforeach @foreach($client_inquiry_item->other_operating_expenses as $o) @if($client_inquiry_item->cargo_type =='TANKERS') @endif @if($route_cargo_detail->is_returning) @endif @endforeach @if($client_inquiry_item->cargo_type =='TANKERS') @endif @if($route_cargo_detail->is_returning) @endif @if($client_inquiry_item->cargo_type =='TANKERS') @endif @if($route_cargo_detail->is_returning) @endif @if($route_cargo_detail->is_returning) @endif @foreach($client_inquiry_item->prepaid_expenses as $l) @if($client_inquiry_item->cargo_type =='TANKERS') @endif @if($route_cargo_detail->is_returning) @endif @endforeach @foreach($client_inquiry_item->fixed_expenses as $expense) @if($client_inquiry_item->cargo_type =='TANKERS') @endif @if($route_cargo_detail->is_returning) @endif @endforeach @if($client_inquiry_item->cargo_type =='TANKERS') @endif @if($route_cargo_detail->is_returning) @endif @if($client_inquiry_item->cargo_type =='TANKERS') @endif @if($route_cargo_detail->is_returning) @endif @if($route_cargo_detail->is_returning) @endif @if($client_inquiry_item->cargo_type =='TANKERS') @endif @if($route_cargo_detail->is_returning) @endif @if($client_inquiry_item->cargo_type =='TANKERS') @endif @if($route_cargo_detail->is_returning) @endif @if($route_cargo_detail->is_returning) @endif @if($route_cargo_detail->is_returning) @endif @if($client_inquiry_item->cargo_type =='TANKERS') @endif @if($route_cargo_detail->is_returning) @endif @if($client_inquiry_item->cargo_type =='TANKERS') @endif @if($route_cargo_detail->is_returning) @endif @if($client_inquiry_item->cargo_type =='TANKERS') @endif @if($route_cargo_detail->is_returning) @endif
is_returning)?2:1 !!}" style="text-align: center"> {{$client_inquiry_item->clientInquiryItemOffloadingPoint->city->name}} - {!! $client_inquiry_item->product_name !!}
SemiPullyReturn Cargo
Exchange Rate {!! number_format($client_inquiry_item->exchange_rate) !!} {!! number_format($client_inquiry_item->exchange_rate) !!} {!! number_format($client_inquiry_item->exchange_rate) !!}
Loading Point {{$client_inquiry_item->clientInquiryItemLoadingPoint->city->name}}{{$client_inquiry_item->clientInquiryItemLoadingPoint->city->name}}{{$route_cargo_detail->routeReturningCargoDetails->first()->loadingCity->name}}
Country {{$client_inquiry_item->clientInquiryItemOffloadingPoint->city->country->name}}{{$client_inquiry_item->clientInquiryItemOffloadingPoint->city->country->name}}{{$route_cargo_detail->routeReturningCargoDetails->first()->loadingCity->country->name}}
Destination {{$client_inquiry_item->clientInquiryItemOffloadingPoint->city->name}}{{$client_inquiry_item->clientInquiryItemOffloadingPoint->city->name}}DAR ES SALAAM
KM {{($route_cargo_detail->is_returning)?number_format($route->go_distance): number_format($route->go_distance*2)}}{{number_format($route->go_distance*2)}} {{number_format($route_cargo_detail->routeReturningCargoDetails->first()->getKm())}}
Rate/MT {{ ($client_inquiry_item->rate_for =='TRIP')? "" : $client_inquiry_item->rate * $client_inquiry_item->tonnage }} {{ ($client_inquiry_item->rate_for =='TRIP')? "" : $client_inquiry_item->rate * $client_inquiry_item->tonnage }}
Rate/Trip {{--*/ $rate = ($client_inquiry_item->rate_for == "TRIP")? $client_inquiry_item->rate:$client_inquiry_item->rate*$client_inquiry_item->standard_semi_tonnage /*--}} {{number_format($rate)}} {{--*/ $rate = ($client_inquiry_item->rate_for == "TRIP")? $client_inquiry_item->rate:$client_inquiry_item->rate*$client_inquiry_item->standard_pully_tonnage /*--}} {{number_format($rate)}} {{-- {{number_format($client_inquiry_item->standard_pully_tonnage*$client_inquiry_item->rate)}}--}}
Fuel(Ltr) {{$route->getFuel($client_inquiry_item->cargo_type)}}{{$route->getFuel($client_inquiry_item->cargo_type)}}{{$route_cargo_detail->routeReturningCargoDetails->first()->getFuel()}}
Fuel Rate/Ltr {!! number_format($client_inquiry_item->fuel_rate) !!}{!! number_format($client_inquiry_item->fuel_rate) !!} {!! number_format($route_cargo_detail->routeReturningCargoDetails->first()->fuel_rate) !!}
Expected days {{$route->getDays($client_inquiry_item->cargo_type)}} {{$route->getDays($client_inquiry_item->cargo_type)}} {{$route_cargo_detail->routeReturningCargoDetails->first()->getDays()}}
  
is_returning)?2:1 !!}">Loading Points Expenses {{-- --}}  
{!! $l->expense !!} {!! number_format($l->amount) !!}{!! number_format($l->amount) !!}{{number_format(($route_cargo_detail->routeReturningCargoDetails->first()->getExpenses($l->account_id)))}}
is_returning )?2:1 !!}">Route Border Expenses  
{!! $b->expense !!} {!! number_format($b->amount) !!}{!! number_format($b->amount) !!}{{number_format(($route_cargo_detail->routeReturningCargoDetails->first()->getExpenses($b->account_id)))}}
is_returning)?2:1 !!}">Route Forecasting Expenses
{!! $l->expense !!} {!! number_format($l->amount) !!}{!! number_format($l->amount) !!}{{number_format(($route_cargo_detail->routeReturningCargoDetails->first()->getExpenses($l->account_id)))}}
is_returning)?2:1 !!}">Driver Expenses
{{$route_expense->expense}} {{number_format($route_expense->amount,2)}}{{number_format($route_expense->amount,2)}}{{number_format(($route_cargo_detail->routeReturningCargoDetails->first()->getExpenses($route_expense->account_id)))}}
{!! $o->expense !!} {{number_format($o->amount,2)}}{{number_format($o->amount,2)}} {{number_format($o->return_amount ,2)}}
is_returning)?2:1 !!}" style="text-align: right;">Total Operating Cost (USD) {!! number_format($client_inquiry_item->computed_values->total_operation_cost_usd) !!}{!! number_format($client_inquiry_item->computed_values->total_operation_cost_usd) !!}{!! number_format($client_inquiry_item->computed_values->total_return_operation_cost_usd) !!}
is_returning)?2:1 !!}" style="text-align: right;">Contribution in USD {!! number_format($client_inquiry_item->computed_values->contribution_semi) !!}{!! number_format($client_inquiry_item->computed_values->contribution_pully) !!}{!! number_format($client_inquiry_item->computed_values->contribution_return_usd) !!}
is_returning)?2:1 !!}">Route Fixed Expenses  
{!! $l->expense!!} {!! number_format($l->amount)!!}{!! number_format($l->amount)!!}{!! number_format($l->amount)!!}
{!! $expense->expense !!} {!! number_format($expense->amount) !!} {!! number_format($expense->amount) !!} {!! number_format($expense->amount) !!}
Total Fixed Cost(Tsh) {!! number_format($client_inquiry_item->computed_values->total_fixed_expenses) !!} {!! number_format($client_inquiry_item->computed_values->total_fixed_expenses) !!} {!! number_format($client_inquiry_item->computed_values->total_fixed_expenses) !!}
Total Fixed Cost(USD) {!! number_format($client_inquiry_item->computed_values->total_fixed_expenses_usd) !!} {!! number_format($client_inquiry_item->computed_values->total_fixed_expenses_usd) !!} {!! number_format($client_inquiry_item->computed_values->total_fixed_expenses_usd) !!}
is_returning)?2:1 !!}"> 
Net Profit in USD {!! number_format($client_inquiry_item->computed_values->net_profit_usd_semi) !!} {!! number_format($client_inquiry_item->computed_values->net_profit_usd_pully) !!} {!! number_format($client_inquiry_item->computed_values->net_profit_usd_return) !!}
{!! number_format($client_inquiry_item->computed_values->net_profit_percentage_semi) !!}% {!! number_format($client_inquiry_item->computed_values->net_profit_percentage_pully) !!}% {!! number_format($client_inquiry_item->computed_values->net_profit_percentage_return) !!}%
is_returning)?2:1 !!}">  
is_returning)?2:1 !!}">  
Net Profit in USD {!! number_format($client_inquiry_item->computed_values->net_profit_usd_semi) !!} {!! number_format($client_inquiry_item->computed_values->net_profit_usd_pully) !!} {!! number_format($client_inquiry_item->computed_values->net_profit_usd_return) !!}
Add: Depreciation {!! number_format($client_inquiry_item->computed_values->depreciation_usd) !!} {!! number_format($client_inquiry_item->computed_values->depreciation_usd) !!} {!! number_format($client_inquiry_item->computed_values->depreciation_usd) !!}
Cash Profit per Trip per {!! ($client_inquiry_item->cargo_type =='TANKERS')?"Tanker":"Truck" !!} {!! number_format($client_inquiry_item->computed_values->cash_profit_per_trip_per_tanker_semi) !!} {!! number_format($client_inquiry_item->computed_values->cash_profit_per_trip_per_tanker_pully) !!} {!! number_format($client_inquiry_item->computed_values->cash_profit_per_trip_per_truck_return) !!}
@endforeach