Compare commits
5 Commits
1a61da35cf
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1326156e8d | ||
|
|
6ec5d088a4 | ||
|
|
5af1a65815 | ||
|
|
ff0da6b3e2 | ||
|
|
08effe4e80 |
@@ -36,7 +36,7 @@ export async function GET(
|
|||||||
|
|
||||||
const pdfBuffer = await lexofficeService.getInvoicePDF(booking.lexofficeConfirmationId);
|
const pdfBuffer = await lexofficeService.getInvoicePDF(booking.lexofficeConfirmationId);
|
||||||
|
|
||||||
return new NextResponse(pdfBuffer, {
|
return new NextResponse(new Uint8Array(pdfBuffer), {
|
||||||
status: 200,
|
status: 200,
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/pdf',
|
'Content-Type': 'application/pdf',
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ export async function GET(
|
|||||||
priceConfig,
|
priceConfig,
|
||||||
};
|
};
|
||||||
|
|
||||||
const signatureData = booking.contractSignedOnline ? booking.contractSignatureData : undefined;
|
const signatureData = booking.contractSignedOnline ? booking.contractSignatureData ?? undefined : undefined;
|
||||||
|
|
||||||
const pdfBuffer = await generateContractFromTemplate(
|
const pdfBuffer = await generateContractFromTemplate(
|
||||||
bookingWithPriceConfig,
|
bookingWithPriceConfig,
|
||||||
@@ -55,7 +55,7 @@ export async function GET(
|
|||||||
signatureData
|
signatureData
|
||||||
);
|
);
|
||||||
|
|
||||||
return new NextResponse(pdfBuffer, {
|
return new NextResponse(new Uint8Array(pdfBuffer), {
|
||||||
status: 200,
|
status: 200,
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/pdf',
|
'Content-Type': 'application/pdf',
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ export async function GET(
|
|||||||
|
|
||||||
const pdfBuffer = await lexofficeService.getQuotationPDF(booking.lexofficeOfferId);
|
const pdfBuffer = await lexofficeService.getQuotationPDF(booking.lexofficeOfferId);
|
||||||
|
|
||||||
return new NextResponse(pdfBuffer, {
|
return new NextResponse(new Uint8Array(pdfBuffer), {
|
||||||
status: 200,
|
status: 200,
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/pdf',
|
'Content-Type': 'application/pdf',
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ export async function GET(req: NextRequest) {
|
|||||||
customerName: booking.customerName,
|
customerName: booking.customerName,
|
||||||
customerEmail: booking.customerEmail,
|
customerEmail: booking.customerEmail,
|
||||||
locationName: booking.location.name,
|
locationName: booking.location.name,
|
||||||
photoboxName: booking.photobox?.name || 'Keine Box',
|
photoboxName: booking.photobox?.model || 'Keine Box',
|
||||||
tourId: booking.tourId,
|
tourId: booking.tourId,
|
||||||
eventType: booking.eventType,
|
eventType: booking.eventType,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { NextRequest, NextResponse } from 'next/server';
|
|||||||
import { prisma } from '@/lib/prisma';
|
import { prisma } from '@/lib/prisma';
|
||||||
import { AIService } from '@/lib/ai-service';
|
import { AIService } from '@/lib/ai-service';
|
||||||
import { LexOfficeService } from '@/lib/lexoffice';
|
import { LexOfficeService } from '@/lib/lexoffice';
|
||||||
import { getCalendarService } from '@/lib/nextcloud-calendar';
|
import { nextcloudCalendar } from '@/lib/nextcloud-calendar';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* AUTO-WORKFLOW CRON-JOB
|
* AUTO-WORKFLOW CRON-JOB
|
||||||
@@ -48,7 +48,7 @@ export async function GET(request: NextRequest) {
|
|||||||
|
|
||||||
const aiService = new AIService();
|
const aiService = new AIService();
|
||||||
const lexoffice = new LexOfficeService();
|
const lexoffice = new LexOfficeService();
|
||||||
const calendar = getCalendarService();
|
const calendar = nextcloudCalendar;
|
||||||
|
|
||||||
let processed = 0;
|
let processed = 0;
|
||||||
let errors = 0;
|
let errors = 0;
|
||||||
|
|||||||
@@ -151,11 +151,11 @@ export class NextcloudCalendarService {
|
|||||||
|
|
||||||
// Suche nach "Buchungen" Kalender, sonst verwende ersten
|
// Suche nach "Buchungen" Kalender, sonst verwende ersten
|
||||||
let calendar = calendars.find((cal: any) =>
|
let calendar = calendars.find((cal: any) =>
|
||||||
cal.displayName?.toLowerCase().includes('buchung')
|
cal.displayName?.toLowerCase().includes('veranstaltung')
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!calendar) {
|
if (!calendar) {
|
||||||
console.warn('⚠️ Kein "Buchungen"-Kalender gefunden, verwende:', calendars[0].displayName);
|
console.warn('⚠️ Kein "Veranstaltungen"-Kalender gefunden, verwende:', calendars[0].displayName);
|
||||||
calendar = calendars[0];
|
calendar = calendars[0];
|
||||||
} else {
|
} else {
|
||||||
console.log('✅ Verwende Kalender:', calendar.displayName);
|
console.log('✅ Verwende Kalender:', calendar.displayName);
|
||||||
|
|||||||
Reference in New Issue
Block a user