kcommons 9.14.2 → 9.15.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.
@@ -1,5 +1,8 @@
1
1
  import { IASNItem } from "../typings/asn.typings";
2
2
  import { INestedGRNItem } from "../typings/grn.typings";
3
+ import { INestedPOItem } from "../typings/po.typings";
4
+ import { IPOASNItemJunction } from "../typings/poAsnJunctionItems.typings";
5
+ import { IVendor } from "../typings/vendor.typings";
3
6
  export declare class ASNItemWrapper implements IASNItem {
4
7
  constructor(partial: IASNItem);
5
8
  po_asn_item_junction_id: string;
@@ -28,3 +31,4 @@ export declare class ASNItemWrapper implements IASNItem {
28
31
  parent_asn: null;
29
32
  vendor: null;
30
33
  }
34
+ export declare function convertPOItemToASNItem(poItem: INestedPOItem, vendor?: IVendor | null, poASNItemJunctions?: IPOASNItemJunction[] | null): IASNItem;
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ASNItemWrapper = void 0;
4
+ exports.convertPOItemToASNItem = convertPOItemToASNItem;
5
+ const uuid_1 = require("uuid");
4
6
  class ASNItemWrapper {
5
7
  constructor(partial) {
6
8
  this.po_asn_item_junction_id = "";
@@ -32,3 +34,32 @@ class ASNItemWrapper {
32
34
  }
33
35
  }
34
36
  exports.ASNItemWrapper = ASNItemWrapper;
37
+ function convertPOItemToASNItem(poItem, vendor, poASNItemJunctions = []) {
38
+ var _a, _b;
39
+ return new ASNItemWrapper({
40
+ id: (0, uuid_1.v4)(),
41
+ parent_asn_id: "",
42
+ dispatched_quantity: ((_a = poASNItemJunctions === null || poASNItemJunctions === void 0 ? void 0 : poASNItemJunctions.find((ele) => ele.item_id === (poItem === null || poItem === void 0 ? void 0 : poItem.item_id))) === null || _a === void 0 ? void 0 : _a.pending_quantity) || 0,
43
+ delivered_quantity: 0,
44
+ vendor_id: (vendor === null || vendor === void 0 ? void 0 : vendor.id) || "",
45
+ // po_item_id: item.id,
46
+ is_deleted: false,
47
+ deleted_at: null,
48
+ created_at: "",
49
+ updated_at: "",
50
+ company_id: (poItem === null || poItem === void 0 ? void 0 : poItem.company_id) || "",
51
+ item_description: (poItem === null || poItem === void 0 ? void 0 : poItem.item_description) || null,
52
+ code_sku: (poItem === null || poItem === void 0 ? void 0 : poItem.code_sku) || "",
53
+ item_id: poItem.item_id,
54
+ item_name: (poItem === null || poItem === void 0 ? void 0 : poItem.item_name) || "",
55
+ uom: (poItem === null || poItem === void 0 ? void 0 : poItem.uom) || "",
56
+ po_asn_item_junction_id: (_b = poASNItemJunctions === null || poASNItemJunctions === void 0 ? void 0 : poASNItemJunctions.find((ele) => ele.item_id === poItem.item_id)) === null || _b === void 0 ? void 0 : _b.id,
57
+ item: null,
58
+ company: null,
59
+ parent_asn: null,
60
+ // parent_po_item: null,
61
+ po_asn_item_junction: null,
62
+ vendor: null,
63
+ used_in_grn_items: null,
64
+ });
65
+ }
@@ -1,4 +1,6 @@
1
1
  import { COMPANY_VENDOR_LIST_TABS } from "../typings/companyVendors.typings";
2
+ import { MI_SOURCE } from "../typings/mi.typings";
3
+ import { PR_SOURCE } from "../typings/pr.typings";
2
4
  export declare enum COMPANY_ROUTE_IDS {
3
5
  MAIN_DSHBRD = "MAIN_DSHBRD",
4
6
  LGN = "LGN",
@@ -358,7 +360,7 @@ export declare const companyNavConfig: {
358
360
  id: COMPANY_ROUTE_IDS;
359
361
  };
360
362
  add: {
361
- route: string;
363
+ route: (source: MI_SOURCE) => string;
362
364
  id: COMPANY_ROUTE_IDS;
363
365
  };
364
366
  edit: {
@@ -376,7 +378,7 @@ export declare const companyNavConfig: {
376
378
  id: COMPANY_ROUTE_IDS;
377
379
  };
378
380
  add: {
379
- route: string;
381
+ route: (source: PR_SOURCE) => string;
380
382
  id: COMPANY_ROUTE_IDS;
381
383
  };
382
384
  edit: {
@@ -361,7 +361,7 @@ exports.companyNavConfig = {
361
361
  id: COMPANY_ROUTE_IDS.MI_LST,
362
362
  },
363
363
  add: {
364
- route: `/store/material-issuance/add?route_id=${COMPANY_ROUTE_IDS.MI_ADD}`,
364
+ route: (source) => `/store/material-issuance/add?route_id=${COMPANY_ROUTE_IDS.MI_ADD}&source=${source}`,
365
365
  id: COMPANY_ROUTE_IDS.MI_ADD,
366
366
  },
367
367
  edit: {
@@ -379,7 +379,7 @@ exports.companyNavConfig = {
379
379
  id: COMPANY_ROUTE_IDS.PR_LST,
380
380
  },
381
381
  add: {
382
- route: `/store/pr/add?route_id=${COMPANY_ROUTE_IDS.PR_ADD}`,
382
+ route: (source) => `/store/pr/add?route_id=${COMPANY_ROUTE_IDS.PR_ADD}&source=${source}`,
383
383
  id: COMPANY_ROUTE_IDS.PR_ADD,
384
384
  },
385
385
  edit: {
package/build/index.d.ts CHANGED
@@ -70,8 +70,6 @@ export * from "./utils/getContactPerson.util";
70
70
  export * from "./utils/quote.util";
71
71
  export * from "./utils/getCompanyQuestionFormLinktoken.util";
72
72
  export * from "./utils/getMediaName.util";
73
- export * from "./templates/notifications/rfq.notifications";
74
- export * from "./templates/notifications/quote.notifications";
75
73
  export * from "./typings/verification_apis/pincode.typings";
76
74
  export * from "./typings/verification_apis/gstVerification.typings";
77
75
  export * from "./typings/kpis/company/companyKpisCommons.typings";
package/build/index.js CHANGED
@@ -91,8 +91,6 @@ __exportStar(require("./utils/quote.util"), exports);
91
91
  __exportStar(require("./utils/getCompanyQuestionFormLinktoken.util"), exports);
92
92
  __exportStar(require("./utils/getMediaName.util"), exports);
93
93
  // Templates
94
- __exportStar(require("./templates/notifications/rfq.notifications"), exports);
95
- __exportStar(require("./templates/notifications/quote.notifications"), exports);
96
94
  // Verification APIs
97
95
  __exportStar(require("./typings/verification_apis/pincode.typings"), exports);
98
96
  __exportStar(require("./typings/verification_apis/gstVerification.typings"), exports);
@@ -45,6 +45,7 @@ export interface IASN {
45
45
  cancelled_by_user_id: string | null;
46
46
  remarks: string | null;
47
47
  eway_bill: string | null;
48
+ carrier_name: string | null;
48
49
  mode_of_transport: string | null;
49
50
  tracking_no: string | null;
50
51
  vehicle_no: string | null;
@@ -7,6 +7,10 @@ import { INestedIndent, INestedIndentItem } from "./indent.typings";
7
7
  import { INestedItem } from "./item.typings";
8
8
  import { INestedStoreLocation } from "./storeLocation.typings";
9
9
  import { INestedUser } from "./user.typings";
10
+ export declare enum MI_SOURCE {
11
+ DIRECT = "DIRECT",
12
+ INDENT = "INDENT"
13
+ }
10
14
  export interface IMI {
11
15
  id: string;
12
16
  mi_no: string;
@@ -1,6 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MI_ITEM_INCLUDE = exports.MI_INCLUDE = exports.MI_STATUS = void 0;
3
+ exports.MI_ITEM_INCLUDE = exports.MI_INCLUDE = exports.MI_STATUS = exports.MI_SOURCE = void 0;
4
+ var MI_SOURCE;
5
+ (function (MI_SOURCE) {
6
+ MI_SOURCE["DIRECT"] = "DIRECT";
7
+ MI_SOURCE["INDENT"] = "INDENT";
8
+ })(MI_SOURCE || (exports.MI_SOURCE = MI_SOURCE = {}));
4
9
  var MI_STATUS;
5
10
  (function (MI_STATUS) {
6
11
  MI_STATUS["DRAFT"] = "DRAFT";
@@ -7,6 +7,10 @@ import { INestedItem } from "./item.typings";
7
7
  import { INestedPurchaseLocation } from "./purchaseLocation.typings";
8
8
  import { INestedRFQItem } from "./rfq.typings";
9
9
  import { INestedUser } from "./user.typings";
10
+ export declare enum PR_SOURCE {
11
+ DIRECT = "DIRECT",
12
+ INDENT = "INDENT"
13
+ }
10
14
  export declare enum PR_STATUS {
11
15
  DRAFT = "DRAFT",
12
16
  PENDING_APPROVAL = "PENDING APPROVAL",
@@ -1,6 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PR_PRIORITY_TYPES = exports.PR_ITEM_INCLUDE = exports.PR_INCLUDE = exports.PR_STATUS = void 0;
3
+ exports.PR_PRIORITY_TYPES = exports.PR_ITEM_INCLUDE = exports.PR_INCLUDE = exports.PR_STATUS = exports.PR_SOURCE = void 0;
4
+ var PR_SOURCE;
5
+ (function (PR_SOURCE) {
6
+ PR_SOURCE["DIRECT"] = "DIRECT";
7
+ PR_SOURCE["INDENT"] = "INDENT";
8
+ })(PR_SOURCE || (exports.PR_SOURCE = PR_SOURCE = {}));
4
9
  var PR_STATUS;
5
10
  (function (PR_STATUS) {
6
11
  PR_STATUS["DRAFT"] = "DRAFT";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kcommons",
3
- "version": "9.14.2",
3
+ "version": "9.15.1",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",
@@ -11,5 +11,8 @@
11
11
  "test": "echo \"Error: no test specified\""
12
12
  },
13
13
  "author": "",
14
- "license": "ISC"
14
+ "license": "ISC",
15
+ "dependencies": {
16
+ "uuid": "^11.1.0"
17
+ }
15
18
  }