feat: enhance translation and invoice layout

This commit is contained in:
2025-03-24 08:55:27 +00:00
parent 1106b9648d
commit 04e668ff83
20 changed files with 2138 additions and 780 deletions

View File

@@ -1,47 +1,46 @@
import * as plugins from './plugins.js';
import * as interfaces from './interfaces/index.js';
import * as plugins from "./plugins.js";
import * as interfaces from "./interfaces/index.js";
const fromContact: plugins.tsclass.business.IContact = {
name: 'Awesome From Company',
type: 'company',
description: 'a company that does stuff',
name: "Awesome From Company",
type: "company",
description: "a company that does stuff",
address: {
streetName: 'Awesome Street',
houseNumber: '5',
city: 'Bremen',
country: 'Germany',
postalCode: '28359',
streetName: "Awesome Street",
houseNumber: "5",
city: "Bremen",
country: "Germany",
postalCode: "28359",
},
vatId: 'DE12345678',
vatId: "DE12345678",
sepaConnection: {
bic: 'BPOTBEB1',
iban: 'BE01234567891616'
bic: "BPOTBEB1",
iban: "BE01234567891616",
},
email: 'hello@awesome.company',
phone: '+49 421 1234567',
fax: '+49 421 1234568',
email: "hello@awesome.company",
phone: "+49 421 1234567",
fax: "+49 421 1234568",
};
const toContact: plugins.tsclass.business.IContact = {
name: 'Awesome To GmbH',
type: 'company',
customerNumber: 'LL-CLIENT-123',
description: 'a company that does stuff',
name: "Awesome To GmbH",
type: "company",
customerNumber: "LL-CLIENT-123",
description: "a company that does stuff",
address: {
streetName: 'Awesome Street',
houseNumber: '5',
city: 'Bremen',
country: 'Germany',
postalCode: '28359'
streetName: "Awesome Street",
houseNumber: "5",
city: "Bremen",
country: "Germany",
postalCode: "28359",
},
vatId: 'BE12345678',
}
vatId: "BE12345678",
};
export const demoLetter: plugins.tsclass.business.ILetter = {
versionInfo: {
type: 'draft',
version: '1.0.0',
type: "draft",
version: "1.0.0",
},
accentColor: null,
content: {
@@ -49,155 +48,192 @@ export const demoLetter: plugins.tsclass.business.ILetter = {
timesheetData: null,
contractData: {
contractDate: Date.now(),
id: 'someid'
id: "someid",
},
letterData: {} as plugins.tsclass.business.ILetter,
invoiceData: {
id: 'LL-INV-48765',
id: "LL-INV-48765",
reverseCharge: true,
dueInDays: 30,
billedBy: fromContact,
billedTo: toContact,
status: null,
deliveryDate: new Date().getTime(),
periodOfPerformance: null,
periodOfPerformance: {
from: +new Date().setDate(new Date().getDate() - 7),
to: +new Date(),
},
printResult: null,
currency: 'EUR',
currency: "EUR",
notes: [],
type: 'debitnote',
type: "debitnote",
items: [
{
name: 'Item with 19% VAT',
name: "Item with 19% VAT",
unitQuantity: 2,
unitNetPrice: 100,
unitType: 'hours',
unitType: "hours",
vatPercentage: 19,
position: 0,
},
{
name: 'Item with 7% VAT',
name: "Item with 7% VAT",
unitQuantity: 4,
unitNetPrice: 100,
unitType: 'hours',
unitType: "hours",
vatPercentage: 7,
position: 1,
},
{
name: 'Item with 7% VAT',
name: "Item with 7% VAT",
unitQuantity: 3,
unitNetPrice: 230,
unitType: 'hours',
unitType: "hours",
vatPercentage: 7,
position: 2,
},
{
name: 'Item with 21% VAT',
name: "Item with 21% VAT",
unitQuantity: 1,
unitNetPrice: 230,
unitType: 'hours',
unitType: "hours",
vatPercentage: 21,
position: 3,
},
{
name: 'Item with 0% VAT',
name: "Item with 0% VAT",
unitQuantity: 6,
unitNetPrice: 230,
unitType: 'hours',
unitType: "hours",
vatPercentage: 0,
position: 4,
},{
name: 'Item with 19% VAT',
},
{
name: "Item with 19% VAT",
unitQuantity: 8,
unitNetPrice: 100,
unitType: 'hours',
unitType: "hours",
vatPercentage: 19,
position: 5,
},
{
name: 'Item with 7% VAT',
name: "Item with 7% VAT",
unitQuantity: 9,
unitNetPrice: 100,
unitType: 'hours',
unitType: "hours",
vatPercentage: 7,
position: 6,
},
{
name: 'Item with 7% VAT',
name: "Item with 7% VAT",
unitQuantity: 4,
unitNetPrice: 230,
unitType: 'hours',
unitType: "hours",
vatPercentage: 7,
position: 8,
},
{
name: 'Item with 21% VAT',
name: "Item with 21% VAT",
unitQuantity: 3,
unitNetPrice: 230,
unitType: 'hours',
unitType: "hours",
vatPercentage: 21,
position: 9,
},
{
name: 'Item with 0% VAT',
name: "Item with 0% VAT",
unitQuantity: 1,
unitNetPrice: 230,
unitType: 'hours',
unitType: "hours",
vatPercentage: 0,
position: 10,
},
{
name: 'Item with 0% VAT',
name: "Item with 0% VAT",
unitQuantity: 1,
unitNetPrice: 230,
unitType: 'hours',
unitType: "hours",
vatPercentage: 0,
position: 10,
position: 11,
},
{
name: 'Item with 0% VAT',
name: "Item with 0% VAT",
unitQuantity: 1,
unitNetPrice: 230,
unitType: 'hours',
unitType: "hours",
vatPercentage: 0,
position: 10,
position: 12,
},
{
name: 'Item with 0% VAT',
name: "Item with 0% VAT",
unitQuantity: 1,
unitNetPrice: 230,
unitType: 'hours',
unitType: "hours",
vatPercentage: 0,
position: 10,
position: 13,
},
{
name: 'Item with 0% VAT',
name: "Item with 0% VAT",
unitQuantity: 1,
unitNetPrice: 230,
unitType: 'hours',
unitType: "hours",
vatPercentage: 0,
position: 10,
position: 14,
},
{
name: 'Item with 0% VAT',
name: "Item with 0% VAT",
unitQuantity: 1,
unitNetPrice: 230,
unitType: 'hours',
unitType: "hours",
vatPercentage: 0,
position: 10,
position: 15,
},
{
name: 'Item with 0% VAT',
name: "Item with 0% VAT",
unitQuantity: 1,
unitNetPrice: 230,
unitType: 'hours',
unitType: "hours",
vatPercentage: 0,
position: 10,
position: 16,
},
{
name: "Item with 0% VAT",
unitQuantity: 1,
unitNetPrice: 230,
unitType: "hours",
vatPercentage: 0,
position: 17,
},
{
name: "Item with 0% VAT",
unitQuantity: 1,
unitNetPrice: 230,
unitType: "hours",
vatPercentage: 0,
position: 18,
},
{
name: "Item with 0% VAT",
unitQuantity: 1,
unitNetPrice: 230,
unitType: "hours",
vatPercentage: 0,
position: 19,
},
{
name: "Item with 0% VAT",
unitQuantity: 1,
unitNetPrice: 230,
unitType: "hours",
vatPercentage: 0,
position: 20,
},
],
}
},
},
date: Date.now(),
type: 'invoice',
type: "invoice",
needsCoverSheet: false,
objectActions: [],
pdf: null,
@@ -208,12 +244,12 @@ export const demoLetter: plugins.tsclass.business.ILetter = {
legalContact: null,
logoUrl: null,
pdfAttachments: null,
subject: 'Invoice: LL-INV-48765',
}
subject: "Invoice: LL-INV-48765",
};
export const demoDocumentSettings: interfaces.IDocumentSettings = {
enableTopDraftText: true,
enableDefaultHeader: true,
enableDefaultFooter: true,
languageCode: 'DE',
};
languageCode: "DE",
};