@things-factory/operato-wms 4.2.12 → 4.3.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 (88) hide show
  1. package/client/constants/index.js +1 -0
  2. package/client/constants/order.js +14 -0
  3. package/client/pages/constants/index.js +1 -0
  4. package/client/pages/constants/setting.js +1 -0
  5. package/client/pages/constants/tote.js +14 -0
  6. package/client/pages/inbound/unload-product.js +1 -1
  7. package/client/pages/inventory/inventory-adjustment-approval.js +24 -9
  8. package/client/pages/inventory/inventory-adjustment.js +79 -13
  9. package/client/pages/inventory-check/create-cycle-count.js +0 -2
  10. package/client/pages/master/product/product-detail-bizplace-setting-popup.js +0 -2
  11. package/client/pages/master/product/product-details-popup.js +10 -9
  12. package/client/pages/master/product/product-list.js +11 -10
  13. package/client/pages/master/tote-list.js +740 -0
  14. package/client/pages/order/arrival-notice/arrival-notice-detail.js +0 -2
  15. package/client/pages/order/arrival-notice/receive-arrival-notice.js +0 -2
  16. package/client/pages/order/draft-release-good/draft-release-good-detail.js +1163 -0
  17. package/client/pages/order/draft-release-good/draft-release-good-list.js +546 -0
  18. package/client/pages/order/release-order/b2c/b2c-order-requests.js +21 -30
  19. package/client/pages/order/release-order/bulk-print-packing-list.js +4 -0
  20. package/client/pages/order/release-order/receive-release-order-request.js +0 -2
  21. package/client/pages/order/release-order/release-order-detail.js +44 -26
  22. package/client/pages/order/return-order/receive-return-order-requests.js +0 -2
  23. package/client/pages/order/transfer-order/receive-transfer-order-request.js +1 -1
  24. package/client/pages/order/transport-order/print-delivery-note.js +0 -1
  25. package/client/pages/order/transport-order/view-delivery-note.js +1 -1
  26. package/client/pages/order/vas-order/receive-vas-order.js +0 -2
  27. package/client/pages/outbound/inventory-assign-popup.js +7 -2
  28. package/client/pages/outbound/inventory-auto-assign-popup.js +2 -1
  29. package/client/pages/outbound/loading-product.js +35 -3
  30. package/client/pages/outbound/order-remark-popup.js +112 -0
  31. package/client/pages/outbound/packing-product.js +38 -5
  32. package/client/pages/outbound/packing-worksheet-list.js +15 -0
  33. package/client/pages/outbound/picking-product.js +142 -10
  34. package/client/pages/outbound/single-outbound-worksheet.js +10 -22
  35. package/client/pages/outbound/sorting-product.js +72 -12
  36. package/client/pages/outbound/tote-popup.js +461 -0
  37. package/client/pages/outbound/worksheet-batch-picking.js +10 -3
  38. package/client/pages/outbound/worksheet-packing.js +7 -2
  39. package/client/pages/outbound/worksheet-picking.js +9 -2
  40. package/client/pages/report/inventory-summary-report.js +8 -0
  41. package/client/pages/report/outbound-order-details-report.js +18 -0
  42. package/client/route.js +12 -0
  43. package/dist-server/entities/index.js +2 -1
  44. package/dist-server/entities/index.js.map +1 -1
  45. package/dist-server/entities/warehouse-bizplace-onhand-inventory.js +168 -0
  46. package/dist-server/entities/warehouse-bizplace-onhand-inventory.js.map +1 -0
  47. package/dist-server/graphql/resolvers/board-setting/board-settings.js +2 -1
  48. package/dist-server/graphql/resolvers/board-setting/board-settings.js.map +1 -1
  49. package/dist-server/graphql/resolvers/index.js +3 -2
  50. package/dist-server/graphql/resolvers/index.js.map +1 -1
  51. package/dist-server/graphql/resolvers/reports/outbound-order-details-report.js +3 -1
  52. package/dist-server/graphql/resolvers/reports/outbound-order-details-report.js.map +1 -1
  53. package/dist-server/graphql/resolvers/warehouse-inventory-adjustment/index.js +6 -0
  54. package/dist-server/graphql/resolvers/warehouse-inventory-adjustment/index.js.map +1 -0
  55. package/dist-server/graphql/resolvers/warehouse-inventory-adjustment/warehouse-intentory-adjustment.js +58 -0
  56. package/dist-server/graphql/resolvers/warehouse-inventory-adjustment/warehouse-intentory-adjustment.js.map +1 -0
  57. package/dist-server/graphql/types/index.js +4 -3
  58. package/dist-server/graphql/types/index.js.map +1 -1
  59. package/dist-server/graphql/types/reports/outbound-order-details-report.js +2 -0
  60. package/dist-server/graphql/types/reports/outbound-order-details-report.js.map +1 -1
  61. package/dist-server/graphql/types/warehouse-inventory-adjustment/index.js +9 -0
  62. package/dist-server/graphql/types/warehouse-inventory-adjustment/index.js.map +1 -0
  63. package/dist-server/index.js +1 -0
  64. package/dist-server/index.js.map +1 -1
  65. package/dist-server/opa-app-setting-constants.js +2 -1
  66. package/dist-server/opa-app-setting-constants.js.map +1 -1
  67. package/helps/release-note.ko.md +10 -8
  68. package/helps/release-note.md +10 -8
  69. package/helps/release-note.ms.md +10 -8
  70. package/helps/release-note.zh.md +10 -8
  71. package/package.json +41 -41
  72. package/server/entities/index.ts +2 -2
  73. package/server/entities/warehouse-bizplace-onhand-inventory.ts +141 -0
  74. package/server/graphql/resolvers/board-setting/board-settings.ts +4 -2
  75. package/server/graphql/resolvers/index.ts +3 -2
  76. package/server/graphql/resolvers/reports/outbound-order-details-report.ts +6 -2
  77. package/server/graphql/resolvers/warehouse-inventory-adjustment/index.ts +5 -0
  78. package/server/graphql/resolvers/warehouse-inventory-adjustment/warehouse-intentory-adjustment.ts +68 -0
  79. package/server/graphql/types/index.ts +4 -4
  80. package/server/graphql/types/reports/outbound-order-details-report.ts +2 -0
  81. package/server/graphql/types/warehouse-inventory-adjustment/index.ts +5 -0
  82. package/server/index.ts +2 -1
  83. package/server/opa-app-setting-constants.ts +1 -0
  84. package/things-factory.config.js +13 -0
  85. package/translations/en.json +45 -6
  86. package/translations/ko.json +34 -1
  87. package/translations/ms.json +34 -1
  88. package/translations/zh.json +34 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/operato-wms",
3
- "version": "4.2.12",
3
+ "version": "4.3.0",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "client/index.js",
6
6
  "things-factory": true,
@@ -47,7 +47,7 @@
47
47
  "db:reset": "yarn run db:clear && yarn run db:restore && yarn run db:seed && yarn run db:setpass"
48
48
  },
49
49
  "dependencies": {
50
- "@operato/ghost-print": "^0.3.28",
50
+ "@operato/ghost-print": "^0.4.3",
51
51
  "@operato/scene-chartjs": "^0.1.5",
52
52
  "@operato/scene-clock": "^0.1.5",
53
53
  "@operato/scene-clone": "^0.1.5",
@@ -63,53 +63,53 @@
63
63
  "@operato/scene-tab": "^0.1.5",
64
64
  "@operato/scene-table": "^0.1.5",
65
65
  "@operato/scene-wheel-sorter": "^0.1.5",
66
- "@things-factory/apptool-ui": "^4.2.12",
67
- "@things-factory/attachment-ui": "^4.2.12",
68
- "@things-factory/auth-ui": "^4.2.12",
69
- "@things-factory/barcode-ui": "^4.2.12",
70
- "@things-factory/biz-ui": "^4.2.12",
71
- "@things-factory/board-service": "^4.2.12",
72
- "@things-factory/board-ui": "^4.2.12",
73
- "@things-factory/code-ui": "^4.2.12",
74
- "@things-factory/context-ui": "^4.2.12",
75
- "@things-factory/export-ui": "^4.2.12",
76
- "@things-factory/export-ui-csv": "^4.2.12",
77
- "@things-factory/export-ui-excel": "^4.2.12",
78
- "@things-factory/fav-base": "^4.2.12",
79
- "@things-factory/form-ui": "^4.2.12",
80
- "@things-factory/grist-ui": "^4.2.12",
81
- "@things-factory/help": "^4.2.12",
82
- "@things-factory/i18n-base": "^4.2.12",
83
- "@things-factory/id-rule-base": "^4.2.12",
84
- "@things-factory/import-ui": "^4.2.12",
85
- "@things-factory/import-ui-excel": "^4.2.12",
86
- "@things-factory/menu-ui": "^4.2.12",
87
- "@things-factory/more-ui": "^4.2.12",
88
- "@things-factory/notification": "^4.2.12",
89
- "@things-factory/pdf": "^4.1.40",
90
- "@things-factory/print-proxy-service": "^4.2.12",
91
- "@things-factory/print-service": "^4.2.12",
92
- "@things-factory/print-ui": "^4.2.12",
93
- "@things-factory/product-base": "^4.2.12",
94
- "@things-factory/resource-ui": "^4.2.12",
95
- "@things-factory/sales-ui": "^4.2.12",
66
+ "@things-factory/apptool-ui": "^4.3.0",
67
+ "@things-factory/attachment-ui": "^4.3.0",
68
+ "@things-factory/auth-ui": "^4.3.0",
69
+ "@things-factory/barcode-ui": "^4.3.0",
70
+ "@things-factory/biz-ui": "^4.3.0",
71
+ "@things-factory/board-service": "^4.3.0",
72
+ "@things-factory/board-ui": "^4.3.0",
73
+ "@things-factory/code-ui": "^4.3.0",
74
+ "@things-factory/context-ui": "^4.3.0",
75
+ "@things-factory/export-ui": "^4.3.0",
76
+ "@things-factory/export-ui-csv": "^4.3.0",
77
+ "@things-factory/export-ui-excel": "^4.3.0",
78
+ "@things-factory/fav-base": "^4.3.0",
79
+ "@things-factory/form-ui": "^4.3.0",
80
+ "@things-factory/grist-ui": "^4.3.0",
81
+ "@things-factory/help": "^4.3.0",
82
+ "@things-factory/i18n-base": "^4.3.0",
83
+ "@things-factory/id-rule-base": "^4.3.0",
84
+ "@things-factory/import-ui": "^4.3.0",
85
+ "@things-factory/import-ui-excel": "^4.3.0",
86
+ "@things-factory/menu-ui": "^4.3.0",
87
+ "@things-factory/more-ui": "^4.3.0",
88
+ "@things-factory/notification": "^4.3.0",
89
+ "@things-factory/pdf": "^4.3.0",
90
+ "@things-factory/print-proxy-service": "^4.3.0",
91
+ "@things-factory/print-service": "^4.3.0",
92
+ "@things-factory/print-ui": "^4.3.0",
93
+ "@things-factory/product-base": "^4.3.0",
94
+ "@things-factory/resource-ui": "^4.3.0",
95
+ "@things-factory/sales-ui": "^4.3.0",
96
96
  "@things-factory/scene-data-transform": "^4.1.40",
97
97
  "@things-factory/scene-excel": "^4.1.40",
98
98
  "@things-factory/scene-firebase": "^4.1.40",
99
99
  "@things-factory/scene-form": "^4.1.40",
100
100
  "@things-factory/scene-google-map": "^4.1.40",
101
101
  "@things-factory/scene-graphql": "^4.1.40",
102
- "@things-factory/scene-label": "^4.2.12",
102
+ "@things-factory/scene-label": "^4.3.0",
103
103
  "@things-factory/scene-marker": "^4.1.40",
104
104
  "@things-factory/scene-mqtt": "^4.1.40",
105
105
  "@things-factory/scene-restful": "^4.1.40",
106
- "@things-factory/scene-visualizer": "^4.1.40",
107
- "@things-factory/setting-ui": "^4.2.12",
108
- "@things-factory/system-ui": "^4.2.12",
109
- "@things-factory/transport-base": "^4.2.12",
110
- "@things-factory/tutorial-ui": "^4.2.12",
111
- "@things-factory/warehouse-base": "^4.2.12",
112
- "@things-factory/worksheet-base": "^4.2.12"
106
+ "@things-factory/scene-visualizer": "^4.3.0",
107
+ "@things-factory/setting-ui": "^4.3.0",
108
+ "@things-factory/system-ui": "^4.3.0",
109
+ "@things-factory/transport-base": "^4.3.0",
110
+ "@things-factory/tutorial-ui": "^4.3.0",
111
+ "@things-factory/warehouse-base": "^4.3.0",
112
+ "@things-factory/worksheet-base": "^4.3.0"
113
113
  },
114
114
  "devDependencies": {
115
115
  "@things-factory/builder": "^4.1.40",
@@ -118,5 +118,5 @@
118
118
  "cypress-localstorage-commands": "^1.6.1",
119
119
  "eslint-plugin-cypress": "^2.12.1"
120
120
  },
121
- "gitHead": "fea26f2ea238a3a279c7ab6427cd8aedcd68926b"
121
+ "gitHead": "772c8e6f56a3dda655ad49f7018a49a37e081ee8"
122
122
  }
@@ -1,3 +1,3 @@
1
- export const entities = []
1
+ import { WarehouseBizplaceOnhandInventory } from './warehouse-bizplace-onhand-inventory'
2
2
 
3
- export {}
3
+ export const entities = [WarehouseBizplaceOnhandInventory]
@@ -0,0 +1,141 @@
1
+ import { ViewColumn, ViewEntity } from 'typeorm'
2
+
3
+ @ViewEntity({
4
+ expression: `
5
+ select d.name as "domainName", b.name as "bizplaceName", src.* from (
6
+ WITH oi as (
7
+ select
8
+ oi.domain_id,
9
+ oi.bizplace_id,
10
+ SUM(oi.release_qty) AS release_qty,
11
+ SUM(oi.release_uom_value) AS release_uom_value,
12
+ oi.batch_id,
13
+ oi.batch_id_ref,
14
+ oi.product_id,
15
+ oi.packing_type,
16
+ oi.packing_size,
17
+ oi.uom
18
+ FROM
19
+ order_inventories oi
20
+ WHERE
21
+ (oi.status = 'PENDING' or oi.status = 'PENDING_RECEIVE' or oi.status = 'PENDING_WORKSHEET' or oi.status = 'PENDING_SPLIT')
22
+ AND oi.batch_id NOTNULL
23
+ AND oi.product_id NOTNULL
24
+ AND oi.packing_type NOTNULL
25
+ AND oi.packing_size NOTNULL
26
+ AND oi.inventory_id IS NULL
27
+ GROUP BY
28
+ oi.domain_id,
29
+ oi.bizplace_id,
30
+ oi.batch_id,
31
+ oi.batch_id_ref,
32
+ oi.product_id,
33
+ oi.packing_type,
34
+ oi.packing_size,
35
+ oi.uom
36
+ )
37
+ -- SINGLE ITEM INVENTORY QUERY
38
+ select
39
+ i.domain_id as "domainId",
40
+ i.bizplace_id as "bizplaceId",
41
+ i.packing_type as "packingType",
42
+ i.packing_size as "packingSize",
43
+ i.uom,
44
+ i.product_id as "productId",
45
+ null as "productBundleId",
46
+ COALESCE(SUM(COALESCE(i.qty, 0)) - SUM(COALESCE(i.locked_qty, 0)) - MAX(COALESCE(oi.release_qty, 0))) AS "remainQty",
47
+ COALESCE(SUM(COALESCE(i.uom_value, 0)) - SUM(COALESCE(i.locked_uom_value, 0)) - MAX(COALESCE(oi.release_uom_value, 0)), 0) AS "remainUomValue",
48
+ 'SINGLE' AS "groupType"
49
+ FROM inventories i
50
+ INNER JOIN locations l2 ON i.location_id = l2.id AND i.domain_id = l2.domain_id AND l2.type NOT IN ('QUARANTINE', 'RESERVE')
51
+ LEFT JOIN oi ON i.batch_id = oi.batch_id AND i.product_id = oi.product_id AND i.packing_type = oi.packing_type AND i.packing_size = oi.packing_size AND i.uom = oi.uom
52
+ WHERE i.status = 'STORED'
53
+ GROUP by
54
+ i.domain_id,
55
+ i.bizplace_id,
56
+ i.product_id,
57
+ i.packing_type,
58
+ i.packing_size,
59
+ i.uom
60
+ union all
61
+ -- BUNDLE ITEM INVENTORY QUERY
62
+ SELECT
63
+ pbs.domain_id as "domainId",
64
+ pbs.bizplace_id as "bizplaceId",
65
+ pb.packing_type as "packingType",
66
+ pb.packing_size as "packingSize",
67
+ 'UNIT' AS "uom",
68
+ null as "productId",
69
+ pb.id AS "productBundleId",
70
+ COALESCE(MIN(FLOOR(pbs."availableQty")),0) AS "remainQty",
71
+ COALESCE(MIN(FLOOR(pbs."availableUomValue")),0) AS "remainUomValue",
72
+ 'BUNDLE' AS "groupType"
73
+ FROM product_bundles pb
74
+ INNER JOIN (
75
+ SELECT i.domain_id, i.bizplace_id, pbs.product_id, pbs.product_bundle_id, min(pbs.bundle_qty),
76
+ (SUM(COALESCE(i.qty, 0)) - SUM(COALESCE(i.locked_qty, 0)) - MAX(COALESCE(oi.release_qty, 0))) / min(pbs.bundle_qty) AS "availableQty",
77
+ (SUM(COALESCE(i.uom_value, 0)) - SUM(COALESCE(i.locked_uom_value, 0)) - MAX(COALESCE(oi.release_uom_value, 0))) / min(pbs.bundle_qty) AS "availableUomValue"
78
+ FROM product_bundle_settings pbs
79
+ LEFT JOIN inventories i ON i.product_id = pbs.product_id AND i.status = 'STORED'
80
+ INNER JOIN locations l ON i.location_id = l.id AND i.domain_id = l.domain_id AND l.type NOT IN ('QUARANTINE', 'RESERVE')
81
+ LEFT JOIN oi ON oi.product_id = i.product_id
82
+ GROUP by
83
+ i.domain_id,
84
+ i.bizplace_id,
85
+ pbs.product_id,
86
+ pbs.product_bundle_id
87
+ ) pbs ON pbs.product_bundle_id = pb.id
88
+ GROUP BY
89
+ pbs.domain_id,
90
+ pbs.bizplace_id,
91
+ pb.packing_type,
92
+ pb.packing_size,
93
+ pb.name,
94
+ pb.sku,
95
+ pb.id
96
+ )
97
+ AS src
98
+ inner join domains d on d.id = src."domainId"
99
+ inner join bizplaces b on b.id = src."bizplaceId"
100
+ where src."remainQty" > 0
101
+ order by src."domainId"
102
+ `
103
+ })
104
+
105
+ export class WarehouseBizplaceOnhandInventory {
106
+ @ViewColumn()
107
+ domainName: string
108
+
109
+ @ViewColumn()
110
+ bizplaceName: string
111
+
112
+ @ViewColumn()
113
+ domainId: string
114
+
115
+ @ViewColumn()
116
+ bizplaceId: string
117
+
118
+ @ViewColumn()
119
+ packingType: string
120
+
121
+ @ViewColumn()
122
+ packingSize: number
123
+
124
+ @ViewColumn()
125
+ uom: string
126
+
127
+ @ViewColumn()
128
+ productId: string
129
+
130
+ @ViewColumn()
131
+ productBundleId: string
132
+
133
+ @ViewColumn()
134
+ remainQty: number
135
+
136
+ @ViewColumn()
137
+ remainUomValue: number
138
+
139
+ @ViewColumn()
140
+ groupType: string
141
+ }
@@ -13,7 +13,8 @@ import {
13
13
  PRODUCT_LABEL_SETTING_KEY,
14
14
  REUSABLE_PALLET_LABEL_SETTING_KEY,
15
15
  INTENALIZED_AWB_SETTING_KEY,
16
- ROUTE_LABEL_SETTING_KEY
16
+ ROUTE_LABEL_SETTING_KEY,
17
+ TOTE_LABEL_SETTING_KEY
17
18
  } from '../../../opa-app-setting-constants'
18
19
 
19
20
  export const boardSettingsResolver = {
@@ -46,7 +47,8 @@ export const boardSettingsResolver = {
46
47
  HOME_BOARD,
47
48
  CARTON_LABEL_SETTING_KEY,
48
49
  INTENALIZED_AWB_SETTING_KEY,
49
- ROUTE_LABEL_SETTING_KEY
50
+ ROUTE_LABEL_SETTING_KEY,
51
+ TOTE_LABEL_SETTING_KEY
50
52
  ]
51
53
 
52
54
  var qb = queryBuilder
@@ -7,6 +7,7 @@ import * as OpaMenu from './opa-menu'
7
7
  import * as Reports from './reports'
8
8
  import * as InventoryComparison from './inventory-comparison'
9
9
  import * as ShippingProviders from './shipping-provider'
10
+ import * as WarehouseInventoryAdjustment from './warehouse-inventory-adjustment'
10
11
 
11
12
  export const queries = [
12
13
  BoardSetting.Query,
@@ -16,7 +17,7 @@ export const queries = [
16
17
  OpaMenu.Query,
17
18
  Reports.Query,
18
19
  InventoryComparison.Query,
19
- ShippingProviders.Query
20
+ ShippingProviders.Query,
20
21
  ]
21
22
 
22
- export const mutations = [Extra.Mutation]
23
+ export const mutations = [Extra.Mutation,WarehouseInventoryAdjustment.Mutation]
@@ -54,11 +54,13 @@ export const outboundOrderDetailsReport = {
54
54
  `
55
55
  create temp table temp_outbound_order_report on commit drop as (
56
56
  select * from (
57
- select oi.id, '${bizplace.id}' AS "bizplace_id", '${bizplace.name}' AS "bizplace_name", '${bizplace.description}' AS "bizplace_description",
57
+ select oi.id, '${bizplace.id}' AS "bizplace_id", '${bizplace.name}' AS "bizplace_name", '${
58
+ bizplace.description
59
+ }' AS "bizplace_description",
58
60
  do2.name AS "delivery_order_no", do2.delivery_date as "delivery_order_date",
59
61
  do2."to", do2.contact_point_ref_id,
60
62
  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",
61
- rg.created_at AS "order_created_at", rg.accepted_at, u4.name as accepted_by,
63
+ rg.created_at AS "order_created_at", rg.accepted_at, u4.name as accepted_by, rg.checked_remark_by, rg.checked_remark_at,
62
64
  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
65
  i.packing_type as "pack_type", i.packing_size as "pack_size", oi.release_qty AS "release_qty",
64
66
  oi.picked_at, oi.picked_by, oi.packed_at, oi.packed_by, oi.loaded_at, oi.loaded_by, oi.shipped_at,
@@ -188,6 +190,8 @@ export const outboundOrderDetailsReport = {
188
190
  pickedBy: itm.picked_by,
189
191
  packedAt: itm.packed_at,
190
192
  packedBy: itm.packed_by,
193
+ checkedRemarkBy: itm.checked_remark_by,
194
+ checkedRemarkAt: itm.checked_remark_at,
191
195
  loadedAt: itm.loaded_at,
192
196
  loadedBy: itm.loaded_by,
193
197
  shippedAt: itm.shipped_at
@@ -0,0 +1,5 @@
1
+ import { warehouseInventoryAdjustment } from './warehouse-intentory-adjustment'
2
+
3
+ export const Mutation = {
4
+ ...warehouseInventoryAdjustment
5
+ }
@@ -0,0 +1,68 @@
1
+ import { EntityManager } from 'typeorm'
2
+ import { InventoryChange, approveInventoryChanges } from '@things-factory/warehouse-base'
3
+ import { In, Not, IsNull } from 'typeorm'
4
+ import { OrderInventory } from '@things-factory/sales-base'
5
+ import { WorksheetDetail } from '@things-factory/worksheet-base'
6
+
7
+ export const warehouseInventoryAdjustment = {
8
+ async warehouseInventoryAdjustment(_: any, { patches }, context: any) {
9
+ try {
10
+ const item = await approveInventoryChanges(patches, context)
11
+
12
+ // Retrieve order inventory
13
+ const { tx }: { tx: EntityManager } = context.state
14
+
15
+ const _inventoryChanges = await tx.getRepository(InventoryChange).find({
16
+ where: { id: In(patches.map(item => item.id)) },
17
+ relations: [
18
+ 'inventory',
19
+ 'inventory.bizplace',
20
+ 'inventory.bizplace.domain',
21
+ 'inventory.product',
22
+ 'inventory.location',
23
+ 'inventory.warehouse',
24
+ 'bizplace',
25
+ 'bizplace.domain',
26
+ 'bizplace.company',
27
+ 'bizplace.company.domain',
28
+ 'product',
29
+ 'product.productDetails',
30
+ 'product.productDetails.childProductDetail',
31
+ 'location'
32
+ ],
33
+ order: {
34
+ createdAt: 'ASC'
35
+ }
36
+ })
37
+
38
+ if (_inventoryChanges.length > 0) {
39
+ const invId: any[] = _inventoryChanges
40
+ .filter((ic: any) => ic.transactionType == 'MISSING')
41
+ .map((ic: any) => ic.inventory.id)
42
+
43
+ const orderInventory: OrderInventory[] = await tx.getRepository(OrderInventory).find({
44
+ where: { inventory: In(invId), status: 'PICKING' }
45
+ })
46
+
47
+ await tx.getRepository(OrderInventory).update(
48
+ {
49
+ inventory: In(invId),status:"PICKING"
50
+ },
51
+ { status: 'MISSING' }
52
+ )
53
+
54
+ const orderInvId: any[] = orderInventory.map((oi: any) => oi.id)
55
+
56
+ await tx.getRepository(WorksheetDetail).update(
57
+ {
58
+ targetInventory: In(orderInvId),status:"EXECUTING"
59
+ },
60
+ { status: 'MISSING' }
61
+ )
62
+ }
63
+ return item
64
+ } catch (error) {
65
+ throw error
66
+ }
67
+ }
68
+ }
@@ -7,7 +7,7 @@ import * as OpaMenu from './opa-menu'
7
7
  import * as Reports from './reports'
8
8
  import * as InventoryComparison from './inventory-comparison'
9
9
  import * as ShippingProvider from './shipping-provider'
10
-
10
+ import * as WarehouseInventory from './warehouse-inventory-adjustment'
11
11
  export const queries = [
12
12
  BoardSetting.Query,
13
13
  CustomElccl.Query,
@@ -16,10 +16,10 @@ export const queries = [
16
16
  OpaMenu.Query,
17
17
  Reports.Query,
18
18
  InventoryComparison.Query,
19
- ShippingProvider.Query
19
+ ShippingProvider.Query,
20
20
  ]
21
21
 
22
- export const mutations = [Extra.Mutation]
22
+ export const mutations = [Extra.Mutation,WarehouseInventory.Mutation]
23
23
 
24
24
  export const types = [
25
25
  ...BoardSetting.Types,
@@ -28,5 +28,5 @@ export const types = [
28
28
  ...OpaMenu.Types,
29
29
  ...Reports.Types,
30
30
  ...InventoryComparison.Types,
31
- ...ShippingProvider.Types
31
+ ...ShippingProvider.Types,
32
32
  ]
@@ -44,6 +44,8 @@ export const OutboundOrderDetailsReport = gql`
44
44
  pickedBy: String
45
45
  packedAt: String
46
46
  packedBy: String
47
+ checkedRemarkBy: String
48
+ checkedRemarkAt: String
47
49
  loadedAt: String
48
50
  loadedBy: String
49
51
  shippedAt: String
@@ -0,0 +1,5 @@
1
+ export const Mutation = /* GraphQL */ `
2
+ warehouseInventoryAdjustment (
3
+ patches: [InventoryChangePatch]!
4
+ ): InventoryChangeList @privilege(category: "inventory_adjustment_approval", privilege: "mutation") @transaction
5
+ `
package/server/index.ts CHANGED
@@ -1,4 +1,5 @@
1
+ export * from './entities'
1
2
  export * from './graphql'
2
3
  export * from './migrations'
3
4
 
4
- import './routes'
5
+ import './routes'
@@ -6,3 +6,4 @@ export const HOME_DASHBOARD_PREFIX = 'dashboard'
6
6
  export const PRODUCT_LABEL_SETTING_KEY = 'product-label'
7
7
  export const INTENALIZED_AWB_SETTING_KEY = 'internalized-awb-label'
8
8
  export const ROUTE_LABEL_SETTING_KEY = 'route-label'
9
+ export const TOTE_LABEL_SETTING_KEY = 'tote-label'
@@ -39,6 +39,10 @@ export default {
39
39
  tagname: 'product-list',
40
40
  page: 'products'
41
41
  },
42
+ {
43
+ tagname: 'tote-list',
44
+ page: 'totes'
45
+ },
42
46
 
43
47
  /**
44
48
  * Order Menus Section
@@ -536,6 +540,15 @@ export default {
536
540
  {
537
541
  tagname: 'bulk-operation',
538
542
  page: 'bulk_operation'
543
+ },
544
+
545
+ {
546
+ tagname: 'draft-release-good-list',
547
+ page: 'draft_release_goods'
548
+ },
549
+ {
550
+ tagname: 'draft-release-good-detail',
551
+ page: 'draft_release_good_detail'
539
552
  }
540
553
  ],
541
554
  bootstrap