@limetech/n8n-nodes-lime 0.2.9 → 0.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.
Files changed (84) hide show
  1. package/.dockerignore +1 -0
  2. package/.github/workflows/lint.yml +21 -0
  3. package/.github/workflows/release.yml +82 -0
  4. package/.github/workflows/test-and-build.yml +47 -0
  5. package/.prettierignore +4 -0
  6. package/.prettierrc.mjs +1 -0
  7. package/.releaserc.json +34 -0
  8. package/CHANGELOG.md +74 -0
  9. package/Dockerfile +21 -0
  10. package/README.md +4 -0
  11. package/credentials/FortnoxApi.credentials.ts +61 -0
  12. package/credentials/LimeCrmApi.credentials.ts +60 -0
  13. package/docker-compose.yml +46 -0
  14. package/eslint.config.mjs +27 -0
  15. package/jest.config.js +11 -0
  16. package/nodes/fortnox/Fortnox.node.json +18 -0
  17. package/nodes/fortnox/Fortnox.node.ts +102 -0
  18. package/nodes/fortnox/FortnoxTrigger.node.json +18 -0
  19. package/nodes/fortnox/FortnoxTrigger.node.ts +196 -0
  20. package/nodes/fortnox/commons.ts +94 -0
  21. package/nodes/fortnox/fortnoxLogo.svg +15 -0
  22. package/nodes/fortnox/model.ts +25 -0
  23. package/nodes/fortnox/resources/customers/filterParameters.ts +47 -0
  24. package/nodes/fortnox/resources/customers/index.ts +57 -0
  25. package/nodes/fortnox/resources/customers/model.ts +107 -0
  26. package/nodes/fortnox/resources/customers/operations/create.operation.ts +303 -0
  27. package/nodes/fortnox/resources/customers/operations/delete.operation.ts +44 -0
  28. package/nodes/fortnox/resources/customers/operations/get.operation.ts +45 -0
  29. package/nodes/fortnox/resources/customers/operations/getAll.operation.ts +80 -0
  30. package/nodes/fortnox/resources/customers/operations/update.operation.ts +278 -0
  31. package/nodes/fortnox/resources/customers/sortParameters.ts +32 -0
  32. package/nodes/fortnox/resources/invoice/filterParameters.ts +88 -0
  33. package/nodes/fortnox/resources/invoice/index.ts +51 -0
  34. package/nodes/fortnox/resources/invoice/invoiceParameters.ts +214 -0
  35. package/nodes/fortnox/resources/invoice/model.ts +160 -0
  36. package/nodes/fortnox/resources/invoice/operations/create.operation.ts +72 -0
  37. package/nodes/fortnox/resources/invoice/operations/get.operation.ts +45 -0
  38. package/nodes/fortnox/resources/invoice/operations/getAll.operation.ts +101 -0
  39. package/nodes/fortnox/resources/invoice/operations/update.operation.ts +74 -0
  40. package/nodes/fortnox/transport/errorCodes.ts +62 -0
  41. package/nodes/fortnox/transport/index.ts +98 -0
  42. package/nodes/lime-crm/LimeCrm.node.json +18 -0
  43. package/nodes/lime-crm/LimeCrmNode.node.ts +135 -0
  44. package/nodes/lime-crm/LimeCrmTrigger.node.ts +263 -0
  45. package/nodes/lime-crm/assets/lime-crm.svg +1 -0
  46. package/nodes/lime-crm/commons/constants.ts +9 -0
  47. package/nodes/lime-crm/commons/index.ts +9 -0
  48. package/nodes/lime-crm/commons/limetype.ts +11 -0
  49. package/nodes/lime-crm/commons/task.ts +55 -0
  50. package/nodes/lime-crm/commons/webhook.ts +50 -0
  51. package/nodes/lime-crm/methods/getEntitiesForErpSystem.ts +11 -0
  52. package/nodes/lime-crm/methods/getLimeTypeProperties.ts +27 -0
  53. package/nodes/lime-crm/methods/getLimeTypes.ts +23 -0
  54. package/nodes/lime-crm/methods/index.ts +3 -0
  55. package/nodes/lime-crm/resources/erpConnector/index.ts +43 -0
  56. package/nodes/lime-crm/resources/erpConnector/operations/createOrUpdateObjects.operation.ts +69 -0
  57. package/nodes/lime-crm/resources/erpConnector/operations/transform.operation.ts +274 -0
  58. package/nodes/lime-crm/resources/erpConnector/transform.ts +49 -0
  59. package/nodes/lime-crm/resources/erpConnector/transformers/baseTransformer.ts +18 -0
  60. package/nodes/lime-crm/resources/erpConnector/transformers/fortnox.ts +201 -0
  61. package/nodes/lime-crm/resources/erpConnector/transformers/index.ts +1 -0
  62. package/nodes/lime-crm/resources/limeObject/index.ts +64 -0
  63. package/nodes/lime-crm/resources/limeObject/operations/create.operation.ts +152 -0
  64. package/nodes/lime-crm/resources/limeObject/operations/delete.operation.ts +55 -0
  65. package/nodes/lime-crm/resources/limeObject/operations/get.operation.ts +54 -0
  66. package/nodes/lime-crm/resources/limeObject/operations/search.operation.ts +99 -0
  67. package/nodes/lime-crm/resources/limeObject/operations/update.operation.ts +157 -0
  68. package/nodes/lime-crm/resources/limeType/index.ts +58 -0
  69. package/nodes/lime-crm/resources/limeType/operations/getProperties.operation.ts +42 -0
  70. package/nodes/lime-crm/resources/limeType/operations/getType.operation.ts +36 -0
  71. package/nodes/lime-crm/resources/limeType/operations/listTypes.operation.ts +18 -0
  72. package/nodes/lime-crm/transport/commons.ts +44 -0
  73. package/nodes/lime-crm/transport/erpConnector.ts +21 -0
  74. package/nodes/lime-crm/transport/index.ts +17 -0
  75. package/nodes/lime-crm/transport/limeobjects.ts +83 -0
  76. package/nodes/lime-crm/transport/limetypes.ts +68 -0
  77. package/nodes/lime-crm/transport/task.ts +32 -0
  78. package/nodes/lime-crm/transport/webhooks.ts +61 -0
  79. package/nodes/nodeResponse.ts +13 -0
  80. package/package.json +36 -16
  81. package/tests/fixtures/fortnox.ts +182 -0
  82. package/tests/transform.spec.ts +187 -0
  83. package/tsconfig.json +30 -0
  84. package/index.js +0 -3
@@ -0,0 +1,278 @@
1
+ import { IExecuteFunctions, INodeProperties, IDataObject } from 'n8n-workflow';
2
+ import { apiRequest } from '../../../transport';
3
+ import { CustomerResponse } from '../model';
4
+ import { code as currencyCode } from 'currency-codes';
5
+ import { NodeResponse } from '../../../../nodeResponse';
6
+
7
+ export const description = {
8
+ name: 'Update Customer',
9
+ value: 'update',
10
+ description: 'Update an existing customer',
11
+ action: 'Update a customer',
12
+ };
13
+
14
+ export const updateProperties: INodeProperties[] = [
15
+ {
16
+ displayName: 'Name',
17
+ name: 'Name',
18
+ type: 'string',
19
+ default: '',
20
+ description: 'Customer name',
21
+ },
22
+ {
23
+ displayName: 'Active',
24
+ name: 'Active',
25
+ type: 'boolean',
26
+ default: true,
27
+ description: 'Whether the customer is active',
28
+ },
29
+ {
30
+ displayName: 'Address 1',
31
+ name: 'Address1',
32
+ type: 'string',
33
+ default: '',
34
+ description: "Customer's primary address",
35
+ },
36
+ {
37
+ displayName: 'Address 2',
38
+ name: 'Address2',
39
+ type: 'string',
40
+ default: '',
41
+ description: "Customer's secondary address",
42
+ },
43
+ {
44
+ displayName: 'City',
45
+ name: 'City',
46
+ type: 'string',
47
+ default: '',
48
+ description: "Customer's city",
49
+ },
50
+ {
51
+ displayName: 'Comments',
52
+ name: 'Comments',
53
+ type: 'string',
54
+ default: '',
55
+ description: 'Comments about the customer',
56
+ },
57
+ {
58
+ displayName: 'Currency',
59
+ name: 'Currency',
60
+ type: 'string',
61
+ default: '',
62
+ description: "Customer's currency code, e.g., SEK, EUR",
63
+ },
64
+ {
65
+ displayName: 'Cost Center',
66
+ name: 'CostCenter',
67
+ type: 'string',
68
+ default: '',
69
+ description: "Customer's cost center",
70
+ },
71
+ {
72
+ displayName: 'Country',
73
+ name: 'Country',
74
+ type: 'string',
75
+ default: '',
76
+ description: "Customer's country",
77
+ },
78
+ {
79
+ displayName: 'Country Code',
80
+ name: 'CountryCode',
81
+ type: 'string',
82
+ default: '',
83
+ description: "Customer's country code",
84
+ },
85
+ {
86
+ displayName: 'Email',
87
+ name: 'Email',
88
+ type: 'string',
89
+ default: '',
90
+ description: "Customer's email address",
91
+ },
92
+ {
93
+ displayName: 'External Reference',
94
+ name: 'ExternalReference',
95
+ type: 'string',
96
+ default: '',
97
+ description: 'External reference for the customer',
98
+ },
99
+ {
100
+ displayName: 'Fax',
101
+ name: 'Fax',
102
+ type: 'string',
103
+ default: '',
104
+ description: "Customer's fax number",
105
+ },
106
+ {
107
+ displayName: 'GLN',
108
+ name: 'GLN',
109
+ type: 'string',
110
+ default: '',
111
+ description: 'Global Location Number',
112
+ },
113
+ {
114
+ displayName: 'Organisation Number',
115
+ name: 'OrganisationNumber',
116
+ type: 'string',
117
+ default: '',
118
+ description: "Customer's organisation number",
119
+ },
120
+ {
121
+ displayName: 'Phone 1',
122
+ name: 'Phone1',
123
+ type: 'string',
124
+ default: '',
125
+ description: "Customer's primary phone number",
126
+ },
127
+ {
128
+ displayName: 'Phone 2',
129
+ name: 'Phone2',
130
+ type: 'string',
131
+ default: '',
132
+ description: "Customer's secondary phone number",
133
+ },
134
+ {
135
+ displayName: 'Type',
136
+ name: 'Type',
137
+ type: 'options',
138
+ options: [
139
+ {
140
+ name: 'Private',
141
+ value: 'PRIVATE',
142
+ },
143
+ {
144
+ name: 'Company',
145
+ value: 'COMPANY',
146
+ },
147
+ ],
148
+ default: 'COMPANY',
149
+ description: 'Type of customer',
150
+ },
151
+ {
152
+ displayName: 'VAT Number',
153
+ name: 'VATNumber',
154
+ type: 'string',
155
+ default: '',
156
+ description: "Customer's VAT number",
157
+ },
158
+ {
159
+ displayName: 'VAT Type',
160
+ name: 'VATType',
161
+ type: 'options',
162
+ options: [
163
+ {
164
+ name: 'SE VAT',
165
+ value: 'SEVAT',
166
+ },
167
+ {
168
+ name: 'SE Reversed VAT',
169
+ value: 'SEREVERSEDVAT',
170
+ },
171
+ {
172
+ name: 'EU Reversed VAT',
173
+ value: 'EUREVERSEDVAT',
174
+ },
175
+ {
176
+ name: 'EU VAT',
177
+ value: 'EUVAT',
178
+ },
179
+ {
180
+ name: 'Export',
181
+ value: 'EXPORT',
182
+ },
183
+ ],
184
+ default: 'SEVAT',
185
+ description: 'Type of VAT applied',
186
+ },
187
+ {
188
+ displayName: 'Website',
189
+ name: 'WWW',
190
+ type: 'string',
191
+ default: '',
192
+ description: "Customer's website URL",
193
+ },
194
+ {
195
+ displayName: 'ZIP Code',
196
+ name: 'ZipCode',
197
+ type: 'string',
198
+ default: '',
199
+ description: "Customer's ZIP/postal code",
200
+ },
201
+ ];
202
+
203
+ export const properties: INodeProperties[] = [
204
+ {
205
+ displayName: 'Customer Number',
206
+ name: 'customerNumber',
207
+ type: 'string',
208
+ required: true,
209
+ default: '',
210
+ description: 'Unique identifier for customer',
211
+ displayOptions: {
212
+ show: {
213
+ resource: ['customer'],
214
+ operation: ['update'],
215
+ },
216
+ },
217
+ },
218
+ {
219
+ displayName: 'Fields',
220
+ name: 'fields',
221
+ type: 'collection',
222
+ placeholder: 'Add Field',
223
+ default: {},
224
+ displayOptions: {
225
+ show: {
226
+ resource: ['customer'],
227
+ operation: ['update'],
228
+ },
229
+ },
230
+ options: [...updateProperties],
231
+ },
232
+ ];
233
+
234
+ export async function execute(
235
+ this: IExecuteFunctions,
236
+ i: number
237
+ ): Promise<NodeResponse<CustomerResponse>> {
238
+ const customerNumber = this.getNodeParameter('customerNumber', i) as string;
239
+ const fields = this.getNodeParameter('fields', i, {}) as IDataObject;
240
+
241
+ if (Object.keys(fields).length === 0) {
242
+ return {
243
+ success: false,
244
+ error: 'At least one field must be provided for update',
245
+ };
246
+ }
247
+
248
+ if (fields.name && fields.name === '') {
249
+ return {
250
+ success: false,
251
+ error: 'Customer name cannot be empty',
252
+ };
253
+ }
254
+
255
+ if (fields.Currency) {
256
+ fields.Currency = String(fields.Currency).toUpperCase();
257
+ if (currencyCode(fields.Currency) === undefined) {
258
+ return {
259
+ success: false,
260
+ error: `Invalid currency code: ${fields.Currency}. Use ISO 4217 currency code.`,
261
+ };
262
+ }
263
+ }
264
+
265
+ const body = {
266
+ Customer: {
267
+ ...fields,
268
+ },
269
+ };
270
+
271
+ const endpoint = `/customers/${encodeURIComponent(customerNumber)}`;
272
+
273
+ return await apiRequest<CustomerResponse>(this, {
274
+ method: 'PUT',
275
+ endpoint: endpoint,
276
+ body: body,
277
+ });
278
+ }
@@ -0,0 +1,32 @@
1
+ import { INodeProperties, NodePropertyTypes } from 'n8n-workflow';
2
+
3
+ const sortByDefinitions = [
4
+ ['Customer Number', 'customernumber'],
5
+ ['Name', 'name'],
6
+ ];
7
+
8
+ function createSortProperties(parameters: string[][]): INodeProperties[] {
9
+ const options = parameters.map(([displayName, fieldName]) => {
10
+ return {
11
+ name: displayName,
12
+ value: fieldName,
13
+ description: `Sort by ${displayName.toLowerCase()}`,
14
+ };
15
+ });
16
+
17
+ return [
18
+ {
19
+ displayName: 'Sort by',
20
+ name: 'sortby',
21
+ type: 'options' as NodePropertyTypes,
22
+ noDataExpression: true,
23
+ options: options,
24
+ default: options[0].value,
25
+ placeholder: 'Select a field to sort by',
26
+ description: 'Select a field to sort by',
27
+ },
28
+ ];
29
+ }
30
+
31
+ export const sortParameters: INodeProperties[] =
32
+ createSortProperties(sortByDefinitions);
@@ -0,0 +1,88 @@
1
+ import { INodeProperties } from 'n8n-workflow';
2
+ import {
3
+ createOptionParameter,
4
+ createParameter,
5
+ ParameterDefinition,
6
+ OptionParameterDefinition,
7
+ } from '../../commons';
8
+
9
+ const optionParametersDefinitions: OptionParameterDefinition[] = [
10
+ {
11
+ displayName: 'Invoice Status',
12
+ name: 'filter',
13
+ parameters: [
14
+ ['Cancelled', 'cancelled'],
15
+ ['Fully Paid', 'fullypaid'],
16
+ ['Unbooked', 'unbooked'],
17
+ ['Unpaid', 'unpaid'],
18
+ ['Unpaid And Overdue', 'unpaidoverdue'],
19
+ ],
20
+ },
21
+ {
22
+ displayName: 'Invoice Type',
23
+ name: 'InvoiceType',
24
+ parameters: [
25
+ ['Invoice', 'invoice'],
26
+ ['Agreement Invoice', 'agreementinvoice'],
27
+ ['Intrest Invoice', 'intrestinvoice'],
28
+ ['Summery Invoice', 'summaryinvoice'],
29
+ ['Cash Invoice', 'cashinvoice'],
30
+ ],
31
+ },
32
+ ];
33
+
34
+ const parametersDefinitions: ParameterDefinition[] = [
35
+ ['Account Number From', 'accountnumberfrom', 'string', '', {}],
36
+ ['Account Number To', 'accountnumberto', 'string', '', {}],
37
+ ['Article Description', 'articledescription', 'string', '', {}],
38
+ ['Article Number', 'articlenumber', 'string', '', {}],
39
+ ['Cost Center', 'costcenter', 'string', '', {}],
40
+ ['Credit', 'credit', 'string', '', {}],
41
+ ['Currency', 'currency', 'string', '', {}],
42
+ ['Customer Name', 'customername', 'string', '', {}],
43
+ ['Customer Number', 'customernumber', 'string', '', {}],
44
+ ['Document Number', 'documentnumber', 'string', '', {}],
45
+ [
46
+ 'External Invoice Reference 1',
47
+ 'externalinvoicereference1',
48
+ 'string',
49
+ '',
50
+ {},
51
+ ],
52
+ [
53
+ 'External Invoice Reference 2',
54
+ 'externalinvoicereference2',
55
+ 'string',
56
+ '',
57
+ {},
58
+ ],
59
+ ['From Date', 'fromdate', 'string', '', {}],
60
+ ['From Final Pay Date', 'fromfinalpaydate', 'string', '', {}],
61
+ ['Label', 'label', 'string', '', {}],
62
+ ['Last Modified', 'lastmodified', 'string', '', {}],
63
+ ['Not Completed', 'notcomplete', 'string', '', {}],
64
+ ['OCR', 'ocr', 'string', '', {}],
65
+ ['Our Reference', 'ourreference', 'string', '', {}],
66
+ ['Project', 'project', 'string', '', {}],
67
+ ['Sent', 'sent', 'boolean', false, {}],
68
+ ['To Date', 'todate', 'string', '', {}],
69
+ ['To Final Pay Date', 'tofinalpaydate', 'string', '', {}],
70
+ ['Your Order Number', 'yourordernumber', 'string', '', {}],
71
+ ['Your Reference', 'yourreference', 'string', '', {}],
72
+ ];
73
+
74
+ export const filterParameters: INodeProperties[] = [
75
+ ...optionParametersDefinitions.map((option) =>
76
+ createOptionParameter(option)
77
+ ),
78
+ ...parametersDefinitions.map(
79
+ ([displayName, name, filterType, defaultValue, typeOptions]) =>
80
+ createParameter(
81
+ displayName,
82
+ name,
83
+ filterType,
84
+ defaultValue,
85
+ typeOptions
86
+ )
87
+ ),
88
+ ];
@@ -0,0 +1,51 @@
1
+ import {
2
+ IExecuteFunctions,
3
+ INodeProperties,
4
+ NodePropertyTypes,
5
+ } from 'n8n-workflow';
6
+
7
+ import * as create from './operations/create.operation';
8
+ import * as get from './operations/get.operation';
9
+ import * as getAll from './operations/getAll.operation';
10
+ import * as update from './operations/update.operation';
11
+
12
+ export const invoiceProperties: INodeProperties[] = [
13
+ {
14
+ displayName: 'Operation',
15
+ name: 'operation',
16
+ type: 'options' as NodePropertyTypes,
17
+ noDataExpression: true,
18
+ displayOptions: {
19
+ show: {
20
+ resource: ['invoice'],
21
+ },
22
+ },
23
+ options: [
24
+ create.description,
25
+ get.description,
26
+ getAll.description,
27
+ update.description,
28
+ ],
29
+ default: 'getAll',
30
+ },
31
+ ...create.properties,
32
+ ...get.properties,
33
+ ...getAll.properties,
34
+ ...update.properties,
35
+ ];
36
+
37
+ export async function invoiceOperations(
38
+ this: IExecuteFunctions,
39
+ { operation, i }: { operation: string; i: number }
40
+ ) {
41
+ if (operation === 'create') {
42
+ return await create.execute.call(this, i);
43
+ } else if (operation === 'get') {
44
+ return await get.execute.call(this, i);
45
+ } else if (operation === 'getAll') {
46
+ return await getAll.execute.call(this, i);
47
+ } else if (operation === 'update') {
48
+ return await update.execute.call(this, i);
49
+ }
50
+ return null;
51
+ }
@@ -0,0 +1,214 @@
1
+ import { INodeProperties } from 'n8n-workflow';
2
+ import {
3
+ createCollectionParameter,
4
+ createOptionParameter,
5
+ createParameter,
6
+ CollectionParameterDefinition,
7
+ OptionParameterDefinition,
8
+ ParameterDefinition,
9
+ } from '../../commons';
10
+
11
+ const optionParametersDefinitions: OptionParameterDefinition[] = [
12
+ {
13
+ displayName: 'Invoice Type',
14
+ name: 'InvoiceType',
15
+ parameters: [
16
+ ['Invoice', 'INVOICE'],
17
+ ['Agreement Invoice', 'AGREEMENTINVOICE'],
18
+ ['Intrest Invoice', 'INTRESTINVOICE'],
19
+ ['Summery Invoice', 'SUMMARYINVOICE'],
20
+ ['Cash Invoice', 'CASHINVOICE'],
21
+ ],
22
+ },
23
+ {
24
+ displayName: 'Language',
25
+ name: 'Language',
26
+ parameters: [
27
+ ['Svenska', 'SV'],
28
+ ['English', 'EN'],
29
+ ],
30
+ },
31
+ {
32
+ displayName: 'Tax Reduction Type',
33
+ name: 'TaxReductionType',
34
+ parameters: [
35
+ ['None', 'none'],
36
+ ['Rot', 'rot'],
37
+ ['Rut', 'rut'],
38
+ ['Green', 'green'],
39
+ ],
40
+ },
41
+ ];
42
+
43
+ const collectionParametersDefinitions: CollectionParameterDefinition[] = [
44
+ {
45
+ displayName: 'EDI Information',
46
+ name: 'EDIInformation',
47
+ parameters: [
48
+ [
49
+ 'EDI Global Location Number',
50
+ 'EDIGlobalLocationNumber',
51
+ 'string',
52
+ '',
53
+ {},
54
+ ],
55
+ [
56
+ 'EDI Global Location Number Delivery',
57
+ 'EDIGlobalLocationNumberDelivery',
58
+ 'string',
59
+ '',
60
+ {},
61
+ ],
62
+ ['EDI Invoice Extra1', 'EDIInvoiceExtra1', 'string', '', {}],
63
+ ['EDI Invoice Extra2', 'EDIInvoiceExtra2', 'string', '', {}],
64
+ [
65
+ 'EDI Our Electronic Reference',
66
+ 'EDIOurElectronicReference',
67
+ 'string',
68
+ '',
69
+ {},
70
+ ],
71
+ [
72
+ 'EDI Your Electronic Reference',
73
+ 'EDIYourElectronicReference',
74
+ 'string',
75
+ '',
76
+ {},
77
+ ],
78
+ ],
79
+ multipleValues: false,
80
+ },
81
+ {
82
+ displayName: 'Email Information',
83
+ name: 'EmailInformation',
84
+ parameters: [
85
+ ['Email Address BCC', 'EmailAddressBCC', 'string', '', {}],
86
+ ['Email Address CC', 'EmailAddressCC', 'string', '', {}],
87
+ ['Email Address From', 'EmailAddressFrom', 'string', '', {}],
88
+ ['Email Address To', 'EmailAddressTo', 'string', '', {}],
89
+ ['Email Body', 'EmailBody', 'string', '', {}],
90
+ ['Email Subject', 'EmailSubject', 'string', '', {}],
91
+ ],
92
+ multipleValues: false,
93
+ },
94
+ {
95
+ displayName: 'Invoice Rows',
96
+ name: 'InvoiceRows',
97
+ parameters: [
98
+ ['Account Number', 'AccountNumber', 'number', 0, {}],
99
+ ['Article Number', 'ArticleNumber', 'string', '', {}],
100
+ ['Cost Center', 'CostCenter', 'string', '', {}],
101
+ ['Delivered Quantity', 'DeliveredQuantity', 'string', '', {}],
102
+ ['Description', 'Description', 'string', '', {}],
103
+ ['Discount', 'Discount', 'number', 0, { numberPrecision: 2 }],
104
+ ['Discount Type', 'DiscountType', 'string', '', {}],
105
+ ['House Work', 'HouseWork', 'boolean', false, {}],
106
+ [
107
+ 'House Work Hours To Report',
108
+ 'HouseWorkHoursToReport',
109
+ 'number',
110
+ 0,
111
+ {},
112
+ ],
113
+ ['House Work Type', 'HouseWorkType', 'string', '', {}],
114
+ ['Price', 'Price', 'number', 0, { numberPrecision: 2 }],
115
+ ['Project', 'Project', 'string', '', {}],
116
+ ['Row ID', 'RowId', 'number', 0, {}],
117
+ ['Stock Point Code', 'StockPointCode', 'string', '', {}],
118
+ ['Unit', 'Unit', 'string', '', {}],
119
+ ['VAT', 'VAT', 'number', 0, {}],
120
+ ['VAT Code', 'VATCode', 'string', '', {}],
121
+ ],
122
+ multipleValues: true,
123
+ },
124
+ {
125
+ displayName: 'Labels',
126
+ name: 'Labels',
127
+ parameters: [['Label ID', 'Id', 'number', 0, {}]],
128
+ multipleValues: true,
129
+ },
130
+ ];
131
+
132
+ const parametersDefinitions: ParameterDefinition[] = [
133
+ ['Address1', 'Address1', 'string', '', {}],
134
+ ['Address2', 'Address2', 'string', '', {}],
135
+ [
136
+ 'Administration Fee',
137
+ 'AdministrationFee',
138
+ 'number',
139
+ 0,
140
+ { numberPrecision: 2 },
141
+ ],
142
+ ['City', 'City', 'string', '', {}],
143
+ ['Comments', 'Comments', 'string', '', {}],
144
+ ['Cost Center', 'CostCenter', 'string', '', {}],
145
+ ['Country', 'Country', 'string', '', {}],
146
+ ['Credit Invoice Reference', 'CreditInvoiceReference', 'string', '', {}],
147
+ ['Currency', 'Currency', 'string', '', {}],
148
+ ['Currency Rate', 'CurrencyRate', 'number', 0, { numberPrecision: 2 }],
149
+ ['Currency Unit', 'CurrencyUnit', 'number', 0, {}],
150
+ ['Customer Name', 'CustomerName', 'string', '', {}],
151
+ ['Delivery Address1', 'DeliveryAddress1', 'string', '', {}],
152
+ ['Delivery Address2', 'DeliveryAddress2', 'string', '', {}],
153
+ ['Delivery City', 'DeliveryCity', 'string', '', {}],
154
+ ['Delivery Country', 'DeliveryCountry', 'string', '', {}],
155
+ ['Delivery Date', 'DeliveryDate', 'string', '', {}],
156
+ ['Delivery Name', 'DeliveryName', 'string', '', {}],
157
+ ['Delivery Zip Code', 'DeliveryZipCode', 'string', '', {}],
158
+ ['Document Number', 'DocumentNumber', 'string', '', {}],
159
+ ['Due Date', 'DueDate', 'string', '', {}],
160
+ ['EU Quarterly Report', 'EuQuarterlyReport', 'boolean', false, {}],
161
+ [
162
+ 'External Invoice Reference1',
163
+ 'ExternalInvoiceReference1',
164
+ 'string',
165
+ '',
166
+ {},
167
+ ],
168
+ [
169
+ 'External Invoice Reference2',
170
+ 'ExternalInvoiceReference2',
171
+ 'string',
172
+ '',
173
+ {},
174
+ ],
175
+ ['Freight', 'Freight', 'number', 0, { numberPrecision: 2 }],
176
+ ['Invoice Date', 'InvoiceDate', 'string', '', {}],
177
+ ['Not Completed', 'NotCompleted', 'boolean', false, {}],
178
+ ['OCR', 'OCR', 'string', '', {}],
179
+ ['Our Reference', 'OurReference', 'string', '', {}],
180
+ ['Outbound Date', 'OutboundDate', 'string', '', {}],
181
+ ['Payment Way', 'PaymentWay', 'string', '', {}],
182
+ ['Phone1', 'Phone1', 'string', '', {}],
183
+ ['Phone2', 'Phone2', 'string', '', {}],
184
+ ['Price List', 'PriceList', 'string', '', {}],
185
+ ['Print Template', 'PrintTemplate', 'string', '', {}],
186
+ ['Project', 'Project', 'string', '', {}],
187
+ ['Remarks', 'Remarks', 'string', '', {}],
188
+ ['Terms Of Delivery', 'TermsOfDelivery', 'string', '', {}],
189
+ ['Terms Of Payment', 'TermsOfPayment', 'string', '', {}],
190
+ ['VAT Included', 'VatIncluded', 'boolean', false, {}],
191
+ ['Way Of Delivery', 'WayOfDelivery', 'string', '', {}],
192
+ ['Your Order Number', 'YourOrderNumber', 'string', '', {}],
193
+ ['Your Reference', 'YourReference', 'string', '', {}],
194
+ ['Zip Code', 'ZipCode', 'string', '', {}],
195
+ ];
196
+
197
+ export const invoiceParameters: INodeProperties[] = [
198
+ ...parametersDefinitions.map(
199
+ ([displayName, name, parameterType, defaultValue, typeOptions]) =>
200
+ createParameter(
201
+ displayName,
202
+ name,
203
+ parameterType,
204
+ defaultValue,
205
+ typeOptions
206
+ )
207
+ ),
208
+ ...collectionParametersDefinitions.map((collection) =>
209
+ createCollectionParameter(collection)
210
+ ),
211
+ ...optionParametersDefinitions.map((option) =>
212
+ createOptionParameter(option)
213
+ ),
214
+ ];