repzo-sap-absjo 1.0.39 → 1.0.41
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/changelog.md +12 -0
- package/lib/actions/create_invoice.js +59 -2
- package/lib/actions/create_proforma.js +42 -3
- package/lib/commands/channel.js +17 -12
- package/lib/commands/client.js +29 -24
- package/lib/commands/client_disabled.js +15 -10
- package/lib/commands/payment_term.js +17 -12
- package/lib/commands/price_list.js +65 -56
- package/lib/commands/product.js +63 -54
- package/lib/commands/product_disabled.js +13 -6
- package/lib/commands/rep.js +13 -5
- package/lib/commands/warehouse.js +25 -21
- package/lib/types.d.ts +1 -1
- package/package.json +2 -2
- package/src/actions/create_invoice.ts +24 -1
- package/src/actions/create_proforma.ts +14 -1
- package/src/commands/channel.ts +2 -2
- package/src/commands/client.ts +2 -2
- package/src/commands/client_disabled.ts +2 -2
- package/src/commands/payment_term.ts +2 -2
- package/src/commands/price_list.ts +2 -2
- package/src/commands/product.ts +2 -2
- package/src/commands/product_disabled.ts +2 -2
- package/src/commands/rep.ts +7 -1
- package/src/commands/warehouse.ts +2 -2
- package/src/types.ts +1 -1
package/changelog.md
CHANGED
|
@@ -4,6 +4,18 @@
|
|
|
4
4
|
|
|
5
5
|
### Added
|
|
6
6
|
|
|
7
|
+
- [RDT-3412/RDT-3415] Update invoice processing to send as sales order to SAP when setting enabled @maramalshen
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
|
|
11
|
+
### Fixed
|
|
12
|
+
|
|
13
|
+
### Removed
|
|
14
|
+
|
|
15
|
+
## [v1.0.41 (2025-09-01)](https://github.com/Repzo/repzo-sap-absjo.git)
|
|
16
|
+
|
|
17
|
+
### Added
|
|
18
|
+
|
|
7
19
|
- [util] in method: getUniqueConcatenatedValues, also add the promotions for items.buy @maramalshen
|
|
8
20
|
- [actions/***] add 2 keys in integration_meta: sync_to_sap_started & sync_to_sap_succeeded @maramalshen
|
|
9
21
|
- [commands/product] assign Foreign Name (ITEMDESCF) in SAP to local_name in Repzo @maramalshen
|
|
@@ -3,7 +3,25 @@ import { _create, getUniqueConcatenatedValues } from "../util.js";
|
|
|
3
3
|
import { v4 as uuid } from "uuid";
|
|
4
4
|
import moment from "moment-timezone";
|
|
5
5
|
export const create_invoice = async (event, options) => {
|
|
6
|
-
var _a,
|
|
6
|
+
var _a,
|
|
7
|
+
_b,
|
|
8
|
+
_c,
|
|
9
|
+
_d,
|
|
10
|
+
_e,
|
|
11
|
+
_f,
|
|
12
|
+
_g,
|
|
13
|
+
_h,
|
|
14
|
+
_j,
|
|
15
|
+
_k,
|
|
16
|
+
_l,
|
|
17
|
+
_m,
|
|
18
|
+
_o,
|
|
19
|
+
_p,
|
|
20
|
+
_q,
|
|
21
|
+
_r,
|
|
22
|
+
_s,
|
|
23
|
+
_t,
|
|
24
|
+
_u;
|
|
7
25
|
const repzo = new Repzo(
|
|
8
26
|
(_a = options.data) === null || _a === void 0 ? void 0 : _a.repzoApiKey,
|
|
9
27
|
{ env: options.env }
|
|
@@ -363,7 +381,46 @@ export const create_invoice = async (event, options) => {
|
|
|
363
381
|
`Repzo => SAP: Invoice - ${repzo_serial_number}`,
|
|
364
382
|
sap_invoice
|
|
365
383
|
);
|
|
366
|
-
|
|
384
|
+
let treating_invoice_as_proforma_for_etax = false;
|
|
385
|
+
if (
|
|
386
|
+
((_r = body === null || body === void 0 ? void 0 : body.creator) ===
|
|
387
|
+
null || _r === void 0
|
|
388
|
+
? void 0
|
|
389
|
+
: _r.type) == "rep" &&
|
|
390
|
+
((_s =
|
|
391
|
+
repzo_rep === null || repzo_rep === void 0
|
|
392
|
+
? void 0
|
|
393
|
+
: repzo_rep.settings) === null || _s === void 0
|
|
394
|
+
? void 0
|
|
395
|
+
: _s.treating_invoice_as_proforma_for_etax)
|
|
396
|
+
) {
|
|
397
|
+
const company = await repzo.safeCrud.create({
|
|
398
|
+
collection: "company",
|
|
399
|
+
filters: { name_space: repzo_invoice.company_namespace },
|
|
400
|
+
});
|
|
401
|
+
if (
|
|
402
|
+
(_u =
|
|
403
|
+
(_t =
|
|
404
|
+
company === null || company === void 0 ? void 0 : company.data) ===
|
|
405
|
+
null || _t === void 0
|
|
406
|
+
? void 0
|
|
407
|
+
: _t[0]) === null || _u === void 0
|
|
408
|
+
? void 0
|
|
409
|
+
: _u.allow_treating_invoice_as_proforma_for_etax
|
|
410
|
+
) {
|
|
411
|
+
treating_invoice_as_proforma_for_etax = true;
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
let result;
|
|
415
|
+
if (treating_invoice_as_proforma_for_etax) {
|
|
416
|
+
actionLog.addDetail(
|
|
417
|
+
`Repzo => SAP: Invoice - ${repzo_serial_number} - Treat Invoice as SalesOrder for eTax`,
|
|
418
|
+
sap_invoice
|
|
419
|
+
);
|
|
420
|
+
result = await _create(SAP_HOST_URL, "/AddOrder", sap_invoice);
|
|
421
|
+
} else {
|
|
422
|
+
result = await _create(SAP_HOST_URL, "/AddInvoice", sap_invoice);
|
|
423
|
+
}
|
|
367
424
|
// console.log(result);
|
|
368
425
|
try {
|
|
369
426
|
await repzo.updateIntegrationMeta.create(
|
|
@@ -1,9 +1,29 @@
|
|
|
1
1
|
import Repzo from "repzo";
|
|
2
|
-
import { _create, getUniqueConcatenatedValues } from "../util.js";
|
|
2
|
+
import { _create, getUniqueConcatenatedValues, set_error } 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,
|
|
6
|
+
var _a,
|
|
7
|
+
_b,
|
|
8
|
+
_c,
|
|
9
|
+
_d,
|
|
10
|
+
_e,
|
|
11
|
+
_f,
|
|
12
|
+
_g,
|
|
13
|
+
_h,
|
|
14
|
+
_j,
|
|
15
|
+
_k,
|
|
16
|
+
_l,
|
|
17
|
+
_m,
|
|
18
|
+
_o,
|
|
19
|
+
_p,
|
|
20
|
+
_q,
|
|
21
|
+
_r,
|
|
22
|
+
_s,
|
|
23
|
+
_t,
|
|
24
|
+
_u,
|
|
25
|
+
_v,
|
|
26
|
+
_w;
|
|
7
27
|
const repzo = new Repzo(
|
|
8
28
|
(_a = options.data) === null || _a === void 0 ? void 0 : _a.repzoApiKey,
|
|
9
29
|
{ env: options.env }
|
|
@@ -318,7 +338,26 @@ export const create_proforma = async (event, options) => {
|
|
|
318
338
|
`Repzo => SAP: SalesOrder - ${repzo_serial_number}`,
|
|
319
339
|
sap_invoice
|
|
320
340
|
); // .commit();
|
|
321
|
-
|
|
341
|
+
let result;
|
|
342
|
+
try {
|
|
343
|
+
result = await _create(SAP_HOST_URL, "/AddOrder", sap_invoice);
|
|
344
|
+
} catch (e) {
|
|
345
|
+
if (
|
|
346
|
+
typeof ((_u = set_error(e)) === null || _u === void 0
|
|
347
|
+
? void 0
|
|
348
|
+
: _u.message) === "string" &&
|
|
349
|
+
((_w =
|
|
350
|
+
(_v = set_error(e)) === null || _v === void 0
|
|
351
|
+
? void 0
|
|
352
|
+
: _v.message) === null || _w === void 0
|
|
353
|
+
? void 0
|
|
354
|
+
: _w.includes("this Sales Order is allready existed"))
|
|
355
|
+
) {
|
|
356
|
+
result = { success: true, message: "Sales Order already exists" };
|
|
357
|
+
} else {
|
|
358
|
+
throw e;
|
|
359
|
+
}
|
|
360
|
+
}
|
|
322
361
|
// console.log(result);
|
|
323
362
|
try {
|
|
324
363
|
await repzo.updateIntegrationMeta.create(
|
package/lib/commands/channel.js
CHANGED
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
set_error,
|
|
7
7
|
} from "../util.js";
|
|
8
8
|
export const sync_channel = async (commandEvent) => {
|
|
9
|
-
var _a, _b, _c, _d;
|
|
9
|
+
var _a, _b, _c, _d, _e, _f;
|
|
10
10
|
const repzo = new Repzo(
|
|
11
11
|
(_a = commandEvent.app.formData) === null || _a === void 0
|
|
12
12
|
? void 0
|
|
@@ -40,7 +40,10 @@ export const sync_channel = async (commandEvent) => {
|
|
|
40
40
|
const sap_clients = await get_sap_clients(
|
|
41
41
|
commandEvent.app.formData.sapHostUrl,
|
|
42
42
|
{
|
|
43
|
-
updateAt:
|
|
43
|
+
updateAt:
|
|
44
|
+
(_b = commandEvent.app.options_formData) === null || _b === void 0
|
|
45
|
+
? void 0
|
|
46
|
+
: _b[bench_time_key],
|
|
44
47
|
GroupCode: commandEvent.app.formData.GroupCode,
|
|
45
48
|
}
|
|
46
49
|
);
|
|
@@ -59,27 +62,29 @@ export const sync_channel = async (commandEvent) => {
|
|
|
59
62
|
await commandLog
|
|
60
63
|
.addDetail(
|
|
61
64
|
`${result.sap_total} Client Channels in SAP changed since ${
|
|
62
|
-
commandEvent.app.options_formData
|
|
65
|
+
((_c = commandEvent.app.options_formData) === null || _c === void 0
|
|
66
|
+
? void 0
|
|
67
|
+
: _c[bench_time_key]) || "ever"
|
|
63
68
|
}`
|
|
64
69
|
)
|
|
65
70
|
.commit();
|
|
66
71
|
const repzo_channels = await repzo.channel.find({ per_page: 50000 });
|
|
67
72
|
result.repzo_total =
|
|
68
|
-
(
|
|
73
|
+
(_d =
|
|
69
74
|
repzo_channels === null || repzo_channels === void 0
|
|
70
75
|
? void 0
|
|
71
|
-
: repzo_channels.data) === null ||
|
|
76
|
+
: repzo_channels.data) === null || _d === void 0
|
|
72
77
|
? void 0
|
|
73
|
-
:
|
|
78
|
+
: _d.length;
|
|
74
79
|
await commandLog
|
|
75
80
|
.addDetail(
|
|
76
81
|
`${
|
|
77
|
-
(
|
|
82
|
+
(_e =
|
|
78
83
|
repzo_channels === null || repzo_channels === void 0
|
|
79
84
|
? void 0
|
|
80
|
-
: repzo_channels.data) === null ||
|
|
85
|
+
: repzo_channels.data) === null || _e === void 0
|
|
81
86
|
? void 0
|
|
82
|
-
:
|
|
87
|
+
: _e.length
|
|
83
88
|
} Client Channels in Repzo`
|
|
84
89
|
)
|
|
85
90
|
.commit();
|
|
@@ -178,10 +183,10 @@ export const sync_channel = async (commandEvent) => {
|
|
|
178
183
|
} catch (e) {
|
|
179
184
|
//@ts-ignore
|
|
180
185
|
console.error(
|
|
181
|
-
((
|
|
182
|
-
|
|
186
|
+
((_f = e === null || e === void 0 ? void 0 : e.response) === null ||
|
|
187
|
+
_f === void 0
|
|
183
188
|
? void 0
|
|
184
|
-
:
|
|
189
|
+
: _f.data) || e
|
|
185
190
|
);
|
|
186
191
|
await commandLog.setStatus("fail", e).commit();
|
|
187
192
|
throw e;
|
package/lib/commands/client.js
CHANGED
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
set_error,
|
|
7
7
|
} from "../util.js";
|
|
8
8
|
export const sync_client = async (commandEvent) => {
|
|
9
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
9
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
10
10
|
const repzo = new Repzo(
|
|
11
11
|
(_a = commandEvent.app.formData) === null || _a === void 0
|
|
12
12
|
? void 0
|
|
@@ -39,7 +39,10 @@ export const sync_client = async (commandEvent) => {
|
|
|
39
39
|
const sap_clients = await get_sap_clients(
|
|
40
40
|
commandEvent.app.formData.sapHostUrl,
|
|
41
41
|
{
|
|
42
|
-
updateAt:
|
|
42
|
+
updateAt:
|
|
43
|
+
(_b = commandEvent.app.options_formData) === null || _b === void 0
|
|
44
|
+
? void 0
|
|
45
|
+
: _b[bench_time_key],
|
|
43
46
|
GroupCode: commandEvent.app.formData.GroupCode,
|
|
44
47
|
}
|
|
45
48
|
);
|
|
@@ -50,7 +53,9 @@ export const sync_client = async (commandEvent) => {
|
|
|
50
53
|
await commandLog
|
|
51
54
|
.addDetail(
|
|
52
55
|
`${result.sap_total} Customers in SAP changed since ${
|
|
53
|
-
commandEvent.app.options_formData
|
|
56
|
+
((_c = commandEvent.app.options_formData) === null || _c === void 0
|
|
57
|
+
? void 0
|
|
58
|
+
: _c[bench_time_key]) || "ever"
|
|
54
59
|
}`
|
|
55
60
|
)
|
|
56
61
|
.commit();
|
|
@@ -89,21 +94,21 @@ export const sync_client = async (commandEvent) => {
|
|
|
89
94
|
project: ["_id", "integration_meta"],
|
|
90
95
|
});
|
|
91
96
|
result.repzo_total =
|
|
92
|
-
(
|
|
97
|
+
(_d =
|
|
93
98
|
repzo_clients === null || repzo_clients === void 0
|
|
94
99
|
? void 0
|
|
95
|
-
: repzo_clients.data) === null ||
|
|
100
|
+
: repzo_clients.data) === null || _d === void 0
|
|
96
101
|
? void 0
|
|
97
|
-
:
|
|
102
|
+
: _d.length;
|
|
98
103
|
await commandLog
|
|
99
104
|
.addDetail(
|
|
100
105
|
`${
|
|
101
|
-
(
|
|
106
|
+
(_e =
|
|
102
107
|
repzo_clients === null || repzo_clients === void 0
|
|
103
108
|
? void 0
|
|
104
|
-
: repzo_clients.data) === null ||
|
|
109
|
+
: repzo_clients.data) === null || _e === void 0
|
|
105
110
|
? void 0
|
|
106
|
-
:
|
|
111
|
+
: _e.length
|
|
107
112
|
} Clients in Repzo`
|
|
108
113
|
)
|
|
109
114
|
.commit();
|
|
@@ -125,12 +130,12 @@ export const sync_client = async (commandEvent) => {
|
|
|
125
130
|
);
|
|
126
131
|
});
|
|
127
132
|
const tag =
|
|
128
|
-
(
|
|
133
|
+
(_f =
|
|
129
134
|
repzo_tags === null || repzo_tags === void 0
|
|
130
135
|
? void 0
|
|
131
|
-
: repzo_tags.data) === null ||
|
|
136
|
+
: repzo_tags.data) === null || _f === void 0
|
|
132
137
|
? void 0
|
|
133
|
-
:
|
|
138
|
+
: _f.find((tag) => {
|
|
134
139
|
var _a;
|
|
135
140
|
return (
|
|
136
141
|
((_a = tag.integration_meta) === null || _a === void 0
|
|
@@ -139,12 +144,12 @@ export const sync_client = async (commandEvent) => {
|
|
|
139
144
|
);
|
|
140
145
|
});
|
|
141
146
|
const channel =
|
|
142
|
-
(
|
|
147
|
+
(_g =
|
|
143
148
|
repzo_channels === null || repzo_channels === void 0
|
|
144
149
|
? void 0
|
|
145
|
-
: repzo_channels.data) === null ||
|
|
150
|
+
: repzo_channels.data) === null || _g === void 0
|
|
146
151
|
? void 0
|
|
147
|
-
:
|
|
152
|
+
: _g.find((channel) => {
|
|
148
153
|
var _a;
|
|
149
154
|
return (
|
|
150
155
|
((_a = channel.integration_meta) === null || _a === void 0
|
|
@@ -153,12 +158,12 @@ export const sync_client = async (commandEvent) => {
|
|
|
153
158
|
);
|
|
154
159
|
});
|
|
155
160
|
const paymentTerm =
|
|
156
|
-
(
|
|
161
|
+
(_h =
|
|
157
162
|
repzo_payment_terms === null || repzo_payment_terms === void 0
|
|
158
163
|
? void 0
|
|
159
|
-
: repzo_payment_terms.data) === null ||
|
|
164
|
+
: repzo_payment_terms.data) === null || _h === void 0
|
|
160
165
|
? void 0
|
|
161
|
-
:
|
|
166
|
+
: _h.find((paymentTerm) => {
|
|
162
167
|
var _a;
|
|
163
168
|
return (
|
|
164
169
|
((_a = paymentTerm.integration_meta) === null || _a === void 0
|
|
@@ -167,12 +172,12 @@ export const sync_client = async (commandEvent) => {
|
|
|
167
172
|
);
|
|
168
173
|
});
|
|
169
174
|
const priceList =
|
|
170
|
-
(
|
|
175
|
+
(_j =
|
|
171
176
|
repzo_price_lists === null || repzo_price_lists === void 0
|
|
172
177
|
? void 0
|
|
173
|
-
: repzo_price_lists.data) === null ||
|
|
178
|
+
: repzo_price_lists.data) === null || _j === void 0
|
|
174
179
|
? void 0
|
|
175
|
-
:
|
|
180
|
+
: _j.find((pricelist) => {
|
|
176
181
|
var _a;
|
|
177
182
|
return (
|
|
178
183
|
((_a = pricelist.integration_meta) === null || _a === void 0
|
|
@@ -313,10 +318,10 @@ export const sync_client = async (commandEvent) => {
|
|
|
313
318
|
} catch (e) {
|
|
314
319
|
//@ts-ignore
|
|
315
320
|
console.error(
|
|
316
|
-
((
|
|
317
|
-
|
|
321
|
+
((_k = e === null || e === void 0 ? void 0 : e.response) === null ||
|
|
322
|
+
_k === void 0
|
|
318
323
|
? void 0
|
|
319
|
-
:
|
|
324
|
+
: _k.data) || e
|
|
320
325
|
);
|
|
321
326
|
await commandLog.setStatus("fail", e).commit();
|
|
322
327
|
throw e;
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
set_error,
|
|
7
7
|
} from "../util.js";
|
|
8
8
|
export const sync_disabled_client = async (commandEvent) => {
|
|
9
|
-
var _a, _b, _c, _d;
|
|
9
|
+
var _a, _b, _c, _d, _e, _f;
|
|
10
10
|
const repzo = new Repzo(
|
|
11
11
|
(_a = commandEvent.app.formData) === null || _a === void 0
|
|
12
12
|
? void 0
|
|
@@ -40,7 +40,10 @@ export const sync_disabled_client = async (commandEvent) => {
|
|
|
40
40
|
const sap_disabled_clients = await get_sap_clients(
|
|
41
41
|
commandEvent.app.formData.sapHostUrl,
|
|
42
42
|
{
|
|
43
|
-
updateAt:
|
|
43
|
+
updateAt:
|
|
44
|
+
(_b = commandEvent.app.options_formData) === null || _b === void 0
|
|
45
|
+
? void 0
|
|
46
|
+
: _b[bench_time_key],
|
|
44
47
|
GroupCode: commandEvent.app.formData.GroupCode,
|
|
45
48
|
}
|
|
46
49
|
);
|
|
@@ -51,7 +54,9 @@ export const sync_disabled_client = async (commandEvent) => {
|
|
|
51
54
|
await commandLog
|
|
52
55
|
.addDetail(
|
|
53
56
|
`${result.sap_total} Disabled Clients in SAP changed since ${
|
|
54
|
-
commandEvent.app.options_formData
|
|
57
|
+
((_c = commandEvent.app.options_formData) === null || _c === void 0
|
|
58
|
+
? void 0
|
|
59
|
+
: _c[bench_time_key]) || "ever"
|
|
55
60
|
}`
|
|
56
61
|
)
|
|
57
62
|
.commit();
|
|
@@ -76,9 +81,9 @@ export const sync_disabled_client = async (commandEvent) => {
|
|
|
76
81
|
{ per_page: 50000, project: ["_id", "integration_meta"] }
|
|
77
82
|
);
|
|
78
83
|
result.repzo_total =
|
|
79
|
-
(
|
|
84
|
+
(_d = repzo_disabled_clients.data) === null || _d === void 0
|
|
80
85
|
? void 0
|
|
81
|
-
:
|
|
86
|
+
: _d.length;
|
|
82
87
|
await commandLog
|
|
83
88
|
.addDetail(`${result.repzo_total} Matched Active Clients in Repzo`)
|
|
84
89
|
.commit();
|
|
@@ -92,9 +97,9 @@ export const sync_disabled_client = async (commandEvent) => {
|
|
|
92
97
|
) {
|
|
93
98
|
const sap_client = sap_disabled_clients[i];
|
|
94
99
|
const repzo_client =
|
|
95
|
-
(
|
|
100
|
+
(_e = repzo_disabled_clients.data) === null || _e === void 0
|
|
96
101
|
? void 0
|
|
97
|
-
:
|
|
102
|
+
: _e.find((r_client) => {
|
|
98
103
|
var _a;
|
|
99
104
|
return (
|
|
100
105
|
((_a = r_client.integration_meta) === null || _a === void 0
|
|
@@ -142,10 +147,10 @@ export const sync_disabled_client = async (commandEvent) => {
|
|
|
142
147
|
} catch (e) {
|
|
143
148
|
//@ts-ignore
|
|
144
149
|
console.error(
|
|
145
|
-
((
|
|
146
|
-
|
|
150
|
+
((_f = e === null || e === void 0 ? void 0 : e.response) === null ||
|
|
151
|
+
_f === void 0
|
|
147
152
|
? void 0
|
|
148
|
-
:
|
|
153
|
+
: _f.data) || e
|
|
149
154
|
);
|
|
150
155
|
await commandLog.setStatus("fail", e).commit();
|
|
151
156
|
throw e;
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
set_error,
|
|
7
7
|
} from "../util.js";
|
|
8
8
|
export const sync_payment_term = async (commandEvent) => {
|
|
9
|
-
var _a, _b, _c, _d;
|
|
9
|
+
var _a, _b, _c, _d, _e, _f;
|
|
10
10
|
const repzo = new Repzo(
|
|
11
11
|
(_a = commandEvent.app.formData) === null || _a === void 0
|
|
12
12
|
? void 0
|
|
@@ -40,7 +40,10 @@ export const sync_payment_term = async (commandEvent) => {
|
|
|
40
40
|
const sap_clients = await get_sap_clients(
|
|
41
41
|
commandEvent.app.formData.sapHostUrl,
|
|
42
42
|
{
|
|
43
|
-
updateAt:
|
|
43
|
+
updateAt:
|
|
44
|
+
(_b = commandEvent.app.options_formData) === null || _b === void 0
|
|
45
|
+
? void 0
|
|
46
|
+
: _b[bench_time_key],
|
|
44
47
|
GroupCode: commandEvent.app.formData.GroupCode,
|
|
45
48
|
}
|
|
46
49
|
);
|
|
@@ -59,7 +62,9 @@ export const sync_payment_term = async (commandEvent) => {
|
|
|
59
62
|
await commandLog
|
|
60
63
|
.addDetail(
|
|
61
64
|
`${result.sap_total} Payments Term in SAP changed since ${
|
|
62
|
-
commandEvent.app.options_formData
|
|
65
|
+
((_c = commandEvent.app.options_formData) === null || _c === void 0
|
|
66
|
+
? void 0
|
|
67
|
+
: _c[bench_time_key]) || "ever"
|
|
63
68
|
}`
|
|
64
69
|
)
|
|
65
70
|
.commit();
|
|
@@ -67,21 +72,21 @@ export const sync_payment_term = async (commandEvent) => {
|
|
|
67
72
|
per_page: 50000,
|
|
68
73
|
});
|
|
69
74
|
result.repzo_total =
|
|
70
|
-
(
|
|
75
|
+
(_d =
|
|
71
76
|
repzo_payment_terms === null || repzo_payment_terms === void 0
|
|
72
77
|
? void 0
|
|
73
|
-
: repzo_payment_terms.data) === null ||
|
|
78
|
+
: repzo_payment_terms.data) === null || _d === void 0
|
|
74
79
|
? void 0
|
|
75
|
-
:
|
|
80
|
+
: _d.length;
|
|
76
81
|
await commandLog
|
|
77
82
|
.addDetail(
|
|
78
83
|
`${
|
|
79
|
-
(
|
|
84
|
+
(_e =
|
|
80
85
|
repzo_payment_terms === null || repzo_payment_terms === void 0
|
|
81
86
|
? void 0
|
|
82
|
-
: repzo_payment_terms.data) === null ||
|
|
87
|
+
: repzo_payment_terms.data) === null || _e === void 0
|
|
83
88
|
? void 0
|
|
84
|
-
:
|
|
89
|
+
: _e.length
|
|
85
90
|
} Payments Term in Repzo`
|
|
86
91
|
)
|
|
87
92
|
.commit();
|
|
@@ -182,10 +187,10 @@ export const sync_payment_term = async (commandEvent) => {
|
|
|
182
187
|
} catch (e) {
|
|
183
188
|
//@ts-ignore
|
|
184
189
|
console.error(
|
|
185
|
-
((
|
|
186
|
-
|
|
190
|
+
((_f = e === null || e === void 0 ? void 0 : e.response) === null ||
|
|
191
|
+
_f === void 0
|
|
187
192
|
? void 0
|
|
188
|
-
:
|
|
193
|
+
: _f.data) || e
|
|
189
194
|
);
|
|
190
195
|
await commandLog.setStatus("fail", e).commit();
|
|
191
196
|
throw e;
|