- Updated billing frontend views to use Jinja2 templates for rendering HTML pages. - Added support for displaying supplier invoices, template builder, and templates list with titles. - Introduced a new configuration setting for company CVR number. - Enhanced OllamaService to support credit notes in invoice extraction, including detailed JSON output format. - Improved PDF text extraction using pdfplumber for better layout handling. - Added a modal for editing vendor details with comprehensive fields and validation. - Implemented invoice loading and display functionality in vendor detail view. - Updated vendor management to remove priority handling and improve error messaging. - Added tests for AI analyze endpoint and CVR filtering to ensure correct behavior. - Created migration script to support credit notes in the database schema.
39 lines
1.2 KiB
Python
39 lines
1.2 KiB
Python
"""
|
|
Billing Frontend Views
|
|
Serves HTML pages for billing features
|
|
"""
|
|
|
|
from fastapi import APIRouter, Request
|
|
from fastapi.templating import Jinja2Templates
|
|
from fastapi.responses import HTMLResponse
|
|
|
|
router = APIRouter()
|
|
templates = Jinja2Templates(directory="app")
|
|
|
|
|
|
@router.get("/billing/supplier-invoices", response_class=HTMLResponse)
|
|
async def supplier_invoices_page(request: Request):
|
|
"""Supplier invoices (kassekladde) page"""
|
|
return templates.TemplateResponse("billing/frontend/supplier_invoices.html", {
|
|
"request": request,
|
|
"title": "Kassekladde"
|
|
})
|
|
|
|
|
|
@router.get("/billing/template-builder", response_class=HTMLResponse)
|
|
async def template_builder_page(request: Request):
|
|
"""Template builder for supplier invoice extraction"""
|
|
return templates.TemplateResponse("billing/frontend/template_builder.html", {
|
|
"request": request,
|
|
"title": "Template Builder"
|
|
})
|
|
|
|
|
|
@router.get("/billing/templates", response_class=HTMLResponse)
|
|
async def templates_list_page(request: Request):
|
|
"""Templates list and management page"""
|
|
return templates.TemplateResponse("billing/frontend/templates_list.html", {
|
|
"request": request,
|
|
"title": "Templates"
|
|
})
|