@disruptive-learning/n8n-nodes-gigstack 1.1.8 → 1.1.9
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.
|
@@ -595,13 +595,29 @@ class Gigstack {
|
|
|
595
595
|
};
|
|
596
596
|
if (additionalFields.currency)
|
|
597
597
|
body.currency = additionalFields.currency;
|
|
598
|
+
if (additionalFields.exchange_rate)
|
|
599
|
+
body.exchange_rate = additionalFields.exchange_rate;
|
|
598
600
|
if (additionalFields.periodicity)
|
|
599
601
|
body.periodicity = additionalFields.periodicity;
|
|
600
602
|
if (additionalFields.payment_form)
|
|
601
603
|
body.payment_form = additionalFields.payment_form;
|
|
604
|
+
if (additionalFields.idempotency_key)
|
|
605
|
+
body.idempotency_key = additionalFields.idempotency_key;
|
|
602
606
|
if (additionalFields.metadata) {
|
|
603
607
|
body.metadata = JSON.parse(additionalFields.metadata);
|
|
604
608
|
}
|
|
609
|
+
// Handle invoice_config
|
|
610
|
+
const invoiceConfig = this.getNodeParameter('invoiceConfig', i, {});
|
|
611
|
+
if (invoiceConfig && Object.keys(invoiceConfig).length > 0) {
|
|
612
|
+
const config = {};
|
|
613
|
+
if (invoiceConfig.serie)
|
|
614
|
+
config.serie = invoiceConfig.serie;
|
|
615
|
+
if (invoiceConfig.folio && invoiceConfig.folio !== 0)
|
|
616
|
+
config.folio = invoiceConfig.folio;
|
|
617
|
+
if (Object.keys(config).length > 0) {
|
|
618
|
+
body.invoice_config = config;
|
|
619
|
+
}
|
|
620
|
+
}
|
|
605
621
|
responseData = await GenericFunctions_1.gigstackApiRequest.call(this, 'POST', '/receipts', body, qs);
|
|
606
622
|
responseData = (0, GenericFunctions_1.simplifyResponse)(responseData);
|
|
607
623
|
}
|
|
@@ -140,6 +140,23 @@ exports.receiptFields = [
|
|
|
140
140
|
default: 'MXN',
|
|
141
141
|
description: 'Receipt currency',
|
|
142
142
|
},
|
|
143
|
+
{
|
|
144
|
+
displayName: 'Exchange Rate',
|
|
145
|
+
name: 'exchange_rate',
|
|
146
|
+
type: 'number',
|
|
147
|
+
default: 1,
|
|
148
|
+
typeOptions: {
|
|
149
|
+
numberPrecision: 4,
|
|
150
|
+
},
|
|
151
|
+
description: 'Exchange rate to MXN',
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
displayName: 'Idempotency Key',
|
|
155
|
+
name: 'idempotency_key',
|
|
156
|
+
type: 'string',
|
|
157
|
+
default: '',
|
|
158
|
+
description: 'Unique key to prevent duplicate receipts. If a receipt with this key already exists, the existing receipt will be returned.',
|
|
159
|
+
},
|
|
143
160
|
{
|
|
144
161
|
displayName: 'Periodicity',
|
|
145
162
|
name: 'periodicity',
|
|
@@ -147,9 +164,9 @@ exports.receiptFields = [
|
|
|
147
164
|
options: [
|
|
148
165
|
{ name: 'Day', value: 'day' },
|
|
149
166
|
{ name: 'Week', value: 'week' },
|
|
150
|
-
{ name: 'Two Weeks', value: '
|
|
167
|
+
{ name: 'Two Weeks', value: 'two_weeks' },
|
|
151
168
|
{ name: 'Month', value: 'month' },
|
|
152
|
-
{ name: 'Two Months', value: '
|
|
169
|
+
{ name: 'Two Months', value: 'two_months' },
|
|
153
170
|
],
|
|
154
171
|
default: 'month',
|
|
155
172
|
description: 'Validity period for stamping the receipt',
|
|
@@ -177,6 +194,36 @@ exports.receiptFields = [
|
|
|
177
194
|
},
|
|
178
195
|
],
|
|
179
196
|
},
|
|
197
|
+
{
|
|
198
|
+
displayName: 'Invoice Config',
|
|
199
|
+
name: 'invoiceConfig',
|
|
200
|
+
type: 'collection',
|
|
201
|
+
placeholder: 'Add Invoice Config',
|
|
202
|
+
default: {},
|
|
203
|
+
displayOptions: {
|
|
204
|
+
show: {
|
|
205
|
+
resource: ['receipt'],
|
|
206
|
+
operation: ['create'],
|
|
207
|
+
},
|
|
208
|
+
},
|
|
209
|
+
description: 'Configure invoice serie and folio for future stamping',
|
|
210
|
+
options: [
|
|
211
|
+
{
|
|
212
|
+
displayName: 'Serie',
|
|
213
|
+
name: 'serie',
|
|
214
|
+
type: 'string',
|
|
215
|
+
default: '',
|
|
216
|
+
description: 'Invoice serie (e.g., "A", "B"). Leave empty for default.',
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
displayName: 'Folio',
|
|
220
|
+
name: 'folio',
|
|
221
|
+
type: 'number',
|
|
222
|
+
default: 0,
|
|
223
|
+
description: 'Invoice folio number. Leave 0 for automatic increment.',
|
|
224
|
+
},
|
|
225
|
+
],
|
|
226
|
+
},
|
|
180
227
|
// ----------------------------------
|
|
181
228
|
// receipt: get, cancel, stamp
|
|
182
229
|
// ----------------------------------
|
|
@@ -368,6 +415,40 @@ exports.receiptFields = [
|
|
|
368
415
|
default: '',
|
|
369
416
|
description: 'Filter receipts created before this date',
|
|
370
417
|
},
|
|
418
|
+
{
|
|
419
|
+
displayName: 'Metadata Filters',
|
|
420
|
+
name: 'metadataFilters',
|
|
421
|
+
type: 'fixedCollection',
|
|
422
|
+
typeOptions: {
|
|
423
|
+
multipleValues: true,
|
|
424
|
+
},
|
|
425
|
+
default: {},
|
|
426
|
+
description: 'Filter by metadata fields using key-value pairs',
|
|
427
|
+
options: [
|
|
428
|
+
{
|
|
429
|
+
name: 'filters',
|
|
430
|
+
displayName: 'Metadata Filter',
|
|
431
|
+
values: [
|
|
432
|
+
{
|
|
433
|
+
displayName: 'Key',
|
|
434
|
+
name: 'key',
|
|
435
|
+
type: 'string',
|
|
436
|
+
default: '',
|
|
437
|
+
placeholder: 'e.g., order_id',
|
|
438
|
+
description: 'The metadata field key to filter on',
|
|
439
|
+
},
|
|
440
|
+
{
|
|
441
|
+
displayName: 'Value',
|
|
442
|
+
name: 'value',
|
|
443
|
+
type: 'string',
|
|
444
|
+
default: '',
|
|
445
|
+
placeholder: 'e.g., ORD-123',
|
|
446
|
+
description: 'The value to match',
|
|
447
|
+
},
|
|
448
|
+
],
|
|
449
|
+
},
|
|
450
|
+
],
|
|
451
|
+
},
|
|
371
452
|
],
|
|
372
453
|
},
|
|
373
454
|
// ----------------------------------
|
package/package.json
CHANGED