diff --git a/.paul/PROJECT.md b/.paul/PROJECT.md index accbfc1..3b83814 100644 --- a/.paul/PROJECT.md +++ b/.paul/PROJECT.md @@ -13,7 +13,7 @@ Sprzedawca moĹĽe obsĹ‚ugiwać zamĂłwienia ze wszystkich kanałów | Attribute | Value | |-----------|-------| | Version | 3.7.0-dev | -| Status | v3.7 in progress — Phase 113 (Fakturownia Integration Foundation) shipped | +| Status | v3.7 in progress — Phases 113 (Fakturownia Foundation) + 114 (Accounting Configs Refactor) shipped | | Last Updated | 2026-05-10 | ## Requirements @@ -117,6 +117,7 @@ Sprzedawca moĹĽe obsĹ‚ugiwać zamĂłwienia ze wszystkich kanałów - [x] Re-import zamowienia (Allegro + shopPRO) wykrywa tranzycje payment_status 0/1->2 i emituje `payment.status_changed` (chain reguly #7 zmienia status na `w_realizacji`); naprawa luki dla zamowien zaimportowanych przed potwierdzeniem platnosci (case #864) + backfill CLI — Phase 111 - [x] Re-import istniejacego zamowienia jest delta-only: skip dla pozycji/adresow/notatek (stabilne `order_items.id`, ochrona `project_generated`), zawezony `updateOrderDelta()`, propagacja anulowania ze zrodla, identical-payload no-op guard (case #882) — Phase 112 - [x] Fundament v3.7 Invoices: tabele `invoices`, `invoice_configs`, `invoice_number_counters`, `fakturownia_integration_settings` + `orders.invoice_requested`; CRUD kont Fakturowni z testem polaczenia API (`/settings/integrations/fakturownia`); karta w hubie integracji — Phase 113 +- [x] Ksiegowosc: refaktor `/settings/accounting` na hub-rozdroze + osobne podstrony `/receipts` i `/invoices` + edycja na osobnym widoku; pelen CRUD `invoice_configs` z opcja delegacji do Fakturowni (conditional integration_id, serwerowa walidacja); seed `Domyslny VAT`; globalny modul `confirm-delete.js` — Phase 114 ### Deferred @@ -209,6 +210,10 @@ PHP (XAMPP/Laravel), integracje z API marketplace'Ăłw (Allegro, Erli) oraz API | Faktury: lokalna numeracja domyslna, delegacja przez `invoice_configs.is_delegated` | Pelna kontrola w default; opcja outsourcingu numeracji+PDF do Fakturowni gdy ksiegowy tak chce | 2026-05-10 | Active | | Brak eventu automatyzacji `invoice.created` (na start v3.7) | `receipt.created` pozostaje czysty — regula wysylki paragonu mailem nie zostanie odpalona dla faktury; mozliwe rozszerzenie jako osobny plan w przyszlosci | 2026-05-10 | Active | | Migracje no-op zawsze jako DDL (np. `ALTER TABLE COMMENT`), nigdy `SELECT 1;` | `SELECT` zwraca result set i pod PDO unbuffered blokuje kolejne migracje (SQLSTATE 2014) | 2026-05-10 | Active | +| Ksiegowosc: osobne podstrony `/settings/accounting/{receipts\|invoices}` zamiast tabow/jednej strony | Dlugie listy + rosnacy form faktury (conditional fields delegacji) nie mieszczace sie na jednej stronie | 2026-05-10 | Active | +| Legacy aliasy starych endpointow `/settings/accounting/save\|toggle\|delete` jako duplicate routes | Brak inwentaryzacji zewnetrznych referencji/bookmarkow - zero kosztu utrzymania, pelna wsteczna kompatybilnosc | 2026-05-10 | Active | +| `OrderProAlerts.confirm` to options-object API (`{title, message, onConfirm, danger, confirmLabel}`), nie pozycyjne argumenty | Pozycyjne wywolanie cicho fail'uje - callback ginie. Bug znaleziony w Phase 114-01 podczas smoke testu user. Pattern dla wszystkich przyszlych confirm dialogow | 2026-05-10 | Active | +| Globalny `confirm-delete.js` z `data-confirm-bound='1'` idempotent guard | Stare widoki maja inline scripts robiace to samo - guard zapobiega podwojnemu bindowi gdy modul globalny widzi juz-bound buttony. Mozna stopniowo migrowac stare widoki | 2026-05-10 | Active | ## Success Metrics @@ -240,6 +245,6 @@ Quick Reference: --- *PROJECT.md — Updated when requirements or context change* -*Last updated: 2026-05-10 after Phase 113 (Fakturownia Integration Foundation) completion; v3.7 Invoices milestone in progress* +*Last updated: 2026-05-10 after Phase 114 (Accounting Configs Refactor) completion; v3.7 Invoices milestone in progress* diff --git a/.paul/ROADMAP.md b/.paul/ROADMAP.md index 353b28d..7ac3d9f 100644 --- a/.paul/ROADMAP.md +++ b/.paul/ROADMAP.md @@ -13,10 +13,10 @@ Wystawianie faktur dla klientow z NIP poprzez integracje z Fakturownia (app.fakt | Phase | Name | Plans | Status | |-------|------|-------|--------| | 113 | Fakturownia Integration Foundation | 1/1 | Complete (2026-05-10) | -| 114 | Receipt Config Edit Refactor + Invoice Configs CRUD | 0/? | Planning | +| 114 | Accounting Configs Refactor (hub + osobne podstrony receipts/invoices) | 1/1 | Complete (2026-05-10) | +| 115 | Wystawianie faktury z zamowienia (lokalne + delegacja Fakturownia) | 0/? | Planning | Planowane kolejne fazy v3.7 (do dokladnego rozplanowania): -- Wystawianie faktury z zamowienia (lokalne + delegacja Fakturownia) - Lista faktur w sekcji Ksiegowosc + podglad/wydruk PDF - `orders.invoice_requested` w importerach Allegro/shopPRO + toggle w UI zamowienia @@ -492,4 +492,4 @@ Archive: `.paul/milestones/v0.1-ROADMAP.md` --- *Roadmap created: 2026-03-12* -*Last updated: 2026-05-10 - Phase 113 (Fakturownia Integration Foundation) complete; v3.7 milestone in progress* +*Last updated: 2026-05-10 - Phase 114 (Accounting Configs Refactor) complete; v3.7 milestone in progress* diff --git a/.paul/STATE.md b/.paul/STATE.md index cba0d7c..576fb74 100644 --- a/.paul/STATE.md +++ b/.paul/STATE.md @@ -5,46 +5,45 @@ See: .paul/PROJECT.md (updated 2026-05-07) **Core value:** Sprzedawca moze obslugiwac zamowienia ze wszystkich kanalow sprzedazy i nadawac przesylki bez przelaczania sie miedzy platformami. -**Current focus:** v3.7 Invoices — Phase 113 (Fakturownia Integration Foundation) shipped; nastepna faza 114 (Receipt Config Edit Refactor + Invoice Configs CRUD) do zaplanowania +**Current focus:** v3.7 Invoices — Phase 113 + 114 shipped; nastepna faza 115 (wystawianie faktury z zamowienia) do zaplanowania ## Current Position Milestone: v3.7 Invoices (Fakturownia integration) — In progress -Phase: 114 of TBD (Receipt Config Edit Refactor + Invoice Configs CRUD) — Not started +Phase: 115 of TBD (Wystawianie faktury z zamowienia) — Not started Plan: pending -Status: Phase 113 complete; ready to plan Phase 114 -Last activity: 2026-05-10 — UNIFY 113-01 complete, Phase 113 closed, transition done +Status: Phase 114 complete (transition done); ready to plan Phase 115 +Last activity: 2026-05-10 — UNIFY 114-01 complete, Phase 114 closed, transition done Progress: -- Milestone v3.7: [██░░░░░░░░] ~15% (Phase 113 z planowanych ~5) -- Phase 113: [██████████] 100% — Complete +- Milestone v3.7: [███░░░░░░░] ~30% (Phase 113 + 114 zamkniete; planowane ~5 faz) +- Phase 114: [██████████] 100% — Complete ## Loop Position Current loop state: ``` v3.7 milestone: - Phase 113 (Fakturownia Integration Foundation): - Plan 113-01: PLAN ✓ → APPLY ✓ → UNIFY ✓ - -> Phase 113 closed (transition complete) - Phase 114 (Receipt Config Edit Refactor + Invoice Configs CRUD): not started + Phase 113 (Fakturownia Integration Foundation): Complete + Phase 114 (Accounting Configs Refactor): Complete + Phase 115 (Wystawianie faktury z zamowienia): not started ``` ``` PLAN ──▶ APPLY ──▶ UNIFY - ✓ ✓ ✓ [Phase 113 closed; ready for Phase 114 plan] + ✓ ✓ ✓ [Phase 114 closed; ready for Phase 115 plan] ``` ## Session Continuity Last session: 2026-05-10 -Stopped at: Phase 113 transition complete (PROJECT.md/ROADMAP.md updated, SUMMARY zapisany) -Next action: /paul:plan dla Phase 114 (Receipt Config Edit Refactor + Invoice Configs CRUD) -Resume file: .paul/phases/113-fakturownia-integration/113-01-SUMMARY.md +Stopped at: Phase 114 transition complete (PROJECT.md + ROADMAP.md updated, SUMMARY zapisany) +Next action: /paul:plan dla Phase 115 (wystawianie faktury z zamowienia, lokalna numeracja + delegacja Fakturownia) +Resume file: .paul/phases/114-accounting-configs-refactor/114-01-SUMMARY.md ## Git State -Last commit: (pending — feat(113): fakturownia integration foundation) +Last commit: 2382018 feat(113): fakturownia integration foundation Branch: main Feature branches merged: none diff --git a/.paul/changelog/2026-05-10.md b/.paul/changelog/2026-05-10.md index 45ad893..8de98c3 100644 --- a/.paul/changelog/2026-05-10.md +++ b/.paul/changelog/2026-05-10.md @@ -2,6 +2,14 @@ ## Co zrobiono +- [Phase 114, Plan 01] Accounting Configs Refactor — `/settings/accounting` jako hub-rozdroze, osobne podstrony Paragony/Faktury, pelen CRUD `invoice_configs` z delegacja do Fakturowni +- Phase 114 Task 1: migracja seed `Domyslny VAT` (idempotentna NOT EXISTS) + `InvoiceConfigRepository` z walidacja delegacji +- Phase 114 Task 2: `InvoiceConfigController` + widoki listy/edycji + `invoice-config-form.js` (conditional integration_id select) + 6 routes +- Phase 114 Task 3: `ReceiptConfigController` refactor (hub/list/edit split) + hub view + 2 widoki paragonow + legacy aliasy + docs +- Auto-fix: globalny `confirm-delete.js` zastapil rozsiane inline scripts (po user feedback "Usuwanie konfiguracji faktur nie dziala") +- Auto-fix: `OrderProAlerts.confirm` poprawiony z pozycyjnych argumentow na options-object API +- Phase 114 transition: PROJECT.md (4 nowe Key Decisions) + ROADMAP.md zaktualizowane + - [Phase 113, Plan 01] Fakturownia Integration Foundation — fundament v3.7 Invoices - Task 1: 3 migracje SQL (invoices, invoice_configs, invoice_number_counters, fakturownia_integration_settings, orders.invoice_requested) - Task 2: FakturowniaIntegrationRepository + FakturowniaApiClient (testConnection + STUB createInvoice/downloadPdf) + IntegrationsRepository::updateTestResult() @@ -13,6 +21,20 @@ ## Zmienione pliki +- `database/migrations/20260511_000107_seed_default_invoice_config.sql` +- `src/Modules/Settings/InvoiceConfigRepository.php` +- `src/Modules/Settings/InvoiceConfigController.php` +- `src/Modules/Settings/ReceiptConfigController.php` +- `resources/views/settings/accounting.php` +- `resources/views/settings/accounting-receipts.php` +- `resources/views/settings/accounting-receipt-edit.php` +- `resources/views/settings/accounting-invoices.php` +- `resources/views/settings/accounting-invoice-edit.php` +- `resources/views/layouts/app.php` +- `public/assets/js/modules/invoice-config-form.js` +- `public/assets/js/modules/confirm-delete.js` +- `.paul/phases/114-accounting-configs-refactor/114-01-PLAN.md` +- `.paul/phases/114-accounting-configs-refactor/114-01-SUMMARY.md` - `database/migrations/20260510_000104_create_invoices_tables.sql` - `database/migrations/20260510_000105_add_invoice_requested_to_orders.sql` - `database/migrations/20260510_000106_seed_fakturownia_integration_type.sql` diff --git a/.paul/codebase/architecture.md b/.paul/codebase/architecture.md index 182ef05..088614e 100644 --- a/.paul/codebase/architecture.md +++ b/.paul/codebase/architecture.md @@ -203,3 +203,32 @@ tests/ ### IntegrationsHubController - Nowy parametr konstruktora `FakturowniaIntegrationRepository $fakturownia` i nowa metoda `buildFakturowniaRow()` agregująca status wszystkich kont (count instancji, configured/active counts, ostatni test). +## Phase 114 — Accounting Configs Refactor + +### Sekcja Ksiegowosc — struktura URL +- `/settings/accounting` — hub-rozdroze z 2 kartami: "Paragony" i "Faktury". `ReceiptConfigController::hub()`. +- `/settings/accounting/receipts` — lista konfiguracji paragonow. `ReceiptConfigController::list()`. +- `/settings/accounting/receipts/new`, `/edit?id=N` — formularz na osobnej podstronie. `ReceiptConfigController::edit()`. +- `/settings/accounting/receipts/save|toggle|delete` — POST actions. +- **Legacy aliasy:** `/settings/accounting/save|toggle|delete` (POST) zostaja jako duplicate routes (wsteczna kompatybilnosc z `