getMain #465

Merged
UMBENOMENA merged 18 commits from main into UMBE 2025-03-26 14:33:20 +00:00
3 changed files with 9 additions and 2 deletions
Showing only changes of commit 302ae192ac - Show all commits

View File

@@ -9,6 +9,7 @@ import { BilderKategorie, Enums, Heizungsstatus } from "#lib/server/prisma.js";
import { fileURLToPath } from "url";
import { copyPage } from "./utils/copyPage.js";
import { PERSISTENT_DIR } from "#lib/server/constants.js";
import { shortenUID } from "#server/lib/hash.js";
/* -------------------------------- Pdf Tools ------------------------------- */
@@ -52,13 +53,15 @@ export async function pdfDatenblattVerbrauchsausweisWohnen(ausweis: Verbrauchsau
const innerWidth = pages[0].getWidth() - marginX * 2;
const id = shortenUID(ausweis.uid);
const layout = xml2pdf(`<layout height="${pages[0].getHeight()}" width="${pages[0].getWidth()}" marginTop="150" marginLeft="${marginX}" marginRight="${marginX}">
<text size="12" lineHeight="14">${benutzer.vorname} ${benutzer.name}</text>
<text size="12" lineHeight="14">${benutzer.adresse}</text>
<text size="12" lineHeight="14">${benutzer.plz} ${benutzer.ort}</text>
<flex direction="row" justify="space-between" marginTop="55" width="${innerWidth}">
<text size="12" font="bold">Datenblatt Energieausweis</text>
<text size="12">Ausweis ID: ${ausweis.uid}</text>
<text size="12">Ausweis ID: ${id}</text>
</flex>
<text size="12" lineHeight="14" font="bold" marginTop="10">Gebäudedaten</text>
<text size="12" lineHeight="14">Adresse: ${objekt.adresse}, ${objekt.plz} ${objekt.ort}</text>

View File

@@ -34,6 +34,7 @@
export let objekt: ObjektClient
export let aufnahme: AufnahmeClient
export let user: BenutzerClient = {} as BenutzerClient;
export let ausweistyp: Enums.AusweisTyp
export let bilder: UploadedGebaeudeBild[] = []
export let uid: string;

View File

@@ -6,8 +6,11 @@ import { AufnahmeClient, BedarfsausweisWohnenClient, ObjektClient, UploadedGebae
import { createCaller } from "src/astro-typesafe-api-caller";
import { API_ACCESS_TOKEN_COOKIE_NAME } from "#lib/constants";
import { validateAccessTokenServer } from "#server/lib/validateAccessToken";
import { Enums } from "#lib/server/prisma";
const uid = Astro.url.searchParams.get("uid") || "";
const uid_aufnahme = Astro.url.searchParams.get("aufnahme")
const ausweistyp = Astro.url.searchParams.get("ausweistyp") || Enums.AusweisTyp.Standard;
let ausweis: VerbrauchsausweisWohnenClient = {} as VerbrauchsausweisWohnenClient;
let aufnahme: AufnahmeClient = {} as AufnahmeClient;
let objekt: ObjektClient = {} as ObjektClient;
@@ -78,5 +81,5 @@ if (uid) {
---
<AusweisLayout title="Bedarfsausweis erstellen | IBCornelsen">
<BedarfsausweisWohnenModule client:only {ausweis} {objekt} {aufnahme} {bilder} {uid}></BedarfsausweisWohnenModule>
<BedarfsausweisWohnenModule client:only {ausweis} {objekt} {aufnahme} {bilder} {ausweistyp} {uid}></BedarfsausweisWohnenModule>
</AusweisLayout>