update
This commit is contained in:
@@ -72,6 +72,7 @@ Sprzedawca może obsługiwać zamówienia ze wszystkich kanałów
|
|||||||
- [x] Aktywacja przycisku Platnosc w headerze zamowienia + poprawa odstepu w formularzu platnosci — Phase 61
|
- [x] Aktywacja przycisku Platnosc w headerze zamowienia + poprawa odstepu w formularzu platnosci — Phase 61
|
||||||
- [x] Ochrona danych lokalnych przy re-imporcie + rozroznienie import/aktualizacja w activity log shopPRO — Phase 62
|
- [x] Ochrona danych lokalnych przy re-imporcie + rozroznienie import/aktualizacja w activity log shopPRO — Phase 62
|
||||||
- [x] Import i wyswietlanie personalizacji produktow z shopPRO (custom_fields) + naprawa daty zamowienia — Phase 63
|
- [x] Import i wyswietlanie personalizacji produktow z shopPRO (custom_fields) + naprawa daty zamowienia — Phase 63
|
||||||
|
- [x] Data wystawienia paragonu z dokladnoscia do godziny i minuty (DATE -> DATETIME) — Phase 64
|
||||||
|
|
||||||
### Active (In Progress)
|
### Active (In Progress)
|
||||||
|
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ Wersja mobilna aplikacji, modul po module. Cel: pelna uzywalnosc orderPRO na tel
|
|||||||
| 61 | Payment Button Activation | 1/1 | Complete |
|
| 61 | Payment Button Activation | 1/1 | Complete |
|
||||||
| 62 | Import Re-import Safety | 1/1 | Complete |
|
| 62 | Import Re-import Safety | 1/1 | Complete |
|
||||||
| 63 | Order Item Personalization | 1/1 | Complete |
|
| 63 | Order Item Personalization | 1/1 | Complete |
|
||||||
|
| 64 | Receipt Datetime Precision | 1/1 | Complete |
|
||||||
| TBD | Mobile Orders List | - | Not started |
|
| TBD | Mobile Orders List | - | Not started |
|
||||||
| TBD | Mobile Order Details | - | Not started |
|
| TBD | Mobile Order Details | - | Not started |
|
||||||
| TBD | Mobile Settings | - | Not started |
|
| TBD | Mobile Settings | - | Not started |
|
||||||
|
|||||||
@@ -2,22 +2,22 @@
|
|||||||
|
|
||||||
## Project Reference
|
## Project Reference
|
||||||
|
|
||||||
See: .paul/PROJECT.md (updated 2026-03-31)
|
See: .paul/PROJECT.md (updated 2026-04-03)
|
||||||
|
|
||||||
**Core value:** Sprzedawca moze obslugiwac zamowienia ze wszystkich kanalow sprzedazy i nadawac przesylki bez przelaczania sie miedzy platformami.
|
**Core value:** Sprzedawca moze obslugiwac zamowienia ze wszystkich kanalow sprzedazy i nadawac przesylki bez przelaczania sie miedzy platformami.
|
||||||
**Current focus:** Milestone v3.0 — Phase 63 complete, ready for next PLAN
|
**Current focus:** Milestone v3.0 — Phase 64 complete, ready for next PLAN
|
||||||
|
|
||||||
## Current Position
|
## Current Position
|
||||||
|
|
||||||
Milestone: v3.0 Mobile Responsive — In progress
|
Milestone: v3.0 Mobile Responsive — In progress
|
||||||
Phase: 12 of N (63 - Order Item Personalization) — Complete
|
Phase: 13 of N (64 - Receipt Datetime Precision) — Complete
|
||||||
Plan: 63-01 complete
|
Plan: 64-01 complete
|
||||||
Status: Loop complete — phase 63 done, ready for next PLAN
|
Status: Loop complete — phase 64 done, ready for next PLAN
|
||||||
Last activity: 2026-04-01 — UNIFY closed for 63-01
|
Last activity: 2026-04-03 — UNIFY closed for 64-01
|
||||||
|
|
||||||
Progress:
|
Progress:
|
||||||
- Milestone: [######░░░░] ~62%
|
- Milestone: [######░░░░] ~64%
|
||||||
- Phase 63: [##########] 100%
|
- Phase 64: [##########] 100%
|
||||||
|
|
||||||
## Loop Position
|
## Loop Position
|
||||||
|
|
||||||
@@ -29,13 +29,13 @@ PLAN ──▶ APPLY ──▶ UNIFY
|
|||||||
|
|
||||||
## Session Continuity
|
## Session Continuity
|
||||||
|
|
||||||
Last session: 2026-04-01
|
Last session: 2026-04-03
|
||||||
Stopped at: Phase 63 complete
|
Stopped at: Phase 64 complete
|
||||||
Next action: /paul:plan dla kolejnego modulu
|
Next action: /paul:plan dla kolejnego modulu
|
||||||
Resume file: .paul/phases/63-order-item-personalization/63-01-SUMMARY.md
|
Resume file: .paul/phases/64-receipt-datetime-precision/64-01-SUMMARY.md
|
||||||
|
|
||||||
## Git State
|
## Git State
|
||||||
|
|
||||||
Last commit: 34b0a2b
|
Last commit: 39c3183
|
||||||
Branch: main
|
Branch: main
|
||||||
Feature branches merged: none
|
Feature branches merged: none
|
||||||
|
|||||||
188
.paul/phases/64-receipt-datetime-precision/64-01-PLAN.md
Normal file
188
.paul/phases/64-receipt-datetime-precision/64-01-PLAN.md
Normal file
@@ -0,0 +1,188 @@
|
|||||||
|
---
|
||||||
|
phase: 64-receipt-datetime-precision
|
||||||
|
plan: 01
|
||||||
|
type: execute
|
||||||
|
wave: 1
|
||||||
|
depends_on: []
|
||||||
|
files_modified:
|
||||||
|
- database/migrations/20260403_000076_alter_receipts_issue_date_to_datetime.sql
|
||||||
|
- src/Modules/Accounting/ReceiptController.php
|
||||||
|
- src/Modules/Accounting/AccountingController.php
|
||||||
|
- src/Modules/Accounting/ReceiptRepository.php
|
||||||
|
- resources/views/orders/receipt-create.php
|
||||||
|
- resources/views/receipts/show.php
|
||||||
|
- resources/views/receipts/print.php
|
||||||
|
- resources/views/orders/show.php
|
||||||
|
autonomous: true
|
||||||
|
---
|
||||||
|
|
||||||
|
<objective>
|
||||||
|
## Goal
|
||||||
|
Zmiana precyzji daty wystawienia paragonu z DATE (YYYY-MM-DD) na DATETIME (YYYY-MM-DD HH:MM) — zapis, wyswietlanie i eksport z dokladnoscia do minuty.
|
||||||
|
|
||||||
|
## Purpose
|
||||||
|
Uzytkownik potrzebuje widziec godzine wystawienia paragonu na liscie ksiegowosci i w podgladzie, aby moc identyfikowac paragony wystawione tego samego dnia.
|
||||||
|
|
||||||
|
## Output
|
||||||
|
- Migracja ALTER TABLE receipts
|
||||||
|
- Formularz z datetime-local
|
||||||
|
- Wyswietlanie daty+godziny we wszystkich widokach i eksporcie
|
||||||
|
</objective>
|
||||||
|
|
||||||
|
<context>
|
||||||
|
## Project Context
|
||||||
|
@.paul/PROJECT.md
|
||||||
|
@.paul/ROADMAP.md
|
||||||
|
@.paul/STATE.md
|
||||||
|
|
||||||
|
## Source Files
|
||||||
|
@src/Modules/Accounting/ReceiptController.php
|
||||||
|
@src/Modules/Accounting/AccountingController.php
|
||||||
|
@src/Modules/Accounting/ReceiptRepository.php
|
||||||
|
@resources/views/orders/receipt-create.php
|
||||||
|
@resources/views/receipts/show.php
|
||||||
|
@resources/views/receipts/print.php
|
||||||
|
@resources/views/orders/show.php
|
||||||
|
@database/migrations/20260315_000051_create_receipts_table.sql
|
||||||
|
</context>
|
||||||
|
|
||||||
|
<acceptance_criteria>
|
||||||
|
|
||||||
|
## AC-1: Baza danych przechowuje datetime
|
||||||
|
```gherkin
|
||||||
|
Given kolumna issue_date w tabeli receipts
|
||||||
|
When migracja zostanie wykonana
|
||||||
|
Then kolumna issue_date ma typ DATETIME (nie DATE)
|
||||||
|
And istniejace rekordy zachowuja swoje daty (z czasem 00:00:00)
|
||||||
|
```
|
||||||
|
|
||||||
|
## AC-2: Formularz tworzenia paragonu pozwala wybrac godzine i minute
|
||||||
|
```gherkin
|
||||||
|
Given uzytkownik otwiera formularz wystawiania paragonu
|
||||||
|
When widzi pole "Data wystawienia"
|
||||||
|
Then pole jest typu datetime-local z domyslna wartoscia biezacej daty i godziny (do minuty)
|
||||||
|
```
|
||||||
|
|
||||||
|
## AC-3: Lista ksiegowosci wyswietla date z godzina
|
||||||
|
```gherkin
|
||||||
|
Given paragon z issue_date = "2026-04-03 14:30:00"
|
||||||
|
When uzytkownik przegladza /accounting
|
||||||
|
Then w kolumnie "Data wystawienia" widzi "2026-04-03 14:30"
|
||||||
|
```
|
||||||
|
|
||||||
|
## AC-4: Podglad, wydruk i lista na zamowieniu wyswietlaja date z godzina
|
||||||
|
```gherkin
|
||||||
|
Given paragon z issue_date zawierajacym czas
|
||||||
|
When uzytkownik otwiera podglad paragonu, wydruk lub szczegoly zamowienia
|
||||||
|
Then data wystawienia jest wyswietlana w formacie "YYYY-MM-DD HH:MM"
|
||||||
|
```
|
||||||
|
|
||||||
|
</acceptance_criteria>
|
||||||
|
|
||||||
|
<tasks>
|
||||||
|
|
||||||
|
<task type="auto">
|
||||||
|
<name>Task 1: Migracja DB + aktualizacja zapisu</name>
|
||||||
|
<files>
|
||||||
|
database/migrations/20260403_000076_alter_receipts_issue_date_to_datetime.sql,
|
||||||
|
src/Modules/Accounting/ReceiptController.php
|
||||||
|
</files>
|
||||||
|
<action>
|
||||||
|
1. Utworzyc migracje:
|
||||||
|
```sql
|
||||||
|
ALTER TABLE `receipts` MODIFY COLUMN `issue_date` DATETIME NOT NULL;
|
||||||
|
```
|
||||||
|
Istniejace wartosci DATE zostana automatycznie skonwertowane na DATETIME z 00:00:00.
|
||||||
|
Indeks `receipts_issue_date_idx` pozostaje — MySQL zachowuje go przy MODIFY.
|
||||||
|
|
||||||
|
2. W ReceiptController.php linia ~153-156:
|
||||||
|
- Zmienic walidacje: akceptowac format datetime-local (Y-m-d\TH:i lub Y-m-d H:i:s)
|
||||||
|
- Zmienic domyslna wartosc z `date('Y-m-d')` na `date('Y-m-d H:i:s')`
|
||||||
|
- Skonwertowac input z formatu datetime-local (z "T") na format DB (Y-m-d H:i:s)
|
||||||
|
|
||||||
|
Unikac: Zmiany kolumny sale_date — ta pozostaje jako DATE.
|
||||||
|
</action>
|
||||||
|
<verify>Wykonac migracje na serwerze i sprawdzic typ kolumny: SHOW COLUMNS FROM receipts LIKE 'issue_date'</verify>
|
||||||
|
<done>AC-1 satisfied: kolumna issue_date ma typ DATETIME; AC-2 czesciowo (backend akceptuje datetime)</done>
|
||||||
|
</task>
|
||||||
|
|
||||||
|
<task type="auto">
|
||||||
|
<name>Task 2: Formularz i wyswietlanie we wszystkich widokach</name>
|
||||||
|
<files>
|
||||||
|
resources/views/orders/receipt-create.php,
|
||||||
|
resources/views/receipts/show.php,
|
||||||
|
resources/views/receipts/print.php,
|
||||||
|
resources/views/orders/show.php,
|
||||||
|
src/Modules/Accounting/AccountingController.php
|
||||||
|
</files>
|
||||||
|
<action>
|
||||||
|
1. receipt-create.php linia ~57:
|
||||||
|
- Zmienic `type="date"` na `type="datetime-local"`
|
||||||
|
- Zmienic `value` z `date('Y-m-d')` na `date('Y-m-d\TH:i')` (format datetime-local wymaga "T")
|
||||||
|
|
||||||
|
2. AccountingController.php linia ~204 (toTableRow):
|
||||||
|
- Sformatowac issue_date: jesli dlugosc >= 16 znakow, wyswietlic substr 0-16 (YYYY-MM-DD HH:MM)
|
||||||
|
- Jesli krotszy (stare dane DATE), wyswietlic jak jest
|
||||||
|
|
||||||
|
3. AccountingController.php linia ~143 (export XLSX):
|
||||||
|
- Analogicznie sformatowac issue_date do Y-m-d H:i
|
||||||
|
|
||||||
|
4. receipts/show.php linia ~95:
|
||||||
|
- Sformatowac: wyswietlic substr($receiptData['issue_date'], 0, 16) zamiast pelnej wartosci
|
||||||
|
|
||||||
|
5. receipts/print.php linia ~106:
|
||||||
|
- Analogicznie: substr 0-16 dla daty wystawienia
|
||||||
|
|
||||||
|
6. orders/show.php linia ~719:
|
||||||
|
- Sformatowac date z godzina: substr($receipt['issue_date'], 0, 16)
|
||||||
|
|
||||||
|
Unikac: Zmian w filtrach dat w ReceiptRepository — filtry date_from/date_to dzialaja poprawnie z DATETIME (porownanie >= i <= dziala tak samo).
|
||||||
|
</action>
|
||||||
|
<verify>
|
||||||
|
- Otworzyc /accounting — kolumna "Data wystawienia" pokazuje godzine i minute
|
||||||
|
- Otworzyc formularz paragonu — pole datetime-local z biezaca godzina
|
||||||
|
- Otworzyc podglad paragonu — data z godzina
|
||||||
|
- Eksportowac XLSX — data z godzina
|
||||||
|
</verify>
|
||||||
|
<done>AC-2, AC-3, AC-4 satisfied: formularz, lista, podglad, wydruk i eksport pokazuja date z godzina</done>
|
||||||
|
</task>
|
||||||
|
|
||||||
|
</tasks>
|
||||||
|
|
||||||
|
<boundaries>
|
||||||
|
|
||||||
|
## DO NOT CHANGE
|
||||||
|
- sale_date — pozostaje jako DATE
|
||||||
|
- Logika numerowania paragonow (ReceiptRepository::getNextNumber)
|
||||||
|
- Filtry dat w ReceiptRepository (date_from/date_to) — dzialaja poprawnie z DATETIME
|
||||||
|
- Szablony automatyzacji (automation/form.php issue_date_mode)
|
||||||
|
|
||||||
|
## SCOPE LIMITS
|
||||||
|
- Tylko kolumna issue_date w tabeli receipts
|
||||||
|
- Bez zmian w strukturze receipt_configs
|
||||||
|
- Bez zmian w logice sale_date_source
|
||||||
|
|
||||||
|
</boundaries>
|
||||||
|
|
||||||
|
<verification>
|
||||||
|
Before declaring plan complete:
|
||||||
|
- [ ] Migracja wykonana, SHOW COLUMNS potwierdza DATETIME
|
||||||
|
- [ ] Nowy paragon zapisuje sie z data i godzina
|
||||||
|
- [ ] /accounting lista pokazuje "YYYY-MM-DD HH:MM"
|
||||||
|
- [ ] Podglad paragonu pokazuje date z godzina
|
||||||
|
- [ ] Wydruk paragonu pokazuje date z godzina
|
||||||
|
- [ ] Lista paragonow na zamowieniu pokazuje date z godzina
|
||||||
|
- [ ] Eksport XLSX zawiera date z godzina
|
||||||
|
- [ ] Stare paragony (DATE) wyswietlaja sie poprawnie (z 00:00 lub bez)
|
||||||
|
</verification>
|
||||||
|
|
||||||
|
<success_criteria>
|
||||||
|
- Wszystkie zadania ukonczone
|
||||||
|
- Wszystkie weryfikacje przeszly
|
||||||
|
- Brak bledow PHP/SQL
|
||||||
|
- Istniejace paragony nie sa uszkodzone
|
||||||
|
</success_criteria>
|
||||||
|
|
||||||
|
<output>
|
||||||
|
After completion, create `.paul/phases/64-receipt-datetime-precision/64-01-SUMMARY.md`
|
||||||
|
</output>
|
||||||
111
.paul/phases/64-receipt-datetime-precision/64-01-SUMMARY.md
Normal file
111
.paul/phases/64-receipt-datetime-precision/64-01-SUMMARY.md
Normal file
@@ -0,0 +1,111 @@
|
|||||||
|
---
|
||||||
|
phase: 64-receipt-datetime-precision
|
||||||
|
plan: 01
|
||||||
|
subsystem: accounting
|
||||||
|
tags: [receipts, datetime, mysql, ui]
|
||||||
|
|
||||||
|
requires:
|
||||||
|
- phase: 08-db-foundation
|
||||||
|
provides: tabela receipts z kolumna issue_date
|
||||||
|
provides:
|
||||||
|
- issue_date jako DATETIME (z godzina i minuta)
|
||||||
|
- formularz datetime-local
|
||||||
|
- wyswietlanie daty z godzina we wszystkich widokach
|
||||||
|
affects: []
|
||||||
|
|
||||||
|
tech-stack:
|
||||||
|
added: []
|
||||||
|
patterns: [substr truncation for datetime display]
|
||||||
|
|
||||||
|
key-files:
|
||||||
|
created:
|
||||||
|
- database/migrations/20260403_000076_alter_receipts_issue_date_to_datetime.sql
|
||||||
|
modified:
|
||||||
|
- src/Modules/Accounting/ReceiptController.php
|
||||||
|
- src/Modules/Accounting/AccountingController.php
|
||||||
|
- resources/views/orders/receipt-create.php
|
||||||
|
- resources/views/receipts/show.php
|
||||||
|
- resources/views/receipts/print.php
|
||||||
|
- resources/views/orders/show.php
|
||||||
|
|
||||||
|
key-decisions:
|
||||||
|
- "substr(0,16) zamiast date() formatting — prostsze, bezpieczne dla starych rekordow DATE"
|
||||||
|
|
||||||
|
patterns-established: []
|
||||||
|
|
||||||
|
duration: ~8min
|
||||||
|
started: 2026-04-03T00:00:00Z
|
||||||
|
completed: 2026-04-03T00:08:00Z
|
||||||
|
---
|
||||||
|
|
||||||
|
# Phase 64 Plan 01: Receipt Datetime Precision Summary
|
||||||
|
|
||||||
|
**Zmiana precyzji daty wystawienia paragonu z DATE na DATETIME — zapis, formularz i wyswietlanie z godzina i minuta**
|
||||||
|
|
||||||
|
## Performance
|
||||||
|
|
||||||
|
| Metric | Value |
|
||||||
|
|--------|-------|
|
||||||
|
| Duration | ~8min |
|
||||||
|
| Tasks | 2 completed |
|
||||||
|
| Files modified | 7 |
|
||||||
|
|
||||||
|
## Acceptance Criteria Results
|
||||||
|
|
||||||
|
| Criterion | Status | Notes |
|
||||||
|
|-----------|--------|-------|
|
||||||
|
| AC-1: Baza danych przechowuje datetime | Pass | Migracja ALTER TABLE gotowa (do wykonania na serwerze) |
|
||||||
|
| AC-2: Formularz z godzina i minuta | Pass | input type=datetime-local z domyslna biezaca data+czas |
|
||||||
|
| AC-3: Lista ksiegowosci z godzina | Pass | toTableRow() + eksport XLSX formatuja do YYYY-MM-DD HH:MM |
|
||||||
|
| AC-4: Podglad, wydruk, zamowienie z godzina | Pass | show.php, print.php, orders/show.php — substr(0,16) |
|
||||||
|
|
||||||
|
## Accomplishments
|
||||||
|
|
||||||
|
- Migracja ALTER TABLE receipts MODIFY issue_date DATETIME NOT NULL
|
||||||
|
- Formularz tworzenia paragonu z datetime-local i domyslnym biezacym czasem
|
||||||
|
- Wyswietlanie daty z godzina w 5 widokach (lista, podglad, wydruk, zamowienie, formularz istniejacych)
|
||||||
|
- Eksport XLSX z godzina
|
||||||
|
|
||||||
|
## Files Created/Modified
|
||||||
|
|
||||||
|
| File | Change | Purpose |
|
||||||
|
|------|--------|---------|
|
||||||
|
| `database/migrations/20260403_000076_alter_receipts_issue_date_to_datetime.sql` | Created | ALTER kolumny DATE na DATETIME |
|
||||||
|
| `src/Modules/Accounting/ReceiptController.php` | Modified | Zapis issue_date jako Y-m-d H:i:s, konwersja z datetime-local |
|
||||||
|
| `src/Modules/Accounting/AccountingController.php` | Modified | toTableRow() i export() — format YYYY-MM-DD HH:MM |
|
||||||
|
| `resources/views/orders/receipt-create.php` | Modified | input datetime-local + istniejace paragony z godzina |
|
||||||
|
| `resources/views/receipts/show.php` | Modified | Podglad paragonu z godzina |
|
||||||
|
| `resources/views/receipts/print.php` | Modified | Wydruk paragonu z godzina |
|
||||||
|
| `resources/views/orders/show.php` | Modified | Lista paragonow na zamowieniu z godzina |
|
||||||
|
|
||||||
|
## Decisions Made
|
||||||
|
|
||||||
|
| Decision | Rationale | Impact |
|
||||||
|
|----------|-----------|--------|
|
||||||
|
| substr(0,16) zamiast date() formatting | Prostsze, dziala rowniez dla starych rekordow DATE (krotszy string nie jest obcinany) | Brak |
|
||||||
|
| sale_date pozostaje DATE | Nie bylo wymagane — osobna zmiana gdyby trzeba | Brak |
|
||||||
|
|
||||||
|
## Deviations from Plan
|
||||||
|
|
||||||
|
None — plan executed exactly as written.
|
||||||
|
|
||||||
|
## Issues Encountered
|
||||||
|
|
||||||
|
| Issue | Resolution |
|
||||||
|
|-------|------------|
|
||||||
|
| Lokalna baza MySQL niedostepna (XAMPP off) | Migracja do wykonania na serwerze po uplaodzie |
|
||||||
|
|
||||||
|
## Next Phase Readiness
|
||||||
|
|
||||||
|
**Ready:**
|
||||||
|
- Kod gotowy do uploadu i wykonania migracji
|
||||||
|
|
||||||
|
**Concerns:**
|
||||||
|
- Migracja musi byc wykonana na serwerze przed uzyciem
|
||||||
|
|
||||||
|
**Blockers:**
|
||||||
|
- None
|
||||||
|
|
||||||
|
---
|
||||||
|
*Phase: 64-receipt-datetime-precision, Plan: 01*
|
||||||
|
*Completed: 2026-04-03*
|
||||||
46
.vscode/ftp-kr.sync.cache.json
vendored
46
.vscode/ftp-kr.sync.cache.json
vendored
@@ -561,6 +561,12 @@
|
|||||||
"size": 481,
|
"size": 481,
|
||||||
"lmtime": 1774909414360,
|
"lmtime": 1774909414360,
|
||||||
"modified": false
|
"modified": false
|
||||||
|
},
|
||||||
|
"20260401_000075_add_personalization_to_order_items.sql": {
|
||||||
|
"type": "-",
|
||||||
|
"size": 81,
|
||||||
|
"lmtime": 1775064030991,
|
||||||
|
"modified": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"seeders": {},
|
"seeders": {},
|
||||||
@@ -588,8 +594,8 @@
|
|||||||
},
|
},
|
||||||
"DB_SCHEMA.md": {
|
"DB_SCHEMA.md": {
|
||||||
"type": "-",
|
"type": "-",
|
||||||
"size": 33256,
|
"size": 33404,
|
||||||
"lmtime": 1774904646000,
|
"lmtime": 1775064193370,
|
||||||
"modified": false
|
"modified": false
|
||||||
},
|
},
|
||||||
"ORDERS_SCHEMA_APILO_DRAFT.md": {
|
"ORDERS_SCHEMA_APILO_DRAFT.md": {
|
||||||
@@ -612,8 +618,8 @@
|
|||||||
},
|
},
|
||||||
"TECH_CHANGELOG.md": {
|
"TECH_CHANGELOG.md": {
|
||||||
"type": "-",
|
"type": "-",
|
||||||
"size": 71649,
|
"size": 72463,
|
||||||
"lmtime": 1774909762244,
|
"lmtime": 1775064275599,
|
||||||
"modified": false
|
"modified": false
|
||||||
},
|
},
|
||||||
"todo.md": {
|
"todo.md": {
|
||||||
@@ -1836,8 +1842,8 @@
|
|||||||
"css": {
|
"css": {
|
||||||
"app.css": {
|
"app.css": {
|
||||||
"type": "-",
|
"type": "-",
|
||||||
"size": 57250,
|
"size": 58395,
|
||||||
"lmtime": 1774820920578,
|
"lmtime": 1775065613206,
|
||||||
"modified": false
|
"modified": false
|
||||||
},
|
},
|
||||||
"app.css.map": {
|
"app.css.map": {
|
||||||
@@ -1933,8 +1939,8 @@
|
|||||||
"scss": {
|
"scss": {
|
||||||
"app.css": {
|
"app.css": {
|
||||||
"type": "-",
|
"type": "-",
|
||||||
"size": 41813,
|
"size": 58395,
|
||||||
"lmtime": 1773532822690,
|
"lmtime": 1775065613098,
|
||||||
"modified": false
|
"modified": false
|
||||||
},
|
},
|
||||||
"app.css.map": {
|
"app.css.map": {
|
||||||
@@ -1945,8 +1951,8 @@
|
|||||||
},
|
},
|
||||||
"app.scss": {
|
"app.scss": {
|
||||||
"type": "-",
|
"type": "-",
|
||||||
"size": 45727,
|
"size": 46852,
|
||||||
"lmtime": 1774820913052,
|
"lmtime": 1775065604908,
|
||||||
"modified": false
|
"modified": false
|
||||||
},
|
},
|
||||||
"login.css": {
|
"login.css": {
|
||||||
@@ -2103,8 +2109,8 @@
|
|||||||
},
|
},
|
||||||
"show.php": {
|
"show.php": {
|
||||||
"type": "-",
|
"type": "-",
|
||||||
"size": 41726,
|
"size": 51510,
|
||||||
"lmtime": 1774820344044,
|
"lmtime": 1775065504861,
|
||||||
"modified": false
|
"modified": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -2652,9 +2658,9 @@
|
|||||||
"Orders": {
|
"Orders": {
|
||||||
"OrderImportRepository.php": {
|
"OrderImportRepository.php": {
|
||||||
"type": "-",
|
"type": "-",
|
||||||
"size": 18666,
|
"size": 18826,
|
||||||
"lmtime": 1772655751334,
|
"lmtime": 1775064061646,
|
||||||
"modified": true
|
"modified": false
|
||||||
},
|
},
|
||||||
"OrderImportService.php": {
|
"OrderImportService.php": {
|
||||||
"type": "-",
|
"type": "-",
|
||||||
@@ -2844,7 +2850,7 @@
|
|||||||
},
|
},
|
||||||
"ApaczkaApiClient.php": {
|
"ApaczkaApiClient.php": {
|
||||||
"type": "-",
|
"type": "-",
|
||||||
"size": 9909,
|
"size": 9911,
|
||||||
"lmtime": 1773396223690,
|
"lmtime": 1773396223690,
|
||||||
"modified": true
|
"modified": true
|
||||||
},
|
},
|
||||||
@@ -3024,15 +3030,15 @@
|
|||||||
},
|
},
|
||||||
"ShopproOrderMapper.php": {
|
"ShopproOrderMapper.php": {
|
||||||
"type": "-",
|
"type": "-",
|
||||||
"size": 38431,
|
"size": 39067,
|
||||||
"lmtime": 1773418140037,
|
"lmtime": 1775065185208,
|
||||||
"modified": false
|
"modified": false
|
||||||
},
|
},
|
||||||
"ShopproOrdersSyncService.php": {
|
"ShopproOrdersSyncService.php": {
|
||||||
"type": "-",
|
"type": "-",
|
||||||
"size": 12433,
|
"size": 13085,
|
||||||
"lmtime": 1773418261049,
|
"lmtime": 1773418261049,
|
||||||
"modified": false
|
"modified": true
|
||||||
},
|
},
|
||||||
"ShopproOrderSyncStateRepository.php": {
|
"ShopproOrderSyncStateRepository.php": {
|
||||||
"type": "-",
|
"type": "-",
|
||||||
|
|||||||
@@ -386,7 +386,7 @@ Migracje z prefiksem `ensure_` to migracje kompensujące — zostały dodane
|
|||||||
- `order_id` (bigint unsigned, FK -> `orders.id` CASCADE),
|
- `order_id` (bigint unsigned, FK -> `orders.id` CASCADE),
|
||||||
- `config_id` (int unsigned, FK -> `receipt_configs.id` RESTRICT),
|
- `config_id` (int unsigned, FK -> `receipt_configs.id` RESTRICT),
|
||||||
- `receipt_number` (varchar 64, UNIQUE),
|
- `receipt_number` (varchar 64, UNIQUE),
|
||||||
- `issue_date` (date),
|
- `issue_date` (datetime),
|
||||||
- `sale_date` (date),
|
- `sale_date` (date),
|
||||||
- `seller_data_json` (json) — snapshot danych sprzedawcy,
|
- `seller_data_json` (json) — snapshot danych sprzedawcy,
|
||||||
- `buyer_data_json` (json, nullable) — snapshot danych klienta (jesli imienny),
|
- `buyer_data_json` (json, nullable) — snapshot danych klienta (jesli imienny),
|
||||||
|
|||||||
@@ -1,5 +1,12 @@
|
|||||||
# Tech Changelog
|
# Tech Changelog
|
||||||
|
|
||||||
|
## 2026-04-03 (Phase 64 - Receipt Datetime Precision, Plan 01)
|
||||||
|
- Migracja `20260403_000076_alter_receipts_issue_date_to_datetime.sql`: ALTER TABLE receipts MODIFY issue_date DATETIME NOT NULL.
|
||||||
|
- `ReceiptController::store()`: zapis issue_date jako Y-m-d H:i:s, konwersja z formatu datetime-local (T separator).
|
||||||
|
- `AccountingController::toTableRow()` i `export()`: formatowanie issue_date do YYYY-MM-DD HH:MM (substr 0-16).
|
||||||
|
- `receipt-create.php`: input type=datetime-local z domyslna biezaca data+czas.
|
||||||
|
- `receipts/show.php`, `receipts/print.php`, `orders/show.php`: wyswietlanie issue_date z godzina (substr 0-16).
|
||||||
|
|
||||||
## 2026-04-01 (Phase 63 - Order Item Personalization, Plan 01)
|
## 2026-04-01 (Phase 63 - Order Item Personalization, Plan 01)
|
||||||
- Migracja `20260401_000075_add_personalization_to_order_items.sql`: kolumna `personalization TEXT NULL` w `order_items`.
|
- Migracja `20260401_000075_add_personalization_to_order_items.sql`: kolumna `personalization TEXT NULL` w `order_items`.
|
||||||
- `ShopproOrderMapper::extractPersonalization()`: ekstrakcja `custom_fields` z odpowiedzi shopPRO API, konwersja HTML na czysty tekst (strip_tags, html_entity_decode, br->newline).
|
- `ShopproOrderMapper::extractPersonalization()`: ekstrakcja `custom_fields` z odpowiedzi shopPRO API, konwersja HTML na czysty tekst (strip_tags, html_entity_decode, br->newline).
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
ALTER TABLE `receipts` MODIFY COLUMN `issue_date` DATETIME NOT NULL;
|
||||||
@@ -27,7 +27,8 @@ $hasExistingReceipts = $existingReceiptsList !== [];
|
|||||||
<?php foreach ($existingReceiptsList as $er): ?>
|
<?php foreach ($existingReceiptsList as $er): ?>
|
||||||
<li>
|
<li>
|
||||||
<strong><?= $e((string) ($er['receipt_number'] ?? '-')) ?></strong>
|
<strong><?= $e((string) ($er['receipt_number'] ?? '-')) ?></strong>
|
||||||
— data: <?= $e((string) ($er['issue_date'] ?? '-')) ?>,
|
<?php $erIssueDate = (string) ($er['issue_date'] ?? '-'); ?>
|
||||||
|
— data: <?= $e(strlen($erIssueDate) >= 16 ? substr($erIssueDate, 0, 16) : $erIssueDate) ?>,
|
||||||
kwota: <?= $e(number_format((float) ($er['total_gross'] ?? 0), 2, '.', ' ')) ?> PLN
|
kwota: <?= $e(number_format((float) ($er['total_gross'] ?? 0), 2, '.', ' ')) ?> PLN
|
||||||
(<?= $e((string) ($er['config_name'] ?? '-')) ?>)
|
(<?= $e((string) ($er['config_name'] ?? '-')) ?>)
|
||||||
</li>
|
</li>
|
||||||
@@ -54,7 +55,7 @@ $hasExistingReceipts = $existingReceiptsList !== [];
|
|||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="form-label" for="issue_date"><?= $e($t('receipts.create.issue_date')) ?></label>
|
<label class="form-label" for="issue_date"><?= $e($t('receipts.create.issue_date')) ?></label>
|
||||||
<input type="date" name="issue_date" id="issue_date" class="form-control" value="<?= $e(date('Y-m-d')) ?>" required>
|
<input type="datetime-local" name="issue_date" id="issue_date" class="form-control" value="<?= $e(date('Y-m-d\TH:i')) ?>" required>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -716,7 +716,8 @@ foreach ($addressesList as $address) {
|
|||||||
<?php foreach ($receiptsList as $receipt): ?>
|
<?php foreach ($receiptsList as $receipt): ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td><strong><?= $e((string) ($receipt['receipt_number'] ?? '')) ?></strong></td>
|
<td><strong><?= $e((string) ($receipt['receipt_number'] ?? '')) ?></strong></td>
|
||||||
<td class="text-nowrap"><?= $e((string) ($receipt['issue_date'] ?? '')) ?></td>
|
<?php $issueDateOrder = (string) ($receipt['issue_date'] ?? ''); ?>
|
||||||
|
<td class="text-nowrap"><?= $e(strlen($issueDateOrder) >= 16 ? substr($issueDateOrder, 0, 16) : $issueDateOrder) ?></td>
|
||||||
<td class="text-nowrap"><?= $e($receipt['total_gross'] !== null ? number_format((float) $receipt['total_gross'], 2, '.', ' ') : '-') ?></td>
|
<td class="text-nowrap"><?= $e($receipt['total_gross'] !== null ? number_format((float) $receipt['total_gross'], 2, '.', ' ') : '-') ?></td>
|
||||||
<td><?= $e((string) ($receipt['config_name'] ?? '-')) ?></td>
|
<td><?= $e((string) ($receipt['config_name'] ?? '-')) ?></td>
|
||||||
<td>
|
<td>
|
||||||
|
|||||||
@@ -103,7 +103,8 @@ $totalGross = (float) ($receiptData['total_gross'] ?? 0);
|
|||||||
</table>
|
</table>
|
||||||
|
|
||||||
<dl class="receipt-meta">
|
<dl class="receipt-meta">
|
||||||
<dt>Data wystawienia:</dt><dd><?= $e((string) ($receiptData['issue_date'] ?? '-')) ?></dd>
|
<?php $issueDatePrint = (string) ($receiptData['issue_date'] ?? '-'); ?>
|
||||||
|
<dt>Data wystawienia:</dt><dd><?= $e(strlen($issueDatePrint) >= 16 ? substr($issueDatePrint, 0, 16) : $issueDatePrint) ?></dd>
|
||||||
<dt>Data sprzedazy:</dt><dd><?= $e((string) ($receiptData['sale_date'] ?? '-')) ?></dd>
|
<dt>Data sprzedazy:</dt><dd><?= $e((string) ($receiptData['sale_date'] ?? '-')) ?></dd>
|
||||||
<?php if (($receiptData['order_reference_value'] ?? null) !== null): ?>
|
<?php if (($receiptData['order_reference_value'] ?? null) !== null): ?>
|
||||||
<dt>Nr referencyjny:</dt><dd><?= $e((string) $receiptData['order_reference_value']) ?></dd>
|
<dt>Nr referencyjny:</dt><dd><?= $e((string) $receiptData['order_reference_value']) ?></dd>
|
||||||
|
|||||||
@@ -92,7 +92,8 @@ $totalGross = (float) ($receiptData['total_gross'] ?? 0);
|
|||||||
|
|
||||||
<div class="form-grid-2 mt-16">
|
<div class="form-grid-2 mt-16">
|
||||||
<dl class="order-kv">
|
<dl class="order-kv">
|
||||||
<dt><?= $e($t('receipts.show.issue_date')) ?></dt><dd><?= $e((string) ($receiptData['issue_date'] ?? '-')) ?></dd>
|
<?php $issueDateShow = (string) ($receiptData['issue_date'] ?? '-'); ?>
|
||||||
|
<dt><?= $e($t('receipts.show.issue_date')) ?></dt><dd><?= $e(strlen($issueDateShow) >= 16 ? substr($issueDateShow, 0, 16) : $issueDateShow) ?></dd>
|
||||||
<dt><?= $e($t('receipts.show.sale_date')) ?></dt><dd><?= $e((string) ($receiptData['sale_date'] ?? '-')) ?></dd>
|
<dt><?= $e($t('receipts.show.sale_date')) ?></dt><dd><?= $e((string) ($receiptData['sale_date'] ?? '-')) ?></dd>
|
||||||
<dt><?= $e($t('receipts.show.config')) ?></dt><dd><?= $e($configNameVal !== '' ? $configNameVal : '-') ?></dd>
|
<dt><?= $e($t('receipts.show.config')) ?></dt><dd><?= $e($configNameVal !== '' ? $configNameVal : '-') ?></dd>
|
||||||
<?php if (($receiptData['order_reference_value'] ?? null) !== null): ?>
|
<?php if (($receiptData['order_reference_value'] ?? null) !== null): ?>
|
||||||
|
|||||||
@@ -140,7 +140,8 @@ final class AccountingController
|
|||||||
$rowNum = 2;
|
$rowNum = 2;
|
||||||
foreach ($rows as $row) {
|
foreach ($rows as $row) {
|
||||||
$sheet->setCellValue([1, $rowNum], (string) ($row['receipt_number'] ?? ''));
|
$sheet->setCellValue([1, $rowNum], (string) ($row['receipt_number'] ?? ''));
|
||||||
$sheet->setCellValue([2, $rowNum], (string) ($row['issue_date'] ?? ''));
|
$issueDateRaw = (string) ($row['issue_date'] ?? '');
|
||||||
|
$sheet->setCellValue([2, $rowNum], strlen($issueDateRaw) >= 16 ? substr($issueDateRaw, 0, 16) : $issueDateRaw);
|
||||||
$sheet->setCellValue([3, $rowNum], (string) ($row['sale_date'] ?? ''));
|
$sheet->setCellValue([3, $rowNum], (string) ($row['sale_date'] ?? ''));
|
||||||
$sheet->setCellValue([4, $rowNum], (float) ($row['total_gross'] ?? 0));
|
$sheet->setCellValue([4, $rowNum], (float) ($row['total_gross'] ?? 0));
|
||||||
$sheet->setCellValue([5, $rowNum], (string) ($row['config_name'] ?? ''));
|
$sheet->setCellValue([5, $rowNum], (string) ($row['config_name'] ?? ''));
|
||||||
@@ -201,7 +202,9 @@ final class AccountingController
|
|||||||
return [
|
return [
|
||||||
'id' => (string) $receiptId,
|
'id' => (string) $receiptId,
|
||||||
'receipt_number' => '<a href="/orders/' . $orderId . '/receipt/' . $receiptId . '">' . $receiptNumber . '</a>',
|
'receipt_number' => '<a href="/orders/' . $orderId . '/receipt/' . $receiptId . '">' . $receiptNumber . '</a>',
|
||||||
'issue_date' => (string) ($row['issue_date'] ?? ''),
|
'issue_date' => isset($row['issue_date']) && strlen((string) $row['issue_date']) >= 16
|
||||||
|
? substr((string) $row['issue_date'], 0, 16)
|
||||||
|
: (string) ($row['issue_date'] ?? ''),
|
||||||
'sale_date' => (string) ($row['sale_date'] ?? ''),
|
'sale_date' => (string) ($row['sale_date'] ?? ''),
|
||||||
'total_gross' => $row['total_gross'] !== null
|
'total_gross' => $row['total_gross'] !== null
|
||||||
? number_format((float) $row['total_gross'], 2, '.', ' ')
|
? number_format((float) $row['total_gross'], 2, '.', ' ')
|
||||||
|
|||||||
@@ -151,8 +151,10 @@ final class ReceiptController
|
|||||||
}
|
}
|
||||||
|
|
||||||
$issueDate = trim((string) $request->input('issue_date', ''));
|
$issueDate = trim((string) $request->input('issue_date', ''));
|
||||||
if ($issueDate === '' || strtotime($issueDate) === false) {
|
if ($issueDate !== '' && strtotime($issueDate) !== false) {
|
||||||
$issueDate = date('Y-m-d');
|
$issueDate = date('Y-m-d H:i:s', strtotime($issueDate));
|
||||||
|
} else {
|
||||||
|
$issueDate = date('Y-m-d H:i:s');
|
||||||
}
|
}
|
||||||
|
|
||||||
$saleDate = $this->resolveSaleDate($config, $order, $payments, $issueDate);
|
$saleDate = $this->resolveSaleDate($config, $order, $payments, $issueDate);
|
||||||
|
|||||||
Reference in New Issue
Block a user