@things-factory/operato-wms 4.1.30 → 5.0.0-alpha.3

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 (31) hide show
  1. package/client/pages/inbound/unload-product.js +1 -1
  2. package/client/pages/inventory-check/create-cycle-count.js +0 -2
  3. package/client/pages/master/product/product-detail-bizplace-setting-popup.js +0 -2
  4. package/client/pages/master/product/product-details-popup.js +10 -9
  5. package/client/pages/master/product/product-list.js +10 -9
  6. package/client/pages/order/release-order/b2b/b2b-order-list.js +18 -41
  7. package/client/pages/order/release-order/b2c/b2c-order-requests.js +18 -40
  8. package/client/pages/outbound/packing-product.js +40 -82
  9. package/client/pages/outbound/worksheet-batch-picking.js +1 -1
  10. package/client/pages/report/outbound-order-details-report.js +9 -64
  11. package/dist-server/graphql/index.js +5 -1
  12. package/dist-server/graphql/index.js.map +1 -1
  13. package/dist-server/graphql/resolvers/index.js +5 -1
  14. package/dist-server/graphql/resolvers/index.js.map +1 -1
  15. package/dist-server/graphql/resolvers/reports/outbound-order-details-report.js +48 -53
  16. package/dist-server/graphql/resolvers/reports/outbound-order-details-report.js.map +1 -1
  17. package/dist-server/graphql/types/index.js +5 -1
  18. package/dist-server/graphql/types/index.js.map +1 -1
  19. package/dist-server/graphql/types/reports/outbound-order-details-report.js +0 -3
  20. package/dist-server/graphql/types/reports/outbound-order-details-report.js.map +1 -1
  21. package/dist-server/index.js +5 -1
  22. package/dist-server/index.js.map +1 -1
  23. package/dist-server/utils/index.js +5 -1
  24. package/dist-server/utils/index.js.map +1 -1
  25. package/package.json +51 -51
  26. package/server/graphql/resolvers/reports/outbound-order-details-report.ts +48 -54
  27. package/server/graphql/types/reports/outbound-order-details-report.ts +0 -3
  28. package/translations/en.json +5 -10
  29. package/translations/ko.json +1 -7
  30. package/translations/ms.json +1 -7
  31. package/translations/zh.json +1 -7
@@ -16,7 +16,6 @@ export const outboundOrderDetailsReport = {
16
16
  let toDate = params.filters.find(data => data.name === 'toDate')
17
17
  let roNo = params.filters.find(data => data.name === 'roNo')
18
18
  let doNo = params.filters.find(data => data.name === 'doNo')
19
- let status = params.filters.find(data => data.name === 'status')
20
19
 
21
20
  if (userFilter) {
22
21
  const user: User = await tx.getRepository(User).findOne({
@@ -49,35 +48,60 @@ export const outboundOrderDetailsReport = {
49
48
  extraQueryFilters = `${extraQueryFilters} and delivery_order_no like '%${doNo.value}%' `
50
49
  }
51
50
 
52
- console.time('temp')
53
51
  await tx.query(
54
52
  `
55
53
  create temp table temp_outbound_order_report on commit drop as (
56
54
  select * from (
57
- select oi.id, '${bizplace.id}' AS "bizplace_id", '${bizplace.name}' AS "bizplace_name", '${bizplace.description}' AS "bizplace_description",
58
- do2.name AS "delivery_order_no", do2.delivery_date as "delivery_order_date",
59
- do2."to", do2.contact_point_ref_id,
60
- 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",
55
+ select b2.id AS "bizplace_id", b2.name AS "bizplace_name", b2.description AS "bizplace_description",
56
+ 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",
57
+ 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",
61
58
  rg.created_at AS "order_created_at", rg.accepted_at, u4.name as accepted_by,
62
59
  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",
63
- i.packing_type as "pack_type", i.packing_size as "pack_size", oi.release_qty AS "release_qty",
64
- oi.picked_at, oi.picked_by, oi.packed_at, oi.packed_by, oi.loaded_at, oi.loaded_by, oi.shipped_at,
65
- oi.release_qty as "qty", oi.release_uom_value as "uom_value", i.uom,
66
- oi.return_to_location_qty, oi.return_to_location_uom_value,
67
- i.pallet_id, i.carton_id, i.batch_id, i.batch_id_ref, i.expiration_date, i.manufacture_date
68
- from order_inventories oi
69
- inner join release_goods rg on rg.id = oi.release_good_id
60
+ oi.packing_type as "pack_type", oi.packing_size as "pack_size", oi.release_qty AS "release_qty",
61
+ w.started_at as "picking_start", w.ended_at as "picking_complete",
62
+ 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,
63
+ i.expiration_date, i.manufacture_date,
64
+ ih.created_at as "picked_at", u.name as "picked_by",
65
+ ih2.created_at as "packed_at", u2.name as "packed_by",
66
+ ih3.created_at as "loaded_at", u3.name as "loaded_by",
67
+ ih4.created_at as "shipped_at",
68
+ 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
69
+ order by created_at desc
70
+ fetch first 1 rows only),0) as unit_volume,
71
+ 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
72
+ order by created_at desc
73
+ fetch first 1 rows only),0) as unit_nett_weight,
74
+ 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
75
+ order by created_at desc
76
+ fetch first 1 rows only),0) as unit_gross_weight,
77
+ 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
78
+ order by created_at desc
79
+ fetch first 1 rows only),'') as weight_unit
80
+ from (
81
+ select * from release_goods
82
+ where domain_id = $1 and bizplace_id = $2 and status ='DONE'
83
+ and created_at >= $3 and created_at <= $4
84
+ ) rg
70
85
  left join users u4 on u4.id = rg.accepted_by_id
86
+ inner join bizplaces b2 ON b2.id = rg.bizplace_id
87
+ inner join order_inventories oi on oi.release_good_id = rg.id
71
88
  inner join inventories i on i.id = oi.inventory_id
72
89
  inner join temp_products p on p.id = oi.product_id
90
+ left join worksheets w on w.release_good_id = rg.id and w."type" ='PICKING'
91
+ 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
92
+ left join users u on u.id = ih.creator_id
93
+ 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
94
+ left join users u2 on u2.id = ih2.creator_id
95
+ 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
96
+ left join users u3 on u3.id = ih3.creator_id
97
+ 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
98
+ left join worksheets w2 on w2.release_good_id = rg.id and w2."type" ='PACKING'
99
+ left join worksheets w3 on w3.release_good_id = rg.id and w2."type" ='LOADING'
73
100
  left join delivery_orders do2 on do2.id = oi.delivery_order_id
74
- where exists (
75
- select rg2.id from release_goods rg2
76
- where rg2.domain_id = $1 and rg2.bizplace_id = $2
77
- and rg2.created_at >= $3 and rg2.created_at <= $4 and rg2.id = oi.release_good_id
78
- )
79
- and oi.status <> 'REPLACED'
80
- ${status ? `and rg.status = '${status.value}' ` : ``}
101
+ left join contact_points cp on cp.id = do2.contact_point_ref_id
102
+ left join marketplace_orders mo on mo.release_order_id::uuid = rg.id
103
+ where oi.status <> 'REPLACED'
104
+ order by rg.name, p.sku
81
105
  ) src
82
106
  where 1=1
83
107
  ${extraQueryFilters}
@@ -86,49 +110,22 @@ export const outboundOrderDetailsReport = {
86
110
  [context.state.domain.id, bizplace.id, fromDate.value, toDate.value]
87
111
  )
88
112
 
89
- console.timeEnd('temp')
90
113
  const total: any = await tx.query(`
91
114
  select count(*) from temp_outbound_order_report
92
115
  `)
93
116
 
94
- console.time('result')
95
117
  const result: any = await tx.query(
96
118
  `
97
119
  select *,
98
120
  round((qty * unit_volume)::numeric ,4) as total_volume,
99
121
  round((qty * unit_nett_weight)::numeric ,4) as total_unit_nett_weight,
100
- round((qty * unit_gross_weight)::numeric ,4) as total_unit_gross_weight
101
- from (
102
- select *,
103
- w.started_at as picking_start,
104
- w.ended_at as picking_complete,
105
- coalesce(oi."to", concat(cp.address, cp.address_2)) as "delivery_address",
106
- 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
107
- order by created_at desc
108
- fetch first 1 rows only),0) as unit_volume,
109
- 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
110
- order by created_at desc
111
- fetch first 1 rows only),0) as unit_nett_weight,
112
- 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
113
- order by created_at desc
114
- fetch first 1 rows only),0) as unit_gross_weight,
115
- 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
116
- order by created_at desc
117
- fetch first 1 rows only),'') as weight_unit
118
- from temp_outbound_order_report oi
119
- left join worksheet_details wd on wd.target_inventory_id = oi.id
120
- left join worksheets w on w.id = wd.worksheet_id
121
- left join contact_points cp on cp.id = oi.contact_point_ref_id
122
- where (w.type= 'PICKING' OR w.type = 'BATCH_PICKING')
123
- order by oi.ro_no, oi.product_sku
124
- offset $1 limit $2
125
- ) src
122
+ round((qty * unit_gross_weight)::numeric ,4) as total_unit_gross_weight
123
+ from temp_outbound_order_report
124
+ offset $1 limit $2
126
125
  `,
127
126
  [(params.pagination.page - 1) * params.pagination.limit, params.pagination.limit]
128
127
  )
129
128
 
130
- console.timeEnd('result')
131
-
132
129
  let items = result.map(itm => {
133
130
  return {
134
131
  bizplace: {
@@ -141,10 +138,9 @@ export const outboundOrderDetailsReport = {
141
138
  deliveryAddress: itm.delivery_address,
142
139
  roNo: itm.ro_no,
143
140
  roType: itm.ro_type,
144
- status: itm.ro_status,
145
141
  refNo1: itm.ref_no_1,
146
- refNo3: itm.ref_no_3,
147
142
  refNo2: itm.ref_no_2,
143
+ refNo3: itm.ref_no_3,
148
144
  acceptedBy: itm.accepted_by,
149
145
  acceptedAt: itm.accepted_at,
150
146
  orderCreatedAt: itm.order_created_at,
@@ -162,8 +158,6 @@ export const outboundOrderDetailsReport = {
162
158
  qty: Math.abs(itm.qty),
163
159
  uomValue: Math.abs(itm.uom_value),
164
160
  uom: itm.uom,
165
- returnToLocationQty: itm.return_to_location_qty,
166
- returnToLocationUomValue: itm.return_to_location_uom_value,
167
161
  unitVolume: itm.unit_volume,
168
162
  totalVolume: itm.total_volume,
169
163
  unitNettWeight: itm.unit_nett_weight,
@@ -8,7 +8,6 @@ export const OutboundOrderDetailsReport = gql`
8
8
  deliveryAddress: String
9
9
  roNo: String
10
10
  roType: String
11
- status: String
12
11
  refNo1: String
13
12
  refNo2: String
14
13
  refNo3: String
@@ -23,8 +22,6 @@ export const OutboundOrderDetailsReport = gql`
23
22
  packSize: Int
24
23
  qty: Int
25
24
  uomValue: Float
26
- returnToLocationQty: Int
27
- returnToLocationUomValue: Float
28
25
  uom: String
29
26
  unitVolume: Float
30
27
  totalVolume: Float
@@ -104,7 +104,6 @@
104
104
  "delivery_order_form_invalid": "delivery order form invalid",
105
105
  "field.accepted_at": "accepted at",
106
106
  "field.accepted_by": "accepted by",
107
- "field.actual_lot_qty": "actual lot qty",
108
107
  "field.actual_pack_qty": "actual pack qty",
109
108
  "field.actual_pallet_qty": "actual pallet qty",
110
109
  "field.actual_qty": "actual qty",
@@ -294,7 +293,6 @@
294
293
  "field.location": "location",
295
294
  "field.loose_item": "loose item",
296
295
  "field.lot_id": "lot id",
297
- "field.lot_qty": "lot qty",
298
296
  "field.low_on_stock": "low on stock",
299
297
  "field.main_bizplace": "main customer",
300
298
  "field.manifest_no": "manifest no",
@@ -752,7 +750,6 @@
752
750
  "label.order_status_ready_to_unload": "ready to unload",
753
751
  "label.order_status_received": "received",
754
752
  "label.order_status_rejected": "rejected",
755
- "label.order_status_sorting": "sorting",
756
753
  "label.order_type": "order type",
757
754
  "label.other_destination": "other destination",
758
755
  "label.other": "other",
@@ -1113,14 +1110,15 @@
1113
1110
  "text.invalid_form": "invalid form",
1114
1111
  "text.invalid_format_of_location_id": "invalid format of location id",
1115
1112
  "text.invalid_inventory": "invalid_inventory",
1113
+ "text.manufacture-date-cannot-be-later-than-today": "manufacture date cannot be later than today",
1116
1114
  "text.invalid_no_of_random_item_value": "invalid no of random item value",
1117
1115
  "text.invalid_pack_qty": "invalid pack qty",
1118
1116
  "text.invalid_pallet_id": "invalid pallet id",
1119
1117
  "text.invalid_pallet_qty": "invalid pallet qty",
1120
1118
  "text.invalid_print_qty": "invalid print qty",
1121
1119
  "text.invalid_product_combination": "invalid product combination",
1122
- "text.invalid_qty": "invalid quantity",
1123
1120
  "text.invalid_quantity_input": "invalid quantity input",
1121
+ "text.invalid_qty": "invalid quantity",
1124
1122
  "text.invalid_release_date": "invalid release date",
1125
1123
  "text.invalid_release_qty": "invalid release qty",
1126
1124
  "text.invalid_return_location": "invalid return location",
@@ -1153,7 +1151,6 @@
1153
1151
  "text.manifest_has_been_dispatched_and_closed": "manifest has been dispatched and closed",
1154
1152
  "text.manifest_has_been_generated": "manifest has been generated",
1155
1153
  "text.manifest_items_is_empty": "manifest items is empty",
1156
- "text.manufacture-date-cannot-be-later-than-today": "manufacture date cannot be later than today",
1157
1154
  "text.missing_zone_name": "missing zone name",
1158
1155
  "text.new_batch_id_is_empty": "new batch no is empty",
1159
1156
  "text.no_changes_to_be_submitted": "no changes to be submitted",
@@ -1200,7 +1197,6 @@
1200
1197
  "text.please_select_a_truck": "select a truck",
1201
1198
  "text.please_select_an_inventory": "please select an inventory",
1202
1199
  "text.please_select_label_indicator": "please select label indicator",
1203
- "text.please_select_one_or_more_order_to_generate_worksheet": "please select one or more order to generate worksheet",
1204
1200
  "text.please_select_release_order": "please select release order",
1205
1201
  "text.please_select_the_company": "please select the company",
1206
1202
  "text.please_select_the_contact_type": "please select the contact type",
@@ -1284,10 +1280,8 @@
1284
1280
  "text.selected_inventory_not_using_carton_label": "selected inventory not using carton label",
1285
1281
  "text.selected_item_qty_is_less_than_order_release_qty": "selected item qty is less than order release qty",
1286
1282
  "text.selected_item_qty_is_more_than_order_release_qty": "selected item qty is more than order release qty",
1287
- "text.scanned_product_status_is_done": "scanned product status is done",
1288
1283
  "text.selected_qty_is_less_than_expected": "selected qty is less than expected",
1289
1284
  "text.selected_qty_is_more_than_expected": "selected qty is more than expected",
1290
- "text.selected_release_order(s)_has_existing_worksheet": "selected release order(s) has existing worksheet",
1291
1285
  "text.send_goods_received_note": "send GRN",
1292
1286
  "text.set_order_to_ready_to_ship": "set order to ready to ship",
1293
1287
  "text.shelf_is_not_allowed_as_an_indicator_for_partial_format": "shelf is not allowed as an indicator for partial format",
@@ -1363,7 +1357,6 @@
1363
1357
  "text.warehouse_not_found": "warehouse not found!",
1364
1358
  "text.worksheet_activated": "worksheet activated",
1365
1359
  "text.worksheet_has_been_generated": "worksheet has been generated",
1366
- "text.worksheet(s)_has_been_generated": "worksheet(s) has been generated",
1367
1360
  "text.wrong_carton_id": "wrong carton id",
1368
1361
  "text.wrong_lot_id": "wrong lot id",
1369
1362
  "text.wrong_release_qty": "wrong release qty",
@@ -1692,5 +1685,7 @@
1692
1685
  "title.worksheet_unloading": "worksheet unloading",
1693
1686
  "title.worksheet_vas": "worksheet vas",
1694
1687
  "title.worksheet": "worksheet",
1695
- "vas_order_created": "vas order created"
1688
+ "vas_order_created": "vas order created",
1689
+ "field.lot_qty": "lot qty",
1690
+ "field.actual_lot_qty": "actual lot qty"
1696
1691
  }
@@ -1,5 +1,4 @@
1
1
  {
2
- "label.order_status_sorting": "[ko]sorting",
3
2
  "button.print_internal_awb": "[ko]print internal awb",
4
3
  "arrival_notice_created": "입고주문이 생성 되었습니다.",
5
4
  "arrival_notice_updated": "[ko]arrival notice updated",
@@ -1877,15 +1876,10 @@
1877
1876
  "title.undo_putaway": "[ko] undo putaway",
1878
1877
  "field.lot_qty": "[ko] lot qty",
1879
1878
  "field.actual_lot_qty": "[ko] actual lot qty",
1880
- "text.scanned_product_status_is_done": "[ko] scanned product status is done",
1881
1879
  "field.manufacture_date": "[ko] manufacture date",
1882
1880
  "text.manufacture-date-cannot-be-later-than-today": "[ko] manufacture date cannot be later than today",
1883
1881
  "text.please_select_an_inventory": "[ko] please select an inventory",
1884
1882
  "text.carton_id_not_found": "[ko] carton id not found",
1885
1883
  "text.lot_id_not_found": "[ko] lot id not found",
1886
- "field.volume_m3": "[ko] volume (M3)",
1887
- "text.scanned_product_status_is_done": "[ko] scanned product status is done",
1888
- "text.selected_release_order(s)_has_existing_worksheet": "[ko] selected release order(s) has existing worksheet",
1889
- "text.please_select_one_or_more_order_to_generate_worksheet": "[ko] please select one or more order to generate worksheet",
1890
- "text.worksheet(s)_has_been_generated": "[ko] worksheet(s) has been generated"
1884
+ "field.volume_m3": "[ko] volume (M3)"
1891
1885
  }
@@ -1,5 +1,4 @@
1
1
  {
2
- "label.order_status_sorting": "[ms]sorting",
3
2
  "button.print_internal_awb": "[ms]print internal awb",
4
3
  "arrival_notice_created": "notis ketibaan telah dicipta",
5
4
  "arrival_notice_updated": "notis ketibaan telah dikemaskinikan",
@@ -1747,15 +1746,10 @@
1747
1746
  "title.undo_putaway": "[ms] undo putaway",
1748
1747
  "field.lot_qty": "[ms] lot qty",
1749
1748
  "field.actual_lot_qty": "[ms] actual lot qty",
1750
- "text.scanned_product_status_is_done": "[ms] scanned product status is done",
1751
1749
  "field.manufacture_date": "[ms] manufacture date",
1752
1750
  "text.manufacture-date-cannot-be-later-than-today": "[ms] manufacture date cannot be later than today",
1753
1751
  "text.please_select_an_inventory": "[ms] please select an inventory",
1754
1752
  "text.carton_id_not_found": "[ms] carton id not found",
1755
1753
  "text.lot_id_not_found": "[ms] lot id not found",
1756
- "field.volume_m3": "[ms] volume (M3)",
1757
- "text.scanned_product_status_is_done": "[ms] scanned product status is done",
1758
- "text.selected_release_order(s)_has_existing_worksheet": "[ms] selected release order(s) has existing worksheet",
1759
- "text.please_select_one_or_more_order_to_generate_worksheet": "[ms] please select one or more order to generate worksheet",
1760
- "text.worksheet(s)_has_been_generated": "[ms] worksheet(s) has been generated"
1754
+ "field.volume_m3": "[ms] volume (M3)"
1761
1755
  }
@@ -1,5 +1,4 @@
1
1
  {
2
- "label.order_status_sorting": "[zh]sorting",
3
2
  "button.print_internal_awb": "[zh]print internal awb",
4
3
  "arrival_notice_created": "arrival notice created",
5
4
  "button.activate": "activate",
@@ -1697,15 +1696,10 @@
1697
1696
  "title.undo_putaway": "[zh] undo putaway",
1698
1697
  "field.lot_qty": "[zh] lot qty",
1699
1698
  "field.actual_lot_qty": "[zh] actual lot qty",
1700
- "text.scanned_product_status_is_done": "[zh] scanned product status is done",
1701
1699
  "field.manufacture_date": "[zh] manufacture date",
1702
1700
  "text.manufacture-date-cannot-be-later-than-today": "[zh] manufacture date cannot be later than today",
1703
1701
  "text.please_select_an_inventory": "[zh] please select an inventory",
1704
1702
  "text.carton_id_not_found": "[zh] carton id not found",
1705
1703
  "text.lot_id_not_found": "[zh] lot id not found",
1706
- "field.volume_m3": "[zh] volume (M3)",
1707
- "text.scanned_product_status_is_done": "[zh] scanned product status is done",
1708
- "text.selected_release_order(s)_has_existing_worksheet": "[zh] selected release order(s) has existing worksheet",
1709
- "text.please_select_one_or_more_order_to_generate_worksheet": "[zh] please select one or more order to generate worksheet",
1710
- "text.worksheet(s)_has_been_generated": "[zh] worksheet(s) has been generated"
1704
+ "field.volume_m3": "[zh] volume (M3)"
1711
1705
  }