@php $barcodeGen = app('Milon\Barcode\DNS1D'); @endphp @foreach ($printData as $data) @php $product = $data['product']; $config = $data['config']; $quantity = $data['quantity']; $perRow = $config->barcodes_per_row ?? 3; $rowsPerPage = $config->rows_per_page ?? 10; $perPage = $perRow * $rowsPerPage; $barcodeType = $config->barcode_type ?? 'C128'; $marginTop = $config->margin_top ?? 10; $marginRight = $config->margin_right ?? 10; $marginBottom = $config->margin_bottom ?? 10; $marginLeft = $config->margin_left ?? 10; $gapVertical = $config->gap_vertical ?? 5; $gapHorizontal = $config->gap_horizontal ?? 5; $width = $config->width ?? 50; $height = $config->height ?? 30; @endphp @for ($i = 0; $i < $quantity; $i++) @if ($i % $perPage == 0)
@endif {{--
{{ $product->name }} @if (!empty($product->product_code)) {!! app('Milon\Barcode\DNS1D')->getBarcodeHTML($product->product_code, $barcodeType, 1.5, 30) !!} @else
Missing Barcode
@endif
{{ $product->product_code }}
--}}
@if ($config->product_name_show) {{ $product->name }} @endif @if (!empty($product->product_code)) @if ($barcodeType == 'C39' && !isValidCode39($product->product_code))
Invalid characters
@else {!! app('Milon\Barcode\DNS1D')->getBarcodeHTML($product->product_code, $barcodeType, 1.5, 30) !!} @endif @else
Missing Barcode
@endif @if ($config->code_show)
{{ $product->product_code }}
@endif @if ($config->price_show)
{{ numberformat($data['add_vat'] ? $product->priceWithVat : $product->sale_price) }}
@endif @if ($config->vat_include_show)
(Vat {{ $data['add_vat'] ? 'Included' : 'Excluded' }})
@endif @if ($config->company_show && !empty($data['company']))
{{ $data['company']->company_name }}
@endif
@if (($i + 1) % $perPage == 0 || $i == $quantity - 1)
@endif @endfor @endforeach