kcommons 18.5.2 → 18.6.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.
@@ -112,7 +112,7 @@ export interface IVendorOnboardingRequest {
112
112
  extra_form_answers: INestedExtraFormAnswer[] | null;
113
113
  child_company_vendors: INestedCompanyVendors[] | null;
114
114
  scores: INestedVendorOnboardingRequestScore[] | null;
115
- metafields?: IVendorOnboardingRequestMetafields[] | null;
115
+ metafields?: IVendorOnboardingRequestMetafields | null;
116
116
  }
117
117
  export interface INestedVendorOnboardingRequest extends Omit<IVendorOnboardingRequest, "company" | "created_by_user" | "last_updated_by_user" | "sent_for_approval_by_user" | "invitation_sent_by_user" | "approval_chain" | "parent_department" | "parent_vendor_management_body" | "extra_form_answers" | "cancelled_by_user" | "child_company_vendors" | "scores" | "vendor_onboarding_request_category" | "metafields"> {
118
118
  }
@@ -4,7 +4,8 @@ import { INestedRole } from "../roles.typings";
4
4
  import { INestedUser } from "../user.typings";
5
5
  import { INestedVendor } from "../vendor.typings";
6
6
  export declare enum QUEUE_JOB_TYPES {
7
- PO_EXCEL_UPLOAD = "PO_EXCEL_UPLOAD"
7
+ PO_EXCEL_UPLOAD = "PO_EXCEL_UPLOAD",
8
+ FETCH_PO_FROM_ERP = "FETCH_PO_FROM_ERP"
8
9
  }
9
10
  export declare enum QUEUE_JOB_STATUS {
10
11
  waiting = "waiting",
@@ -39,6 +40,7 @@ export interface IQueueJob {
39
40
  reasons_for_failure: string | null;
40
41
  excel_upload_path: string | null;
41
42
  notes: string | null;
43
+ job_title: string | null;
42
44
  created_at: Date;
43
45
  updated_at: Date;
44
46
  created_by_user: INestedUser | null;
@@ -57,4 +59,38 @@ export interface IQueueJobFiltersWithPagination extends IPaginationFilters {
57
59
  * appropriate services to process it.
58
60
  */
59
61
  export interface IQueueJobMetadata extends Pick<IQueueJob, "job_type"> {
62
+ po_data?: IPurchaseOrderDataFromERP;
63
+ }
64
+ export interface IPurchaseOrderItems {
65
+ item_code: string | null;
66
+ remark: string | null;
67
+ quantity: string | null;
68
+ gst_percentage: string | null;
69
+ total: string | null;
70
+ per_unit_rate: string | null;
71
+ discount_type: string | null;
72
+ discount_value: string | null;
73
+ pending_order_quantity: string | null;
74
+ over_tolerance_percentage: string | null;
75
+ under_tolerance_percentage: string | null;
76
+ Delivery_Completed: string | null;
77
+ }
78
+ export interface IPurchaseOrderDataFromERP {
79
+ purchase_order_number: string | null;
80
+ purchase_location_code: string | null;
81
+ shipping_location_code: string | null;
82
+ comany_vendor_code: string | null;
83
+ subtotal: string | null;
84
+ total: string | null;
85
+ remark: string | null;
86
+ created_by_employee_code: string | null;
87
+ request_date: string | null;
88
+ Payment_terms: string | null;
89
+ items: IPurchaseOrderItems[];
90
+ }
91
+ export interface IPODataResponse {
92
+ purchase_order: IPurchaseOrderDataFromERP[];
93
+ }
94
+ export interface IMTPOFetchResponse {
95
+ MT_POFetch_Res: IPODataResponse;
60
96
  }
@@ -4,6 +4,7 @@ exports.QUEUE_JOB_INCLUDE = exports.QUEUE_JOB_CREATED_BY_TYPE = exports.QUEUE_JO
4
4
  var QUEUE_JOB_TYPES;
5
5
  (function (QUEUE_JOB_TYPES) {
6
6
  QUEUE_JOB_TYPES["PO_EXCEL_UPLOAD"] = "PO_EXCEL_UPLOAD";
7
+ QUEUE_JOB_TYPES["FETCH_PO_FROM_ERP"] = "FETCH_PO_FROM_ERP";
7
8
  })(QUEUE_JOB_TYPES || (exports.QUEUE_JOB_TYPES = QUEUE_JOB_TYPES = {}));
8
9
  var QUEUE_JOB_STATUS;
9
10
  (function (QUEUE_JOB_STATUS) {
@@ -48,4 +48,5 @@ export interface IGSTVerifyResponse {
48
48
  centerJurisdictionCode: string;
49
49
  tradeName: string;
50
50
  centerJurisdiction: string;
51
+ eInvoiceStatus: string;
51
52
  }
@@ -1,4 +1,17 @@
1
1
  "use strict";
2
+ // export function toFixedDecimal(num: any, decimal: number = 2) {
3
+ // if (
4
+ // num === undefined ||
5
+ // num === null ||
6
+ // typeof num !== "number" ||
7
+ // isNaN(num)
8
+ // )
9
+ // return "-";
10
+ // return Number(Number(String(num).trim())).toLocaleString("en-IN", {
11
+ // minimumFractionDigits: decimal,
12
+ // maximumFractionDigits: decimal,
13
+ // });
14
+ // }
2
15
  Object.defineProperty(exports, "__esModule", { value: true });
3
16
  exports.toFixedDecimal = toFixedDecimal;
4
17
  function toFixedDecimal(num, decimal = 2) {
@@ -7,8 +20,9 @@ function toFixedDecimal(num, decimal = 2) {
7
20
  typeof num !== "number" ||
8
21
  isNaN(num))
9
22
  return "-";
10
- return Number(Number(String(num).trim())).toLocaleString("en-IN", {
11
- minimumFractionDigits: decimal,
23
+ const value = Number(String(num).trim());
24
+ return value.toLocaleString("en-IN", {
25
+ minimumFractionDigits: Number.isInteger(value) ? 0 : decimal,
12
26
  maximumFractionDigits: decimal,
13
27
  });
14
28
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kcommons",
3
- "version": "18.5.2",
3
+ "version": "18.6.1",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",