@php $document = new \DOMDocument('1.0', 'UTF-8'); $internalErrors = libxml_use_internal_errors(true); $key_total = 0; @endphp
@foreach($registers as $item) @php if( $item->payment_type == 'Local Charges'){ $key_total = 0; foreach($item->payment_fee as $key => $value){ $price = ( $value->currencies_id == 148 ? number_format((($value->price) * ($value->PaymentType == 'BL' ? $item->blQty: $item->containerQty)),2,'.','') : number_format($value->price * ($value->PaymentType == 'BL' ? $item->blQty: $item->containerQty),2,'.','') ); echo ''; $key_total++; } } if( $item->payment_type == 'Hauling'){ $key_total = 0; foreach($item->payment_fee as $value){ $line = ''; echo $line; $key_total++; } } for ($i=($key_total); $i < $count_column; $i++){ echo ''; } $amountBRL = number_format(($item->amountBRL), 2, ',', '.'); $correctionPrice = number_format(($item->correctionPrice * $item->correctionQty), 2, ',', '.'); $totalAmountBRL = number_format(($item->amountBRL + ($item->correctionPrice * $item->correctionQty)), 2, ',', '.'); @endphp @endforeach
Payment Type Process Number Extra Payment User Client Carrier Booking POL POD Incoterm BL Date Request Date Fee And Rates Description Correction Fee Amount USD Amount BRL Dollar Rate Total Amount Status
@if($item->payment_type == 'Local Charges') @if($item->status == 'Extra Payment') @else @endif @if ($item->status == 'Extra Payment') @else @endif @elseif($item->payment_type == 'Hauling') @if($item->status == 'Extra Payment') @else @endif @endif {{ $item->payment_type }} {{ $item->SAOE }} @if ($item->status == 'Extra Payment') - @else @if($item->payment_type == 'Local Charges') @elseif($item->payment_type == 'Hauling') @endif @endif {{ isset($item->usuarios->nome) ? str_limit($item->usuarios->nome, $limit = 10, $end = '...') : '-' }} {{ isset($item->loading_requests->clients->fantasyName) ? str_limit($item->loading_requests->clients->fantasyName, $limit = 10, $end = '...') : str_limit($item->loading_requests->clients->name, $limit = 10, $end = '...') }} {{ $item->loading_requests->carriers->descricao ? $item->loading_requests->carriers->descricao : '-' }} {{ $item->loading_requests->booking ? $item->loading_requests->booking : '-'}} {{ $item->loading_requests->loading_ports->descricao }} {{ $item->loading_requests->code_of_ports1->place .', '. $item->loading_requests->code_of_ports1->country }} {{ $item->loading_requests->incoterm ? $item->loading_requests->incoterms->description : '-'}} {{ $item->loading_requests->loading_confirmations->pluck('BlDate') ? date( 'd-m-Y' , strtotime($item->loading_requests->loading_confirmations->pluck('BlDate')->implode(' '))) : '-' }} {{ $item->emailRequestDate ? date( 'd-m-Y' , strtotime($item->emailRequestDate)) : '-' }}' . $price . ' (' . ($value->currencies_id == 148 ? 'USD' : 'BRL') . ') - ' . $value->descricao . ' ' ; $line .= ' Route: ' . $value->cities .'->'. $value->cities2 .'->'. $value->cities3 .'('; $line .= ($value->qty_truckingCost != 0 && $value->qty_truckingCost != null ? 'QTY:' . $value->qty_truckingCost. '-TRUCK COST ' . 'PRICE: ' . number_format(($value->truckingCost / $value->qty_truckingCost),2,',','.').'|' : ''); $line .= ($value->qty_toll != 0 && $value->qty_toll != null ? 'QTY:'. $value->qty_toll.'-TOLL ' . 'PRICE: ' . number_format(($value->toll / $value->qty_toll),2,',','.').'|': ''); $line .= ($value->qty_truck_laytime != 0 && $value->qty_truck_laytime != null ? 'QTY:' . $value->qty_truck_laytime.'-TRUCK LAYTIME ' . 'PRICE: ' . number_format(($value->truck_laytime / $value->qty_truck_laytime),2,',','.') .'|': ''); $line .= ($value->qty_flexitank_instalation != 0 && $value->qty_flexitank_instalation != null ? 'QTY:' . $value->qty_flexitank_instalation.'-FLEXITANK INSTALATION ' . 'PRICE: ' . number_format(($value->flexitank_instalation / $value->qty_flexitank_instalation),2,',','.') : ''); $line .= ') - {!! $correctionPrice ? $correctionPrice : '-' !!} {!! number_format(($item->amount ? $item->amount : 0),2,',','.') !!} {!! $amountBRL ? $totalAmountBRL : 0 !!} {!! number_format(($item->dollarRate ? $item->dollarRate : 0),5,',','.') !!} {!! number_format(( $item->dollarRate ? (($item->amount * $item->dollarRate) + ($item->amountBRL + ($item->correctionPrice * $item->correctionQty))) : 0) ,2,',','.') !!} {{ $item->status ? $item->status : '-'}}