add workflow
Some checks failed
Deploy Amap / deploy (push) Has been cancelled

This commit is contained in:
2026-02-19 23:38:26 +01:00
parent 7574626e52
commit 242e29c8a6
46 changed files with 536 additions and 30 deletions

View File

@@ -5,6 +5,8 @@ import html
from weasyprint import HTML
import io
import pathlib
def generate_html_contract(
contract: models.Contract,
cheques: list[dict],
@@ -13,7 +15,7 @@ def generate_html_contract(
recurrent_price: float,
total_price: float
):
template_dir = "./src/contracts/templates"
template_dir = pathlib.Path().resolve() + "/src/contracts/templates"
template_loader = jinja2.FileSystemLoader(searchpath=template_dir)
template_env = jinja2.Environment(loader=template_loader, autoescape=jinja2.select_autoescape(["html", "xml"]))
template_file = "layout.html"
@@ -57,7 +59,8 @@ def generate_html_contract(
return HTML(
string=output_text,
base_url=template_dir
base_url=template_dir,
**options
).write_pdf()
from odfdo import Document, Table, Row, Cell