@things-factory/operato-wms 4.3.39 → 4.3.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 (41) hide show
  1. package/client/pages/bulk-operation/bulk-operation.js +13 -2
  2. package/client/pages/bulk-operation/validate-ro-popup.js +40 -0
  3. package/client/pages/order/arrival-notice/arrival-notice-detail.js +2 -2
  4. package/client/pages/order/arrival-notice/create-arrival-notice.js +2 -2
  5. package/client/pages/order/goods-received-note/received-note-detail.js +187 -15
  6. package/client/pages/order/release-order/create-release-order.js +500 -6
  7. package/client/pages/order/release-order/release-order-detail.js +756 -165
  8. package/client/pages/order/transport-order/delivery-note-popup.js +970 -126
  9. package/client/pages/order/transport-order/print-delivery-note.js +162 -2
  10. package/client/pages/outbound/loading-product.js +87 -77
  11. package/client/pages/outbound/merged-outbound-worksheet.js +2 -2
  12. package/client/pages/outbound/picking-product.js +11 -7
  13. package/client/pages/outbound/route-label-popup.js +283 -191
  14. package/client/pages/outbound/sorting-product.js +7 -7
  15. package/client/pages/report/inbound-serial-number-report.js +86 -9
  16. package/client/pages/report/inventory-report.js +10 -0
  17. package/client/pages/report/outbound-serial-number-report.js +87 -9
  18. package/dist-server/graphql/resolvers/dashboard/inventory-expiry-monitor.js +10 -5
  19. package/dist-server/graphql/resolvers/dashboard/inventory-expiry-monitor.js.map +1 -1
  20. package/dist-server/graphql/resolvers/dashboard/outbound-order-by-status.js +11 -5
  21. package/dist-server/graphql/resolvers/dashboard/outbound-order-by-status.js.map +1 -1
  22. package/dist-server/graphql/resolvers/reports/inbound-serial-number-report.js +33 -4
  23. package/dist-server/graphql/resolvers/reports/inbound-serial-number-report.js.map +1 -1
  24. package/dist-server/graphql/resolvers/reports/outbound-serial-number-report.js +33 -8
  25. package/dist-server/graphql/resolvers/reports/outbound-serial-number-report.js.map +1 -1
  26. package/dist-server/utils/report-query-util.js +3 -2
  27. package/dist-server/utils/report-query-util.js.map +1 -1
  28. package/helps/release-note.ko.md +10 -12
  29. package/helps/release-note.md +10 -12
  30. package/helps/release-note.ms.md +10 -12
  31. package/helps/release-note.zh.md +10 -12
  32. package/package.json +21 -20
  33. package/server/graphql/resolvers/dashboard/inventory-expiry-monitor.ts +10 -8
  34. package/server/graphql/resolvers/dashboard/outbound-order-by-status.ts +10 -7
  35. package/server/graphql/resolvers/reports/inbound-serial-number-report.ts +34 -4
  36. package/server/graphql/resolvers/reports/outbound-serial-number-report.ts +34 -8
  37. package/server/utils/report-query-util.ts +3 -2
  38. package/translations/en.json +31 -0
  39. package/translations/ko.json +10 -1
  40. package/translations/ms.json +11 -1
  41. package/translations/zh.json +10 -1
@@ -2,34 +2,32 @@
2
2
 
3
3
  <div align="center">
4
4
 
5
- ## 20 May Update
5
+ ## 13 June Update
6
6
 
7
- #### V4.4.0 Release Note
7
+ #### V4.5.0 Release Note
8
8
 
9
9
  #### Greetings to all,
10
10
 
11
- #### We are back with more features and enhancements to digitize your warehouse operation!
11
+ #### Make June even better with the new features and enhancements we have in store for you!
12
12
 
13
13
  <div>
14
- 1. Volume Summary Report (beta)
14
+ 1. Shipment Information in Release Order
15
15
  </div>
16
16
  <div>
17
- 2. Excel upload for Purchase Order
17
+ 2. Excel Export of Goods Received Note and Delivery Order
18
18
  </div>
19
19
  <div>
20
- 3. Non-loaded inventory in Onhand Inventory
20
+ 3. Excel Export of Serial Number Report
21
21
  </div>
22
22
  <div>
23
- 4. Manufacture date in Onhand Inventory
23
+ 4. SKU in Inventory Report
24
24
  </div>
25
25
  <br>
26
- <a href="https://bit.ly/220519_Hatio_Release">V4.4.0 Release Note</a>
26
+ For additional information about the aspects of the release, see the following link
27
+ <a href="https://bit.ly/220613_Hatio_ReleaseNote">V4.5.0 Release Note</a>
27
28
  <br>
28
29
 
29
- Should you have any inquiry, feel free to contact support@hatio.asia!
30
- <br>
31
- Don't forget to stay cool and we shall together beat the heat away! Stay safe and positively negative!
32
-
30
+ Should you have any inquiries, feel free to contact support@hatio.asia! Stay safe and positively negative!
33
31
  <br>
34
32
 
35
33
  _**Team Hatio**
@@ -2,34 +2,32 @@
2
2
 
3
3
  <div align="center">
4
4
 
5
- ## 20 May Update
5
+ ## 13 June Update
6
6
 
7
- #### V4.4.0 Release Note
7
+ #### V4.5.0 Release Note
8
8
 
9
9
  #### Greetings to all,
10
10
 
11
- #### We are back with more features and enhancements to digitize your warehouse operation!
11
+ #### Make June even better with the new features and enhancements we have in store for you!
12
12
 
13
13
  <div>
14
- 1. Volume Summary Report (beta)
14
+ 1. Shipment Information in Release Order
15
15
  </div>
16
16
  <div>
17
- 2. Excel upload for Purchase Order
17
+ 2. Excel Export of Goods Received Note and Delivery Order
18
18
  </div>
19
19
  <div>
20
- 3. Non-loaded inventory in Onhand Inventory
20
+ 3. Excel Export of Serial Number Report
21
21
  </div>
22
22
  <div>
23
- 4. Manufacture date in Onhand Inventory
23
+ 4. SKU in Inventory Report
24
24
  </div>
25
25
  <br>
26
- <a href="https://bit.ly/220519_Hatio_Release">V4.4.0 Release Note</a>
26
+ For additional information about the aspects of the release, see the following link
27
+ <a href="https://bit.ly/220613_Hatio_ReleaseNote">V4.5.0 Release Note</a>
27
28
  <br>
28
29
 
29
- Should you have any inquiry, feel free to contact support@hatio.asia!
30
- <br>
31
- Don't forget to stay cool and we shall together beat the heat away! Stay safe and positively negative!
32
-
30
+ Should you have any inquiries, feel free to contact support@hatio.asia! Stay safe and positively negative!
33
31
  <br>
34
32
 
35
33
  _**Team Hatio**
@@ -2,34 +2,32 @@
2
2
 
3
3
  <div align="center">
4
4
 
5
- ## 20 May Update
5
+ ## 13 June Update
6
6
 
7
- #### V4.4.0 Release Note
7
+ #### V4.5.0 Release Note
8
8
 
9
9
  #### Greetings to all,
10
10
 
11
- #### We are back with more features and enhancements to digitize your warehouse operation!
11
+ #### Make June even better with the new features and enhancements we have in store for you!
12
12
 
13
13
  <div>
14
- 1. Volume Summary Report (beta)
14
+ 1. Shipment Information in Release Order
15
15
  </div>
16
16
  <div>
17
- 2. Excel upload for Purchase Order
17
+ 2. Excel Export of Goods Received Note and Delivery Order
18
18
  </div>
19
19
  <div>
20
- 3. Non-loaded inventory in Onhand Inventory
20
+ 3. Excel Export of Serial Number Report
21
21
  </div>
22
22
  <div>
23
- 4. Manufacture date in Onhand Inventory
23
+ 4. SKU in Inventory Report
24
24
  </div>
25
25
  <br>
26
- <a href="https://bit.ly/220519_Hatio_Release">V4.4.0 Release Note</a>
26
+ For additional information about the aspects of the release, see the following link
27
+ <a href="https://bit.ly/220613_Hatio_ReleaseNote">V4.5.0 Release Note</a>
27
28
  <br>
28
29
 
29
- Should you have any inquiry, feel free to contact support@hatio.asia!
30
- <br>
31
- Don't forget to stay cool and we shall together beat the heat away! Stay safe and positively negative!
32
-
30
+ Should you have any inquiries, feel free to contact support@hatio.asia! Stay safe and positively negative!
33
31
  <br>
34
32
 
35
33
  _**Team Hatio**
@@ -2,34 +2,32 @@
2
2
 
3
3
  <div align="center">
4
4
 
5
- ## 20 May Update
5
+ ## 13 June Update
6
6
 
7
- #### V4.4.0 Release Note
7
+ #### V4.5.0 Release Note
8
8
 
9
9
  #### Greetings to all,
10
10
 
11
- #### We are back with more features and enhancements to digitize your warehouse operation!
11
+ #### Make June even better with the new features and enhancements we have in store for you!
12
12
 
13
13
  <div>
14
- 1. Volume Summary Report (beta)
14
+ 1. Shipment Information in Release Order
15
15
  </div>
16
16
  <div>
17
- 2. Excel upload for Purchase Order
17
+ 2. Excel Export of Goods Received Note and Delivery Order
18
18
  </div>
19
19
  <div>
20
- 3. Non-loaded inventory in Onhand Inventory
20
+ 3. Excel Export of Serial Number Report
21
21
  </div>
22
22
  <div>
23
- 4. Manufacture date in Onhand Inventory
23
+ 4. SKU in Inventory Report
24
24
  </div>
25
25
  <br>
26
- <a href="https://bit.ly/220519_Hatio_Release">V4.4.0 Release Note</a>
26
+ For additional information about the aspects of the release, see the following link
27
+ <a href="https://bit.ly/220613_Hatio_ReleaseNote">V4.5.0 Release Note</a>
27
28
  <br>
28
29
 
29
- Should you have any inquiry, feel free to contact support@hatio.asia!
30
- <br>
31
- Don't forget to stay cool and we shall together beat the heat away! Stay safe and positively negative!
32
-
30
+ Should you have any inquiries, feel free to contact support@hatio.asia! Stay safe and positively negative!
33
31
  <br>
34
32
 
35
33
  _**Team Hatio**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/operato-wms",
3
- "version": "4.3.39",
3
+ "version": "4.3.40",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "client/index.js",
6
6
  "things-factory": true,
@@ -64,35 +64,36 @@
64
64
  "@operato/scene-table": "^0.1.6",
65
65
  "@operato/scene-wheel-sorter": "^0.1.6",
66
66
  "@things-factory/apptool-ui": "^4.3.35",
67
- "@things-factory/attachment-ui": "^4.3.38",
68
- "@things-factory/auth-ui": "^4.3.38",
67
+ "@things-factory/attachment-ui": "^4.3.40",
68
+ "@things-factory/auth-ui": "^4.3.40",
69
69
  "@things-factory/barcode-ui": "^4.3.35",
70
- "@things-factory/biz-ui": "^4.3.38",
71
- "@things-factory/board-service": "^4.3.38",
72
- "@things-factory/board-ui": "^4.3.38",
73
- "@things-factory/code-ui": "^4.3.38",
70
+ "@things-factory/biz-ui": "^4.3.40",
71
+ "@things-factory/board-service": "^4.3.40",
72
+ "@things-factory/board-ui": "^4.3.40",
73
+ "@things-factory/code-ui": "^4.3.40",
74
74
  "@things-factory/context-ui": "^4.3.35",
75
75
  "@things-factory/export-ui": "^4.3.35",
76
76
  "@things-factory/export-ui-csv": "^4.3.35",
77
77
  "@things-factory/export-ui-excel": "^4.3.35",
78
- "@things-factory/fav-base": "^4.3.38",
78
+ "@things-factory/fav-base": "^4.3.40",
79
79
  "@things-factory/form-ui": "^4.3.35",
80
+ "@things-factory/geography": "^4.3.40",
80
81
  "@things-factory/grist-ui": "^4.3.35",
81
82
  "@things-factory/help": "^4.3.35",
82
83
  "@things-factory/i18n-base": "^4.3.35",
83
- "@things-factory/id-rule-base": "^4.3.38",
84
+ "@things-factory/id-rule-base": "^4.3.40",
84
85
  "@things-factory/import-ui": "^4.3.35",
85
86
  "@things-factory/import-ui-excel": "^4.3.35",
86
- "@things-factory/menu-ui": "^4.3.38",
87
+ "@things-factory/menu-ui": "^4.3.40",
87
88
  "@things-factory/more-ui": "^4.3.35",
88
- "@things-factory/notification": "^4.3.38",
89
+ "@things-factory/notification": "^4.3.40",
89
90
  "@things-factory/pdf": "^4.3.35",
90
91
  "@things-factory/print-proxy-service": "^4.3.35",
91
92
  "@things-factory/print-service": "^4.3.35",
92
93
  "@things-factory/print-ui": "^4.3.35",
93
- "@things-factory/product-base": "^4.3.38",
94
- "@things-factory/resource-ui": "^4.3.38",
95
- "@things-factory/sales-ui": "^4.3.39",
94
+ "@things-factory/product-base": "^4.3.40",
95
+ "@things-factory/resource-ui": "^4.3.40",
96
+ "@things-factory/sales-ui": "^4.3.40",
96
97
  "@things-factory/scene-data-transform": "^4.3.35",
97
98
  "@things-factory/scene-excel": "^4.3.35",
98
99
  "@things-factory/scene-firebase": "^4.3.35",
@@ -104,12 +105,12 @@
104
105
  "@things-factory/scene-mqtt": "^4.3.35",
105
106
  "@things-factory/scene-restful": "^4.3.35",
106
107
  "@things-factory/scene-visualizer": "^4.3.35",
107
- "@things-factory/setting-ui": "^4.3.38",
108
+ "@things-factory/setting-ui": "^4.3.40",
108
109
  "@things-factory/system-ui": "^4.3.35",
109
- "@things-factory/transport-base": "^4.3.38",
110
- "@things-factory/tutorial-ui": "^4.3.38",
111
- "@things-factory/warehouse-base": "^4.3.39",
112
- "@things-factory/worksheet-base": "^4.3.39"
110
+ "@things-factory/transport-base": "^4.3.40",
111
+ "@things-factory/tutorial-ui": "^4.3.40",
112
+ "@things-factory/warehouse-base": "^4.3.40",
113
+ "@things-factory/worksheet-base": "^4.3.40"
113
114
  },
114
115
  "devDependencies": {
115
116
  "@things-factory/builder": "^4.3.35",
@@ -118,5 +119,5 @@
118
119
  "cypress-localstorage-commands": "^1.6.1",
119
120
  "eslint-plugin-cypress": "^2.12.1"
120
121
  },
121
- "gitHead": "fb8d1e9252adad381337fe604a8eaccaaee62b77"
122
+ "gitHead": "5ae9cd8d8abe747c4e8ac9e243468c1f6662481b"
122
123
  }
@@ -7,14 +7,16 @@ import { getPermittedBizplaceIds } from '@things-factory/biz-base'
7
7
  export const inventoryExpiryMonitorResolver = {
8
8
  async inventoryExpiryMonitor(_: any, params: ListParam, context: any) {
9
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(',')
10
+ const bizplaceId: string = params.filters.find((filter: any) => filter.name === 'bizplace')?.value || 'ALL'
11
+ const v4 = new RegExp(/^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i)
12
+ let bizplaceIds: string
13
+
14
+ if (bizplaceId && (bizplaceId == 'ALL' || bizplaceId.match(v4))){
15
+ let bizplaces: string[] = bizplaceId && bizplaceId != 'ALL' ? [bizplaceId] : await getPermittedBizplaceIds(domain, user)
16
+ bizplaceIds = bizplaces.map(bizplace => {
17
+ return "'" + bizplace?.trim() + "'"
18
+ }).join(',')
19
+ } else throw new Error('invalid bizplaceId')
18
20
 
19
21
  const expInventories: {
20
22
  location: string
@@ -7,14 +7,16 @@ import { getPermittedBizplaceIds } from '@things-factory/biz-base'
7
7
  export const outboundOrderByStatusResolver = {
8
8
  async outboundOrderByStatus(_: any, params: ListParam, context: any) {
9
9
  const { domain, user, tx }: { domain: Domain; user: User; tx: EntityManager } = context.state
10
+ const bizplaceId: string = params.filters.find((filter: any) => filter.name === 'bizplace')?.value || 'ALL'
11
+ const v4 = new RegExp(/^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i)
12
+ let bizplaceIds: string
10
13
 
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(',')
14
+ if (bizplaceId && (bizplaceId == 'ALL' || bizplaceId.match(v4))){
15
+ let bizplaces: string[] = bizplaceId && bizplaceId != 'ALL' ? [bizplaceId] : await getPermittedBizplaceIds(domain, user)
16
+ bizplaceIds = bizplaces.map(bizplace => {
17
+ return "'" + bizplace?.trim() + "'"
18
+ }).join(',')
19
+ } else throw new Error('invalid bizplaceId')
18
20
 
19
21
  const orderStatus: { status: string; count: number }[] = await tx.query(
20
22
  `
@@ -78,6 +80,7 @@ export const outboundOrderByStatusResolver = {
78
80
  INNER JOIN release_goods rg ON rg.manifest_id = m.id
79
81
  WHERE m."status" = 'OPEN'
80
82
  AND m."domain_id" = $1
83
+ AND rg."bizplace_id" IN (${bizplaceIds})
81
84
  UNION ALL
82
85
  SELECT 'PICKING ASSIGNED' AS "status", count(*) FROM worksheets w
83
86
  WHERE w."domain_id" = $1
@@ -14,7 +14,11 @@ export const inboundSerialNumberReport = {
14
14
  let userFilter = params.filters.find(data => data.name === 'user')
15
15
  let fromDate = params.filters.find(data => data.name === 'fromDate')
16
16
  let toDate = params.filters.find(data => data.name === 'toDate')
17
- let ganNo = params.filters.find(data => data.name === 'ganNo')
17
+ let orderNo = params.filters.find(data => data.name === 'orderNo')
18
+ let ref = params.filters.find(data => data.name === 'ref')
19
+ let palletId = params.filters.find(data => data.name === 'palletId')
20
+ let cartonId = params.filters.find(data => data.name === 'cartonId')
21
+ let serialNumber = params.filters.find(data => data.name === 'serialNumber')
18
22
 
19
23
  if (userFilter) {
20
24
  const user: User = await tx.getRepository(User).findOne({
@@ -40,8 +44,33 @@ export const inboundSerialNumberReport = {
40
44
  await rawProductsQuery(tx, params, bizplace)
41
45
 
42
46
  let extraQueryFilters = ''
43
- if (ganNo) {
44
- extraQueryFilters = `${extraQueryFilters} and order_no like '%${ganNo.value}%' `
47
+ if (orderNo) {
48
+ extraQueryFilters = `${extraQueryFilters} and order_no like '%${orderNo.value}%' `
49
+ }
50
+ if (palletId) {
51
+ extraQueryFilters = `${extraQueryFilters} and pallet_id like '%${palletId.value}%' `
52
+ }
53
+ if (cartonId) {
54
+ extraQueryFilters = `${extraQueryFilters} and carton_id like '%${cartonId.value}%' `
55
+ }
56
+ if (serialNumber) {
57
+ extraQueryFilters = `${extraQueryFilters} and serial_number like '%${serialNumber.value}%' `
58
+ }
59
+
60
+ let refNoQueryFilter = ''
61
+ if (ref) {
62
+ let refValue = ref.value
63
+ .toLowerCase()
64
+ .split(',')
65
+ .map(ref => {
66
+ return "'%" + ref.trim().replace(/'/g, "''") + "%'"
67
+ })
68
+ .join(',')
69
+ refNoQueryFilter = `AND (
70
+ Lower(an.ref_no) LIKE ANY(ARRAY[${refValue}])
71
+ OR Lower(an.ref_no_2) LIKE ANY(ARRAY[${refValue}])
72
+ OR Lower(an.ref_no_3) LIKE ANY(ARRAY[${refValue}])
73
+ )`
45
74
  }
46
75
 
47
76
  await tx.query(
@@ -59,13 +88,14 @@ export const inboundSerialNumberReport = {
59
88
  coalesce(w.started_at,ii.created_at) as "etd"
60
89
  from inventory_items ii
61
90
  inner join inventories i on i.id = ii.inventory_id
62
- inner join products p on p.id = i.product_id
91
+ inner join temp_products p on p.id = i.product_id
63
92
  left join product_details pd on pd.product_id = p.id and pd.packing_type = i.packing_type and pd.packing_size = i.packing_size
64
93
  left join arrival_notices an on an.id = ii.inbound_order_id::uuid
65
94
  left join worksheets w on w.arrival_notice_id = an.id and w.type = 'UNLOADING'
66
95
  where
67
96
  i.domain_id = $1 and i.bizplace_id = $2
68
97
  and coalesce(w.started_at, ii.created_at) between $3 and $4
98
+ ${refNoQueryFilter}
69
99
  order by coalesce(w.started_at, ii.created_at), p.sku
70
100
  ) src
71
101
  where 1=1
@@ -14,7 +14,11 @@ export const outboundSerialNumberReport = {
14
14
  let userFilter = params.filters.find(data => data.name === 'user')
15
15
  let fromDate = params.filters.find(data => data.name === 'fromDate')
16
16
  let toDate = params.filters.find(data => data.name === 'toDate')
17
- let ganNo = params.filters.find(data => data.name === 'ganNo')
17
+ let orderNo = params.filters.find(data => data.name === 'orderNo')
18
+ let ref = params.filters.find(data => data.name === 'ref')
19
+ let palletId = params.filters.find(data => data.name === 'palletId')
20
+ let cartonId = params.filters.find(data => data.name === 'cartonId')
21
+ let serialNumber = params.filters.find(data => data.name === 'serialNumber')
18
22
 
19
23
  if (userFilter) {
20
24
  const user: User = await tx.getRepository(User).findOne({
@@ -40,8 +44,33 @@ export const outboundSerialNumberReport = {
40
44
  await rawProductsQuery(tx, params, bizplace)
41
45
 
42
46
  let extraQueryFilters = ''
43
- if (ganNo) {
44
- extraQueryFilters = `${extraQueryFilters} and order_no like '%${ganNo.value}%' `
47
+ if (orderNo) {
48
+ extraQueryFilters = `${extraQueryFilters} and order_no like '%${orderNo.value}%' `
49
+ }
50
+ if (palletId) {
51
+ extraQueryFilters = `${extraQueryFilters} and pallet_id like '%${palletId.value}%' `
52
+ }
53
+ if (cartonId) {
54
+ extraQueryFilters = `${extraQueryFilters} and carton_id like '%${cartonId.value}%' `
55
+ }
56
+ if (serialNumber) {
57
+ extraQueryFilters = `${extraQueryFilters} and serial_number like '%${serialNumber.value}%' `
58
+ }
59
+
60
+ let refNoQueryFilter = ''
61
+ if (ref) {
62
+ let refValue = ref.value
63
+ .toLowerCase()
64
+ .split(',')
65
+ .map(ref => {
66
+ return "'%" + ref.trim().replace(/'/g, "''") + "%'"
67
+ })
68
+ .join(',')
69
+ refNoQueryFilter = `AND (
70
+ Lower(rg.ref_no) LIKE ANY(ARRAY[${refValue}])
71
+ OR Lower(rg.ref_no_2) LIKE ANY(ARRAY[${refValue}])
72
+ OR Lower(rg.ref_no_3) LIKE ANY(ARRAY[${refValue}])
73
+ )`
45
74
  }
46
75
 
47
76
  await tx.query(
@@ -60,17 +89,14 @@ export const outboundSerialNumberReport = {
60
89
  coalesce(w.started_at,ii.created_at) as "etd"
61
90
  from inventory_items ii
62
91
  inner join inventories i on i.id = ii.inventory_id
63
- inner join products p on p.id = i.product_id
92
+ inner join temp_products p on p.id = i.product_id
64
93
  left join product_details pd on pd.product_id = p.id and pd.packing_type = i.packing_type and pd.packing_size = i.packing_size
65
94
  inner join release_goods rg on rg.id = ii.outbound_order_id::uuid
66
- left join contact_points cp on cp.id = rg.deliver_to_id
67
- left join order_inventories oi on oi.release_good_id = rg.id and oi.inventory_id = i.id
68
- left join delivery_orders do2 on do2.id = oi.delivery_order_id
69
- left join contact_points cp2 on cp2.id = do2.contact_point_ref_id
70
95
  left join worksheets w on w.arrival_notice_id = rg.id and w.type = 'PICKING'
71
96
  where
72
97
  i.domain_id = $1 and i.bizplace_id = $2
73
98
  and coalesce(w.started_at, ii.created_at) between $3 and $4
99
+ ${refNoQueryFilter}
74
100
  order by coalesce(w.started_at, ii.created_at), p.sku
75
101
  ) src
76
102
  where 1=1
@@ -19,6 +19,7 @@ export async function rawProductsQuery(tx: EntityManager, params: ListParam, biz
19
19
  Lower(prd.name) LIKE ANY(ARRAY[${productValue}])
20
20
  OR Lower(prd.sku) LIKE ANY(ARRAY[${productValue}])
21
21
  OR Lower(prd.description) LIKE ANY(ARRAY[${productValue}])
22
+ OR Lower(prd.brand_sku) LIKE ANY(ARRAY[${productValue}])
22
23
  )`
23
24
  }
24
25
 
@@ -31,13 +32,13 @@ export async function rawProductsQuery(tx: EntityManager, params: ListParam, biz
31
32
  `
32
33
  create temp table temp_products on commit drop AS
33
34
  (
34
- select prd.id, prd.sku, prd.name, prd.description, prd.type, prd.id::varchar as product_id from products prd
35
+ select prd.id, prd.sku, prd.name, prd.description, prd.type, prd.id::varchar as product_id, prd.brand_sku from products prd
35
36
  inner join bizplaces b on b.id = prd.bizplace_id
36
37
  inner join companies c on c.domain_id = b.domain_id
37
38
  inner join bizplaces b2 on b2.company_id = c.id
38
39
  where b2.id = $1
39
40
  ${productQuery}
40
- GROUP BY prd.id, prd.sku, prd.name, prd.description
41
+ GROUP BY prd.id, prd.sku, prd.name, prd.description, prd.brand_sku
41
42
  )`,
42
43
  [bizplace.id]
43
44
  )