kcommons 16.4.0 → 16.5.1

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) {
@@ -126,8 +126,10 @@ export declare enum VENDOR_INCLUDE {
126
126
  }
127
127
  export declare enum VENDOR_TYPE {
128
128
  MFG = "Manufacturing",
129
- TRD = "Traders",
130
- SPO = "Service Provider and Others"
129
+ TRD = "Trader / Supplier",
130
+ SPO = "Service Provider",
131
+ CTR = "Contractor",
132
+ OTH = "Others"
131
133
  }
132
134
  export declare enum VENDOR_LINKABLE_FIELDS_FOR_EXTRA_FORMS {
133
135
  gst_no = "gst_no",
@@ -36,8 +36,10 @@ var VENDOR_INCLUDE;
36
36
  var VENDOR_TYPE;
37
37
  (function (VENDOR_TYPE) {
38
38
  VENDOR_TYPE["MFG"] = "Manufacturing";
39
- VENDOR_TYPE["TRD"] = "Traders";
40
- VENDOR_TYPE["SPO"] = "Service Provider and Others";
39
+ VENDOR_TYPE["TRD"] = "Trader / Supplier";
40
+ VENDOR_TYPE["SPO"] = "Service Provider";
41
+ VENDOR_TYPE["CTR"] = "Contractor";
42
+ VENDOR_TYPE["OTH"] = "Others";
41
43
  })(VENDOR_TYPE || (exports.VENDOR_TYPE = VENDOR_TYPE = {}));
42
44
  var VENDOR_LINKABLE_FIELDS_FOR_EXTRA_FORMS;
43
45
  (function (VENDOR_LINKABLE_FIELDS_FOR_EXTRA_FORMS) {
@@ -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.1",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",