repzo-sap-absjo 1.0.19 → 1.0.20
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.
- package/lib/actions/create_invoice.d.ts +13 -19
- package/lib/actions/create_invoice.js +207 -377
- package/lib/actions/create_payment.d.ts +1 -4
- package/lib/actions/create_payment.js +107 -195
- package/lib/actions/create_proforma.d.ts +1 -4
- package/lib/actions/create_proforma.js +146 -285
- package/lib/actions/create_return_invoice.d.ts +1 -4
- package/lib/actions/create_return_invoice.js +158 -312
- package/lib/actions/create_transfer.d.ts +1 -4
- package/lib/actions/create_transfer.js +126 -223
- package/lib/actions/index.js +15 -23
- package/lib/commands/adjust_inventory.d.ts +2 -4
- package/lib/commands/adjust_inventory.js +160 -290
- package/lib/commands/bank.d.ts +2 -4
- package/lib/commands/bank.js +157 -279
- package/lib/commands/basic.js +48 -67
- package/lib/commands/brand.d.ts +1 -3
- package/lib/commands/brand.js +100 -174
- package/lib/commands/category.d.ts +1 -3
- package/lib/commands/category.js +104 -178
- package/lib/commands/channel.d.ts +1 -3
- package/lib/commands/channel.js +117 -198
- package/lib/commands/client.d.ts +32 -34
- package/lib/commands/client.js +244 -404
- package/lib/commands/client_disabled.d.ts +1 -3
- package/lib/commands/client_disabled.js +94 -163
- package/lib/commands/index.d.ts +11 -15
- package/lib/commands/index.js +62 -62
- package/lib/commands/join.js +66 -192
- package/lib/commands/measureunit.d.ts +14 -19
- package/lib/commands/measureunit.js +191 -289
- package/lib/commands/measureunit_family.d.ts +8 -10
- package/lib/commands/measureunit_family.js +138 -250
- package/lib/commands/payment_term.d.ts +1 -3
- package/lib/commands/payment_term.js +123 -202
- package/lib/commands/price_list.d.ts +15 -15
- package/lib/commands/price_list.js +326 -612
- package/lib/commands/product.d.ts +30 -32
- package/lib/commands/product.js +263 -485
- package/lib/commands/product_disabled.d.ts +1 -3
- package/lib/commands/product_disabled.js +94 -160
- package/lib/commands/rep.js +141 -221
- package/lib/commands/tag.js +109 -174
- package/lib/commands/tax.js +112 -177
- package/lib/commands/warehouse.d.ts +1 -3
- package/lib/commands/warehouse.js +119 -207
- package/lib/index.d.ts +12 -21
- package/lib/test/actions/create_invoice.js +188 -193
- package/lib/test/actions/create_payment.js +107 -112
- package/lib/test/actions/create_proforma.js +216 -220
- package/lib/test/actions/create_return_invoice.js +200 -205
- package/lib/test/actions/create_transfer.js +115 -120
- package/lib/test/commands/adjust_inventory.js +90 -90
- package/lib/test/commands/bank.js +90 -90
- package/lib/test/commands/basic.js +327 -328
- package/lib/test/commands/brand.js +90 -90
- package/lib/test/commands/category.js +90 -90
- package/lib/test/commands/channel.js +90 -90
- package/lib/test/commands/client.js +353 -355
- package/lib/test/commands/client_disabled.js +90 -90
- package/lib/test/commands/join.js +327 -328
- package/lib/test/commands/measureunit.js +90 -90
- package/lib/test/commands/measureunit_family.js +90 -90
- package/lib/test/commands/payment_term.js +90 -90
- package/lib/test/commands/price_list.js +334 -337
- package/lib/test/commands/product.js +90 -90
- package/lib/test/commands/product_disabled.js +90 -90
- package/lib/test/commands/rep.js +344 -346
- package/lib/test/commands/tag.js +90 -90
- package/lib/test/commands/tax.js +90 -90
- package/lib/test/commands/warehouse.js +90 -90
- package/lib/types.d.ts +53 -77
- package/lib/util.d.ts +19 -70
- package/lib/util.js +144 -170
- package/package.json +1 -1
- package/src/actions/create_invoice.ts +5 -25
|
@@ -55,16 +55,13 @@ export const create_invoice = async (event: EVENT, options: Config) => {
|
|
|
55
55
|
const actionLog = new Repzo.ActionLogs(repzo, action_sync_id);
|
|
56
56
|
let body: Service.FullInvoice.InvoiceSchema | any;
|
|
57
57
|
try {
|
|
58
|
-
console.log("create_invoice");
|
|
59
|
-
|
|
58
|
+
// console.log("create_invoice");
|
|
60
59
|
await actionLog.load(action_sync_id);
|
|
61
60
|
|
|
62
61
|
body = event.body;
|
|
63
62
|
try {
|
|
64
63
|
if (body) body = JSON.parse(body);
|
|
65
|
-
} catch (e) {
|
|
66
|
-
console.error("Error parsing event body:", e); // Debug log added
|
|
67
|
-
}
|
|
64
|
+
} catch (e) {}
|
|
68
65
|
|
|
69
66
|
const repzo_serial_number = body?.serial_number?.formatted;
|
|
70
67
|
try {
|
|
@@ -76,7 +73,7 @@ export const create_invoice = async (event: EVENT, options: Config) => {
|
|
|
76
73
|
{ _id: body._id, type: "fullinvoices" }
|
|
77
74
|
);
|
|
78
75
|
} catch (e) {
|
|
79
|
-
console.error(
|
|
76
|
+
console.error(e);
|
|
80
77
|
}
|
|
81
78
|
|
|
82
79
|
await actionLog
|
|
@@ -283,7 +280,7 @@ export const create_invoice = async (event: EVENT, options: Config) => {
|
|
|
283
280
|
|
|
284
281
|
const result = await _create(SAP_HOST_URL, "/AddInvoice", sap_invoice);
|
|
285
282
|
|
|
286
|
-
console.log(
|
|
283
|
+
// console.log(result);
|
|
287
284
|
|
|
288
285
|
try {
|
|
289
286
|
await repzo.updateIntegrationMeta.create(
|
|
@@ -291,7 +288,7 @@ export const create_invoice = async (event: EVENT, options: Config) => {
|
|
|
291
288
|
{ _id: body._id, type: "fullinvoices" }
|
|
292
289
|
);
|
|
293
290
|
} catch (e) {
|
|
294
|
-
console.error(
|
|
291
|
+
console.error(e);
|
|
295
292
|
}
|
|
296
293
|
|
|
297
294
|
await actionLog
|
|
@@ -314,10 +311,6 @@ export const get_invoice_from_sap = async (
|
|
|
314
311
|
query?: { updatedAt: string; Status: string; InvoiceId: string }
|
|
315
312
|
): Promise<SAPOpenInvoice[]> => {
|
|
316
313
|
try {
|
|
317
|
-
console.log("Inside get_invoice_from_sap function"); // Debug log
|
|
318
|
-
console.log("Service End Point:", serviceEndPoint); // Debug log
|
|
319
|
-
console.log("Query:", query); // Debug log
|
|
320
|
-
|
|
321
314
|
const sap_openInvoices: SAPOpenInvoices = await _create(
|
|
322
315
|
serviceEndPoint,
|
|
323
316
|
"/OpenInvoices",
|
|
@@ -327,12 +320,8 @@ export const get_invoice_from_sap = async (
|
|
|
327
320
|
InvoiceId: query?.InvoiceId,
|
|
328
321
|
}
|
|
329
322
|
);
|
|
330
|
-
|
|
331
|
-
console.log("SAP Open Invoices:", sap_openInvoices); // Debug log
|
|
332
|
-
|
|
333
323
|
return sap_openInvoices?.OpenInvoices;
|
|
334
324
|
} catch (e: any) {
|
|
335
|
-
console.error("Error in get_invoice_from_sap:", e); // Debug log
|
|
336
325
|
throw e;
|
|
337
326
|
}
|
|
338
327
|
};
|
|
@@ -348,17 +337,8 @@ function getUniqueConcatenatedValues(
|
|
|
348
337
|
...item.general_promotions,
|
|
349
338
|
...item.used_promotions,
|
|
350
339
|
];
|
|
351
|
-
|
|
352
|
-
console.log("Inside getUniqueConcatenatedValues function"); // Debug log
|
|
353
|
-
console.log("Item:", item); // Debug log
|
|
354
|
-
console.log("Key:", key); // Debug log
|
|
355
|
-
console.log("Delimiter:", delimiter); // Debug log
|
|
356
|
-
|
|
357
340
|
const uniqueValues = new Set(
|
|
358
341
|
allPromotions.map((promotion) => promotion[key]).filter((value) => value)
|
|
359
342
|
);
|
|
360
|
-
|
|
361
|
-
console.log("Unique Values:", uniqueValues); // Debug log
|
|
362
|
-
|
|
363
343
|
return [...uniqueValues].join(delimiter);
|
|
364
344
|
}
|