@pokash/n8n-nodes-optima-rest-api 1.3.1 → 1.4.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.
@@ -319,9 +319,45 @@ class OptimaRestApi {
319
319
  name: 'Purchase Invoice',
320
320
  value: 'Purchase',
321
321
  },
322
+ {
323
+ name: 'Margin Invoice (VAT marża)',
324
+ value: 'Margin',
325
+ },
322
326
  ],
323
327
  default: 'Sale',
324
328
  },
329
+ // Procedura marży - only for Margin Invoice
330
+ {
331
+ displayName: 'Margin Procedure',
332
+ name: 'proceduraMarzy',
333
+ type: 'options',
334
+ displayOptions: {
335
+ show: {
336
+ resource: ['document'],
337
+ operation: ['createInvoice'],
338
+ documentType: ['Margin'],
339
+ },
340
+ },
341
+ options: [
342
+ {
343
+ name: 'Towary używane',
344
+ value: 'towary używane',
345
+ },
346
+ {
347
+ name: 'Biura podróży',
348
+ value: 'biura podróży',
349
+ },
350
+ {
351
+ name: 'Dzieła sztuki',
352
+ value: 'dzieła sztuki',
353
+ },
354
+ {
355
+ name: 'Przedmioty kolekcjonerskie i antyki',
356
+ value: 'przedmioty kolekcjonerskie i antyki',
357
+ },
358
+ ],
359
+ default: 'towary używane',
360
+ },
325
361
  // Record Type for Additional Record
326
362
  {
327
363
  displayName: 'Record Type',
@@ -799,6 +835,11 @@ class OptimaRestApi {
799
835
  if (operation === 'createInvoice') {
800
836
  const documentType = this.getNodeParameter('documentType', i);
801
837
  const documentData = JSON.parse(this.getNodeParameter('documentData', i));
838
+ // Add ProceduraMarzy for Margin invoices
839
+ if (documentType === 'Margin') {
840
+ const proceduraMarzy = this.getNodeParameter('proceduraMarzy', i);
841
+ documentData.ProceduraMarzy = proceduraMarzy;
842
+ }
802
843
  const response = await makeAuthenticatedRequest({
803
844
  method: 'POST',
804
845
  url: `${gatewayUrl}/api/Documents/Invoice/${documentType}`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pokash/n8n-nodes-optima-rest-api",
3
- "version": "1.3.1",
3
+ "version": "1.4.0",
4
4
  "description": "n8n node for Comarch Optima REST API integration",
5
5
  "keywords": [
6
6
  "n8n-community-node-package",