@things-factory/operato-wms 4.3.32 → 4.3.35

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.
@@ -485,7 +485,7 @@ class WorksheetPutaway extends localize(i18next)(PageView) {
485
485
  const currentLocationColumn = {
486
486
  type: 'object',
487
487
  name: 'location',
488
- header: i18next.t('field.current_location'),
488
+ header: i18next.t('field.buffer_location'),
489
489
  width: 170
490
490
  }
491
491
  const statusColumnConfig = {
@@ -47,7 +47,6 @@ class InventorySummaryReport extends connect(store)(localize(i18next)(PageView))
47
47
  _searchFields: Object,
48
48
  _config: Object,
49
49
  _partners: Object,
50
- _productType: Object,
51
50
  _gristData: Object,
52
51
  _byPallet: Boolean,
53
52
  data: Object
@@ -175,15 +174,7 @@ class InventorySummaryReport extends connect(store)(localize(i18next)(PageView))
175
174
  label: i18next.t('field.product_type'),
176
175
  name: 'productType',
177
176
  type: 'select',
178
- options: [
179
- { value: '' },
180
- ...this._productType.map(type => {
181
- return {
182
- name: type.name,
183
- value: type.name
184
- }
185
- })
186
- ],
177
+ options: [{ value: '' }],
187
178
  props: { searchOper: 'eq' }
188
179
  },
189
180
  {
@@ -322,7 +313,6 @@ class InventorySummaryReport extends connect(store)(localize(i18next)(PageView))
322
313
  this._gristData = { total: 0, totalWithOpeningBalance: 0, records: [] }
323
314
  this._products = []
324
315
  this._partners = [...(await this._fetchPartners())]
325
- this._productType = []
326
316
 
327
317
  this._searchFields = this.searchFields
328
318
  this._config = this.reportConfig
@@ -468,25 +458,44 @@ class InventorySummaryReport extends connect(store)(localize(i18next)(PageView))
468
458
 
469
459
  if (this._toDateInput.value < fromDate) this._toDateInput.value = fromDate
470
460
 
471
- let min = new Date(fromDate)
472
- let today = new Date()
473
- today.setHours(0, 0, 0, 0)
474
-
475
- min = min.toISOString().split('T')[0]
476
-
461
+ let min = new Date(fromDate).toISOString().split('T')[0]
477
462
  this._toDateInput.min = min
478
463
  this._submit()
479
464
  }
480
465
 
481
466
  async _companyChanged(e) {
482
- this._productType = !this._bizplaceSelector.value
467
+ const _productType = !this._bizplaceSelector.value
483
468
  ? []
484
469
  : await getPartnerCodeByName(
485
470
  'PRODUCT_TYPES',
486
471
  this._partners.find(p => p.id == this._bizplaceSelector.value)?.company?.domainId || ''
487
472
  )
488
473
 
489
- this._searchFields = [...this.searchFields]
474
+ // update searchFields with the latest productTypes and toDate's min props
475
+ this._searchFields = this._searchFields.map(field => {
476
+ switch (field.name) {
477
+ case 'productType':
478
+ field.options = [
479
+ { value: '' },
480
+ ..._productType.map(type => {
481
+ return {
482
+ name: type.name,
483
+ value: type.name
484
+ }
485
+ })
486
+ ]
487
+ break
488
+
489
+ case 'toDate':
490
+ field.props = {
491
+ ...field.props,
492
+ min: this._toDateInput.min
493
+ }
494
+ break
495
+ }
496
+
497
+ return field
498
+ })
490
499
  }
491
500
 
492
501
  _submit(e) {
@@ -12,9 +12,17 @@ var __rest = (this && this.__rest) || function (s, e) {
12
12
  };
13
13
  Object.defineProperty(exports, "__esModule", { value: true });
14
14
  exports.inventoryExpiryMonitorResolver = void 0;
15
+ const biz_base_1 = require("@things-factory/biz-base");
15
16
  exports.inventoryExpiryMonitorResolver = {
16
17
  async inventoryExpiryMonitor(_, params, context) {
17
- const { domain, tx } = context.state;
18
+ var _a;
19
+ const { domain, user, tx } = context.state;
20
+ const bizplaceId = ((_a = params.filters.find((filter) => filter.name === 'bizplace')) === null || _a === void 0 ? void 0 : _a.value) || null;
21
+ let bizplaceIds;
22
+ let bizplaces = bizplaceId != 'ALL' ? [bizplaceId] : await (0, biz_base_1.getPermittedBizplaceIds)(domain, user);
23
+ bizplaceIds = bizplaces.map(bizplace => {
24
+ return "'" + bizplace.trim() + "'";
25
+ }).join(',');
18
26
  const expInventories = await tx.query(`
19
27
  SELECT "location", sum("expired") AS "expired", sum("sixMonths") AS "sixMonths", sum("nineMonths") AS "nineMonths" FROM (
20
28
  SELECT
@@ -28,6 +36,7 @@ exports.inventoryExpiryMonitorResolver = {
28
36
  AND i.expiration_date NOTNULL
29
37
  AND i.status = 'STORED'
30
38
  AND i.domain_id = $1
39
+ AND i.bizplace_id IN (${bizplaceIds})
31
40
  ) AS foo
32
41
  GROUP BY "location"
33
42
  `, [domain.id]);
@@ -1 +1 @@
1
- {"version":3,"file":"inventory-expiry-monitor.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/dashboard/inventory-expiry-monitor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAKa,QAAA,8BAA8B,GAAG;IAC5C,KAAK,CAAC,sBAAsB,CAAC,CAAM,EAAE,MAAiB,EAAE,OAAY;QAClE,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,GAAsD,OAAO,CAAC,KAAK,CAAA;QAEvF,MAAM,cAAc,GAMd,MAAM,EAAE,CAAC,KAAK,CAClB;;;;;;;;;;;;;;;KAeD,EACC,CAAC,MAAM,CAAC,EAAE,CAAC,CACZ,CAAA;QAED,OAAO;YACL,WAAW,EAAE,sBAAsB,CAAC,cAAc,EAAE,aAAa,CAAC;YAClE,OAAO,EAAE,sBAAsB,CAAC,cAAc,EAAE,UAAU,CAAC;SAC5D,CAAA;IACH,CAAC;CACF,CAAA;AAED,SAAS,sBAAsB,CAAC,cAAc,EAAE,QAAQ;IACtD,IAAI,UAAU,GAAQ,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,QAAQ,IAAI,QAAQ,CAAC,CAAA;IAE1E,IAAI,UAAU;QAAE,OAAO,CAAC,CAAC,EAAoB,EAAE,EAAE;gBAAxB,EAAE,QAAQ,OAAU,EAAL,GAAG,cAAlB,YAAoB,CAAF;YAAO,OAAA,GAAG,CAAA;SAAA,CAAC,CAAC,UAAU,CAAC,CAAA;;QAC7D,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,CAAA;AACzD,CAAC"}
1
+ {"version":3,"file":"inventory-expiry-monitor.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/dashboard/inventory-expiry-monitor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAIA,uDAAkE;AAErD,QAAA,8BAA8B,GAAG;IAC5C,KAAK,CAAC,sBAAsB,CAAC,CAAM,EAAE,MAAiB,EAAE,OAAY;;QAClE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAsD,OAAO,CAAC,KAAK,CAAA;QAE7F,MAAM,UAAU,GAAW,CAAA,MAAA,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,MAAW,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,KAAK,UAAU,CAAC,0CAAE,KAAK,KAAI,IAAI,CAAA;QAC1G,IAAI,WAAqB,CAAA;QAEzB,IAAI,SAAS,GAAG,UAAU,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,MAAM,IAAA,kCAAuB,EAAC,MAAM,EAAE,IAAI,CAAC,CAAA;QAChG,WAAW,GAAG,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE;YACzB,OAAO,GAAG,GAAG,QAAQ,CAAC,IAAI,EAAE,GAAG,GAAG,CAAA;QACpC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;QAExB,MAAM,cAAc,GAMd,MAAM,EAAE,CAAC,KAAK,CAClB;;;;;;;;;;;;;gCAa0B,WAAW;;;KAGtC,EACC,CAAC,MAAM,CAAC,EAAE,CAAC,CACZ,CAAA;QAED,OAAO;YACL,WAAW,EAAE,sBAAsB,CAAC,cAAc,EAAE,aAAa,CAAC;YAClE,OAAO,EAAE,sBAAsB,CAAC,cAAc,EAAE,UAAU,CAAC;SAC5D,CAAA;IACH,CAAC;CACF,CAAA;AAED,SAAS,sBAAsB,CAAC,cAAc,EAAE,QAAQ;IACtD,IAAI,UAAU,GAAQ,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,QAAQ,IAAI,QAAQ,CAAC,CAAA;IAE1E,IAAI,UAAU;QAAE,OAAO,CAAC,CAAC,EAAoB,EAAE,EAAE;gBAAxB,EAAE,QAAQ,OAAU,EAAL,GAAG,cAAlB,YAAoB,CAAF;YAAO,OAAA,GAAG,CAAA;SAAA,CAAC,CAAC,UAAU,CAAC,CAAA;;QAC7D,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,CAAA;AACzD,CAAC"}
@@ -1,86 +1,117 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.outboundOrderByStatusResolver = void 0;
4
+ const biz_base_1 = require("@things-factory/biz-base");
4
5
  exports.outboundOrderByStatusResolver = {
5
6
  async outboundOrderByStatus(_, params, context) {
6
- const { domain, tx } = context.state;
7
+ var _a;
8
+ const { domain, user, tx } = context.state;
9
+ const bizplaceId = ((_a = params.filters.find((filter) => filter.name === 'bizplace')) === null || _a === void 0 ? void 0 : _a.value) || null;
10
+ let bizplaceIds;
11
+ let bizplaces = bizplaceId != 'ALL' ? [bizplaceId] : await (0, biz_base_1.getPermittedBizplaceIds)(domain, user);
12
+ bizplaceIds = bizplaces.map(bizplace => {
13
+ return "'" + bizplace.trim() + "'";
14
+ }).join(',');
7
15
  const orderStatus = await tx.query(`
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 (
27
- SELECT "status", COUNT(*) AS "count" FROM (
28
- SELECT
29
- CASE WHEN "status" = 'DONE' and rg.updated_at::date = CURRENT_DATE THEN 'DONE'
30
- WHEN "status" = 'CANCELLED' THEN 'CANCELLED'
31
- WHEN "status" IN('PENDING_RECEIVE', 'PENDING_WORKSHEET') THEN 'PICKING UNASSIGNED'
32
- END AS "status"
33
- FROM release_goods rg
34
- WHERE "domain_id" = $1
35
- AND rg."status" IN ('CANCELLED','PENDING', 'PENDING_RECEIVE', 'PENDING_WORKSHEET', 'READY_TO_PICK', 'PICKING', 'READY_TO_PACK', 'PACKING', 'DONE')
36
- ) AS foo
16
+ WITH cte_list ("status", "count") AS (
17
+ SELECT 'PICKING UNASSIGNED' AS status, 0 AS "count"
18
+ UNION
19
+ SELECT 'PICKING ASSIGNED' AS status, 0 AS "count"
20
+ UNION
21
+ SELECT 'BATCH PICKING ASSIGNED' AS status, 0 AS "count"
22
+ UNION
23
+ SELECT 'PACKING' AS status, 0 AS "count"
24
+ UNION
25
+ SELECT 'AWAITING DISPATCH' AS status, 0 AS "count"
26
+ UNION
27
+ SELECT 'OUT FROM WAREHOUSE' AS status, 0 AS "count"
28
+ UNION
29
+ SELECT 'PENDING MANIFEST CREATION' AS status, 0 AS "count"
30
+ UNION
31
+ SELECT 'DONE' AS status, 0 AS "count"
32
+ UNION
33
+ SELECT 'PENDING CANCEL' AS status, 0 AS "count"
34
+ UNION
35
+ SELECT 'CANCELLED' AS status, 0 AS "count"
36
+ UNION
37
+ SELECT 'OTHERS' AS status, 0 AS "count"
38
+ UNION
39
+ SELECT 'DRAFT' AS status, 0 AS "count"
40
+ ) SELECT l."status", coalesce(src."count", l."count") AS "count"
41
+ FROM cte_list l
42
+ LEFT JOIN (
43
+ SELECT "status", SUM("count") AS count FROM (
44
+ SELECT "status", COUNT(*) AS "count" FROM (
45
+ SELECT
46
+ CASE WHEN "status" = 'DONE' AND rg.updated_at::date = CURRENT_DATE THEN 'DONE'
47
+ WHEN "status" = 'PENDING_CANCEL' THEN 'PENDING CANCEL'
48
+ WHEN "status" = 'CANCELLED' AND rg.updated_at::date = CURRENT_DATE THEN 'CANCELLED'
49
+ WHEN "status" IN('PENDING_RECEIVE','PENDING_WORKSHEET') THEN 'PICKING UNASSIGNED'
50
+ END AS "status"
51
+ FROM release_goods rg
52
+ WHERE "domain_id" = $1
53
+ AND rg."bizplace_id" IN (${bizplaceIds})
54
+ AND rg."status" IN ('PENDING','PENDING_RECEIVE','PENDING_WORKSHEET','READY_TO_PICK','PICKING','READY_TO_PACK','PACKING','PENDING_CANCEL','CANCELLED','DONE')
55
+ ) AS foo
56
+ GROUP BY "status"
57
+ UNION ALL
58
+ SELECT "status", COUNT(*) AS "count" FROM (
59
+ SELECT
60
+ CASE WHEN "dispatchment_status" = 'DISPATCHED' AND rg.updated_at::date = CURRENT_DATE THEN 'OUT FROM WAREHOUSE'
61
+ END AS "status"
62
+ FROM release_goods rg
63
+ WHERE "domain_id" = $1
64
+ AND rg."bizplace_id" IN (${bizplaceIds})
65
+ AND rg."dispatchment_status" IN ('READY_TO_DISPATCH', 'DISPATCHED')
66
+ AND rg."status" NOT IN ('CANCELLED','PENDING_CANCEL')
67
+ AND rg."tracking_no" NOTNULL
68
+ AND rg."type" = 'b2c'
69
+ ) AS foo
70
+ GROUP BY "status"
71
+ UNION ALL
72
+ SELECT 'AWAITING DISPATCH' AS "status", count(*) FROM manifests m
73
+ INNER JOIN release_goods rg ON rg.manifest_id = m.id
74
+ WHERE m."status" = 'OPEN'
75
+ AND m."domain_id" = $1
76
+ UNION ALL
77
+ SELECT 'PICKING ASSIGNED' AS "status", count(*) FROM worksheets w
78
+ WHERE w."domain_id" = $1
79
+ AND w."bizplace_id" IN (${bizplaceIds})
80
+ AND w."type" = 'PICKING'
81
+ AND w."status" IN ('DEACTIVATED','EXECUTING','PENDING_CANCEL')
82
+ GROUP BY w."status"
83
+ UNION ALL
84
+ SELECT 'BATCH PICKING ASSIGNED' AS "status", count(*) FROM worksheets w
85
+ WHERE w."domain_id" = $1
86
+ AND w."bizplace_id" IN (${bizplaceIds})
87
+ AND w."type" = 'BATCH_PICKING'
88
+ AND w."status" IN ('DEACTIVATED','EXECUTING','PENDING_CANCEL')
89
+ GROUP BY w."status"
90
+ UNION ALL
91
+ SELECT 'PACKING' AS "status", count(*) FROM worksheets w
92
+ WHERE w."domain_id" = $1 AND w."type" = 'PACKING'
93
+ AND w."bizplace_id" IN (${bizplaceIds})
94
+ AND w."status" IN ('DEACTIVATED','EXECUTING','PENDING_CANCEL')
95
+ GROUP BY w."status"
96
+ UNION ALL
97
+ SELECT 'PENDING MANIFEST CREATION' AS "status", count(*) FROM release_goods rg
98
+ WHERE rg."domain_id" = $1
99
+ AND rg."bizplace_id" IN (${bizplaceIds})
100
+ AND rg."status" = 'DONE'
101
+ AND rg."manifest_id" ISNULL
102
+ AND rg."type" = 'b2c'
103
+ AND rg."updated_at" >= (CURRENT_DATE - 30)
104
+ UNION ALL
105
+ SELECT 'DRAFT' AS "status", count(*) FROM draft_release_goods drg
106
+ WHERE drg."domain_id" = $1
107
+ AND drg."bizplace_id" IN (${bizplaceIds})
108
+ AND drg."status" = 'DRAFT'
109
+ AND drg."type" = 'b2c'
110
+ ) AS src
37
111
  GROUP BY "status"
38
- UNION ALL
39
- SELECT "status", COUNT(*) AS "count" FROM (
40
- SELECT
41
- CASE WHEN "dispatchment_status" = 'DISPATCHED' THEN 'OUT FROM WAREHOUSE'
42
- END AS "status"
43
- FROM release_goods rg
44
- WHERE "domain_id" = $1
45
- AND rg."dispatchment_status" IN ('READY_TO_DISPATCH', 'DISPATCHED')
46
- AND rg."status" NOT IN ('CANCELLED', 'PENDING_CANCEL')
47
- AND rg."tracking_no" NOTNULL
48
- ) AS foo
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"
112
+ ) src ON src."status" = l."status"
65
113
  `, [domain.id]);
66
- const statusList = [
67
- 'PICKING UNASSIGNED',
68
- 'PICKING ASSIGNED',
69
- 'PACKING',
70
- 'AWAITING DISPATCH',
71
- 'OUT FROM WAREHOUSE',
72
- 'CANCELLED',
73
- 'DONE',
74
- 'OUT OF STOCK'
75
- ];
76
- return statusList.reduce((statusCounts, status) => {
77
- let foundItem = orderStatus.find(order => order.status == status);
78
- if (foundItem)
79
- statusCounts.push({ status, count: foundItem.count });
80
- else
81
- statusCounts.push({ status, count: 0 });
82
- return statusCounts;
83
- }, []);
114
+ return orderStatus;
84
115
  }
85
116
  };
86
117
  //# sourceMappingURL=outbound-order-by-status.js.map
@@ -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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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"}
1
+ {"version":3,"file":"outbound-order-by-status.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/dashboard/outbound-order-by-status.ts"],"names":[],"mappings":";;;AAIA,uDAAkE;AAErD,QAAA,6BAA6B,GAAG;IAC3C,KAAK,CAAC,qBAAqB,CAAC,CAAM,EAAE,MAAiB,EAAE,OAAY;;QACjE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAsD,OAAO,CAAC,KAAK,CAAA;QAE7F,MAAM,UAAU,GAAW,CAAA,MAAA,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,MAAW,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,KAAK,UAAU,CAAC,0CAAE,KAAK,KAAI,IAAI,CAAA;QAC1G,IAAI,WAAqB,CAAA;QAEzB,IAAI,SAAS,GAAG,UAAU,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,MAAM,IAAA,kCAAuB,EAAC,MAAM,EAAE,IAAI,CAAC,CAAA;QAChG,WAAW,GAAG,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE;YACzB,OAAO,GAAG,GAAG,QAAQ,CAAC,IAAI,EAAE,GAAG,GAAG,CAAA;QACpC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;QAExB,MAAM,WAAW,GAAwC,MAAM,EAAE,CAAC,KAAK,CACrE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uCAsCiC,WAAW;;;;;;;;;;;uCAWX,WAAW;;;;;;;;;;;;;;;oCAed,WAAW;;;;;;;oCAOX,WAAW;;;;;;;oCAOX,WAAW;;;;;;qCAMV,WAAW;;;;;;;;sCAQV,WAAW;;;;;;KAM5C,EACC,CAAC,MAAM,CAAC,EAAE,CAAC,CACZ,CAAA;QAED,OAAO,WAAW,CAAA;IACpB,CAAC;CACF,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/operato-wms",
3
- "version": "4.3.32",
3
+ "version": "4.3.35",
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.6",
64
64
  "@operato/scene-table": "^0.1.6",
65
65
  "@operato/scene-wheel-sorter": "^0.1.6",
66
- "@things-factory/apptool-ui": "^4.3.32",
67
- "@things-factory/attachment-ui": "^4.3.32",
68
- "@things-factory/auth-ui": "^4.3.32",
69
- "@things-factory/barcode-ui": "^4.3.32",
70
- "@things-factory/biz-ui": "^4.3.32",
71
- "@things-factory/board-service": "^4.3.32",
72
- "@things-factory/board-ui": "^4.3.32",
73
- "@things-factory/code-ui": "^4.3.32",
74
- "@things-factory/context-ui": "^4.3.32",
75
- "@things-factory/export-ui": "^4.3.32",
76
- "@things-factory/export-ui-csv": "^4.3.32",
77
- "@things-factory/export-ui-excel": "^4.3.32",
78
- "@things-factory/fav-base": "^4.3.32",
79
- "@things-factory/form-ui": "^4.3.32",
80
- "@things-factory/grist-ui": "^4.3.32",
81
- "@things-factory/help": "^4.3.32",
82
- "@things-factory/i18n-base": "^4.3.32",
83
- "@things-factory/id-rule-base": "^4.3.32",
84
- "@things-factory/import-ui": "^4.3.32",
85
- "@things-factory/import-ui-excel": "^4.3.32",
86
- "@things-factory/menu-ui": "^4.3.32",
87
- "@things-factory/more-ui": "^4.3.32",
88
- "@things-factory/notification": "^4.3.32",
89
- "@things-factory/pdf": "^4.3.32",
90
- "@things-factory/print-proxy-service": "^4.3.32",
91
- "@things-factory/print-service": "^4.3.32",
92
- "@things-factory/print-ui": "^4.3.32",
93
- "@things-factory/product-base": "^4.3.32",
94
- "@things-factory/resource-ui": "^4.3.32",
95
- "@things-factory/sales-ui": "^4.3.32",
96
- "@things-factory/scene-data-transform": "^4.3.32",
97
- "@things-factory/scene-excel": "^4.3.32",
98
- "@things-factory/scene-firebase": "^4.3.32",
99
- "@things-factory/scene-form": "^4.3.32",
100
- "@things-factory/scene-google-map": "^4.3.32",
101
- "@things-factory/scene-graphql": "^4.3.32",
102
- "@things-factory/scene-label": "^4.3.32",
103
- "@things-factory/scene-marker": "^4.3.32",
104
- "@things-factory/scene-mqtt": "^4.3.32",
105
- "@things-factory/scene-restful": "^4.3.32",
106
- "@things-factory/scene-visualizer": "^4.3.32",
107
- "@things-factory/setting-ui": "^4.3.32",
108
- "@things-factory/system-ui": "^4.3.32",
109
- "@things-factory/transport-base": "^4.3.32",
110
- "@things-factory/tutorial-ui": "^4.3.32",
111
- "@things-factory/warehouse-base": "^4.3.32",
112
- "@things-factory/worksheet-base": "^4.3.32"
66
+ "@things-factory/apptool-ui": "^4.3.35",
67
+ "@things-factory/attachment-ui": "^4.3.35",
68
+ "@things-factory/auth-ui": "^4.3.35",
69
+ "@things-factory/barcode-ui": "^4.3.35",
70
+ "@things-factory/biz-ui": "^4.3.35",
71
+ "@things-factory/board-service": "^4.3.35",
72
+ "@things-factory/board-ui": "^4.3.35",
73
+ "@things-factory/code-ui": "^4.3.35",
74
+ "@things-factory/context-ui": "^4.3.35",
75
+ "@things-factory/export-ui": "^4.3.35",
76
+ "@things-factory/export-ui-csv": "^4.3.35",
77
+ "@things-factory/export-ui-excel": "^4.3.35",
78
+ "@things-factory/fav-base": "^4.3.35",
79
+ "@things-factory/form-ui": "^4.3.35",
80
+ "@things-factory/grist-ui": "^4.3.35",
81
+ "@things-factory/help": "^4.3.35",
82
+ "@things-factory/i18n-base": "^4.3.35",
83
+ "@things-factory/id-rule-base": "^4.3.35",
84
+ "@things-factory/import-ui": "^4.3.35",
85
+ "@things-factory/import-ui-excel": "^4.3.35",
86
+ "@things-factory/menu-ui": "^4.3.35",
87
+ "@things-factory/more-ui": "^4.3.35",
88
+ "@things-factory/notification": "^4.3.35",
89
+ "@things-factory/pdf": "^4.3.35",
90
+ "@things-factory/print-proxy-service": "^4.3.35",
91
+ "@things-factory/print-service": "^4.3.35",
92
+ "@things-factory/print-ui": "^4.3.35",
93
+ "@things-factory/product-base": "^4.3.35",
94
+ "@things-factory/resource-ui": "^4.3.35",
95
+ "@things-factory/sales-ui": "^4.3.35",
96
+ "@things-factory/scene-data-transform": "^4.3.35",
97
+ "@things-factory/scene-excel": "^4.3.35",
98
+ "@things-factory/scene-firebase": "^4.3.35",
99
+ "@things-factory/scene-form": "^4.3.35",
100
+ "@things-factory/scene-google-map": "^4.3.35",
101
+ "@things-factory/scene-graphql": "^4.3.35",
102
+ "@things-factory/scene-label": "^4.3.35",
103
+ "@things-factory/scene-marker": "^4.3.35",
104
+ "@things-factory/scene-mqtt": "^4.3.35",
105
+ "@things-factory/scene-restful": "^4.3.35",
106
+ "@things-factory/scene-visualizer": "^4.3.35",
107
+ "@things-factory/setting-ui": "^4.3.35",
108
+ "@things-factory/system-ui": "^4.3.35",
109
+ "@things-factory/transport-base": "^4.3.35",
110
+ "@things-factory/tutorial-ui": "^4.3.35",
111
+ "@things-factory/warehouse-base": "^4.3.35",
112
+ "@things-factory/worksheet-base": "^4.3.35"
113
113
  },
114
114
  "devDependencies": {
115
- "@things-factory/builder": "^4.3.32",
115
+ "@things-factory/builder": "^4.3.35",
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": "0c5bd74405efd1db48838320c9afa68811c3e37a"
121
+ "gitHead": "3500a8c074e7ec6d112454b0b0631fcc9e41b886"
122
122
  }
@@ -2,10 +2,19 @@ import { EntityManager } from 'typeorm'
2
2
 
3
3
  import { User } from '@things-factory/auth-base'
4
4
  import { Domain, ListParam } from '@things-factory/shell'
5
+ import { getPermittedBizplaceIds } from '@things-factory/biz-base'
5
6
 
6
7
  export const inventoryExpiryMonitorResolver = {
7
8
  async inventoryExpiryMonitor(_: any, params: ListParam, context: any) {
8
- const { domain, tx }: { domain: Domain; user: User; tx: EntityManager } = context.state
9
+ const { domain, user, tx }: { domain: Domain; user: User; tx: EntityManager } = context.state
10
+
11
+ const bizplaceId: string = params.filters.find((filter: any) => filter.name === 'bizplace')?.value || null
12
+ let bizplaceIds: string[]
13
+
14
+ let bizplaces = bizplaceId != 'ALL' ? [bizplaceId] : await getPermittedBizplaceIds(domain, user)
15
+ bizplaceIds = bizplaces.map(bizplace => {
16
+ return "'" + bizplace.trim() + "'"
17
+ }).join(',')
9
18
 
10
19
  const expInventories: {
11
20
  location: string
@@ -27,6 +36,7 @@ export const inventoryExpiryMonitorResolver = {
27
36
  AND i.expiration_date NOTNULL
28
37
  AND i.status = 'STORED'
29
38
  AND i.domain_id = $1
39
+ AND i.bizplace_id IN (${bizplaceIds})
30
40
  ) AS foo
31
41
  GROUP BY "location"
32
42
  `,