Phase 08 — DB Foundation: - 3 new tables: receipt_configs, receipts, receipt_number_counters - company_settings extended with BDO, REGON, KRS, logo fields Phase 09 — Receipt Config: - CRUD for receipt configurations (Settings > Accounting) - ReceiptConfigController + ReceiptConfigRepository Phase 10 — Receipt Issuing: - ReceiptRepository with atomic numbering (INSERT ON DUPLICATE KEY UPDATE) - ReceiptController with snapshot pattern (seller/buyer/items as JSON) - "Wystaw paragon" button in order view - Documents tab showing both receipts and marketplace documents - Activity log entry on receipt creation Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
5.7 KiB
5.7 KiB
phase, plan, subsystem, tags, requires, provides, affects, tech-stack, key-files, key-decisions, patterns-established, duration, completed
| phase | plan | subsystem | tags | requires | provides | affects | tech-stack | key-files | key-decisions | patterns-established | duration | completed | ||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 10-receipt-issue | 01 | accounting |
|
|
|
|
|
|
|
|
~25min | 2026-03-15 |
Phase 10 Plan 01: Wystawianie paragonow z zamowienia Summary
Pelny flow wystawiania paragonow: przycisk w zamowieniu, formularz z podgladem pozycji/sprzedawcy, zapis z atomowym numerowaniem i snapshotami, lista w zakladce Dokumenty + wpis w historii.
Performance
| Metric | Value |
|---|---|
| Duration | ~25min |
| Completed | 2026-03-15 |
| Tasks | 3 auto + 1 checkpoint |
| Files created | 3 |
| Files modified | 5 |
Acceptance Criteria Results
| Criterion | Status | Notes |
|---|---|---|
| AC-1: Przycisk "Wystaw paragon" w widoku zamowienia | Pass | Widoczny tylko gdy sa aktywne konfiguracje |
| AC-2: Formularz wystawiania paragonu | Pass | Select konfiguracji, tabela pozycji, podglad sprzedawcy, data wystawienia |
| AC-3: Zapis paragonu z atomowym numerowaniem | Pass | INSERT ON DUPLICATE KEY UPDATE, snapshoty JSON |
| AC-4: Lista paragonow w zakladce Dokumenty | Pass | Paragony + dokumenty zewnetrzne w osobnych sekcjach |
| AC-5: Walidacja — brak duplikatow i brak pustych konfiguracji | Pass | Przycisk ukryty bez konfiguracji, walidacja config_id |
Accomplishments
- Nowy modul
App\Modules\Accountingz ReceiptRepository i ReceiptController - Atomowe numerowanie paragonow przez receipt_number_counters (INSERT ON DUPLICATE KEY UPDATE)
- Snapshoty seller/buyer/items jako JSON — dane zamrozone w momencie wystawienia
- Zakladka Dokumenty wyswietla zarowno paragony jak i dokumenty zewnetrzne z marketplace
Files Created/Modified
| File | Change | Purpose |
|---|---|---|
src/Modules/Accounting/ReceiptRepository.php |
Created | CRUD na receipts + atomowe numerowanie |
src/Modules/Accounting/ReceiptController.php |
Created | Formularz tworzenia + zapis paragonu + activity log |
resources/views/orders/receipt-create.php |
Created | Widok formularza wystawiania paragonu |
src/Modules/Orders/OrdersController.php |
Modified | Dodano ?ReceiptRepository, ?ReceiptConfigRepository do konstruktora + show() |
resources/views/orders/show.php |
Modified | Przycisk "Wystaw paragon", zakladka Dokumenty z paragony + dokumenty zewnetrzne |
routes/web.php |
Modified | Instancje ReceiptRepository/ReceiptController, 2 nowe trasy |
resources/lang/pl.php |
Modified | Tlumaczenia receipts.create., receipts.documents., receipt_issued |
DOCS/ARCHITECTURE.md |
Modified | Klasy Accounting, przeplyw wystawiania paragonu |
Deviations from Plan
Summary
| Type | Count | Impact |
|---|---|---|
| Scope additions | 2 | User feedback — activity log + dokumenty zewnetrzne |
Total impact: Dwa uzasadnione rozszerzenia poza planem, poprawiajace UX.
Scope Additions
1. Activity log po wystawieniu paragonu
- Source: User feedback podczas checkpoint
- Issue: Brak wpisu w historii zmian zamowienia po wystawieniu paragonu
- Fix: Dodano recordActivity() z typem
receipt_issued+ tlumaczenie - Files: ReceiptController.php, resources/lang/pl.php
2. Dokumenty zewnetrzne w zakladce Dokumenty
- Source: User feedback — licznik Dokumenty(2) ale widoczny tylko 1 paragon
- Issue: Zakladka wyswietlala tylko paragony, nie dokumenty z order_documents
- Fix: Dodano sekcje "Dokumenty zewnetrzne" z tabela order_documents
- Files: resources/views/orders/show.php
Issues Encountered
| Issue | Resolution |
|---|---|
| Duplikacja instancji ReceiptConfigRepository/ReceiptRepository w web.php | Przeniesiono tworzenie przed ordersController, usunieto duplikaty |
Next Phase Readiness
Ready:
- ReceiptRepository::findById() gotowe pod podglad paragonu (faza 11)
- Snapshoty JSON (seller, buyer, items) gotowe do renderowania HTML/PDF
- receipt_number unikalne — gotowe do wyswietlania
Concerns:
- Brak
Blockers:
- Brak
Phase: 10-receipt-issue, Plan: 01 Completed: 2026-03-15