@php $columns = match ($format) { 'dymo' => 1, '2x7_price' => 2, '4x7_price' => 4, '4x12' => 4, '4x12_price' => 4, default => 2, }; if ($type == 'lot') { $records = $records->filter(fn ($moveLine) => $moveLine->lot_id); } $showPrice = str_contains($format, 'price'); $flatRecords = []; foreach ($records as $record) { $quantity = match ($quantityType) { 'operation' => $record->qty, 'custom' => $quantity, 'per_lot' => 1, default => $record->qty, }; for ($i = 0; $i < $quantity; $i++) { $flatRecords[] = $record; } } $totalRecords = count($flatRecords); $barcodeScale = $columns == 4 ? 1.2 : 2; @endphp @for ($i = 0; $i < $totalRecords; $i += $columns) @for ($j = 0; $j < $columns && ($i + $j) < $totalRecords; $j++) @php $currentRecord = $flatRecords[$i + $j]; $barcode = $currentRecord->lot?->name ?? $currentRecord->product->barcode; @endphp @endfor @endfor
{{ strtoupper($currentRecord->product->name) }}
@if ($barcode)
{!! DNS1D::getBarcodeHTML($barcode, 'C128', $barcodeScale, 33) !!}
{{ $barcode }}
@endif @if ($showPrice)
{{ number_format($currentRecord->price, 2) }}
@endif