@php // 1. Calculate Totals Upfront $totalRoll = 0; $totalWeight = 0; $totalLength = 0; $totalArea = 0; // Get majority SALESUOM for BX1 label $majorityUom = isset($ET_ITEM) && $ET_ITEM->isNotEmpty() ? strtoupper($ET_ITEM->pluck('SALESUOM')->countBy()->sortDesc()->keys()->first() ?? 'BX1') : 'BX1'; $firstItemSalesUom = $majorityUom === 'BAL' ? 'BALE' : $majorityUom; // Loop to calculate totals only $totalQtyBx1 = 0; $totalPcs = 0; foreach($ET_ITEM as $item) { $totalQtyBx1 += (float)($item->ORDERQTY ?? 0); $totalWeight += (float)($item->WEIGHT ?? 0); $totalPcs += (float)($item->AREAPERPIECE ?? 0); } // --- PAGINATION LOGIC --- $chunks = \App\Helpers\DocumentPagination_Helper::paginate($ET_ITEM, 'internal_order'); @endphp @foreach ($chunks as $pageIndex => $chunk) @if ($pageIndex > 0)
@endif
@if ($pageIndex == 0)
@php $logoPath = public_path('storage/logo_large.png'); if (file_exists($logoPath)) { $logoData = base64_encode(file_get_contents($logoPath)); $logoSrc = 'data:image/png;base64,' . $logoData; } else { $logoSrc = asset('storage/logo_large.png'); } @endphp Logo

PT. MULTI SPUNINDO JAYA Tbk

Ds. Jabaran RT. 008 RW. 003, Jabaran, Balongbendo, Kab. Sidoarjo

Jawa Timur - Indonesia

Telp. +62-31-8975555 (H), Fax +62-31-8976666, 8971300

INTERNAL ORDER

Consignee
{{ $ET_HEADER->first()->CONSIGNEENAME1 ?? '' }}
@if ($ET_HEADER->first()->CONSIGNEENAME2 ?? null) {{ $ET_HEADER->first()->CONSIGNEENAME2 }}
@endif @if ($ET_HEADER->first()->CONSIGNEESTREET ?? null) {{ $ET_HEADER->first()->CONSIGNEESTREET ?? '' }}
@endif @if ($ET_HEADER->first()->CONSIGNEESTRSUPPL1 ?? null) {{ $ET_HEADER->first()->CONSIGNEESTRSUPPL1 ?? '' }}
@endif @if ( $ET_HEADER->first()->CONSIGNEESTRSUPPL2 ?? null) {{ $ET_HEADER->first()->CONSIGNEESTRSUPPL2 ?? '' }}
@endif @if ($ET_HEADER->first()->CONSIGNEESTRSUPPL3 ?? null) {{ $ET_HEADER->first()->CONSIGNEESTRSUPPL3 ?? '' }}
@endif @if ($ET_HEADER->first()->CONSIGNEECITY ?? null) {{ $ET_HEADER->first()->CONSIGNEECITY ?? '' }}
@endif {{ $ET_HEADER->first()->CONSIGNEECOUNTRY ?? '' }}
SO/PI No : {{ ltrim($ET_HEADER->first()->SALESDOCUMENT ?? '', '0') }} Date {{ $ET_HEADER->first()->DOCUMENTDATE ? \Carbon\Carbon::parse($ET_HEADER->first()->DOCUMENTDATE)->format('d-m-Y') : '' }}
Our Ref : {{ $ET_HEADER->first()->OURREFERENCE ?? '' }}
No PO : {{ $ET_HEADER->first()->CUSTOMERPO ?? '' }}
End User : {{ $ET_HEADER->first()->ENDUSER ?? '' }}
Payment Term : {{ $ET_HEADER->first()->ZTERMTXT ?? '' }}
Price Condition : {{ $ET_HEADER->first()->PRICECOND ?? '' }}
Buyer / Notify Party ( if other than consignee )
{{ $ET_HEADER->first()->BUYERNAME1 ?? '' }}
@if ($ET_HEADER->first()->BUYERNAME2 ?? null) {{ $ET_HEADER->first()->BUYERNAME2 }}
@endif @if ($ET_HEADER->first()->BUYERSTREET ?? null) {{ $ET_HEADER->first()->BUYERSTREET ?? '' }}
@endif @if ($ET_HEADER->first()->BUYERSTRSUPPL1 ?? null) {{ $ET_HEADER->first()->BUYERSTRSUPPL1 ?? '' }}
@endif @if ( $ET_HEADER->first()->BUYERSTRSUPPL2 ?? null) {{ $ET_HEADER->first()->BUYERSTRSUPPL2 ?? '' }}
@endif @if ($ET_HEADER->first()->BUYERSTRSUPPL3 ?? null) {{ $ET_HEADER->first()->BUYERSTRSUPPL3 ?? '' }}
@endif @if ($ET_HEADER->first()->BUYERCITY ?? null) {{ $ET_HEADER->first()->BUYERCITY ?? '' }}
@endif {{ $ET_HEADER->first()->BUYERCOUNTRY ?? '' }}
Loading Port : {{ $ET_HEADER->first()->LOADPORT ?? '' }}
Destination : {{ $ET_HEADER->first()->DESTINATION ?? '' }}
Shipment by : {{ $ET_HEADER->first()->SHIPMENTBY ?? '' }}
Packing : {{ $ET_HEADER->first()->PACKING ?? '' }}
Shipment Date : {{ $ET_HEADER->first()->SHIPMENTDATE ?? '' }}
@else
@endif @foreach($chunk as $item) @endforeach @if ($loop->last) @endif
Weight /
Pcs
Width (m) Length Qty
{{ $firstItemSalesUom }}
Tot. Weight
(kg)
PCS /
{{ $firstItemSalesUom }}
Total
PCS
Spec Reference
{{ $item->DESCRIPTION ?? '' }} @if($item->CUSTOMERMATERIAL ?? null) // {{ $item->CUSTOMERMATERIAL }} @endif @if($item->MATERIAL ?? null)     {{ $item->MATERIAL }} @endif
{{ $item->GSM ?? '' }} {{ number_format((float)($item->WIDTHPERROLL ?? 0), 3, ',', '.') }} {{ number_format((float)($item->LENGTHPERROLL ?? 0), 3, ',', '.') }} {{ $item->ORDERQTY ?? '' }} {{ number_format((float)($item->WEIGHT ?? 0), 2, ',', '.') }} {{ number_format((float)($item->LENGTHPERPIECE ?? 0), 0, ',', '.') }} {{ number_format((float)($item->AREAPERPIECE ?? 0), 0, ',', '.') }}
TOTAL AMOUNT {{ number_format($totalQtyBx1, 0, ',', '.') }} {{ number_format($totalWeight, 2, ',', '.') }} {{ number_format($totalPcs, 0, ',', '.') }}
@if ($loop->last) @endif
@endforeach