kcommons 16.3.1 → 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) {
|
|
@@ -30,7 +30,7 @@ export declare enum SUB_PO_INCLUDES {
|
|
|
30
30
|
export declare enum SUB_PO_METAFIELDS_INCLUDE {
|
|
31
31
|
items_data = "items_data",
|
|
32
32
|
vendor_data = "vendor_data",
|
|
33
|
-
|
|
33
|
+
shipping_location_data = "shipping_location_data"
|
|
34
34
|
}
|
|
35
35
|
interface ISubPOFiltersBase {
|
|
36
36
|
name?: string;
|
|
@@ -25,5 +25,5 @@ var SUB_PO_METAFIELDS_INCLUDE;
|
|
|
25
25
|
(function (SUB_PO_METAFIELDS_INCLUDE) {
|
|
26
26
|
SUB_PO_METAFIELDS_INCLUDE["items_data"] = "items_data";
|
|
27
27
|
SUB_PO_METAFIELDS_INCLUDE["vendor_data"] = "vendor_data";
|
|
28
|
-
SUB_PO_METAFIELDS_INCLUDE["
|
|
28
|
+
SUB_PO_METAFIELDS_INCLUDE["shipping_location_data"] = "shipping_location_data";
|
|
29
29
|
})(SUB_PO_METAFIELDS_INCLUDE || (exports.SUB_PO_METAFIELDS_INCLUDE = SUB_PO_METAFIELDS_INCLUDE = {}));
|
|
@@ -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:
|
|
9
|
+
upper_buffer: 0,
|
|
10
10
|
lower_bound: total_quantity_in_po,
|
|
11
|
-
lower_buffer:
|
|
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
|
-
|
|
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 =
|
|
28
|
-
|
|
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,
|