M5.1 OCR upload + parse + invoices CRUD (ERP)
- erp/ocr.py: FastAPI router under /api/erp/*
- POST /ocr/upload: file → pgz_sport.invoice_uploads (sha256, mime, klub_id, tenant_id)
- POST /ocr/parse: Tesseract+pdftotext OCR + DeepSeek V3 LLM extraction
- GET/POST/PUT /invoices, /invoices/{id}/pay, uploads list
- Wired into pgz_sport_api.py
- HR invoice regex (OIB, IBAN, datum DD.MM.YYYY i ISO, ukupno/PDV)
- DeepSeek V3 returns JSON object {izdavatelj_*, kupac_*, iznos_neto/pdv/brutto, stavke[], vrsta_troska...}
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1384,6 +1384,22 @@ try:
|
||||
except Exception as e:
|
||||
print(f'[ENRICH] router fail: {e}')
|
||||
|
||||
# === Round 3 / CC4 — ERP (M5: OCR + Invoices, M6: Putni nalozi) ===
|
||||
sys.path.insert(0, '/opt/pgz-sport')
|
||||
try:
|
||||
from erp.ocr import router as erp_ocr_router
|
||||
app.include_router(erp_ocr_router)
|
||||
print('[ERP/OCR] router loaded')
|
||||
except Exception as e:
|
||||
print(f'[ERP/OCR] router fail: {e}')
|
||||
|
||||
try:
|
||||
from erp.putni_nalozi import router as erp_putni_router
|
||||
app.include_router(erp_putni_router)
|
||||
print('[ERP/PUTNI] router loaded')
|
||||
except Exception as e:
|
||||
print(f'[ERP/PUTNI] router fail: {e}')
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user