kcommons 16.4.0 → 16.5.0

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.
@@ -35,7 +35,8 @@ export declare enum COMPANY_VIEW_PO_TABS {
35
35
  ASNS = "ASNS",
36
36
  SUB_POS = "SUB_POS",
37
37
  INVOICES = "INVOICES",
38
- LOGS = "LOGS"
38
+ LOGS = "LOGS",
39
+ AMENDED_PO_ITEMS = "AMENDED_PO_ITEMS"
39
40
  }
40
41
  export declare enum PO_STATUS {
41
42
  /** @description DRAFT means the PO has been created by user and is in initial stage. Vendor has no information about this PO at DRAFT Stage */
@@ -15,6 +15,7 @@ var COMPANY_VIEW_PO_TABS;
15
15
  COMPANY_VIEW_PO_TABS["SUB_POS"] = "SUB_POS";
16
16
  COMPANY_VIEW_PO_TABS["INVOICES"] = "INVOICES";
17
17
  COMPANY_VIEW_PO_TABS["LOGS"] = "LOGS";
18
+ COMPANY_VIEW_PO_TABS["AMENDED_PO_ITEMS"] = "AMENDED_PO_ITEMS";
18
19
  })(COMPANY_VIEW_PO_TABS || (exports.COMPANY_VIEW_PO_TABS = COMPANY_VIEW_PO_TABS = {}));
19
20
  var PO_STATUS;
20
21
  (function (PO_STATUS) {
@@ -6,17 +6,17 @@ function calculateToleranceRange({ allow_tolerance, allowed_tolerance_unit, lowe
6
6
  if (!allow_tolerance || !allowed_tolerance_unit)
7
7
  return {
8
8
  upper_bound: total_quantity_in_po,
9
- upper_buffer: total_quantity_in_po,
9
+ upper_buffer: 0,
10
10
  lower_bound: total_quantity_in_po,
11
- lower_buffer: total_quantity_in_po,
11
+ lower_buffer: 0,
12
12
  };
13
13
  if (lowerbound_allowed_tolerance_value === null)
14
14
  throw new Error(`lowerbound_allowed_tolerance_value is required when calculating lowerbound of allowed tolerance range`);
15
15
  if (upperbound_allowed_tolerance_value === null)
16
16
  throw new Error(`upperbound_allowed_tolerance_value is required when calculating upperbound of allowed tolerance range`);
17
17
  if (allowed_tolerance_unit === item_typings_1.ITEM_TOLERANCE_TYPES.FIXED) {
18
- if (upperbound_allowed_tolerance_value > total_quantity_in_po)
19
- throw new Error(`Tolerance cannot be greater than the target quantity`);
18
+ // if (upperbound_allowed_tolerance_value > total_quantity_in_po)
19
+ // throw new Error(`Tolerance cannot be greater than the target quantity`);
20
20
  return {
21
21
  upper_bound: total_quantity_in_po + upperbound_allowed_tolerance_value,
22
22
  lower_bound: total_quantity_in_po - lowerbound_allowed_tolerance_value,
@@ -24,8 +24,12 @@ function calculateToleranceRange({ allow_tolerance, allowed_tolerance_unit, lowe
24
24
  lower_buffer: lowerbound_allowed_tolerance_value,
25
25
  };
26
26
  }
27
- const calculatedUpperboundBuffer = total_quantity_in_po * (upperbound_allowed_tolerance_value / 100);
28
- const calculatedLowerboundBuffer = total_quantity_in_po * (lowerbound_allowed_tolerance_value / 100);
27
+ const calculatedUpperboundBuffer = upperbound_allowed_tolerance_value === null
28
+ ? 0
29
+ : total_quantity_in_po * (upperbound_allowed_tolerance_value / 100);
30
+ const calculatedLowerboundBuffer = lowerbound_allowed_tolerance_value === null
31
+ ? 0
32
+ : total_quantity_in_po * (lowerbound_allowed_tolerance_value / 100);
29
33
  return {
30
34
  upper_bound: total_quantity_in_po + calculatedUpperboundBuffer,
31
35
  lower_bound: total_quantity_in_po - calculatedLowerboundBuffer,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kcommons",
3
- "version": "16.4.0",
3
+ "version": "16.5.0",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",