xinvoice/test/assets/letter/letter1.ts
2025-04-03 15:53:08 +00:00

182 lines
4.0 KiB
TypeScript

import { business, finance } from '@tsclass/tsclass';
import type { TInvoice, TDebitNote } from '../../../ts/interfaces/common.js';
const fromContact: business.TContact = {
type: 'company',
name: 'Awesome From Company',
description: 'a company that does stuff',
address: {
streetName: 'Awesome Street',
houseNumber: '5',
city: 'Bremen',
country: 'Germany',
postalCode: '28359',
},
status: 'active',
foundedDate: {
year: 2000,
month: 1,
day: 1
},
registrationDetails: {
vatId: 'DE12345678',
registrationId: '',
registrationName: ''
},
email: 'hello@awesome.company',
phone: '+49 421 1234567',
fax: '+49 421 1234568',
};
const toContact: business.TContact = {
type: 'company',
name: 'Awesome To GmbH',
description: 'a company that does stuff',
address: {
streetName: 'Awesome Street',
houseNumber: '5',
city: 'Bremen',
country: 'Germany',
postalCode: '28359'
},
status: 'active',
foundedDate: {
year: 2000,
month: 1,
day: 1
},
registrationDetails: {
vatId: 'BE12345678',
registrationId: '',
registrationName: ''
},
customerNumber: 'LL-CLIENT-123',
};
export const demoLetter: TInvoice = {
type: 'invoice',
id: 'LL-INV-48765',
invoiceType: 'debitnote',
date: Date.now(),
status: 'invoice',
versionInfo: {
type: 'draft',
version: '1.0.0',
},
language: 'en',
incidenceId: 'LL-INV-48765',
from: fromContact,
to: toContact,
subject: 'Invoice: LL-INV-48765',
accentColor: null,
content: {
textData: null,
timesheetData: null,
contractData: {
contractDate: Date.now(),
id: 'someid'
},
invoiceData: {
id: 'LL-INV-48765',
reverseCharge: true,
dueInDays: 30,
billedBy: fromContact,
billedTo: toContact,
status: null,
deliveryDate: new Date().getTime(),
periodOfPerformance: null,
printResult: null,
currency: 'EUR',
notes: [],
type: 'debitnote',
items: [
{
position: 0,
name: 'Item with 19% VAT',
unitQuantity: 2,
unitNetPrice: 100,
unitType: 'hours',
vatPercentage: 19,
},
{
position: 1,
name: 'Item with 7% VAT',
unitQuantity: 4,
unitNetPrice: 100,
unitType: 'hours',
vatPercentage: 7,
},
{
position: 2,
name: 'Item with 7% VAT',
unitQuantity: 3,
unitNetPrice: 230,
unitType: 'hours',
vatPercentage: 7,
},
{
position: 3,
name: 'Item with 21% VAT',
unitQuantity: 1,
unitNetPrice: 230,
unitType: 'hours',
vatPercentage: 21,
},
{
position: 4,
name: 'Item with 0% VAT',
unitQuantity: 6,
unitNetPrice: 230,
unitType: 'hours',
vatPercentage: 0,
},
{
position: 5,
name: 'Item with 19% VAT',
unitQuantity: 8,
unitNetPrice: 100,
unitType: 'hours',
vatPercentage: 19,
},
{
position: 6,
name: 'Item with 7% VAT',
unitQuantity: 9,
unitNetPrice: 100,
unitType: 'hours',
vatPercentage: 7,
},
{
position: 8,
name: 'Item with 7% VAT',
unitQuantity: 4,
unitNetPrice: 230,
unitType: 'hours',
vatPercentage: 7,
},
{
position: 9,
name: 'Item with 21% VAT',
unitQuantity: 3,
unitNetPrice: 230,
unitType: 'hours',
vatPercentage: 21,
},
{
position: 10,
name: 'Item with 0% VAT',
unitQuantity: 1,
unitNetPrice: 230,
unitType: 'hours',
vatPercentage: 0,
},
],
}
},
objectActions: [],
pdf: null,
legalContact: null,
logoUrl: null,
pdfAttachments: null,
};