Commit Graph

253 Commits

Author SHA1 Message Date
Claude Agent
be7e97796d fix(qa): ISSUE-004 — show receipt ID in title immediately after save
Set receipt.value = savedReceipt before router.push() so modeTitle
computes 'Bon #123' even when Vue Router reuses the component instance
and onMounted does not re-run.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-20 14:32:45 +00:00
Claude Agent
6eb88c8730 fix(qa): ISSUE-003 — widen Nr., Total, and Card/Cash payment fields
- .nr-input: 90px → 120px (fits 7-digit receipt numbers)
- .total-input: 80px → 105px (fits 5-digit amounts with decimals)
- .pay-input: 80px → 105px (PaymentCompactFields Card/Cash columns)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-20 14:32:38 +00:00
Claude Agent
67d6871176 chore: exclude .gstack/ directory from version control
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-20 14:32:30 +00:00
Claude Agent
23080aec46 fix(ocr,gitignore): fix charmap encoding in OCR workers and ignore SQLite WAL files
- Fix UnicodeEncodeError in OCR worker subprocesses on Windows: spawned processes
  with 'spawn' context inherit charmap (CP1252) encoding, causing crashes when
  printing Romanian diacritics (ș, ț, ă) from OCR-extracted text.
  Fix: reconfigure sys.stdout/sys.stderr to UTF-8 in _worker_initializer().

- Add *.db-wal and *.db-shm to .gitignore for SQLite WAL mode auxiliary files.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-20 12:52:50 +00:00
Claude Agent
a1a47eeb7f ssh tunnels 2026-03-13 22:24:54 +00:00
3e2b7fcc0f curatare 2026-03-13 16:40:10 +02:00
Claude Agent
74dff2d17d feat(reports,mobile): add FinancialIndicators page and refactor dashboard layout
- Add dedicated FinancialIndicatorsView with its own route
- Refactor FinancialIndicatorsCard: simplified collapsible card (no period picker)
- Dashboard mobile: reduce swipeable pages from 2 to 1, embed indicators in card-0
- Dashboard desktop: wrap indicators in CollapsibleCard
- Update MobileBottomNav defaults: reports-centric nav (Facturi/Banca/Casa/Indicatori)
- BankView/CashView: date format DD/MM/YY, remove amount color classes, CSS tweaks

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-01 08:55:11 +00:00
Claude Agent
06cbf8fb9d feat(auth,dashboard): 2FA mobile session persistence and sparkline cards
- Persist 2FA state in sessionStorage to survive mobile page reloads
- Reuse existing valid OTP on re-login to avoid rate limiting and duplicate emails
- Add embedded sparkline charts to SolduriCompactCard with expand toggle
- Mobile dashboard redesigned: 2 pages with enriched compact cards + cashflow type
- Login UI simplified: remove gradient bg, subtitle, icon; use design tokens
- Focus OTP input when session is restored from 2FA state

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-26 14:36:22 +00:00
Claude Agent
cbcd5fe8e7 curatare 2026-02-26 08:41:34 +00:00
Claude Agent
0459b3feaf fix(reports): neutralize totals color and fix dark mode button contrast
- Remove green/red/blue coloring from summary totals on all report pages
  (Facturi, Facturi pe Parteneri, Casă, Bancă) — mobile and desktop,
  light and dark mode; totals now use --text-color like TrialBalance
- Fix SplitButton (Export) dark mode: was blue (--color-primary), now
  matches secondary outlined style (--text-color / --surface-border)
- Update button syntax: severity="secondary" outlined instead of legacy
  class="p-button-outlined p-button-secondary"
- DetailedInvoices: partner-meta (8 facturi) inline with partner name
  via flex-direction row instead of column
- TrialBalance: mobile flat-row list layout replacing card layout
- Dashboard mobile title: shows company name + period instead of static "Dashboard"
- Navigation: move Facturi pe Parteneri to RAPOARTE section;
  update MobileBottomNav default items (Detalii replaces Facturi)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-26 08:40:59 +00:00
Claude Agent
1839285ac3 feat(auth): add 2FA with OTP, backup codes and trusted devices
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-24 17:25:00 +00:00
Claude Agent
b001b94e37 fix deploy 2026-02-24 10:09:19 +00:00
Claude Agent
1e2516e022 fix(telegram): use BASE_URL prefix for IIS sub-app compatibility
Replace hardcoded '/api/telegram' with import.meta.env.BASE_URL + 'api/telegram'
to match the reports API pattern. In production the base is '/roa2web/' so absolute
paths bypassed IIS sub-app routing, causing 404 on generate-code endpoint.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-24 10:02:48 +00:00
Claude Agent
24aba7e0b3 curatare 2026-02-23 15:26:07 +00:00
Claude Agent
8bc567a9c5 fix telegram 2026-02-23 15:12:33 +00:00
Claude Agent
6c78fec8a7 feat(dashboard): add datorat/achitat/sold breakdown for budget debts
Replaces "luna prec / luna curentă" columns with a clearer accounting
reconciliation flow: Datorat (owed) → Achitat (paid) → Sold (remaining).
Backend models gain 3 new fields per sub-account and group. Frontend
shows ✓ when a debt is fully cleared. Mobile TVA card now shows both
total and remaining sold. SwipeableCards gains fixedDots/fillHeight props
for better layout above MobileBottomNav. Telegram formatter updated to
use new fields and drops redundant RON suffix from amounts.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-23 15:05:41 +00:00
Claude Agent
aac49542e4 fix(telegram): edit messages in-place during server switch flow
Server switch flow now edits the original message at each step
(progress, error, company list) instead of sending separate messages.
"Server schimbat" notice is folded into the company selection header.
Also adds budget debt breakdown to dashboard formatter.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-23 09:18:59 +00:00
Claude Agent
30f55cf18b feat: Add A-Z filter for clients/suppliers in Telegram bot
- Add A-Z alphabetical filter keyboard for clients and suppliers lists
  (same pattern as company selection, without emoji)
- Increase clients/suppliers list pagination from 10 to 20 items per page
- Remove emoji from company A-Z filter button for consistency
- Add 6 new callback handlers: clients_alpha_menu, clients_alpha:LETTER,
  clients_alpha_page:PAGE:LETTER, and supplier equivalents
- Dashboard service and models updates
- Telegram bot: email handlers, auth, DB operations, internal API improvements
- Frontend: dashboard cards updates (CashFlow, Clienti, Furnizori, Treasury)
- Frontend: SolduriCompactCard and CollapsibleCard improvements
- DashboardView enhancements
- start.sh and run-with-restart.sh script updates
- IIS web.config and service worker updates

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-21 14:34:15 +00:00
Claude Agent
1366dbc11c feat: Add WhatsApp import scripts for receipt processing
- OCR client for SQLite queue
- WhatsApp flow: PDF -> OCR -> SQLite -> Oracle
- PACK_CONTAFIN integration for Oracle save
- README with flux documentation
2026-02-03 15:33:22 +00:00
Claude Agent
2e1ead69e1 refactor: simplify Oracle pool to use only ORACLE_SERVERS format
- Remove legacy pool support (DSN, env vars fallback)
- Use first registered server when server_id not specified
- Show server dropdown even with single server in ORACLE_SERVERS
- Email login only available for 2+ servers

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 15:15:57 +00:00
Claude Agent
6718c956f7 feat: [US-004] Add SSH tunnel auto-start for Windows services
- Add ssh-tunnel.ps1: Windows SSH tunnel manager (equivalent to ssh-tunnel.sh)
  - Supports password auth via plink.exe (PuTTY)
  - Supports ssh_hostkey for non-interactive batch mode
  - Commands: start, stop, restart, status

- Add start-backend-service.ps1: NSSM service wrapper
  - Starts SSH tunnels before uvicorn
  - Waits for tunnel ports to be accessible (30s timeout)
  - Configured by Install-ROA2WEB.ps1

- Add start.ps1: Windows equivalent of start.sh
  - Orchestrates SSH tunnel + backend + frontend startup

- Add backend/shared/ssh_tunnel_manager.py: Python monitoring
  - Background asyncio task monitors tunnel health every 30s
  - Auto-restarts tunnels after 2 consecutive failures
  - Exposes status to /health endpoint

- Update ROA2WEB-Console.ps1:
  - Add Deploy-Scripts function
  - Update Update-ServiceToUseVenv to use wrapper script

- Fix PowerShell reserved variable ($PID -> $tunnelPid)
- Fix script path detection (scripts/ vs deployment/windows/scripts/)
- Update README.md with ssh_hostkey documentation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 19:04:26 +00:00
Claude Agent
dc1711acd0 feat: [US-001] Add automatic Alembic migrations at backend startup
- Add alembic.ini config for data_entry module
- Add migrations.py helper with:
  - run_migrations(): runs pending migrations at startup (returns True/False)
  - get_current_revision(): returns current schema version for /health
- Integrate migrations in main.py startup_event() BEFORE init_data_entry_db()
- Add data_entry_schema_version to /health endpoint

If migrations fail, backend continues with WARNING (not crash).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 18:00:01 +00:00
Claude Agent
8567f893bc feat: [US-003] Audit and document deploy script data preservation
- Add detailed logging in Deploy-Backend function for data/ preservation
- Update deployment/windows/README.md with "Data Preserved During Deploy" section
- Document data/ directory structure (receipts/, telegram/, cache/)
- Explain preservation mechanism (backup → deploy → restore)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 23:41:55 +00:00
Claude Agent
752858182d feat: [US-002] Fix UTF-8 encoding for Windows console
Add UTF-8 encoding setup at the top of backend/main.py to fix
'charmap' codec encoding errors when logging Romanian diacritics
(ă, î, ș, ț) on Windows console.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 23:36:47 +00:00
Claude Agent
b137e80b71 feat: multi-Oracle server support with runtime switching
Complete implementation of multi-server Oracle database support:

Backend:
- Multi-pool Oracle with lazy loading per server
- Email-to-server cache for automatic server discovery
- JWT tokens include server_id claim
- /auth/check-identity and /auth/check-email endpoints
- /auth/my-servers endpoint for listing user's accessible servers
- Server switch with password re-authentication

Frontend:
- New ServerSelector component for header dropdown
- Multi-step login flow (identity → server → password)
- Server switching from header with password modal
- Mobile drawer menu with server selection
- Dark mode support for all new components
- URL bookmark support with ?server= query param

Scripts:
- Unified start.sh replacing start-prod.sh/start-test.sh
- Unified ssh-tunnel.sh with multi-server support
- Updated status.sh for new architecture

Tests:
- E2E tests for multi-server and single-server login flows
- Backend unit tests for all new endpoints
- Oracle multi-pool integration tests

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 22:39:06 +00:00
Claude Agent
5f99ee2fd0 curatare 2026-01-22 13:41:48 +00:00
Claude Agent
fcf2722974 refactor(docs): create troubleshooting folder, cleanup OCR docs
- Create docs/troubleshooting/ for debugging guides
- Move OCR_MEMORY_SOLUTIONS_RESEARCH.md → troubleshooting/OCR_MEMORY_LEAKS.md
- Delete outdated docs/data-entry/OCR_PROFILE_TEST_RESULTS.md
- Update CLAUDE.md documentation index with troubleshooting reference

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-22 09:21:07 +00:00
Claude Agent
625fdcef5e chore: delete outdated OCR benchmark results
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-22 09:16:47 +00:00
Claude Agent
3baac5f03e refactor(tests): move OCR benchmark results to tests directory
- Move docs/OCR_TEST_RESULTS.md → tests/ocr-validation/BENCHMARK_RESULTS.md
- Keep docs/OCR_MEMORY_SOLUTIONS_RESEARCH.md as technical reference

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-22 09:15:25 +00:00
Claude Agent
62f86250cc refactor(docs): consolidate and cleanup documentation
- Delete 9 deprecated/obsolete docs (~6,300 lines removed)
- Move test PDFs to tests/fixtures/ocr-samples/
- Create docs/DEPLOYMENT.md as principal guide
- Create tests/ocr-validation/README.md
- Update all refs for ultrathin monolith architecture
- Update OCR tests to use relative paths

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-22 09:14:51 +00:00
Claude Agent
1b9ebf1d8f feat(dashboard): Complete dashboard desktop cleanup and improvements
User Stories Completed:
- US-001: Eliminare SolduriCompactCard de pe Desktop
- US-002: Eliminare Icoane din Header-ul CollapsibleCard
- US-003: Reorganizare TreasuryDualCard - Text Înainte de Grafice
- US-004: Reorganizare ClientiBalanceCard - Text Înainte de Grafice
- US-005: Reorganizare FurnizoriBalanceCard - Text Înainte de Grafice
- US-006: Grafice Colapsabile în TreasuryDualCard
- US-007: Grafice Colapsabile în ClientiBalanceCard
- US-008: Grafice Colapsabile în FurnizoriBalanceCard
- US-009: Grafice Colapsabile în CashFlowMetricCard

Additional Improvements:
- Add cache metadata display (CacheFooter component) for all dashboard cards
- Add @cached decorators to get_monthly_flows and get_indicators_with_sparklines
- Fix financial indicators calculations and sparkline sync
- Add state reset on company change to prevent stale data
- New shared components: CacheFooter.vue, authRedirect.js
- Enhanced FinancialIndicatorsCard with sparklines and period selection

Squashed from branch: ralph/dashboard-desktop-cleanup (11 commits)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-22 07:27:27 +00:00
Claude Agent
69683b2d65 fix(dashboard): Add missing CollapsibleCard shared component
This component was imported in DashboardView.vue but never committed.
CollapsibleCard provides an expandable/collapsible card UI pattern used
for Trezorerie, Cash Flow, Clienți, and Furnizori dashboard cards.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 20:47:14 +00:00
Claude Agent
3039138e66 feat(financial-indicators): Sync desktop descriptions with mobile for UX consistency
Update all 34 indicator descriptions in the Expanded View (Desktop) section
to match the more descriptive Mobile Bottom Sheet format. Each description
now starts with a natural language explanation followed by the formula and
ideal threshold.

Categories updated: Lichiditate, Eficiență, Risc, Cash Flow, Dinamică,
Profitabilitate, and Altman Z-Score.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 20:46:13 +00:00
Claude Agent
dd4b90f922 feat(financial-indicators): Complete Financial Indicators Dashboard Card
Implementare completă a card-ului Indicatori Financiari în Dashboard Solduri:

Backend:
- Model FinancialIndicators cu 22+ indicatori organizați pe categorii
- Service cu calcule din VBAL (Lichiditate, Eficiență, Risc, Cash Flow, Dinamică)
- Altman Z-Score cu toate componentele (X1-X4) și valori absolute
- Profitabilitate cu ROA, ROE, Cifra Afaceri, Cheltuieli separate (operaționale/financiare)
- Caching inteligent pe company_id, luna, an

Frontend:
- FinancialIndicatorsCard.vue cu 4 indicatori principali collapsed
- Expanded view grupat pe categorii (desktop + mobile BottomSheet)
- Subindicatori pentru verificare manuală în balanță
- Traduceri complete în română
- Dark mode support complet
- Sparklines cu tooltips
- Responsive design (desktop grid + mobile carousel)

Documentație:
- PRD complet cu specificații și formule
- Descrieri cu conturi din planul contabil român (OMFP 1802/2014)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 17:32:48 +00:00
Claude Agent
15327687f4 feat(dashboard-solduri): Complete dashboard solduri v2 implementation
## Features
- US-2001: Create reusable SolduriCompactCard component
- US-2004: Solduri section on Desktop (top, without title)
- US-2005: Remove MaturityAndDetailsCard from Dashboard
- US-2006: Integrate Solduri data from dashboardStore
- US-2007: Visual indicators for financial status
- US-2008: Refresh button in Dashboard header

## UI Improvements
- Desktop: 2x2 grid for solduri cards with larger breakdown fonts
- Mobile: Single column layout with auto height
- Theme persistence: synchronous initialization to prevent flash
- Unified "Bonuri" icon (pi-shopping-bag) across all navigation

## Files Changed
- New: SolduriCompactCard.vue - expandable cards for Trezorerie/Clienți/Furnizori/TVA
- Modified: DashboardView.vue - integrated solduri section
- Modified: index.html - theme init script
- Modified: Mobile navigation components - icon consistency

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 08:37:10 +00:00
Claude Agent
eedc2bca67 feat(ui-fixes-phase6): Fix SpeedDial Bulk Upload și Mobile Spacing
- SpeedDial: Redus la 2 opțiuni (Bon Nou + Bulk Upload)
- SpeedDial: Eliminat masca gri (:mask="false")
- Bulk Upload: Acum deschide file picker direct (openBulkFileInput)
- Mobile spacing: Eliminat margin-top excesiv pe .mobile-layout
- MaturityAnalysisCard: Redus padding/margin pe mobil
- MaturityAnalysisView: Redus gap pe mobil

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-14 16:25:44 +00:00
Claude Agent
0868fc4ea3 feat(ui-fixes-phase6): Complete US-705 - Reducere Padding și Margin Top Excesiv
Implemented by Ralph autonomous loop.
Iteration: 5

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-13 22:39:06 +00:00
Claude Agent
e47e8956e0 feat(ui-fixes-phase6): Complete US-704 - Mărire Spațiu Tabel Scadențe
Implemented by Ralph autonomous loop.
Iteration: 4

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-13 22:36:09 +00:00
Claude Agent
6fd5ffdf94 feat(ui-fixes-phase6): Complete US-703 - Navigare Hamburger pe Paginile Analize
Implemented by Ralph autonomous loop.
Iteration: 3

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-13 22:34:32 +00:00
Claude Agent
7d5e8f32ed feat(ui-fixes-phase6): Complete US-702 - Verificare Meniu Acțiuni Per Bon
Implemented by Ralph autonomous loop.
Iteration: 2

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-13 22:31:33 +00:00
Claude Agent
cc52ad1850 feat(ui-fixes-phase6): Complete US-701 - Reparare SpeedDial FAB pe Lista Bonuri
Implemented by Ralph autonomous loop.
Iteration: 1

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-13 22:29:57 +00:00
Claude Agent
6775565e01 feat(ui-fixes-phase6): Complete US-610 - Eliminare Spațiu Gol Deasupra Tabelelor
Implemented by Ralph autonomous loop.
Iteration: 11

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-13 16:48:47 +00:00
Claude Agent
bc8537f9b5 feat(ui-fixes-phase6): Complete US-609 - Buton Resetează pe Toate Paginile cu Filtre Mobil
Implemented by Ralph autonomous loop.
Iteration: 10

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-13 16:42:27 +00:00
Claude Agent
109ef50fb2 feat(ui-fixes-phase6): Complete US-608 - Fix Buton FAB SpeedDial în Lista Bonuri
Implemented by Ralph autonomous loop.
Iteration: 9

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-13 16:38:01 +00:00
Claude Agent
ec678b4b04 feat(ui-fixes-phase6): Complete US-607 - Secțiune Utilizator Compactă în Meniul Mobil
Implemented by Ralph autonomous loop.
Iteration: 8

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-13 16:33:08 +00:00
Claude Agent
83ec6e69d5 feat(ui-fixes-phase6): Complete US-606 - Layout Scrollabil Unificat în Meniul Mobil
Implemented by Ralph autonomous loop.
Iteration: 7

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-13 16:29:48 +00:00
Claude Agent
36f798eb34 feat(ui-fixes-phase6): Complete US-605 - Companie/Perioadă Colapsabile în Meniul Mobil
Implemented by Ralph autonomous loop.
Iteration: 6

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-13 16:23:39 +00:00
Claude Agent
0737f0626b feat(ui-fixes-phase6): Complete US-604 - Toggle Temă cu 3 Stări în Meniul Mobil
Implemented by Ralph autonomous loop.
Iteration: 5

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-13 16:18:22 +00:00
Claude Agent
496fd8014e feat(ui-fixes-phase6): Complete US-603 - Implementare Pagină Facturi Detaliate
Implemented by Ralph autonomous loop.
Iteration: 3

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-13 16:11:33 +00:00
Claude Agent
ea82f61a74 feat(ui-fixes-phase6): Complete US-602 - Tab-uri Clienți/Furnizori în Pagina Scadențe
Implemented by Ralph autonomous loop.
Iteration: 2

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-13 16:08:47 +00:00