Files
Atlas/scripts/test-lexoffice-finalize.ts
Julia Wehden a2c95c70e7 feat: Equipment-System, Buchungsbearbeitung, Kundenadresse, LexOffice-Fix
- Vintage Modell hinzugefuegt
- Equipment Multi-Select (Neue Buchung + Bearbeitung)
- Kundenadresse in Formularen
- Bearbeiten-Seite fuer Buchungen
- Abbau-Zeiten in Formularen und Uebersicht
- Vertrag PDF nur bei Privatkunden
- LexOffice Kontakt-Erstellung Fix (BUSINESS)
- Zurueck-Pfeil auf Touren-Seite
2026-03-19 16:21:55 +01:00

55 lines
1.6 KiB
TypeScript

import { LexOfficeService } from '../lib/lexoffice';
async function main() {
const lexoffice = new LexOfficeService();
console.log('🧪 Teste LexOffice Quotation finalize Parameter...\n');
// Einfaches Test-Angebot erstellen
const testQuotation = {
voucherDate: new Date().toISOString().split('T')[0] + 'T00:00:00.000+01:00',
expirationDate: new Date(Date.now() + 14 * 24 * 60 * 60 * 1000).toISOString().split('T')[0] + 'T00:00:00.000+01:00',
address: {
name: 'Test Kunde',
countryCode: 'DE',
},
lineItems: [
{
type: 'custom' as const,
name: 'Test Artikel',
quantity: 1,
unitName: 'Stück',
unitPrice: {
currency: 'EUR',
netAmount: 100,
taxRatePercentage: 19,
},
},
],
totalPrice: {
currency: 'EUR',
},
taxConditions: {
taxType: 'net' as const,
},
};
try {
console.log('📤 Erstelle Quotation MIT finalize=true...');
const result = await lexoffice.createQuotation(testQuotation, true);
console.log('✅ Quotation erstellt:', result);
console.log('\n🔍 Lade Quotation Details...');
const details = await lexoffice.getQuotation(result.id);
console.log('📊 Quotation Status:', JSON.stringify(details, null, 2));
console.log('\n📄 Versuche PDF Download...');
const pdf = await lexoffice.getQuotationPDF(result.id);
console.log('✅ PDF erfolgreich heruntergeladen! Größe:', pdf.length, 'bytes');
} catch (error: any) {
console.error('❌ Fehler:', error.message);
}
}
main();