repzo-sap-absjo 1.0.8 → 1.0.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.
- package/lib/actions/create_invoice.d.ts +19 -13
- package/lib/actions/create_invoice.js +363 -214
- package/lib/actions/create_payment.d.ts +4 -1
- package/lib/actions/create_payment.js +200 -125
- package/lib/actions/create_proforma.d.ts +4 -1
- package/lib/actions/create_proforma.js +290 -165
- package/lib/actions/create_return_invoice.d.ts +4 -1
- package/lib/actions/create_return_invoice.js +321 -177
- package/lib/actions/create_transfer.d.ts +4 -1
- package/lib/actions/create_transfer.js +220 -143
- package/lib/actions/index.js +23 -15
- package/lib/commands/adjust_inventory.d.ts +4 -2
- package/lib/commands/adjust_inventory.js +290 -160
- package/lib/commands/bank.d.ts +4 -2
- package/lib/commands/bank.js +279 -157
- package/lib/commands/basic.js +66 -47
- package/lib/commands/category.d.ts +3 -1
- package/lib/commands/category.js +178 -104
- package/lib/commands/channel.d.ts +3 -1
- package/lib/commands/channel.js +198 -117
- package/lib/commands/client.d.ts +34 -32
- package/lib/commands/client.js +404 -244
- package/lib/commands/client_disabled.d.ts +3 -1
- package/lib/commands/client_disabled.js +163 -94
- package/lib/commands/index.d.ts +15 -11
- package/lib/commands/index.js +60 -60
- package/lib/commands/join.js +192 -66
- package/lib/commands/measureunit.d.ts +19 -14
- package/lib/commands/measureunit.js +289 -191
- package/lib/commands/measureunit_family.d.ts +10 -8
- package/lib/commands/measureunit_family.js +250 -138
- package/lib/commands/payment_term.d.ts +3 -1
- package/lib/commands/payment_term.js +202 -123
- package/lib/commands/price_list.d.ts +15 -15
- package/lib/commands/price_list.js +612 -326
- package/lib/commands/product.d.ts +32 -30
- package/lib/commands/product.js +425 -243
- package/lib/commands/product_disabled.d.ts +3 -1
- package/lib/commands/product_disabled.js +164 -94
- package/lib/commands/rep.js +221 -141
- package/lib/commands/tag.js +174 -109
- package/lib/commands/tax.js +177 -112
- package/lib/commands/warehouse.d.ts +3 -1
- package/lib/commands/warehouse.js +207 -119
- package/lib/index.d.ts +21 -12
- package/lib/test/actions/create_invoice.js +193 -188
- package/lib/test/actions/create_payment.js +112 -107
- package/lib/test/actions/create_proforma.js +220 -216
- package/lib/test/actions/create_return_invoice.js +205 -200
- package/lib/test/actions/create_transfer.js +120 -115
- package/lib/test/commands/adjust_inventory.js +90 -90
- package/lib/test/commands/bank.js +90 -90
- package/lib/test/commands/basic.js +328 -327
- package/lib/test/commands/category.js +90 -90
- package/lib/test/commands/channel.js +90 -90
- package/lib/test/commands/client.js +355 -353
- package/lib/test/commands/client_disabled.js +90 -90
- package/lib/test/commands/join.js +328 -327
- 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 +337 -334
- package/lib/test/commands/product.js +90 -90
- package/lib/test/commands/product_disabled.js +90 -90
- package/lib/test/commands/rep.js +346 -344
- 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 +83 -60
- package/lib/util.d.ts +70 -19
- package/lib/util.js +170 -144
- package/package.json +1 -1
- package/src/actions/create_invoice.ts +4 -13
- package/src/actions/create_payment.ts +4 -13
- package/src/actions/create_proforma.ts +28 -40
- package/src/actions/create_return_invoice.ts +4 -16
- package/src/actions/create_transfer.ts +24 -36
|
@@ -49,11 +49,6 @@ export const create_payment = async (event: EVENT, options: Config) => {
|
|
|
49
49
|
}
|
|
50
50
|
} catch (e) {
|
|
51
51
|
console.error(e);
|
|
52
|
-
await actionLog
|
|
53
|
-
.addDetail(
|
|
54
|
-
`Failed updating integration_meta of Payment: ${repzo_serial_number}`
|
|
55
|
-
)
|
|
56
|
-
.commit();
|
|
57
52
|
}
|
|
58
53
|
|
|
59
54
|
await actionLog
|
|
@@ -133,9 +128,10 @@ export const create_payment = async (event: EVENT, options: Config) => {
|
|
|
133
128
|
|
|
134
129
|
// console.dir(sap_payment, { depth: null });
|
|
135
130
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
131
|
+
actionLog.addDetail(
|
|
132
|
+
`Repzo => SAP: Payment - ${repzo_serial_number}`,
|
|
133
|
+
sap_payment
|
|
134
|
+
);
|
|
139
135
|
|
|
140
136
|
const result = await _create(SAP_HOST_URL, "/AddPayment", sap_payment);
|
|
141
137
|
|
|
@@ -151,11 +147,6 @@ export const create_payment = async (event: EVENT, options: Config) => {
|
|
|
151
147
|
}
|
|
152
148
|
} catch (e) {
|
|
153
149
|
console.error(e);
|
|
154
|
-
await actionLog
|
|
155
|
-
.addDetail(
|
|
156
|
-
`Failed updating integration_meta of Payment: ${repzo_serial_number}`
|
|
157
|
-
)
|
|
158
|
-
.commit();
|
|
159
150
|
}
|
|
160
151
|
|
|
161
152
|
await actionLog
|
|
@@ -44,24 +44,19 @@ export const create_proforma = async (event: EVENT, options: Config) => {
|
|
|
44
44
|
} catch (e) {}
|
|
45
45
|
|
|
46
46
|
const repzo_serial_number = body?.serial_number?.formatted;
|
|
47
|
-
try {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
} catch (e) {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
.addDetail(
|
|
61
|
-
`Failed updating integration_meta of SalesOrder: ${repzo_serial_number}`
|
|
62
|
-
)
|
|
63
|
-
.commit();
|
|
64
|
-
}
|
|
47
|
+
// try {
|
|
48
|
+
// if (body?._id) {
|
|
49
|
+
// body.integration_meta = body?.integration_meta || {};
|
|
50
|
+
// body.integration_meta.sync_to_sap_started = true;
|
|
51
|
+
// body.integration_meta.sync_to_sap_succeeded =
|
|
52
|
+
// body.integration_meta.sync_to_sap_succeeded || false;
|
|
53
|
+
// await repzo.proforma.update(body._id, {
|
|
54
|
+
// integration_meta: body.integration_meta,
|
|
55
|
+
// });
|
|
56
|
+
// }
|
|
57
|
+
// } catch (e) {
|
|
58
|
+
// console.error(e);
|
|
59
|
+
// }
|
|
65
60
|
|
|
66
61
|
await actionLog
|
|
67
62
|
.addDetail(`SalesOrder - ${repzo_serial_number} => ${body?.sync_id}`)
|
|
@@ -204,33 +199,26 @@ export const create_proforma = async (event: EVENT, options: Config) => {
|
|
|
204
199
|
|
|
205
200
|
// console.dir(sap_invoice, { depth: null });
|
|
206
201
|
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
)
|
|
212
|
-
.commit();
|
|
202
|
+
actionLog.addDetail(
|
|
203
|
+
`Repzo => SAP: SalesOrder - ${repzo_serial_number}`,
|
|
204
|
+
sap_invoice
|
|
205
|
+
); // .commit();
|
|
213
206
|
|
|
214
207
|
const result = await _create(SAP_HOST_URL, "/AddOrder", sap_invoice);
|
|
215
208
|
|
|
216
209
|
// console.log(result);
|
|
217
210
|
|
|
218
|
-
try {
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
} catch (e) {
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
.addDetail(
|
|
230
|
-
`Failed updating integration_meta of SalesOrder: ${repzo_serial_number}`
|
|
231
|
-
)
|
|
232
|
-
.commit();
|
|
233
|
-
}
|
|
211
|
+
// try {
|
|
212
|
+
// if (body?._id) {
|
|
213
|
+
// body.integration_meta = body?.integration_meta || {};
|
|
214
|
+
// body.integration_meta.sync_to_sap_succeeded = true;
|
|
215
|
+
// await repzo.proforma.update(body._id, {
|
|
216
|
+
// integration_meta: body.integration_meta,
|
|
217
|
+
// });
|
|
218
|
+
// }
|
|
219
|
+
// } catch (e) {
|
|
220
|
+
// console.error(e);
|
|
221
|
+
// }
|
|
234
222
|
|
|
235
223
|
await actionLog
|
|
236
224
|
.addDetail(`SAP Responded with `, result)
|
|
@@ -64,11 +64,6 @@ export const create_return_invoice = async (event: EVENT, options: Config) => {
|
|
|
64
64
|
}
|
|
65
65
|
} catch (e) {
|
|
66
66
|
console.error(e);
|
|
67
|
-
await actionLog
|
|
68
|
-
.addDetail(
|
|
69
|
-
`Failed updating integration_meta of Return Invoice: ${repzo_serial_number}`
|
|
70
|
-
)
|
|
71
|
-
.commit();
|
|
72
67
|
}
|
|
73
68
|
|
|
74
69
|
await actionLog
|
|
@@ -231,12 +226,10 @@ export const create_return_invoice = async (event: EVENT, options: Config) => {
|
|
|
231
226
|
|
|
232
227
|
// console.dir(sap_return_invoice, { depth: null });
|
|
233
228
|
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
)
|
|
239
|
-
.commit();
|
|
229
|
+
actionLog.addDetail(
|
|
230
|
+
`Repzo => SAP: Invoice - ${repzo_serial_number}`,
|
|
231
|
+
sap_return_invoice
|
|
232
|
+
);
|
|
240
233
|
|
|
241
234
|
const result = await _create(
|
|
242
235
|
SAP_HOST_URL,
|
|
@@ -256,11 +249,6 @@ export const create_return_invoice = async (event: EVENT, options: Config) => {
|
|
|
256
249
|
}
|
|
257
250
|
} catch (e) {
|
|
258
251
|
console.error(e);
|
|
259
|
-
await actionLog
|
|
260
|
-
.addDetail(
|
|
261
|
-
`Failed updating integration_meta of Return Invoice: ${repzo_serial_number}`
|
|
262
|
-
)
|
|
263
|
-
.commit();
|
|
264
252
|
}
|
|
265
253
|
|
|
266
254
|
await actionLog
|
|
@@ -41,24 +41,19 @@ export const create_transfer = async (event: EVENT, options: Config) => {
|
|
|
41
41
|
} catch (e) {}
|
|
42
42
|
|
|
43
43
|
const repzo_serial_number = body?.serial_number?.formatted;
|
|
44
|
-
try {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
} catch (e) {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
.addDetail(
|
|
58
|
-
`Failed updating integration_meta of Transfer: ${repzo_serial_number}`
|
|
59
|
-
)
|
|
60
|
-
.commit();
|
|
61
|
-
}
|
|
44
|
+
// try {
|
|
45
|
+
// if (body?._id) {
|
|
46
|
+
// body.integration_meta = body?.integration_meta || {};
|
|
47
|
+
// body.integration_meta.sync_to_sap_started = true;
|
|
48
|
+
// body.integration_meta.sync_to_sap_succeeded =
|
|
49
|
+
// body.integration_meta.sync_to_sap_succeeded || false;
|
|
50
|
+
// await repzo.transfer.update(body._id, {
|
|
51
|
+
// integration_meta: body.integration_meta,
|
|
52
|
+
// });
|
|
53
|
+
// }
|
|
54
|
+
// } catch (e) {
|
|
55
|
+
// console.error(e);
|
|
56
|
+
// }
|
|
62
57
|
|
|
63
58
|
await actionLog
|
|
64
59
|
.addDetail(`Transfer - ${repzo_serial_number} => ${body?.sync_id}`)
|
|
@@ -161,12 +156,10 @@ export const create_transfer = async (event: EVENT, options: Config) => {
|
|
|
161
156
|
|
|
162
157
|
// console.dir(sap_transfer, { depth: null });
|
|
163
158
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
)
|
|
169
|
-
.commit();
|
|
159
|
+
actionLog.addDetail(
|
|
160
|
+
`Repzo => SAP: Transfer - ${repzo_serial_number}`,
|
|
161
|
+
sap_transfer
|
|
162
|
+
);
|
|
170
163
|
|
|
171
164
|
const result = await _create(
|
|
172
165
|
SAP_HOST_URL,
|
|
@@ -176,20 +169,15 @@ export const create_transfer = async (event: EVENT, options: Config) => {
|
|
|
176
169
|
|
|
177
170
|
// console.log(result);
|
|
178
171
|
try {
|
|
179
|
-
if (body?._id) {
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
}
|
|
172
|
+
// if (body?._id) {
|
|
173
|
+
// body.integration_meta = body?.integration_meta || {};
|
|
174
|
+
// body.integration_meta.sync_to_sap_succeeded = true;
|
|
175
|
+
// await repzo.transfer.update(body._id, {
|
|
176
|
+
// integration_meta: body.integration_meta,
|
|
177
|
+
// });
|
|
178
|
+
// }
|
|
186
179
|
} catch (e) {
|
|
187
180
|
console.error(e);
|
|
188
|
-
await actionLog
|
|
189
|
-
.addDetail(
|
|
190
|
-
`Failed updating integration_meta of Transfer: ${repzo_serial_number}`
|
|
191
|
-
)
|
|
192
|
-
.commit();
|
|
193
181
|
}
|
|
194
182
|
|
|
195
183
|
await actionLog
|