@wals-pro/n8n-nodes-weclapp 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 (98) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +206 -0
  3. package/dist/credentials/WeclappApi.credentials.d.ts +10 -0
  4. package/dist/credentials/WeclappApi.credentials.js +56 -0
  5. package/dist/credentials/WeclappApi.credentials.js.map +1 -0
  6. package/dist/credentials/weclapp.dark.svg +19 -0
  7. package/dist/credentials/weclapp.light.svg +19 -0
  8. package/dist/nodes/Weclapp/GenericFunctions.d.ts +19 -0
  9. package/dist/nodes/Weclapp/GenericFunctions.js +287 -0
  10. package/dist/nodes/Weclapp/GenericFunctions.js.map +1 -0
  11. package/dist/nodes/Weclapp/SharedFields.d.ts +24 -0
  12. package/dist/nodes/Weclapp/SharedFields.js +348 -0
  13. package/dist/nodes/Weclapp/SharedFields.js.map +1 -0
  14. package/dist/nodes/Weclapp/Weclapp.node.d.ts +27 -0
  15. package/dist/nodes/Weclapp/Weclapp.node.js +231 -0
  16. package/dist/nodes/Weclapp/Weclapp.node.js.map +1 -0
  17. package/dist/nodes/Weclapp/actions/applyPayment.d.ts +9 -0
  18. package/dist/nodes/Weclapp/actions/applyPayment.js +64 -0
  19. package/dist/nodes/Weclapp/actions/applyPayment.js.map +1 -0
  20. package/dist/nodes/Weclapp/actions/articlePriceSync.d.ts +41 -0
  21. package/dist/nodes/Weclapp/actions/articlePriceSync.js +238 -0
  22. package/dist/nodes/Weclapp/actions/articlePriceSync.js.map +1 -0
  23. package/dist/nodes/Weclapp/actions/documentUpload.d.ts +3 -0
  24. package/dist/nodes/Weclapp/actions/documentUpload.js +90 -0
  25. package/dist/nodes/Weclapp/actions/documentUpload.js.map +1 -0
  26. package/dist/nodes/Weclapp/descriptions/ArticleDescription.d.ts +3 -0
  27. package/dist/nodes/Weclapp/descriptions/ArticleDescription.js +724 -0
  28. package/dist/nodes/Weclapp/descriptions/ArticleDescription.js.map +1 -0
  29. package/dist/nodes/Weclapp/descriptions/BankDescription.d.ts +6 -0
  30. package/dist/nodes/Weclapp/descriptions/BankDescription.js +471 -0
  31. package/dist/nodes/Weclapp/descriptions/BankDescription.js.map +1 -0
  32. package/dist/nodes/Weclapp/descriptions/CustomApiDescription.d.ts +4 -0
  33. package/dist/nodes/Weclapp/descriptions/CustomApiDescription.js +238 -0
  34. package/dist/nodes/Weclapp/descriptions/CustomApiDescription.js.map +1 -0
  35. package/dist/nodes/Weclapp/descriptions/DocumentDescription.d.ts +3 -0
  36. package/dist/nodes/Weclapp/descriptions/DocumentDescription.js +976 -0
  37. package/dist/nodes/Weclapp/descriptions/DocumentDescription.js.map +1 -0
  38. package/dist/nodes/Weclapp/descriptions/PartyDescription.d.ts +4 -0
  39. package/dist/nodes/Weclapp/descriptions/PartyDescription.js +408 -0
  40. package/dist/nodes/Weclapp/descriptions/PartyDescription.js.map +1 -0
  41. package/dist/nodes/Weclapp/descriptions/ProductionOrderDescription.d.ts +4 -0
  42. package/dist/nodes/Weclapp/descriptions/ProductionOrderDescription.js +628 -0
  43. package/dist/nodes/Weclapp/descriptions/ProductionOrderDescription.js.map +1 -0
  44. package/dist/nodes/Weclapp/descriptions/PurchaseInvoiceDescription.d.ts +3 -0
  45. package/dist/nodes/Weclapp/descriptions/PurchaseInvoiceDescription.js +559 -0
  46. package/dist/nodes/Weclapp/descriptions/PurchaseInvoiceDescription.js.map +1 -0
  47. package/dist/nodes/Weclapp/descriptions/PurchaseOrderDescription.d.ts +3 -0
  48. package/dist/nodes/Weclapp/descriptions/PurchaseOrderDescription.js +681 -0
  49. package/dist/nodes/Weclapp/descriptions/PurchaseOrderDescription.js.map +1 -0
  50. package/dist/nodes/Weclapp/descriptions/QuotationDescription.d.ts +3 -0
  51. package/dist/nodes/Weclapp/descriptions/QuotationDescription.js +1069 -0
  52. package/dist/nodes/Weclapp/descriptions/QuotationDescription.js.map +1 -0
  53. package/dist/nodes/Weclapp/descriptions/SalesInvoiceDescription.d.ts +3 -0
  54. package/dist/nodes/Weclapp/descriptions/SalesInvoiceDescription.js +994 -0
  55. package/dist/nodes/Weclapp/descriptions/SalesInvoiceDescription.js.map +1 -0
  56. package/dist/nodes/Weclapp/descriptions/SalesOrderDescription.d.ts +4 -0
  57. package/dist/nodes/Weclapp/descriptions/SalesOrderDescription.js +1122 -0
  58. package/dist/nodes/Weclapp/descriptions/SalesOrderDescription.js.map +1 -0
  59. package/dist/nodes/Weclapp/descriptions/ShipmentDescription.d.ts +3 -0
  60. package/dist/nodes/Weclapp/descriptions/ShipmentDescription.js +502 -0
  61. package/dist/nodes/Weclapp/descriptions/ShipmentDescription.js.map +1 -0
  62. package/dist/nodes/Weclapp/descriptions/TagUnitUserDescription.d.ts +9 -0
  63. package/dist/nodes/Weclapp/descriptions/TagUnitUserDescription.js +664 -0
  64. package/dist/nodes/Weclapp/descriptions/TagUnitUserDescription.js.map +1 -0
  65. package/dist/nodes/Weclapp/descriptions/TicketDescription.d.ts +9 -0
  66. package/dist/nodes/Weclapp/descriptions/TicketDescription.js +745 -0
  67. package/dist/nodes/Weclapp/descriptions/TicketDescription.js.map +1 -0
  68. package/dist/nodes/Weclapp/descriptions/WarehouseDescription.d.ts +35 -0
  69. package/dist/nodes/Weclapp/descriptions/WarehouseDescription.js +935 -0
  70. package/dist/nodes/Weclapp/descriptions/WarehouseDescription.js.map +1 -0
  71. package/dist/nodes/Weclapp/descriptions/WebhookDescription.d.ts +4 -0
  72. package/dist/nodes/Weclapp/descriptions/WebhookDescription.js +411 -0
  73. package/dist/nodes/Weclapp/descriptions/WebhookDescription.js.map +1 -0
  74. package/dist/nodes/Weclapp/descriptions/index.d.ts +3 -0
  75. package/dist/nodes/Weclapp/descriptions/index.js +56 -0
  76. package/dist/nodes/Weclapp/descriptions/index.js.map +1 -0
  77. package/dist/nodes/Weclapp/generated/entityMetadata.d.ts +3 -0
  78. package/dist/nodes/Weclapp/generated/entityMetadata.js +368 -0
  79. package/dist/nodes/Weclapp/generated/entityMetadata.js.map +1 -0
  80. package/dist/nodes/Weclapp/generated/openapiMetadata.d.ts +3 -0
  81. package/dist/nodes/Weclapp/generated/openapiMetadata.js +212 -0
  82. package/dist/nodes/Weclapp/generated/openapiMetadata.js.map +1 -0
  83. package/dist/nodes/Weclapp/methods/customAttributes.d.ts +32 -0
  84. package/dist/nodes/Weclapp/methods/customAttributes.js +156 -0
  85. package/dist/nodes/Weclapp/methods/customAttributes.js.map +1 -0
  86. package/dist/nodes/Weclapp/methods/loadOptions.d.ts +3 -0
  87. package/dist/nodes/Weclapp/methods/loadOptions.js +107 -0
  88. package/dist/nodes/Weclapp/methods/loadOptions.js.map +1 -0
  89. package/dist/nodes/Weclapp/weclapp.dark.svg +19 -0
  90. package/dist/nodes/Weclapp/weclapp.light.svg +19 -0
  91. package/dist/nodes/WeclappTrigger/WeclappTrigger.node.d.ts +12 -0
  92. package/dist/nodes/WeclappTrigger/WeclappTrigger.node.js +198 -0
  93. package/dist/nodes/WeclappTrigger/WeclappTrigger.node.js.map +1 -0
  94. package/dist/nodes/WeclappTrigger/weclapp.dark.svg +19 -0
  95. package/dist/nodes/WeclappTrigger/weclapp.light.svg +19 -0
  96. package/dist/package.json +78 -0
  97. package/dist/tsconfig.tsbuildinfo +1 -0
  98. package/package.json +78 -0
@@ -0,0 +1,994 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.salesInvoiceFields = exports.salesInvoiceOperations = void 0;
4
+ const SharedFields_1 = require("../SharedFields");
5
+ const GenericFunctions_1 = require("../GenericFunctions");
6
+ exports.salesInvoiceOperations = [
7
+ {
8
+ displayName: 'Operation',
9
+ name: 'operation',
10
+ type: 'options',
11
+ noDataExpression: true,
12
+ displayOptions: {
13
+ show: {
14
+ resource: ['salesInvoice'],
15
+ },
16
+ },
17
+ options: [
18
+ {
19
+ name: 'Add Sales Orders',
20
+ value: 'addSalesOrders',
21
+ description: 'Attach one or more sales orders to this sales invoice',
22
+ action: 'Add sales orders to a sales invoice',
23
+ routing: {
24
+ request: {
25
+ method: 'POST',
26
+ url: '=/salesInvoice/id/{{ $parameter.salesInvoiceId }}/addSalesOrders',
27
+ },
28
+ output: {
29
+ postReceive: [
30
+ {
31
+ type: 'rootProperty',
32
+ properties: {
33
+ property: 'result',
34
+ },
35
+ },
36
+ ],
37
+ },
38
+ },
39
+ },
40
+ {
41
+ name: 'Calculate Sales Prices',
42
+ value: 'calculateSalesPrices',
43
+ description: 'Recalculate item sales prices using cost-surcharge or target-margin mode',
44
+ action: 'Calculate sales prices on a sales invoice',
45
+ routing: {
46
+ request: {
47
+ method: 'POST',
48
+ url: '=/salesInvoice/id/{{ $parameter.salesInvoiceId }}/calculateSalesPrices',
49
+ },
50
+ output: {
51
+ postReceive: [
52
+ {
53
+ type: 'rootProperty',
54
+ properties: {
55
+ property: 'result',
56
+ },
57
+ },
58
+ ],
59
+ },
60
+ },
61
+ },
62
+ {
63
+ name: 'Create',
64
+ value: 'create',
65
+ description: 'Create a new sales invoice',
66
+ action: 'Create a sales invoice',
67
+ routing: {
68
+ request: {
69
+ method: 'POST',
70
+ url: '/salesInvoice',
71
+ },
72
+ },
73
+ },
74
+ {
75
+ name: 'Create Credit Note',
76
+ value: 'createCreditNote',
77
+ description: 'Create a credit note for this sales invoice (optionally for specific items)',
78
+ action: 'Create credit note from a sales invoice',
79
+ routing: {
80
+ request: {
81
+ method: 'POST',
82
+ url: '=/salesInvoice/id/{{ $parameter.salesInvoiceId }}/createCreditNote',
83
+ },
84
+ output: {
85
+ postReceive: [
86
+ {
87
+ type: 'rootProperty',
88
+ properties: {
89
+ property: 'result',
90
+ },
91
+ },
92
+ ],
93
+ },
94
+ },
95
+ },
96
+ {
97
+ name: 'Create Credit Note Open Item',
98
+ value: 'createCreditNoteOpenItem',
99
+ description: 'Create an open-item credit note for this sales invoice',
100
+ action: 'Create credit note open item from a sales invoice',
101
+ routing: {
102
+ request: {
103
+ method: 'POST',
104
+ url: '=/salesInvoice/id/{{ $parameter.salesInvoiceId }}/createCreditNoteOpenItem',
105
+ },
106
+ output: {
107
+ postReceive: [
108
+ {
109
+ type: 'rootProperty',
110
+ properties: {
111
+ property: 'result',
112
+ },
113
+ },
114
+ ],
115
+ },
116
+ },
117
+ },
118
+ {
119
+ name: 'Delete',
120
+ value: 'delete',
121
+ description: 'Delete a sales invoice by ID',
122
+ action: 'Delete a sales invoice',
123
+ routing: {
124
+ request: {
125
+ method: 'DELETE',
126
+ url: '=/salesInvoice/id/{{ $parameter.salesInvoiceId }}',
127
+ },
128
+ output: {
129
+ postReceive: [
130
+ {
131
+ type: 'set',
132
+ properties: {
133
+ value: '={{ { "deleted": true, "id": $parameter.salesInvoiceId } }}',
134
+ },
135
+ },
136
+ ],
137
+ },
138
+ },
139
+ },
140
+ {
141
+ name: 'Download PDF',
142
+ value: 'downloadLatestSalesInvoicePdf',
143
+ description: 'Download the latest PDF for this sales invoice as binary data',
144
+ action: 'Download sales invoice PDF',
145
+ routing: {
146
+ request: {
147
+ method: 'GET',
148
+ url: '=/salesInvoice/id/{{ $parameter.salesInvoiceId }}/downloadLatestSalesInvoicePdf',
149
+ returnFullResponse: true,
150
+ encoding: 'arraybuffer',
151
+ },
152
+ output: {
153
+ postReceive: [
154
+ {
155
+ type: 'binaryData',
156
+ properties: {
157
+ destinationProperty: 'data',
158
+ },
159
+ },
160
+ ],
161
+ },
162
+ },
163
+ },
164
+ {
165
+ name: 'Get',
166
+ value: 'get',
167
+ description: 'Retrieve a sales invoice by ID',
168
+ action: 'Get a sales invoice',
169
+ routing: {
170
+ request: {
171
+ method: 'GET',
172
+ url: '=/salesInvoice/id/{{ $parameter.salesInvoiceId }}',
173
+ },
174
+ output: {
175
+ postReceive: [GenericFunctions_1.simplifyPostReceive],
176
+ },
177
+ },
178
+ },
179
+ {
180
+ name: 'Get Many',
181
+ value: 'list',
182
+ description: 'Retrieve a list of sales invoices',
183
+ action: 'Get many sales invoices',
184
+ routing: {
185
+ ...SharedFields_1.listPaginationRouting,
186
+ request: {
187
+ method: 'GET',
188
+ url: '/salesInvoice',
189
+ },
190
+ output: {
191
+ postReceive: [
192
+ {
193
+ type: 'rootProperty',
194
+ properties: {
195
+ property: 'result',
196
+ },
197
+ },
198
+ GenericFunctions_1.mergeAdditionalProperties,
199
+ GenericFunctions_1.simplifyPostReceive,
200
+ ],
201
+ },
202
+ },
203
+ },
204
+ {
205
+ name: 'Print Label',
206
+ value: 'printLabel',
207
+ description: 'Generate a label PDF for items on this sales invoice',
208
+ action: 'Print label for a sales invoice',
209
+ routing: {
210
+ request: {
211
+ method: 'POST',
212
+ url: '=/salesInvoice/id/{{ $parameter.salesInvoiceId }}/printLabel',
213
+ returnFullResponse: true,
214
+ encoding: 'arraybuffer',
215
+ },
216
+ output: {
217
+ postReceive: [
218
+ {
219
+ type: 'binaryData',
220
+ properties: {
221
+ destinationProperty: 'data',
222
+ },
223
+ },
224
+ ],
225
+ },
226
+ },
227
+ },
228
+ {
229
+ name: 'Recalculate Costs',
230
+ value: 'recalculateCosts',
231
+ description: 'Recalculate costs for all items on this sales invoice from current sources',
232
+ action: 'Recalculate costs on a sales invoice',
233
+ routing: {
234
+ request: {
235
+ method: 'POST',
236
+ url: '=/salesInvoice/id/{{ $parameter.salesInvoiceId }}/recalculateCosts',
237
+ },
238
+ output: {
239
+ postReceive: [
240
+ {
241
+ type: 'rootProperty',
242
+ properties: {
243
+ property: 'result',
244
+ },
245
+ },
246
+ ],
247
+ },
248
+ },
249
+ },
250
+ {
251
+ name: 'Reset Taxes',
252
+ value: 'resetTaxes',
253
+ description: 'Reset item taxes to their defaults on this sales invoice',
254
+ action: 'Reset taxes on a sales invoice',
255
+ routing: {
256
+ request: {
257
+ method: 'POST',
258
+ url: '=/salesInvoice/id/{{ $parameter.salesInvoiceId }}/resetTaxes',
259
+ },
260
+ output: {
261
+ postReceive: [
262
+ {
263
+ type: 'rootProperty',
264
+ properties: {
265
+ property: 'result',
266
+ },
267
+ },
268
+ ],
269
+ },
270
+ },
271
+ },
272
+ {
273
+ name: 'Set Costs for Items Without Cost',
274
+ value: 'setCostsForItemsWithoutCost',
275
+ description: 'Set unit costs for all sales invoice items that currently have no unit cost',
276
+ action: 'Set costs for items without cost on a sales invoice',
277
+ routing: {
278
+ request: {
279
+ method: 'POST',
280
+ url: '=/salesInvoice/id/{{ $parameter.salesInvoiceId }}/setCostsForItemsWithoutCost',
281
+ },
282
+ output: {
283
+ postReceive: [
284
+ {
285
+ type: 'rootProperty',
286
+ properties: {
287
+ property: 'result',
288
+ },
289
+ },
290
+ ],
291
+ },
292
+ },
293
+ },
294
+ {
295
+ name: 'Update',
296
+ value: 'update',
297
+ description: 'Update a sales invoice by ID (PUT with ignoreMissingProperties=true)',
298
+ action: 'Update a sales invoice',
299
+ routing: {
300
+ request: {
301
+ method: 'PUT',
302
+ url: '=/salesInvoice/id/{{ $parameter.salesInvoiceId }}',
303
+ qs: {
304
+ ignoreMissingProperties: true,
305
+ },
306
+ },
307
+ },
308
+ },
309
+ {
310
+ name: 'Update Prices',
311
+ value: 'updatePrices',
312
+ description: 'Refresh article prices on this sales invoice from current price lists',
313
+ action: 'Update prices on a sales invoice',
314
+ routing: {
315
+ request: {
316
+ method: 'POST',
317
+ url: '=/salesInvoice/id/{{ $parameter.salesInvoiceId }}/updatePrices',
318
+ },
319
+ output: {
320
+ postReceive: [
321
+ {
322
+ type: 'rootProperty',
323
+ properties: {
324
+ property: 'result',
325
+ },
326
+ },
327
+ ],
328
+ },
329
+ },
330
+ },
331
+ ],
332
+ default: 'list',
333
+ },
334
+ ];
335
+ const salesInvoiceIdField = {
336
+ displayName: 'Sales Invoice',
337
+ name: 'salesInvoiceId',
338
+ type: 'resourceLocator',
339
+ default: { mode: 'list', value: '' },
340
+ required: true,
341
+ description: 'The sales invoice to operate on',
342
+ displayOptions: {
343
+ show: {
344
+ resource: ['salesInvoice'],
345
+ operation: [
346
+ 'addSalesOrders',
347
+ 'calculateSalesPrices',
348
+ 'createCreditNote',
349
+ 'createCreditNoteOpenItem',
350
+ 'delete',
351
+ 'downloadLatestSalesInvoicePdf',
352
+ 'get',
353
+ 'printLabel',
354
+ 'recalculateCosts',
355
+ 'resetTaxes',
356
+ 'setCostsForItemsWithoutCost',
357
+ 'update',
358
+ 'updatePrices',
359
+ ],
360
+ },
361
+ },
362
+ modes: [
363
+ {
364
+ displayName: 'From List',
365
+ name: 'list',
366
+ type: 'list',
367
+ typeOptions: {
368
+ searchListMethod: 'searchSalesInvoices',
369
+ searchable: true,
370
+ },
371
+ },
372
+ {
373
+ displayName: 'By ID',
374
+ name: 'id',
375
+ type: 'string',
376
+ placeholder: 'e.g. 1234567890',
377
+ validation: [
378
+ {
379
+ type: 'regex',
380
+ properties: {
381
+ regex: '^[0-9]+$',
382
+ errorMessage: 'Sales Invoice ID must be numeric',
383
+ },
384
+ },
385
+ ],
386
+ },
387
+ {
388
+ displayName: 'By URL',
389
+ name: 'url',
390
+ type: 'string',
391
+ placeholder: 'e.g. https://tenant.weclapp.com/webapp/api/v2/salesInvoice/id/1234567890',
392
+ extractValue: {
393
+ type: 'regex',
394
+ regex: '/salesInvoice/id/([0-9]+)',
395
+ },
396
+ validation: [
397
+ {
398
+ type: 'regex',
399
+ properties: {
400
+ regex: '/salesInvoice/id/[0-9]+',
401
+ errorMessage: 'URL must contain /salesInvoice/id/{id}',
402
+ },
403
+ },
404
+ ],
405
+ },
406
+ ],
407
+ };
408
+ exports.salesInvoiceFields = [
409
+ salesInvoiceIdField,
410
+ {
411
+ ...SharedFields_1.limitField,
412
+ displayOptions: {
413
+ show: {
414
+ resource: ['salesInvoice'],
415
+ operation: ['list'],
416
+ },
417
+ },
418
+ },
419
+ {
420
+ displayName: 'Customer ID',
421
+ name: 'customerId',
422
+ type: 'string',
423
+ default: '',
424
+ description: 'Filter by customer ID',
425
+ displayOptions: {
426
+ show: {
427
+ resource: ['salesInvoice'],
428
+ operation: ['list'],
429
+ },
430
+ },
431
+ routing: {
432
+ request: {
433
+ qs: {
434
+ 'customerId-eq': '={{ $value || undefined }}',
435
+ },
436
+ },
437
+ },
438
+ },
439
+ {
440
+ displayName: 'Due Date (From)',
441
+ name: 'dueDateFrom',
442
+ type: 'dateTime',
443
+ default: '',
444
+ description: 'Filter invoices with dueDate on or after this date',
445
+ displayOptions: {
446
+ show: {
447
+ resource: ['salesInvoice'],
448
+ operation: ['list'],
449
+ },
450
+ },
451
+ routing: {
452
+ request: {
453
+ qs: {
454
+ 'dueDate-ge': '={{ $value ? new Date($value).getTime() : undefined }}',
455
+ },
456
+ },
457
+ },
458
+ },
459
+ {
460
+ displayName: 'Invoice Date (From)',
461
+ name: 'invoiceDateFrom',
462
+ type: 'dateTime',
463
+ default: '',
464
+ description: 'Filter invoices with invoiceDate on or after this date',
465
+ displayOptions: {
466
+ show: {
467
+ resource: ['salesInvoice'],
468
+ operation: ['list'],
469
+ },
470
+ },
471
+ routing: {
472
+ request: {
473
+ qs: {
474
+ 'invoiceDate-ge': '={{ $value ? new Date($value).getTime() : undefined }}',
475
+ },
476
+ },
477
+ },
478
+ },
479
+ {
480
+ displayName: 'Invoice Date (To)',
481
+ name: 'invoiceDateTo',
482
+ type: 'dateTime',
483
+ default: '',
484
+ description: 'Filter invoices with invoiceDate on or before this date',
485
+ displayOptions: {
486
+ show: {
487
+ resource: ['salesInvoice'],
488
+ operation: ['list'],
489
+ },
490
+ },
491
+ routing: {
492
+ request: {
493
+ qs: {
494
+ 'invoiceDate-le': '={{ $value ? new Date($value).getTime() : undefined }}',
495
+ },
496
+ },
497
+ },
498
+ },
499
+ {
500
+ displayName: 'Invoice Number',
501
+ name: 'invoiceNumber',
502
+ type: 'string',
503
+ default: '',
504
+ description: 'Filter by exact invoice number',
505
+ displayOptions: {
506
+ show: {
507
+ resource: ['salesInvoice'],
508
+ operation: ['list'],
509
+ },
510
+ },
511
+ routing: {
512
+ request: {
513
+ qs: {
514
+ 'invoiceNumber-eq': '={{ $value || undefined }}',
515
+ },
516
+ },
517
+ },
518
+ },
519
+ {
520
+ displayName: 'Record Currency ID',
521
+ name: 'recordCurrencyId',
522
+ type: 'string',
523
+ default: '',
524
+ description: 'Filter by currency ID (e.g. EUR)',
525
+ displayOptions: {
526
+ show: {
527
+ resource: ['salesInvoice'],
528
+ operation: ['list'],
529
+ },
530
+ },
531
+ routing: {
532
+ request: {
533
+ qs: {
534
+ 'recordCurrencyId-eq': '={{ $value || undefined }}',
535
+ },
536
+ },
537
+ },
538
+ },
539
+ {
540
+ displayName: 'Status',
541
+ name: 'status',
542
+ type: 'options',
543
+ default: '',
544
+ description: 'Filter by invoice status',
545
+ options: [
546
+ { name: '(All)', value: '' },
547
+ { name: 'Cancelled', value: 'CANCELLED' },
548
+ { name: 'Document Created', value: 'DOCUMENT_CREATED' },
549
+ { name: 'Entry Completed', value: 'ENTRY_COMPLETED' },
550
+ { name: 'New', value: 'NEW' },
551
+ { name: 'Open Item Created', value: 'OPEN_ITEM_CREATED' },
552
+ ],
553
+ displayOptions: {
554
+ show: {
555
+ resource: ['salesInvoice'],
556
+ operation: ['list'],
557
+ },
558
+ },
559
+ routing: {
560
+ request: {
561
+ qs: {
562
+ 'status-eq': '={{ $value || undefined }}',
563
+ },
564
+ },
565
+ },
566
+ },
567
+ {
568
+ ...SharedFields_1.filtersCollection,
569
+ displayOptions: {
570
+ show: {
571
+ resource: ['salesInvoice'],
572
+ operation: ['list'],
573
+ },
574
+ },
575
+ },
576
+ {
577
+ ...SharedFields_1.simplifyField,
578
+ displayOptions: {
579
+ show: {
580
+ resource: ['salesInvoice'],
581
+ operation: ['get', 'list'],
582
+ },
583
+ },
584
+ },
585
+ {
586
+ displayName: 'Customer ID',
587
+ name: 'customerId',
588
+ type: 'string',
589
+ required: true,
590
+ default: '',
591
+ description: 'ID of the customer for this invoice',
592
+ displayOptions: {
593
+ show: {
594
+ resource: ['salesInvoice'],
595
+ operation: ['create'],
596
+ },
597
+ },
598
+ routing: {
599
+ request: {
600
+ body: {
601
+ customerId: '={{ $value }}',
602
+ },
603
+ },
604
+ },
605
+ },
606
+ {
607
+ displayName: 'Invoice Date',
608
+ name: 'invoiceDate',
609
+ type: 'dateTime',
610
+ required: true,
611
+ default: '',
612
+ description: 'Date of the invoice',
613
+ displayOptions: {
614
+ show: {
615
+ resource: ['salesInvoice'],
616
+ operation: ['create'],
617
+ },
618
+ },
619
+ routing: {
620
+ request: {
621
+ body: {
622
+ invoiceDate: '={{ $value ? new Date($value).getTime() : undefined }}',
623
+ },
624
+ },
625
+ },
626
+ },
627
+ {
628
+ displayName: 'Additional Fields',
629
+ name: 'additionalFields',
630
+ type: 'collection',
631
+ placeholder: 'Add Field',
632
+ default: {},
633
+ displayOptions: {
634
+ show: {
635
+ resource: ['salesInvoice'],
636
+ operation: ['create'],
637
+ },
638
+ },
639
+ options: [
640
+ {
641
+ displayName: 'Comment',
642
+ name: 'comment',
643
+ type: 'string',
644
+ default: '',
645
+ description: 'Internal comment on the invoice',
646
+ routing: {
647
+ request: {
648
+ body: {
649
+ comment: '={{ $value || undefined }}',
650
+ },
651
+ },
652
+ },
653
+ },
654
+ {
655
+ displayName: 'Currency ID',
656
+ name: 'currencyId',
657
+ type: 'string',
658
+ default: '',
659
+ description: 'Currency ID (e.g. EUR). Defaults to customer currency if omitted.',
660
+ routing: {
661
+ request: {
662
+ body: {
663
+ currencyId: '={{ $value || undefined }}',
664
+ },
665
+ },
666
+ },
667
+ },
668
+ {
669
+ displayName: 'Dry Run',
670
+ name: 'dryRun',
671
+ type: 'boolean',
672
+ default: false,
673
+ description: 'Whether to validate the request without persisting it',
674
+ routing: {
675
+ request: {
676
+ qs: {
677
+ dryRun: '={{ $value || undefined }}',
678
+ },
679
+ },
680
+ },
681
+ },
682
+ {
683
+ displayName: 'Sales Channel',
684
+ name: 'salesChannel',
685
+ type: 'string',
686
+ default: '',
687
+ description: 'Sales channel ID. If omitted, the customer default is used.',
688
+ routing: {
689
+ request: {
690
+ body: {
691
+ salesChannel: '={{ $value || undefined }}',
692
+ },
693
+ },
694
+ },
695
+ },
696
+ ],
697
+ },
698
+ {
699
+ displayName: 'Update Fields (JSON)',
700
+ name: 'updateBody',
701
+ type: 'json',
702
+ default: '{}',
703
+ description: 'Fields to update as a JSON object. Only supplied fields are changed (ignoreMissingProperties=true). Include "version" to use optimistic locking.',
704
+ displayOptions: {
705
+ show: {
706
+ resource: ['salesInvoice'],
707
+ operation: ['update'],
708
+ },
709
+ },
710
+ routing: {
711
+ request: {
712
+ body: '={{ JSON.parse($value) }}',
713
+ },
714
+ },
715
+ },
716
+ {
717
+ displayName: 'Dry Run',
718
+ name: 'dryRunUpdate',
719
+ type: 'boolean',
720
+ default: false,
721
+ description: 'Whether to validate the update without persisting it',
722
+ displayOptions: {
723
+ show: {
724
+ resource: ['salesInvoice'],
725
+ operation: ['update'],
726
+ },
727
+ },
728
+ routing: {
729
+ request: {
730
+ qs: {
731
+ dryRun: '={{ $value || undefined }}',
732
+ },
733
+ },
734
+ },
735
+ },
736
+ {
737
+ ...SharedFields_1.customAttributesField,
738
+ displayOptions: { show: { resource: ['salesInvoice'], operation: ['create', 'update'] } },
739
+ },
740
+ {
741
+ displayName: 'Collective Invoice Position Print Type',
742
+ name: 'collectiveInvoicePositionPrintType',
743
+ type: 'options',
744
+ default: '',
745
+ description: 'How positions are grouped on the collective invoice',
746
+ options: [
747
+ { name: '(None)', value: '' },
748
+ { name: 'Order Position Group', value: 'ORDER_POSITION_GROUP' },
749
+ { name: 'Performance Record Position Group', value: 'PERFORMANCE_RECORD_POSITION_GROUP' },
750
+ { name: 'Shipment Position Group', value: 'SHIPMENT_POSITION_GROUP' },
751
+ ],
752
+ displayOptions: {
753
+ show: {
754
+ resource: ['salesInvoice'],
755
+ operation: ['addSalesOrders'],
756
+ },
757
+ },
758
+ routing: {
759
+ request: {
760
+ body: {
761
+ collectiveInvoicePositionPrintType: '={{ $value || undefined }}',
762
+ },
763
+ },
764
+ },
765
+ },
766
+ {
767
+ displayName: 'Sales Order IDs',
768
+ name: 'salesOrderIds',
769
+ type: 'string',
770
+ required: true,
771
+ default: '',
772
+ description: 'Comma-separated list of sales order IDs to attach to the invoice',
773
+ displayOptions: {
774
+ show: {
775
+ resource: ['salesInvoice'],
776
+ operation: ['addSalesOrders'],
777
+ },
778
+ },
779
+ routing: {
780
+ request: {
781
+ body: {
782
+ salesOrderIds: '={{ $value.split(",").map((s) => s.trim()).filter(Boolean) }}',
783
+ },
784
+ },
785
+ },
786
+ },
787
+ {
788
+ displayName: 'Calculation Mode',
789
+ name: 'calculationMode',
790
+ type: 'options',
791
+ required: true,
792
+ default: 'COST_SURCHARGE',
793
+ description: 'How to calculate new sales prices',
794
+ options: [
795
+ {
796
+ name: 'Cost Surcharge',
797
+ value: 'COST_SURCHARGE',
798
+ description: 'Net price = purchase costs + purchase costs x surcharge / 100',
799
+ },
800
+ {
801
+ name: 'Target Margin',
802
+ value: 'TARGET_MARGIN',
803
+ description: 'Net price = purchase costs x 100 / (100 - target margin)',
804
+ },
805
+ ],
806
+ displayOptions: {
807
+ show: {
808
+ resource: ['salesInvoice'],
809
+ operation: ['calculateSalesPrices'],
810
+ },
811
+ },
812
+ routing: {
813
+ request: {
814
+ body: {
815
+ calculationMode: '={{ $value }}',
816
+ },
817
+ },
818
+ },
819
+ },
820
+ {
821
+ displayName: 'Invoice Item IDs (Optional)',
822
+ name: 'invoiceItemIds',
823
+ type: 'string',
824
+ default: '',
825
+ description: 'Comma-separated list of invoice item IDs to recalculate. If empty, all items are recalculated.',
826
+ displayOptions: {
827
+ show: {
828
+ resource: ['salesInvoice'],
829
+ operation: ['calculateSalesPrices'],
830
+ },
831
+ },
832
+ routing: {
833
+ request: {
834
+ body: {
835
+ invoiceItemIds: '={{ $value ? $value.split(",").map((s) => s.trim()).filter(Boolean) : undefined }}',
836
+ },
837
+ },
838
+ },
839
+ },
840
+ {
841
+ displayName: 'Percentage',
842
+ name: 'percentage',
843
+ type: 'string',
844
+ required: true,
845
+ default: '',
846
+ description: 'Target margin or surcharge percentage (decimal string, e.g. "20" for 20%)',
847
+ placeholder: 'e.g. 20',
848
+ displayOptions: {
849
+ show: {
850
+ resource: ['salesInvoice'],
851
+ operation: ['calculateSalesPrices'],
852
+ },
853
+ },
854
+ routing: {
855
+ request: {
856
+ body: {
857
+ percentage: '={{ $value }}',
858
+ },
859
+ },
860
+ },
861
+ },
862
+ {
863
+ displayName: 'Item IDs (Optional)',
864
+ name: 'itemIds',
865
+ type: 'string',
866
+ default: '',
867
+ description: 'Comma-separated list of invoice item IDs to include in the credit note. If empty, all items are used.',
868
+ displayOptions: {
869
+ show: {
870
+ resource: ['salesInvoice'],
871
+ operation: ['createCreditNote'],
872
+ },
873
+ },
874
+ routing: {
875
+ request: {
876
+ body: {
877
+ itemIds: '={{ $value ? $value.split(",").map((s) => s.trim()).filter(Boolean) : undefined }}',
878
+ },
879
+ },
880
+ },
881
+ },
882
+ {
883
+ displayName: 'Clear Credit Note',
884
+ name: 'clearCreditNote',
885
+ type: 'boolean',
886
+ default: false,
887
+ description: 'Whether to automatically clear (offset) the credit note against the invoice',
888
+ displayOptions: {
889
+ show: {
890
+ resource: ['salesInvoice'],
891
+ operation: ['createCreditNoteOpenItem'],
892
+ },
893
+ },
894
+ routing: {
895
+ request: {
896
+ body: {
897
+ clearCreditNote: '={{ $value }}',
898
+ },
899
+ },
900
+ },
901
+ },
902
+ {
903
+ displayName: 'Item Label Quantity Print Setting',
904
+ name: 'itemLabelQuantityPrintSetting',
905
+ type: 'options',
906
+ required: true,
907
+ default: 'ONLY_ONE_LABEL_PER_ITEM',
908
+ description: 'Controls how many labels are printed per item',
909
+ options: [
910
+ {
911
+ name: 'Item Quantity',
912
+ value: 'ITEM_QUANTITY',
913
+ description: 'Print one label per unit of quantity',
914
+ },
915
+ {
916
+ name: 'Only One Label per Booking Record',
917
+ value: 'ONLY_ONE_LABEL_PER_BOOKING_RECORD',
918
+ description: 'Print one label per booking record',
919
+ },
920
+ {
921
+ name: 'Only One Label per Item',
922
+ value: 'ONLY_ONE_LABEL_PER_ITEM',
923
+ description: 'Print one label per line item',
924
+ },
925
+ ],
926
+ displayOptions: {
927
+ show: {
928
+ resource: ['salesInvoice'],
929
+ operation: ['printLabel'],
930
+ },
931
+ },
932
+ routing: {
933
+ request: {
934
+ body: {
935
+ itemLabelQuantityPrintSetting: '={{ $value }}',
936
+ },
937
+ },
938
+ },
939
+ },
940
+ {
941
+ displayName: 'Sales Invoice Item IDs (Optional)',
942
+ name: 'salesInvoiceItemIds',
943
+ type: 'string',
944
+ default: '',
945
+ description: 'Comma-separated list of invoice item IDs to print labels for. If empty, labels are printed for all items.',
946
+ displayOptions: {
947
+ show: {
948
+ resource: ['salesInvoice'],
949
+ operation: ['printLabel'],
950
+ },
951
+ },
952
+ routing: {
953
+ request: {
954
+ body: {
955
+ salesInvoiceItemIds: '={{ $value ? $value.split(",").map((s) => s.trim()).filter(Boolean) : undefined }}',
956
+ },
957
+ },
958
+ },
959
+ },
960
+ {
961
+ displayName: 'Cost Update Mode',
962
+ name: 'costUpdateMode',
963
+ type: 'options',
964
+ required: true,
965
+ default: 'SET_TO_NET_UNIT_PRICE',
966
+ description: 'Target value to assign as unit cost for items that currently have no cost',
967
+ options: [
968
+ {
969
+ name: 'Set to Net Unit Price',
970
+ value: 'SET_TO_NET_UNIT_PRICE',
971
+ description: 'Use the net unit price of each item as its unit cost',
972
+ },
973
+ {
974
+ name: 'Set to Zero',
975
+ value: 'SET_TO_ZERO',
976
+ description: 'Set unit cost to 0',
977
+ },
978
+ ],
979
+ displayOptions: {
980
+ show: {
981
+ resource: ['salesInvoice'],
982
+ operation: ['setCostsForItemsWithoutCost'],
983
+ },
984
+ },
985
+ routing: {
986
+ request: {
987
+ body: {
988
+ costUpdateMode: '={{ $value }}',
989
+ },
990
+ },
991
+ },
992
+ },
993
+ ];
994
+ //# sourceMappingURL=SalesInvoiceDescription.js.map