@things-factory/operato-wms 4.1.36 → 4.1.40

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 (37) hide show
  1. package/client/pages/inventory/non-loaded-inventory.js +83 -15
  2. package/client/pages/order/release-order/b2c/b2c-order-requests.js +67 -13
  3. package/client/pages/outbound/picking-product.js +54 -16
  4. package/client/pages/outbound/select-operator-popup.js +3 -3
  5. package/client/pages/outbound/single-outbound-worksheet.js +86 -4
  6. package/client/pages/outbound/worksheet-batch-picking.js +2 -2
  7. package/client/pages/outbound/worksheet-picking.js +2 -2
  8. package/dist-server/graphql/resolvers/dashboard/index.js +3 -1
  9. package/dist-server/graphql/resolvers/dashboard/index.js.map +1 -1
  10. package/dist-server/graphql/resolvers/dashboard/inventory-expiry-monitor.js +51 -0
  11. package/dist-server/graphql/resolvers/dashboard/inventory-expiry-monitor.js.map +1 -0
  12. package/dist-server/graphql/resolvers/dashboard/outbound-order-by-status.js +55 -0
  13. package/dist-server/graphql/resolvers/dashboard/outbound-order-by-status.js.map +1 -0
  14. package/dist-server/graphql/resolvers/extra/add-release-good-products.js +5 -1
  15. package/dist-server/graphql/resolvers/extra/add-release-good-products.js.map +1 -1
  16. package/dist-server/graphql/types/dashboard/index.js +5 -1
  17. package/dist-server/graphql/types/dashboard/index.js.map +1 -1
  18. package/dist-server/graphql/types/dashboard/inventory-expiry-counter.js +16 -0
  19. package/dist-server/graphql/types/dashboard/inventory-expiry-counter.js.map +1 -0
  20. package/dist-server/graphql/types/dashboard/inventory-expiry-status.js +14 -0
  21. package/dist-server/graphql/types/dashboard/inventory-expiry-status.js.map +1 -0
  22. package/helps/release-note.ko.md +37 -2
  23. package/helps/release-note.md +12 -41
  24. package/helps/release-note.ms.md +36 -1
  25. package/helps/release-note.zh.md +36 -1
  26. package/package.json +50 -50
  27. package/server/graphql/resolvers/dashboard/index.ts +5 -1
  28. package/server/graphql/resolvers/dashboard/inventory-expiry-monitor.ts +49 -0
  29. package/server/graphql/resolvers/dashboard/outbound-order-by-status.ts +62 -0
  30. package/server/graphql/resolvers/extra/add-release-good-products.ts +7 -2
  31. package/server/graphql/types/dashboard/index.ts +5 -1
  32. package/server/graphql/types/dashboard/inventory-expiry-counter.ts +10 -0
  33. package/server/graphql/types/dashboard/inventory-expiry-status.ts +8 -0
  34. package/translations/en.json +3 -0
  35. package/translations/ko.json +1 -0
  36. package/translations/ms.json +1 -0
  37. package/translations/zh.json +1 -0
@@ -0,0 +1,49 @@
1
+ import { EntityManager } from 'typeorm'
2
+
3
+ import { User } from '@things-factory/auth-base'
4
+ import { Domain, ListParam } from '@things-factory/shell'
5
+
6
+ export const inventoryExpiryMonitorResolver = {
7
+ async inventoryExpiryMonitor(_: any, params: ListParam, context: any) {
8
+ const { domain, tx }: { domain: Domain; user: User; tx: EntityManager } = context.state
9
+
10
+ const expInventories: {
11
+ location: string
12
+ expired: number
13
+ thirtyDays: number
14
+ fortyFiveDays: number
15
+ sixtyDays: number
16
+ }[] = await tx.query(
17
+ `
18
+ SELECT "location", sum("expired") AS "expired", sum("thirtyDays") AS "thirtyDays", sum("fortyFiveDays") AS "fortyFiveDays", sum("sixtyDays") AS "sixtyDays" FROM (
19
+ SELECT
20
+ CASE WHEN l.TYPE IN ('QUARANTINE','RESERVE') THEN 'QUARANTINED' ELSE 'IN SHELF' END AS "location",
21
+ CASE WHEN i.expiration_date - now()::date <= 0 THEN 1 ELSE 0 END AS "expired",
22
+ CASE WHEN i.expiration_date - now()::date > 0 AND i.expiration_date - now()::date <= 30 THEN 1 ELSE 0 END AS "thirtyDays",
23
+ CASE WHEN i.expiration_date - now()::date > 30 AND i.expiration_date - now()::date <= 45 THEN 1 ELSE 0 END AS "fortyFiveDays",
24
+ CASE WHEN i.expiration_date - now()::date > 45 AND i.expiration_date - now()::date <= 60 THEN 1 ELSE 0 END AS "sixtyDays"
25
+ FROM inventories i
26
+ INNER JOIN locations l ON i.location_id = l.id
27
+ WHERE i.expiration_date - now()::date <= 60
28
+ AND i.expiration_date NOTNULL
29
+ AND i.status = 'STORED'
30
+ AND i.domain_id = $1
31
+ ) AS foo
32
+ GROUP BY "location"
33
+ `,
34
+ [domain.id]
35
+ )
36
+
37
+ return {
38
+ quarantined: getExpiryCountByStatus(expInventories, 'QUARANTINED'),
39
+ inShelf: getExpiryCountByStatus(expInventories, 'IN SHELF')
40
+ }
41
+ }
42
+ }
43
+
44
+ function getExpiryCountByStatus(expInventories, location) {
45
+ let matchedInv: any = expInventories.find(inv => inv.location == location)
46
+
47
+ if (matchedInv) return (({ location, ...inv }) => inv)(matchedInv)
48
+ else return { expired: 0, thirtyDays: 0, fortyFiveDays: 0, sixtyDays: 0 }
49
+ }
@@ -0,0 +1,62 @@
1
+ import { EntityManager } from 'typeorm'
2
+
3
+ import { User } from '@things-factory/auth-base'
4
+ import { Domain, ListParam } from '@things-factory/shell'
5
+
6
+ export const outboundOrderByStatusResolver = {
7
+ async outboundOrderByStatus(_: any, params: ListParam, context: any) {
8
+ const { domain, user, tx }: { domain: Domain; user: User; tx: EntityManager } = context.state
9
+
10
+ const orderStatus: { status: string; count: number }[] = await tx.query(
11
+ `
12
+ (
13
+ SELECT "status", COUNT(*) AS "count" FROM (
14
+ SELECT
15
+ CASE WHEN "status" = 'DEACTIVATED' AND "assignee_id" ISNULL AND "type" = 'PICKING' THEN 'PICKING UNASSIGNED'
16
+ WHEN "status" = 'EXECUTING' AND "assignee_id" NOTNULL AND "type" = 'PICKING' THEN 'PICKING ASSIGNED'
17
+ WHEN "status" = 'EXECUTING' AND "type" = 'PACKING' THEN 'PACKING'
18
+ END AS "status" FROM worksheets ws
19
+ WHERE "domain_id" = $1
20
+ ) AS foo
21
+ WHERE status IN ('PICKING ASSIGNED', 'PICKING UNASSIGNED', 'PACKING')
22
+ GROUP BY "status"
23
+ ) UNION ALL (
24
+ SELECT "status", COUNT(id) AS "count" FROM release_goods rg
25
+ WHERE "status" IN ('DONE', 'CANCELLED')
26
+ AND "domain_id" = $1
27
+ GROUP BY "status"
28
+ ) UNION ALL (
29
+ SELECT
30
+ CASE WHEN "status"::VARCHAR = 'OPEN' THEN 'AWAITING DISPATCH'
31
+ WHEN "status"::VARCHAR = 'CLOSED' THEN 'OUT FROM WAREHOUSE'
32
+ END AS "status",
33
+ COUNT(id) AS "count"
34
+ FROM manifests
35
+ WHERE "domain_id" = $1
36
+ GROUP BY "status"
37
+ )
38
+ `,
39
+ [domain.id]
40
+ )
41
+
42
+ const statusList: string[] = [
43
+ 'PICKING UNASSIGNED',
44
+ 'PICKING ASSIGNED',
45
+ 'PACKING',
46
+ 'AWAITING DISPATCH',
47
+ 'OUT FROM WAREHOUSE',
48
+ 'CANCELLED',
49
+ 'DONE',
50
+ 'OUT OF STOCK'
51
+ ]
52
+
53
+ return statusList.reduce((statusCounts: { status: string; count: number }[], status: string) => {
54
+ let foundItem = orderStatus.find(order => order.status == status)
55
+
56
+ if (foundItem) statusCounts.push({ status, count: foundItem.count })
57
+ else statusCounts.push({ status, count: 0 })
58
+
59
+ return statusCounts
60
+ }, [])
61
+ }
62
+ }
@@ -251,8 +251,13 @@ export const addReleaseGoodProducts = {
251
251
  // if found existing OrderInventory and worksheetDetail then qty, uomValue, and status are updated
252
252
  newOrderInv = {
253
253
  ...existingOrderInv,
254
- releaseQty: existingOrderInv.releaseQty + newOrderInv.releaseQty,
255
- releaseUomValue: existingOrderInv.releaseUomValue + newOrderInv.releaseUomValue,
254
+ releaseQty:
255
+ existingOrderInv.status === ORDER_INVENTORY_STATUS.REPLACED
256
+ ? newOrderInv.releaseQty
257
+ : existingOrderInv.releaseQty + newOrderInv.releaseQty,
258
+ releaseUomValue: ORDER_INVENTORY_STATUS.REPLACED
259
+ ? newOrderInv.releaseUomValue
260
+ : existingOrderInv.releaseUomValue + newOrderInv.releaseUomValue,
256
261
  status:
257
262
  existingOrderInv.status === ORDER_INVENTORY_STATUS.CANCELLED
258
263
  ? pickingWorksheet
@@ -1,3 +1,5 @@
1
+ import { InventoryExpiryCounter } from './inventory-expiry-counter'
2
+ import { InventoryExpiryStatus } from './inventory-expiry-status'
1
3
  import { OrderStatusCounter } from './order-status-counter'
2
4
 
3
5
  export const Query = /* GraphQL */ `
@@ -5,5 +7,7 @@ export const Query = /* GraphQL */ `
5
7
  collectionOrdersByStatus(filters: [Filter]): [OrderStatusCounter] @transaction
6
8
  deliveryOrdersByStatus(filters: [Filter]): [OrderStatusCounter] @transaction
7
9
  releaseGoodsByStatus(filters: [Filter]): [OrderStatusCounter] @transaction
10
+ outboundOrderByStatus(filters: [Filter]): [OrderStatusCounter] @transaction
11
+ inventoryExpiryMonitor(filters: [Filter]): InventoryExpiryStatus @transaction
8
12
  `
9
- export const Types = [OrderStatusCounter]
13
+ export const Types = [InventoryExpiryCounter, InventoryExpiryStatus, OrderStatusCounter]
@@ -0,0 +1,10 @@
1
+ import gql from 'graphql-tag'
2
+
3
+ export const InventoryExpiryCounter = gql`
4
+ type InventoryExpiryCounter {
5
+ expired: Int
6
+ thirtyDays: Int
7
+ fortyFiveDays: Int
8
+ sixtyDays: Int
9
+ }
10
+ `
@@ -0,0 +1,8 @@
1
+ import gql from 'graphql-tag'
2
+
3
+ export const InventoryExpiryStatus = gql`
4
+ type InventoryExpiryStatus {
5
+ quarantined: InventoryExpiryCounter
6
+ inShelf: InventoryExpiryCounter
7
+ }
8
+ `
@@ -10,6 +10,7 @@
10
10
  "button.approve": "approve",
11
11
  "button.arrived": "arrived",
12
12
  "button.assign_warehouse": "assign warehouse",
13
+ "button.assign_picker": "assign picker",
13
14
  "button.assign": "assign",
14
15
  "button.auto_assign": "auto assign",
15
16
  "button.auto_select": "auto select",
@@ -132,6 +133,7 @@
132
133
  "field.assigned_qty": "assigned qty",
133
134
  "field.assigned_uom_value": "assigned uom value",
134
135
  "field.assigned": "assigned",
136
+ "field.assigned_picker":"assigned picker",
135
137
  "field.attention_to": "attention to",
136
138
  "field.aux_unit_2": "aux unit 2",
137
139
  "field.aux_unit": "aux unit",
@@ -1316,6 +1318,7 @@
1316
1318
  "text.there_is_additional_operation": "there is additional operation",
1317
1319
  "text.there_is_completed_item_already": "there is completed item already",
1318
1320
  "text.there_is_duplicated_products": "there is duplicated products",
1321
+ "text.there_is_no_airway_bill_for_this_ro": "there is no airway bill for this RO",
1319
1322
  "text.there_is_no_arrival_notice_no": "there is no arrival notice no",
1320
1323
  "text.there_is_no_from_location": "there is no from location",
1321
1324
  "text.there_is_no_inventory": "there is no inventory",
@@ -1400,6 +1400,7 @@
1400
1400
  "text.there_is_additional_operation": "추가작업이 있습니다",
1401
1401
  "text.there_is_completed_item_already": "이미 완료된 상품이 있습니다",
1402
1402
  "text.there_is_duplicated_products": "[ko]there is duplicated products",
1403
+ "text.there_is_no_airway_bill_for_this_ro": "[ko]there is no airway bill for this RO",
1403
1404
  "text.there_is_no_arrival_notice_no": "출고주문번호가 없습니다",
1404
1405
  "text.there_is_no_from_location": "from 로케이션이 없습니다",
1405
1406
  "text.there_is_no_input_for_truck_no": "there is no input for truck no",
@@ -1323,6 +1323,7 @@
1323
1323
  "text.there_is_additional_operation": "terdapat operasi tambahan",
1324
1324
  "text.there_is_completed_item_already": "there is completed item already",
1325
1325
  "text.there_is_duplicated_products": "[ms]there is duplicated products",
1326
+ "text.there_is_no_airway_bill_for_this_ro": "[ms]there is no airway bill for this RO",
1326
1327
  "text.there_is_no_arrival_notice_no": "pesanan ketibaan tidak dapat dicari",
1327
1328
  "text.there_is_no_from_location": "tiada dari lokasi",
1328
1329
  "text.there_is_no_inventory": "tiada inventori",
@@ -1290,6 +1290,7 @@
1290
1290
  "text.there_is_additional_operation": "[zh]there is additional operation",
1291
1291
  "text.there_is_completed_item_already": "[zh]there is completed item already",
1292
1292
  "text.there_is_duplicated_products": "[zh]there is duplicated products",
1293
+ "text.there_is_no_airway_bill_for_this_ro": "[zh]there is no airway bill for this RO",
1293
1294
  "text.there_is_no_arrival_notice_no": "[zh]there is no arrival notice no",
1294
1295
  "text.there_is_no_from_location": "[zh]there is no from location",
1295
1296
  "text.there_is_no_inventory": "[zh]there is no inventory",