feat: Add A6 PDF QR stickers with human-readable order info

Implement QrStickerService to generate both SVG (web) and PDF (print) stickers:

- Generate 32x32mm QR codes using SimpleSoftwareIO
- Create A6 (148mm  105mm) PDF stickers using DomPDF
- Include human-readable info: order number, customer, status, date, tracking
- Store order type (STOCK/CUSTOM) with visual badge
- Add generation timestamp to footer

Create stickers/qr-sticker.blade.php template:
- Two-column layout: info left, QR right
- Styled for A6 landscape printing
- Shows order number, customer, status, date, tracking info
- QR code positioned for easy scanning
- Print-optimized CSS

Update GenerateQrCodeOnOrderCreated listener:
- Now calls QrStickerService::generateSticker()
- Generates both SVG and PDF on OrderCreated event
- Logs paths to both formats

Add OpsController::downloadSticker() endpoint:
- GET /ops/orders/{id}/sticker/download
- Returns PDF with filename QR-{order_number}.pdf
- Requires ops access authorization
- Logs all downloads with user context

Update ops order-detail view:
- Add download button for A6 sticker PDF
- Position next to QR code display
- Link to new sticker download route
This commit is contained in:
twotalesanimation
2026-01-02 19:51:23 +02:00
parent bb6b92df10
commit 3040681842
6 changed files with 394 additions and 19 deletions
+8 -1
View File
@@ -31,7 +31,14 @@
<!-- QR Code -->
<div class="border-t pt-6">
<p class="text-sm text-gray-600 mb-3">Scan to access this order:</p>
<div class="flex items-start justify-between mb-3">
<div>
<p class="text-sm text-gray-600 mb-3">Scan to access this order:</p>
</div>
<a href="{{ route('ops.order.sticker.download', $order) }}" class="inline-flex items-center px-3 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 text-sm">
📥 Download Sticker (A6 PDF)
</a>
</div>
<div class="inline-block bg-gray-50 p-4 rounded border">
{!! file_get_contents(storage_path("app/public/qr-codes/{$order->uuid}.svg")) !!}
</div>