kcommons 15.7.2 → 16.0.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.
- package/build/configs/response.typings.d.ts +4 -2
- package/build/constants/companyRoutes.constants.d.ts +9 -0
- package/build/constants/companyRoutes.constants.js +10 -0
- package/build/constants/permission.constants.d.ts +5 -2
- package/build/constants/permission.constants.js +8 -0
- package/build/constants/statuses.constants.d.ts +3 -0
- package/build/constants/statuses.constants.js +3 -0
- package/build/constants/vendorRoutes.constants.d.ts +3 -0
- package/build/constants/vendorRoutes.constants.js +3 -0
- package/build/helpers/isBackendRequestError.helper.d.ts +2 -0
- package/build/helpers/isBackendRequestError.helper.js +14 -0
- package/build/index.d.ts +4 -0
- package/build/index.js +4 -0
- package/build/typings/company/masters/amendedPOItems.typings.d.ts +30 -0
- package/build/typings/company/masters/amendedPOItems.typings.js +11 -0
- package/build/typings/company/masters/po.typings.d.ts +30 -6
- package/build/typings/company/masters/po.typings.js +9 -2
- package/build/typings/company.typings.d.ts +16 -2
- package/build/typings/company.typings.js +10 -1
- package/build/typings/documentTaxes.typings.d.ts +6 -2
- package/build/typings/documentTaxes.typings.js +1 -0
- package/build/typings/entityApprovalChainEntry.typings.d.ts +9 -4
- package/build/typings/entityApprovalChainEntry.typings.js +4 -2
- package/build/typings/grn.typings.d.ts +5 -2
- package/build/typings/grn.typings.js +1 -0
- package/build/typings/item.typings.d.ts +19 -8
- package/build/typings/item.typings.js +7 -1
- package/build/typings/mrn.typings.d.ts +42 -3
- package/build/typings/mrn.typings.js +15 -1
- package/build/typings/subPO.typings.d.ts +72 -0
- package/build/typings/subPO.typings.js +23 -0
- package/build/typings/subPOItem.typings.d.ts +34 -0
- package/build/typings/subPOItem.typings.js +12 -0
- package/build/typings/user.typings.d.ts +27 -2
- package/build/typings/user.typings.js +11 -0
- package/build/utils/calculateToleranceRange.util.d.ts +11 -0
- package/build/utils/calculateToleranceRange.util.js +35 -0
- package/build/utils/getContactPerson.util.d.ts +4 -4
- package/build/utils/getContactPerson.util.spec.js +0 -134
- package/build/utils/taxes.util.d.ts +4 -1
- package/build/utils/taxes.util.js +4 -4
- package/package.json +2 -2
|
@@ -44,7 +44,8 @@ export declare enum GRN_INCLUDE {
|
|
|
44
44
|
approval_chain = "approval_chain",
|
|
45
45
|
sent_for_approval_by = "sent_for_approval_by",
|
|
46
46
|
sent_to_store_by = "sent_to_store_by",
|
|
47
|
-
child_mrns = "child_mrns"
|
|
47
|
+
child_mrns = "child_mrns",
|
|
48
|
+
referenced_po = "referenced_po"
|
|
48
49
|
}
|
|
49
50
|
export interface IGRNFilters {
|
|
50
51
|
parent_asn_id?: string;
|
|
@@ -79,6 +80,7 @@ export interface IGRN {
|
|
|
79
80
|
parent_asn_id: string | null;
|
|
80
81
|
parent_po_id: string | null;
|
|
81
82
|
parent_ves_id: string | null;
|
|
83
|
+
referenced_po_id: string | null;
|
|
82
84
|
shipping_store_location_id: string;
|
|
83
85
|
created_by_id: string;
|
|
84
86
|
last_updated_by_user_id: string;
|
|
@@ -107,9 +109,10 @@ export interface IGRN {
|
|
|
107
109
|
parent_istd: INestedISTD | null;
|
|
108
110
|
parent_po: INestedPo | null;
|
|
109
111
|
parent_ves: INestedVES | null;
|
|
112
|
+
referenced_po: INestedPo | null;
|
|
110
113
|
metafields: IGRNMetafields | null;
|
|
111
114
|
}
|
|
112
|
-
export interface INestedGRN extends Omit<IGRN, "company" | "created_by_user" | "last_updated_by_user" | "shipping_store_location" | "department" | "parent_asn" | "contact_person" | "items" | "approval_chain" | "sent_for_approval_by" | "sent_to_store_by" | "child_mrns" | "parent_istd" | "parent_po" | "parent_ves" | "metafields"> {
|
|
115
|
+
export interface INestedGRN extends Omit<IGRN, "company" | "created_by_user" | "last_updated_by_user" | "shipping_store_location" | "department" | "parent_asn" | "contact_person" | "items" | "approval_chain" | "sent_for_approval_by" | "sent_to_store_by" | "child_mrns" | "parent_istd" | "parent_po" | "parent_ves" | "referenced_po" | "metafields"> {
|
|
113
116
|
}
|
|
114
117
|
export declare enum GRN_ITEM_INCLUDE {
|
|
115
118
|
company = "company",
|
|
@@ -37,6 +37,7 @@ var GRN_INCLUDE;
|
|
|
37
37
|
GRN_INCLUDE["sent_for_approval_by"] = "sent_for_approval_by";
|
|
38
38
|
GRN_INCLUDE["sent_to_store_by"] = "sent_to_store_by";
|
|
39
39
|
GRN_INCLUDE["child_mrns"] = "child_mrns";
|
|
40
|
+
GRN_INCLUDE["referenced_po"] = "referenced_po";
|
|
40
41
|
})(GRN_INCLUDE || (exports.GRN_INCLUDE = GRN_INCLUDE = {}));
|
|
41
42
|
var GRN_STATUS;
|
|
42
43
|
(function (GRN_STATUS) {
|
|
@@ -24,16 +24,21 @@ import { IOpenApprovalsBase } from "./common/openApprovals.typings";
|
|
|
24
24
|
import { INestedVESItem } from "./company/masters/vesItem.typings";
|
|
25
25
|
import { INestedPOASNItemJunction } from "./company/masters/poAsnJunctionItems.typings";
|
|
26
26
|
import { INestedPOGRNItemJunction } from "./company/masters/poGrnJunctionItems.typings";
|
|
27
|
-
|
|
28
|
-
itemData: IItem;
|
|
29
|
-
entityApprovalChainEntry: IEntityApprovalChainEntry;
|
|
30
|
-
}
|
|
27
|
+
import { INestedAmendedPOItem } from "./company/masters/amendedPOItems.typings";
|
|
31
28
|
export declare enum ITEM_STATUS {
|
|
32
29
|
PENDING_APPROVAL = "PENDING_APPROVAL",
|
|
33
30
|
APPROVED = "APPROVED",
|
|
34
31
|
CANCELLED = "CANCELLED",
|
|
35
32
|
REQUESTED = "REQUESTED"
|
|
36
33
|
}
|
|
34
|
+
export declare enum ITEM_TOLERANCE_TYPES {
|
|
35
|
+
FIXED = "FIXED",
|
|
36
|
+
PERCENTAGE = "PERCENTAGE"
|
|
37
|
+
}
|
|
38
|
+
export interface IOpenItemApprovalsTokenVerificationResponse {
|
|
39
|
+
itemData: IItem;
|
|
40
|
+
entityApprovalChainEntry: IEntityApprovalChainEntry;
|
|
41
|
+
}
|
|
37
42
|
export declare enum ITEM_INCLUDE {
|
|
38
43
|
item_category = "item_category",
|
|
39
44
|
item_subcategory = "item_subcategory",
|
|
@@ -67,7 +72,8 @@ export declare enum ITEM_INCLUDE {
|
|
|
67
72
|
sent_for_approval_by = "sent_for_approval_by",
|
|
68
73
|
used_in_po_grn_item_junction = "used_in_po_grn_item_junction",
|
|
69
74
|
cancelled_by_user = "cancelled_by_user",
|
|
70
|
-
used_in_ves_items = "used_in_ves_items"
|
|
75
|
+
used_in_ves_items = "used_in_ves_items",
|
|
76
|
+
referenced_in_amended_po_items = "referenced_in_amended_po_items"
|
|
71
77
|
}
|
|
72
78
|
export interface IOpenItemApprovalsPayload extends IOpenApprovalsBase {
|
|
73
79
|
item_id: string;
|
|
@@ -131,6 +137,10 @@ export interface IItem {
|
|
|
131
137
|
additional_discount_after_billing_before_tax_value: number | null;
|
|
132
138
|
cancellation_remark: string | null;
|
|
133
139
|
status: ITEM_STATUS;
|
|
140
|
+
allow_tolerance: boolean;
|
|
141
|
+
upperbound_allowed_tolerance_value: number | null;
|
|
142
|
+
lowerbound_allowed_tolerance_value: number | null;
|
|
143
|
+
allowed_tolerance_unit: ITEM_TOLERANCE_TYPES | null;
|
|
134
144
|
last_updated_by_id: string;
|
|
135
145
|
is_editable: boolean;
|
|
136
146
|
is_enabled: boolean;
|
|
@@ -160,8 +170,9 @@ export interface IItem {
|
|
|
160
170
|
previous_purchase_vendor?: INestedCompanyVendors | null;
|
|
161
171
|
least_purchase_vendor?: INestedCompanyVendors | null;
|
|
162
172
|
dealing_company_vendors?: INestedCompanyVendors[] | null;
|
|
163
|
-
|
|
164
|
-
|
|
173
|
+
referenced_in_amended_po_items?: INestedAmendedPOItem[] | null;
|
|
174
|
+
used_in_po_asn_item_junction?: INestedPOASNItemJunction[] | null;
|
|
175
|
+
used_in_po_grn_item_junction?: INestedPOGRNItemJunction[] | null;
|
|
165
176
|
vendor_item_versions: INestedCompanyItemVendorVersion[] | null;
|
|
166
177
|
last_updated_by: INestedUser | null;
|
|
167
178
|
used_in_istd_items: INestedISTDItem[] | null;
|
|
@@ -174,7 +185,7 @@ export interface IItem {
|
|
|
174
185
|
cancelled_by_user: INestedUser | null;
|
|
175
186
|
used_in_ves_items: INestedVESItem[] | null;
|
|
176
187
|
}
|
|
177
|
-
export interface INestedItem extends Omit<IItem, "inventory_entries" | "created_by_user" | "sent_for_approval_by" | "item_category" | "item_subcategory" | "company" | "used_in_rfq_items" | "used_in_indent_items" | "used_in_mi_items" | "used_in_pr_items" | "used_in_quote_items" | "used_in_grn_items" | "used_in_mrn_items" | "used_in_bom_items" | "used_in_comparative_items" | "previous_purchase_vendor" | "least_purchase_vendor" | "dealing_company_vendors" | "used_in_po_asn_item_junction" | "used_in_po_grn_item_junction" | "vendor_item_versions" | "last_updated_by" | "used_in_istd_items" | "used_in_iads" | "used_in_inventory_logs" | "previous_purchase_po" | "least_purchase_po" | "parent_item_management_body" | "approval_chain" | "cancelled_by_user" | "used_in_ves_items"> {
|
|
188
|
+
export interface INestedItem extends Omit<IItem, "inventory_entries" | "created_by_user" | "sent_for_approval_by" | "item_category" | "item_subcategory" | "company" | "used_in_rfq_items" | "used_in_indent_items" | "used_in_mi_items" | "used_in_pr_items" | "used_in_quote_items" | "used_in_grn_items" | "used_in_mrn_items" | "used_in_bom_items" | "used_in_comparative_items" | "previous_purchase_vendor" | "least_purchase_vendor" | "dealing_company_vendors" | "used_in_po_asn_item_junction" | "used_in_po_grn_item_junction" | "vendor_item_versions" | "last_updated_by" | "used_in_istd_items" | "used_in_iads" | "used_in_inventory_logs" | "previous_purchase_po" | "least_purchase_po" | "parent_item_management_body" | "approval_chain" | "cancelled_by_user" | "used_in_ves_items" | "referenced_in_amended_po_items"> {
|
|
178
189
|
}
|
|
179
190
|
export declare const ITEM_CLASSIFICATION: {
|
|
180
191
|
DIRECT: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UOMS = exports.ITEM_TYPES = exports.ITEM_TAX_PREFERENCE = exports.ITEM_CLASSIFICATION = exports.ITEM_INCLUDE = exports.ITEM_STATUS = void 0;
|
|
3
|
+
exports.UOMS = exports.ITEM_TYPES = exports.ITEM_TAX_PREFERENCE = exports.ITEM_CLASSIFICATION = exports.ITEM_INCLUDE = exports.ITEM_TOLERANCE_TYPES = exports.ITEM_STATUS = void 0;
|
|
4
4
|
var ITEM_STATUS;
|
|
5
5
|
(function (ITEM_STATUS) {
|
|
6
6
|
ITEM_STATUS["PENDING_APPROVAL"] = "PENDING_APPROVAL";
|
|
@@ -8,6 +8,11 @@ var ITEM_STATUS;
|
|
|
8
8
|
ITEM_STATUS["CANCELLED"] = "CANCELLED";
|
|
9
9
|
ITEM_STATUS["REQUESTED"] = "REQUESTED";
|
|
10
10
|
})(ITEM_STATUS || (exports.ITEM_STATUS = ITEM_STATUS = {}));
|
|
11
|
+
var ITEM_TOLERANCE_TYPES;
|
|
12
|
+
(function (ITEM_TOLERANCE_TYPES) {
|
|
13
|
+
ITEM_TOLERANCE_TYPES["FIXED"] = "FIXED";
|
|
14
|
+
ITEM_TOLERANCE_TYPES["PERCENTAGE"] = "PERCENTAGE";
|
|
15
|
+
})(ITEM_TOLERANCE_TYPES || (exports.ITEM_TOLERANCE_TYPES = ITEM_TOLERANCE_TYPES = {}));
|
|
11
16
|
var ITEM_INCLUDE;
|
|
12
17
|
(function (ITEM_INCLUDE) {
|
|
13
18
|
ITEM_INCLUDE["item_category"] = "item_category";
|
|
@@ -43,6 +48,7 @@ var ITEM_INCLUDE;
|
|
|
43
48
|
ITEM_INCLUDE["used_in_po_grn_item_junction"] = "used_in_po_grn_item_junction";
|
|
44
49
|
ITEM_INCLUDE["cancelled_by_user"] = "cancelled_by_user";
|
|
45
50
|
ITEM_INCLUDE["used_in_ves_items"] = "used_in_ves_items";
|
|
51
|
+
ITEM_INCLUDE["referenced_in_amended_po_items"] = "referenced_in_amended_po_items";
|
|
46
52
|
})(ITEM_INCLUDE || (exports.ITEM_INCLUDE = ITEM_INCLUDE = {}));
|
|
47
53
|
exports.ITEM_CLASSIFICATION = {
|
|
48
54
|
DIRECT: "Direct",
|
|
@@ -3,12 +3,22 @@ import { INestedCompany } from "./company.typings";
|
|
|
3
3
|
import { INestedInventoryLog } from "./company/inventory/inventoryLogger.typings";
|
|
4
4
|
import { INestedISTD } from "./company/istd/istd.typings";
|
|
5
5
|
import { INestedISTDItem } from "./company/istd/istdItems.typings";
|
|
6
|
+
import { INestedPo } from "./company/masters/po.typings";
|
|
6
7
|
import { INestedDepartment } from "./department.typings";
|
|
7
8
|
import { INestedEntityApprovalChainEntry } from "./entityApprovalChainEntry.typings";
|
|
8
9
|
import { INestedGRN, INestedGRNItem } from "./grn.typings";
|
|
9
10
|
import { INestedItem } from "./item.typings";
|
|
10
11
|
import { INestedStoreLocation } from "./storeLocation.typings";
|
|
12
|
+
import { INestedSubPO } from "./subPO.typings";
|
|
11
13
|
import { INestedUser } from "./user.typings";
|
|
14
|
+
export declare enum MRN_DISPUTE_STATUS {
|
|
15
|
+
IN_DISPUTE = "IN_DISPUTE",
|
|
16
|
+
RESOLVED = "RESOLVED"
|
|
17
|
+
}
|
|
18
|
+
export declare enum DISPUTED_MRN_RESOLUTION_METHODS {
|
|
19
|
+
SUB_PO = "SUB_PO",
|
|
20
|
+
AMENDMENT_AND_SUB_PO = "AMENDMENT_AND_SUB_PO"
|
|
21
|
+
}
|
|
12
22
|
export declare enum MRN_LIST_TYPES {
|
|
13
23
|
ALL = "ALL",
|
|
14
24
|
CREATED_BY_ME = "CREATED_BY_ME",
|
|
@@ -44,7 +54,10 @@ export declare enum MRN_INCLUDE {
|
|
|
44
54
|
approval_chain = "approval_chain",
|
|
45
55
|
items = "items",
|
|
46
56
|
parent_istd = "parent_istd",
|
|
47
|
-
inventory_logs = "inventory_logs"
|
|
57
|
+
inventory_logs = "inventory_logs",
|
|
58
|
+
parent_po = "parent_po",
|
|
59
|
+
resolved_by_user = "resolved_by_user",
|
|
60
|
+
resolved_by_sub_po = "resolved_by_sub_po"
|
|
48
61
|
}
|
|
49
62
|
export declare enum MRN_STATUS {
|
|
50
63
|
DRAFT = "DRAFT",
|
|
@@ -72,6 +85,12 @@ export interface IMRN {
|
|
|
72
85
|
remark: string | null;
|
|
73
86
|
send_for_approval_at: string | null;
|
|
74
87
|
sent_for_approval_by_id: string | null;
|
|
88
|
+
resolved_by_sub_po_id: string | null;
|
|
89
|
+
parent_po_id: string | null;
|
|
90
|
+
has_disputes: boolean;
|
|
91
|
+
resolved_by_user_id: string | null;
|
|
92
|
+
dispute_status: MRN_DISPUTE_STATUS | null;
|
|
93
|
+
dispute_resolution_method: DISPUTED_MRN_RESOLUTION_METHODS | null;
|
|
75
94
|
is_deleted: boolean;
|
|
76
95
|
closed_at: string | null;
|
|
77
96
|
deleted_at: string | null;
|
|
@@ -87,15 +106,19 @@ export interface IMRN {
|
|
|
87
106
|
items: INestedMRNItem[] | null;
|
|
88
107
|
parent_istd: INestedISTD | null;
|
|
89
108
|
inventory_logs: INestedInventoryLog[] | null;
|
|
109
|
+
parent_po: INestedPo | null;
|
|
110
|
+
resolved_by_user: INestedUser | null;
|
|
90
111
|
metafields: IMRNMetafields | null;
|
|
112
|
+
resolved_by_sub_po: INestedSubPO[] | null;
|
|
91
113
|
}
|
|
92
|
-
export interface INestedMRN extends Omit<IMRN, "company" | "parent_grn" | "parent_department" | "parent_store_location" | "contact_person" | "sent_for_approval_by" | "approval_chain" | "items" | "parent_istd" | "inventory_logs" | "metafields"> {
|
|
114
|
+
export interface INestedMRN extends Omit<IMRN, "company" | "parent_grn" | "parent_department" | "parent_store_location" | "contact_person" | "sent_for_approval_by" | "approval_chain" | "items" | "parent_istd" | "inventory_logs" | "parent_po" | "resolved_by_user" | "resolved_by_sub_po_id" | "metafields"> {
|
|
93
115
|
}
|
|
94
116
|
export declare enum MRN_ITEM_INCLUDE {
|
|
95
117
|
parent_mrn = "parent_mrn",
|
|
96
118
|
company = "company",
|
|
97
119
|
item = "item",
|
|
98
|
-
parent_grn_item = "parent_grn_item"
|
|
120
|
+
parent_grn_item = "parent_grn_item",
|
|
121
|
+
parent_istd_item = "parent_istd_item"
|
|
99
122
|
}
|
|
100
123
|
export interface IMRNItem {
|
|
101
124
|
id: string;
|
|
@@ -105,8 +128,11 @@ export interface IMRNItem {
|
|
|
105
128
|
item_name: string;
|
|
106
129
|
code_sku: string;
|
|
107
130
|
uom: string;
|
|
131
|
+
/** @deprecated */
|
|
108
132
|
requested_quantity: number | null;
|
|
133
|
+
/** @deprecated */
|
|
109
134
|
delivered_quantity: number | null;
|
|
135
|
+
excess_quantity: number | null;
|
|
110
136
|
expected_quantity: number | null;
|
|
111
137
|
actual_quantity: number;
|
|
112
138
|
difference_remark: string | null;
|
|
@@ -133,3 +159,16 @@ export interface IMRNMetafields {
|
|
|
133
159
|
export declare enum MRN_METAFIELDS_INCLUDE {
|
|
134
160
|
items_data = "items_data"
|
|
135
161
|
}
|
|
162
|
+
export interface IMRNItemUpperboundData {
|
|
163
|
+
item_id: string;
|
|
164
|
+
max_qty_limit: number;
|
|
165
|
+
exceeded_qty: number;
|
|
166
|
+
}
|
|
167
|
+
export interface IMRNItemUpperboundResponse {
|
|
168
|
+
data: IMRNItemUpperboundData[];
|
|
169
|
+
}
|
|
170
|
+
export interface IResolveDisputedMRNInputs extends Pick<IMRNFilters, "include"> {
|
|
171
|
+
parent_po_id: string;
|
|
172
|
+
target_mrn_ids: string[];
|
|
173
|
+
resolution_method: DISPUTED_MRN_RESOLUTION_METHODS;
|
|
174
|
+
}
|
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MRN_METAFIELDS_INCLUDE = exports.MRN_ITEM_INCLUDE = exports.MRN_STATUS = exports.MRN_INCLUDE = exports.MRN_PARENT_DOC_TYPE = exports.MRN_TABS = exports.MRN_LIST_TYPES = void 0;
|
|
3
|
+
exports.MRN_METAFIELDS_INCLUDE = exports.MRN_ITEM_INCLUDE = exports.MRN_STATUS = exports.MRN_INCLUDE = exports.MRN_PARENT_DOC_TYPE = exports.MRN_TABS = exports.MRN_LIST_TYPES = exports.DISPUTED_MRN_RESOLUTION_METHODS = exports.MRN_DISPUTE_STATUS = void 0;
|
|
4
|
+
var MRN_DISPUTE_STATUS;
|
|
5
|
+
(function (MRN_DISPUTE_STATUS) {
|
|
6
|
+
MRN_DISPUTE_STATUS["IN_DISPUTE"] = "IN_DISPUTE";
|
|
7
|
+
MRN_DISPUTE_STATUS["RESOLVED"] = "RESOLVED";
|
|
8
|
+
})(MRN_DISPUTE_STATUS || (exports.MRN_DISPUTE_STATUS = MRN_DISPUTE_STATUS = {}));
|
|
9
|
+
var DISPUTED_MRN_RESOLUTION_METHODS;
|
|
10
|
+
(function (DISPUTED_MRN_RESOLUTION_METHODS) {
|
|
11
|
+
DISPUTED_MRN_RESOLUTION_METHODS["SUB_PO"] = "SUB_PO";
|
|
12
|
+
DISPUTED_MRN_RESOLUTION_METHODS["AMENDMENT_AND_SUB_PO"] = "AMENDMENT_AND_SUB_PO";
|
|
13
|
+
})(DISPUTED_MRN_RESOLUTION_METHODS || (exports.DISPUTED_MRN_RESOLUTION_METHODS = DISPUTED_MRN_RESOLUTION_METHODS = {}));
|
|
4
14
|
var MRN_LIST_TYPES;
|
|
5
15
|
(function (MRN_LIST_TYPES) {
|
|
6
16
|
MRN_LIST_TYPES["ALL"] = "ALL";
|
|
@@ -30,6 +40,9 @@ var MRN_INCLUDE;
|
|
|
30
40
|
MRN_INCLUDE["items"] = "items";
|
|
31
41
|
MRN_INCLUDE["parent_istd"] = "parent_istd";
|
|
32
42
|
MRN_INCLUDE["inventory_logs"] = "inventory_logs";
|
|
43
|
+
MRN_INCLUDE["parent_po"] = "parent_po";
|
|
44
|
+
MRN_INCLUDE["resolved_by_user"] = "resolved_by_user";
|
|
45
|
+
MRN_INCLUDE["resolved_by_sub_po"] = "resolved_by_sub_po";
|
|
33
46
|
})(MRN_INCLUDE || (exports.MRN_INCLUDE = MRN_INCLUDE = {}));
|
|
34
47
|
var MRN_STATUS;
|
|
35
48
|
(function (MRN_STATUS) {
|
|
@@ -48,6 +61,7 @@ var MRN_ITEM_INCLUDE;
|
|
|
48
61
|
MRN_ITEM_INCLUDE["company"] = "company";
|
|
49
62
|
MRN_ITEM_INCLUDE["item"] = "item";
|
|
50
63
|
MRN_ITEM_INCLUDE["parent_grn_item"] = "parent_grn_item";
|
|
64
|
+
MRN_ITEM_INCLUDE["parent_istd_item"] = "parent_istd_item";
|
|
51
65
|
})(MRN_ITEM_INCLUDE || (exports.MRN_ITEM_INCLUDE = MRN_ITEM_INCLUDE = {}));
|
|
52
66
|
var MRN_METAFIELDS_INCLUDE;
|
|
53
67
|
(function (MRN_METAFIELDS_INCLUDE) {
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { IPaginationFilters } from "./common/paginationFilters.typings";
|
|
2
|
+
import { INestedCompany } from "./company.typings";
|
|
3
|
+
import { INestedPo } from "./company/masters/po.typings";
|
|
4
|
+
import { INestedDocumentTaxes } from "./documentTaxes.typings";
|
|
5
|
+
import { INestedEntityApprovalChainEntry } from "./entityApprovalChainEntry.typings";
|
|
6
|
+
import { INestedMRN } from "./mrn.typings";
|
|
7
|
+
import { INestedSubPOItem } from "./subPOItem.typings";
|
|
8
|
+
import { INestedUser } from "./user.typings";
|
|
9
|
+
export declare enum SUB_PO_STATUS {
|
|
10
|
+
DRAFT = "DRAFT",
|
|
11
|
+
PENDING_APPROVAL = "PENDING_APPROVAL",
|
|
12
|
+
APPROVED = "APPROVED",
|
|
13
|
+
ACCEPTED_BY_VENDOR = "ACCEPTED_BY_VENDOR"
|
|
14
|
+
}
|
|
15
|
+
export declare enum SUB_PO_INCLUDES {
|
|
16
|
+
company = "company",
|
|
17
|
+
parent_po = "parent_po",
|
|
18
|
+
created_by_user = "created_by_user",
|
|
19
|
+
last_updated_by_user = "last_updated_by_user",
|
|
20
|
+
sent_for_approval_by_user = "sent_for_approval_by_user",
|
|
21
|
+
sent_to_vendor_by_user = "sent_to_vendor_by_user",
|
|
22
|
+
items = "items",
|
|
23
|
+
taxes = "taxes",
|
|
24
|
+
approval_chain = "approval_chain",
|
|
25
|
+
mrns_resolved = "mrns_resolved"
|
|
26
|
+
}
|
|
27
|
+
interface ISubPOFiltersBase {
|
|
28
|
+
name?: string;
|
|
29
|
+
parent_po_id?: string;
|
|
30
|
+
include?: SUB_PO_INCLUDES[];
|
|
31
|
+
}
|
|
32
|
+
export interface ISubPOFilters extends ISubPOFiltersBase {
|
|
33
|
+
child_mrn_ids?: string[];
|
|
34
|
+
}
|
|
35
|
+
export interface ISubPOFiltersWithPagination extends ISubPOFilters, IPaginationFilters {
|
|
36
|
+
}
|
|
37
|
+
export interface ISubPOFiltersForVendor extends ISubPOFiltersBase {
|
|
38
|
+
}
|
|
39
|
+
export interface ISubPOFiltersForVendorWithPagination extends ISubPOFiltersForVendor, IPaginationFilters {
|
|
40
|
+
}
|
|
41
|
+
export interface ISubPO {
|
|
42
|
+
id: string;
|
|
43
|
+
company_id: string;
|
|
44
|
+
parent_po_id: string;
|
|
45
|
+
sub_po_no: string;
|
|
46
|
+
total: number;
|
|
47
|
+
sub_total: number;
|
|
48
|
+
status: SUB_PO_STATUS;
|
|
49
|
+
parent_mrn_id: string;
|
|
50
|
+
created_by_user_id: string;
|
|
51
|
+
last_updated_by_user_id: string;
|
|
52
|
+
sent_for_approval_by_user_id: string | null;
|
|
53
|
+
sent_to_vendor_by_user_id: string | null;
|
|
54
|
+
approved_at: string | null;
|
|
55
|
+
sent_for_approval_at: string | null;
|
|
56
|
+
sent_to_vendor_by_user_at: string | null;
|
|
57
|
+
created_at: string;
|
|
58
|
+
updated_at: string;
|
|
59
|
+
company: INestedCompany | null;
|
|
60
|
+
parent_po: INestedPo | null;
|
|
61
|
+
created_by_user: INestedUser | null;
|
|
62
|
+
last_updated_by_user: INestedUser | null;
|
|
63
|
+
sent_for_approval_by_user: INestedUser | null;
|
|
64
|
+
sent_to_vendor_by_user: INestedUser | null;
|
|
65
|
+
items: INestedSubPOItem[] | null;
|
|
66
|
+
taxes: INestedDocumentTaxes[] | null;
|
|
67
|
+
approval_chain: INestedEntityApprovalChainEntry[] | null;
|
|
68
|
+
mrns_resolved: INestedMRN[] | null;
|
|
69
|
+
}
|
|
70
|
+
export interface INestedSubPO extends Omit<ISubPO, "company" | "parent_po" | "created_by_user" | "last_updated_by_user" | "sent_for_approval_by_user" | "sent_to_vendor_by_user" | "items" | "taxes" | "approval_chain" | "mrns_resolved"> {
|
|
71
|
+
}
|
|
72
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SUB_PO_INCLUDES = exports.SUB_PO_STATUS = void 0;
|
|
4
|
+
var SUB_PO_STATUS;
|
|
5
|
+
(function (SUB_PO_STATUS) {
|
|
6
|
+
SUB_PO_STATUS["DRAFT"] = "DRAFT";
|
|
7
|
+
SUB_PO_STATUS["PENDING_APPROVAL"] = "PENDING_APPROVAL";
|
|
8
|
+
SUB_PO_STATUS["APPROVED"] = "APPROVED";
|
|
9
|
+
SUB_PO_STATUS["ACCEPTED_BY_VENDOR"] = "ACCEPTED_BY_VENDOR";
|
|
10
|
+
})(SUB_PO_STATUS || (exports.SUB_PO_STATUS = SUB_PO_STATUS = {}));
|
|
11
|
+
var SUB_PO_INCLUDES;
|
|
12
|
+
(function (SUB_PO_INCLUDES) {
|
|
13
|
+
SUB_PO_INCLUDES["company"] = "company";
|
|
14
|
+
SUB_PO_INCLUDES["parent_po"] = "parent_po";
|
|
15
|
+
SUB_PO_INCLUDES["created_by_user"] = "created_by_user";
|
|
16
|
+
SUB_PO_INCLUDES["last_updated_by_user"] = "last_updated_by_user";
|
|
17
|
+
SUB_PO_INCLUDES["sent_for_approval_by_user"] = "sent_for_approval_by_user";
|
|
18
|
+
SUB_PO_INCLUDES["sent_to_vendor_by_user"] = "sent_to_vendor_by_user";
|
|
19
|
+
SUB_PO_INCLUDES["items"] = "items";
|
|
20
|
+
SUB_PO_INCLUDES["taxes"] = "taxes";
|
|
21
|
+
SUB_PO_INCLUDES["approval_chain"] = "approval_chain";
|
|
22
|
+
SUB_PO_INCLUDES["mrns_resolved"] = "mrns_resolved";
|
|
23
|
+
})(SUB_PO_INCLUDES || (exports.SUB_PO_INCLUDES = SUB_PO_INCLUDES = {}));
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { INestedCompany } from "./company.typings";
|
|
2
|
+
import { INestedItem } from "./item.typings";
|
|
3
|
+
import { INestedSubPO } from "./subPO.typings";
|
|
4
|
+
import { INestedUser } from "./user.typings";
|
|
5
|
+
export declare enum SUB_PO_ITEM_INCLUDES {
|
|
6
|
+
company = "company",
|
|
7
|
+
item = "item",
|
|
8
|
+
parent_sub_po = "parent_sub_po",
|
|
9
|
+
created_by_user = "created_by_user",
|
|
10
|
+
last_updated_by_user = "last_updated_by_user",
|
|
11
|
+
marked_as_deleted_by_user = "marked_as_deleted_by_user"
|
|
12
|
+
}
|
|
13
|
+
export interface ISubPOItem {
|
|
14
|
+
id: string;
|
|
15
|
+
company_id: string;
|
|
16
|
+
item_id: string;
|
|
17
|
+
parent_sub_po_id: string;
|
|
18
|
+
created_by_user_id: string;
|
|
19
|
+
last_updated_by_user_id: string;
|
|
20
|
+
marked_as_deleted_by_user_id: string | null;
|
|
21
|
+
quantity: number;
|
|
22
|
+
is_deleted: boolean;
|
|
23
|
+
deleted_at: string | null;
|
|
24
|
+
created_at: string;
|
|
25
|
+
updated_at: string;
|
|
26
|
+
company: INestedCompany | null;
|
|
27
|
+
item: INestedItem | null;
|
|
28
|
+
parent_sub_po: INestedSubPO | null;
|
|
29
|
+
created_by_user: INestedUser | null;
|
|
30
|
+
last_updated_by_user: INestedUser | null;
|
|
31
|
+
marked_as_deleted_by_user: INestedUser | null;
|
|
32
|
+
}
|
|
33
|
+
export interface INestedSubPOItem extends Omit<ISubPOItem, "company" | "item" | "parent_sub_po" | "created_by_user" | "last_updated_by_user" | "marked_as_deleted_by_user"> {
|
|
34
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SUB_PO_ITEM_INCLUDES = void 0;
|
|
4
|
+
var SUB_PO_ITEM_INCLUDES;
|
|
5
|
+
(function (SUB_PO_ITEM_INCLUDES) {
|
|
6
|
+
SUB_PO_ITEM_INCLUDES["company"] = "company";
|
|
7
|
+
SUB_PO_ITEM_INCLUDES["item"] = "item";
|
|
8
|
+
SUB_PO_ITEM_INCLUDES["parent_sub_po"] = "parent_sub_po";
|
|
9
|
+
SUB_PO_ITEM_INCLUDES["created_by_user"] = "created_by_user";
|
|
10
|
+
SUB_PO_ITEM_INCLUDES["last_updated_by_user"] = "last_updated_by_user";
|
|
11
|
+
SUB_PO_ITEM_INCLUDES["marked_as_deleted_by_user"] = "marked_as_deleted_by_user";
|
|
12
|
+
})(SUB_PO_ITEM_INCLUDES || (exports.SUB_PO_ITEM_INCLUDES = SUB_PO_ITEM_INCLUDES = {}));
|
|
@@ -46,6 +46,9 @@ import { INestedVES } from "./company/masters/ves.typings";
|
|
|
46
46
|
import { INestedVESCheckpointTracking } from "./company/_junctions/vesCheckpointTracking.typings";
|
|
47
47
|
import { INestedQueueJob } from "./system/queueJob.typings";
|
|
48
48
|
import { INestedTemporaryWorkerForm } from "./temporaryWorkerForm.typings";
|
|
49
|
+
import { INestedAmendedPOItem } from "./company/masters/amendedPOItems.typings";
|
|
50
|
+
import { INestedSubPOItem } from "./subPOItem.typings";
|
|
51
|
+
import { INestedSubPO } from "./subPO.typings";
|
|
49
52
|
export interface IUser {
|
|
50
53
|
id: string;
|
|
51
54
|
is_enabled?: boolean | null;
|
|
@@ -187,11 +190,22 @@ export interface IUser {
|
|
|
187
190
|
ves_cancelled_by_user: INestedVES[] | null;
|
|
188
191
|
time_records_at_checkpoint: INestedVESCheckpointTracking[] | null;
|
|
189
192
|
created_queue_jobs: INestedQueueJob[] | null;
|
|
193
|
+
pos_closed_early: INestedPo[] | null;
|
|
190
194
|
last_updated_payment_terms: INestedUser | null;
|
|
191
195
|
created_temporary_worker_form: INestedTemporaryWorkerForm[] | null;
|
|
192
196
|
last_updated_temporary_worker_form: INestedTemporaryWorkerForm[] | null;
|
|
197
|
+
resolved_mrns: INestedMRN[] | null;
|
|
198
|
+
created_amended_po_items: INestedAmendedPOItem[] | null;
|
|
199
|
+
last_updated_amended_po_items: INestedAmendedPOItem[] | null;
|
|
200
|
+
created_sub_pos: INestedSubPO[] | null;
|
|
201
|
+
last_updated_sub_pos: INestedSubPO[] | null;
|
|
202
|
+
sent_for_approval_sub_pos: INestedSubPO[] | null;
|
|
203
|
+
sent_to_vendor_sub_pos: INestedSubPO[] | null;
|
|
204
|
+
created_sub_po_items: INestedSubPOItem[] | null;
|
|
205
|
+
last_udpated_sub_po_items: INestedSubPOItem[] | null;
|
|
206
|
+
marked_as_deleted_sub_po_items: INestedSubPOItem[] | null;
|
|
193
207
|
}
|
|
194
|
-
export interface INestedUser extends Omit<IUser, "updated_at" | "created_at" | "deleted_at" | "reporting_to" | "active_company" | "active_role" | "subordinates" | "otps" | "as_incharge_in_purchase_locations" | "as_incharge_in_store_locations" | "as_incharge_in_offices" | "as_incharge_in_gates" | "as_contact_person_companies" | "as_contact_person_offices" | "as_contact_person_gates" | "owned_companies" | "head_for_departments" | "created_item_subcategories" | "last_updated_item_subcategories" | "head_for_departments" | "approval_chains" | "indents_created_for_user" | "created_mis" | "mis_issued_for_user" | "mis_sent_for_approval" | "mis_issued" | "mis_last_updated" | "created_prs" | "pr_sent_for_approval" | "pr_sent_to_purchase_location" | "last_updated_prs" | "created_rfqs" | "entity_approval_chains" | "as_contact_person_for_rfqs" | "as_contact_person_for_quotes" | "rfqs_sent_for_approval" | "rfqs_sent_to_vendors" | "created_rfq_items" | "negotiations" | "created_pos" | "last_updated_pos" | "as_contact_person_for_pos" | "pos_sent_for_approval" | "pos_sent_to_vendors" | "created_grns" | "last_updated_grns" | "as_contact_person_for_grns" | "grns_sent_for_approval" | "grns_sent_to_store" | "mrns_sent_for_approval" | "as_contact_person_for_mrns" | "created_boms" | "last_updated_boms" | "created_vendor_groups" | "last_updated_vendor_groups" | "comparatives_sent_for_approval" | "user_notifications" | "created_extra_quesstions" | "updated_extra_quesstions" | "answered_questions" | "created_extra_core_question_for_companies" | "updated_extra_core_question_for_companies" | "cancelled_asns" | "created_contact_people" | "updated_contact_people" | "last_updated_company_item_vendor_version" | "items_last_updated_by_user" | "company_vendors_last_updated_by_user" | "created_istds" | "last_updated_istds" | "source_contact_person_for_istd" | "dest_contact_person_for_istd" | "istds_sent_for_source_approval" | "istds_sent_for_dest_approval" | "istds_sent_for_dest_store" | "istds_marked_as_processed" | "istds_terminated" | "created_payment_terms" | "created_iads" | "user_last_updated_iads" | "as_approver_for_iads" | "iads_terminated_by_user" | "finalised_iads" | "assigned_roles" | "initiated_inventory_logs" | "logs" | "vendor_onboarding_requests_created_by_user" | "vendor_onboarding_requests_last_updated" | "vendor_onboarding_requests_sent_for_approval" | "invitation_sent_for_vendor_onboarding_requests" | "created_vendor_management_bodies" | "last_updated_vendor_management_bodies" | "head_of_vendor_management_bodies" | "cancelled_vendor_onboarding_requests" | "company_vendor_created_by_user" | "company_vendors_last_updated_by_user" | "sent_for_approval_company_vendors" | "sent_questions_to_company_vendors" | "cancelled_company_vendors" | "created_vendor_onboarding_request_categories" | "last_updated_vendor_onboarding_request_categories" | "created_item_management_bodies" | "last_updated_item_management_bodies" | "as_head_of_item_management_bodies" | "created_items" | "items_sent_for_approval" | "cancelled_items" | "invoices_marked_as_paid_or_rejected" | "onboarded_company_vendors" | "created_indents" | "rollback_forms_by_user" | "asns_sent_to_vendor_by_user" | "created_terms_and_conditions" | "last_updated_terms_and_conditions" | "checkpoints_created_by_user" | "checkpoints_last_updated_by_user" | "ves_created_by_user" | "ves_last_updated_by_user" | "ves_cancelled_by_user" | "take_on_approval_for_ves" | "time_records_at_checkpoint" | "created_queue_jobs" | "last_updated_payment_terms" | "created_temporary_worker_form" | "last_updated_temporary_worker_form"> {
|
|
208
|
+
export interface INestedUser extends Omit<IUser, "updated_at" | "created_at" | "deleted_at" | "reporting_to" | "active_company" | "active_role" | "subordinates" | "otps" | "as_incharge_in_purchase_locations" | "as_incharge_in_store_locations" | "as_incharge_in_offices" | "as_incharge_in_gates" | "as_contact_person_companies" | "as_contact_person_offices" | "as_contact_person_gates" | "owned_companies" | "head_for_departments" | "created_item_subcategories" | "last_updated_item_subcategories" | "head_for_departments" | "approval_chains" | "indents_created_for_user" | "created_mis" | "mis_issued_for_user" | "mis_sent_for_approval" | "mis_issued" | "mis_last_updated" | "created_prs" | "pr_sent_for_approval" | "pr_sent_to_purchase_location" | "last_updated_prs" | "created_rfqs" | "entity_approval_chains" | "as_contact_person_for_rfqs" | "as_contact_person_for_quotes" | "rfqs_sent_for_approval" | "rfqs_sent_to_vendors" | "created_rfq_items" | "negotiations" | "created_pos" | "last_updated_pos" | "as_contact_person_for_pos" | "pos_sent_for_approval" | "pos_sent_to_vendors" | "created_grns" | "last_updated_grns" | "as_contact_person_for_grns" | "grns_sent_for_approval" | "grns_sent_to_store" | "mrns_sent_for_approval" | "as_contact_person_for_mrns" | "created_boms" | "last_updated_boms" | "created_vendor_groups" | "last_updated_vendor_groups" | "comparatives_sent_for_approval" | "user_notifications" | "created_extra_quesstions" | "updated_extra_quesstions" | "answered_questions" | "created_extra_core_question_for_companies" | "updated_extra_core_question_for_companies" | "cancelled_asns" | "created_contact_people" | "updated_contact_people" | "last_updated_company_item_vendor_version" | "items_last_updated_by_user" | "company_vendors_last_updated_by_user" | "created_istds" | "last_updated_istds" | "source_contact_person_for_istd" | "dest_contact_person_for_istd" | "istds_sent_for_source_approval" | "istds_sent_for_dest_approval" | "istds_sent_for_dest_store" | "istds_marked_as_processed" | "istds_terminated" | "created_payment_terms" | "created_iads" | "user_last_updated_iads" | "as_approver_for_iads" | "iads_terminated_by_user" | "finalised_iads" | "assigned_roles" | "initiated_inventory_logs" | "logs" | "vendor_onboarding_requests_created_by_user" | "vendor_onboarding_requests_last_updated" | "vendor_onboarding_requests_sent_for_approval" | "invitation_sent_for_vendor_onboarding_requests" | "created_vendor_management_bodies" | "last_updated_vendor_management_bodies" | "head_of_vendor_management_bodies" | "cancelled_vendor_onboarding_requests" | "company_vendor_created_by_user" | "company_vendors_last_updated_by_user" | "sent_for_approval_company_vendors" | "sent_questions_to_company_vendors" | "cancelled_company_vendors" | "created_vendor_onboarding_request_categories" | "last_updated_vendor_onboarding_request_categories" | "created_item_management_bodies" | "last_updated_item_management_bodies" | "as_head_of_item_management_bodies" | "created_items" | "items_sent_for_approval" | "cancelled_items" | "invoices_marked_as_paid_or_rejected" | "onboarded_company_vendors" | "created_indents" | "rollback_forms_by_user" | "asns_sent_to_vendor_by_user" | "created_terms_and_conditions" | "last_updated_terms_and_conditions" | "checkpoints_created_by_user" | "checkpoints_last_updated_by_user" | "pos_closed_early" | "ves_created_by_user" | "ves_last_updated_by_user" | "ves_cancelled_by_user" | "take_on_approval_for_ves" | "time_records_at_checkpoint" | "created_queue_jobs" | "last_updated_payment_terms" | "created_temporary_worker_form" | "last_updated_temporary_worker_form" | "resolved_mrns" | "created_amended_po_items" | "last_updated_amended_po_items" | "created_sub_pos" | "last_updated_sub_pos" | "sent_for_approval_sub_pos" | "sent_to_vendor_sub_pos" | "created_sub_po_items" | "last_udpated_sub_po_items" | "marked_as_deleted_sub_po_items"> {
|
|
195
209
|
}
|
|
196
210
|
export declare enum UserInclude {
|
|
197
211
|
subordinates = "subordinates",
|
|
@@ -313,7 +327,18 @@ export declare enum UserInclude {
|
|
|
313
327
|
last_updated_payment_terms = "last_updated_payment_terms",
|
|
314
328
|
created_temporary_worker_form = "created_temporary_worker_form",
|
|
315
329
|
last_updated_temporary_worker_form = "last_updated_temporary_worker_form",
|
|
316
|
-
reporting_to = "reporting_to"
|
|
330
|
+
reporting_to = "reporting_to",
|
|
331
|
+
pos_closed_early = "pos_closed_early",
|
|
332
|
+
resolved_mrns = "resolved_mrns",
|
|
333
|
+
created_amended_po_items = "created_amended_po_items",
|
|
334
|
+
last_updated_amended_po_items = "last_updated_amended_po_items",
|
|
335
|
+
created_sub_pos = "created_sub_pos",
|
|
336
|
+
last_updated_sub_pos = "last_updated_sub_pos",
|
|
337
|
+
sent_for_approval_sub_pos = "sent_for_approval_sub_pos",
|
|
338
|
+
sent_to_vendor_sub_pos = "sent_to_vendor_sub_pos",
|
|
339
|
+
created_sub_po_items = "created_sub_po_items",
|
|
340
|
+
last_udpated_sub_po_items = "last_udpated_sub_po_items",
|
|
341
|
+
marked_as_deleted_sub_po_items = "marked_as_deleted_sub_po_items"
|
|
317
342
|
}
|
|
318
343
|
export interface IUserFilters {
|
|
319
344
|
name?: string | null;
|
|
@@ -125,4 +125,15 @@ var UserInclude;
|
|
|
125
125
|
UserInclude["created_temporary_worker_form"] = "created_temporary_worker_form";
|
|
126
126
|
UserInclude["last_updated_temporary_worker_form"] = "last_updated_temporary_worker_form";
|
|
127
127
|
UserInclude["reporting_to"] = "reporting_to";
|
|
128
|
+
UserInclude["pos_closed_early"] = "pos_closed_early";
|
|
129
|
+
UserInclude["resolved_mrns"] = "resolved_mrns";
|
|
130
|
+
UserInclude["created_amended_po_items"] = "created_amended_po_items";
|
|
131
|
+
UserInclude["last_updated_amended_po_items"] = "last_updated_amended_po_items";
|
|
132
|
+
UserInclude["created_sub_pos"] = "created_sub_pos";
|
|
133
|
+
UserInclude["last_updated_sub_pos"] = "last_updated_sub_pos";
|
|
134
|
+
UserInclude["sent_for_approval_sub_pos"] = "sent_for_approval_sub_pos";
|
|
135
|
+
UserInclude["sent_to_vendor_sub_pos"] = "sent_to_vendor_sub_pos";
|
|
136
|
+
UserInclude["created_sub_po_items"] = "created_sub_po_items";
|
|
137
|
+
UserInclude["last_udpated_sub_po_items"] = "last_udpated_sub_po_items";
|
|
138
|
+
UserInclude["marked_as_deleted_sub_po_items"] = "marked_as_deleted_sub_po_items";
|
|
128
139
|
})(UserInclude || (exports.UserInclude = UserInclude = {}));
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IItem } from "../typings/item.typings";
|
|
2
|
+
interface IArgs extends Pick<IItem, "allow_tolerance" | "allowed_tolerance_unit" | "lowerbound_allowed_tolerance_value" | "upperbound_allowed_tolerance_value"> {
|
|
3
|
+
total_quantity_in_po: number;
|
|
4
|
+
}
|
|
5
|
+
export declare function calculateToleranceRange({ allow_tolerance, allowed_tolerance_unit, lowerbound_allowed_tolerance_value, upperbound_allowed_tolerance_value, total_quantity_in_po, }: IArgs): {
|
|
6
|
+
upper_bound: number;
|
|
7
|
+
lower_bound: number;
|
|
8
|
+
upper_buffer: number;
|
|
9
|
+
lower_buffer: number;
|
|
10
|
+
};
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.calculateToleranceRange = calculateToleranceRange;
|
|
4
|
+
const item_typings_1 = require("../typings/item.typings");
|
|
5
|
+
function calculateToleranceRange({ allow_tolerance, allowed_tolerance_unit, lowerbound_allowed_tolerance_value, upperbound_allowed_tolerance_value, total_quantity_in_po, }) {
|
|
6
|
+
if (!allow_tolerance || !allowed_tolerance_unit)
|
|
7
|
+
return {
|
|
8
|
+
upper_bound: total_quantity_in_po,
|
|
9
|
+
upper_buffer: total_quantity_in_po,
|
|
10
|
+
lower_bound: total_quantity_in_po,
|
|
11
|
+
lower_buffer: total_quantity_in_po,
|
|
12
|
+
};
|
|
13
|
+
if (lowerbound_allowed_tolerance_value === null)
|
|
14
|
+
throw new Error(`lowerbound_allowed_tolerance_value is required when calculating lowerbound of allowed tolerance range`);
|
|
15
|
+
if (upperbound_allowed_tolerance_value === null)
|
|
16
|
+
throw new Error(`upperbound_allowed_tolerance_value is required when calculating upperbound of allowed tolerance range`);
|
|
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`);
|
|
20
|
+
return {
|
|
21
|
+
upper_bound: total_quantity_in_po + upperbound_allowed_tolerance_value,
|
|
22
|
+
lower_bound: total_quantity_in_po - lowerbound_allowed_tolerance_value,
|
|
23
|
+
upper_buffer: upperbound_allowed_tolerance_value,
|
|
24
|
+
lower_buffer: lowerbound_allowed_tolerance_value,
|
|
25
|
+
};
|
|
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);
|
|
29
|
+
return {
|
|
30
|
+
upper_bound: total_quantity_in_po + calculatedUpperboundBuffer,
|
|
31
|
+
lower_bound: total_quantity_in_po - calculatedLowerboundBuffer,
|
|
32
|
+
upper_buffer: calculatedUpperboundBuffer,
|
|
33
|
+
lower_buffer: calculatedLowerboundBuffer,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CONTACT_PERSON_TYPE, IContactPeople } from "../typings/contactPeople.typings";
|
|
2
|
-
import {
|
|
2
|
+
import { INestedUser } from "../typings/user.typings";
|
|
3
3
|
export interface IContactPersonDetails {
|
|
4
4
|
id?: string | null;
|
|
5
5
|
name?: string | null;
|
|
@@ -7,10 +7,10 @@ export interface IContactPersonDetails {
|
|
|
7
7
|
contact?: string | null;
|
|
8
8
|
email?: string | null;
|
|
9
9
|
}
|
|
10
|
-
interface
|
|
11
|
-
company_user?:
|
|
10
|
+
interface IArgs {
|
|
11
|
+
company_user?: INestedUser | null;
|
|
12
12
|
contact_person?: IContactPeople | null;
|
|
13
13
|
contact_person_type: CONTACT_PERSON_TYPE;
|
|
14
14
|
}
|
|
15
|
-
export declare function getContactPerson({ contact_person_type, company_user, contact_person, }:
|
|
15
|
+
export declare function getContactPerson({ contact_person_type, company_user, contact_person, }: IArgs): IContactPersonDetails | null;
|
|
16
16
|
export {};
|