- Przycisk "Drukuj" w prepare.php i show.php z AJAX + duplikat protection - Bulk print z listy zamówień (checkboxy + header action) - Kolejka wydruku w Ustawienia > Drukowanie (filtr statusu, retry) - POST /api/print/jobs/bulk endpoint (package_ids + order_ids) - ensureLabel() auto-download przez ShipmentProviderRegistry - Apaczka carrier_id = nazwa usługi, kolumna Przewoznik - Tab persistence (localStorage), label file_exists check - Fix use statement ApaczkaApiClient, redirect po utworzeniu przesyłki - Phase 17 (receipt duplicate guard) + Phase 18 (print queue backend) docs Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
3.1 KiB
3.1 KiB
phase, plan, subsystem, tags, requires, provides, affects, tech-stack, key-files, key-decisions, patterns-established, duration, started, completed
| phase | plan | subsystem | tags | requires | provides | affects | tech-stack | key-files | key-decisions | patterns-established | duration | started | completed | |||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 17-receipt-duplicate-guard | 01 | ui |
|
|
|
|
|
|
|
5min | 2026-03-22T00:00:00Z | 2026-03-22T00:05:00Z |
Phase 17 Plan 01: Receipt Duplicate Guard Summary
Frontend guard preventing accidental duplicate receipt creation — warning box + OrderProAlerts.confirm before submit when order already has receipts.
Performance
| Metric | Value |
|---|---|
| Duration | ~5min |
| Tasks | 2 completed |
| Files modified | 2 |
Acceptance Criteria Results
| Criterion | Status | Notes |
|---|---|---|
| AC-1: Formularz pokazuje ostrzeżenie gdy zamówienie ma paragon | Pass | Warning box z numerem, datą, kwotą, configiem |
| AC-2: Submit wymaga potwierdzenia gdy istnieją paragony | Pass | button type="button" + OrderProAlerts.confirm |
| AC-3: Brak ostrzeżenia gdy zamówienie nie ma paragonów | Pass | Warunek PHP $hasExistingReceipts, normalny submit |
Accomplishments
- Warning box
.alert--warningz listą istniejących paragonów (numer, data, kwota, config) - Conditional submit:
type="button"+OrderProAlerts.confirm()gdy istnieją paragony, normalnytype="submit"gdy brak - Reuse istniejącego
ReceiptRepository::findByOrderId()— zero nowego kodu backend poza 2 liniami
Files Created/Modified
| File | Change | Purpose |
|---|---|---|
src/Modules/Accounting/ReceiptController.php |
Modified | Dodanie findByOrderId() query + przekazanie existingReceipts do widoku |
resources/views/orders/receipt-create.php |
Modified | Warning box, conditional button type, inline JS z OrderProAlerts.confirm |
Decisions Made
| Decision | Rationale | Impact |
|---|---|---|
| Frontend guard only (brak blokady w store()) | Użytkownik świadomie potwierdza — to wystarczający level ochrony | Prostota, brak zmian w logice zapisu |
| Conditional button type zamiast always-JS | Brak narzutu JS gdy nie ma istniejących paragonów | Czystsza implementacja |
Deviations from Plan
None — plan executed exactly as written.
Issues Encountered
None.
Next Phase Readiness
Ready:
- Punkt 31 z todo.md zrealizowany
- Pattern duplicate-guard gotowy do reuse w innych formularzach
Concerns:
- Brak
Blockers:
- None
Phase: 17-receipt-duplicate-guard, Plan: 01 Completed: 2026-03-22