@things-factory/operato-wms 4.3.105 → 4.3.113-alpha.0

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 (62) hide show
  1. package/client/pages/bulk-operation/bulk-operation.js +9 -15
  2. package/client/pages/components/select-inventory-popup.js +7 -1
  3. package/client/pages/components/select-product-popup.js +31 -2
  4. package/client/pages/inbound/undo-putaway-popup.js +5 -9
  5. package/client/pages/inbound/undo-unload-popup.js +15 -2
  6. package/client/pages/inbound/unload-product.js +72 -67
  7. package/client/pages/inventory/inventory-adjustment-approval.js +4 -5
  8. package/client/pages/inventory/inventory-adjustment.js +7 -0
  9. package/client/pages/inventory-check/check-inventory-popup.js +14 -3
  10. package/client/pages/inventory-check/create-cycle-count.js +2 -3
  11. package/client/pages/inventory-check/inspecting-product.js +25 -7
  12. package/client/pages/inventory-check/inventory-check-list.js +94 -10
  13. package/client/pages/manifest/loading-manifest-detail.js +7 -4
  14. package/client/pages/master/generate-location-list.js +30 -22
  15. package/client/pages/master/location-list.js +134 -71
  16. package/client/pages/master/pallet-list.js +137 -58
  17. package/client/pages/master/product/product-details-popup.js +3 -3
  18. package/client/pages/master/tote-list.js +40 -27
  19. package/client/pages/master/transport-driver.js +50 -41
  20. package/client/pages/master/transport-vehicle.js +45 -41
  21. package/client/pages/master/warehouse-list.js +56 -34
  22. package/client/pages/order/arrival-notice/arrival-notice-detail.js +36 -25
  23. package/client/pages/order/arrival-notice/create-arrival-notice.js +53 -32
  24. package/client/pages/order/arrival-notice/duplicate-arrival-notice.js +2 -0
  25. package/client/pages/order/arrival-notice/edit-product-popup.js +9 -7
  26. package/client/pages/order/draft-release-good/draft-release-good-detail.js +39 -2
  27. package/client/pages/order/release-order/create-release-order.js +22 -5
  28. package/client/pages/order/release-order/release-extra-product-popup.js +4 -1
  29. package/client/pages/order/release-order/release-order-detail.js +24 -0
  30. package/client/pages/order/return-order/create-return-order.js +5 -0
  31. package/client/pages/order/return-order/return-order-inventory-popup.js +1 -0
  32. package/client/pages/order/transport-order/delivery-order-list.js +26 -0
  33. package/client/pages/outbound/inventory-reassign-popup.js +6 -0
  34. package/client/pages/outbound/packing-product.js +5 -5
  35. package/client/pages/outbound/packing-worksheet-list.js +3 -1
  36. package/client/pages/outbound/picking-product.js +18 -7
  37. package/client/pages/outbound/show-my-worksheet-list-popup.js +12 -3
  38. package/client/pages/report/custom-elccl/elccl-daily-collection-report.js +5 -2
  39. package/client/pages/report/custom-elccl/elccl-daily-order-inventory-report.js +2 -2
  40. package/client/pages/report/custom-elccl/elccl-delivery-order-summary.js +48 -8
  41. package/dist-server/graphql/resolvers/custom/elccl/elccl-inventory-history-report.js +4 -5
  42. package/dist-server/graphql/resolvers/custom/elccl/elccl-inventory-history-report.js.map +1 -1
  43. package/dist-server/graphql/resolvers/other/add-release-good-products.js +7 -11
  44. package/dist-server/graphql/resolvers/other/add-release-good-products.js.map +1 -1
  45. package/dist-server/graphql/resolvers/reports/costing-report.js +18 -24
  46. package/dist-server/graphql/resolvers/reports/costing-report.js.map +1 -1
  47. package/dist-server/graphql/resolvers/reports/inbound-order-details-report.js +6 -6
  48. package/dist-server/graphql/resolvers/reports/outbound-order-details-report.js +5 -6
  49. package/dist-server/graphql/resolvers/reports/outbound-order-details-report.js.map +1 -1
  50. package/dist-server/graphql/resolvers/reports/release-inventory-report.js +3 -3
  51. package/dist-server/graphql/resolvers/reports/release-inventory-report.js.map +1 -1
  52. package/package.json +50 -50
  53. package/server/graphql/resolvers/custom/elccl/elccl-inventory-history-report.ts +4 -5
  54. package/server/graphql/resolvers/other/add-release-good-products.ts +8 -12
  55. package/server/graphql/resolvers/reports/costing-report.ts +18 -24
  56. package/server/graphql/resolvers/reports/inbound-order-details-report.ts +6 -6
  57. package/server/graphql/resolvers/reports/outbound-order-details-report.ts +5 -6
  58. package/server/graphql/resolvers/reports/release-inventory-report.ts +6 -4
  59. package/translations/en.json +27 -12
  60. package/translations/ko.json +25 -10
  61. package/translations/ms.json +25 -10
  62. package/translations/zh.json +18 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/operato-wms",
3
- "version": "4.3.105",
3
+ "version": "4.3.113-alpha.0",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "client/index.js",
6
6
  "things-factory": true,
@@ -63,60 +63,60 @@
63
63
  "@operato/scene-tab": "^0.1.8",
64
64
  "@operato/scene-table": "^0.1.8",
65
65
  "@operato/scene-wheel-sorter": "^0.1.8",
66
- "@things-factory/apptool-ui": "^4.3.99",
67
- "@things-factory/attachment-ui": "^4.3.99",
68
- "@things-factory/auth-ui": "^4.3.99",
69
- "@things-factory/barcode-ui": "^4.3.99",
70
- "@things-factory/biz-ui": "^4.3.99",
71
- "@things-factory/board-service": "^4.3.99",
72
- "@things-factory/board-ui": "^4.3.99",
73
- "@things-factory/code-ui": "^4.3.99",
74
- "@things-factory/context-ui": "^4.3.99",
75
- "@things-factory/export-ui": "^4.3.99",
76
- "@things-factory/export-ui-csv": "^4.3.99",
77
- "@things-factory/export-ui-excel": "^4.3.99",
78
- "@things-factory/fav-base": "^4.3.99",
79
- "@things-factory/form-ui": "^4.3.99",
80
- "@things-factory/geography": "^4.3.99",
81
- "@things-factory/grist-ui": "^4.3.99",
82
- "@things-factory/help": "^4.3.99",
83
- "@things-factory/i18n-base": "^4.3.99",
84
- "@things-factory/id-rule-base": "^4.3.99",
85
- "@things-factory/import-ui": "^4.3.99",
86
- "@things-factory/import-ui-excel": "^4.3.99",
87
- "@things-factory/menu-ui": "^4.3.99",
88
- "@things-factory/more-ui": "^4.3.99",
89
- "@things-factory/notification": "^4.3.99",
90
- "@things-factory/pdf": "^4.3.99",
91
- "@things-factory/print-proxy-service": "^4.3.99",
92
- "@things-factory/print-ui": "^4.3.99",
93
- "@things-factory/product-base": "^4.3.101",
94
- "@things-factory/resource-ui": "^4.3.99",
95
- "@things-factory/sales-ui": "^4.3.105",
96
- "@things-factory/scene-data-transform": "^4.3.99",
97
- "@things-factory/scene-excel": "^4.3.99",
98
- "@things-factory/scene-firebase": "^4.3.99",
99
- "@things-factory/scene-form": "^4.3.99",
100
- "@things-factory/scene-google-map": "^4.3.99",
101
- "@things-factory/scene-graphql": "^4.3.99",
102
- "@things-factory/scene-label": "^4.3.99",
103
- "@things-factory/scene-marker": "^4.3.99",
104
- "@things-factory/scene-mqtt": "^4.3.99",
105
- "@things-factory/scene-restful": "^4.3.99",
106
- "@things-factory/scene-visualizer": "^4.3.99",
107
- "@things-factory/setting-ui": "^4.3.99",
108
- "@things-factory/system-ui": "^4.3.99",
109
- "@things-factory/transport-base": "^4.3.99",
110
- "@things-factory/tutorial-ui": "^4.3.99",
111
- "@things-factory/warehouse-base": "^4.3.103",
112
- "@things-factory/worksheet-base": "^4.3.105"
66
+ "@things-factory/apptool-ui": "^4.3.113-alpha.0",
67
+ "@things-factory/attachment-ui": "^4.3.113-alpha.0",
68
+ "@things-factory/auth-ui": "^4.3.113-alpha.0",
69
+ "@things-factory/barcode-ui": "^4.3.113-alpha.0",
70
+ "@things-factory/biz-ui": "^4.3.113-alpha.0",
71
+ "@things-factory/board-service": "^4.3.113-alpha.0",
72
+ "@things-factory/board-ui": "^4.3.113-alpha.0",
73
+ "@things-factory/code-ui": "^4.3.113-alpha.0",
74
+ "@things-factory/context-ui": "^4.3.113-alpha.0",
75
+ "@things-factory/export-ui": "^4.3.113-alpha.0",
76
+ "@things-factory/export-ui-csv": "^4.3.113-alpha.0",
77
+ "@things-factory/export-ui-excel": "^4.3.113-alpha.0",
78
+ "@things-factory/fav-base": "^4.3.113-alpha.0",
79
+ "@things-factory/form-ui": "^4.3.113-alpha.0",
80
+ "@things-factory/geography": "^4.3.113-alpha.0",
81
+ "@things-factory/grist-ui": "^4.3.113-alpha.0",
82
+ "@things-factory/help": "^4.3.113-alpha.0",
83
+ "@things-factory/i18n-base": "^4.3.113-alpha.0",
84
+ "@things-factory/id-rule-base": "^4.3.113-alpha.0",
85
+ "@things-factory/import-ui": "^4.3.113-alpha.0",
86
+ "@things-factory/import-ui-excel": "^4.3.113-alpha.0",
87
+ "@things-factory/menu-ui": "^4.3.113-alpha.0",
88
+ "@things-factory/more-ui": "^4.3.113-alpha.0",
89
+ "@things-factory/notification": "^4.3.113-alpha.0",
90
+ "@things-factory/pdf": "^4.3.113-alpha.0",
91
+ "@things-factory/print-proxy-service": "^4.3.113-alpha.0",
92
+ "@things-factory/print-ui": "^4.3.113-alpha.0",
93
+ "@things-factory/product-base": "^4.3.113-alpha.0",
94
+ "@things-factory/resource-ui": "^4.3.113-alpha.0",
95
+ "@things-factory/sales-ui": "^4.3.113-alpha.0",
96
+ "@things-factory/scene-data-transform": "^4.3.113-alpha.0",
97
+ "@things-factory/scene-excel": "^4.3.113-alpha.0",
98
+ "@things-factory/scene-firebase": "^4.3.113-alpha.0",
99
+ "@things-factory/scene-form": "^4.3.113-alpha.0",
100
+ "@things-factory/scene-google-map": "^4.3.113-alpha.0",
101
+ "@things-factory/scene-graphql": "^4.3.113-alpha.0",
102
+ "@things-factory/scene-label": "^4.3.113-alpha.0",
103
+ "@things-factory/scene-marker": "^4.3.113-alpha.0",
104
+ "@things-factory/scene-mqtt": "^4.3.113-alpha.0",
105
+ "@things-factory/scene-restful": "^4.3.113-alpha.0",
106
+ "@things-factory/scene-visualizer": "^4.3.113-alpha.0",
107
+ "@things-factory/setting-ui": "^4.3.113-alpha.0",
108
+ "@things-factory/system-ui": "^4.3.113-alpha.0",
109
+ "@things-factory/transport-base": "^4.3.113-alpha.0",
110
+ "@things-factory/tutorial-ui": "^4.3.113-alpha.0",
111
+ "@things-factory/warehouse-base": "^4.3.113-alpha.0",
112
+ "@things-factory/worksheet-base": "^4.3.113-alpha.0"
113
113
  },
114
114
  "devDependencies": {
115
- "@things-factory/builder": "^4.3.99",
115
+ "@things-factory/builder": "^4.3.113-alpha.0",
116
116
  "cypress": "^9.4.1",
117
117
  "cypress-file-upload": "^5.0.8",
118
118
  "cypress-localstorage-commands": "^1.6.1",
119
119
  "eslint-plugin-cypress": "^2.12.1"
120
120
  },
121
- "gitHead": "62c2cb76038cdb0f60f9349529e449de9721009d"
121
+ "gitHead": "3dd2e6f58cc2828ab5e2658d3fa47120165c802b"
122
122
  }
@@ -57,7 +57,7 @@ export const elcclInventoryHistoryReport = {
57
57
  create temp table temp_data_src AS
58
58
  (
59
59
  SELECT prd.sku AS product_sku, prd.name AS product_name, prd.description AS product_description, trim(invh.batch_id) as batch_id, invh.product_id,
60
- invh.packing_type, invh.bizplace_id, invh.domain_id,
60
+ invh.product_detail_id, invh.packing_type, invh.bizplace_id, invh.domain_id,
61
61
  invh.ref_order_id, invh.order_no, invh.order_ref_no, invh.transaction_type, invh.created_at,
62
62
  invh.qty, invh.opening_qty, invh.uom_value, invh.opening_uom_value
63
63
  FROM reduced_inventory_histories invh
@@ -86,15 +86,14 @@ export const elcclInventoryHistoryReport = {
86
86
  0 AS rn,
87
87
  $1 AS created_at
88
88
  FROM (
89
- SELECT src.product_sku, src.product_name, src.product_description, src.batch_id, src.product_id, src.packing_type, src.bizplace_id,
89
+ SELECT src.product_sku, src.product_name, src.product_description, src.batch_id, src.product_id, src.product_detail_id, src.packing_type, src.bizplace_id,
90
90
  src.domain_id
91
91
  FROM temp_data_src src
92
- GROUP BY src.product_sku, src.product_name, src.product_description, src.batch_id, src.product_id, src.packing_type, src.bizplace_id,
92
+ GROUP BY src.product_sku, src.product_name, src.product_description, src.batch_id, src.product_id, src.product_detail_id, src.packing_type, src.bizplace_id,
93
93
  src.domain_id
94
94
  ) AS src
95
95
  LEFT JOIN inventory_histories invh ON src.batch_id = trim(invh.batch_id) AND
96
- src.product_id = invh.product_id AND
97
- src.packing_type = invh.packing_type AND
96
+ src.product_detail_id = invh.product_detail_id AND
98
97
  src.bizplace_id = invh.bizplace_id AND
99
98
  src.domain_id = invh.domain_id AND
100
99
  invh.created_at < $1::timestamp AND
@@ -2,7 +2,7 @@ import { EntityManager, In, Not } from 'typeorm'
2
2
 
3
3
  import { User } from '@things-factory/auth-base'
4
4
  import { Bizplace } from '@things-factory/biz-base'
5
- import { Product } from '@things-factory/product-base'
5
+ import { Product, ProductDetail } from '@things-factory/product-base'
6
6
  import {
7
7
  ORDER_INVENTORY_STATUS,
8
8
  ORDER_PRODUCT_STATUS,
@@ -48,7 +48,7 @@ export const addReleaseGoodProducts = {
48
48
  curOrderInv.domain = domain
49
49
  curOrderInv.bizplace = bizplace
50
50
  curOrderInv.releaseGood = releaseGood
51
- curOrderInv.product = await tx.getRepository(Product).findOne(oi.product.id)
51
+ curOrderInv.productDetail = await tx.getRepository(ProductDetail).findOne(oi.productDetail.id)
52
52
 
53
53
  let existingOrderInv: OrderInventory
54
54
 
@@ -59,9 +59,8 @@ export const addReleaseGoodProducts = {
59
59
  existingOrderInv = await tx.getRepository(OrderInventory).findOne({
60
60
  where: {
61
61
  releaseGood,
62
- product: curOrderInv.product,
62
+ productDetail: curOrderInv.productDetail,
63
63
  batchId: curOrderInv.batchId,
64
- packingType: curOrderInv.packingType,
65
64
  inventory: foundInv
66
65
  }
67
66
  })
@@ -204,7 +203,6 @@ export const addReleaseGoodProducts = {
204
203
  newOrderInv.status = pickingWorksheet ? ORDER_INVENTORY_STATUS.PICKING : ORDER_INVENTORY_STATUS.PENDING
205
204
  newOrderInv.name = OrderNoGenerator.orderInventory()
206
205
  newOrderInv.releaseGood = releaseGood
207
- newOrderInv.product = await tx.getRepository(Product).findOne(oi.product.id)
208
206
  newOrderInv.creator = user
209
207
  newOrderInv.updater = user
210
208
 
@@ -215,8 +213,7 @@ export const addReleaseGoodProducts = {
215
213
  domain,
216
214
  releaseGood,
217
215
  batchId: oi.batchId,
218
- packingType: oi.packingType,
219
- product: newOrderInv.product
216
+ productDetail: newOrderInv.productDetail
220
217
  }
221
218
  })
222
219
 
@@ -232,9 +229,8 @@ export const addReleaseGoodProducts = {
232
229
  existingOrderInv = await tx.getRepository(OrderInventory).findOne({
233
230
  where: {
234
231
  releaseGood,
235
- product: newOrderInv.product,
232
+ productDetail: newOrderInv.productDetail,
236
233
  batchId: newOrderInv.batchId,
237
- packingType: newOrderInv.packingType,
238
234
  inventory: foundInv
239
235
  }
240
236
  })
@@ -263,9 +259,8 @@ export const addReleaseGoodProducts = {
263
259
  existingOrderInv = await tx.getRepository(OrderInventory).findOne({
264
260
  where: {
265
261
  releaseGood,
266
- product: newOrderInv.product,
267
- batchId: newOrderInv.batchId,
268
- packingType: newOrderInv.packingType
262
+ productDetail: newOrderInv.productDetail,
263
+ batchId: newOrderInv.batchId
269
264
  }
270
265
  })
271
266
  }
@@ -325,6 +320,7 @@ export const addReleaseGoodProducts = {
325
320
  savedOrderInv.packingType = newOrderInv.packingType
326
321
  savedOrderInv.uom = newOrderInv.uom
327
322
  savedOrderInv.product = newOrderInv.product
323
+ savedOrderInv.productDetail = newOrderInv.productDetail
328
324
  savedOrderInv.inventory = newOrderInv.inventory
329
325
  savedOrderInv.status = newOrderInv.status
330
326
  savedOrderInv.releaseGood = newOrderInv.releaseGood
@@ -41,18 +41,18 @@ export const costingReport = {
41
41
  await tx.query(
42
42
  `
43
43
  create temp table tmp_outbound_ord on commit drop as (
44
- select p.sku, rih.domain_id, rih.bizplace_id, rih.product_id, rih.packing_type, rih.packing_size, coalesce(rih.uom, pd.uom, pd2.uom) as uom,
44
+ select p.sku, rih.domain_id, rih.bizplace_id, rih.product_detail_id, coalesce(rih.uom, pd.uom, pd2.uom) as uom,
45
45
  sum(rih.qty) as total_picked_qty, sum(rih.uom_value) as total_picked_uom_value
46
46
  from reduced_inventory_histories rih
47
47
  inner join inventories inv on inv.domain_id = rih.domain_id and inv.pallet_id = rih.pallet_id
48
- left join product_details pd on pd.product_id = rih.product_id and pd.packing_type = rih.packing_type and pd.packing_size = rih.packing_size
48
+ left join product_details pd on pd.id = rih.product_detail_id
49
49
  left join product_details pd2 on pd2.product_id = rih.product_id and pd2.is_default = true
50
50
  left join products p on p.id = rih.product_id
51
51
  where rih.domain_id = $1
52
52
  and inv.bizplace_id = $2
53
53
  and rih.created_at >= $3 and rih.created_at <= $4
54
54
  and rih.transaction_type = 'PICKING'
55
- group by p.sku, rih.domain_id, rih.bizplace_id, rih.product_id, rih.packing_type, rih.packing_size, coalesce(rih.uom, pd.uom, pd2.uom)
55
+ group by p.sku, rih.domain_id, rih.bizplace_id, rih.product_detail_id, coalesce(rih.uom, pd.uom, pd2.uom)
56
56
  );
57
57
  `,
58
58
  [context.state.domain.id, bizplace.id, fromDate.value, toDate.value]
@@ -61,14 +61,14 @@ export const costingReport = {
61
61
  await tx.query(
62
62
  `
63
63
  create temp table tmp_stored_inv on commit drop as (
64
- select src2.sku, src2.domain_id, src2.bizplace_id, src2.pallet_id, src2.product_id, src2.packing_type, src2.packing_size, src2.uom,
64
+ select src2.sku, src2.domain_id, src2.bizplace_id, src2.pallet_id, src2.product_detail_id, src2.uom,
65
65
  to_char(src2.created_at, 'YYYY-MM') as created_year_month, sum(closing_qty) as closing_qty from (
66
- select distinct on (rih.pallet_id) p.sku, rih.domain_id, rih.bizplace_id, rih.pallet_id, rih.product_id, rih.packing_type, rih.packing_size,
66
+ select distinct on (rih.pallet_id) p.sku, rih.domain_id, rih.bizplace_id, rih.pallet_id, rih.product_detail_id,
67
67
  coalesce(rih.uom, pd.uom, pd2.uom) as uom,
68
68
  rih.created_at, rih.transaction_type, rih.status, rih.opening_qty + rih.qty as closing_qty
69
69
  from reduced_inventory_histories rih
70
70
  inner join inventories i on i.domain_id = rih.domain_id and i.pallet_id = rih.pallet_id
71
- left join product_details pd on pd.product_id = rih.product_id and pd.packing_type = rih.packing_type and pd.packing_size = rih.packing_size
71
+ left join product_details pd on pd.id = rih.product_detail_id
72
72
  left join product_details pd2 on pd2.product_id = rih.product_id and pd2.is_default = true
73
73
  left join products p on p.id = rih.product_id
74
74
  where rih.domain_id = $1
@@ -80,12 +80,10 @@ export const costingReport = {
80
80
  select * from tmp_outbound_ord outboundOrd
81
81
  where outboundOrd.domain_id = src2.domain_id
82
82
  and outboundOrd.bizplace_id = src2.bizplace_id
83
- and outboundOrd.product_id = src2.product_id
84
- and outboundOrd.packing_type = src2.packing_type
85
- and outboundOrd.packing_size = src2.packing_size
83
+ and outboundOrd.product_detail_id = src2.product_detail_id
86
84
  and outboundOrd.uom = src2.uom
87
85
  )
88
- group by src2.sku, src2.domain_id, src2.bizplace_id, src2.pallet_id, src2.product_id, src2.packing_type, src2.packing_size, src2.uom, to_char(src2.created_at, 'YYYY-MM')
86
+ group by src2.sku, src2.domain_id, src2.bizplace_id, src2.pallet_id, src2.product_detail_id, src2.uom, to_char(src2.created_at, 'YYYY-MM')
89
87
  );
90
88
  `,
91
89
  [context.state.domain.id, bizplace.id, toDate.value]
@@ -95,11 +93,11 @@ export const costingReport = {
95
93
  `
96
94
  create temp table temp_costing_report on commit drop as (
97
95
  WITH RECURSIVE cte_forwarded_cost as (
98
- select src.domain_id, src.bizplace_id, src.product_id, src.packing_type, src.packing_size, src.uom, TO_DATE(src.created_year_month,'YYYY-MM')::timestamp as running_year_month,
96
+ select src.domain_id, src.bizplace_id, src.product_id, src.product_detail_id, src.uom, TO_DATE(src.created_year_month,'YYYY-MM')::timestamp as running_year_month,
99
97
  sum(src.qty) as qty, sum(src.total_cost)/ sum(src.qty) as monthly_avg_cost,
100
98
  coalesce(sum(src.qty)) as closing_qty from (
101
99
  select distinct on (pallet_id)
102
- ih.domain_id, ih.bizplace_id, ih.pallet_id, ih.unit_cost, (ih.unit_cost * (ih.opening_qty + ih.qty)) as total_cost, ih.status, ih.transaction_type, ih.product_id, ih.packing_type, ih.packing_size, coalesce(ih.uom, pd.uom) as uom,
100
+ ih.domain_id, ih.bizplace_id, ih.pallet_id, ih.unit_cost, (ih.unit_cost * (ih.opening_qty + ih.qty)) as total_cost, ih.status, ih.transaction_type, ih.product_id, ih.product_detail_id, coalesce(ih.uom, pd.uom) as uom,
103
101
  ih.created_at, to_char(ih.created_at, 'YYYY-MM') as created_year_month,
104
102
  ih.opening_qty,
105
103
  ih.qty as transaction_qty,
@@ -109,7 +107,7 @@ export const costingReport = {
109
107
  ih.opening_uom_value + ih.uom_value as uom_value
110
108
  from reduced_inventory_histories ih
111
109
  inner join inventories i on i.domain_id = ih.domain_id and i.pallet_id = ih.pallet_id
112
- left join product_details pd on pd.product_id = ih.product_id and pd.packing_type = ih.packing_type and pd.packing_size = ih.packing_size
110
+ left join product_details pd on pd.id = ih.product_detail_id
113
111
  where ih.domain_id = $1
114
112
  and i.bizplace_id = $2
115
113
  and ih.created_at <= $3 and ih.unit_cost is not null
@@ -117,33 +115,29 @@ export const costingReport = {
117
115
  select * from tmp_outbound_ord outboundOrd
118
116
  where outboundOrd.domain_id = ih.domain_id
119
117
  and outboundOrd.bizplace_id = ih.bizplace_id
120
- and outboundOrd.product_id = ih.product_id
121
- and outboundOrd.packing_type = ih.packing_type
122
- and outboundOrd.packing_size = ih.packing_size
118
+ and outboundOrd.product_detail_id = ih.product_detail_id
123
119
  and outboundOrd.uom = ih.uom
124
120
  )
125
121
  order by ih.pallet_id, ih.seq
126
122
  ) src
127
- group by src.domain_id, src.bizplace_id, src.product_id, src.packing_type, src.packing_size, src.uom, src.created_year_month
123
+ group by src.domain_id, src.bizplace_id, src.product_id, src.product_detail_id, src.uom, src.created_year_month
128
124
  union all
129
- select dt1.domain_id, dt1.bizplace_id, dt1.product_id, dt1.packing_type, dt1.packing_size, dt1.uom,
125
+ select dt1.domain_id, dt1.bizplace_id, dt1.product_id, dt1.product_detail_id, dt1.uom,
130
126
  dt1.running_year_month + interval '1 month' as running_year_month, dt1.qty, dt1.monthly_avg_cost, dt1.closing_qty
131
127
  from cte_forwarded_cost dt1
132
128
  where dt1.running_year_month + interval '1 month' < $3
133
129
  ) select fc.*, -outboundord.total_picked_qty as "qty", -outboundord.total_picked_uom_value as "uom_value", (-outboundord.total_picked_qty * fc.weighted_avg_unit_cost) as "total_cost" from (
134
130
  select p.sku as "product_sku", p."name" as "product_name", p.description as "product_description", p."type" as "product_type",
135
- fc.domain_id, fc.bizplace_id, fc.product_id, fc.packing_type, fc.packing_size, fc.uom, fc.running_year_month,
131
+ fc.domain_id, fc.bizplace_id, fc.product_detail_id, fc.uom, fc.running_year_month,
136
132
  ROUND(cast(sum(fc.monthly_avg_cost * fc.closing_qty) / sum(fc.qty) as numeric),2) as "weighted_avg_unit_cost"
137
133
  from cte_forwarded_cost fc
138
134
  left join products p on p.id = fc.product_id
139
135
  where running_year_month = to_date(to_char($3::date, 'YYYY-MM'),'YYYY-MM')::timestamp
140
- group by p.sku, p."name", p.description, p."type", fc.domain_id, fc.bizplace_id, fc.product_id, fc.packing_type, fc.packing_size, fc.uom, fc.running_year_month
136
+ group by p.sku, p."name", p.description, p."type", fc.domain_id, fc.bizplace_id, fc.product_detail_id, fc.uom, fc.running_year_month
141
137
  ) fc
142
138
  left join tmp_outbound_ord outboundord on outboundord.domain_id = fc.domain_id
143
139
  and outboundord.bizplace_id = fc.bizplace_id
144
- and outboundord.product_id = fc.product_id
145
- and outboundord.packing_type = fc.packing_type
146
- and outboundord.packing_size = fc.packing_size
140
+ and outboundord.product_detail_id = fc.product_detail_id
147
141
  and outboundord.uom = fc.uom
148
142
  );
149
143
  `,
@@ -151,7 +145,7 @@ export const costingReport = {
151
145
  )
152
146
 
153
147
  const total: any = await tx.query(`
154
- select count(*) from temp_costing_report
148
+ select count(*) from temp_costing_report
155
149
  `)
156
150
 
157
151
  const result: any = await tx.query(
@@ -81,16 +81,16 @@ export const inboundOrderDetailsReport = {
81
81
  ih.unit_cost,
82
82
  ih.created_at as "unloaded_at",u2.name as "unloaded_by",
83
83
  ih2.created_at as "putaway_at", u3.name as "putaway_by",
84
- 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
84
+ coalesce((select volume from product_details pd where pd.id = i.product_detail_id
85
85
  order by created_at desc
86
86
  fetch first 1 rows only),0) as unit_volume,
87
- 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
87
+ coalesce((select nett_weight from product_details pd where pd.id = i.product_detail_id
88
88
  order by created_at desc
89
89
  fetch first 1 rows only),0) as unit_nett_weight,
90
- 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
90
+ coalesce((select gross_weight from product_details pd where pd.id = i.product_detail_id
91
91
  order by created_at desc
92
92
  fetch first 1 rows only),0) as unit_gross_weight,
93
- 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
93
+ coalesce((select weight_unit from product_details pd where pd.id = i.product_detail_id
94
94
  order by created_at desc
95
95
  fetch first 1 rows only),'') as weight_unit
96
96
  from (
@@ -111,8 +111,8 @@ export const inboundOrderDetailsReport = {
111
111
  inner join reduced_inventory_histories ih2 on ih2.inventory_id = oi.inventory_id and ih2.transaction_type ='PUTAWAY' and ih2.ref_order_id = an.id::varchar
112
112
  left join users u3 on u3.id = ih2.creator_id
113
113
  inner join temp_products p on p.id = ih.product_id
114
- inner join order_products op on op.arrival_notice_id = an.id and op.actual_pack_qty is not null and op.product_id = ih.product_id and
115
- op.batch_id = ih.batch_id and op.packing_type = ih.packing_type
114
+ inner join order_products op on op.arrival_notice_id = an.id and op.actual_pack_qty is not null and op.product_detail_id = ih.product_detail_id and
115
+ op.batch_id = ih.batch_id
116
116
  order by an.name, p.sku, ih.batch_id
117
117
  ) src
118
118
  where 1=1
@@ -56,7 +56,7 @@ export const outboundOrderDetailsReport = {
56
56
  select * from (
57
57
  select oi.id,
58
58
  oi.release_qty AS "release_qty", oi.picked_at, oi.picked_by, oi.packed_at, oi.packed_by, oi.loaded_at, oi.loaded_by,
59
- oi.release_qty as "qty", oi.release_uom_value as "uom_value", oi.return_to_location_qty, oi.return_to_location_uom_value,
59
+ oi.release_qty as "qty", oi.release_uom_value as "uom_value", oi.return_to_location_qty, oi.return_to_location_uom_value, oi.product_detail_id,
60
60
  coalesce(do2.other_driver, td.name) as driver_name,
61
61
  coalesce(do2.truck_no, tv.name, rg.truck_no) as vehicle_no,
62
62
  do2.name AS "delivery_order_no", do2.delivery_date AS "delivery_order_delivery_date", do2."to", do2.contact_point_ref_id, do2.pallet_qty,
@@ -68,7 +68,6 @@ export const outboundOrderDetailsReport = {
68
68
  u1.name as "order_created_by", rg.created_at AS "order_created_at",
69
69
  rg.accepted_at, u4.name as accepted_by, rg.checked_remark_by, rg.checked_remark_at, coalesce(do2.own_collection, rg.own_transport) AS own_transport,
70
70
  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",
71
- i.packing_type as "pack_type", i.packing_size as "pack_size",
72
71
  i.uom, i.unit_cost,
73
72
  i.id as inventory_id, i.pallet_id, i.carton_id, i.batch_id, i.batch_id_ref, i.expiration_date, i.manufacture_date,
74
73
  coalesce(ms.name,'') as manifest_no, coalesce(rg.manifested_at, ms.created_at) as manifested_at, coalesce(u6.name, u5.name) as manifested_by
@@ -126,16 +125,16 @@ export const outboundOrderDetailsReport = {
126
125
  wsort.started_at as sorting_start, wsort.ended_at as sorting_complete,
127
126
  wload.started_at as loading_start, wload.ended_at as loading_complete,
128
127
  coalesce(delivery_address, concat(cp.address, cp.address_2)) as "delivery_address",
129
- 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
128
+ coalesce((select volume from product_details pd where pd.id = oi.product_detail_id
130
129
  order by created_at desc
131
130
  fetch first 1 rows only),0) as unit_volume,
132
- 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
131
+ coalesce((select nett_weight from product_details pd where pd.id = oi.product_detail_id
133
132
  order by created_at desc
134
133
  fetch first 1 rows only),0) as unit_nett_weight,
135
- 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
134
+ coalesce((select gross_weight from product_details pd where pd.id = oi.product_detail_id
136
135
  order by created_at desc
137
136
  fetch first 1 rows only),0) as unit_gross_weight,
138
- 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
137
+ coalesce((select weight_unit from product_details pd where pd.id = oi.product_detail_id
139
138
  order by created_at desc
140
139
  fetch first 1 rows only),'') as weight_unit,
141
140
  coalesce((select unit_cost from reduced_inventory_histories rih where
@@ -35,7 +35,9 @@ export const releaseInventoryReport = {
35
35
  // }
36
36
 
37
37
  // if (!bizplaceFilter) throw 'Invalid input'
38
- let roFilter = '', ccFilter = '', queryFilter = ''
38
+ let roFilter = '',
39
+ ccFilter = '',
40
+ queryFilter = ''
39
41
  if (order) {
40
42
  let orderValue = order.value
41
43
  .toLowerCase()
@@ -108,7 +110,7 @@ export const releaseInventoryReport = {
108
110
  where release_good_id is not null
109
111
  and od.status in ('PENDING', 'PENDING_RECEIVE', 'PENDING_CANCEL', 'PENDING_WORKSHEET', 'READY_TO_PICK', 'PICKING')
110
112
  and od.domain_id = $1
111
- and oi.status != 'REPLACED'
113
+ and oi.status not in ('REPLACED', 'MISSING')
112
114
  group by inventory_id, release_good_id
113
115
  ) oi
114
116
  inner join release_goods od on od.id = oi.release_good_id
@@ -166,10 +168,10 @@ export const releaseInventoryReport = {
166
168
  sku: itm.product_sku,
167
169
  name: itm.product_name,
168
170
  description: itm.product_description,
169
- brand: itm.product_brand,
171
+ brand: itm.product_brand
170
172
  },
171
173
  location: {
172
- name: itm.location_name,
174
+ name: itm.location_name
173
175
  },
174
176
  packingType: itm.packing_type,
175
177
  assignedQty: itm.assigned_qty,
@@ -62,7 +62,7 @@
62
62
  "button.move_to_x": "move to {state.x}",
63
63
  "button.move": "move",
64
64
  "button.my_worksheet_list": "my worksheet list",
65
- "button.next_order":"next order",
65
+ "button.next_order": "next order",
66
66
  "button.okay": "okay",
67
67
  "button.order_remark": "order remark",
68
68
  "button.order_sorted": "order sorted",
@@ -214,10 +214,10 @@
214
214
  "field.comment": "comment",
215
215
  "field.company": "company",
216
216
  "field.completed": "completed",
217
- "field.contact": "contact",
218
217
  "field.contact_name": "contact name",
219
218
  "field.contact_point": "contact point",
220
219
  "field.contact_type": "contact type",
220
+ "field.contact": "contact",
221
221
  "field.container_no": "container no",
222
222
  "field.container_size": "container size",
223
223
  "field.container": "container",
@@ -493,8 +493,8 @@
493
493
  "field.replenishment_order_no": "replenishment order no",
494
494
  "field.request_date": "request date",
495
495
  "field.require_packing": "require packing",
496
- "field.require_serial_number_scanning_inbound":"require serial number scanning inbound",
497
- "field.require_serial_number_scanning_outbound":"require serial number scanning outbound",
496
+ "field.require_serial_number_scanning_inbound": "require serial number scanning inbound",
497
+ "field.require_serial_number_scanning_outbound": "require serial number scanning outbound",
498
498
  "field.require_serial_number_scanning": "require serial number scanning",
499
499
  "field.reserve_qty": "reserve qty",
500
500
  "field.reserve_stock_only": "reserve stock only",
@@ -571,6 +571,7 @@
571
571
  "field.total_cost": "total cost",
572
572
  "field.total_delivery": "total delivery",
573
573
  "field.total_pack_qty": "total pack qty",
574
+ "field.total_pallet": "total pallet",
574
575
  "field.total_price": "total price",
575
576
  "field.total_qty": "total qty",
576
577
  "field.total_quantity": "total quantity",
@@ -635,8 +636,6 @@
635
636
  "field.your_name": "your name",
636
637
  "field.zone": "zone",
637
638
  "filed.role": "role",
638
- "field.delivery_address": "delivery address",
639
- "field.total_pallet": "total pallet",
640
639
  "label.activated": "activated",
641
640
  "label.actual_qty": "actual qty",
642
641
  "label.add_extension": "add extension",
@@ -1088,6 +1087,7 @@
1088
1087
  "text.add_extra_product": "add extra product",
1089
1088
  "text.adjustment_pending_admin_approval": "adjustment pending admin approval",
1090
1089
  "text.advise_mt_date_is_empty": "advise mt date is empty",
1090
+ "text.all_related_serial_number_will_be_deleted": "all related serial number will be deleted!",
1091
1091
  "text.already_existed": "row {state.text} is already existed",
1092
1092
  "text.are_empty": "are empty",
1093
1093
  "text.are_you_sure_to_change_the_order_status_to_Done": "are you sure to change the to Done?",
@@ -1202,7 +1202,7 @@
1202
1202
  "text.do_you_want_to_mark_it_as_missing": "do you want to mark it as missing?",
1203
1203
  "text.do_you_want_to_print": "do you want to print",
1204
1204
  "text.do_you_want_to_proceed": "do you want to proceed",
1205
- "text.do_you_wish_to_proceed_the_selected_products_will_be_removed": "do you wish to proceed? The selected product will be removed.",
1205
+ "text.do_you_wish_to_proceed_the_selected_products_will_be_removed": "Do you wish to proceed? The selected product will be removed.",
1206
1206
  "text.document_has_been_generated": "document has been generated",
1207
1207
  "text.draft_order_form_invalid": "draft order form invalid",
1208
1208
  "text.draft_purchase_order": "draft purchase order",
@@ -1230,6 +1230,7 @@
1230
1230
  "text.extra_products_were_added": "extra products were added",
1231
1231
  "text.field": "field",
1232
1232
  "text.fields": "fields",
1233
+ "text.from_date_cannot_be_empty": "from date cannot be empty",
1233
1234
  "text.from_date_is_empty": "from date is empty",
1234
1235
  "text.from_location_is_same_as_to_location": "from location is same as to location",
1235
1236
  "text.from_location_not_match_with_location": "from location not match with location",
@@ -1262,12 +1263,14 @@
1262
1263
  "text.invalid_form_value": "invalid form value",
1263
1264
  "text.invalid_form": "invalid form",
1264
1265
  "text.invalid_format_of_location_id": "invalid format of location id",
1266
+ "text.invalid_holder": "invalid holder",
1265
1267
  "text.invalid_inventory": "invalid_inventory",
1266
- "text.invalid_manufacture_date":"invalid manufacture date",
1268
+ "text.invalid_manufacture_date": "invalid manufacture date",
1267
1269
  "text.invalid_no_of_random_item_value": "invalid no of random item value",
1270
+ "text.invalid_owner": "invalid owner",
1268
1271
  "text.invalid_pack_qty": "invalid pack qty",
1269
- "text.invalid_packing_size":"invalid packing size",
1270
- "text.invalid_packing_type":"invalid packing type",
1272
+ "text.invalid_packing_size": "invalid packing size",
1273
+ "text.invalid_packing_type": "invalid packing type",
1271
1274
  "text.invalid_pallet_id": "invalid pallet id",
1272
1275
  "text.invalid_pallet_qty": "invalid pallet qty",
1273
1276
  "text.invalid_print_qty": "invalid print qty",
@@ -1277,7 +1280,7 @@
1277
1280
  "text.invalid_release_date": "invalid release date",
1278
1281
  "text.invalid_release_qty": "invalid release qty",
1279
1282
  "text.invalid_return_location": "invalid return location",
1280
- "text.invalid_unit_cost":"invalid unit cost",
1283
+ "text.invalid_unit_cost": "invalid unit cost",
1281
1284
  "text.invalid_uom_value_input": "invalid uom value input",
1282
1285
  "text.invalid_uom_value": "invalid uom value",
1283
1286
  "text.invalid_value_in_list": "invalid value in list",
@@ -1302,7 +1305,10 @@
1302
1305
  "text.location_code_is_empty": "location code is empty",
1303
1306
  "text.location_id_is_empty": "location id is empty",
1304
1307
  "text.location_is_not_selected": "location is not selected",
1308
+ "text.location_name(s)_already_existed": "location name(s) already existed",
1305
1309
  "text.location_scanned_is_not_a_quarantine_zone_or_reserved_zone": "Location scanned is not a quarantine zone or reserved zone!",
1310
+ "text.location_status_does_not_exist": "location status does not exist",
1311
+ "text.location_type_does_not_exist": "location type does not exist",
1306
1312
  "text.logistics_has_been_initialised": "logistics has been initialised",
1307
1313
  "text.lot_id_is_duplicated": "lot ID is duplicated",
1308
1314
  "text.lot_id_is_empty": "lot ID is empty",
@@ -1316,6 +1322,7 @@
1316
1322
  "text.manufacture-date-cannot-be-later-than-today": "manufacture date cannot be later than today",
1317
1323
  "text.minimum_of_2_orders_required_for_batch_picking": "Minimum of 2 orders required for batch picking",
1318
1324
  "text.missing_zone_name": "missing zone name",
1325
+ "text.month_is_empty": "month is empty",
1319
1326
  "text.new_batch_id_is_empty": "new batch no is empty",
1320
1327
  "text.no_available_worksheet_selected": "no available worksheet selected",
1321
1328
  "text.no_changes_to_be_submitted": "no changes to be submitted",
@@ -1348,8 +1355,11 @@
1348
1355
  "text.owner_field_is_empty": "owner field is empty",
1349
1356
  "text.pack_qty_and_unit_price_will_be_updated_to_1_if_the_value_is_empty_or_0": "pack qty and unit price will be updated to 1 if the value is empty or 0",
1350
1357
  "text.packing_is_completed": "packing is completed",
1358
+ "text.pallet_(x)_is_not_found_in_cycle_count_worksheet_(y)": "pallet ({x}) is not found in cycle count worksheet ({y})",
1351
1359
  "text.pallet_is_in_progressing": "pallet is in progressing",
1360
+ "text.pallet_name(s)_is_already_existed": "pallet name(s) is already existed",
1352
1361
  "text.pallet_qty_is_empty": "pallet qty is empty",
1362
+ "text.pallet_status_does_not_exist": "pallet status does not exist",
1353
1363
  "text.parcels_are_found_with_cancelled_or_pending_cancelled_status": "parcels are found with cancelled or pending cancelled status",
1354
1364
  "text.partial_complete": "partial unloading",
1355
1365
  "text.partial_format": "partial format",
@@ -1368,6 +1378,7 @@
1368
1378
  "text.please_select_a_driver": "please select a driver",
1369
1379
  "text.please_select_a_truck": "select a truck",
1370
1380
  "text.please_select_an_inventory": "please select an inventory",
1381
+ "text.please_select_container_size": "please select container size",
1371
1382
  "text.please_select_label_indicator": "please select label indicator",
1372
1383
  "text.please_select_one_or_more_order_to_generate_worksheet": "please select one or more order to generate worksheet",
1373
1384
  "text.please_select_release_order": "please select release order",
@@ -1505,11 +1516,14 @@
1505
1516
  "text.there_is_non_assigned_vas": "there is non-assigned vas",
1506
1517
  "text.there_is_not_ready_vas": "there is not ready vas",
1507
1518
  "text.there_is_nothing_to_restore": "there is nothing to restore",
1519
+ "text.there_is_nothing_changed": "there is nothing changed",
1508
1520
  "text.there_is_release_qty_no_amendment_is_allowed": "there is release qty, no amendment is allowed",
1509
1521
  "text.there_is_uncompleted_task": "there is uncompleted task",
1510
1522
  "text.there_no_selected": "there no selected",
1511
1523
  "text.theres_no_pallet_selected": "there's no pallet selected",
1512
1524
  "text.this_is_cross_docking": "this is cross docking",
1525
+ "text.to_date_cannot_be_before_from_date": "to date cannot be before from date",
1526
+ "text.to_date_cannot_be_empty": "to date cannot be empty",
1513
1527
  "text.to_date_is_empty": "to date is empty",
1514
1528
  "text.to_lot_id_is_empty": "to lot ID is empty",
1515
1529
  "text.tote_box_(x)_is_scanned": "tote box ({x}) is scanned",
@@ -1519,6 +1533,7 @@
1519
1533
  "text.tote_is_dispatched_please_scan_again": "tote is dispatched, please scan again",
1520
1534
  "text.tote_is_not_scanned": "tote is not scanned",
1521
1535
  "text.tote_number": "tote number",
1536
+ "text.tote_status_does_not_exist": "tote status does not exist",
1522
1537
  "text.tracking_no_added_successfully": "tracking no added successfully",
1523
1538
  "text.tracking_no_already_exist_in_manifest_list": "tracking no already exist in manifest list",
1524
1539
  "text.transfer_inventory_to_different_location": "transfer inventory to different location",
@@ -1908,4 +1923,4 @@
1908
1923
  "title.worksheet_vas": "worksheet vas",
1909
1924
  "title.worksheet": "worksheet",
1910
1925
  "vas_order_created": "vas order created"
1911
- }
1926
+ }