repzo-sap-absjo 1.0.32 → 1.0.34

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 CHANGED
@@ -27,6 +27,7 @@
27
27
  - [actions/**] don't update integration_meta.sync_to_sap_succeeded if it is already true @maramalshen
28
28
  - [actions/create_invoice] include item.get_promotion in MEO_Serial & Promotion_Name @maramalshen
29
29
  - fix bug in is_matched in client & product @maramalshen
30
+ - fix: update date formatting to use 'YYYYMMDD:000000' for UpdateAt field @maramalshen
30
31
 
31
32
  ### Removed
32
33
 
@@ -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, // "111"
174
+ : _o.SalesPersonCode,
175
175
  FromWarehouse: body.from.code,
176
176
  ToWarehouse: body.to.code,
177
177
  RepzoStockTransferLines: variants,
@@ -194,7 +194,7 @@ const get_sap_clients = async (serviceEndPoint, query) => {
194
194
  Frozen: "N",
195
195
  UpdateAt: date_formatting(
196
196
  query === null || query === void 0 ? void 0 : query.updateAt,
197
- "YYYYMMDD:HHmmss"
197
+ "YYYYMMDD:000000"
198
198
  ),
199
199
  GroupCode:
200
200
  (query === null || query === void 0 ? void 0 : query.GroupCode) || "",
@@ -311,7 +311,7 @@ const get_sap_clients = async (serviceEndPoint, query) => {
311
311
  Frozen: "N",
312
312
  UpdateAt: date_formatting(
313
313
  query === null || query === void 0 ? void 0 : query.updateAt,
314
- "YYYYMMDD:HHmmss"
314
+ "YYYYMMDD:000000"
315
315
  ),
316
316
  GroupCode:
317
317
  (query === null || query === void 0 ? void 0 : query.GroupCode) || "",
@@ -158,7 +158,7 @@ const get_sap_clients = async (serviceEndPoint, query) => {
158
158
  Frozen: "N",
159
159
  UpdateAt: date_formatting(
160
160
  query === null || query === void 0 ? void 0 : query.updateAt,
161
- "YYYYMMDD:HHmmss"
161
+ "YYYYMMDD:000000"
162
162
  ),
163
163
  GroupCode:
164
164
  (query === null || query === void 0 ? void 0 : query.GroupCode) || "",
@@ -198,7 +198,7 @@ const get_sap_clients = async (serviceEndPoint, query) => {
198
198
  Frozen: "N",
199
199
  UpdateAt: date_formatting(
200
200
  query === null || query === void 0 ? void 0 : query.updateAt,
201
- "YYYYMMDD:HHmmss"
201
+ "YYYYMMDD:000000"
202
202
  ),
203
203
  GroupCode:
204
204
  (query === null || query === void 0 ? void 0 : query.GroupCode) || "",
@@ -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.round(item.PLITEMPRICEVALUE * 1000)
479
- : Math.round(
478
+ ? Math.ceil(item.PLITEMPRICEVALUE * 1000)
479
+ : Math.ceil(
480
480
  (item.PLITEMPRICEVALUE * 1000) / repzo_product_uom.factor
481
481
  );
482
482
  const variant =
@@ -431,7 +431,7 @@ const get_sap_products = async (serviceEndPoint, query) => {
431
431
  Active: "Y",
432
432
  UpdateAt: date_formatting(
433
433
  query === null || query === void 0 ? void 0 : query.updateAt,
434
- "YYYYMMDD:HHmmss"
434
+ "YYYYMMDD:000000"
435
435
  ),
436
436
  });
437
437
  return sap_products.Items;
@@ -157,7 +157,7 @@ const get_sap_disabled_products = async (serviceEndPoint, query) => {
157
157
  Active: "N",
158
158
  UpdateAt: date_formatting(
159
159
  query === null || query === void 0 ? void 0 : query.updateAt,
160
- "YYYYMMDD:HHmmss"
160
+ "YYYYMMDD:000000"
161
161
  ),
162
162
  });
163
163
  return sap_products.Items;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "repzo-sap-absjo",
3
3
  "description": "repzo SAP ABS jo integration",
4
- "version": "1.0.32",
4
+ "version": "1.0.34",
5
5
  "homepage": "",
6
6
  "keywords": [],
7
7
  "author": {
@@ -208,7 +208,7 @@ const get_sap_clients = async (
208
208
  {
209
209
  Active: "Y",
210
210
  Frozen: "N",
211
- UpdateAt: date_formatting(query?.updateAt, "YYYYMMDD:HHmmss"),
211
+ UpdateAt: date_formatting(query?.updateAt, "YYYYMMDD:000000"),
212
212
  GroupCode: query?.GroupCode || "",
213
213
  }
214
214
  );
@@ -298,7 +298,7 @@ const get_sap_clients = async (
298
298
  {
299
299
  Active: "Y",
300
300
  Frozen: "N",
301
- UpdateAt: date_formatting(query?.updateAt, "YYYYMMDD:HHmmss"),
301
+ UpdateAt: date_formatting(query?.updateAt, "YYYYMMDD:000000"),
302
302
  GroupCode: query?.GroupCode || "",
303
303
  }
304
304
  );
@@ -148,7 +148,7 @@ const get_sap_clients = async (
148
148
  {
149
149
  Active: "N",
150
150
  Frozen: "N",
151
- UpdateAt: date_formatting(query?.updateAt, "YYYYMMDD:HHmmss"),
151
+ UpdateAt: date_formatting(query?.updateAt, "YYYYMMDD:000000"),
152
152
  GroupCode: query?.GroupCode || "",
153
153
  }
154
154
  );
@@ -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", {
@@ -213,7 +213,7 @@ const get_sap_clients = async (
213
213
  {
214
214
  Active: "Y",
215
215
  Frozen: "N",
216
- UpdateAt: date_formatting(query?.updateAt, "YYYYMMDD:HHmmss"),
216
+ UpdateAt: date_formatting(query?.updateAt, "YYYYMMDD:000000"),
217
217
  GroupCode: query?.GroupCode || "",
218
218
  }
219
219
  );
@@ -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.round(item.PLITEMPRICEVALUE * 1000)
348
- : Math.round(
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) {
@@ -328,7 +328,7 @@ const get_sap_products = async (
328
328
  try {
329
329
  const sap_products: SAPProducts = await _create(serviceEndPoint, "/Items", {
330
330
  Active: "Y",
331
- UpdateAt: date_formatting(query?.updateAt, "YYYYMMDD:HHmmss"),
331
+ UpdateAt: date_formatting(query?.updateAt, "YYYYMMDD:000000"),
332
332
  });
333
333
  return sap_products.Items;
334
334
  } catch (e: any) {
@@ -146,7 +146,7 @@ const get_sap_disabled_products = async (
146
146
  try {
147
147
  const sap_products: SAPProducts = await _create(serviceEndPoint, "/Items", {
148
148
  Active: "N",
149
- UpdateAt: date_formatting(query?.updateAt, "YYYYMMDD:HHmmss"),
149
+ UpdateAt: date_formatting(query?.updateAt, "YYYYMMDD:000000"),
150
150
  });
151
151
  return sap_products.Items;
152
152
  } catch (e: any) {