@things-factory/operato-wms 5.0.0-alpha.2 → 5.0.0-alpha.22

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.
Files changed (52) hide show
  1. package/client/pages/inbound/serial-number-list-popup.js +342 -0
  2. package/client/pages/inbound/unload-product.js +220 -41
  3. package/client/pages/inbound/unloaded-inventories-popup.js +7 -0
  4. package/client/pages/inventory/non-loaded-inventory.js +297 -0
  5. package/client/pages/order/release-order/b2b/b2b-order-list.js +41 -18
  6. package/client/pages/order/release-order/b2c/b2c-order-requests.js +40 -18
  7. package/client/pages/outbound/packing-product.js +88 -80
  8. package/client/pages/outbound/picking-product.js +61 -36
  9. package/client/pages/outbound/serial-number-popup.js +150 -64
  10. package/client/pages/report/inbound-serial-number-report.js +452 -0
  11. package/client/pages/report/outbound-order-details-report.js +64 -9
  12. package/client/pages/report/outbound-serial-number-report.js +467 -0
  13. package/client/route.js +11 -0
  14. package/dist-server/graphql/resolvers/reports/inbound-serial-number-report.js +111 -0
  15. package/dist-server/graphql/resolvers/reports/inbound-serial-number-report.js.map +1 -0
  16. package/dist-server/graphql/resolvers/reports/index.js +3 -1
  17. package/dist-server/graphql/resolvers/reports/index.js.map +1 -1
  18. package/dist-server/graphql/resolvers/reports/outbound-order-details-report.js +53 -48
  19. package/dist-server/graphql/resolvers/reports/outbound-order-details-report.js.map +1 -1
  20. package/dist-server/graphql/resolvers/reports/outbound-serial-number-report.js +118 -0
  21. package/dist-server/graphql/resolvers/reports/outbound-serial-number-report.js.map +1 -0
  22. package/dist-server/graphql/types/reports/inbound-serial-number-report-list.js +14 -0
  23. package/dist-server/graphql/types/reports/inbound-serial-number-report-list.js.map +1 -0
  24. package/dist-server/graphql/types/reports/inbound-serial-number-report.js +23 -0
  25. package/dist-server/graphql/types/reports/inbound-serial-number-report.js.map +1 -0
  26. package/dist-server/graphql/types/reports/index.js +10 -0
  27. package/dist-server/graphql/types/reports/index.js.map +1 -1
  28. package/dist-server/graphql/types/reports/outbound-order-details-report.js +3 -0
  29. package/dist-server/graphql/types/reports/outbound-order-details-report.js.map +1 -1
  30. package/dist-server/graphql/types/reports/outbound-serial-number-report-list.js +14 -0
  31. package/dist-server/graphql/types/reports/outbound-serial-number-report-list.js.map +1 -0
  32. package/dist-server/graphql/types/reports/outbound-serial-number-report.js +25 -0
  33. package/dist-server/graphql/types/reports/outbound-serial-number-report.js.map +1 -0
  34. package/dist-server/migrations/1568858861188-SeedSetting.js +2 -1
  35. package/dist-server/migrations/1568858861188-SeedSetting.js.map +1 -1
  36. package/package.json +67 -66
  37. package/server/graphql/resolvers/reports/inbound-serial-number-report.ts +128 -0
  38. package/server/graphql/resolvers/reports/index.ts +5 -0
  39. package/server/graphql/resolvers/reports/outbound-order-details-report.ts +54 -48
  40. package/server/graphql/resolvers/reports/outbound-serial-number-report.ts +135 -0
  41. package/server/graphql/types/reports/inbound-serial-number-report-list.ts +8 -0
  42. package/server/graphql/types/reports/inbound-serial-number-report.ts +17 -0
  43. package/server/graphql/types/reports/index.ts +11 -0
  44. package/server/graphql/types/reports/outbound-order-details-report.ts +3 -0
  45. package/server/graphql/types/reports/outbound-serial-number-report-list.ts +8 -0
  46. package/server/graphql/types/reports/outbound-serial-number-report.ts +19 -0
  47. package/server/migrations/1568858861188-SeedSetting.ts +5 -2
  48. package/things-factory.config.js +12 -0
  49. package/translations/en.json +26 -6
  50. package/translations/ko.json +21 -2
  51. package/translations/ms.json +21 -2
  52. package/translations/zh.json +25 -6
@@ -14,6 +14,7 @@ exports.outboundOrderDetailsReport = {
14
14
  let toDate = params.filters.find(data => data.name === 'toDate');
15
15
  let roNo = params.filters.find(data => data.name === 'roNo');
16
16
  let doNo = params.filters.find(data => data.name === 'doNo');
17
+ let status = params.filters.find(data => data.name === 'status');
17
18
  if (userFilter) {
18
19
  const user = await tx.getRepository(auth_base_1.User).findOne({
19
20
  where: { id: userFilter.value },
@@ -40,75 +41,76 @@ exports.outboundOrderDetailsReport = {
40
41
  if (doNo) {
41
42
  extraQueryFilters = `${extraQueryFilters} and delivery_order_no like '%${doNo.value}%' `;
42
43
  }
44
+ console.time('temp');
43
45
  await tx.query(`
44
46
  create temp table temp_outbound_order_report on commit drop as (
45
47
  select * from (
46
- select b2.id AS "bizplace_id", b2.name AS "bizplace_name", b2.description AS "bizplace_description",
47
- do2.name AS "delivery_order_no", do2.delivery_date as "delivery_order_date", coalesce(do2."to", concat(cp.address, cp.address_2)) as "delivery_address",
48
- rg.name AS "ro_no", rg."type" as "ro_type", rg.ref_no AS "ref_no_1", rg.ref_no_2 AS "ref_no_2", rg.ref_no_3 AS "ref_no_3",
48
+ select oi.id, '${bizplace.id}' AS "bizplace_id", '${bizplace.name}' AS "bizplace_name", '${bizplace.description}' AS "bizplace_description",
49
+ do2.name AS "delivery_order_no", do2.delivery_date as "delivery_order_date",
50
+ do2."to", do2.contact_point_ref_id,
51
+ rg.name AS "ro_no", rg."type" as "ro_type", rg.ref_no AS "ref_no_1", rg.ref_no_2 AS "ref_no_2", rg.ref_no_3 AS "ref_no_3", rg.status as "ro_status",
49
52
  rg.created_at AS "order_created_at", rg.accepted_at, u4.name as accepted_by,
50
53
  p.id as "product_id", p.sku as "product_sku", p.name AS "product_name", p.description AS "product_description", p.type as "product_type",
51
- oi.packing_type as "pack_type", oi.packing_size as "pack_size", oi.release_qty AS "release_qty",
52
- w.started_at as "picking_start", w.ended_at as "picking_complete",
53
- ih.qty as "qty", ih.uom_value as "uom_value", ih.uom, ih.pallet_id, ih.carton_id, ih.batch_id, ih.batch_id_ref,
54
- i.expiration_date, i.manufacture_date,
55
- ih.created_at as "picked_at", u.name as "picked_by",
56
- ih2.created_at as "packed_at", u2.name as "packed_by",
57
- ih3.created_at as "loaded_at", u3.name as "loaded_by",
58
- ih4.created_at as "shipped_at",
59
- coalesce((select volume from product_details pd where pd.product_id = i.product_id and pd.packing_type = i.packing_type and pd.packing_size = i.packing_size
60
- order by created_at desc
61
- fetch first 1 rows only),0) as unit_volume,
62
- coalesce((select nett_weight from product_details pd where pd.product_id = i.product_id and pd.packing_type = i.packing_type and pd.packing_size = i.packing_size
63
- order by created_at desc
64
- fetch first 1 rows only),0) as unit_nett_weight,
65
- coalesce((select gross_weight from product_details pd where pd.product_id = i.product_id and pd.packing_type = i.packing_type and pd.packing_size = i.packing_size
66
- order by created_at desc
67
- fetch first 1 rows only),0) as unit_gross_weight,
68
- coalesce((select weight_unit from product_details pd where pd.product_id = i.product_id and pd.packing_type = i.packing_type and pd.packing_size = i.packing_size
69
- order by created_at desc
70
- fetch first 1 rows only),'') as weight_unit
71
- from (
72
- select * from release_goods
73
- where domain_id = $1 and bizplace_id = $2 and status ='DONE'
74
- and created_at >= $3 and created_at <= $4
75
- ) rg
54
+ i.packing_type as "pack_type", i.packing_size as "pack_size", oi.release_qty AS "release_qty",
55
+ oi.picked_at, oi.picked_by, oi.packed_at, oi.packed_by, oi.loaded_at, oi.loaded_by, oi.shipped_at,
56
+ oi.release_qty as "qty", oi.release_uom_value as "uom_value", i.uom,
57
+ oi.return_to_location_qty, oi.return_to_location_uom_value,
58
+ i.pallet_id, i.carton_id, i.batch_id, i.batch_id_ref, i.expiration_date, i.manufacture_date
59
+ from order_inventories oi
60
+ inner join release_goods rg on rg.id = oi.release_good_id
76
61
  left join users u4 on u4.id = rg.accepted_by_id
77
- inner join bizplaces b2 ON b2.id = rg.bizplace_id
78
- inner join order_inventories oi on oi.release_good_id = rg.id
79
62
  inner join inventories i on i.id = oi.inventory_id
80
63
  inner join temp_products p on p.id = oi.product_id
81
- left join worksheets w on w.release_good_id = rg.id and w."type" ='PICKING'
82
- left join reduced_inventory_histories ih on ih.inventory_id = oi.inventory_id and ih.transaction_type ='PICKING' and ih.ref_order_id = rg.id::varchar
83
- left join users u on u.id = ih.creator_id
84
- left join reduced_inventory_histories ih2 on ih2.inventory_id = oi.inventory_id and ih2.transaction_type ='PACKING' and ih2.ref_order_id = rg.id::varchar
85
- left join users u2 on u2.id = ih2.creator_id
86
- left join reduced_inventory_histories ih3 on ih3.inventory_id = oi.inventory_id and ih3.transaction_type ='LOADING' and ih3.ref_order_id = rg.id::varchar
87
- left join users u3 on u3.id = ih3.creator_id
88
- left join reduced_inventory_histories ih4 on ih4.inventory_id = oi.inventory_id and ih4.transaction_type ='SHIPPING' and ih4.ref_order_id = rg.id::varchar
89
- left join worksheets w2 on w2.release_good_id = rg.id and w2."type" ='PACKING'
90
- left join worksheets w3 on w3.release_good_id = rg.id and w2."type" ='LOADING'
91
64
  left join delivery_orders do2 on do2.id = oi.delivery_order_id
92
- left join contact_points cp on cp.id = do2.contact_point_ref_id
93
- left join marketplace_orders mo on mo.release_order_id::uuid = rg.id
94
- where oi.status <> 'REPLACED'
95
- order by rg.name, p.sku
65
+ where exists (
66
+ select rg2.id from release_goods rg2
67
+ where rg2.domain_id = $1 and rg2.bizplace_id = $2
68
+ and rg2.created_at >= $3 and rg2.created_at <= $4 and rg2.id = oi.release_good_id
69
+ )
70
+ and oi.status <> 'REPLACED'
71
+ ${status ? `and rg.status = '${status.value}' ` : ``}
96
72
  ) src
97
73
  where 1=1
98
74
  ${extraQueryFilters}
99
75
  )
100
76
  `, [context.state.domain.id, bizplace.id, fromDate.value, toDate.value]);
77
+ console.timeEnd('temp');
101
78
  const total = await tx.query(`
102
79
  select count(*) from temp_outbound_order_report
103
80
  `);
81
+ console.time('result');
104
82
  const result = await tx.query(`
105
83
  select *,
106
84
  round((qty * unit_volume)::numeric ,4) as total_volume,
107
85
  round((qty * unit_nett_weight)::numeric ,4) as total_unit_nett_weight,
108
- round((qty * unit_gross_weight)::numeric ,4) as total_unit_gross_weight
109
- from temp_outbound_order_report
110
- offset $1 limit $2
86
+ round((qty * unit_gross_weight)::numeric ,4) as total_unit_gross_weight
87
+ from (
88
+ select *,
89
+ w.started_at as picking_start,
90
+ w.ended_at as picking_complete,
91
+ coalesce(oi."to", concat(cp.address, cp.address_2)) as "delivery_address",
92
+ coalesce((select volume from product_details pd where pd.product_id = oi.product_id and pd.packing_type = oi.pack_type and pd.packing_size = oi.pack_size
93
+ order by created_at desc
94
+ fetch first 1 rows only),0) as unit_volume,
95
+ coalesce((select nett_weight from product_details pd where pd.product_id = oi.product_id and pd.packing_type = oi.pack_type and pd.packing_size = oi.pack_size
96
+ order by created_at desc
97
+ fetch first 1 rows only),0) as unit_nett_weight,
98
+ coalesce((select gross_weight from product_details pd where pd.product_id = oi.product_id and pd.packing_type = oi.pack_type and pd.packing_size = oi.pack_size
99
+ order by created_at desc
100
+ fetch first 1 rows only),0) as unit_gross_weight,
101
+ coalesce((select weight_unit from product_details pd where pd.product_id = oi.product_id and pd.packing_type = oi.pack_type and pd.packing_size = oi.pack_size
102
+ order by created_at desc
103
+ fetch first 1 rows only),'') as weight_unit
104
+ from temp_outbound_order_report oi
105
+ left join worksheet_details wd on wd.target_inventory_id = oi.id
106
+ left join worksheets w on w.id = wd.worksheet_id
107
+ left join contact_points cp on cp.id = oi.contact_point_ref_id
108
+ where (w.type= 'PICKING' OR w.type = 'BATCH_PICKING')
109
+ order by oi.ro_no, oi.product_sku
110
+ offset $1 limit $2
111
+ ) src
111
112
  `, [(params.pagination.page - 1) * params.pagination.limit, params.pagination.limit]);
113
+ console.timeEnd('result');
112
114
  let items = result.map(itm => {
113
115
  return {
114
116
  bizplace: {
@@ -121,9 +123,10 @@ exports.outboundOrderDetailsReport = {
121
123
  deliveryAddress: itm.delivery_address,
122
124
  roNo: itm.ro_no,
123
125
  roType: itm.ro_type,
126
+ status: itm.ro_status,
124
127
  refNo1: itm.ref_no_1,
125
- refNo2: itm.ref_no_2,
126
128
  refNo3: itm.ref_no_3,
129
+ refNo2: itm.ref_no_2,
127
130
  acceptedBy: itm.accepted_by,
128
131
  acceptedAt: itm.accepted_at,
129
132
  orderCreatedAt: itm.order_created_at,
@@ -141,6 +144,8 @@ exports.outboundOrderDetailsReport = {
141
144
  qty: Math.abs(itm.qty),
142
145
  uomValue: Math.abs(itm.uom_value),
143
146
  uom: itm.uom,
147
+ returnToLocationQty: itm.return_to_location_qty,
148
+ returnToLocationUomValue: itm.return_to_location_uom_value,
144
149
  unitVolume: itm.unit_volume,
145
150
  totalVolume: itm.total_volume,
146
151
  unitNettWeight: itm.unit_nett_weight,
@@ -1 +1 @@
1
- {"version":3,"file":"outbound-order-details-report.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/reports/outbound-order-details-report.ts"],"names":[],"mappings":";;;AAEA,yDAAgD;AAChD,uDAAmD;AAGnD,0CAAiD;AAEpC,QAAA,0BAA0B,GAAG;IACxC,KAAK,CAAC,0BAA0B,CAAC,CAAM,EAAE,MAAiB,EAAE,OAAY;QACtE,IAAI;YACF,MAAM,EAAE,EAAE,EAAE,GAA0B,OAAO,CAAC,KAAK,CAAA;YACnD,IAAI,cAAc,GAAG,EAAE,IAAI,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CAAA;YAC1D,IAAI,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,MAAM,CAAC,CAAA;YAClE,IAAI,QAAQ,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,UAAU,CAAC,CAAA;YACpE,IAAI,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAA;YAChE,IAAI,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,MAAM,CAAC,CAAA;YAC5D,IAAI,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,MAAM,CAAC,CAAA;YAE5D,IAAI,UAAU,EAAE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,CAAC,CAAA;YAEF,OAAO;gBACL,KAAK;gBACL,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK;aACtB,CAAA;SACF;QAAC,OAAO,KAAK,EAAE;YACd,MAAM,KAAK,CAAA;SACZ;IACH,CAAC;CACF,CAAA"}
1
+ {"version":3,"file":"outbound-order-details-report.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/reports/outbound-order-details-report.ts"],"names":[],"mappings":";;;AAEA,yDAAgD;AAChD,uDAAmD;AAGnD,0CAAiD;AAEpC,QAAA,0BAA0B,GAAG;IACxC,KAAK,CAAC,0BAA0B,CAAC,CAAM,EAAE,MAAiB,EAAE,OAAY;QACtE,IAAI;YACF,MAAM,EAAE,EAAE,EAAE,GAA0B,OAAO,CAAC,KAAK,CAAA;YACnD,IAAI,cAAc,GAAG,EAAE,IAAI,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CAAA;YAC1D,IAAI,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,MAAM,CAAC,CAAA;YAClE,IAAI,QAAQ,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,UAAU,CAAC,CAAA;YACpE,IAAI,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAA;YAChE,IAAI,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,MAAM,CAAC,CAAA;YAC5D,IAAI,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,MAAM,CAA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sB;oBAC/C,eAAe,EAAE,GAAG,CAAC,iBAAiB;oBACtC,oBAAoB,EAAE,GAAG,CAAC,uBAAuB;oBACjD,UAAU,EAAE,GAAG,CAAC,WAAW;oBAC3B,QAAQ,EAAE,GAAG,CAAC,SAAS;oBACvB,QAAQ,EAAE,GAAG,CAAC,SAAS;oBACvB,OAAO,EAAE,GAAG,CAAC,QAAQ;oBACrB,UAAU,EAAE,GAAG,CAAC,YAAY;oBAC5B,cAAc,EAAE,GAAG,CAAC,eAAe;oBACnC,eAAe,EAAE,GAAG,CAAC,gBAAgB;oBACrC,QAAQ,EAAE,GAAG,CAAC,SAAS;oBACvB,QAAQ,EAAE,GAAG,CAAC,SAAS;oBACvB,QAAQ,EAAE,GAAG,CAAC,SAAS;oBACvB,QAAQ,EAAE,GAAG,CAAC,SAAS;oBACvB,QAAQ,EAAE,GAAG,CAAC,SAAS;oBACvB,QAAQ,EAAE,GAAG,CAAC,SAAS;oBACvB,SAAS,EAAE,GAAG,CAAC,UAAU;iBAC1B,CAAA;YACH,CAAC,CAAC,CAAA;YAEF,OAAO;gBACL,KAAK;gBACL,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK;aACtB,CAAA;SACF;QAAC,OAAO,KAAK,EAAE;YACd,MAAM,KAAK,CAAA;SACZ;IACH,CAAC;CACF,CAAA"}
@@ -0,0 +1,118 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.outboundSerialNumberReport = void 0;
4
+ const auth_base_1 = require("@things-factory/auth-base");
5
+ const biz_base_1 = require("@things-factory/biz-base");
6
+ const utils_1 = require("../../../utils");
7
+ exports.outboundSerialNumberReport = {
8
+ async outboundSerialNumberReport(_, params, context) {
9
+ try {
10
+ const { tx } = context.state;
11
+ let bizplaceFilter = { name: '', operator: '', value: '' };
12
+ let userFilter = params.filters.find(data => data.name === 'user');
13
+ let fromDate = params.filters.find(data => data.name === 'fromDate');
14
+ let toDate = params.filters.find(data => data.name === 'toDate');
15
+ let ganNo = params.filters.find(data => data.name === 'ganNo');
16
+ if (userFilter) {
17
+ const user = await tx.getRepository(auth_base_1.User).findOne({
18
+ where: { id: userFilter.value },
19
+ relations: ['bizplaces']
20
+ });
21
+ const bizplace = user.bizplaces[0];
22
+ if (!bizplace)
23
+ throw 'Invalid input';
24
+ bizplaceFilter = { name: 'bizplace', operator: 'eq', value: bizplace.id };
25
+ }
26
+ else {
27
+ bizplaceFilter = params.filters.find(data => data.name === 'bizplace');
28
+ }
29
+ if (!bizplaceFilter || !fromDate || !toDate)
30
+ throw 'Invalid input';
31
+ const bizplace = await tx.getRepository(biz_base_1.Bizplace).findOne({
32
+ id: bizplaceFilter.value
33
+ });
34
+ await (0, utils_1.rawProductsQuery)(tx, params, bizplace);
35
+ let extraQueryFilters = '';
36
+ if (ganNo) {
37
+ extraQueryFilters = `${extraQueryFilters} and order_no like '%${ganNo.value}%' `;
38
+ }
39
+ await tx.query(`
40
+ create temp table temp_outbound_serial_number_report on commit drop as (
41
+ select * from (
42
+ select
43
+ row_number() over(partition by rg."name" order by coalesce(w.started_at, ii.created_at), p.sku ) as "no",
44
+ rg."name" as "order_no", concat_ws(', ',rg.delivery_address_1,rg.delivery_address_2,rg.delivery_address_3,rg.delivery_address_4,rg.delivery_address_5,rg.postal_code,rg.city,rg.state) as "full_delivery_address",
45
+ rg."attention_to" as "attention_to",
46
+ i.pallet_id, i.carton_id, rg.ref_no, rg.ref_no_2, rg.ref_no_3,
47
+ p.id as "product_id", p.sku as "product_sku", p.brand_sku as "product_brand_sku",
48
+ p.name as "product_name", p.description as "product_description", p."type" as "product_type",
49
+ coalesce(pd.volume, '0') as "product_volume",
50
+ ii.serial_number,
51
+ coalesce(w.started_at,ii.created_at) as "etd"
52
+ from inventory_items ii
53
+ inner join inventories i on i.id = ii.inventory_id
54
+ inner join products p on p.id = i.product_id
55
+ left join product_details pd on pd.product_id = p.id and pd.packing_type = i.packing_type and pd.packing_size = i.packing_size
56
+ inner join release_goods rg on rg.id = ii.outbound_order_id::uuid
57
+ left join contact_points cp on cp.id = rg.deliver_to_id
58
+ left join order_inventories oi on oi.release_good_id = rg.id and oi.inventory_id = i.id
59
+ left join delivery_orders do2 on do2.id = oi.delivery_order_id
60
+ left join contact_points cp2 on cp2.id = do2.contact_point_ref_id
61
+ left join worksheets w on w.arrival_notice_id = rg.id and w.type = 'PICKING'
62
+ where
63
+ i.domain_id = $1 and i.bizplace_id = $2
64
+ and coalesce(w.started_at, ii.created_at) between $3 and $4
65
+ order by coalesce(w.started_at, ii.created_at), p.sku
66
+ ) src
67
+ where 1=1
68
+ ${extraQueryFilters}
69
+ )
70
+ `, [context.state.domain.id, bizplace.id, fromDate.value, toDate.value]);
71
+ const total = await tx.query(`
72
+ select count(*) from temp_outbound_serial_number_report
73
+ `);
74
+ const result = await tx.query(`
75
+ select *
76
+ from temp_outbound_serial_number_report
77
+ offset $1 limit $2
78
+ `, [(params.pagination.page - 1) * params.pagination.limit, params.pagination.limit]);
79
+ let items = result.map(itm => {
80
+ let data = {
81
+ no: itm.no,
82
+ bizplace: {
83
+ description: bizplace.description,
84
+ name: bizplace.name
85
+ },
86
+ fullDeliveryAddress: itm.full_delivery_address,
87
+ attentionTo: itm.attention_to,
88
+ palletId: itm.pallet_id,
89
+ cartonId: itm.carton_id,
90
+ orderNo: itm.order_no,
91
+ refNo1: itm.ref_no,
92
+ refNo2: itm.ref_no_2,
93
+ refNo3: itm.ref_no_3,
94
+ product: {
95
+ id: itm.product_id,
96
+ sku: itm.product_sku,
97
+ brandSku: itm.product_brand_sku,
98
+ name: itm.product_name,
99
+ description: itm.product_description,
100
+ type: itm.product_type,
101
+ volume: itm.product_volume
102
+ },
103
+ serialNumber: itm.serial_number,
104
+ etd: itm.etd
105
+ };
106
+ return data;
107
+ });
108
+ return {
109
+ items,
110
+ total: total[0].count
111
+ };
112
+ }
113
+ catch (error) {
114
+ throw error;
115
+ }
116
+ }
117
+ };
118
+ //# sourceMappingURL=outbound-serial-number-report.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"outbound-serial-number-report.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/reports/outbound-serial-number-report.ts"],"names":[],"mappings":";;;AAEA,yDAAgD;AAChD,uDAAmD;AAGnD,0CAAiD;AAEpC,QAAA,0BAA0B,GAAG;IACxC,KAAK,CAAC,0BAA0B,CAAC,CAAM,EAAE,MAAiB,EAAE,OAAY;QACtE,IAAI;YACF,MAAM,EAAE,EAAE,EAAE,GAA0B,OAAO,CAAC,KAAK,CAAA;YACnD,IAAI,cAAc,GAAG,EAAE,IAAI,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CAAA;YAC1D,IAAI,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,MAAM,CAAC,CAAA;YAClE,IAAI,QAAQ,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,UAAU,CAAC,CAAA;YACpE,IAAI,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAA;YAChE,IAAI,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,OAAO,CAAC,CAAA;YAE9D,IAAI,UAAU,EAAE;gBACd,MAAM,IAAI,GAAS,MAAM,EAAE,CAAC,aAAa,CAAC,gBAAI,CAAC,CAAC,OAAO,CAAC;oBACtD,KAAK,EAAE,EAAE,EAAE,EAAE,UAAU,CAAC,KAAK,EAAE;oBAC/B,SAAS,EAAE,CAAC,WAAW,CAAC;iBACzB,CAAC,CAAA;gBAEF,MAAM,QAAQ,GAAa,IAAI,CAAC,SAAS,CAA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+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.InboundSerialNumberReportList = void 0;
7
+ const graphql_tag_1 = __importDefault(require("graphql-tag"));
8
+ exports.InboundSerialNumberReportList = (0, graphql_tag_1.default) `
9
+ type InboundSerialNumberReportList {
10
+ items: [InboundSerialNumberReport]
11
+ total: Int
12
+ }
13
+ `;
14
+ //# sourceMappingURL=inbound-serial-number-report-list.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inbound-serial-number-report-list.js","sourceRoot":"","sources":["../../../../server/graphql/types/reports/inbound-serial-number-report-list.ts"],"names":[],"mappings":";;;;;;AAAA,8DAA6B;AAEhB,QAAA,6BAA6B,GAAG,IAAA,qBAAG,EAAA;;;;;CAK/C,CAAA"}
@@ -0,0 +1,23 @@
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.InboundSerialNumberReport = void 0;
7
+ const graphql_tag_1 = __importDefault(require("graphql-tag"));
8
+ exports.InboundSerialNumberReport = (0, graphql_tag_1.default) `
9
+ type InboundSerialNumberReport {
10
+ no: Int
11
+ bizplace: Bizplace
12
+ palletId: String
13
+ cartonId: String
14
+ orderNo: String
15
+ refNo1: String
16
+ refNo2: String
17
+ refNo3: String
18
+ product: Product
19
+ serialNumber: String
20
+ etd: String
21
+ }
22
+ `;
23
+ //# sourceMappingURL=inbound-serial-number-report.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inbound-serial-number-report.js","sourceRoot":"","sources":["../../../../server/graphql/types/reports/inbound-serial-number-report.ts"],"names":[],"mappings":";;;;;;AAAA,8DAA6B;AAEhB,QAAA,yBAAyB,GAAG,IAAA,qBAAG,EAAA;;;;;;;;;;;;;;CAc3C,CAAA"}
@@ -1,6 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Types = exports.Query = void 0;
4
+ const inbound_serial_number_report_1 = require("./inbound-serial-number-report");
5
+ const inbound_serial_number_report_list_1 = require("./inbound-serial-number-report-list");
6
+ const outbound_serial_number_report_1 = require("./outbound-serial-number-report");
7
+ const outbound_serial_number_report_list_1 = require("./outbound-serial-number-report-list");
4
8
  const inbound_order_details_report_1 = require("./inbound-order-details-report");
5
9
  const inbound_order_details_report_list_1 = require("./inbound-order-details-report-list");
6
10
  const outbound_order_details_report_1 = require("./outbound-order-details-report");
@@ -8,11 +12,17 @@ const outbound_order_details_report_list_1 = require("./outbound-order-details-r
8
12
  const product_label_report_1 = require("./product-label-report");
9
13
  const product_label_report_list_1 = require("./product-label-report-list");
10
14
  exports.Query = `
15
+ inboundSerialNumberReport(filters: [Filter!], pagination: Pagination, sortings: [Sorting!]): InboundSerialNumberReportList @transaction
16
+ outboundSerialNumberReport(filters: [Filter!], pagination: Pagination, sortings: [Sorting!]): OutboundSerialNumberReportList @transaction
11
17
  inboundOrderDetailsReport(filters: [Filter!], pagination: Pagination, sortings: [Sorting!]): InboundOrderDetailsReportList @transaction
12
18
  outboundOrderDetailsReport(filters: [Filter!], pagination: Pagination, sortings: [Sorting!]): OutboundOrderDetailsReportList @transaction
13
19
  productLabelReport(filters: [Filter!], pagination: Pagination, sortings: [Sorting!]): ProductLabelReportList @transaction
14
20
  `;
15
21
  exports.Types = [
22
+ inbound_serial_number_report_1.InboundSerialNumberReport,
23
+ inbound_serial_number_report_list_1.InboundSerialNumberReportList,
24
+ outbound_serial_number_report_1.OutboundSerialNumberReport,
25
+ outbound_serial_number_report_list_1.OutboundSerialNumberReportList,
16
26
  inbound_order_details_report_1.InboundOrderDetailsReport,
17
27
  inbound_order_details_report_list_1.InboundOrderDetailsReportList,
18
28
  outbound_order_details_report_1.OutboundOrderDetailsReport,
@@ -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,2EAAoE;AAEvD,QAAA,KAAK,GAAG;;;;CAIpB,CAAA;AAEY,QAAA,KAAK,GAAG;IACnB,wDAAyB;IACzB,iEAA6B;IAC7B,0DAA0B;IAC1B,mEAA8B;IAC9B,yCAAkB;IAClB,kDAAsB;CACvB,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;AAErF,iFAA0E;AAC1E,2FAAmF;AACnF,mFAA4E;AAC5E,6FAAqF;AACrF,iEAA2D;AAC3D,2EAAoE;AAEvD,QAAA,KAAK,GAAG;;;;;;CAMpB,CAAA;AAEY,QAAA,KAAK,GAAG;IACnB,wDAAyB;IACzB,iEAA6B;IAC7B,0DAA0B;IAC1B,mEAA8B;IAC9B,wDAAyB;IACzB,iEAA6B;IAC7B,0DAA0B;IAC1B,mEAA8B;IAC9B,yCAAkB;IAClB,kDAAsB;CACvB,CAAA"}
@@ -13,6 +13,7 @@ exports.OutboundOrderDetailsReport = (0, graphql_tag_1.default) `
13
13
  deliveryAddress: String
14
14
  roNo: String
15
15
  roType: String
16
+ status: String
16
17
  refNo1: String
17
18
  refNo2: String
18
19
  refNo3: String
@@ -27,6 +28,8 @@ exports.OutboundOrderDetailsReport = (0, graphql_tag_1.default) `
27
28
  packSize: Int
28
29
  qty: Int
29
30
  uomValue: Float
31
+ returnToLocationQty: Int
32
+ returnToLocationUomValue: Float
30
33
  uom: String
31
34
  unitVolume: Float
32
35
  totalVolume: Float
@@ -1 +1 @@
1
- {"version":3,"file":"outbound-order-details-report.js","sourceRoot":"","sources":["../../../../server/graphql/types/reports/outbound-order-details-report.ts"],"names":[],"mappings":";;;;;;AAAA,8DAA6B;AAEhB,QAAA,0BAA0B,GAAG,IAAA,qBAAG,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4C5C,CAAA"}
1
+ {"version":3,"file":"outbound-order-details-report.js","sourceRoot":"","sources":["../../../../server/graphql/types/reports/outbound-order-details-report.ts"],"names":[],"mappings":";;;;;;AAAA,8DAA6B;AAEhB,QAAA,0BAA0B,GAAG,IAAA,qBAAG,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+C5C,CAAA"}
@@ -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.OutboundSerialNumberReportList = void 0;
7
+ const graphql_tag_1 = __importDefault(require("graphql-tag"));
8
+ exports.OutboundSerialNumberReportList = (0, graphql_tag_1.default) `
9
+ type OutboundSerialNumberReportList {
10
+ items: [OutboundSerialNumberReport]
11
+ total: Int
12
+ }
13
+ `;
14
+ //# sourceMappingURL=outbound-serial-number-report-list.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"outbound-serial-number-report-list.js","sourceRoot":"","sources":["../../../../server/graphql/types/reports/outbound-serial-number-report-list.ts"],"names":[],"mappings":";;;;;;AAAA,8DAA6B;AAEhB,QAAA,8BAA8B,GAAG,IAAA,qBAAG,EAAA;;;;;CAKhD,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.OutboundSerialNumberReport = void 0;
7
+ const graphql_tag_1 = __importDefault(require("graphql-tag"));
8
+ exports.OutboundSerialNumberReport = (0, graphql_tag_1.default) `
9
+ type OutboundSerialNumberReport {
10
+ no: Int
11
+ bizplace: Bizplace
12
+ fullDeliveryAddress: String
13
+ attentionTo:String
14
+ palletId: String
15
+ cartonId: String
16
+ orderNo: String
17
+ refNo1: String
18
+ refNo2: String
19
+ refNo3: String
20
+ product: Product
21
+ serialNumber: String
22
+ etd: String
23
+ }
24
+ `;
25
+ //# sourceMappingURL=outbound-serial-number-report.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"outbound-serial-number-report.js","sourceRoot":"","sources":["../../../../server/graphql/types/reports/outbound-serial-number-report.ts"],"names":[],"mappings":";;;;;;AAAA,8DAA6B;AAEhB,QAAA,0BAA0B,GAAG,IAAA,qBAAG,EAAA;;;;;;;;;;;;;;;;CAgB5C,CAAA"}
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SeedSetting1568858861188 = void 0;
4
4
  const typeorm_1 = require("typeorm");
5
+ const env_1 = require("@things-factory/env");
5
6
  const setting_base_1 = require("@things-factory/setting-base");
6
7
  const shell_1 = require("@things-factory/shell");
7
8
  const opa_app_setting_constants_1 = require("../opa-app-setting-constants");
@@ -36,7 +37,7 @@ class SeedSetting1568858861188 {
36
37
  });
37
38
  }
38
39
  catch (e) {
39
- console.error(e);
40
+ env_1.logger.error(e);
40
41
  }
41
42
  }
42
43
  async down(queryRunner) {
@@ -1 +1 @@
1
- {"version":3,"file":"1568858861188-SeedSetting.js","sourceRoot":"","sources":["../../server/migrations/1568858861188-SeedSetting.ts"],"names":[],"mappings":";;;AAAA,qCAAwE;AACxE,+DAAsD;AACtD,iDAA8C;AAC9C,4EAIqC;AAErC,MAAM,aAAa,GAAG;IACpB;QACE,IAAI,EAAE,sDAA0B;QAChC,WAAW,EAAE,mBAAmB;QAChC,KAAK,EAAE,EAAE;QACT,QAAQ,EAAE,OAAO;KAClB;IACD;QACE,IAAI,EAAE,oDAAwB;QAC9B,WAAW,EAAE,iBAAiB;QAC9B,KAAK,EAAE,EAAE;QACT,QAAQ,EAAE,OAAO;KAClB;IACD;QACE,IAAI,EAAE,6DAAiC;QACvC,WAAW,EAAE,0BAA0B;QACvC,KAAK,EAAE,EAAE;QACT,QAAQ,EAAE,OAAO;KAClB;CACF,CAAA;AAED,MAAa,wBAAwB;IAC5B,KAAK,CAAC,EAAE,CAAC,WAAwB;QACtC,MAAM,UAAU,GAAG,IAAA,uBAAa,EAAC,sBAAO,CAAC,CAAA;QACzC,MAAM,gBAAgB,GAAG,IAAA,uBAAa,EAAC,cAAM,CAAC,CAAA;QAC9C,MAAM,MAAM,GAAG,MAAM,gBAAgB,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAA;QAEjE,IAAI;YACF,aAAa,CAAC,OAAO,CAAC,KAAK,EAAC,OAAO,EAAC,EAAE;gBACpC,MAAM,UAAU,CAAC,IAAI,iCAAM,OAAO,KAAE,MAAM,IAAG,CAAA;YAC/C,CAAC,CAAC,CAAA;SACH;QAAC,OAAO,CAAC,EAAE;YACV,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;SACjB;IACH,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,WAAwB;QACxC,MAAM,UAAU,GAAG,IAAA,uBAAa,EAAC,sBAAO,CAAC,CAAA;QAEzC,aAAa,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,KAAK,EAAC,OAAO,EAAC,EAAE;YAC9C,IAAI,MAAM,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,CAAA;YAC7D,MAAM,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;QACjC,CAAC,CAAC,CAAA;IACJ,CAAC;CACF;AAvBD,4DAuBC"}
1
+ {"version":3,"file":"1568858861188-SeedSetting.js","sourceRoot":"","sources":["../../server/migrations/1568858861188-SeedSetting.ts"],"names":[],"mappings":";;;AAAA,qCAAwE;AAExE,6CAA4C;AAC5C,+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