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
This commit is contained in:
54
scripts/test-lexoffice-finalize.ts
Normal file
54
scripts/test-lexoffice-finalize.ts
Normal file
@@ -0,0 +1,54 @@
|
||||
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();
|
||||
Reference in New Issue
Block a user