@things-factory/operato-hub 4.3.555 → 4.3.558

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.
@@ -54,7 +54,7 @@ exports.sendEmailsResolver = {
54
54
  let startDate = new Date(interval.prev());
55
55
  if (dag < now && dag > thirtyMinsAgo) {
56
56
  try {
57
- processEmailCronJob(email, startDate.toISOString(), now.toISOString()); // removed await
57
+ processEmailCronJob(email, startDate.toISOString(), now.toISOString());
58
58
  }
59
59
  catch (e) {
60
60
  env_1.logger.error(`[auto_email_log_by_id(${email.id})] ${e}`);
@@ -1 +1 @@
1
- {"version":3,"file":"send-emails.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/email/send-emails.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wDAAyC;AACzC,8DAA6B;AAC7B,qCAA2C;AAE3C,yDAAyD;AACzD,uDAAmD;AACnD,2DAAyE;AACzE,6CAA4C;AAC5C,iDAA0D;AAE1D,gDAAyC;AAEzC,MAAM,EAAE,mBAAmB,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAA;AAEvE,MAAM,qBAAqB,GAAG,EAAE,CAAA;AAEnB,QAAA,kBAAkB,GAAG;IAChC,KAAK,CAAC,UAAU,CAAC,CAAM,EAAE,EAAE,EAAE,OAAY;QACvC,MAAM,MAAM,GAAY,MAAM,IAAA,uBAAa,EAAC,gBAAK,CAAC,CAAC,IAAI,CAAC;YACtD,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;YACvB,SAAS,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,iBAAiB,EAAE,kBAAkB,CAAC;SACxE,CAAC,CAAA;QAEF,IAAI;YACF,IAAI,GAAG,GAAQ,IAAI,IAAI,EAAE,CAAA;YACzB,IAAI,aAAa,GAAQ,IAAI,IAAI,CAAC,GAAG,GAAG,qBAAqB,GAAG,KAAK,CAAC,CAAA;YACtE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,EAAE,KAAK,CAAC,EAAE,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,EAAE,CAAC,CAAA;QAC3F,WAAW,CAAC,IAAI,CAAC,4BAA4B,KAAK,CAAC,EAAE,GAAG,CAAC,CAAA;KAC1D;IAAC,OAAO,CAAC,EAAE;QACV,WAAW,CAAC,IAAI,CAAC,4BAA4B,KAAK,CAAC,EAAE,GAAG,CAAC,CAAA;QACzD,YAAM,CAAC,KAAK,CAAC,oCAAoC,KAAK,CAAC,EAAE,MAAM,CAAC,EAAE,CAAC,CAAA;KACpE;YAAS;QACR,IAAI,IAAI,GAAG,WAAW,CAAC,OAAO,CAC5B,WAAW,KAAK,CAAC,EAAE,EAAE,EACrB,8BAA8B,KAAK,CAAC,EAAE,GAAG,EACzC,4BAA4B,KAAK,CAAC,EAAE,GAAG,CACxC,CAAA;QACD,YAAM,CAAC,IAAI,CAAC,oCAAoC,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC,CAAA;KACjE;AACH,CAAC"}
@@ -0,0 +1,95 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.customElcclDispatchReport = void 0;
4
+ const biz_base_1 = require("@things-factory/biz-base");
5
+ exports.customElcclDispatchReport = {
6
+ async customElcclDispatchReport(_, params, context) {
7
+ try {
8
+ const { tx } = context.state;
9
+ let bizplaceFilter = params.filters.find(data => data.name === 'bizplace'); // Directly fetch bizplace filter
10
+ // Check for required filters
11
+ if (!bizplaceFilter)
12
+ throw 'Invalid input: Bizplace filter is required';
13
+ const bizplace = await tx.getRepository(biz_base_1.Bizplace).findOne({
14
+ id: bizplaceFilter.value
15
+ });
16
+ if (!bizplace)
17
+ throw 'Invalid input: Bizplace not found';
18
+ // Create temporary table for report (execute in json)
19
+ await tx.query(`
20
+ create temp table temp_inbound_order_report on commit drop as (
21
+ select creation_date, planned_shipped_date, actual_shipped_date, shipment_id, ship_to, ship_to_name, item, description, sum(qty) as qty, qty_um, batch, exp_date, mfg_date from(
22
+ select
23
+ to_char(rg.release_date::timestamp,'dd/mm/yyyy') as "creation_date",
24
+ to_char(do2.delivery_date::timestamp,'dd/mm/yyyy') as "planned_shipped_date",
25
+ do2.delivery_date_time + interval '8 hours' as "actual_shipped_date",
26
+ rg.ref_no_2 as "shipment_id",
27
+ case when do2.contact_point_ref_id is not null then cp."name" else do2.attention_to end as "ship_to",
28
+ case when do2.contact_point_ref_id is not null then cp.company_name else do2.attention_company end as "ship_to_name",
29
+ p.sku as "item",
30
+ p.description as "description",
31
+ oi.release_qty as "qty",
32
+ 'CS' as "qty_um",
33
+ i.batch_id as "batch",
34
+ to_char(i.expiration_date,'dd/mm/yyyy') as "exp_date",
35
+ to_char(i.manufacture_date,'dd/mm/yyyy') as "mfg_date"
36
+ from release_goods rg
37
+ inner join order_inventories oi on rg.id = oi.release_good_id
38
+ inner join inventories i on i.id = oi.inventory_id
39
+ inner join products p on p.id = oi.product_id
40
+ left join delivery_orders do2 on rg.id = do2.release_good_id
41
+ left join contact_points cp on cp.id = do2.contact_point_ref_id::uuid
42
+ where rg.bizplace_id = ANY($1::uuid[]) and rg.status = $2
43
+ order by "creation_date" asc
44
+ )foo
45
+ group by creation_date, planned_shipped_date, actual_shipped_date, shipment_id, ship_to, ship_to_name, item, description, qty_um, batch, exp_date, mfg_date
46
+ )
47
+ `, [[bizplace.id], 'DONE']);
48
+ // Count total records
49
+ // const total: any = await tx.query(`
50
+ // select count(*) from temp_inbound_order_report
51
+ // `) and do2.delivery_date::date = NOW()::Date
52
+ // Fetch paginated results
53
+ const result = await tx.query(`
54
+ select *
55
+ from temp_inbound_order_report
56
+ `);
57
+ const convertGmt = timestamp => {
58
+ const day = timestamp.getDate();
59
+ const month = timestamp.getMonth() + 1;
60
+ const year = timestamp.getFullYear();
61
+ const datePart = `${day}/${month}/${year}`;
62
+ const dateTime = `${datePart}`;
63
+ return dateTime;
64
+ };
65
+ // Map results to required format
66
+ let items = result.map(itm => {
67
+ const processedActualShippedDate = itm.actual_shipped_date ? convertGmt(itm.actual_shipped_date) : '';
68
+ return {
69
+ creationDate: itm.creation_date,
70
+ plannedShippedDate: itm.planned_shipped_date,
71
+ actualShippedDate: processedActualShippedDate,
72
+ shipmentId: itm.shipment_id,
73
+ shipTo: itm.ship_to,
74
+ shipToName: itm.ship_to_name,
75
+ productSku: itm.item,
76
+ productDescription: itm.description,
77
+ qty: itm.qty,
78
+ qtyUm: itm.qty_um,
79
+ batch: itm.batch,
80
+ expDate: itm.exp_date,
81
+ mfgDate: itm.mfg_date // Correctly mapped
82
+ };
83
+ });
84
+ // Return items and total count
85
+ return {
86
+ items
87
+ // total: total[0].count
88
+ };
89
+ }
90
+ catch (error) {
91
+ throw error;
92
+ }
93
+ }
94
+ };
95
+ //# sourceMappingURL=custom-elccl-fn-dispatch-report.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"custom-elccl-fn-dispatch-report.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/reports/custom-elccl-fn-dispatch-report.ts"],"names":[],"mappings":";;;AACA,uDAAmD;AAGtC,QAAA,yBAAyB,GAAG;IACvC,KAAK,CAAC,yBAAyB,CAAC,CAAM,EAAE,MAAiB,EAAE,OAAY;QACrE,IAAI;YACF,MAAM,EAAE,EAAE,EAAE,GAA0B,OAAO,CAAC,KAAK,CAAA;YACnD,IAAI,cAAc,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,UAAU,CAAC,CAAA,CAAC,iCAAiC;YAE5G,6BAA6B;YAC7B,IAAI,CAAC,cAAc;gBAAE,MAAM,4CAA4C,CAAA;YAEvE,MAAM,QAAQ,GAAa,MAAM,EAAE,CAAC,aAAa,CAAC,mBAAQ,CAAC,CAAC,OAAO,CAAC;gBAClE,EAAE,EAAE,cAAc,CAAC,KAAK;aACzB,CAAC,CAAA;YAEF,IAAI,CAAC,QAAQ;gBAAE,M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,EAAE,GAAG,CAAC,WAAW;oBACnC,GAAG,EAAE,GAAG,CAAC,GAAG;oBACZ,KAAK,EAAE,GAAG,CAAC,MAAM;oBACjB,KAAK,EAAE,GAAG,CAAC,KAAK;oBAChB,OAAO,EAAE,GAAG,CAAC,QAAQ;oBACrB,OAAO,EAAE,GAAG,CAAC,QAAQ,CAAC,mBAAmB;iBAC1C,CAAA;YACH,CAAC,CAAC,CAAA;YAEF,+BAA+B;YAC/B,OAAO;gBACL,KAAK;gBACL,wBAAwB;aACzB,CAAA;SACF;QAAC,OAAO,KAAK,EAAE;YACd,MAAM,KAAK,CAAA;SACZ;IACH,CAAC;CACF,CAAA"}
@@ -4,5 +4,6 @@ exports.Query = void 0;
4
4
  const inbound_order_details_report_1 = require("./inbound-order-details-report");
5
5
  const outbound_order_details_report_1 = require("./outbound-order-details-report");
6
6
  const shortage_report_1 = require("./shortage-report");
7
- exports.Query = Object.assign(Object.assign(Object.assign({}, inbound_order_details_report_1.inboundOrderDetailsReport), outbound_order_details_report_1.outboundOrderDetailsReport), shortage_report_1.shortageReport);
7
+ const custom_elccl_fn_dispatch_report_1 = require("./custom-elccl-fn-dispatch-report");
8
+ exports.Query = Object.assign(Object.assign(Object.assign(Object.assign({}, inbound_order_details_report_1.inboundOrderDetailsReport), outbound_order_details_report_1.outboundOrderDetailsReport), shortage_report_1.shortageReport), custom_elccl_fn_dispatch_report_1.customElcclDispatchReport);
8
9
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/reports/index.ts"],"names":[],"mappings":";;;AAAA,iFAA0E;AAC1E,mFAA4E;AAC5E,uDAAkD;AAErC,QAAA,KAAK,iDACb,wDAAyB,GACzB,0DAA0B,GAC1B,gCAAc,EAClB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/reports/index.ts"],"names":[],"mappings":";;;AAAA,iFAA0E;AAC1E,mFAA4E;AAC5E,uDAAkD;AAClD,uFAA6E;AAEhE,QAAA,KAAK,+DACb,wDAAyB,GACzB,0DAA0B,GAC1B,gCAAc,GACd,2DAAyB,EAC7B"}
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.CustomElcclDispatchReportList = void 0;
7
+ const graphql_tag_1 = __importDefault(require("graphql-tag"));
8
+ exports.CustomElcclDispatchReportList = (0, graphql_tag_1.default) `
9
+ type CustomElcclDispatchReportList {
10
+ items: [CustomElcclDispatchReport]
11
+ total: Int
12
+ }
13
+ `;
14
+ //# sourceMappingURL=custom-elccl-fn-dispatch-report-list.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"custom-elccl-fn-dispatch-report-list.js","sourceRoot":"","sources":["../../../../server/graphql/types/reports/custom-elccl-fn-dispatch-report-list.ts"],"names":[],"mappings":";;;;;;AAAA,8DAA6B;AAEhB,QAAA,6BAA6B,GAAG,IAAA,qBAAG,EAAA;;;;;CAK/C,CAAA"}
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.CustomElcclDispatchReport = void 0;
7
+ const graphql_tag_1 = __importDefault(require("graphql-tag"));
8
+ exports.CustomElcclDispatchReport = (0, graphql_tag_1.default) `
9
+ type CustomElcclDispatchReport {
10
+ creationDate: String
11
+ plannedShippedDate: String
12
+ actualShippedDate: String
13
+ shipmentId: String
14
+ shipTo: String
15
+ shipToName: String
16
+ productSku: String
17
+ productDescription: String
18
+ qty: Int
19
+ qtyUm: String
20
+ batch: String
21
+ expDate: String
22
+ mfgDate: String
23
+ }
24
+ `;
25
+ //# sourceMappingURL=custom-elccl-fn-dispatch-report.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"custom-elccl-fn-dispatch-report.js","sourceRoot":"","sources":["../../../../server/graphql/types/reports/custom-elccl-fn-dispatch-report.ts"],"names":[],"mappings":";;;;;;AAAA,8DAA6B;AAEhB,QAAA,yBAAyB,GAAG,IAAA,qBAAG,EAAA;;;;;;;;;;;;;;;;CAgB3C,CAAA"}
@@ -7,10 +7,13 @@ const outbound_order_details_report_1 = require("./outbound-order-details-report
7
7
  const outbound_order_details_report_list_1 = require("./outbound-order-details-report-list");
8
8
  const shortage_report_list_1 = require("./shortage-report-list");
9
9
  const shortage_report_type_1 = require("./shortage-report-type");
10
+ const custom_elccl_fn_dispatch_report_1 = require("./custom-elccl-fn-dispatch-report");
11
+ const custom_elccl_fn_dispatch_report_list_1 = require("./custom-elccl-fn-dispatch-report-list");
10
12
  exports.Query = `
11
13
  inboundOrderDetailsReport(filters: [Filter!], pagination: Pagination, sortings: [Sorting!]): InboundOrderDetailsReportList @transaction
12
14
  outboundOrderDetailsReport(filters: [Filter!], pagination: Pagination, sortings: [Sorting!]): OutboundOrderDetailsReportList @transaction
13
15
  shortageReport(filters: [Filter!], pagination: Pagination, sortings: [Sorting!]):ShortageReportList @transaction
16
+ customElcclDispatchReport(filters: [Filter!], pagination: Pagination, sortings: [Sorting!]): CustomElcclDispatchReportList @transaction
14
17
  `;
15
18
  exports.Types = [
16
19
  inbound_order_details_report_1.InboundOrderDetailsReport,
@@ -18,6 +21,8 @@ exports.Types = [
18
21
  outbound_order_details_report_1.OutboundOrderDetailsReport,
19
22
  outbound_order_details_report_list_1.OutboundOrderDetailsReportList,
20
23
  shortage_report_type_1.ShortageReport,
21
- shortage_report_list_1.ShortageReportList
24
+ shortage_report_list_1.ShortageReportList,
25
+ custom_elccl_fn_dispatch_report_1.CustomElcclDispatchReport,
26
+ custom_elccl_fn_dispatch_report_list_1.CustomElcclDispatchReportList
22
27
  ];
23
28
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../server/graphql/types/reports/index.ts"],"names":[],"mappings":";;;AAAA,iFAA0E;AAC1E,2FAAmF;AACnF,mFAA4E;AAC5E,6FAAqF;AACrF,iEAA2D;AAC3D,iEAAuD;AAE1C,QAAA,KAAK,GAAG;;;;CAIpB,CAAA;AAEY,QAAA,KAAK,GAAG;IACnB,wDAAyB;IACzB,iEAA6B;IAC7B,0DAA0B;IAC1B,mEAA8B;IAC9B,qCAAc;IACd,yCAAkB;CACnB,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../server/graphql/types/reports/index.ts"],"names":[],"mappings":";;;AAAA,iFAA0E;AAC1E,2FAAmF;AACnF,mFAA4E;AAC5E,6FAAqF;AACrF,iEAA2D;AAC3D,iEAAuD;AACvD,uFAA6E;AAC7E,iGAAsF;AAEzE,QAAA,KAAK,GAAG;;;;;CAKpB,CAAA;AAEY,QAAA,KAAK,GAAG;IACnB,wDAAyB;IACzB,iEAA6B;IAC7B,0DAA0B;IAC1B,mEAA8B;IAC9B,qCAAc;IACd,yCAAkB;IAClB,2DAAyB;IACzB,oEAA6B;CAC9B,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/operato-hub",
3
- "version": "4.3.555",
3
+ "version": "4.3.558",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "client/index.js",
6
6
  "things-factory": true,
@@ -92,7 +92,7 @@
92
92
  "@things-factory/pdf": "^4.3.534",
93
93
  "@things-factory/product-ui": "^4.3.535",
94
94
  "@things-factory/resource-ui": "^4.3.535",
95
- "@things-factory/sales-base": "^4.3.554",
95
+ "@things-factory/sales-base": "^4.3.558",
96
96
  "@things-factory/scene-data-transform": "^4.3.534",
97
97
  "@things-factory/scene-excel": "^4.3.534",
98
98
  "@things-factory/scene-firebase": "^4.3.534",
@@ -108,8 +108,8 @@
108
108
  "@things-factory/shell": "^4.3.535",
109
109
  "@things-factory/system-ui": "^4.3.535",
110
110
  "@things-factory/transport-base": "^4.3.535",
111
- "@things-factory/warehouse-base": "^4.3.554",
112
- "@things-factory/worksheet-base": "^4.3.555",
111
+ "@things-factory/warehouse-base": "^4.3.558",
112
+ "@things-factory/worksheet-base": "^4.3.558",
113
113
  "cron-parser": "^4.7.0",
114
114
  "koa2-swagger-ui": "^5.0.2",
115
115
  "swagger-jsdoc": "^5.0.0",
@@ -122,5 +122,5 @@
122
122
  "resolutions": {
123
123
  "core-js": "^3.16.0"
124
124
  },
125
- "gitHead": "c6eddad571d6c8f5bb84f4964f3184e51dd4525c"
125
+ "gitHead": "f3e16d44d2e47c649418b6744d1f5994f4cf8e3b"
126
126
  }
@@ -32,7 +32,7 @@ export const sendEmailsResolver = {
32
32
 
33
33
  if (dag < now && dag > thirtyMinsAgo) {
34
34
  try {
35
- processEmailCronJob(email, startDate.toISOString(), now.toISOString()) // removed await
35
+ processEmailCronJob(email, startDate.toISOString(), now.toISOString())
36
36
  } catch (e) {
37
37
  logger.error(`[auto_email_log_by_id(${email.id})] ${e}`)
38
38
  }
@@ -0,0 +1,106 @@
1
+ import { EntityManager } from 'typeorm'
2
+ import { Bizplace } from '@things-factory/biz-base'
3
+ import { ListParam } from '@things-factory/shell'
4
+
5
+ export const customElcclDispatchReport = {
6
+ async customElcclDispatchReport(_: any, params: ListParam, context: any) {
7
+ try {
8
+ const { tx }: { tx: EntityManager } = context.state
9
+ let bizplaceFilter = params.filters.find(data => data.name === 'bizplace') // Directly fetch bizplace filter
10
+
11
+ // Check for required filters
12
+ if (!bizplaceFilter) throw 'Invalid input: Bizplace filter is required'
13
+
14
+ const bizplace: Bizplace = await tx.getRepository(Bizplace).findOne({
15
+ id: bizplaceFilter.value
16
+ })
17
+
18
+ if (!bizplace) throw 'Invalid input: Bizplace not found'
19
+
20
+ // Create temporary table for report (execute in json)
21
+ await tx.query(
22
+ `
23
+ create temp table temp_inbound_order_report on commit drop as (
24
+ select creation_date, planned_shipped_date, actual_shipped_date, shipment_id, ship_to, ship_to_name, item, description, sum(qty) as qty, qty_um, batch, exp_date, mfg_date from(
25
+ select
26
+ to_char(rg.release_date::timestamp,'dd/mm/yyyy') as "creation_date",
27
+ to_char(do2.delivery_date::timestamp,'dd/mm/yyyy') as "planned_shipped_date",
28
+ do2.delivery_date_time + interval '8 hours' as "actual_shipped_date",
29
+ rg.ref_no_2 as "shipment_id",
30
+ case when do2.contact_point_ref_id is not null then cp."name" else do2.attention_to end as "ship_to",
31
+ case when do2.contact_point_ref_id is not null then cp.company_name else do2.attention_company end as "ship_to_name",
32
+ p.sku as "item",
33
+ p.description as "description",
34
+ oi.release_qty as "qty",
35
+ 'CS' as "qty_um",
36
+ i.batch_id as "batch",
37
+ to_char(i.expiration_date,'dd/mm/yyyy') as "exp_date",
38
+ to_char(i.manufacture_date,'dd/mm/yyyy') as "mfg_date"
39
+ from release_goods rg
40
+ inner join order_inventories oi on rg.id = oi.release_good_id
41
+ inner join inventories i on i.id = oi.inventory_id
42
+ inner join products p on p.id = oi.product_id
43
+ left join delivery_orders do2 on rg.id = do2.release_good_id
44
+ left join contact_points cp on cp.id = do2.contact_point_ref_id::uuid
45
+ where rg.bizplace_id = ANY($1::uuid[]) and rg.status = $2
46
+ order by "creation_date" asc
47
+ )foo
48
+ group by creation_date, planned_shipped_date, actual_shipped_date, shipment_id, ship_to, ship_to_name, item, description, qty_um, batch, exp_date, mfg_date
49
+ )
50
+ `,
51
+ [[bizplace.id], 'DONE']
52
+ )
53
+
54
+ // Count total records
55
+ // const total: any = await tx.query(`
56
+ // select count(*) from temp_inbound_order_report
57
+ // `) and do2.delivery_date::date = NOW()::Date
58
+
59
+ // Fetch paginated results
60
+ const result: any = await tx.query(
61
+ `
62
+ select *
63
+ from temp_inbound_order_report
64
+ `
65
+ )
66
+
67
+ const convertGmt = timestamp => {
68
+ const day = timestamp.getDate()
69
+ const month = timestamp.getMonth() + 1
70
+ const year = timestamp.getFullYear()
71
+ const datePart = `${day}/${month}/${year}`
72
+ const dateTime = `${datePart}`
73
+
74
+ return dateTime
75
+ }
76
+
77
+ // Map results to required format
78
+ let items = result.map(itm => {
79
+ const processedActualShippedDate = itm.actual_shipped_date ? convertGmt(itm.actual_shipped_date) : ''
80
+ return {
81
+ creationDate: itm.creation_date, // Correctly mapped
82
+ plannedShippedDate: itm.planned_shipped_date, // Correctly mapped
83
+ actualShippedDate: processedActualShippedDate, // Correctly mapped
84
+ shipmentId: itm.shipment_id, // Correctly mapped
85
+ shipTo: itm.ship_to, // Correctly mapped
86
+ shipToName: itm.ship_to_name, // Correctly mapped
87
+ productSku: itm.item, // Correctly mapped (item -> sku)
88
+ productDescription: itm.description, // Correctly mapped (description -> description)
89
+ qty: itm.qty, // Correctly mapped
90
+ qtyUm: itm.qty_um, // Correctly mapped
91
+ batch: itm.batch, // Correctly mapped
92
+ expDate: itm.exp_date, // Correctly mapped
93
+ mfgDate: itm.mfg_date // Correctly mapped
94
+ }
95
+ })
96
+
97
+ // Return items and total count
98
+ return {
99
+ items
100
+ // total: total[0].count
101
+ }
102
+ } catch (error) {
103
+ throw error
104
+ }
105
+ }
106
+ }
@@ -1,9 +1,11 @@
1
1
  import { inboundOrderDetailsReport } from './inbound-order-details-report'
2
2
  import { outboundOrderDetailsReport } from './outbound-order-details-report'
3
3
  import { shortageReport } from './shortage-report'
4
+ import { customElcclDispatchReport } from './custom-elccl-fn-dispatch-report'
4
5
 
5
6
  export const Query = {
6
7
  ...inboundOrderDetailsReport,
7
8
  ...outboundOrderDetailsReport,
8
- ...shortageReport
9
+ ...shortageReport,
10
+ ...customElcclDispatchReport
9
11
  }
@@ -0,0 +1,8 @@
1
+ import gql from 'graphql-tag'
2
+
3
+ export const CustomElcclDispatchReportList = gql`
4
+ type CustomElcclDispatchReportList {
5
+ items: [CustomElcclDispatchReport]
6
+ total: Int
7
+ }
8
+ `
@@ -0,0 +1,19 @@
1
+ import gql from 'graphql-tag'
2
+
3
+ export const CustomElcclDispatchReport = gql`
4
+ type CustomElcclDispatchReport {
5
+ creationDate: String
6
+ plannedShippedDate: String
7
+ actualShippedDate: String
8
+ shipmentId: String
9
+ shipTo: String
10
+ shipToName: String
11
+ productSku: String
12
+ productDescription: String
13
+ qty: Int
14
+ qtyUm: String
15
+ batch: String
16
+ expDate: String
17
+ mfgDate: String
18
+ }
19
+ `
@@ -4,11 +4,14 @@ import { OutboundOrderDetailsReport } from './outbound-order-details-report'
4
4
  import { OutboundOrderDetailsReportList } from './outbound-order-details-report-list'
5
5
  import { ShortageReportList } from './shortage-report-list'
6
6
  import { ShortageReport } from './shortage-report-type'
7
+ import { CustomElcclDispatchReport } from './custom-elccl-fn-dispatch-report'
8
+ import { CustomElcclDispatchReportList } from './custom-elccl-fn-dispatch-report-list'
7
9
 
8
10
  export const Query = `
9
11
  inboundOrderDetailsReport(filters: [Filter!], pagination: Pagination, sortings: [Sorting!]): InboundOrderDetailsReportList @transaction
10
12
  outboundOrderDetailsReport(filters: [Filter!], pagination: Pagination, sortings: [Sorting!]): OutboundOrderDetailsReportList @transaction
11
13
  shortageReport(filters: [Filter!], pagination: Pagination, sortings: [Sorting!]):ShortageReportList @transaction
14
+ customElcclDispatchReport(filters: [Filter!], pagination: Pagination, sortings: [Sorting!]): CustomElcclDispatchReportList @transaction
12
15
  `
13
16
 
14
17
  export const Types = [
@@ -17,5 +20,7 @@ export const Types = [
17
20
  OutboundOrderDetailsReport,
18
21
  OutboundOrderDetailsReportList,
19
22
  ShortageReport,
20
- ShortageReportList
23
+ ShortageReportList,
24
+ CustomElcclDispatchReport,
25
+ CustomElcclDispatchReportList
21
26
  ]