{{$company->company_name}}

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

TRIP CHARGES REQUISITION

REQ#. : {{$requisition->id}}
Created By. : {{ $requisition->initiator }}
Date : {{\Carbon\Carbon::parse($requisition->date)->toFormattedDateString()}}
@if(count($current_agent['requested_accounts']))
PAYABLE ACCOUNT : {!! $current_agent['name'] !!}
{{--
BANK NAME :
--}} {{--*/ $current_agent['payable_amount'] = 0 /*--}}
OPEN BALANCE ({!! $current_agent['currency'] !!}): {!! number_format($current_agent['payable_amount'],2) !!}
@foreach($current_agent['requested_accounts'] as $requested_account) @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 /*--}} {{--*/ $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 {{--*/ $total_amount += $sub_total /*--}} {{--*/ $total_amount_usd += $sub_total_usd /*--}} {{--*/ $total_amount_tsh += $sub_total_tsh /*--}} @endforeach @foreach($current_agent['requested_accounts'] as $requested_account) @endforeach {{--*/ $total_amount_from_this_requisition = \App\Logistics\Facades\Logistics::currencyConvert($total_amount_usd,'USD',$current_agent['exchange_rate'],$current_agent['currency'])+ \App\Logistics\Facades\Logistics::currencyConvert($total_amount_tsh,'TSH',$current_agent['exchange_rate'],$current_agent['currency'])/*--}}
S/N Truck Allocation Destination Description TOTAL
{{$requested_account->name}} USD TSH
{{++$index}} {{$loading_order_item->loadingOrderVehicle->vehicle->registration_number}} {{$loading_order_item->LoadingOrder->client->code}} {{$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))}} @endif {{number_format($sub_total_usd)}} {{number_format($sub_total_tsh)}}
{{number_format(array_sum($sub_total_[$requested_account->account->id])) }}{{number_format($total_amount_usd)}} {{number_format(round($total_amount_tsh/100)*100)}}
TOTAL AMOUNT IN {{$current_agent['currency']}} {{number_format($total_amount_from_this_requisition)}}
OVERALL AMOUNT IN {{$current_agent['currency']}} {{number_format($total_amount_from_this_requisition+$current_agent['payable_amount'])}}
@endif