repzo-sap-absjo 1.0.32 → 1.0.33
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.
|
@@ -171,7 +171,7 @@ export const create_transfer = async (event, options) => {
|
|
|
171
171
|
? repzo_rep.integration_id
|
|
172
172
|
: (_o = options.data) === null || _o === void 0
|
|
173
173
|
? void 0
|
|
174
|
-
: _o.SalesPersonCode,
|
|
174
|
+
: _o.SalesPersonCode,
|
|
175
175
|
FromWarehouse: body.from.code,
|
|
176
176
|
ToWarehouse: body.to.code,
|
|
177
177
|
RepzoStockTransferLines: variants,
|
|
@@ -475,8 +475,8 @@ export const sync_price_list = async (commandEvent) => {
|
|
|
475
475
|
(repzo_product_uom === null || repzo_product_uom === void 0
|
|
476
476
|
? void 0
|
|
477
477
|
: repzo_product_uom.factor) == 1
|
|
478
|
-
? Math.
|
|
479
|
-
: Math.
|
|
478
|
+
? Math.ceil(item.PLITEMPRICEVALUE * 1000)
|
|
479
|
+
: Math.ceil(
|
|
480
480
|
(item.PLITEMPRICEVALUE * 1000) / repzo_product_uom.factor
|
|
481
481
|
);
|
|
482
482
|
const variant =
|
package/package.json
CHANGED
|
@@ -39,7 +39,7 @@ export const sync_measureunit = async (commandEvent: CommandEvent) => {
|
|
|
39
39
|
const commandLog = new Repzo.CommandLog(
|
|
40
40
|
repzo,
|
|
41
41
|
commandEvent.app,
|
|
42
|
-
commandEvent.command
|
|
42
|
+
commandEvent.command
|
|
43
43
|
);
|
|
44
44
|
try {
|
|
45
45
|
// console.log("sync_measureunit");
|
|
@@ -64,7 +64,7 @@ export const sync_measureunit = async (commandEvent: CommandEvent) => {
|
|
|
64
64
|
|
|
65
65
|
const sap_UoMs: SAPUoM[] = await get_sap_UoMs(
|
|
66
66
|
commandEvent.app.formData.sapHostUrl,
|
|
67
|
-
{}
|
|
67
|
+
{}
|
|
68
68
|
);
|
|
69
69
|
result.sap_total = sap_UoMs?.length;
|
|
70
70
|
|
|
@@ -116,10 +116,10 @@ export const sync_measureunit = async (commandEvent: CommandEvent) => {
|
|
|
116
116
|
if (max_unit.sap_product_UoMs.length > 1) {
|
|
117
117
|
const PC = max_unit.sap_product_UoMs.find((u) => u.ALTUOMCODE == "PC");
|
|
118
118
|
const POUCH = max_unit.sap_product_UoMs.find(
|
|
119
|
-
(u) => u.ALTUOMCODE == "POUCH"
|
|
119
|
+
(u) => u.ALTUOMCODE == "POUCH"
|
|
120
120
|
);
|
|
121
121
|
const CARD = max_unit.sap_product_UoMs.find(
|
|
122
|
-
(u) => u.ALTUOMCODE == "CARD"
|
|
122
|
+
(u) => u.ALTUOMCODE == "CARD"
|
|
123
123
|
);
|
|
124
124
|
max_unit.default_unit = PC || POUCH || CARD;
|
|
125
125
|
|
|
@@ -135,7 +135,7 @@ export const sync_measureunit = async (commandEvent: CommandEvent) => {
|
|
|
135
135
|
max_unit?.sap_product_UoMs[0]?.ITEMCODE || units[0]?.ITEMCODE,
|
|
136
136
|
doc: units,
|
|
137
137
|
error_message: set_error(
|
|
138
|
-
`Create/Update Measure Unit Failed >> ${max_unit?.sap_product_UoMs[0]?.ITEMCODE} Could not found the base_unit
|
|
138
|
+
`Create/Update Measure Unit Failed >> ${max_unit?.sap_product_UoMs[0]?.ITEMCODE} Could not found the base_unit`
|
|
139
139
|
),
|
|
140
140
|
});
|
|
141
141
|
result.failed++;
|
|
@@ -177,7 +177,7 @@ export const sync_measureunit = async (commandEvent: CommandEvent) => {
|
|
|
177
177
|
const repzo_UoM = repzo_UoMs.data.find(
|
|
178
178
|
(r_UoM) =>
|
|
179
179
|
r_UoM.integration_meta?.id ==
|
|
180
|
-
`${nameSpace}_${sap_UoM.ITEMCODE}_${sap_UoM.UOMGROUPENTRY}_${sap_UoM.ALTUOMID}
|
|
180
|
+
`${nameSpace}_${sap_UoM.ITEMCODE}_${sap_UoM.UOMGROUPENTRY}_${sap_UoM.ALTUOMID}`
|
|
181
181
|
);
|
|
182
182
|
|
|
183
183
|
const body:
|
|
@@ -200,7 +200,7 @@ export const sync_measureunit = async (commandEvent: CommandEvent) => {
|
|
|
200
200
|
// Create
|
|
201
201
|
try {
|
|
202
202
|
const created_UoM = await repzo.measureunit.create(
|
|
203
|
-
body as Service.MeasureUnit.Create.Body
|
|
203
|
+
body as Service.MeasureUnit.Create.Body
|
|
204
204
|
);
|
|
205
205
|
result.created++;
|
|
206
206
|
} catch (e: any) {
|
|
@@ -225,7 +225,7 @@ export const sync_measureunit = async (commandEvent: CommandEvent) => {
|
|
|
225
225
|
try {
|
|
226
226
|
const updated_UoM = await repzo.measureunit.update(
|
|
227
227
|
repzo_UoM._id,
|
|
228
|
-
body as Service.MeasureUnit.Update.Body
|
|
228
|
+
body as Service.MeasureUnit.Update.Body
|
|
229
229
|
);
|
|
230
230
|
result.updated++;
|
|
231
231
|
} catch (e: any) {
|
|
@@ -251,12 +251,12 @@ export const sync_measureunit = async (commandEvent: CommandEvent) => {
|
|
|
251
251
|
repzo,
|
|
252
252
|
commandEvent.app._id,
|
|
253
253
|
bench_time_key,
|
|
254
|
-
new_bench_time
|
|
254
|
+
new_bench_time
|
|
255
255
|
);
|
|
256
256
|
await commandLog
|
|
257
257
|
.setStatus(
|
|
258
258
|
"success",
|
|
259
|
-
failed_docs_report.length ? failed_docs_report : null
|
|
259
|
+
failed_docs_report.length ? failed_docs_report : null
|
|
260
260
|
)
|
|
261
261
|
.setBody(result)
|
|
262
262
|
.commit();
|
|
@@ -271,7 +271,7 @@ export const sync_measureunit = async (commandEvent: CommandEvent) => {
|
|
|
271
271
|
|
|
272
272
|
export const get_sap_UoMs = async (
|
|
273
273
|
serviceEndPoint: string,
|
|
274
|
-
query?: { updateAt?: string }
|
|
274
|
+
query?: { updateAt?: string }
|
|
275
275
|
): Promise<SAPUoM[]> => {
|
|
276
276
|
try {
|
|
277
277
|
const sap_UoMs: SAPUoMs = await _create(serviceEndPoint, "/Uom", {
|
|
@@ -344,13 +344,13 @@ export const sync_price_list = async (commandEvent: CommandEvent) => {
|
|
|
344
344
|
|
|
345
345
|
const price =
|
|
346
346
|
repzo_product_uom && repzo_product_uom?.factor == 1
|
|
347
|
-
? Math.
|
|
348
|
-
: Math.
|
|
347
|
+
? Math.ceil(item.PLITEMPRICEVALUE * 1000)
|
|
348
|
+
: Math.ceil(
|
|
349
349
|
(item.PLITEMPRICEVALUE * 1000) / repzo_product_uom.factor
|
|
350
350
|
);
|
|
351
351
|
|
|
352
352
|
const variant = repzo_product?.variants?.find(
|
|
353
|
-
(variant) =>
|
|
353
|
+
(variant: any) =>
|
|
354
354
|
variant?.integration_meta?.id == `${nameSpace}_${item.PLITEMID}`
|
|
355
355
|
);
|
|
356
356
|
if (!variant) {
|