|
@@ -147,9 +147,15 @@ def forderungen_liste(request: Request, db: Session = Depends(get_session), limi
|
|
|
|
|
|
|
|
|
|
|
|
|
@router.get("/app/forderungen/details/{primary_key}", response_class=HTMLResponse)
|
|
@router.get("/app/forderungen/details/{primary_key}", response_class=HTMLResponse)
|
|
|
-def forderungen_details(request: Request, primary_key: str, db: Session = Depends(get_session), limit: int = 100):
|
|
|
|
|
|
|
+def forderungen_details(request: Request, primary_key: str, db: Session = Depends(get_session)):
|
|
|
|
|
|
|
|
pkey = convert_primary_key("forderungen", primary_key)
|
|
pkey = convert_primary_key("forderungen", primary_key)
|
|
|
|
|
+
|
|
|
|
|
+ template_context = get_template_context(request, pkey, db)
|
|
|
|
|
+ return templates.TemplateResponse(request, "forderungen/details/details.html", template_context)
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+def get_template_context(request: Request, pkey: dict[str, str], db: Session) -> dict:
|
|
|
context = {
|
|
context = {
|
|
|
"appsmith": {
|
|
"appsmith": {
|
|
|
"URL": {
|
|
"URL": {
|
|
@@ -167,7 +173,7 @@ def forderungen_details(request: Request, primary_key: str, db: Session = Depend
|
|
|
for filename in [
|
|
for filename in [
|
|
|
"auftraege_positionen",
|
|
"auftraege_positionen",
|
|
|
"forderungen_buchungen",
|
|
"forderungen_buchungen",
|
|
|
- "forderungen_kommentar",
|
|
|
|
|
|
|
+ "forderungen_kommentare",
|
|
|
"forderungen_details",
|
|
"forderungen_details",
|
|
|
"forderungen_mahnungen",
|
|
"forderungen_mahnungen",
|
|
|
"versicherungen",
|
|
"versicherungen",
|
|
@@ -185,8 +191,7 @@ def forderungen_details(request: Request, primary_key: str, db: Session = Depend
|
|
|
}
|
|
}
|
|
|
template_context["files"] = get_files(pkey)
|
|
template_context["files"] = get_files(pkey)
|
|
|
template_context["add7days"] = (datetime.now() + timedelta(days=7)).strftime("%Y-%m-%d")
|
|
template_context["add7days"] = (datetime.now() + timedelta(days=7)).strftime("%Y-%m-%d")
|
|
|
-
|
|
|
|
|
- return templates.TemplateResponse(request, "forderungen/details/details.html", template_context)
|
|
|
|
|
|
|
+ return template_context
|
|
|
|
|
|
|
|
|
|
|
|
|
@router.post("/app/forderungen/details/{primary_key}", response_class=HTMLResponse)
|
|
@router.post("/app/forderungen/details/{primary_key}", response_class=HTMLResponse)
|
|
@@ -247,6 +252,10 @@ async def post_forderungen_details(
|
|
|
q = db.execute(text(subquery))
|
|
q = db.execute(text(subquery))
|
|
|
print(q.rowcount)
|
|
print(q.rowcount)
|
|
|
db.commit()
|
|
db.commit()
|
|
|
|
|
+ template_context = get_template_context(request, pkey, db)
|
|
|
|
|
+ if source == "comments":
|
|
|
|
|
+ return templates.TemplateResponse(request, "base/chat_container.html", template_context)
|
|
|
|
|
+ return templates.TemplateResponse(request, "forderungen/details/details_formular.html", template_context)
|
|
|
|
|
|
|
|
|
|
|
|
|
def convert_primary_key(area: str, primary_key: str) -> dict[str, str]:
|
|
def convert_primary_key(area: str, primary_key: str) -> dict[str, str]:
|