@custom-js/n8n-nodes-pdf-toolkit 1.35.0 → 1.36.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.
|
@@ -172,7 +172,7 @@ class InvoiceGenerator {
|
|
|
172
172
|
displayName: 'Items JSON',
|
|
173
173
|
name: 'itemsJson',
|
|
174
174
|
type: 'json',
|
|
175
|
-
default: '[]',
|
|
175
|
+
default: '[{"description":"Item 1","quantity":2,"unitPrice":50}]',
|
|
176
176
|
displayOptions: {
|
|
177
177
|
show: {
|
|
178
178
|
itemsMode: ['json'],
|
|
@@ -212,7 +212,6 @@ class InvoiceGenerator {
|
|
|
212
212
|
invoiceItems = itemsJson;
|
|
213
213
|
}
|
|
214
214
|
else {
|
|
215
|
-
// Handle cases where the field might be empty or have other non-array/non-string values
|
|
216
215
|
invoiceItems = [];
|
|
217
216
|
}
|
|
218
217
|
}
|
|
@@ -220,6 +219,13 @@ class InvoiceGenerator {
|
|
|
220
219
|
const itemsData = this.getNodeParameter('items', i);
|
|
221
220
|
invoiceItems = itemsData.itemsValues;
|
|
222
221
|
}
|
|
222
|
+
invoiceItems = invoiceItems.map(item => {
|
|
223
|
+
return {
|
|
224
|
+
description: item.description,
|
|
225
|
+
quantity: Number(item.quantity),
|
|
226
|
+
unitPrice: Number(item.unitPrice),
|
|
227
|
+
};
|
|
228
|
+
});
|
|
223
229
|
const invoiceData = {
|
|
224
230
|
issuer,
|
|
225
231
|
payment,
|