@things-factory/operato-wms 4.3.16 → 4.3.17

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.
@@ -5,26 +5,40 @@ exports.outboundOrderByStatusResolver = {
5
5
  async outboundOrderByStatus(_, params, context) {
6
6
  const { domain, tx } = context.state;
7
7
  const orderStatus = await tx.query(`
8
- (
8
+ WITH cte_list ("status", "count") as (
9
+ select 'DONE' as status, 0 as "count"
10
+ union
11
+ select 'CANCELLED' as status, 0 as "count"
12
+ union
13
+ select 'PICKING UNASSIGNED' as status, 0 as "count"
14
+ union
15
+ select 'PACKING' as status, 0 as "count"
16
+ union
17
+ select 'AWAITING DISPATCH' as status, 0 as "count"
18
+ union
19
+ select 'OUT FROM WAREHOUSE' as status, 0 as "count"
20
+ union
21
+ select 'PICKING ASSIGNED' as status, 0 as "count"
22
+ union
23
+ select 'OTHERS' as status, 0 as "count"
24
+ ) select l."status", coalesce(src."count", l."count") as "count"
25
+ from cte_list l
26
+ left join (
9
27
  SELECT "status", COUNT(*) AS "count" FROM (
10
28
  SELECT
11
29
  CASE WHEN "status" = 'DONE' and rg.updated_at::date = CURRENT_DATE THEN 'DONE'
12
30
  WHEN "status" = 'CANCELLED' THEN 'CANCELLED'
13
- WHEN "status" IN('PENDING', 'PENDING_RECEIVE', 'PENDING_WORKSHEET', 'READY_TO_PICK') THEN 'PICKING UNASSIGNED'
14
- WHEN "status" IN('READY_TO_PACK', 'PACKING') THEN 'PACKING'
15
- WHEN "dispatchment_status" = 'READY_TO_DISPATCH' and "tracking_no" NOTNULL and "status" NOT IN ('CANCELLED', 'PENDING_CANCEL') THEN 'AWAITING DISPATCH'
16
- WHEN "dispatchment_status" = 'DISPATCHED' and "tracking_no" NOTNULL and "status" NOT IN ('CANCELLED', 'PENDING_CANCEL') THEN 'OUT FROM WAREHOUSE'
31
+ WHEN "status" IN('PENDING_RECEIVE', 'PENDING_WORKSHEET') THEN 'PICKING UNASSIGNED'
17
32
  END AS "status"
18
33
  FROM release_goods rg
19
34
  WHERE "domain_id" = $1
20
35
  AND rg."status" IN ('CANCELLED','PENDING', 'PENDING_RECEIVE', 'PENDING_WORKSHEET', 'READY_TO_PICK', 'PICKING', 'READY_TO_PACK', 'PACKING', 'DONE')
21
36
  ) AS foo
22
37
  GROUP BY "status"
23
- ) UNION ALL (
38
+ UNION ALL
24
39
  SELECT "status", COUNT(*) AS "count" FROM (
25
40
  SELECT
26
- CASE WHEN "dispatchment_status" = 'READY_TO_DISPATCH' and tracking_no NOTNULL THEN 'AWAITING DISPATCH'
27
- WHEN "dispatchment_status" = 'DISPATCHED' THEN 'OUT FROM WAREHOUSE'
41
+ CASE WHEN "dispatchment_status" = 'DISPATCHED' THEN 'OUT FROM WAREHOUSE'
28
42
  END AS "status"
29
43
  FROM release_goods rg
30
44
  WHERE "domain_id" = $1
@@ -32,18 +46,22 @@ exports.outboundOrderByStatusResolver = {
32
46
  AND rg."status" NOT IN ('CANCELLED', 'PENDING_CANCEL')
33
47
  AND rg."tracking_no" NOTNULL
34
48
  ) AS foo
35
- GROUP BY "status"
36
- ) UNION ALL (
37
- SELECT "status", COUNT(*) AS "count" FROM (
38
- SELECT
39
- CASE WHEN "status" IN('PENDING', 'PENDING_RECEIVE', 'PENDING_WORKSHEET', 'READY_TO_PICK', 'PICKING') THEN 'PICKING ASSIGNED'
40
- END AS "status"
41
- FROM release_goods rg
42
- WHERE "domain_id" = $1
43
- AND rg."status" IN ('PENDING', 'PENDING_RECEIVE', 'PENDING_WORKSHEET', 'READY_TO_PICK', 'PICKING')
44
- ) AS foo
45
- GROUP BY "status"
46
- )
49
+ GROUP BY "status"
50
+ union all
51
+ select 'AWAITING DISPATCH' as "status", count(*) from manifests m
52
+ inner join release_goods rg ON rg.manifest_id = m.id
53
+ where m."status" = 'OPEN' and m."domain_id" = $1
54
+ union all
55
+ select 'PICKING ASSIGNED' as "status", count(*) from worksheets w
56
+ where w."domain_id" = $1 and w."type" ='PICKING'
57
+ and w."status" in ('DEACTIVATED','EXECUTING','PENDING_CANCEL')
58
+ group by w."status"
59
+ union all
60
+ select 'PACKING' as "status", count(*) from worksheets w
61
+ where w."domain_id" = $1 and w."type" ='PACKING'
62
+ and w."status" in ('DEACTIVATED','EXECUTING','PENDING_CANCEL')
63
+ group by w."status"
64
+ ) src on src."status" = l."status"
47
65
  `, [domain.id]);
48
66
  const statusList = [
49
67
  'PICKING UNASSIGNED',
@@ -1 +1 @@
1
- {"version":3,"file":"outbound-order-by-status.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/dashboard/outbound-order-by-status.ts"],"names":[],"mappings":";;;AAKa,QAAA,6BAA6B,GAAG;IAC3C,KAAK,CAAC,qBAAqB,CAAC,CAAM,EAAE,MAAiB,EAAE,OAAY;QACjE,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,GAAsD,OAAO,CAAC,KAAK,CAAA;QAEvF,MAAM,WAAW,GAAwC,MAAM,EAAE,CAAC,KAAK,CACrE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAwCD,EACC,CAAC,MAAM,CAAC,EAAE,CAAC,CACZ,CAAA;QAED,MAAM,UAAU,GAAa;YAC3B,oBAAoB;YACpB,kBAAkB;YAClB,SAAS;YACT,mBAAmB;YACnB,oBAAoB;YACpB,WAAW;YACX,MAAM;YACN,cAAc;SACf,CAAA;QAED,OAAO,UAAU,CAAC,MAAM,CAAC,CAAC,YAAiD,EAAE,MAAc,EAAE,EAAE;YAC7F,IAAI,SAAS,GAAG,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,IAAI,MAAM,CAAC,CAAA;YAEjE,IAAI,SAAS;gBAAE,YAAY,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,CAAC,KAAK,EAAE,CAAC,CAAA;;gBAC/D,YAAY,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAA;YAE5C,OAAO,YAAY,CAAA;QACrB,CAAC,EAAE,EAAE,CAAC,CAAA;IACR,CAAC;CACF,CAAA"}
1
+ {"version":3,"file":"outbound-order-by-status.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/dashboard/outbound-order-by-status.ts"],"names":[],"mappings":";;;AAKa,QAAA,6BAA6B,GAAG;IAC3C,KAAK,CAAC,qBAAqB,CAAC,CAAM,EAAE,MAAiB,EAAE,OAAY;QACjE,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,GAAsD,OAAO,CAAC,KAAK,CAAA;QAEvF,MAAM,WAAW,GAAwC,MAAM,EAAE,CAAC,KAAK,CACrE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA0DD,EACC,CAAC,MAAM,CAAC,EAAE,CAAC,CACZ,CAAA;QAED,MAAM,UAAU,GAAa;YAC3B,oBAAoB;YACpB,kBAAkB;YAClB,SAAS;YACT,mBAAmB;YACnB,oBAAoB;YACpB,WAAW;YACX,MAAM;YACN,cAAc;SACf,CAAA;QAED,OAAO,UAAU,CAAC,MAAM,CAAC,CAAC,YAAiD,EAAE,MAAc,EAAE,EAAE;YAC7F,IAAI,SAAS,GAAG,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,IAAI,MAAM,CAAC,CAAA;YAEjE,IAAI,SAAS;gBAAE,YAAY,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,CAAC,KAAK,EAAE,CAAC,CAAA;;gBAC/D,YAAY,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAA;YAE5C,OAAO,YAAY,CAAA;QACrB,CAAC,EAAE,EAAE,CAAC,CAAA;IACR,CAAC;CACF,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/operato-wms",
3
- "version": "4.3.16",
3
+ "version": "4.3.17",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "client/index.js",
6
6
  "things-factory": true,
@@ -92,7 +92,7 @@
92
92
  "@things-factory/print-ui": "^4.3.14",
93
93
  "@things-factory/product-base": "^4.3.14",
94
94
  "@things-factory/resource-ui": "^4.3.14",
95
- "@things-factory/sales-ui": "^4.3.16",
95
+ "@things-factory/sales-ui": "^4.3.17",
96
96
  "@things-factory/scene-data-transform": "^4.3.14",
97
97
  "@things-factory/scene-excel": "^4.3.14",
98
98
  "@things-factory/scene-firebase": "^4.3.14",
@@ -109,7 +109,7 @@
109
109
  "@things-factory/transport-base": "^4.3.14",
110
110
  "@things-factory/tutorial-ui": "^4.3.14",
111
111
  "@things-factory/warehouse-base": "^4.3.16",
112
- "@things-factory/worksheet-base": "^4.3.16"
112
+ "@things-factory/worksheet-base": "^4.3.17"
113
113
  },
114
114
  "devDependencies": {
115
115
  "@things-factory/builder": "^4.3.14",
@@ -118,5 +118,5 @@
118
118
  "cypress-localstorage-commands": "^1.6.1",
119
119
  "eslint-plugin-cypress": "^2.12.1"
120
120
  },
121
- "gitHead": "62892327e53288b479a13a53043067c678cd9bfc"
121
+ "gitHead": "5347681c08bd9c85d0ecd390f2411f07d20c1a78"
122
122
  }