{{$company->company_name}}

{{$company->company_address}},
{{$company->city}}, Tanzania
Mob: {{$company->compny_phone}}
Email: {{$company->company_email}}

TRIP REQUISITION

{{-- --}} {{-- --}} {{-- --}} {{-- --}} @if($re_print) @endif
REQ#. : {{$requisition->id}}
Created By. : {{ $requisition->initiator }}
Date : {{\Carbon\Carbon::parse($requisition->date)->toFormattedDateString()}}
Date Required : {{\Carbon\Carbon::parse($requisition->required_date)->toFormattedDateString()}}
Cash/Credit :--}} {{-- --}} {{-- {{$requisition->requisitionItemSource[0]->type == 'VENDOR' ? 'CREDIT' : 'CASH'}}--}} {{-- --}} {{--
Re-printed BY : System Administrator
PAYABLE ACCOUNT : {!! $current_agent['name'] !!}
{{--*/ $current_agent['payable_amount'] = 0 /*--}} {{-- --}}
OPEN BALANCE ({!! $current_agent['currency'] !!}): {!! number_format($current_agent['payable_amount'],2) !!}Loading Order: {{$loading_order_id}}
@if(sizeof($current_agent['cash_requisition_item_descriptions']) >= 1) @foreach($current_agent['requested_accounts'] as $requested_account) @endforeach @foreach($current_agent['requested_items'] as $requested_item) @if(!in_array($requested_item->name, $item_array)) @endif @endforeach @forelse ($requisition->requisition_currencies as $requisition_currency) @empty @endforelse {{--*/ $total_amount = 0 /*--}} {{--*/ $total_amount_usd = 0 /*--}} {{--*/ $total_amount_tsh = 0 /*--}} @foreach($current_agent['cash_requisition_item_descriptions'] as $index=>$route_assignment) {{--*/ $loading_order_item = $route_assignment->loadingOrderItem /*--}} {{--*/ $vehicle_id = $loading_order_item->vehicle_id /*--}} {{--*/ $sub_total = 0 /*--}} {{--*/ $sub_total_usd = 0 /*--}} {{--*/ $sub_total_tsh = 0 /*--}} @foreach($current_agent['requested_accounts'] as $requested_account) {{--*/ $amount = \App\Logistics\Facades\Logistics::currencyConvert($route_assignment->getAmount($requested_account->account->id), $route_assignment->getCurrency($requested_account->account->id), $requisition->RequisitionDrAccount->exchange_rate, $requisition->RequisitionDrAccount->currency) /*--}} {{--*/ $sub_total += $amount /*--}} {{--@if($route_assignment->getCurrency($requested_account->account->id) == 'USD')--}} @if($currency == 'USD') {{--*/ $sub_total_usd += $route_assignment->getAmount($requested_account->account->id) /*--}} @else {{--*/ $sub_total_tsh += $route_assignment->getAmount($requested_account->account->id) /*--}} @endif {{--*/ $sub_total_[$requested_account->account->id][] = $route_assignment->getAmount($requested_account->account->id) /*--}} @endforeach @foreach($current_agent['requested_items'] as $requested_item) @if($route_assignment->requisition_item_id == $requested_item->requisition_item_id) {{--*/ $amount = \App\Logistics\Facades\Logistics::currencyConvert($route_assignment->getAmount($requested_account->account->id), $route_assignment->getCurrency($requested_account->account->id), $requisition->RequisitionDrAccount->exchange_rate, $requisition->RequisitionDrAccount->currency) /*--}} @endif @endforeach @forelse ($requisition->requisition_currencies as $requisition_currency) @empty @endforelse {{--*/ $total_amount += $sub_total /*--}} {{--*/ $total_amount_usd += $sub_total_usd /*--}} {{--*/ $total_amount_tsh += $sub_total_tsh /*--}} @endforeach {{--*/ $total_amount_from_this_requisition = $requisition->getTotalAmount($current_agent['currency'],$current_agent['exchange_rate']) /*--}} @forelse ($requisition->requisition_currencies as $requisition_currency) @empty @endforelse
S/N Truck Driver Allocation Destination Description TOTAL
{{$requested_account->name}} {{$requested_item->name}} Narration{{\App\Logistics\Facades\Logistics::getCurrencySign($requisition_currency)}}{{ $requisition->requisition_item_currency }}
{{++$index}} {{$loading_order_item->loadingOrderVehicle->vehicle->registration_number}} {{$loading_order_item->loadingOrderVehicle->driver->driver}} {{$loading_order_item->LoadingOrder->client ? $loading_order_item->LoadingOrder->client->code : 'PIPE-LINE'}} {{$loading_order_item->loadingOrderDestination->city->name}} {{--*/ $currency = ($requested_account->account->id == 93)?'USD':$route_assignment->getCurrency($requested_account->account->id) /*--}} @if($route_assignment->getAmount($requested_account->account->id)) {{-- {{\App\Logistics\Facades\Logistics::getCurrencySign($route_assignment->getCurrency($requested_account->account->id))}} {{number_format($route_assignment->getAmount($requested_account->account->id))}}--}} {{\App\Logistics\Facades\Logistics::getCurrencySign($currency)}} {{number_format($route_assignment->getAmount($requested_account->account->id), 2)}} @endif {{\App\Logistics\Facades\Logistics::getCurrencySign($currency)}} {{number_format($requested_item->quantity, 2)}} @ {{number_format($requested_item->rate, 2)}} {{$route_assignment->remarks}}{{number_format($route_assignment->getAmountByCurrency($requisition_currency) + $sub_total_from_items, 2)}}{{number_format($route_assignment->getAmountByCurrency($requisition_currency) + $sub_total_from_items, 2)}}
TOTAL{{number_format($requisition->getTotalAmountByCurrency($requisition_currency)+$total_from_items, 2)}}{{number_format($total_amount_from_this_requisition+$total_from_items, 2)}}
OVERALL AMOUNT IN {{$current_agent['currency']}} {{number_format($total_amount_from_this_requisition+$total_from_items)}}
@else @foreach($requisition->requisition_currencies as $requisition_currency) @endforeach {{--*/ $total_amount = 0 /*--}} {{--*/ $total_amount_usd = 0 /*--}} {{--*/ $total_amount_tsh = 0 /*--}} @foreach($current_agent['cash_requisition_item_descriptions'] as $index=>$route_assignment) {{--*/ $loading_order_item = $route_assignment->loadingOrderItem /*--}} {{--*/ $vehicle_id = $loading_order_item->vehicle_id /*--}} {{--*/ $first = 0 /*--}} @foreach($current_agent['requested_accounts'] as $key =>$requested_account) @if($first == $key) @endif {{--*/ $sub_total = 0 /*--}} {{--*/ $sub_total_usd = 0 /*--}} {{--*/ $sub_total_tsh = 0 /*--}} {{--*/ $amount = \App\Logistics\Facades\Logistics::currencyConvert($route_assignment->getAmount($requested_account->account->id), $route_assignment->getCurrency($requested_account->account->id), $requisition->RequisitionDrAccount->exchange_rate, $requisition->RequisitionDrAccount->currency) /*--}} {{--*/ $sub_total += $amount /*--}} {{----}} @if($route_assignment->getAmount($requested_account->account->id)) {{--*/ $currency = ($requested_account->account->id == 93)?'USD':$route_assignment->getCurrency($requested_account->account->id) /*--}} @endif @if($currency == 'USD') {{--*/ $sub_total_usd += $route_assignment->getAmount($requested_account->account->id) /*--}} @else {{--*/ $sub_total_tsh += $route_assignment->getAmount($requested_account->account->id) /*--}} @endif {{--*/ $sub_total_[$requested_account->account->id][] = $route_assignment->getAmount($requested_account->account->id) /*--}} @if(count($current_agent['requested_accounts'])) @foreach($requisition->requisition_currencies as $requisition_currency) @endforeach @else @if($first == $key) @foreach($requisition->requisition_currencies as $requisition_currency) @endforeach @endif @if(sizeof($current_agent['requested_accounts']) == ($key+1)) @foreach($requisition->requisition_currencies as $requisition_currency) @endforeach @endif @endif {{--*/ $total_amount += $sub_total /*--}} {{--*/ $total_amount_usd += $sub_total_usd /*--}} {{--*/ $total_amount_tsh += $sub_total_tsh /*--}} @endforeach @endforeach @foreach($requisition->requisition_currencies as $requisition_currency) @endforeach {{--*/ $total_amount_from_this_requisition = $requisition->getTotalAmount($current_agent['currency'],$current_agent['exchange_rate']) /*--}}
  TRIP DETAILS EXPENSE DESCRIPTION TOTAL
S/N Truck Driver Allocation Destination Narrations Expenses Amount{{\App\Logistics\Facades\Logistics::getCurrencySign($requisition_currency)}}
{{++$index}} {{$loading_order_item->loadingOrderVehicle->vehicle->registration_number}} {{$loading_order_item->loadingOrderVehicle->driver->full_name}} {{$loading_order_item->LoadingOrder->client->code}} {{$loading_order_item->loadingOrderDestination->city->name}} {{$route_assignment->remarks}}
{{$requested_account->name}} {{\App\Logistics\Facades\Logistics::getCurrencySign($currency)}} {{number_format($route_assignment->getAmount($requested_account->account->id), 2)}}{{number_format($route_assignment->getAmountByCurrency($requisition_currency), 2)}}{{number_format($route_assignment->getAmountByCurrency($requisition_currency), 2)}}
TOTAL{{number_format($requisition->getTotalAmountByCurrency($requisition_currency), 2)}}
TOTAL AMOUNT IN {{$current_agent['currency']}} {{number_format($requisition->getTotalAmount($current_agent['currency'], $current_agent['exchange_rate']), 2)}}
OVERALL AMOUNT IN {{$current_agent['currency']}} {{number_format($total_amount_from_this_requisition)}}
@endif