@pokash/n8n-nodes-optima-rest-api 1.8.0 → 1.9.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.
@@ -392,11 +392,23 @@ class OptimaRestApi {
392
392
  description: 'Document data in JSON format. For corrections: include OryginalDocumentId and PrzyczynaKorekty.',
393
393
  },
394
394
  // ---- KSeF Update fields (operation: updateKSeF) ----
395
+ {
396
+ displayName: 'Numer Pełny',
397
+ name: 'numerPelny',
398
+ type: 'string',
399
+ default: '',
400
+ displayOptions: {
401
+ show: {
402
+ resource: ['document'],
403
+ operation: ['updateKSeF'],
404
+ },
405
+ },
406
+ description: 'Nasz numer dokumentu (np. FS/3/2026/DEV/07) — dla SPRZEDAŻY (unikalny w firmie). Ma pierwszeństwo nad Numer Obcy.',
407
+ },
395
408
  {
396
409
  displayName: 'Numer Obcy',
397
410
  name: 'numerObcy',
398
411
  type: 'string',
399
- required: true,
400
412
  default: '',
401
413
  displayOptions: {
402
414
  show: {
@@ -404,7 +416,7 @@ class OptimaRestApi {
404
416
  operation: ['updateKSeF'],
405
417
  },
406
418
  },
407
- description: 'Numer obcy dokumentu (klucz wyszukiwania). Wraz z NIP wskazuje dokładnie 1 dokument.',
419
+ description: 'Numer obcy (sprzedawcy) — dla ZAKUPÓW; użyj razem z NIP. Dla sprzedaży użyj Numer Pełny.',
408
420
  },
409
421
  {
410
422
  displayName: 'NIP (Sprzedawcy)',
@@ -939,14 +951,19 @@ class OptimaRestApi {
939
951
  if (operation === 'updateKSeF') {
940
952
  // Aktualizacja danych KSeF nagłówka po NumerObcy (+ opcjonalnie NIP sprzedawcy).
941
953
  // Partial update: dołączamy tylko niepuste pola (pusty string = "bez zmian").
942
- const numerObcy = this.getNodeParameter('numerObcy', i);
954
+ const numerPelny = this.getNodeParameter('numerPelny', i, '');
955
+ const numerObcy = this.getNodeParameter('numerObcy', i, '');
943
956
  const nip = this.getNodeParameter('nip', i, '');
944
957
  const nrKsef = this.getNodeParameter('nrKsef', i, '');
945
958
  const dataPrzyjecia = this.getNodeParameter('dataPrzyjecia', i, '');
946
959
  const formaPlatnosci = this.getNodeParameter('formaPlatnosci', i, '');
947
960
  const srodowisko = this.getNodeParameter('srodowisko', i, '');
948
961
  const linkWeryfikacyjny = this.getNodeParameter('linkWeryfikacyjny', i, '');
949
- const body = { NumerObcy: numerObcy };
962
+ const body = {};
963
+ if (numerPelny)
964
+ body.NumerPelny = numerPelny;
965
+ if (numerObcy)
966
+ body.NumerObcy = numerObcy;
950
967
  if (nip)
951
968
  body.Nip = nip;
952
969
  if (nrKsef)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pokash/n8n-nodes-optima-rest-api",
3
- "version": "1.8.0",
3
+ "version": "1.9.0",
4
4
  "description": "n8n node for Comarch Optima REST API integration",
5
5
  "keywords": [
6
6
  "n8n-community-node-package",