@extends('layouts.main', ['title' => 'LOGISTICS | Loading Orders']) @section('navigation') @stop @section('title') Loading Orders @endsection @section('msghead_menu') {{--
  • --}} {{--
    --}} {{-- --}} {{--
    --}} {{--
  • --}} @endsection @section('contentinner')
    Loading Order #: {{ $loading_order->id }} Date : {{$loading_order->date}}
    Allocation: {{$loading_order->client->name}} Number of Trucks : {{$loading_order->no_of_vehicles }}


    Expenses Summary

    @foreach($loading_order->safariAllowances() as $account) @endforeach @foreach($loading_order->borderFees() as $account) @endforeach @foreach($loading_order->safariAllowances() as $account) @endforeach @foreach($loading_order->borderFees() as $account) @endforeach {{--*/ $total_diesel_required = 0 /*--}} {{--*/ $total_diesel_requisted = 0 /*--}} @foreach($loading_order->loadingOrderItems as $index=>$loading_order_item) {{--*/ $total_diesel_required += $loading_order_item->loadingOrderItemFuelAssignment()->quantity /*--}} {{--*/ $total_diesel_requisted += $loading_order_item->loadingOrderItemFuelAssignment()->requested /*--}} @foreach($loading_order->safariAllowances() as $account) {{--*/ $total_required[$account->account_id][] =$account->amount /*--}} {{--*/ $total_paid[$account->account_id][] = $loading_order_item->getPaidAmount($account->account_id,$account->currency) /*--}} {{--*/ $total[$account->account_id][] = $loading_order_item->getPaidAmount($account->account_id,$account->currency) /*--}} @endforeach @foreach($loading_order->borderFees() as $account) {{--*/ $total_required[$account->account_id][] =$account->amount /*--}} {{--*/ $total_paid[$account->account_id][] = $loading_order_item->getPaidAmount($account->account_id,$account->currency) /*--}} @endforeach @endforeach @foreach($loading_order->safariAllowances() as $account) @endforeach @foreach($loading_order->borderFees() as $account) @endforeach @foreach($loading_order->safariAllowances() as $account) @endforeach @foreach($loading_order->borderFees() as $account) @endforeach @foreach($loading_order->safariAllowances() as $account) @endforeach @foreach($loading_order->borderFees() as $account) @endforeach
    Trip Details Diesel Safari Allowance Border Charges
    Truck Trailer Destination {{$account->account}}{{$account->account}}
    {{($account->currency=='USD' ? '$':'Tsh')}} {{number_format($account->amount)}}{{($account->currency=='USD' ? '$':'Tsh')}} {{number_format($account->amount)}}
    {{++$index}} {{$loading_order_item->loadingOrderVehicle->vehicle->registration_number}} {{$loading_order_item->loadingOrderVehicle->trailer->registration_number}} {{$loading_order_item->loadingOrderDestination->city->name}} {{number_format($loading_order_item->loadingOrderItemFuelAssignment()->requested)}}{{number_format($loading_order_item->getPaidAmount($account->account_id,$account->currency))}}{{number_format($loading_order_item->getPaidAmount($account->account_id,$account->currency))}}
    Total Required {{number_format($total_diesel_required)}}{{number_format(array_sum($total_required[$account->account_id]))}}{{number_format(array_sum($total_required[$account->account_id]))}}
    Total Allocated {{number_format($total_diesel_requisted)}}{{number_format(array_sum($total_paid[$account->account_id]))}}{{number_format(array_sum($total_paid[$account->account_id]))}}
    Balance {{number_format($total_diesel_required - $total_diesel_requisted)}}{{number_format(array_sum($total_required[$account->account_id])-array_sum($total_paid[$account->account_id]))}}{{number_format(array_sum($total_required[$account->account_id])-array_sum($total_paid[$account->account_id]))}}
    @stop