repzo-sap-absjo 1.0.50 → 1.0.52

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.
@@ -1,6 +1,7 @@
1
1
  import Repzo from "repzo";
2
2
  import DataSet from "data-set-query";
3
3
  import { _create, update_bench_time, set_error } from "../util.js";
4
+ import _ from "lodash";
4
5
  export const sync_measureunit = async (commandEvent) => {
5
6
  var _a, _b, _c, _d, _e, _f, _g, _h;
6
7
  const repzo = new Repzo(
@@ -92,8 +93,8 @@ export const sync_measureunit = async (commandEvent) => {
92
93
  value: null,
93
94
  default_unit: null,
94
95
  };
95
- units.forEach((unit) => {
96
- if (max_unit.value == null || unit.BASEQTY < max_unit.value) {
96
+ _.reverse(_.sortBy(units, "BASEQTY")).forEach((unit) => {
97
+ if (max_unit.value == null || unit.BASEQTY > max_unit.value) {
97
98
  max_unit.value = unit.BASEQTY;
98
99
  max_unit.sap_product_UoMs.push(unit);
99
100
  } else if (unit.BASEQTY == max_unit.value) {
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.50",
4
+ "version": "1.0.52",
5
5
  "homepage": "",
6
6
  "keywords": [],
7
7
  "author": {
@@ -11,6 +11,7 @@ import {
11
11
  date_formatting,
12
12
  set_error,
13
13
  } from "../util.js";
14
+ import _ from "lodash";
14
15
 
15
16
  export interface SAPUoM {
16
17
  ITEMCODE: string; // "010-BIC-RA0001",
@@ -104,8 +105,8 @@ export const sync_measureunit = async (commandEvent: CommandEvent) => {
104
105
  value: null,
105
106
  default_unit: null,
106
107
  };
107
- units.forEach((unit) => {
108
- if (max_unit.value == null || unit.BASEQTY < max_unit.value) {
108
+ _.reverse(_.sortBy(units, "BASEQTY")).forEach((unit) => {
109
+ if (max_unit.value == null || unit.BASEQTY > max_unit.value) {
109
110
  max_unit.value = unit.BASEQTY;
110
111
  max_unit.sap_product_UoMs.push(unit);
111
112
  } else if (unit.BASEQTY == max_unit.value) {