@php $to = 'To: ' @endphp @foreach($shipment->companies as $company) @if((int)$company->pivot->type === 2) @php $to = $to.$company->name @endphp @break; @endif @endforeach {{ $to }} |
Shipment No: {{$shipment->number}} {{$shipment->number2}} |
Description of Goods: |
{!! $shipment->description !!} @if($shipment->contract != '' && $shipment->contract != null && $shipment->contract != 'N/A') CONTRACT NUMBER {{$shipment->contract}} @endif |
Vessel: |
{{$shipment->vessel->name}} |
Voyage: | {{$shipment->voyage}} |
Port of Loading: | @foreach($shipment->ports as $port) @if((int)$port->pivot->type === 1) {{ $port->name }} @break; @endif @endforeach |
Port of Discharge: | @foreach($shipment->ports as $port) @if((int)$port->pivot->type === 2) {{ $port->name }} @break; @endif @endforeach |
Place of Delivery: | @foreach($shipment->companies as $company) @if((int)$company->pivot->type === 2) {{ $company->name }} @break; @endif @endforeach |
PO Number(s): | {{$shipment->poNumber}} |
Container Number |
Seal Number |
Grade/Lot | Cartons | Shipping Number |
Gross Kilos |
Tare Kilos |
Net Kilos |
{{$consignment['containerNumber']}} | @if($consignment['customSeal'] !== null && trim(consignment['customSeal']) !== '') {{ $consignment['customSeal'] }} @else {{ $consignment['seal'] }} @endif | {{ strtoupper($consignment['grade']) }} | @php $cartons = 0 @endphp @if(count($consignment['cartons']) > 0) @php $cartons = $cartons + count($consignment['cartons']) @endphp @endif @if(!empty($consignment->bales)) @php $cartons = $cartons + count($consignment->bales) @endphp @endif {{ number_format($cartons, 0, '.', ',') }} | @php $lines = '' @endphp @php $last = '' @endphp @if(count($consignment['cartons']) > 0) @for($i = 0; $i < count($consignment['cartons']); $i++) @if($i == 0) @php $last = $consignment['cartons'][$i]['shippingNumber'] @endphp @endif @if($i > 0) @if(($consignment['cartons'][$i]['shippingNumber'] - $consignment['cartons'][$i - 1]['shippingNumber']) > 1) @php $lines = $lines.", ".$last."-".$consignment['cartons'][$i - 1]['shippingNumber'] @endphp @php $last = $consignment['cartons'][$i]['shippingNumber'] @endphp @endif @endif @endfor @if($last != $consignment['cartons'][count($consignment['cartons']) - 1]['shippingNumber']) @php $lines = $lines.", ".$last."-".$consignment['cartons'][count($consignment['cartons']) - 1]['shippingNumber'] @endphp @else @php $lines = $lines.", ".$last @endphp @endif @endif @php $lines = trim($lines, ", ") @endphp @if($lines == '') @if(!empty($consignment->bales)) @if(count($consignment->bales) > 0) @for($i = 0; $i < count($consignment->bales); $i++) @if($i == 0) @php $last = $consignment->bales[$i]->progno @endphp @endif @if($i > 0) @if(($consignment->bales[$i]->progno - $consignment->bales[$i - 1]->progno) > 1) @php $lines = $lines.", ".$last."-".$consignment->bales[$i - 1]->progno @endphp @php $last = $consignment->bales[$i]->progno @endphp @endif @endif @endfor @if($last != $consignment->bales[count($consignment->bales) - 1]->progno) @php $lines = $lines.", ".$last."-".$consignment->bales[count($consignment->bales) - 1]->progno @endphp @else @php $lines = $lines.", ".$last @endphp @endif @endif @php $lines = trim($lines, ", ") @endphp @endif @endif {{$lines}} | @if(count($consignment['cartons']) > 0) @php $localGross = 0; $localTare = 0; $localNet = 0 @endphp @if($consignment['customTare'] == null || $consignment['customTare'] == '') @for($x = 0; $x < count($consignment['cartons']); $x++) @php $cases += 1 @endphp] @php $localGross += $consignment['cartons'][$x]['gross'] @endphp] @php $localTare += $consignment['cartons'][$x]['tare'] @endphp] @php $localNet += $consignment['cartons'][$x]['net'] @endphp] @endfor @else @for($x = 0; $x < count($consignment['cartons']); $x++) @php $cases += 1 @endphp] @php $localNet += $consignment['cartons'][$x]['net'] @endphp] @php $localGross += ($consignment['customTare'] + $consignment['cartons'][$x]['net']) @endphp] @php $localTare += $consignment['customTare'] @endphp] @endfor @endif @else @php $gross = $gross + $consignment->bales->sum('mass') @endphp @endif{{ number_format($localGross, 2, '.', ',') }} @php $gross += $localGross @endphp | {{ number_format($localTare, 2, '.', ',') }} @php $tare += $localTare @endphp | {{ number_format($localNet, 2, '.', ',') }} @php $net += $localNet @endphp |
Totals | {{number_format($cases, 0, '.', ',')}} | {{number_format($gross, 2, '.', ',')}} | {{number_format($tare, 2, '.', ',')}} | {{number_format($net, 2, '.', ',')}} |