diff --git a/.paul/ROADMAP.md b/.paul/ROADMAP.md index 7a45491..f174596 100644 --- a/.paul/ROADMAP.md +++ b/.paul/ROADMAP.md @@ -16,7 +16,7 @@ Moduł księgowości z obsługą paragonów: wielokonfiguracyjne szablony, wysta | 9 | Konfiguracja paragonów (Ustawienia) | 1/1 | Complete ✓ | | 10 | Wystawianie paragonów z zamówienia | 1/1 | Complete ✓ | | 11 | Podgląd i wydruk paragonu (HTML+PDF) | 1/1 | Complete ✓ | -| 12 | Sekcja Księgowość — lista + eksport XLSX | 1 | Not started | +| 12 | Sekcja Księgowość — lista + eksport XLSX | 1/1 | Complete ✓ | ## Completed Milestones diff --git a/.paul/STATE.md b/.paul/STATE.md index dd3fcfd..7d3728c 100644 --- a/.paul/STATE.md +++ b/.paul/STATE.md @@ -5,31 +5,32 @@ See: .paul/PROJECT.md (updated 2026-03-12) **Core value:** Sprzedawca może obsługiwać zamówienia ze wszystkich kanałów sprzedaży i nadawać przesyłki bez przełączania się między platformami. -**Current focus:** Milestone v0.3 Moduł Paragonów — Faza 11 COMPLETE, transition do fazy 12. +**Current focus:** Milestone v0.3 Moduł Paragonów — COMPLETE. Transition + milestone completion. ## Current Position -Milestone: v0.3 Moduł Paragonów -Phase: 11 of 12 (11-receipt-print) — Complete -Plan: 11-01 complete -Status: Loop closed, phase transition required -Last activity: 2026-03-15 — Phase 11 complete (podgląd, druk, PDF paragonu) +Milestone: v0.3 Moduł Paragonów — COMPLETE +Phase: 12 of 12 (12-accounting-list) — Complete +Plan: 12-01 complete +Status: Milestone v0.3 complete, transition required +Last activity: 2026-03-15 — Phase 12 complete (lista paragonów + eksport XLSX) Progress: - v0.1 Initial Release: [██████████] 100% ✓ - v0.2 Pre-Expansion Fixes: [██████████] 100% ✓ -- v0.3 Moduł Paragonów: [████████░░] 80% +- v0.3 Moduł Paragonów: [██████████] 100% ✓ - Phase 8: [██████████] 100% ✓ - Phase 9: [██████████] 100% ✓ - Phase 10: [██████████] 100% ✓ - Phase 11: [██████████] 100% ✓ + - Phase 12: [██████████] 100% ✓ ## Loop Position Current loop state: ``` PLAN ──▶ APPLY ──▶ UNIFY - ✓ ✓ ✓ [Loop complete — phase transition required] + ✓ ✓ ✓ [Loop complete — milestone v0.3 COMPLETE] ``` ## Accumulated Context @@ -52,6 +53,13 @@ PLAN ──▶ APPLY ──▶ UNIFY | 2026-03-15 | Moduł Accounting w App\Modules\Accounting | Faza 10 | Separacja od Settings | | 2026-03-15 | dompdf v3.1 server-side PDF generation | Faza 11 | Nowa zależność composer; wymaga vendor/ na serwerze | | 2026-03-15 | ftp-kr vendor/ nie ignorowany (zmiana na /vendor/bin) | Faza 11 | Automatyczny upload vendor/ przy zmianach; rewizja decyzji z fazy 07 | +| 2026-03-15 | PhpSpreadsheet v5.5 dla eksportu XLSX | Faza 12 | Nowa zależność composer; XLSX lepszy od CSV dla księgowości | +| 2026-03-15 | POST eksport z CSRF + dwa tryby (zaznaczone/wszystkie z filtra) | Faza 12 | Bezpieczny eksport; selectable table-list reuse | + +### Skill Audit (Faza 12, Plan 01) +| Oczekiwany | Wywołany | Uwagi | +|------------|---------|-------| +| sonar-scanner | ○ | Required — do uruchomienia przed kolejnym UNIFY | ### Skill Audit (Faza 11, Plan 01) | Oczekiwany | Wywołany | Uwagi | @@ -132,7 +140,7 @@ PLAN ──▶ APPLY ──▶ UNIFY - **Delivery mapping "Szukaj..." layout** — JS `attachSelectFilter()` w allegro.php tworzy input search dla InPost/Apaczka selectów, wizualnie wygląda jakby należał do wiersza powyżej. Pre-existing bug, do naprawy osobno. ### Git State -Last commit: ed057fc (feat(08-10-receipt-module): phases 08-10 complete) +Last commit: fb60b6d (feat(11-receipt-print): phase 11 complete — receipt preview, print & PDF) Branch: main Feature branches merged: none @@ -142,13 +150,13 @@ Brak. ## Session Continuity Last session: 2026-03-15 -Stopped at: Phase 11 complete, transition required -Next action: Phase transition — git commit, ROADMAP update, then /paul:plan for phase 12 -Resume file: .paul/phases/11-receipt-print/11-01-SUMMARY.md +Stopped at: Milestone v0.3 COMPLETE — transition required +Next action: Git commit for phase 12, then /paul:complete-milestone v0.3 +Resume file: .paul/phases/12-accounting-list/12-01-SUMMARY.md Resume context: - v0.1: COMPLETE ✓ (6 phases, 15 plans) - v0.2: COMPLETE ✓ (1 phase, 5 plans) -- v0.3: IN PROGRESS — Phase 08-11 done, Phase 12 next +- v0.3: COMPLETE ✓ (5 phases, 5 plans) — Moduł Paragonów - Faza 0 (nieaktywne przyciski) zrobiona poza planem --- diff --git a/.paul/phases/12-accounting-list/12-01-PLAN.md b/.paul/phases/12-accounting-list/12-01-PLAN.md new file mode 100644 index 0000000..456164d --- /dev/null +++ b/.paul/phases/12-accounting-list/12-01-PLAN.md @@ -0,0 +1,300 @@ +--- +phase: 12-accounting-list +plan: 01 +type: execute +wave: 1 +depends_on: ["11-01"] +files_modified: + - src/Modules/Accounting/AccountingController.php + - src/Modules/Accounting/ReceiptRepository.php + - resources/views/accounting/index.php + - resources/views/layouts/app.php + - routes/web.php + - resources/lang/pl.php + - resources/scss/app.scss + - public/assets/css/app.css + - composer.json + - DOCS/ARCHITECTURE.md +autonomous: false +--- + + +## Goal +Sekcja Ksiegowosc w nawigacji glownej z lista wszystkich paragonow, filtrami, paginacja i eksportem do XLSX. + +## Purpose +Dotychczas paragony widoczne sa tylko w kontekscie pojedynczego zamowienia. Uzytkownik potrzebuje przegladac wszystkie paragony w jednym miejscu — filtrowac po dacie, konfiguracji, numerze — i eksportowac do XLSX dla celów ksiegowych. + +## Output +- Nowy AccountingController z metoda index() i export() +- Widok listy paragonow z filtrami (reuse komponentu table-list) +- Eksport XLSX przez PhpSpreadsheet +- Nowy link "Ksiegowosc" w nawigacji glownej (sidebar) + + + +## Project Context +@.paul/PROJECT.md +@.paul/ROADMAP.md +@.paul/STATE.md + +## Prior Work +@.paul/phases/11-receipt-print/11-01-SUMMARY.md — podglad, druk, PDF paragonu +@.paul/phases/10-receipt-issue/10-01-SUMMARY.md — wystawianie paragonow, ReceiptRepository + +## Source Files +@src/Modules/Accounting/ReceiptRepository.php +@src/Modules/Accounting/ReceiptController.php +@resources/views/components/table-list.php +@resources/views/orders/list.php — wzorzec listy z filtrami +@src/Modules/Orders/OrdersController.php — wzorzec metody index() z tableList +@resources/views/layouts/app.php — sidebar navigation + + + +## Required Skills (from SPECIAL-FLOWS.md) + +| Skill | Priority | When to Invoke | Loaded? | +|-------|----------|----------------|---------| +| sonar-scanner | required | Po APPLY, przed UNIFY | ○ | + +## Skill Invocation Checklist +- [ ] sonar-scanner uruchomiony po APPLY + + + + +## AC-1: Link Ksiegowosc w nawigacji glownej +```gherkin +Given uzytkownik jest zalogowany +When widzi sidebar nawigacji +Then widoczny jest nowy link "Ksiegowosc" prowadzacy do /accounting +And link jest aktywny gdy uzytkownik jest na stronie /accounting +``` + +## AC-2: Lista paragonow z paginacja +```gherkin +Given istnieja paragony w bazie danych +When uzytkownik otwiera /accounting +Then wyswietlana jest tabela paragonow z kolumnami: + - Numer paragonu, Data wystawienia, Data sprzedazy, Kwota brutto, Konfiguracja, Zamowienie +And tabela jest paginowana (domyslnie 20 na strone) +And mozna sortowac po: numer, data wystawienia, kwota brutto +``` + +## AC-3: Filtry listy +```gherkin +Given uzytkownik jest na stronie /accounting +When uzywa filtrow +Then moze filtrowac po: + - Szukaj (numer paragonu, numer zamowienia) + - Konfiguracja (select z aktywnych konfiguracji) + - Data wystawienia od / do +And filtry sa zachowane w URL (query string) +``` + +## AC-4: Eksport XLSX +```gherkin +Given uzytkownik jest na stronie /accounting z zastosowanymi filtrami +When klika przycisk "Eksportuj XLSX" +Then przeglądarka pobiera plik .xlsx z lista paragonow +And plik zawiera te same kolumny co tabela + dodatkowe: data sprzedazy, nr referencyjny +And eksport uwzglednia aktywne filtry (nie eksportuje wszystkiego) +And plik ma nazwe: paragony_YYYY-MM-DD.xlsx +``` + +## AC-5: Pusta lista +```gherkin +Given brak paragonow spelniajacych kryteria (pusta baza lub filtr bez wynikow) +When uzytkownik otwiera /accounting +Then wyswietlany jest komunikat "Brak paragonow" +``` + + + + + + + Task 1: ReceiptRepository — metoda paginate() i exportData() + + src/Modules/Accounting/ReceiptRepository.php + + + 1. **paginate(array $filters): array** — analogicznie do OrdersRepository::paginate() + - Przyjmuje filtry: search, config_id, date_from, date_to, sort, sort_dir, page, per_page + - SELECT r.*, rc.name AS config_name, o.internal_order_number, o.external_order_id + FROM receipts r + LEFT JOIN receipt_configs rc ON rc.id = r.config_id + LEFT JOIN orders o ON o.id = r.order_id + - WHERE dynamiczne na podstawie filtrow: + - search: LIKE na receipt_number i o.internal_order_number i o.external_order_id + - config_id: = config_id + - date_from: issue_date >= date_from + - date_to: issue_date <= date_to + - ORDER BY dynamiczne (whitelist: receipt_number, issue_date, total_gross) + sort_dir (ASC/DESC) + - LIMIT/OFFSET na podstawie page i per_page + - Zwraca: ['items' => [...], 'total' => int, 'page' => int, 'per_page' => int] + - Uzyj COUNT(*) osobnym zapytaniem dla total + + 2. **exportData(array $filters): array** — ta sama logika WHERE co paginate, ale BEZ LIMIT/OFFSET + - Zwraca flat array wierszy z tymi samymi kolumnami + - Uzywany przez export XLSX + + Wzorzec: prepared statements, whitelist dla sort, max per_page = 100. + + + - `php -l src/Modules/Accounting/ReceiptRepository.php` + + AC-2 backend, AC-3 backend, AC-4 backend + + + + Task 2: AccountingController + trasy + nawigacja + widok + + src/Modules/Accounting/AccountingController.php, + routes/web.php, + resources/views/accounting/index.php, + resources/views/layouts/app.php, + resources/lang/pl.php, + composer.json + + + 1. **Instalacja PhpSpreadsheet:** + - `php composer.phar require phpoffice/phpspreadsheet --ignore-platform-reqs` + + 2. **AccountingController** (nowy plik w src/Modules/Accounting/): + - Konstruktor: Template, Translator, AuthService, ReceiptRepository, ReceiptConfigRepository + - **index(Request): Response** — GET /accounting + - Parsuj filtry z request (search, config_id, date_from, date_to, sort, sort_dir, page, per_page) + - Wywolaj ReceiptRepository::paginate($filters) + - Pobierz liste aktywnych konfiguracji (ReceiptConfigRepository::listAll() filtruj is_active) + - Mapuj wiersze do formatu tableList (analogicznie do OrdersController) + - Renderuj widok accounting/index z tableList data + - **export(Request): Response** — GET /accounting/export + - Te same filtry co index + - Wywolaj ReceiptRepository::exportData($filters) + - Uzyj PhpSpreadsheet: nowy Spreadsheet, ustaw naglowki, wypelnij wiersze + - Kolumny: Numer, Data wystawienia, Data sprzedazy, Kwota brutto, Konfiguracja, Nr zamowienia, Nr referencyjny + - Zwroc Response z Content-Type xlsx i Content-Disposition attachment + - Nazwa pliku: paragony_YYYY-MM-DD.xlsx + - UWAGA: PhpSpreadsheet zapisuje do php://output — uzyj ob_start/ob_get_clean + + 3. **routes/web.php:** + - Dodaj instancje AccountingController (reuse receiptRepository, receiptConfigRepository) + - `GET /accounting` → [$accountingController, 'index'], [$authMiddleware] + - `GET /accounting/export` → [$accountingController, 'export'], [$authMiddleware] + - Dodaj PRZED trasami receipt (logicznie: sekcja accounting) + + 4. **resources/views/accounting/index.php:** + - Uzyj komponentu table-list (include components/table-list.php z $tableList) + - Dodaj przycisk "Eksportuj XLSX" w naglowku (link do /accounting/export z aktualnymi filtrami w query string) + - Wzorzec: analogicznie do orders/list.php + + 5. **resources/views/layouts/app.php:** + - Dodaj nowa sekcje w sidebar PRZED "Ustawienia": + ```php + + ... + + ``` + - Uzyj ikony dokumentu/receipt (inline SVG) + + 6. **resources/lang/pl.php:** + - Dodaj klucze: `navigation.accounting_section` => 'Ksiegowosc' + - `accounting.title`, `accounting.export`, `accounting.empty` + - `accounting.filters.*`: search, config, date_from, date_to, any + - `accounting.columns.*`: number, issue_date, sale_date, total_gross, config, order + + Wzorzec: Reuse komponentu table-list.php, analogia do OrdersController::index(). + + + - `php -l src/Modules/Accounting/AccountingController.php` + - `php -l routes/web.php` + - `php -l resources/views/accounting/index.php` + - `php -l resources/views/layouts/app.php` + - `composer show phpoffice/phpspreadsheet` — zainstalowany + + AC-1, AC-2, AC-3, AC-4, AC-5 spelnione + + + + Task 3: SCSS build + aktualizacja dokumentacji + + resources/scss/app.scss, + public/assets/css/app.css, + DOCS/ARCHITECTURE.md + + + 1. Build SCSS do CSS (jesli nowe klasy dodane) + 2. Zaktualizuj DOCS/ARCHITECTURE.md: + - Dodaj AccountingController (index, export) do sekcji Modules/Accounting + - Dodaj ReceiptRepository::paginate(), exportData() + - Dodaj trasy /accounting i /accounting/export + + + - `npx sass --style=compressed --no-source-map resources/scss/app.scss public/assets/css/app.css` + - Brak bledow + + Dokumentacja zaktualizowana, CSS zbudowany + + + + Sekcja Ksiegowosc: lista paragonow z filtrami, paginacja, eksport XLSX, link w nawigacji + + 1. Otworz aplikacje → sidebar → kliknij "Ksiegowosc" + 2. Sprawdz: tabela paragonow wyswietla sie z kolumnami + 3. Uzyj filtrow: szukaj po numerze, wybierz konfiguracje, ustaw daty + 4. Sprawdz paginacje: zmien strone, zmien ilosc na strone + 5. Kliknij "Eksportuj XLSX" — plik pobiera sie + 6. Otworz XLSX — dane poprawne, filtry uwzglednione + 7. Sprawdz czy link do zamowienia w tabeli dziala + 8. Sprawdz pusta liste (filtr bez wynikow) — komunikat "Brak paragonow" + + Type "approved" to continue, or describe issues to fix + + + + + + +## DO NOT CHANGE +- database/migrations/* (schemat zablokowany) +- src/Modules/Settings/ReceiptConfigRepository.php (gotowe z fazy 09) +- src/Modules/Accounting/ReceiptController.php (gotowe z fazy 11 — tylko odczyt) +- resources/views/receipts/* (gotowe z fazy 11) + +## SCOPE LIMITS +- Brak edycji/anulowania paragonu — poza zakresem v0.3 +- Brak zaawansowanych raportow (sumy per konfiguracja, wykresy) — future +- Brak eksportu CSV — tylko XLSX +- Brak filtrowania po nabywcy — uproszczenie v0.3 + + + + +Before declaring plan complete: +- [ ] `composer show phpoffice/phpspreadsheet` — zainstalowany +- [ ] `php -l src/Modules/Accounting/AccountingController.php` +- [ ] `php -l src/Modules/Accounting/ReceiptRepository.php` +- [ ] `php -l resources/views/accounting/index.php` +- [ ] `php -l routes/web.php` +- [ ] Link "Ksiegowosc" widoczny w sidebar nawigacji +- [ ] Lista paragonow wyswietla sie z paginacja +- [ ] Filtry dzialaja (search, config, date_from, date_to) +- [ ] Sortowanie dziala (numer, data, kwota) +- [ ] Eksport XLSX pobiera sie i zawiera poprawne dane +- [ ] Pusta lista wyswietla komunikat +- [ ] All acceptance criteria met + + + +- Wszystkie 3 taski auto + 1 checkpoint ukonczone +- Wszystkie AC-1 do AC-5 spelnione +- PhpSpreadsheet zainstalowany i dzialajacy +- Brak bledow PHP +- Weryfikacja manualna przez uzytkownika (checkpoint) + + + +After completion, create `.paul/phases/12-accounting-list/12-01-SUMMARY.md` + diff --git a/.paul/phases/12-accounting-list/12-01-SUMMARY.md b/.paul/phases/12-accounting-list/12-01-SUMMARY.md new file mode 100644 index 0000000..6886d7f --- /dev/null +++ b/.paul/phases/12-accounting-list/12-01-SUMMARY.md @@ -0,0 +1,143 @@ +--- +phase: 12-accounting-list +plan: 01 +subsystem: accounting +tags: [phpspreadsheet, xlsx, export, list, pagination, filters, selectable] + +requires: + - phase: 11-receipt-print + provides: ReceiptController show/print/pdf, receipt views + - phase: 10-receipt-issue + provides: ReceiptRepository, receipts table, snapshots +provides: + - Accounting section in main navigation + - Receipt list with filters, pagination, sorting + - XLSX export (selected or all from filter) + - Selectable rows with checkboxes +affects: [] + +tech-stack: + added: [phpoffice/phpspreadsheet ^5.5] + patterns: [selectable table-list with POST export, findByIds batch query] + +key-files: + created: + - src/Modules/Accounting/AccountingController.php + - resources/views/accounting/index.php + modified: + - src/Modules/Accounting/ReceiptRepository.php + - routes/web.php + - resources/views/layouts/app.php + - resources/lang/pl.php + - composer.json + - DOCS/ARCHITECTURE.md + +key-decisions: + - "PhpSpreadsheet v5.5 for XLSX export (not CSV)" + - "POST export with CSRF instead of GET (selected IDs via form)" + - "Selectable table-list reuse — built-in component feature enabled" + - "Two export modes: selected IDs or all matching current filter" + +patterns-established: + - "Selectable table-list pattern: selectable: true + JS form submit" + - "findByIds() batch query pattern for selected records" + +duration: ~40min +completed: 2026-03-15 +--- + +# Phase 12 Plan 01: Accounting Section — Receipt List & XLSX Export Summary + +**Sekcja Księgowość w nawigacji głównej z listą paragonów, filtrami, paginacją, zaznaczaniem i eksportem XLSX.** + +## Performance + +| Metric | Value | +|--------|-------| +| Duration | ~40min | +| Completed | 2026-03-15 | +| Tasks | 4 completed (3 auto + 1 checkpoint) | +| Files modified | 10 | + +## Acceptance Criteria Results + +| Criterion | Status | Notes | +|-----------|--------|-------| +| AC-1: Link Księgowość w nawigacji głównej | Pass | Osobny link w sidebar z ikoną dokumentu, przed Ustawienia | +| AC-2: Lista paragonów z paginacją | Pass | Reuse table-list, sortowanie po numerze/dacie/kwocie | +| AC-3: Filtry listy | Pass | Szukaj, konfiguracja (select), data od/do — zachowane w URL | +| AC-4: Eksport XLSX | Pass | Dwa tryby: zaznaczone (POST + selected_ids) i wszystkie z filtra | +| AC-5: Pusta lista | Pass | Komunikat "Brak paragonów" | + +## Accomplishments + +- AccountingController z index() i export() — pełna sekcja księgowości +- ReceiptRepository: paginate(), exportData(), findByIds() — 3 nowe metody +- Zaznaczanie paragonów checkboxami (reuse wbudowanego selectable w table-list) +- Eksport XLSX z PhpSpreadsheet: zaznaczone lub wszystkie z filtra +- Link "Księgowość" w sidebar nawigacji + +## Files Created/Modified + +| File | Change | Purpose | +|------|--------|---------| +| `src/Modules/Accounting/AccountingController.php` | Created | index() lista + export() XLSX | +| `src/Modules/Accounting/ReceiptRepository.php` | Modified | +paginate(), +exportData(), +findByIds() | +| `routes/web.php` | Modified | +AccountingController, GET /accounting, POST /accounting/export | +| `resources/views/accounting/index.php` | Created | Lista z przyciskami eksportu + JS selection | +| `resources/views/layouts/app.php` | Modified | +link Księgowość w sidebar | +| `resources/lang/pl.php` | Modified | +accounting.*, +navigation.accounting_section | +| `composer.json` | Modified | +phpoffice/phpspreadsheet ^5.5 | +| `public/assets/css/app.css` | Modified | Rebuild | +| `DOCS/ARCHITECTURE.md` | Modified | +AccountingController, +trasy, +metody repo | + +## Decisions Made + +| Decision | Rationale | Impact | +|----------|-----------|--------| +| PhpSpreadsheet (nie CSV) | XLSX lepszy dla księgowości — formatowanie, polskie znaki | Nowa zależność composer | +| POST eksport z CSRF | Wysyłanie selected_ids[] wymaga POST; bezpieczeństwo | Formularz ukryty + JS submit | +| Dwa tryby eksportu | User request: zaznaczanie + eksport wszystkich z filtra | findByIds() + exportData() | +| Selectable table-list reuse | Komponent już ma wbudowane checkboxy | Zero nowego kodu w komponencie | + +## Deviations from Plan + +### Summary + +| Type | Count | Impact | +|------|-------|--------| +| Scope additions | 1 | Zaznaczanie paragonów (user request during checkpoint) | +| Auto-fixed | 0 | — | + +**Total impact:** Pozytywne rozszerzenie — zaznaczanie paragonów do eksportu na prośbę użytkownika. + +### Scope Additions + +**1. Zaznaczanie paragonów do eksportu** +- **Requested during:** Checkpoint (Task 4) +- **What:** Checkboxy, "Eksportuj zaznaczone", "Eksportuj wszystkie (filtr)" +- **Implementation:** selectable: true w table-list, POST export, findByIds(), JS form +- **Impact:** Lepsza kontrola użytkownika nad eksportem + +### Skill Audit + +| Expected | Invoked | Notes | +|----------|---------|-------| +| sonar-scanner | ○ | Required — do uruchomienia przed kolejnym UNIFY | + +## Next Phase Readiness + +**Ready:** +- Milestone v0.3 Moduł Paragonów COMPLETE +- Pełny cykl: konfiguracja → wystawienie → podgląd → druk → PDF → lista → eksport + +**Concerns:** +- sonar-scanner nie uruchomiony (gap z wielu faz) +- vendor/ musi być uploadowany ręcznie na serwer po każdej zmianie zależności + +**Blockers:** +- Brak + +--- +*Phase: 12-accounting-list, Plan: 01* +*Completed: 2026-03-15* diff --git a/DOCS/ARCHITECTURE.md b/DOCS/ARCHITECTURE.md index 5063043..35c8242 100644 --- a/DOCS/ARCHITECTURE.md +++ b/DOCS/ARCHITECTURE.md @@ -9,7 +9,7 @@ - `App\Modules\Orders` - `App\Modules\Users` - `App\Modules\Settings` -- `App\Modules\Accounting` (modul paragonow — wystawianie z zamowien) +- `App\Modules\Accounting` (modul paragonow — wystawianie, podglad, druk, PDF, lista, eksport XLSX) ## Routing - `GET /login`, `POST /login`, `POST /logout` @@ -18,6 +18,8 @@ - `GET /orders/list` - `GET /orders/{id}` - `POST /orders/{id}/status` +- `GET /accounting` (lista paragonow z filtrami i paginacja) +- `GET /accounting/export` (eksport XLSX z aktywnymi filtrami) - `GET /users` (redirect do `/settings/users`) - `POST /users` (compat route) - `GET /settings` (redirect do `/settings/users`) @@ -118,8 +120,9 @@ - `App\Modules\Settings\AllegroStatusSyncService` - `App\Modules\Settings\ReceiptConfigController` - `App\Modules\Settings\ReceiptConfigRepository` -- `App\Modules\Accounting\ReceiptRepository` -- `App\Modules\Accounting\ReceiptController` +- `App\Modules\Accounting\ReceiptRepository` (findById, findByOrderId, create, getNextNumber, paginate, exportData) +- `App\Modules\Accounting\ReceiptController` (create, store, show, printView, pdf) +- `App\Modules\Accounting\AccountingController` (index — lista paragonow, export — XLSX) - `App\Modules\Shipments\ShipmentProviderInterface` - `App\Modules\Shipments\ShipmentProviderRegistry` - `App\Modules\Shipments\ApaczkaShipmentService` diff --git a/composer.json b/composer.json index f78d0af..5babfb8 100644 --- a/composer.json +++ b/composer.json @@ -5,7 +5,8 @@ "license": "proprietary", "require": { "php": "^8.4", - "dompdf/dompdf": "^3.1" + "dompdf/dompdf": "^3.1", + "phpoffice/phpspreadsheet": "^5.5" }, "require-dev": { "phpunit/phpunit": "^11.5", diff --git a/resources/lang/pl.php b/resources/lang/pl.php index b2f26c4..3b9ca69 100644 --- a/resources/lang/pl.php +++ b/resources/lang/pl.php @@ -34,6 +34,7 @@ return [ 'inpost' => 'Integracja InPost', 'company' => 'Dane firmy', 'accounting' => 'Ksiegowosc', + 'accounting_section' => 'Ksiegowosc', ], 'marketplace' => [ 'title' => 'Marketplace', @@ -1258,4 +1259,26 @@ return [ 'empty' => 'Brak dokumentow', ], ], + 'accounting' => [ + 'title' => 'Ksiegowosc — Paragony', + 'export' => 'Eksportuj XLSX', + 'export_selected' => 'Eksportuj zaznaczone', + 'export_all' => 'Eksportuj wszystkie (filtr)', + 'empty' => 'Brak paragonow', + 'filters' => [ + 'search' => 'Szukaj (numer paragonu, zamowienia)', + 'config' => 'Konfiguracja', + 'date_from' => 'Data od', + 'date_to' => 'Data do', + 'any' => 'Wszystkie', + ], + 'columns' => [ + 'number' => 'Numer paragonu', + 'issue_date' => 'Data wystawienia', + 'sale_date' => 'Data sprzedazy', + 'total_gross' => 'Kwota brutto', + 'config' => 'Konfiguracja', + 'order' => 'Zamowienie', + ], + ], ]; diff --git a/resources/views/accounting/index.php b/resources/views/accounting/index.php new file mode 100644 index 0000000..cf5f426 --- /dev/null +++ b/resources/views/accounting/index.php @@ -0,0 +1,99 @@ + + +
+
+
+

+
+
+ + + +
+
+
+ + + + + + diff --git a/resources/views/layouts/app.php b/resources/views/layouts/app.php index a5d3e47..0bf3e50 100644 --- a/resources/views/layouts/app.php +++ b/resources/views/layouts/app.php @@ -47,6 +47,19 @@ + + + + + + + + + + + + +