Kleinere Fehler gefixt
This commit is contained in:
4
Makefile
4
Makefile
@@ -12,7 +12,7 @@ BACKUP_FILENAME := $(HOME)/backups/$(shell date +"%Y-%m-%d_%H-%M-%S").sql.gz
|
||||
online-energieausweis:
|
||||
bun run dev --host
|
||||
|
||||
dev: install-dependencies database online-energieausweis
|
||||
dev: database online-energieausweis
|
||||
|
||||
database:
|
||||
docker compose up
|
||||
@@ -69,4 +69,4 @@ prod: install-dependencies run-database
|
||||
# - echo "CERTIFICATE=$(cat /etc/letsencrypt/live/ibcornelsen.de/fullchain.pem | base64 | tr -d '\n')" >> ~/online-energieausweis/.env;
|
||||
|
||||
- pm2 delete online-energieausweis
|
||||
pm2 start --name "online-energieausweis" --log ~/logs/`date '+%d-%m-%Y_%H:%M:%S'`.log --time bun -- run ./server.ts
|
||||
NODE_ENV="production" pm2 start --name "online-energieausweis" --update-env --log ~/logs/`date '+%d-%m-%Y_%H:%M:%S'`.log --time bun -- run ./server.ts
|
||||
47
prisma/migrations/20250223113449_migration/migration.sql
Normal file
47
prisma/migrations/20250223113449_migration/migration.sql
Normal file
@@ -0,0 +1,47 @@
|
||||
-- AlterTable
|
||||
ALTER TABLE "Anteilshaber" ALTER COLUMN "uid" SET DEFAULT 'ant-' || gen_random_uuid();
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE "Aufnahme" ALTER COLUMN "uid" SET DEFAULT 'auf-' || gen_random_uuid();
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE "BedarfsausweisGewerbe" ALTER COLUMN "uid" SET DEFAULT 'bag-' || gen_random_uuid();
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE "BedarfsausweisWohnen" ALTER COLUMN "uid" SET DEFAULT 'baw-' || gen_random_uuid();
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE "Bild" ALTER COLUMN "uid" SET DEFAULT 'img-' || gen_random_uuid();
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE "Event" ALTER COLUMN "uid" SET DEFAULT 'evt-' || gen_random_uuid();
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE "GEGEinpreisung" ALTER COLUMN "uid" SET DEFAULT 'gge-' || gen_random_uuid();
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE "GEGNachweisGewerbe" ALTER COLUMN "uid" SET DEFAULT 'gnw-' || gen_random_uuid();
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE "GEGNachweisWohnen" ALTER COLUMN "uid" SET DEFAULT 'gnw-' || gen_random_uuid();
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE "Objekt" ALTER COLUMN "uid" SET DEFAULT 'obj-' || gen_random_uuid();
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE "Rechnung" ALTER COLUMN "uid" SET DEFAULT 'inv-' || gen_random_uuid();
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE "Tickets" ALTER COLUMN "uid" SET DEFAULT 'tkt-' || gen_random_uuid();
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE "Unterlage" ALTER COLUMN "uid" SET DEFAULT 'pln-' || gen_random_uuid();
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE "VerbrauchsausweisGewerbe" ALTER COLUMN "uid" SET DEFAULT 'vag-' || gen_random_uuid();
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE "VerbrauchsausweisWohnen" ALTER COLUMN "uid" SET DEFAULT 'vaw-' || gen_random_uuid();
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE "benutzer" ALTER COLUMN "uid" SET DEFAULT 'usr-' || gen_random_uuid();
|
||||
@@ -14,29 +14,27 @@ export const createCaller = createCallerFactory({
|
||||
"admin/stornieren": await import("../src/pages/api/admin/stornieren.ts"),
|
||||
"aufnahme": await import("../src/pages/api/aufnahme/index.ts"),
|
||||
"ausweise": await import("../src/pages/api/ausweise/index.ts"),
|
||||
"bedarfsausweis-wohnen/[uid]": await import("../src/pages/api/bedarfsausweis-wohnen/[uid].ts"),
|
||||
"bedarfsausweis-wohnen": await import("../src/pages/api/bedarfsausweis-wohnen/index.ts"),
|
||||
"auth/access-token": await import("../src/pages/api/auth/access-token.ts"),
|
||||
"auth/forgot-password": await import("../src/pages/api/auth/forgot-password.ts"),
|
||||
"auth/refresh-token": await import("../src/pages/api/auth/refresh-token.ts"),
|
||||
"bedarfsausweis-wohnen/[uid]": await import("../src/pages/api/bedarfsausweis-wohnen/[uid].ts"),
|
||||
"bedarfsausweis-wohnen": await import("../src/pages/api/bedarfsausweis-wohnen/index.ts"),
|
||||
"ausweise": await import("../src/pages/api/ausweise/index.ts"),
|
||||
"aufnahme": await import("../src/pages/api/aufnahme/index.ts"),
|
||||
"bilder/[uid]": await import("../src/pages/api/bilder/[uid].ts"),
|
||||
"geg-nachweis-gewerbe/[uid]": await import("../src/pages/api/geg-nachweis-gewerbe/[uid].ts"),
|
||||
"geg-nachweis-gewerbe": await import("../src/pages/api/geg-nachweis-gewerbe/index.ts"),
|
||||
"geg-nachweis-wohnen/[uid]": await import("../src/pages/api/geg-nachweis-wohnen/[uid].ts"),
|
||||
"geg-nachweis-wohnen": await import("../src/pages/api/geg-nachweis-wohnen/index.ts"),
|
||||
"objekt": await import("../src/pages/api/objekt/index.ts"),
|
||||
"ticket": await import("../src/pages/api/ticket/index.ts"),
|
||||
"rechnung/anfordern": await import("../src/pages/api/rechnung/anfordern.ts"),
|
||||
"rechnung": await import("../src/pages/api/rechnung/index.ts"),
|
||||
"ticket": await import("../src/pages/api/ticket/index.ts"),
|
||||
"user": await import("../src/pages/api/user/index.ts"),
|
||||
"user/self": await import("../src/pages/api/user/self.ts"),
|
||||
"webhooks/mollie": await import("../src/pages/api/webhooks/mollie.ts"),
|
||||
"verbrauchsausweis-gewerbe/[uid]": await import("../src/pages/api/verbrauchsausweis-gewerbe/[uid].ts"),
|
||||
"verbrauchsausweis-gewerbe": await import("../src/pages/api/verbrauchsausweis-gewerbe/index.ts"),
|
||||
"verbrauchsausweis-wohnen/[uid]": await import("../src/pages/api/verbrauchsausweis-wohnen/[uid].ts"),
|
||||
"verbrauchsausweis-wohnen": await import("../src/pages/api/verbrauchsausweis-wohnen/index.ts"),
|
||||
"webhooks/mollie": await import("../src/pages/api/webhooks/mollie.ts"),
|
||||
"aufnahme/[uid]/bilder": await import("../src/pages/api/aufnahme/[uid]/bilder.ts"),
|
||||
"aufnahme/[uid]": await import("../src/pages/api/aufnahme/[uid]/index.ts"),
|
||||
"aufnahme/[uid]/unterlagen": await import("../src/pages/api/aufnahme/[uid]/unterlagen.ts"),
|
||||
|
||||
@@ -87,7 +87,7 @@ xl:grid-cols-3 xl:gap-x-8 xl:gap-y-8
|
||||
name="rechnung_ort"
|
||||
type="text"
|
||||
required
|
||||
value={rechnung.ort}
|
||||
bind:value={rechnung.ort}
|
||||
/>
|
||||
|
||||
<div class="help-label">
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import { fade } from "svelte/transition";
|
||||
import WidgetCardTemplate from "#components/widgets/WidgetCardTemplate_IBC.svelte";
|
||||
import { PRICES } from "#lib/constants.js";
|
||||
import { Enums } from "#lib/client/prisma";
|
||||
import { Enums } from "#lib/client/prisma.js";
|
||||
|
||||
let gebaeudetyp: string = "bitte auswählen";
|
||||
let anlass: string = "bitte auswählen";
|
||||
|
||||
@@ -43,6 +43,10 @@ export class Image extends PDFElement {
|
||||
async draw(page: PDFPage, x: number, y: number) {
|
||||
let embed: PDFImage;
|
||||
if (this.options.src) {
|
||||
if (!fs.existsSync(this.options.src)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const img = fs.readFileSync(this.options.src)
|
||||
if (this.options.src.split(".").pop() === "png") {
|
||||
embed = await page.doc.embedPng(img)
|
||||
|
||||
@@ -5,7 +5,7 @@ import { PDFDocument, rgb, StandardFonts, TextAlignment } from "pdf-lib";
|
||||
import { checkbox, flex, text } from "./elements/index.js";
|
||||
import { xml2pdf } from "./elements/xml2pdf.js";
|
||||
import moment from "moment";
|
||||
import { BilderKategorie, Heizungsstatus } from "#lib/server/prisma";
|
||||
import { BilderKategorie, Heizungsstatus } from "#lib/server/prisma.js";
|
||||
import { fileURLToPath } from "url";
|
||||
import { copyPage } from "./utils/copyPage.js";
|
||||
import { PERSISTENT_DIR } from "#lib/server/constants.js";
|
||||
@@ -51,7 +51,7 @@ export async function pdfDatenblattVerbrauchsausweisWohnen(ausweis: Verbrauchsau
|
||||
}
|
||||
|
||||
const innerWidth = pages[0].getWidth() - marginX * 2;
|
||||
|
||||
|
||||
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>
|
||||
@@ -337,74 +337,5 @@ export async function pdfDatenblattVerbrauchsausweisWohnen(ausweis: Verbrauchsau
|
||||
layoutPage2.draw(pages[1], 0, pages[1].getHeight())
|
||||
layoutPage3.draw(pages[2], 0, pages[2].getHeight())
|
||||
|
||||
// const containerWidth = width - marginX;
|
||||
|
||||
// const layout = flex([
|
||||
// flex([
|
||||
// checkbox(8, 8), text("Neubau", {
|
||||
// color: rgb(0,0,0),
|
||||
// font,
|
||||
// fontSize: 12
|
||||
// })
|
||||
// ], {
|
||||
// align: "center",
|
||||
// justify: "center",
|
||||
// gap: 5,
|
||||
// height: 12,
|
||||
// page: pages[0]
|
||||
// }),
|
||||
// flex([
|
||||
// checkbox(8, 8), text("Vermietung/Verkauf", {
|
||||
// color: rgb(0,0,0),
|
||||
// font,
|
||||
// fontSize: 12
|
||||
// })
|
||||
// ], {
|
||||
// align: "center",
|
||||
// justify: "center",
|
||||
// gap: 5,
|
||||
// height: 12,
|
||||
// page: pages[0]
|
||||
// }),
|
||||
// flex([
|
||||
// checkbox(8, 8), text("Modernisierung", {
|
||||
// color: rgb(0,0,0),
|
||||
// font,
|
||||
// fontSize: 12
|
||||
// })
|
||||
// ], {
|
||||
// align: "center",
|
||||
// justify: "center",
|
||||
// gap: 5,
|
||||
// height: 12,
|
||||
// page: pages[0]
|
||||
// }),
|
||||
// flex([
|
||||
// checkbox(8, 8), text("Sonstiges", {
|
||||
// color: rgb(0,0,0),
|
||||
// font,
|
||||
// fontSize: 12
|
||||
// })
|
||||
// ], {
|
||||
// align: "center",
|
||||
// justify: "center",
|
||||
// gap: 5,
|
||||
// height: 12,
|
||||
// page: pages[0]
|
||||
// })
|
||||
// ], {
|
||||
// align: "center",
|
||||
// justify: "space-between",
|
||||
// gap: 15,
|
||||
// x: marginX,
|
||||
// y: height - marginY - 165,
|
||||
// height: 12,
|
||||
// width: containerWidth
|
||||
// })
|
||||
|
||||
// layout.draw(pages[0])
|
||||
|
||||
// pdf.getForm().flatten()
|
||||
|
||||
return pdf.save();
|
||||
}
|
||||
@@ -86,15 +86,19 @@ export async function pdfVerbrauchsausweisWohnen(ausweis: VerbrauchsausweisWohne
|
||||
const bild = bilder && bilder.find(image => image.kategorie === Enums.BilderKategorie.Gebaeude);
|
||||
|
||||
if (bild) {
|
||||
const file = fs.readFileSync(fileURLToPath(new URL(`${PERSISTENT_DIR}/images/${bild.uid}.jpg`, import.meta.url)))
|
||||
let image: PDFImage;
|
||||
image = await pdf.embedJpg(file)
|
||||
pages[0].drawImage(image, {
|
||||
x: 460.5,
|
||||
y: height - 289,
|
||||
width: 111,
|
||||
height: 138
|
||||
})
|
||||
const path = `${PERSISTENT_DIR}/images/${bild.uid}.jpg`;
|
||||
|
||||
if (fs.existsSync(path)) {
|
||||
const file = fs.readFileSync(fileURLToPath(new URL(path, import.meta.url)))
|
||||
let image: PDFImage;
|
||||
image = await pdf.embedJpg(file)
|
||||
pages[0].drawImage(image, {
|
||||
x: 460.5,
|
||||
y: height - 289,
|
||||
width: 111,
|
||||
height: 138
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// Nach 82 aus Wohnfläche ermittelt
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
import Bereich from "#components/labels/Bereich.svelte";
|
||||
import Ansprechpartner from "#components/Ausweis/Ansprechpartner.svelte";
|
||||
import Rechnungsadresse from "#components/Ausweis/Rechnungsadresse.svelte";
|
||||
import type { Bezahlmethoden } from "#lib/client/prisma";
|
||||
import { Enums } from "#lib/client/prisma";
|
||||
import type { Bezahlmethoden } from "#lib/client/prisma.js";
|
||||
import { Enums } from "#lib/client/prisma.js";
|
||||
import { dialogs } from "svelte-dialogs";
|
||||
import LoginDialog from "#components/LoginDialog.svelte";
|
||||
import {
|
||||
@@ -239,11 +239,19 @@
|
||||
}
|
||||
|
||||
if (result === null) {
|
||||
addNotification({
|
||||
dismissable: true,
|
||||
message: "Ups... Das hat nicht geklappt.",
|
||||
subtext: "Der Ausweis konnte nicht gespeichert werden, bitte versuchen sie es erneut oder kontaktieren sie unseren Support."
|
||||
})
|
||||
if (ausweisart === Enums.Ausweisart.GEGNachweisWohnen || ausweisart === Enums.Ausweisart.GEGNachweisGewerbe || ausweisart === Enums.Ausweisart.GEGNachweisBedarfsausweis) {
|
||||
addNotification({
|
||||
dismissable: true,
|
||||
message: "Ups... Das hat nicht geklappt.",
|
||||
subtext: "Der Ausweis konnte nicht gespeichert werden, bitte versuchen sie es erneut oder kontaktieren sie unseren Support."
|
||||
})
|
||||
} else {
|
||||
addNotification({
|
||||
dismissable: true,
|
||||
message: "Ups... Das hat nicht geklappt.",
|
||||
subtext: "Ihre Anfrage für einen GEG Nachweis konnte nicht gespeichert werden, bitte versuchen sie es erneut oder kontaktieren sie unseren Support."
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
@@ -350,9 +358,11 @@
|
||||
<Progressbar
|
||||
active={1}
|
||||
steps={["Gebäudedaten", "Kundendaten", "Bestätigung"]}
|
||||
{ausweisart}
|
||||
anliegen={"erstellen"}
|
||||
/>
|
||||
{:else}
|
||||
<Progressbar active={1} />
|
||||
<Progressbar active={1} {ausweisart} anliegen={"anfragen"} />
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
|
||||
@@ -98,7 +98,7 @@ export const POST: APIRoute = async (Astro) => {
|
||||
const aufnahme = JSON.parse(params.get("aufnahme") || "{}");
|
||||
const objekt = JSON.parse(params.get("objekt") || "{}");
|
||||
const bilder = JSON.parse(params.get("bilder") || "{}");
|
||||
const ausweisart: Enums.Ausweisart = params.get("ausweisart")
|
||||
const ausweisart: Enums.Ausweisart = JSON.parse(params.get("ausweisart") || "")
|
||||
|
||||
let user: BenutzerClient = {};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user