update staging #532

Merged
IB-Cornelsen merged 4 commits from dev into staging 2025-04-29 18:20:06 +00:00
3 changed files with 32 additions and 13 deletions
Showing only changes of commit 6600d8dee8 - Show all commits

View File

@@ -688,7 +688,7 @@
{aufnahme.aussenwand_min_12cm_gedaemmt ? "Außenwand min. 12cm gedämmt" : ""}
</div>
<div class="text-xs space-y-1 p-2">
<span class="font-semibold">Hiermit bestätige ich {benutzer.vorname} {benutzer.name} als Besteller folgende Angaben:</span><br>
<span class="font-semibold">Hiermit bestätige ich {benutzer.vorname} {benutzer.name} als Besteller:</span><br>
{#if ausweis.pruefpunkt_heizungsalter}
<div>Das Heizungsalter ist jünger als 3 Jahre. Es betrifft einen Heizungstausch ohne energetische Verbesserung.</div>
{/if}

View File

@@ -199,19 +199,28 @@ export async function pdfVerbrauchsausweisGewerbe(ausweis: VerbrauchsausweisGewe
if (bild) {
const file = await getS3File("ibc-images", `${bild.id}.jpg`);
if (file) {
let image: PDFImage;
image = await pdf.embedJpg(file)
image = await pdf.embedJpg(file);
const originalWidth = image.width;
const originalHeight = image.height;
// Calculate the scaling factor to fit within the maximum dimensions while maintaining proportions
const scaleFactor = Math.min(111 / originalWidth, 138 / originalHeight);
const scaledWidth = originalWidth * scaleFactor;
const scaledHeight = originalHeight * scaleFactor;
pages[0].drawImage(image, {
x: 460.5,
y: height - 289,
width: 111,
height: 138
})
y: (height - 289 - scaledHeight) + 138, // Adjust y to align the image properly
width: scaledWidth,
height: scaledHeight
});
}
}
// Checkmark Verbrauchsausweis.
pages[0].drawText("x", {
x: 41,

View File

@@ -59,13 +59,23 @@ export async function pdfVerbrauchsausweisWohnen(ausweis: VerbrauchsausweisWohne
if (file) {
let image: PDFImage;
image = await pdf.embedJpg(file)
image = await pdf.embedJpg(file);
const originalWidth = image.width;
const originalHeight = image.height;
// Calculate the scaling factor to fit within the maximum dimensions while maintaining proportions
const scaleFactor = Math.min(111 / originalWidth, 138 / originalHeight);
const scaledWidth = originalWidth * scaleFactor;
const scaledHeight = originalHeight * scaleFactor;
pages[0].drawImage(image, {
x: 460.5,
y: height - 289,
width: 111,
height: 138
})
y: (height - 289 - scaledHeight) + 138, // Adjust y to align the image properly
width: scaledWidth,
height: scaledHeight
});
}
}