{{$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()}}
Re-printed BY : System Administrator
@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) !!} @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) @endforeach @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 /*--}} {{--*/ $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) {{--*/ $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) /*--}} @endforeach @foreach($requisition->requisition_currencies as $requisition_currency) @endforeach {{----}} {{-- --}} {{--*/ $total_amount += $sub_total /*--}} {{--*/ $total_amount_usd += $sub_total_usd /*--}} {{--*/ $total_amount_tsh += $sub_total_tsh /*--}} @endforeach @foreach($requisition->requisition_currencies as $requisition_currency) @endforeach {{----}} {{----}} {{--*/ $total_amount_from_this_requisition = $requisition->getTotalAmount($current_agent['currency'],$current_agent['exchange_rate']) /*--}}
S/N Truck Driver Allocation Destination Description TOTAL
{{$requested_account->name}} {{$requested_item->name}} Narration{{\App\Logistics\Facades\Logistics::getCurrencySign($requisition_currency)}}
{{++$index}} {{$loading_order_item->loadingOrderVehicle->vehicle->registration_number}} {{$loading_order_item->loadingOrderVehicle->driver->driver}} {{$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),2)}} @endif {{\App\Logistics\Facades\Logistics::getCurrencySign($currency)}} {{number_format($requested_item->quantity)}} @ {{number_format($requested_item->rate, 2)}} {{$route_assignment->remarks}}{{number_format($route_assignment->getAmountByCurrency($requisition_currency) + $sub_total_from_items,2)}}{{number_format($sub_total_usd)}}{{number_format($sub_total_tsh)}}
TOTAL{{number_format($requisition->getTotalAmountByCurrency($requisition_currency)+$total_from_items,2)}}{{number_format($total_amount_usd)}}{{number_format(round($total_amount_tsh/100)*100)}}
TOTAL AMOUNT IN {{$current_agent['currency']}} {{number_format($requisition->getTotalAmount($current_agent['currency'],$current_agent['exchange_rate'])+$total_from_items,2)}}
OVERALL AMOUNT IN {{$current_agent['currency']}} {{number_format($total_amount_from_this_requisition+$total_from_items,2)}}
@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(sizeof($current_agent['requested_accounts']) == 1) @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))}}{{number_format($route_assignment->getAmountByCurrency($requisition_currency))}}{{number_format($route_assignment->getAmountByCurrency($requisition_currency))}}
TOTAL{{number_format($requisition->getTotalAmountByCurrency($requisition_currency))}}
TOTAL AMOUNT IN {{$current_agent['currency']}} {{number_format($requisition->getTotalAmount($current_agent['currency'], $current_agent['exchange_rate']))}}
OVERALL AMOUNT IN {{$current_agent['currency']}} {{number_format($total_amount_from_this_requisition)}}
@endif
@endif @if($requisition->requisitionItems && !count($current_agent['requested_accounts']) ) {{--*/ $total_amount = 0 /*--}} {{--*/ $total_amount_usd = 0 /*--}} {{--*/ $total_amount_tsh = 0 /*--}} {{--*/ $exchange_rate = 2250 /*--}} {{--*/ $currency = 'TSH' /*--}} @foreach($requisition->requisitionItems as $index=>$requisition_item) {{--*/ $loading_order_item = $route_assignment->loadingOrderItem /*--}} {{--*/ $vehicle_id = $loading_order_item->vehicle_id /*--}} {{----}} {{--@if($index == 0)--}} {{----}} {{--@elseif($index == 1)--}} {{----}} {{--@else--}} {{----}} {{--@endif--}} {{----}} {{--*/ $total_amount += $requisition_item->requisitionItemAccount->amount /*--}} {{--*/ $total_amount_usd += $sub_total_usd /*--}} {{--*/ $total_amount_tsh += $sub_total_tsh /*--}} @endforeach
S/N Account Description Cost Center Quantity UOM Currency Rate Amount
{!! $loading_order_item !!}
{{$requisition_item->id}} {{$requisition_item->requisitionItemAccount->account->name ? $requisition_item->requisitionItemAccount->account->name : $requisition_item->requisitionItemItem->item->name }} {{$requisition_item->remarks != '' ? $requisition_item->remarks : $requisition->remarks }}T327 DPYT940 DPXT957 DPX{{$requisition_item->requisitionItemCostCenter->costCenter->name ? $requisition_item->requisitionItemCostCenter->costCenter->name : $requisition_item->requisitionItemDepartment->department->dept_name}} {{number_format($requisition_item->requisitionItemItem->quantity)}} {{$requisition_item->unit_of_measurement ? $requisition_item->unit_of_measurement->name : '' }} {{$requisition_item->currency}} {{number_format($requisition_item->requisitionItemItem->rate, 2)}} {{ $requisition_item->requisitionItemAccount->amount ? number_format($requisition_item->requisitionItemAccount->amount,2) : number_format(($requisition_item->requisitionItemItem->quantity * $requisition_item->requisitionItemItem->rate), 2)}}
TOTAL {{number_format($quantity_total)}} {{number_format($total_amount ? $total_amount : $amount_total ,2)}}
@endif
{{----}}