repzo-sap-absjo 1.0.10 → 1.0.12

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.
Files changed (79) hide show
  1. package/changelog.md +2 -0
  2. package/lib/actions/create_invoice.d.ts +19 -13
  3. package/lib/actions/create_invoice.js +356 -208
  4. package/lib/actions/create_payment.d.ts +4 -1
  5. package/lib/actions/create_payment.js +191 -117
  6. package/lib/actions/create_proforma.d.ts +4 -1
  7. package/lib/actions/create_proforma.js +285 -155
  8. package/lib/actions/create_return_invoice.d.ts +4 -1
  9. package/lib/actions/create_return_invoice.js +312 -169
  10. package/lib/actions/create_transfer.d.ts +4 -1
  11. package/lib/actions/create_transfer.js +223 -136
  12. package/lib/actions/index.js +23 -15
  13. package/lib/commands/adjust_inventory.d.ts +4 -2
  14. package/lib/commands/adjust_inventory.js +290 -160
  15. package/lib/commands/bank.d.ts +4 -2
  16. package/lib/commands/bank.js +279 -157
  17. package/lib/commands/basic.js +66 -47
  18. package/lib/commands/category.d.ts +3 -1
  19. package/lib/commands/category.js +178 -104
  20. package/lib/commands/channel.d.ts +3 -1
  21. package/lib/commands/channel.js +198 -117
  22. package/lib/commands/client.d.ts +34 -32
  23. package/lib/commands/client.js +404 -244
  24. package/lib/commands/client_disabled.d.ts +3 -1
  25. package/lib/commands/client_disabled.js +163 -94
  26. package/lib/commands/index.d.ts +15 -11
  27. package/lib/commands/index.js +60 -60
  28. package/lib/commands/join.js +192 -66
  29. package/lib/commands/measureunit.d.ts +19 -14
  30. package/lib/commands/measureunit.js +289 -191
  31. package/lib/commands/measureunit_family.d.ts +10 -8
  32. package/lib/commands/measureunit_family.js +250 -138
  33. package/lib/commands/payment_term.d.ts +3 -1
  34. package/lib/commands/payment_term.js +202 -123
  35. package/lib/commands/price_list.d.ts +15 -15
  36. package/lib/commands/price_list.js +612 -326
  37. package/lib/commands/product.d.ts +32 -30
  38. package/lib/commands/product.js +426 -243
  39. package/lib/commands/product_disabled.d.ts +3 -1
  40. package/lib/commands/product_disabled.js +164 -94
  41. package/lib/commands/rep.js +221 -141
  42. package/lib/commands/tag.js +174 -109
  43. package/lib/commands/tax.js +177 -112
  44. package/lib/commands/warehouse.d.ts +3 -1
  45. package/lib/commands/warehouse.js +207 -119
  46. package/lib/index.d.ts +21 -12
  47. package/lib/test/actions/create_invoice.js +193 -188
  48. package/lib/test/actions/create_payment.js +112 -107
  49. package/lib/test/actions/create_proforma.js +220 -216
  50. package/lib/test/actions/create_return_invoice.js +205 -200
  51. package/lib/test/actions/create_transfer.js +120 -115
  52. package/lib/test/commands/adjust_inventory.js +90 -90
  53. package/lib/test/commands/bank.js +90 -90
  54. package/lib/test/commands/basic.js +328 -327
  55. package/lib/test/commands/category.js +90 -90
  56. package/lib/test/commands/channel.js +90 -90
  57. package/lib/test/commands/client.js +355 -353
  58. package/lib/test/commands/client_disabled.js +90 -90
  59. package/lib/test/commands/join.js +328 -327
  60. package/lib/test/commands/measureunit.js +90 -90
  61. package/lib/test/commands/measureunit_family.js +90 -90
  62. package/lib/test/commands/payment_term.js +90 -90
  63. package/lib/test/commands/price_list.js +337 -334
  64. package/lib/test/commands/product.js +90 -90
  65. package/lib/test/commands/product_disabled.js +90 -90
  66. package/lib/test/commands/rep.js +346 -344
  67. package/lib/test/commands/tag.js +90 -90
  68. package/lib/test/commands/tax.js +90 -90
  69. package/lib/test/commands/warehouse.js +90 -90
  70. package/lib/types.d.ts +83 -60
  71. package/lib/util.d.ts +70 -19
  72. package/lib/util.js +170 -144
  73. package/package.json +2 -2
  74. package/src/actions/create_invoice.ts +11 -16
  75. package/src/actions/create_payment.ts +11 -16
  76. package/src/actions/create_proforma.ts +19 -24
  77. package/src/actions/create_return_invoice.ts +11 -16
  78. package/src/actions/create_transfer.ts +23 -28
  79. package/src/commands/product.ts +1 -0
@@ -3,164 +3,294 @@ import { _create } from "../util.js";
3
3
  import { v4 as uuid } from "uuid";
4
4
  import moment from "moment-timezone";
5
5
  export const create_proforma = async (event, options) => {
6
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
7
- const repzo = new Repzo((_a = options.data) === null || _a === void 0 ? void 0 : _a.repzoApiKey, { env: options.env });
8
- const action_sync_id = ((_b = event === null || event === void 0 ? void 0 : event.headers) === null || _b === void 0 ? void 0 : _b.action_sync_id) || uuid();
9
- const actionLog = new Repzo.ActionLogs(repzo, action_sync_id);
10
- let body;
6
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
7
+ const repzo = new Repzo(
8
+ (_a = options.data) === null || _a === void 0 ? void 0 : _a.repzoApiKey,
9
+ { env: options.env }
10
+ );
11
+ const action_sync_id =
12
+ ((_b = event === null || event === void 0 ? void 0 : event.headers) ===
13
+ null || _b === void 0
14
+ ? void 0
15
+ : _b.action_sync_id) || uuid();
16
+ const actionLog = new Repzo.ActionLogs(repzo, action_sync_id);
17
+ let body;
18
+ try {
19
+ // console.log("create_proforma");
20
+ await actionLog.load(action_sync_id);
21
+ body = event.body;
11
22
  try {
12
- // console.log("create_proforma");
13
- await actionLog.load(action_sync_id);
14
- body = event.body;
15
- try {
16
- if (body)
17
- body = JSON.parse(body);
18
- }
19
- catch (e) { }
20
- const repzo_serial_number = (_c = body === null || body === void 0 ? void 0 : body.serial_number) === null || _c === void 0 ? void 0 : _c.formatted;
21
- // try {
22
- // if (body?._id) {
23
- // body.integration_meta = body?.integration_meta || {};
24
- // body.integration_meta.sync_to_sap_started = true;
25
- // body.integration_meta.sync_to_sap_succeeded =
26
- // body.integration_meta.sync_to_sap_succeeded || false;
27
- // await repzo.proforma.update(body._id, {
28
- // integration_meta: body.integration_meta,
29
- // });
30
- // }
31
- // } catch (e) {
32
- // console.error(e);
33
- // }
34
- await actionLog
35
- .addDetail(`SalesOrder - ${repzo_serial_number} => ${body === null || body === void 0 ? void 0 : body.sync_id}`)
36
- .addDetail(`Repzo => SAP: Started Create SalesOrder - ${repzo_serial_number}`)
37
- .commit();
38
- const SAP_HOST_URL = (_d = options.data) === null || _d === void 0 ? void 0 : _d.sapHostUrl;
39
- if (!SAP_HOST_URL)
40
- throw `SAP Host Url is missing and Required: ${SAP_HOST_URL}`;
41
- const repzo_proforma = body;
42
- // Get Repzo Rep
43
- let repzo_rep;
44
- if (repzo_proforma.creator.type == "rep") {
45
- repzo_rep = await repzo.rep.get((_e = repzo_proforma === null || repzo_proforma === void 0 ? void 0 : repzo_proforma.creator) === null || _e === void 0 ? void 0 : _e._id);
46
- if (!repzo_rep)
47
- throw `Rep with _id: ${repzo_proforma.creator._id} not found in Repzo`;
48
- }
49
- // Get Repzo Client
50
- const repzo_client = await repzo.client.get(repzo_proforma === null || repzo_proforma === void 0 ? void 0 : repzo_proforma.client_id);
51
- if (!repzo_client)
52
- throw `Client with _id: ${repzo_proforma.client_id} not found in Repzo`;
53
- const repzo_tax_ids = {};
54
- const repzo_measureunit_ids = {};
55
- const repzo_product_ids = {};
56
- (_f = repzo_proforma.items) === null || _f === void 0 ? void 0 : _f.forEach((item) => {
57
- var _a, _b, _c;
58
- if (item) {
59
- repzo_tax_ids[(_a = item.tax) === null || _a === void 0 ? void 0 : _a._id] = true;
60
- repzo_measureunit_ids[(_b = item.measureunit) === null || _b === void 0 ? void 0 : _b._id] = true;
61
- repzo_product_ids[(_c = item.variant) === null || _c === void 0 ? void 0 : _c.product_id] = true;
62
- }
23
+ if (body) body = JSON.parse(body);
24
+ } catch (e) {}
25
+ const repzo_serial_number =
26
+ (_c = body === null || body === void 0 ? void 0 : body.serial_number) ===
27
+ null || _c === void 0
28
+ ? void 0
29
+ : _c.formatted;
30
+ try {
31
+ await repzo.updateIntegrationMeta.create(
32
+ [
33
+ { key: "sync_to_sap_started", value: true },
34
+ { key: "sync_to_sap_succeeded", value: false },
35
+ ],
36
+ { _id: body._id, type: "proformas" }
37
+ );
38
+ } catch (e) {
39
+ console.error(e);
40
+ }
41
+ await actionLog
42
+ .addDetail(
43
+ `SalesOrder - ${repzo_serial_number} => ${
44
+ body === null || body === void 0 ? void 0 : body.sync_id
45
+ }`
46
+ )
47
+ .addDetail(
48
+ `Repzo => SAP: Started Create SalesOrder - ${repzo_serial_number}`
49
+ )
50
+ .commit();
51
+ const SAP_HOST_URL =
52
+ (_d = options.data) === null || _d === void 0 ? void 0 : _d.sapHostUrl;
53
+ if (!SAP_HOST_URL)
54
+ throw `SAP Host Url is missing and Required: ${SAP_HOST_URL}`;
55
+ const repzo_proforma = body;
56
+ // Get Repzo Rep
57
+ let repzo_rep;
58
+ if (repzo_proforma.creator.type == "rep") {
59
+ repzo_rep = await repzo.rep.get(
60
+ (_e =
61
+ repzo_proforma === null || repzo_proforma === void 0
62
+ ? void 0
63
+ : repzo_proforma.creator) === null || _e === void 0
64
+ ? void 0
65
+ : _e._id
66
+ );
67
+ if (!repzo_rep)
68
+ throw `Rep with _id: ${repzo_proforma.creator._id} not found in Repzo`;
69
+ }
70
+ // Get Repzo Client
71
+ const repzo_client = await repzo.client.get(
72
+ repzo_proforma === null || repzo_proforma === void 0
73
+ ? void 0
74
+ : repzo_proforma.client_id
75
+ );
76
+ if (!repzo_client)
77
+ throw `Client with _id: ${repzo_proforma.client_id} not found in Repzo`;
78
+ const repzo_tax_ids = {};
79
+ const repzo_measureunit_ids = {};
80
+ const repzo_product_ids = {};
81
+ (_f = repzo_proforma.items) === null || _f === void 0
82
+ ? void 0
83
+ : _f.forEach((item) => {
84
+ var _a, _b, _c;
85
+ if (item) {
86
+ repzo_tax_ids[
87
+ (_a = item.tax) === null || _a === void 0 ? void 0 : _a._id
88
+ ] = true;
89
+ repzo_measureunit_ids[
90
+ (_b = item.measureunit) === null || _b === void 0
91
+ ? void 0
92
+ : _b._id
93
+ ] = true;
94
+ repzo_product_ids[
95
+ (_c = item.variant) === null || _c === void 0
96
+ ? void 0
97
+ : _c.product_id
98
+ ] = true;
99
+ }
63
100
  });
64
- const repzo_taxes = await repzo.patchAction.create({
65
- slug: "tax",
66
- readQuery: [
67
- {
68
- key: "_id",
69
- value: Object.keys(repzo_tax_ids),
70
- operator: "in",
71
- },
72
- ],
73
- }, { per_page: 50000 });
74
- const repzo_measureunits = await repzo.patchAction.create({
75
- slug: "measureunits",
76
- readQuery: [
77
- {
78
- key: "_id",
79
- value: Object.keys(repzo_measureunit_ids),
80
- operator: "in",
81
- },
82
- ],
83
- }, { per_page: 50000 });
84
- const repzo_products = await repzo.patchAction.create({
85
- slug: "product",
86
- readQuery: [
87
- {
88
- key: "_id",
89
- value: Object.keys(repzo_product_ids),
90
- operator: "in",
91
- },
92
- ],
93
- }, { per_page: 50000 });
94
- // Prepare SAP_invoice_items
95
- const items = [];
96
- for (let i = 0; i < ((_g = repzo_proforma === null || repzo_proforma === void 0 ? void 0 : repzo_proforma.items) === null || _g === void 0 ? void 0 : _g.length); i++) {
97
- const item = repzo_proforma.items[i];
98
- // Get Repzo Tax
99
- const repzo_tax = (_h = repzo_taxes === null || repzo_taxes === void 0 ? void 0 : repzo_taxes.data) === null || _h === void 0 ? void 0 : _h.find((t) => { var _a, _b, _c; return ((_a = t._id) === null || _a === void 0 ? void 0 : _a.toString()) == ((_c = (_b = item.tax) === null || _b === void 0 ? void 0 : _b._id) === null || _c === void 0 ? void 0 : _c.toString()); });
100
- if (!repzo_tax)
101
- throw `Tax with _id: ${item.tax._id} not found in Repzo`;
102
- // Get Repzo UoM
103
- const repzo_measureunit = (_j = repzo_measureunits === null || repzo_measureunits === void 0 ? void 0 : repzo_measureunits.data) === null || _j === void 0 ? void 0 : _j.find((m) => { var _a, _b, _c; return ((_a = m._id) === null || _a === void 0 ? void 0 : _a.toString()) == ((_c = (_b = item.measureunit) === null || _b === void 0 ? void 0 : _b._id) === null || _c === void 0 ? void 0 : _c.toString()); });
104
- if (!repzo_measureunit)
105
- throw `Uom with _id: ${(_k = item.measureunit) === null || _k === void 0 ? void 0 : _k._id} not found in Repzo`;
106
- // Get Repzo Product
107
- const repzo_product = (_l = repzo_products === null || repzo_products === void 0 ? void 0 : repzo_products.data) === null || _l === void 0 ? void 0 : _l.find((p) => { var _a, _b, _c; return ((_a = p._id) === null || _a === void 0 ? void 0 : _a.toString()) == ((_c = (_b = item.variant) === null || _b === void 0 ? void 0 : _b.product_id) === null || _c === void 0 ? void 0 : _c.toString()); });
108
- if (!repzo_product)
109
- throw `Product with _id: ${item.measureunit._id} not found in Repzo`;
110
- items.push({
111
- ItemCode: item.variant.variant_name,
112
- Quantity: item.qty,
113
- TaxCode: repzo_tax.integration_meta.TaxCode,
114
- UnitPrice: (item.price * repzo_measureunit.factor) / 1000,
115
- DiscountPerc: "0",
116
- //@ts-ignore
117
- LineTotal: item.total_before_tax / 1000,
118
- UomCode: repzo_measureunit.integration_meta.ALTUOMID,
119
- Brand: (_m = repzo_product.integration_meta) === null || _m === void 0 ? void 0 : _m.BRAND,
120
- Department: ((_o = repzo_rep === null || repzo_rep === void 0 ? void 0 : repzo_rep.integration_meta) === null || _o === void 0 ? void 0 : _o.DEPARTMENTCODE) ||
121
- ((_p = options.data) === null || _p === void 0 ? void 0 : _p.DepartmentCode), // "D2"
101
+ const repzo_taxes = await repzo.patchAction.create(
102
+ {
103
+ slug: "tax",
104
+ readQuery: [
105
+ {
106
+ key: "_id",
107
+ value: Object.keys(repzo_tax_ids),
108
+ operator: "in",
109
+ },
110
+ ],
111
+ },
112
+ { per_page: 50000 }
113
+ );
114
+ const repzo_measureunits = await repzo.patchAction.create(
115
+ {
116
+ slug: "measureunits",
117
+ readQuery: [
118
+ {
119
+ key: "_id",
120
+ value: Object.keys(repzo_measureunit_ids),
121
+ operator: "in",
122
+ },
123
+ ],
124
+ },
125
+ { per_page: 50000 }
126
+ );
127
+ const repzo_products = await repzo.patchAction.create(
128
+ {
129
+ slug: "product",
130
+ readQuery: [
131
+ {
132
+ key: "_id",
133
+ value: Object.keys(repzo_product_ids),
134
+ operator: "in",
135
+ },
136
+ ],
137
+ },
138
+ { per_page: 50000 }
139
+ );
140
+ // Prepare SAP_invoice_items
141
+ const items = [];
142
+ for (
143
+ let i = 0;
144
+ i <
145
+ ((_g =
146
+ repzo_proforma === null || repzo_proforma === void 0
147
+ ? void 0
148
+ : repzo_proforma.items) === null || _g === void 0
149
+ ? void 0
150
+ : _g.length);
151
+ i++
152
+ ) {
153
+ const item = repzo_proforma.items[i];
154
+ // Get Repzo Tax
155
+ const repzo_tax =
156
+ (_h =
157
+ repzo_taxes === null || repzo_taxes === void 0
158
+ ? void 0
159
+ : repzo_taxes.data) === null || _h === void 0
160
+ ? void 0
161
+ : _h.find((t) => {
162
+ var _a, _b, _c;
163
+ return (
164
+ ((_a = t._id) === null || _a === void 0
165
+ ? void 0
166
+ : _a.toString()) ==
167
+ ((_c =
168
+ (_b = item.tax) === null || _b === void 0
169
+ ? void 0
170
+ : _b._id) === null || _c === void 0
171
+ ? void 0
172
+ : _c.toString())
173
+ );
122
174
  });
123
- }
124
- const sap_invoice = {
125
- RefNum: repzo_proforma.serial_number.formatted,
126
- SalPersCode: repzo_rep
127
- ? repzo_rep.integration_id
128
- : (_q = options.data) === null || _q === void 0 ? void 0 : _q.SalPersCode,
129
- DocDate: moment(repzo_proforma.issue_date, "YYYY-MM-DD").format("YYYYMMDD"),
130
- DocDueDate: moment(repzo_proforma.issue_date, "YYYY-MM-DD").format("YYYYMMDD"),
131
- ClientCode: repzo_client.client_code,
132
- DiscountPerc: "0",
133
- Note: repzo_proforma.comment,
134
- // WarehouseCode: "1",
135
- LinesDetails: items,
136
- };
137
- // console.dir(sap_invoice, { depth: null });
138
- actionLog.addDetail(`Repzo => SAP: SalesOrder - ${repzo_serial_number}`, sap_invoice); // .commit();
139
- const result = await _create(SAP_HOST_URL, "/AddOrder", sap_invoice);
140
- // console.log(result);
141
- // try {
142
- // if (body?._id) {
143
- // body.integration_meta = body?.integration_meta || {};
144
- // body.integration_meta.sync_to_sap_succeeded = true;
145
- // await repzo.proforma.update(body._id, {
146
- // integration_meta: body.integration_meta,
147
- // });
148
- // }
149
- // } catch (e) {
150
- // console.error(e);
151
- // }
152
- await actionLog
153
- .addDetail(`SAP Responded with `, result)
154
- .addDetail(`Repzo => SAP: SalesOrder - ${repzo_serial_number}`)
155
- .setStatus("success")
156
- .setBody(repzo_proforma)
157
- .commit();
158
- return result;
159
- }
160
- catch (e) {
175
+ if (!repzo_tax) throw `Tax with _id: ${item.tax._id} not found in Repzo`;
176
+ // Get Repzo UoM
177
+ const repzo_measureunit =
178
+ (_j =
179
+ repzo_measureunits === null || repzo_measureunits === void 0
180
+ ? void 0
181
+ : repzo_measureunits.data) === null || _j === void 0
182
+ ? void 0
183
+ : _j.find((m) => {
184
+ var _a, _b, _c;
185
+ return (
186
+ ((_a = m._id) === null || _a === void 0
187
+ ? void 0
188
+ : _a.toString()) ==
189
+ ((_c =
190
+ (_b = item.measureunit) === null || _b === void 0
191
+ ? void 0
192
+ : _b._id) === null || _c === void 0
193
+ ? void 0
194
+ : _c.toString())
195
+ );
196
+ });
197
+ if (!repzo_measureunit)
198
+ throw `Uom with _id: ${
199
+ (_k = item.measureunit) === null || _k === void 0 ? void 0 : _k._id
200
+ } not found in Repzo`;
201
+ // Get Repzo Product
202
+ const repzo_product =
203
+ (_l =
204
+ repzo_products === null || repzo_products === void 0
205
+ ? void 0
206
+ : repzo_products.data) === null || _l === void 0
207
+ ? void 0
208
+ : _l.find((p) => {
209
+ var _a, _b, _c;
210
+ return (
211
+ ((_a = p._id) === null || _a === void 0
212
+ ? void 0
213
+ : _a.toString()) ==
214
+ ((_c =
215
+ (_b = item.variant) === null || _b === void 0
216
+ ? void 0
217
+ : _b.product_id) === null || _c === void 0
218
+ ? void 0
219
+ : _c.toString())
220
+ );
221
+ });
222
+ if (!repzo_product)
223
+ throw `Product with _id: ${item.measureunit._id} not found in Repzo`;
224
+ items.push({
225
+ ItemCode: item.variant.variant_name,
226
+ Quantity: item.qty,
227
+ TaxCode: repzo_tax.integration_meta.TaxCode,
228
+ UnitPrice: (item.price * repzo_measureunit.factor) / 1000,
229
+ DiscountPerc: "0",
161
230
  //@ts-ignore
162
- console.error((e === null || e === void 0 ? void 0 : e.response) || e);
163
- await actionLog.setStatus("fail", e).setBody(body).commit();
164
- throw e;
231
+ LineTotal: item.total_before_tax / 1000,
232
+ UomCode: repzo_measureunit.integration_meta.ALTUOMID,
233
+ Brand:
234
+ (_m = repzo_product.integration_meta) === null || _m === void 0
235
+ ? void 0
236
+ : _m.BRAND,
237
+ Department:
238
+ ((_o =
239
+ repzo_rep === null || repzo_rep === void 0
240
+ ? void 0
241
+ : repzo_rep.integration_meta) === null || _o === void 0
242
+ ? void 0
243
+ : _o.DEPARTMENTCODE) ||
244
+ ((_p = options.data) === null || _p === void 0
245
+ ? void 0
246
+ : _p.DepartmentCode), // "D2"
247
+ });
248
+ }
249
+ const sap_invoice = {
250
+ RefNum: repzo_proforma.serial_number.formatted,
251
+ SalPersCode: repzo_rep
252
+ ? repzo_rep.integration_id
253
+ : (_q = options.data) === null || _q === void 0
254
+ ? void 0
255
+ : _q.SalPersCode,
256
+ DocDate: moment(repzo_proforma.issue_date, "YYYY-MM-DD").format(
257
+ "YYYYMMDD"
258
+ ),
259
+ DocDueDate: moment(repzo_proforma.issue_date, "YYYY-MM-DD").format(
260
+ "YYYYMMDD"
261
+ ),
262
+ ClientCode: repzo_client.client_code,
263
+ DiscountPerc: "0",
264
+ Note: repzo_proforma.comment,
265
+ // WarehouseCode: "1",
266
+ LinesDetails: items,
267
+ };
268
+ // console.dir(sap_invoice, { depth: null });
269
+ actionLog.addDetail(
270
+ `Repzo => SAP: SalesOrder - ${repzo_serial_number}`,
271
+ sap_invoice
272
+ ); // .commit();
273
+ const result = await _create(SAP_HOST_URL, "/AddOrder", sap_invoice);
274
+ // console.log(result);
275
+ try {
276
+ await repzo.updateIntegrationMeta.create(
277
+ [{ key: "sync_to_sap_succeeded", value: true }],
278
+ { _id: body._id, type: "proformas" }
279
+ );
280
+ } catch (e) {
281
+ console.error(e);
165
282
  }
283
+ await actionLog
284
+ .addDetail(`SAP Responded with `, result)
285
+ .addDetail(`Repzo => SAP: SalesOrder - ${repzo_serial_number}`)
286
+ .setStatus("success")
287
+ .setBody(repzo_proforma)
288
+ .commit();
289
+ return result;
290
+ } catch (e) {
291
+ //@ts-ignore
292
+ console.error((e === null || e === void 0 ? void 0 : e.response) || e);
293
+ await actionLog.setStatus("fail", e).setBody(body).commit();
294
+ throw e;
295
+ }
166
296
  };
@@ -1,2 +1,5 @@
1
1
  import { EVENT, Config } from "../types";
2
- export declare const create_return_invoice: (event: EVENT, options: Config) => Promise<any>;
2
+ export declare const create_return_invoice: (
3
+ event: EVENT,
4
+ options: Config
5
+ ) => Promise<any>;