@design.estate/dees-document 1.1.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist_bundle/bundle.js +148 -144
- package/dist_bundle/bundle.js.map +4 -4
- package/dist_ts/00_commitinfo_data.js +3 -3
- package/dist_ts/interfaces/document.d.ts +2 -0
- package/dist_ts/interfaces/document.js +2 -2
- package/dist_ts/interfaces/translation.d.ts +17 -2
- package/dist_ts/shared/demoletter.d.ts +4 -0
- package/dist_ts/shared/demoletter.js +214 -0
- package/dist_ts/shared/index.d.ts +7 -0
- package/dist_ts/shared/index.js +8 -0
- package/dist_ts/shared/translation.d.ts +15 -0
- package/dist_ts/shared/translation.js +73 -0
- package/dist_watch/bundle.js +106 -24
- package/dist_watch/bundle.js.map +4 -4
- package/npmextra.json +9 -12
- package/package.json +11 -13
- package/readme.md +30 -27
- package/ts/00_commitinfo_data.ts +2 -2
- package/ts/interfaces/document.ts +3 -0
- package/ts/interfaces/translation.ts +17 -2
- package/{ts_web/elements → ts}/shared/demoletter.ts +10 -1
- package/{ts_web/elements → ts}/shared/index.ts +1 -1
- package/ts/shared/translation.ts +82 -0
- package/ts_web/00_commitinfo_data.ts +2 -2
- package/ts_web/elements/contentinvoice.ts +15 -9
- package/ts_web/elements/document.demo.ts +1 -1
- package/ts_web/elements/document.ts +3 -1
- package/ts_web/elements/index.ts +1 -1
- package/ts_web/elements/letterheader.ts +1 -1
- package/ts_web/elements/page.ts +6 -2
- package/ts_web/elements/pagecontainer.ts +1 -1
- package/ts_web/elements/pagecontent.ts +1 -1
- package/ts_web/elements/pagefooter.ts +14 -6
- package/ts_web/elements/pageheader.ts +10 -2
- package/ts_web/elements/viewer.demo.ts +2 -2
- package/ts_web/elements/viewer.ts +4 -1
- package/ts_web/pages/page1.ts +1 -1
- package/ts_web/elements/shared/translation.ts +0 -31
package/npmextra.json
CHANGED
|
@@ -5,29 +5,26 @@
|
|
|
5
5
|
"githost": "code.foss.global",
|
|
6
6
|
"gitscope": "designestate/private",
|
|
7
7
|
"gitrepo": "dedocument-catalog",
|
|
8
|
-
"description": "A
|
|
8
|
+
"description": "A comprehensive tool for dynamically generating and rendering business documents like invoices using modern web technologies.",
|
|
9
9
|
"npmPackagename": "@designestate_private/dedocument-catalog",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"projectDomain": "design.estate",
|
|
12
12
|
"shortDescription": "undefined variable",
|
|
13
13
|
"keywords": [
|
|
14
14
|
"document generation",
|
|
15
|
-
"
|
|
15
|
+
"invoice automation",
|
|
16
|
+
"business documentation",
|
|
17
|
+
"dynamic rendering",
|
|
16
18
|
"PDF creation",
|
|
17
|
-
"TypeScript",
|
|
18
19
|
"web components",
|
|
20
|
+
"Node.js",
|
|
21
|
+
"TypeScript",
|
|
19
22
|
"templating",
|
|
20
|
-
"
|
|
23
|
+
"modern web technologies",
|
|
21
24
|
"responsive design",
|
|
22
|
-
"business documentation",
|
|
23
|
-
"automated workflows",
|
|
24
|
-
"modular architecture",
|
|
25
|
-
"smart contracts",
|
|
26
|
-
"javascript",
|
|
27
25
|
"QR code",
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"data-driven"
|
|
26
|
+
"modular architecture",
|
|
27
|
+
"automated workflows"
|
|
31
28
|
]
|
|
32
29
|
}
|
|
33
30
|
},
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@design.estate/dees-document",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"private": false,
|
|
5
|
-
"description": "A
|
|
5
|
+
"description": "A comprehensive tool for dynamically generating and rendering business documents like invoices using modern web technologies.",
|
|
6
6
|
"main": "dist_ts_web/index.js",
|
|
7
7
|
"typings": "dist_ts_web/index.d.ts",
|
|
8
8
|
"exports": {
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
"@push.rocks/smartpdf": "^3.1.8",
|
|
23
23
|
"@push.rocks/smarttime": "^4.0.8",
|
|
24
24
|
"@tsclass/tsclass": "^4.1.2",
|
|
25
|
+
"@types/node": "^22.10.1",
|
|
25
26
|
"@types/qrcode": "^1.5.5",
|
|
26
27
|
"qrcode": "^1.5.4"
|
|
27
28
|
},
|
|
@@ -59,22 +60,19 @@
|
|
|
59
60
|
"homepage": "https://gitlab.com/designestate/private/dedocument-catalog#readme",
|
|
60
61
|
"keywords": [
|
|
61
62
|
"document generation",
|
|
62
|
-
"
|
|
63
|
+
"invoice automation",
|
|
64
|
+
"business documentation",
|
|
65
|
+
"dynamic rendering",
|
|
63
66
|
"PDF creation",
|
|
64
|
-
"TypeScript",
|
|
65
67
|
"web components",
|
|
68
|
+
"Node.js",
|
|
69
|
+
"TypeScript",
|
|
66
70
|
"templating",
|
|
67
|
-
"
|
|
71
|
+
"modern web technologies",
|
|
68
72
|
"responsive design",
|
|
69
|
-
"business documentation",
|
|
70
|
-
"automated workflows",
|
|
71
|
-
"modular architecture",
|
|
72
|
-
"smart contracts",
|
|
73
|
-
"javascript",
|
|
74
73
|
"QR code",
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
-
"data-driven"
|
|
74
|
+
"modular architecture",
|
|
75
|
+
"automated workflows"
|
|
78
76
|
],
|
|
79
77
|
"scripts": {
|
|
80
78
|
"test": "npm run build && tstest test/",
|
package/readme.md
CHANGED
|
@@ -1,31 +1,32 @@
|
|
|
1
|
+
```markdown
|
|
1
2
|
# @design.estate/dees-document
|
|
2
3
|
|
|
3
|
-
A
|
|
4
|
+
A versatile tool for dynamically generating and rendering business documents, such as invoices, using modern web technologies and elements.
|
|
4
5
|
|
|
5
6
|
## Install
|
|
6
7
|
|
|
7
|
-
To
|
|
8
|
+
To incorporate `@design.estate/dees-document` into your project, execute the following command in your terminal:
|
|
8
9
|
|
|
9
10
|
```shell
|
|
10
11
|
npm install @design.estate/dees-document --save
|
|
11
12
|
```
|
|
12
13
|
|
|
13
|
-
This will install the package and add it to your project's dependencies,
|
|
14
|
+
This command will install the package and add it to your project's dependencies, thus making all the necessary modules available within your `node_modules` directory.
|
|
14
15
|
|
|
15
16
|
## Usage
|
|
16
17
|
|
|
17
|
-
The `@design.estate/dees-document` package
|
|
18
|
+
The `@design.estate/dees-document` package serves as a robust framework to facilitate the generation of business documents, such as invoices and contracts. Leveraging modern web technologies, this package integrates seamlessly with TypeScript and ES modules, offering a type-safe environment conducive to efficient, dynamic document creation. Presented here is a comprehensive guide to utilizing this package, ranging from initializing your environment to generating complete PDF documents.
|
|
18
19
|
|
|
19
20
|
### Getting Started
|
|
20
21
|
|
|
21
|
-
|
|
22
|
+
To embark on a document creation journey, initiate the document service. This service constitutes the core of this package and is typically started at the application's outset.
|
|
22
23
|
|
|
23
24
|
```typescript
|
|
24
25
|
import { PdfService, IPdfServiceConstructorOptions } from '@design.estate/dees-document';
|
|
25
26
|
|
|
26
27
|
async function setupPdfService() {
|
|
27
28
|
const options: IPdfServiceConstructorOptions = {
|
|
28
|
-
//
|
|
29
|
+
// configure your options here
|
|
29
30
|
};
|
|
30
31
|
|
|
31
32
|
const pdfService = await PdfService.createAndStart(options);
|
|
@@ -34,15 +35,15 @@ async function setupPdfService() {
|
|
|
34
35
|
}
|
|
35
36
|
```
|
|
36
37
|
|
|
37
|
-
|
|
38
|
+
The above code initializes the `PdfService`. Tailor the configuration options to suit your specific requirements.
|
|
38
39
|
|
|
39
40
|
### Creating Documents
|
|
40
41
|
|
|
41
|
-
With the PDF service
|
|
42
|
+
With the PDF service initialized, you can now proceed to generate your documents. In the following section, you will find a detailed walkthrough for creating an invoice. This method can be adapted to other document types with necessary modifications.
|
|
42
43
|
|
|
43
44
|
#### Step-by-Step: Create an Invoice
|
|
44
45
|
|
|
45
|
-
1. **Define the Data Structure**:
|
|
46
|
+
1. **Define the Data Structure**: Construct the details of the invoice, including the sender, recipient information, and the details of the items being invoiced.
|
|
46
47
|
|
|
47
48
|
```typescript
|
|
48
49
|
import { ILetter } from '@design.estate/dees-document';
|
|
@@ -95,22 +96,22 @@ With the PDF service ready, you can proceed to generate documents. The following
|
|
|
95
96
|
};
|
|
96
97
|
```
|
|
97
98
|
|
|
98
|
-
|
|
99
|
+
The `ILetter` interface captures all the components of an invoice, including both the sender (`from`) and recipient (`to`) information, alongside the details of the invoiced items.
|
|
99
100
|
|
|
100
|
-
2. **Generate the PDF**:
|
|
101
|
+
2. **Generate the PDF**: Convert the invoice details into a PDF file.
|
|
101
102
|
|
|
102
103
|
```typescript
|
|
103
104
|
async function generateInvoice(pdfService: PdfService, invoiceData: ILetter) {
|
|
104
105
|
const pdfBuffer = await pdfService.createPdfFromLetterObject(invoiceData);
|
|
105
106
|
console.log('Invoice PDF generated successfully.');
|
|
106
107
|
|
|
107
|
-
//
|
|
108
|
+
// Here you could save the PDF to your filesystem, send it via email, etc.
|
|
108
109
|
}
|
|
109
110
|
```
|
|
110
111
|
|
|
111
|
-
The
|
|
112
|
+
The `createPdfFromLetterObject` function returns a `Buffer` that contains the generated PDF, enabling you to save it to a file, send it to clients, or store it for record-keeping.
|
|
112
113
|
|
|
113
|
-
3. **Integrate It All**:
|
|
114
|
+
3. **Integrate It All**: The following script ties together the PDF service and generates the invoice with the described data.
|
|
114
115
|
|
|
115
116
|
```typescript
|
|
116
117
|
async function main() {
|
|
@@ -121,15 +122,15 @@ With the PDF service ready, you can proceed to generate documents. The following
|
|
|
121
122
|
main().then(() => console.log('Invoice generation process completed.'));
|
|
122
123
|
```
|
|
123
124
|
|
|
124
|
-
This
|
|
125
|
+
This example initiates the PDF service and utilizes it to generate a PDF invoice with specified parameters.
|
|
125
126
|
|
|
126
127
|
### Advanced Document Features
|
|
127
128
|
|
|
128
|
-
The package is designed to create
|
|
129
|
+
The package is designed to create a broad range of documents, far beyond simple invoices. Utilize the modular architecture to customize documents to your specific business requirements.
|
|
129
130
|
|
|
130
131
|
#### Advanced Scenarios
|
|
131
132
|
|
|
132
|
-
1. **Custom Styling**:
|
|
133
|
+
1. **Custom Styling**: Alter the visual styles of various elements within your documents, like headers, footers, and more through CSS or inline styles.
|
|
133
134
|
|
|
134
135
|
```typescript
|
|
135
136
|
import { DeDocumentViewer } from '@design.estate/dees-element';
|
|
@@ -139,31 +140,33 @@ The package is designed to create not only invoices but a wide range of document
|
|
|
139
140
|
document.body.appendChild(customStyledViewer);
|
|
140
141
|
```
|
|
141
142
|
|
|
142
|
-
|
|
143
|
+
Adjust styles either with standard CSS or via dynamic TypeScript changes.
|
|
143
144
|
|
|
144
|
-
2. **Interactive Document Elements**:
|
|
145
|
+
2. **Interactive Document Elements**: Integrate interactive UI components, like buttons or input fields, fitting seamlessly into your documents.
|
|
145
146
|
|
|
146
|
-
3. **Multi-page Document Generation**: Handle overflow
|
|
147
|
+
3. **Multi-page Document Generation**: Handle content overflow elegantly through automatic page creation, keeping headers and footers intact.
|
|
147
148
|
|
|
148
149
|
```typescript
|
|
149
150
|
pdfService.adjustDePageScaling();
|
|
150
151
|
```
|
|
151
152
|
|
|
152
|
-
|
|
153
|
+
Adapt between print and digital formats, managing scaling effectively.
|
|
153
154
|
|
|
154
|
-
4. **Embedding Images and Logos**:
|
|
155
|
+
4. **Embedding Images and Logos**: Enhance your document's appearance with company logos, graphics, and other auxiliary content.
|
|
155
156
|
|
|
156
157
|
### Additional Capabilities
|
|
157
158
|
|
|
158
|
-
Beyond
|
|
159
|
+
Beyond basic functionality, this package offers a range of advanced features:
|
|
159
160
|
|
|
160
|
-
- **Document Management**: Manage multiple document templates,
|
|
161
|
-
- **Dynamic Rendering**:
|
|
162
|
-
- **Responsive Design for Digital Documents**: Ensure documents are displayed
|
|
161
|
+
- **Document Management**: Manage multiple document templates, maintain version control, and append annotations or notes.
|
|
162
|
+
- **Dynamic Rendering**: Utilize templating engines to render dynamic content based on input variables.
|
|
163
|
+
- **Responsive Design for Digital Documents**: Ensure your documents are consistently displayed across various devices.
|
|
163
164
|
|
|
164
165
|
### Concluding Remarks
|
|
165
166
|
|
|
166
|
-
The `@design.estate/dees-document` package
|
|
167
|
+
The `@design.estate/dees-document` package presents a powerful solution within the modern document generation realm. From basic invoices to intricate templates, this package provides the essential tools for businesses to streamline their document workflows and enhance their presentation quality and accuracy. Explore further depth by consulting the package’s detailed documentation or by reviewing the examples included within the module.
|
|
168
|
+
```
|
|
169
|
+
|
|
167
170
|
|
|
168
171
|
## License and Legal Information
|
|
169
172
|
|
package/ts/00_commitinfo_data.ts
CHANGED
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export const commitinfo = {
|
|
5
5
|
name: '@design.estate/dees-document',
|
|
6
|
-
version: '1.
|
|
7
|
-
description: 'A
|
|
6
|
+
version: '1.3.0',
|
|
7
|
+
description: 'A comprehensive tool for dynamically generating and rendering business documents like invoices using modern web technologies.'
|
|
8
8
|
}
|
|
@@ -1,4 +1,19 @@
|
|
|
1
1
|
export interface IDeDocumentTranslations {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
address: string;
|
|
3
|
+
bankConnection: string;
|
|
4
|
+
contactInfo: string;
|
|
5
|
+
description: string;
|
|
6
|
+
invoice: string;
|
|
7
|
+
itemPos: string;
|
|
8
|
+
quantity: string;
|
|
9
|
+
registrationInfo: string;
|
|
10
|
+
reverseVatNote: string;
|
|
11
|
+
totalNetPrice: string;
|
|
12
|
+
unitNetPrice: string;
|
|
13
|
+
unitType: string;
|
|
14
|
+
yourCustomerId: string;
|
|
15
|
+
yourVatId: string;
|
|
16
|
+
continuesOnPage: string;
|
|
17
|
+
finalPageStatement: string;
|
|
18
|
+
page: string;
|
|
4
19
|
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import * as tsclass from '@tsclass/tsclass';
|
|
2
|
+
import * as interfaces from '../interfaces/index.js';
|
|
3
|
+
|
|
2
4
|
const fromContact: tsclass.business.IContact = {
|
|
3
5
|
name: 'Awesome From Company',
|
|
4
6
|
type: 'company',
|
|
@@ -207,4 +209,11 @@ export const demoLetter: tsclass.business.ILetter = {
|
|
|
207
209
|
logoUrl: null,
|
|
208
210
|
pdfAttachments: null,
|
|
209
211
|
subject: 'Invoice: LL-INV-48765',
|
|
210
|
-
}
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
export const demoDocumentSettings: interfaces.IDocumentSettings = {
|
|
215
|
+
enableTopDraftText: true,
|
|
216
|
+
enableDefaultHeader: true,
|
|
217
|
+
enableDefaultFooter: true,
|
|
218
|
+
languageCode: 'DE',
|
|
219
|
+
};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import * as interfaces from '../interfaces/index.js';
|
|
2
|
+
|
|
3
|
+
type TTranslationImplementation = {
|
|
4
|
+
[key in keyof interfaces.IDeDocumentTranslations]: string;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export const EN_translations: TTranslationImplementation = {
|
|
8
|
+
address: 'Address',
|
|
9
|
+
bankConnection: 'Bank Connection',
|
|
10
|
+
contactInfo: 'Contact Info',
|
|
11
|
+
description: 'Description',
|
|
12
|
+
invoice: 'Invoice',
|
|
13
|
+
itemPos: 'Item Pos.',
|
|
14
|
+
quantity: 'Quantity',
|
|
15
|
+
registrationInfo: 'Registration Info',
|
|
16
|
+
reverseVatNote: 'VAT arises on a reverse charge basis and is payable by the customer.',
|
|
17
|
+
totalNetPrice: 'Total Net Price',
|
|
18
|
+
unitNetPrice: 'Unit Net Price',
|
|
19
|
+
unitType: 'Unit Type',
|
|
20
|
+
yourCustomerId: 'Your Customer ID:',
|
|
21
|
+
yourVatId: 'Your vat id on file:',
|
|
22
|
+
continuesOnPage: 'Continues on page',
|
|
23
|
+
finalPageStatement: 'This is the final page of this document.',
|
|
24
|
+
page: 'Page',
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export const DE_translations: TTranslationImplementation = {
|
|
28
|
+
address: 'Adresse',
|
|
29
|
+
bankConnection: 'Bankverbindung',
|
|
30
|
+
contactInfo: 'Kontaktinformationen',
|
|
31
|
+
description: 'Beschreibung',
|
|
32
|
+
invoice: 'Rechnung',
|
|
33
|
+
itemPos: 'Pos.',
|
|
34
|
+
quantity: 'Anzahl',
|
|
35
|
+
registrationInfo: 'HRA/HRB Info',
|
|
36
|
+
reverseVatNote: 'Umkehr der Umsatzsteuerpflicht: Der Rechnungsempfänger ist für die korrekte Abrechnung der Umsatzsteuer zuständig.',
|
|
37
|
+
totalNetPrice: 'Nettopreis Summe',
|
|
38
|
+
unitNetPrice: 'Nettopreis',
|
|
39
|
+
unitType: 'Einheit',
|
|
40
|
+
yourCustomerId: 'Ihre Kundennummer:',
|
|
41
|
+
yourVatId: 'Ihre Umsatzsteuer-ID:',
|
|
42
|
+
continuesOnPage: 'Fortsetzung auf Seite',
|
|
43
|
+
finalPageStatement: 'Diese ist die letzte Seite einer Dokumente.',
|
|
44
|
+
page: 'Seite',
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export const ES_translations: TTranslationImplementation = {
|
|
48
|
+
address: 'Dirección',
|
|
49
|
+
bankConnection: 'Conexión bancaria',
|
|
50
|
+
contactInfo: 'Información de contacto',
|
|
51
|
+
description: 'Descripción',
|
|
52
|
+
invoice: 'Factura',
|
|
53
|
+
itemPos: 'Pos.',
|
|
54
|
+
quantity: 'Cantidad',
|
|
55
|
+
registrationInfo: 'Información de registro',
|
|
56
|
+
reverseVatNote: 'La declaración de IVA se aplica en base a la factura de venta, y se paga por el cliente.',
|
|
57
|
+
totalNetPrice: 'Precio total neto',
|
|
58
|
+
unitNetPrice: 'Precio unitario neto',
|
|
59
|
+
unitType: 'Tipo de unidad',
|
|
60
|
+
yourCustomerId: 'Su número de cliente:',
|
|
61
|
+
yourVatId: 'Su ID de IVA:',
|
|
62
|
+
continuesOnPage: 'Continues on page',
|
|
63
|
+
finalPageStatement: 'This is the final page of this document.',
|
|
64
|
+
page: 'Page',
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export const languageCodeMap = {
|
|
68
|
+
'DE': DE_translations,
|
|
69
|
+
'EN': EN_translations,
|
|
70
|
+
'ES': ES_translations,
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export type TLanguageCode = keyof typeof languageCodeMap;
|
|
74
|
+
|
|
75
|
+
export const translate = (languageCode: TLanguageCode, key: string, defaultValue: string) => {
|
|
76
|
+
const translations = languageCodeMap[languageCode] || EN_translations;
|
|
77
|
+
if (translations && translations[key]) {
|
|
78
|
+
return translations[key];
|
|
79
|
+
} else {
|
|
80
|
+
return defaultValue;
|
|
81
|
+
}
|
|
82
|
+
};
|
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export const commitinfo = {
|
|
5
5
|
name: '@design.estate/dees-document',
|
|
6
|
-
version: '1.
|
|
7
|
-
description: 'A
|
|
6
|
+
version: '1.3.0',
|
|
7
|
+
description: 'A comprehensive tool for dynamically generating and rendering business documents like invoices using modern web technologies.'
|
|
8
8
|
}
|
|
@@ -15,8 +15,8 @@ import {
|
|
|
15
15
|
domtools,
|
|
16
16
|
} from '@design.estate/dees-element';
|
|
17
17
|
import * as plugins from '../plugins.js';
|
|
18
|
-
import * as shared from '
|
|
19
|
-
|
|
18
|
+
import * as shared from '../../ts/shared/index.js';
|
|
19
|
+
import * as interfaces from '../../ts/interfaces/index.js';
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
declare global {
|
|
@@ -45,6 +45,12 @@ export class DeContentInvoice extends DeesElement {
|
|
|
45
45
|
})
|
|
46
46
|
public letterData: plugins.tsclass.business.ILetter;
|
|
47
47
|
|
|
48
|
+
@property({
|
|
49
|
+
type: Object,
|
|
50
|
+
reflect: true,
|
|
51
|
+
})
|
|
52
|
+
public documentSettings: interfaces.IDocumentSettings;
|
|
53
|
+
|
|
48
54
|
constructor() {
|
|
49
55
|
super();
|
|
50
56
|
domtools.DomTools.setupDomTools();
|
|
@@ -275,12 +281,12 @@ export class DeContentInvoice extends DeesElement {
|
|
|
275
281
|
</style>
|
|
276
282
|
<div>We hereby invoice products and services provided to you by Lossless GmbH:</div>
|
|
277
283
|
<div class="grid topLine dataHeader">
|
|
278
|
-
<div class="lineItem"
|
|
279
|
-
<div class="lineItem">${shared.translation.translate(
|
|
280
|
-
<div class="lineItem">${shared.translation.translate(
|
|
281
|
-
<div class="lineItem"
|
|
282
|
-
<div class="lineItem"
|
|
283
|
-
<div class="lineItem"
|
|
284
|
+
<div class="lineItem">${shared.translation.translate(this.documentSettings.languageCode, 'itemPos', 'Item Pos.')}</div>
|
|
285
|
+
<div class="lineItem">${shared.translation.translate(this.documentSettings.languageCode, 'description', 'Description')}</div>
|
|
286
|
+
<div class="lineItem">${shared.translation.translate(this.documentSettings.languageCode, 'quantity', 'Quantity')}</div>
|
|
287
|
+
<div class="lineItem">${shared.translation.translate(this.documentSettings.languageCode, 'unitType', 'Unit Type')}</div>
|
|
288
|
+
<div class="lineItem">${shared.translation.translate(this.documentSettings.languageCode, 'unitNetPrice', 'Unit Net Price')}</div>
|
|
289
|
+
<div class="lineItem">${shared.translation.translate(this.documentSettings.languageCode, 'totalNetPrice', 'Total Net Price')}</div>
|
|
284
290
|
</div>
|
|
285
291
|
${(() => {
|
|
286
292
|
let counter = 1;
|
|
@@ -329,7 +335,7 @@ export class DeContentInvoice extends DeesElement {
|
|
|
329
335
|
${this.letterData?.content.invoiceData.reverseCharge
|
|
330
336
|
? html`
|
|
331
337
|
<div class="taxNote">
|
|
332
|
-
VAT arises on a reverse charge basis and is payable by the customer.
|
|
338
|
+
${shared.translation.translate(this.documentSettings.languageCode, 'reverseVatNote', 'VAT arises on a reverse charge basis and is payable by the customer.')}
|
|
333
339
|
</div>
|
|
334
340
|
`
|
|
335
341
|
: ``}
|
|
@@ -24,7 +24,7 @@ export const defaultDocumentSettings: interfaces.IDocumentSettings = {
|
|
|
24
24
|
import { DePage } from './page.js';
|
|
25
25
|
import { DeContentInvoice } from './contentinvoice.js';
|
|
26
26
|
|
|
27
|
-
import * as shared from '
|
|
27
|
+
import * as shared from '../../ts/shared/index.js';
|
|
28
28
|
import { demoFunc } from './document.demo.js';
|
|
29
29
|
|
|
30
30
|
declare global {
|
|
@@ -146,6 +146,7 @@ export class DeDocument extends DeesElement {
|
|
|
146
146
|
// lets append the content
|
|
147
147
|
const content: DeContentInvoice = new DeContentInvoice();
|
|
148
148
|
content.letterData = this.letterData;
|
|
149
|
+
content.documentSettings = this.documentSettings;
|
|
149
150
|
document.body.appendChild(content);
|
|
150
151
|
|
|
151
152
|
await domtools.convenience.smartdelay.delayFor(0);
|
|
@@ -158,6 +159,7 @@ export class DeDocument extends DeesElement {
|
|
|
158
159
|
const newPage = new DePage();
|
|
159
160
|
newPage.printMode = this.printMode;
|
|
160
161
|
newPage.letterData = this.letterData;
|
|
162
|
+
newPage.documentSettings = this.documentSettings;
|
|
161
163
|
pages.push(newPage);
|
|
162
164
|
newPage.pageNumber = pageCounter;
|
|
163
165
|
newPage.append(currentContent);
|
package/ts_web/elements/index.ts
CHANGED
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
} from '@design.estate/dees-element';
|
|
11
11
|
import * as domtools from '@design.estate/dees-domtools';
|
|
12
12
|
|
|
13
|
-
import * as shared from '
|
|
13
|
+
import * as shared from '../../ts/shared/index.js';
|
|
14
14
|
import * as tsclass from '@tsclass/tsclass';
|
|
15
15
|
|
|
16
16
|
declare global {
|
package/ts_web/elements/page.ts
CHANGED
|
@@ -15,7 +15,7 @@ import * as interfaces from '../../ts/interfaces/index.js';
|
|
|
15
15
|
|
|
16
16
|
import { defaultDocumentSettings } from './document.js';
|
|
17
17
|
|
|
18
|
-
import * as shared from '
|
|
18
|
+
import * as shared from '../../ts/shared/index.js';
|
|
19
19
|
|
|
20
20
|
declare global {
|
|
21
21
|
interface HTMLElementTagNameMap {
|
|
@@ -127,6 +127,7 @@ export class DePage extends DeesElement {
|
|
|
127
127
|
? html`
|
|
128
128
|
<dedocument-pageheader
|
|
129
129
|
.letterData=${this.letterData}
|
|
130
|
+
.documentSettings=${this.documentSettings}
|
|
130
131
|
.pageNumber="${this.pageNumber}"
|
|
131
132
|
.pageTotalNumber="${this.pageTotalNumber}"
|
|
132
133
|
></dedocument-pageheader>
|
|
@@ -137,20 +138,23 @@ export class DePage extends DeesElement {
|
|
|
137
138
|
<dedocument-letterheader
|
|
138
139
|
.pageNumber="${this.pageNumber}"
|
|
139
140
|
.letterData=${this.letterData}
|
|
141
|
+
.documentSettings=${this.documentSettings}
|
|
140
142
|
.pageTotalNumber="${this.pageTotalNumber}"
|
|
141
143
|
></dedocument-letterheader>
|
|
142
144
|
`
|
|
143
145
|
: html``}
|
|
144
146
|
<dedocument-pagecontent
|
|
147
|
+
.letterData=${this.letterData}
|
|
148
|
+
.documentSettings=${this.documentSettings}
|
|
145
149
|
.pageNumber="${this.pageNumber}"
|
|
146
150
|
.pageTotalNumber="${this.pageTotalNumber}"
|
|
147
|
-
.letterData=${this.letterData}
|
|
148
151
|
><slot></slot
|
|
149
152
|
></dedocument-pagecontent>
|
|
150
153
|
${this.documentSettings.enableDefaultFooter
|
|
151
154
|
? html`
|
|
152
155
|
<dedocument-pagefooter
|
|
153
156
|
.letterData=${this.letterData}
|
|
157
|
+
.documentSettings=${this.documentSettings}
|
|
154
158
|
.pageNumber="${this.pageNumber}"
|
|
155
159
|
.pageTotalNumber="${this.pageTotalNumber}"
|
|
156
160
|
></dedocument-pagefooter>
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
} from '@design.estate/dees-element';
|
|
11
11
|
import * as domtools from '@design.estate/dees-domtools';
|
|
12
12
|
|
|
13
|
-
import * as shared from '
|
|
13
|
+
import * as shared from '../../ts/shared/index.js';
|
|
14
14
|
|
|
15
15
|
declare global {
|
|
16
16
|
interface HTMLElementTagNameMap {
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
} from '@design.estate/dees-element';
|
|
11
11
|
import * as domtools from '@design.estate/dees-domtools';
|
|
12
12
|
|
|
13
|
-
import * as shared from '
|
|
13
|
+
import * as shared from '../../ts/shared/index.js';
|
|
14
14
|
import * as tsclass from '@tsclass/tsclass';
|
|
15
15
|
|
|
16
16
|
declare global {
|
|
@@ -7,10 +7,12 @@ import {
|
|
|
7
7
|
css,
|
|
8
8
|
cssManager,
|
|
9
9
|
unsafeCSS,
|
|
10
|
+
domtools,
|
|
10
11
|
} from '@design.estate/dees-element';
|
|
11
|
-
import * as domtools from '@design.estate/dees-domtools';
|
|
12
12
|
|
|
13
|
-
import * as
|
|
13
|
+
import * as interfaces from '../../ts/interfaces/index.js';
|
|
14
|
+
|
|
15
|
+
import * as shared from '../../ts/shared/index.js';
|
|
14
16
|
import * as tsclass from '@tsclass/tsclass';
|
|
15
17
|
|
|
16
18
|
declare global {
|
|
@@ -30,6 +32,12 @@ export class DePageFooter extends DeesElement {
|
|
|
30
32
|
})
|
|
31
33
|
letterData: tsclass.business.ILetter;
|
|
32
34
|
|
|
35
|
+
@property({
|
|
36
|
+
type: Object,
|
|
37
|
+
reflect: true,
|
|
38
|
+
})
|
|
39
|
+
documentSettings: interfaces.IDocumentSettings;
|
|
40
|
+
|
|
33
41
|
@property({
|
|
34
42
|
type: Number
|
|
35
43
|
})
|
|
@@ -96,26 +104,26 @@ export class DePageFooter extends DeesElement {
|
|
|
96
104
|
return html`
|
|
97
105
|
<div class="bottomstripe">
|
|
98
106
|
<div>
|
|
99
|
-
<strong
|
|
107
|
+
<strong>${shared.translation.translate(this.documentSettings.languageCode, 'address', 'Address')}:</strong><br />
|
|
100
108
|
${this.letterData.from.name}<br />
|
|
101
109
|
${this.letterData.from.address.streetName} ${this.letterData.from.address.houseNumber}<br />
|
|
102
110
|
${this.letterData.from.address.postalCode} ${this.letterData.from.address.city}<br />
|
|
103
111
|
${this.letterData.from.address.country}
|
|
104
112
|
</div>
|
|
105
113
|
<div>
|
|
106
|
-
<strong
|
|
114
|
+
<strong>${shared.translation.translate(this.documentSettings.languageCode, 'registrationInfo', 'Registration Info')}:</strong><br />
|
|
107
115
|
Amtsgericht Bremen<br />
|
|
108
116
|
<i>reg-#:</i> HRB 35230 HB<br />
|
|
109
117
|
<i>vat-id:</i> ${this.letterData.from.vatId}
|
|
110
118
|
</div>
|
|
111
119
|
<div>
|
|
112
|
-
<strong
|
|
120
|
+
<strong>${shared.translation.translate(this.documentSettings.languageCode, 'contactInfo', 'Contact Info')}:</strong><br />
|
|
113
121
|
<i>email:</i> ${this.letterData.from.email}<br />
|
|
114
122
|
<i>phone:</i> ${this.letterData.from.phone}<br />
|
|
115
123
|
<i>fax:</i> ${this.letterData.from.fax}
|
|
116
124
|
</div>
|
|
117
125
|
<div>
|
|
118
|
-
<strong
|
|
126
|
+
<strong>${shared.translation.translate(this.documentSettings.languageCode, 'bankConnection', 'Bank Connection')}:</strong><br />
|
|
119
127
|
<i>beneficiary:</i> ${this.letterData?.from?.name}<br />
|
|
120
128
|
<i>institution:</i> ${this.letterData?.from?.sepaConnection?.institution}<br />
|
|
121
129
|
<i>iban:</i> ${this.letterData?.from?.sepaConnection?.iban}<br />
|