@casoon/invoice-generator
Version:
Generate PDF invoices, XRechnung XML, and ZUGFeRD PDF/A-3 from JSON data with TypeScript support
100 lines (88 loc) • 1.89 kB
text/typescript
export interface ContactInfo {
phone: string;
mobile: string;
email: string;
website?: string;
}
export interface Address {
street: string;
postalCode: string;
city: string;
}
export interface InvoiceSender {
name: string;
company?: string;
address: Address;
contactInfo: ContactInfo;
businessOwner?: string;
vatId?: string;
}
export interface InvoiceRecipient {
name: string;
address: Address;
}
export interface InvoiceDetails {
invoiceNumber: string;
customerNumber: string;
invoiceDate: string;
deliveryDate: string;
servicePeriod: string;
dueDate: string;
vatId?: string;
}
export interface Salutation {
greeting: string;
introduction: string;
}
export interface InvoiceItem {
description: string;
quantity: number;
unit: string;
vatRate: number;
unitPrice: number;
total: number;
currency: string;
}
export interface InvoiceTotals {
netAmount: number;
vatRate: number;
vatAmount: number;
grossAmount: number;
currency: string;
}
export interface PaymentInfo {
paymentTerms: string;
dueDate: string; // Zahlungsziel im Format "DD.MM.YY"
bank: string;
accountHolder: string;
iban: string;
bic: string;
}
export interface Metadata {
createdWith: string;
creationDate: string;
filename: string;
}
export interface Invoice {
sender: InvoiceSender;
recipient: InvoiceRecipient;
details: InvoiceDetails;
salutation: Salutation;
items: InvoiceItem[];
totals: InvoiceTotals;
paymentInfo: PaymentInfo;
metadata: Metadata;
}
export interface InvoiceData {
invoices: Invoice[];
extractionDate: string;
invoiceCount: number;
formatVersion: string;
description: string;
}
export interface PDFOptions {
template?: 'default' | 'modern' | 'classic';
language?: 'de' | 'en';
includeLogo?: boolean;
logoPath?: string; // Pfad zur Logo-Datei (PNG, JPG) oder URL
}