Shipments @can('style:create') @endcan
@if(!$hideFilters)
@error('search') {{ $message }} @enderror
@endif
@if (Session::get('message')) @endif @if($errors->all()) @endif
@if($columns['Shipment No'])@endif @if($columns['Created'])@endif @if($columns['Organiser'])@endif @if($columns['Transporter'])@endif @if($columns['Price'])@endif @if($columns['Qty'])@endif @if($columns['Shipped Qty'])@endif @if($columns['Factory'])@endif @if($columns['Style'])@endif @if($columns['Description'])@endif @if($columns['Customer'])@endif @foreach($shipments as $shipment) @php $factories = $shipment->shipment_lines->map(function($l){ return $l->factories?->name ?? $l->customer_order_lines?->colourways?->style_versions?->factories?->name; })->filter()->unique()->values(); $customers = $shipment->shipment_lines->map(fn($l) => $l->customer_order_lines?->customer_orders?->customers?->name)->filter()->unique()->values(); $rowspan = max(1, max($factories->count(), $customers->count())); @endphp @for($i = 0; $i < $rowspan; $i++) @if($i === 0) @if($columns['Shipment No'])@endif @if($columns['Created'])@endif @if($columns['Organiser'])@endif @if($columns['Transporter'])@endif @if($columns['Price'])@endif @if($columns['Qty'])@endif @if($columns['Shipped Qty'])@endif @endif @if($columns['Factory'])@endif @if($columns['Style'])@endif @if($columns['Description'])@endif @if($columns['Customer'])@endif @if($i === 0) @endif @endfor @endforeach
Shipment No.CreatedOrganiserTransporterPriceQtyShipped QtyFactoryStyleDescriptionCustomer
{{$shipment->id}}{{$shipment->created_at->format('d-M-Y')}}{{$shipment->organiser}}{{$shipment->transporters?->name}}£{{number_format($shipment->cost, 2)}}{{$shipment->goods_qty}}{{ $shipment->shipment_lines->sum(fn($l) => $l->shipment_line_sizes->sum('shipped_qty')) }}{{ $factories[$i] ?? '' }}{{ $customers[$i] ?? '' }}
{{ $shipments->links() }}