@if(($expenses_category == 'DIESEL') OR ($expenses_category == 'ALL') ) @endif @if(($expenses_category == 'SAFARI_ALLOWANCE') OR ($expenses_category == 'ALL') ) @endif @if(($expenses_category == 'BORDER_CHARGES') OR ($expenses_category == 'ALL') ) @endif @if(sizeof($loading_order->forecastExpenses())>1) @if(($expenses_category == 'FORECASTED_EXPENSES') OR ($expenses_category == 'ALL') ) @endif @endif @if(($expenses_category == 'DIESEL') OR ($expenses_category == 'ALL') ) @endif @if(($expenses_category == 'SAFARI_ALLOWANCE') OR ($expenses_category == 'ALL') ) @foreach($loading_order->safariAllowances() as $account) @endforeach @endif @if(($expenses_category == 'BORDER_CHARGES') OR ($expenses_category == 'ALL') ) @foreach($loading_order->borderFees() as $account) @endforeach @endif @if(($expenses_category == 'FORECASTED_EXPENSES') OR ($expenses_category == 'ALL') ) @foreach($loading_order->forecastExpenses() as $account) @endforeach @endif @if(($expenses_category == 'DIESEL') OR ($expenses_category == 'ALL') ) @endif @if(($expenses_category == 'SAFARI_ALLOWANCE') OR ($expenses_category == 'ALL') ) @foreach($loading_order->safariAllowances() as $account) @endforeach @endif @if(($expenses_category == 'BORDER_CHARGES') OR ($expenses_category == 'ALL') ) @foreach($loading_order->borderFees() as $account) @endforeach @endif @if(($expenses_category == 'FORECASTED_EXPENSES') OR ($expenses_category == 'ALL') ) @foreach($loading_order->forecastExpenses() as $account) @endforeach @endif {{--*/ $total_diesel_required = 0 /*--}} {{--*/ $total_diesel_requisted = 0 /*--}} @foreach($loading_order->loadingOrderItems as $index=>$loading_order_item) @if(($expenses_category == 'DIESEL') OR ($expenses_category == 'ALL') ) {{--*/ $total_diesel_required += $loading_order_item->loadingOrderItemFuelAssignment()->quantity /*--}} {{--*/ $total_diesel_requisted += $loading_order_item->loadingOrderItemFuelAssignment()->requested /*--}} @endif @if(($expenses_category == 'SAFARI_ALLOWANCE') OR ($expenses_category == 'ALL') ) @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 @endif @if(($expenses_category == 'BORDER_CHARGES') OR ($expenses_category == 'ALL') ) @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 @endif @if(($expenses_category == 'FORECASTED_EXPENSES') OR ($expenses_category == 'ALL') ) @foreach($loading_order->forecastExpenses() as $account) {{--*/ $total_required[$account->account_id][] =$account->amount /*--}} {{--*/ $total_paid[$account->account_id][] = $loading_order_item->getPaidAmount($account->account_id,$account->currency) /*--}} @endforeach @endif @endforeach @if(($expenses_category == 'DIESEL') OR ($expenses_category == 'ALL') ) @endif @if(($expenses_category == 'SAFARI_ALLOWANCE') OR ($expenses_category == 'ALL') ) @foreach($loading_order->safariAllowances() as $account) @endforeach @endif @if(($expenses_category == 'BORDER_CHARGES') OR ($expenses_category == 'ALL') ) @foreach($loading_order->borderFees() as $account) @endforeach @endif @if(($expenses_category == 'FORECASTED_EXPENSES') OR ($expenses_category == 'ALL') ) @foreach($loading_order->forecastExpenses() as $account) @endforeach @endif @if(($expenses_category == 'DIESEL') OR ($expenses_category == 'ALL') ) @endif @if(($expenses_category == 'SAFARI_ALLOWANCE') OR ($expenses_category == 'ALL') ) @foreach($loading_order->safariAllowances() as $account) @endforeach @endif @if(($expenses_category == 'BORDER_CHARGES') OR ($expenses_category == 'ALL') ) @foreach($loading_order->borderFees() as $account) @endforeach @endif @if(($expenses_category == 'FORECASTED_EXPENSES') OR ($expenses_category == 'ALL') ) @foreach($loading_order->forecastExpenses() as $account) @endforeach @endif @if(($expenses_category == 'DIESEL') OR ($expenses_category == 'ALL') ) @endif @if(($expenses_category == 'SAFARI_ALLOWANCE') OR ($expenses_category == 'ALL') ) @foreach($loading_order->safariAllowances() as $account) @endforeach @endif @if(($expenses_category == 'BORDER_CHARGES') OR ($expenses_category == 'ALL') ) @foreach($loading_order->borderFees() as $account) @endforeach @endif @if(($expenses_category == 'FORECASTED_EXPENSES') OR ($expenses_category == 'ALL') ) @foreach($loading_order->forecastExpenses() as $account) @endforeach @endif
Trip DetailsDieselSafari Allowance Border ChargesForecast Expenses
Truck Trailer Destination{{$account->account}}{{$account->account}}{{$account->account}}
Budgeted Amount@{{($account->currency=='USD' ? '$':'Tsh')}} {{number_format($account->amount)}}{{($account->currency=='USD' ? '$':'Tsh')}} {{number_format($account->amount)}}{{($account->currency=='USD' ? '$':'Tsh')}} {{number_format($account->amount)}}
{{$loading_order_item->id}} {{$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))}}{{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]))}}{{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]))}}{{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]))}}{{number_format(array_sum($total_required[$account->account_id])-array_sum($total_paid[$account->account_id]))}}