@things-factory/operato-wms 4.3.37 → 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.
- package/client/pages/bulk-operation/bulk-operation.js +13 -2
- package/client/pages/bulk-operation/validate-ro-popup.js +40 -0
- package/client/pages/inbound/pallet-label-popup.js +2 -0
- package/client/pages/order/arrival-notice/arrival-notice-detail.js +2 -2
- package/client/pages/order/arrival-notice/create-arrival-notice.js +2 -2
- package/client/pages/order/goods-received-note/received-note-detail.js +187 -15
- package/client/pages/order/release-order/create-release-order.js +500 -6
- package/client/pages/order/release-order/release-order-detail.js +760 -169
- package/client/pages/order/transport-order/delivery-note-popup.js +970 -126
- package/client/pages/order/transport-order/print-delivery-note.js +162 -2
- package/client/pages/outbound/loading-product.js +87 -77
- package/client/pages/outbound/merged-outbound-worksheet.js +2 -2
- package/client/pages/outbound/picking-product.js +11 -7
- package/client/pages/outbound/route-label-popup.js +283 -191
- package/client/pages/outbound/sorting-product.js +7 -7
- package/client/pages/report/inbound-serial-number-report.js +86 -9
- package/client/pages/report/inventory-report.js +10 -0
- package/client/pages/report/outbound-serial-number-report.js +87 -9
- package/dist-server/graphql/resolvers/dashboard/inventory-expiry-monitor.js +10 -5
- package/dist-server/graphql/resolvers/dashboard/inventory-expiry-monitor.js.map +1 -1
- package/dist-server/graphql/resolvers/dashboard/outbound-order-by-status.js +11 -5
- package/dist-server/graphql/resolvers/dashboard/outbound-order-by-status.js.map +1 -1
- package/dist-server/graphql/resolvers/reports/inbound-serial-number-report.js +33 -4
- package/dist-server/graphql/resolvers/reports/inbound-serial-number-report.js.map +1 -1
- package/dist-server/graphql/resolvers/reports/outbound-serial-number-report.js +33 -8
- package/dist-server/graphql/resolvers/reports/outbound-serial-number-report.js.map +1 -1
- package/dist-server/utils/report-query-util.js +3 -2
- package/dist-server/utils/report-query-util.js.map +1 -1
- package/helps/release-note.ko.md +10 -12
- package/helps/release-note.md +10 -12
- package/helps/release-note.ms.md +10 -12
- package/helps/release-note.zh.md +10 -12
- package/package.json +21 -20
- package/server/graphql/resolvers/dashboard/inventory-expiry-monitor.ts +10 -8
- package/server/graphql/resolvers/dashboard/outbound-order-by-status.ts +10 -7
- package/server/graphql/resolvers/reports/inbound-serial-number-report.ts +34 -4
- package/server/graphql/resolvers/reports/outbound-serial-number-report.ts +34 -8
- package/server/utils/report-query-util.ts +3 -2
- package/translations/en.json +31 -0
- package/translations/ko.json +10 -1
- package/translations/ms.json +11 -1
- package/translations/zh.json +10 -1
package/helps/release-note.ko.md
CHANGED
|
@@ -2,34 +2,32 @@
|
|
|
2
2
|
|
|
3
3
|
<div align="center">
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## 13 June Update
|
|
6
6
|
|
|
7
|
-
#### V4.
|
|
7
|
+
#### V4.5.0 Release Note
|
|
8
8
|
|
|
9
9
|
#### Greetings to all,
|
|
10
10
|
|
|
11
|
-
####
|
|
11
|
+
#### Make June even better with the new features and enhancements we have in store for you!
|
|
12
12
|
|
|
13
13
|
<div>
|
|
14
|
-
1.
|
|
14
|
+
1. Shipment Information in Release Order
|
|
15
15
|
</div>
|
|
16
16
|
<div>
|
|
17
|
-
2. Excel
|
|
17
|
+
2. Excel Export of Goods Received Note and Delivery Order
|
|
18
18
|
</div>
|
|
19
19
|
<div>
|
|
20
|
-
3.
|
|
20
|
+
3. Excel Export of Serial Number Report
|
|
21
21
|
</div>
|
|
22
22
|
<div>
|
|
23
|
-
4.
|
|
23
|
+
4. SKU in Inventory Report
|
|
24
24
|
</div>
|
|
25
25
|
<br>
|
|
26
|
-
|
|
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
|
|
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/helps/release-note.md
CHANGED
|
@@ -2,34 +2,32 @@
|
|
|
2
2
|
|
|
3
3
|
<div align="center">
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## 13 June Update
|
|
6
6
|
|
|
7
|
-
#### V4.
|
|
7
|
+
#### V4.5.0 Release Note
|
|
8
8
|
|
|
9
9
|
#### Greetings to all,
|
|
10
10
|
|
|
11
|
-
####
|
|
11
|
+
#### Make June even better with the new features and enhancements we have in store for you!
|
|
12
12
|
|
|
13
13
|
<div>
|
|
14
|
-
1.
|
|
14
|
+
1. Shipment Information in Release Order
|
|
15
15
|
</div>
|
|
16
16
|
<div>
|
|
17
|
-
2. Excel
|
|
17
|
+
2. Excel Export of Goods Received Note and Delivery Order
|
|
18
18
|
</div>
|
|
19
19
|
<div>
|
|
20
|
-
3.
|
|
20
|
+
3. Excel Export of Serial Number Report
|
|
21
21
|
</div>
|
|
22
22
|
<div>
|
|
23
|
-
4.
|
|
23
|
+
4. SKU in Inventory Report
|
|
24
24
|
</div>
|
|
25
25
|
<br>
|
|
26
|
-
|
|
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
|
|
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/helps/release-note.ms.md
CHANGED
|
@@ -2,34 +2,32 @@
|
|
|
2
2
|
|
|
3
3
|
<div align="center">
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## 13 June Update
|
|
6
6
|
|
|
7
|
-
#### V4.
|
|
7
|
+
#### V4.5.0 Release Note
|
|
8
8
|
|
|
9
9
|
#### Greetings to all,
|
|
10
10
|
|
|
11
|
-
####
|
|
11
|
+
#### Make June even better with the new features and enhancements we have in store for you!
|
|
12
12
|
|
|
13
13
|
<div>
|
|
14
|
-
1.
|
|
14
|
+
1. Shipment Information in Release Order
|
|
15
15
|
</div>
|
|
16
16
|
<div>
|
|
17
|
-
2. Excel
|
|
17
|
+
2. Excel Export of Goods Received Note and Delivery Order
|
|
18
18
|
</div>
|
|
19
19
|
<div>
|
|
20
|
-
3.
|
|
20
|
+
3. Excel Export of Serial Number Report
|
|
21
21
|
</div>
|
|
22
22
|
<div>
|
|
23
|
-
4.
|
|
23
|
+
4. SKU in Inventory Report
|
|
24
24
|
</div>
|
|
25
25
|
<br>
|
|
26
|
-
|
|
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
|
|
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/helps/release-note.zh.md
CHANGED
|
@@ -2,34 +2,32 @@
|
|
|
2
2
|
|
|
3
3
|
<div align="center">
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## 13 June Update
|
|
6
6
|
|
|
7
|
-
#### V4.
|
|
7
|
+
#### V4.5.0 Release Note
|
|
8
8
|
|
|
9
9
|
#### Greetings to all,
|
|
10
10
|
|
|
11
|
-
####
|
|
11
|
+
#### Make June even better with the new features and enhancements we have in store for you!
|
|
12
12
|
|
|
13
13
|
<div>
|
|
14
|
-
1.
|
|
14
|
+
1. Shipment Information in Release Order
|
|
15
15
|
</div>
|
|
16
16
|
<div>
|
|
17
|
-
2. Excel
|
|
17
|
+
2. Excel Export of Goods Received Note and Delivery Order
|
|
18
18
|
</div>
|
|
19
19
|
<div>
|
|
20
|
-
3.
|
|
20
|
+
3. Excel Export of Serial Number Report
|
|
21
21
|
</div>
|
|
22
22
|
<div>
|
|
23
|
-
4.
|
|
23
|
+
4. SKU in Inventory Report
|
|
24
24
|
</div>
|
|
25
25
|
<br>
|
|
26
|
-
|
|
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
|
|
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.
|
|
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.
|
|
68
|
-
"@things-factory/auth-ui": "^4.3.
|
|
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.
|
|
71
|
-
"@things-factory/board-service": "^4.3.
|
|
72
|
-
"@things-factory/board-ui": "^4.3.
|
|
73
|
-
"@things-factory/code-ui": "^4.3.
|
|
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.
|
|
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.
|
|
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.
|
|
87
|
+
"@things-factory/menu-ui": "^4.3.40",
|
|
87
88
|
"@things-factory/more-ui": "^4.3.35",
|
|
88
|
-
"@things-factory/notification": "^4.3.
|
|
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.
|
|
94
|
-
"@things-factory/resource-ui": "^4.3.
|
|
95
|
-
"@things-factory/sales-ui": "^4.3.
|
|
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.
|
|
108
|
+
"@things-factory/setting-ui": "^4.3.40",
|
|
108
109
|
"@things-factory/system-ui": "^4.3.35",
|
|
109
|
-
"@things-factory/transport-base": "^4.3.
|
|
110
|
-
"@things-factory/tutorial-ui": "^4.3.
|
|
111
|
-
"@things-factory/warehouse-base": "^4.3.
|
|
112
|
-
"@things-factory/worksheet-base": "^4.3.
|
|
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": "
|
|
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
|
|
12
|
-
let bizplaceIds: string
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
|
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 (
|
|
44
|
-
extraQueryFilters = `${extraQueryFilters} and order_no like '%${
|
|
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
|
|
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
|
|
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 (
|
|
44
|
-
extraQueryFilters = `${extraQueryFilters} and order_no like '%${
|
|
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
|
|
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
|
)
|