@things-factory/operato-wms 4.3.411 → 4.3.413
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/order/draft-release-good/draft-release-good-detail.js +3 -3
- package/client/pages/report/shortage-report.js +1 -1
- package/dist-server/graphql/resolvers/reports/shortage-report.js +70 -23
- package/dist-server/graphql/resolvers/reports/shortage-report.js.map +1 -1
- package/package.json +3 -3
- package/server/graphql/resolvers/reports/shortage-report.ts +112 -65
|
@@ -558,7 +558,7 @@ class DraftReleaseGoodDetail extends connect(store)(localize(i18next)(PageView))
|
|
|
558
558
|
}
|
|
559
559
|
|
|
560
560
|
_initialiseProductGristConfig() {
|
|
561
|
-
let bundleData = this._draftOrderData?.orderProducts
|
|
561
|
+
let bundleData = this._draftOrderData?.orderProducts?.find(op => op.productBundle)
|
|
562
562
|
this._editable = this._draftOrderData?.status == DRAFT_RELEASE_ORDER_STATUS.DRAFT && !bundleData
|
|
563
563
|
this._orderProductGristConfig = {
|
|
564
564
|
pagination: { infinite: true },
|
|
@@ -831,7 +831,7 @@ class DraftReleaseGoodDetail extends connect(store)(localize(i18next)(PageView))
|
|
|
831
831
|
productDetail {
|
|
832
832
|
id
|
|
833
833
|
}
|
|
834
|
-
productBundle{
|
|
834
|
+
productBundle {
|
|
835
835
|
name
|
|
836
836
|
sku
|
|
837
837
|
description
|
|
@@ -1115,7 +1115,7 @@ class DraftReleaseGoodDetail extends connect(store)(localize(i18next)(PageView))
|
|
|
1115
1115
|
id: record.id ? record.id.toString() : null,
|
|
1116
1116
|
name: record.name ? record.name.toString() : null,
|
|
1117
1117
|
product: { id: record?.groupType == 'SINGLE' ? record.product.id : record?.productBundle?.id },
|
|
1118
|
-
productDetail: { id: record.productDetailId },
|
|
1118
|
+
productDetail: { id: record.productDetailId || record?.productDetail?.id },
|
|
1119
1119
|
packingType: record.packingType,
|
|
1120
1120
|
packingSize: record.packingSize,
|
|
1121
1121
|
uomValue: record?.uomValue ? record.uomValue : 0,
|
|
@@ -61,7 +61,7 @@ class shortageReport extends connect(store)(localize(i18next)(PageView)) {
|
|
|
61
61
|
return {
|
|
62
62
|
title: i18next.t('Shortage Report'),
|
|
63
63
|
exportable: {
|
|
64
|
-
name: i18next.t('
|
|
64
|
+
name: i18next.t('Shortage Report'),
|
|
65
65
|
data: this._exportableData.bind(this)
|
|
66
66
|
},
|
|
67
67
|
help: 'operato-wms/report/shortage-report'
|
|
@@ -55,29 +55,76 @@ exports.shortageReport = {
|
|
|
55
55
|
if (!bizplaceFilter || !fromDate || !toDate)
|
|
56
56
|
throw 'Invalid input';
|
|
57
57
|
await tx.query(`
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
58
|
+
CREATE TEMP TABLE shortage_report ON COMMIT DROP AS (
|
|
59
|
+
SELECT
|
|
60
|
+
b."name" AS "company",
|
|
61
|
+
drg.name AS "order_no",
|
|
62
|
+
drg.ref_no,
|
|
63
|
+
p.sku AS "product_sku",
|
|
64
|
+
p."name" AS "product_name",
|
|
65
|
+
op.release_qty AS "order_quantity",
|
|
66
|
+
COALESCE(src.av_qty, 0) AS available_qty,
|
|
67
|
+
COALESCE(src.av_qty, 0) - op.release_qty AS "Nett_Stock",
|
|
68
|
+
CONCAT(
|
|
69
|
+
drg.delivery_address_1, ' ',
|
|
70
|
+
drg.delivery_address_2, ' ',
|
|
71
|
+
drg.delivery_address_3, ' ',
|
|
72
|
+
drg.delivery_address_4, ' ',
|
|
73
|
+
drg.delivery_address_5
|
|
74
|
+
) AS "delivery_address",
|
|
75
|
+
drg.state,
|
|
76
|
+
drg.city,
|
|
77
|
+
drg.country,
|
|
78
|
+
drg.created_at
|
|
79
|
+
FROM
|
|
80
|
+
draft_release_goods drg
|
|
81
|
+
INNER JOIN
|
|
82
|
+
bizplaces b ON b.id = drg.bizplace_id
|
|
83
|
+
INNER JOIN
|
|
84
|
+
order_products op ON op.draft_release_good_id = drg.id
|
|
85
|
+
INNER JOIN
|
|
86
|
+
products p ON p.id = op.product_id
|
|
87
|
+
INNER JOIN
|
|
88
|
+
product_details pd ON pd.id = op.product_detail_id
|
|
89
|
+
LEFT JOIN (
|
|
90
|
+
SELECT
|
|
91
|
+
i.domain_id AS "domain_id",
|
|
92
|
+
i.bizplace_id AS "bizplace_id",
|
|
93
|
+
i.product_id AS "product_id",
|
|
94
|
+
i.product_detail_id AS "product_detail_id",
|
|
95
|
+
COALESCE(SUM(COALESCE(i.qty, 0)) - SUM(COALESCE(i.locked_qty, 0))) AS "av_qty"
|
|
96
|
+
FROM
|
|
97
|
+
inventories i
|
|
98
|
+
INNER JOIN
|
|
99
|
+
locations l2 ON i.location_id = l2.id AND i.domain_id = l2.domain_id AND l2.type NOT IN ('QUARANTINE', 'RESERVE', 'DAMAGE')
|
|
100
|
+
INNER JOIN
|
|
101
|
+
products p ON p.id = i.product_id
|
|
102
|
+
INNER JOIN
|
|
103
|
+
product_details pd ON pd.id = i.product_detail_id
|
|
104
|
+
WHERE
|
|
105
|
+
i.status = 'STORED'
|
|
106
|
+
AND i.obsolete IS FALSE
|
|
107
|
+
AND i.domain_id = $1
|
|
108
|
+
AND i.bizplace_id = '${bizplace.value}'
|
|
109
|
+
GROUP BY
|
|
110
|
+
i.domain_id,
|
|
111
|
+
i.bizplace_id,
|
|
112
|
+
i.product_id,
|
|
113
|
+
i.product_detail_id
|
|
114
|
+
) src ON op.product_id = src.product_id AND op.product_detail_id = src.product_detail_id
|
|
115
|
+
WHERE
|
|
116
|
+
drg.status = 'DRAFT'
|
|
117
|
+
AND drg.domain_id = $1
|
|
118
|
+
AND COALESCE(src.av_qty - op.release_qty, 0) <= 0
|
|
119
|
+
AND op.release_qty != COALESCE(src.av_qty, 0)
|
|
120
|
+
AND drg.created_at >= $2
|
|
121
|
+
AND drg.created_at <= $3
|
|
122
|
+
${roFilter}
|
|
123
|
+
${queryFilter}
|
|
124
|
+
ORDER BY
|
|
125
|
+
drg.created_at DESC
|
|
126
|
+
)
|
|
127
|
+
`, [context.state.domain.id, fromDate.value, toDate.value]);
|
|
81
128
|
const total = await tx.query(`
|
|
82
129
|
select count(*) from shortage_report
|
|
83
130
|
`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shortage-report.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/reports/shortage-report.ts"],"names":[],"mappings":";;;AAIa,QAAA,cAAc,GAAG;
|
|
1
|
+
{"version":3,"file":"shortage-report.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/reports/shortage-report.ts"],"names":[],"mappings":";;;AAIa,QAAA,cAAc,GAAG;IAC5B,KAAK,CAAC,cAAc,CAAC,CAAM,EAAE,MAAiB,EAAE,OAAY;QAC1D,IAAI;YACF,MAAM,EAAE,EAAE,EAAE,GAA0B,OAAO,CAAC,KAAK,CAAA;YACnD,IAAI,cAAc,GAAG,EAAE,IAAI,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CAAA;YAC1D,IAAI,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,KAAK,OAAO,CAAC,CAAA;YAChE,IAAI,QAAQ,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,KAAK,UAAU,CAAC,CAAA;YACtE,IAAI,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,KAAK,QAAQ,CAAC,CAA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AG,CAAC,aAAa;oBACxB,SAAS,EAAE,GAAG,CAAC,UAAU;oBACzB,eAAe,EAAE,GAAG,CAAC,gBAAgB;oBACrC,KAAK,EAAE,GAAG,CAAC,KAAK;oBAChB,IAAI,EAAE,GAAG,CAAC,IAAI;oBACd,OAAO,EAAE,GAAG,CAAC,OAAO;oBACpB,SAAS,EAAE,GAAG,CAAC,UAAU;iBAC1B,CAAA;YACH,CAAC,CAAC,CAAA;YAEF,OAAO;gBACL,KAAK;gBACL,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK;aACtB,CAAA;SACF;QAAC,OAAO,KAAK,EAAE;YACd,MAAM,KAAK,CAAA;SACZ;IACH,CAAC;CACF,CAAA"}
|
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.413",
|
|
4
4
|
"main": "dist-server/index.js",
|
|
5
5
|
"browser": "client/index.js",
|
|
6
6
|
"things-factory": true,
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
"@things-factory/transport-base": "^4.3.381",
|
|
109
109
|
"@things-factory/tutorial-ui": "^4.3.381",
|
|
110
110
|
"@things-factory/warehouse-base": "^4.3.411",
|
|
111
|
-
"@things-factory/worksheet-base": "^4.3.
|
|
111
|
+
"@things-factory/worksheet-base": "^4.3.413"
|
|
112
112
|
},
|
|
113
113
|
"devDependencies": {
|
|
114
114
|
"@things-factory/builder": "^4.3.381",
|
|
@@ -117,5 +117,5 @@
|
|
|
117
117
|
"cypress-localstorage-commands": "^1.6.1",
|
|
118
118
|
"eslint-plugin-cypress": "^2.12.1"
|
|
119
119
|
},
|
|
120
|
-
"gitHead": "
|
|
120
|
+
"gitHead": "8032f1e44446277514eb3b93cb5bed29f8c7d7c3"
|
|
121
121
|
}
|
|
@@ -3,31 +3,31 @@ import { EntityManager } from 'typeorm'
|
|
|
3
3
|
import { ListParam } from '@things-factory/shell'
|
|
4
4
|
|
|
5
5
|
export const shortageReport = {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
6
|
+
async shortageReport(_: any, params: ListParam, context: any) {
|
|
7
|
+
try {
|
|
8
|
+
const { tx }: { tx: EntityManager } = context.state
|
|
9
|
+
let bizplaceFilter = { name: '', operator: '', value: '' }
|
|
10
|
+
let order = params.filters.find(items => items.name === 'order')
|
|
11
|
+
let fromDate = params.filters.find(items => items.name === 'fromDate')
|
|
12
|
+
let toDate = params.filters.find(items => items.name === 'toDate')
|
|
13
|
+
let orderNo = params.filters.find(items => items.name === 'orderNo')
|
|
14
|
+
let product = params.filters.find(items => items.name === 'product')
|
|
15
|
+
let bizplace = params.filters.find(items => items.name === 'bizplace')
|
|
16
|
+
|
|
17
|
+
if (!bizplace) throw 'Invalid input'
|
|
18
|
+
|
|
19
|
+
let roFilter = '',
|
|
20
20
|
queryFilter = ''
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
22
|
+
if (product) {
|
|
23
|
+
let productInfoValue = product.value
|
|
24
|
+
.toLowerCase()
|
|
25
|
+
.split(',')
|
|
26
|
+
.map(prod => {
|
|
27
|
+
return "'%" + prod.trim().replace(/'/g, "''") + "%'"
|
|
28
|
+
})
|
|
29
|
+
.join(',')
|
|
30
|
+
|
|
31
31
|
roFilter += `AND (
|
|
32
32
|
Lower(drg.name) LIKE ANY(ARRAY[${productInfoValue}])
|
|
33
33
|
OR Lower(p.sku) LIKE ANY(ARRAY[${productInfoValue}])
|
|
@@ -40,14 +40,14 @@ export const shortageReport = {
|
|
|
40
40
|
)`
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
43
|
+
if (orderNo) {
|
|
44
|
+
let orderValue = orderNo.value
|
|
45
|
+
.toLowerCase()
|
|
46
|
+
.split(',')
|
|
47
|
+
.map(prod => {
|
|
48
|
+
return "'%" + prod.trim().replace(/'/g, "''") + "%'"
|
|
49
|
+
})
|
|
50
|
+
.join(',')
|
|
51
51
|
|
|
52
52
|
roFilter += `AND (
|
|
53
53
|
Lower(drg.name) LIKE ANY(ARRAY[${orderValue}])
|
|
@@ -65,29 +65,76 @@ export const shortageReport = {
|
|
|
65
65
|
|
|
66
66
|
await tx.query(
|
|
67
67
|
`
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
68
|
+
CREATE TEMP TABLE shortage_report ON COMMIT DROP AS (
|
|
69
|
+
SELECT
|
|
70
|
+
b."name" AS "company",
|
|
71
|
+
drg.name AS "order_no",
|
|
72
|
+
drg.ref_no,
|
|
73
|
+
p.sku AS "product_sku",
|
|
74
|
+
p."name" AS "product_name",
|
|
75
|
+
op.release_qty AS "order_quantity",
|
|
76
|
+
COALESCE(src.av_qty, 0) AS available_qty,
|
|
77
|
+
COALESCE(src.av_qty, 0) - op.release_qty AS "Nett_Stock",
|
|
78
|
+
CONCAT(
|
|
79
|
+
drg.delivery_address_1, ' ',
|
|
80
|
+
drg.delivery_address_2, ' ',
|
|
81
|
+
drg.delivery_address_3, ' ',
|
|
82
|
+
drg.delivery_address_4, ' ',
|
|
83
|
+
drg.delivery_address_5
|
|
84
|
+
) AS "delivery_address",
|
|
85
|
+
drg.state,
|
|
86
|
+
drg.city,
|
|
87
|
+
drg.country,
|
|
88
|
+
drg.created_at
|
|
89
|
+
FROM
|
|
90
|
+
draft_release_goods drg
|
|
91
|
+
INNER JOIN
|
|
92
|
+
bizplaces b ON b.id = drg.bizplace_id
|
|
93
|
+
INNER JOIN
|
|
94
|
+
order_products op ON op.draft_release_good_id = drg.id
|
|
95
|
+
INNER JOIN
|
|
96
|
+
products p ON p.id = op.product_id
|
|
97
|
+
INNER JOIN
|
|
98
|
+
product_details pd ON pd.id = op.product_detail_id
|
|
99
|
+
LEFT JOIN (
|
|
100
|
+
SELECT
|
|
101
|
+
i.domain_id AS "domain_id",
|
|
102
|
+
i.bizplace_id AS "bizplace_id",
|
|
103
|
+
i.product_id AS "product_id",
|
|
104
|
+
i.product_detail_id AS "product_detail_id",
|
|
105
|
+
COALESCE(SUM(COALESCE(i.qty, 0)) - SUM(COALESCE(i.locked_qty, 0))) AS "av_qty"
|
|
106
|
+
FROM
|
|
107
|
+
inventories i
|
|
108
|
+
INNER JOIN
|
|
109
|
+
locations l2 ON i.location_id = l2.id AND i.domain_id = l2.domain_id AND l2.type NOT IN ('QUARANTINE', 'RESERVE', 'DAMAGE')
|
|
110
|
+
INNER JOIN
|
|
111
|
+
products p ON p.id = i.product_id
|
|
112
|
+
INNER JOIN
|
|
113
|
+
product_details pd ON pd.id = i.product_detail_id
|
|
114
|
+
WHERE
|
|
115
|
+
i.status = 'STORED'
|
|
116
|
+
AND i.obsolete IS FALSE
|
|
117
|
+
AND i.domain_id = $1
|
|
118
|
+
AND i.bizplace_id = '${bizplace.value}'
|
|
119
|
+
GROUP BY
|
|
120
|
+
i.domain_id,
|
|
121
|
+
i.bizplace_id,
|
|
122
|
+
i.product_id,
|
|
123
|
+
i.product_detail_id
|
|
124
|
+
) src ON op.product_id = src.product_id AND op.product_detail_id = src.product_detail_id
|
|
125
|
+
WHERE
|
|
126
|
+
drg.status = 'DRAFT'
|
|
127
|
+
AND drg.domain_id = $1
|
|
128
|
+
AND COALESCE(src.av_qty - op.release_qty, 0) <= 0
|
|
129
|
+
AND op.release_qty != COALESCE(src.av_qty, 0)
|
|
130
|
+
AND drg.created_at >= $2
|
|
131
|
+
AND drg.created_at <= $3
|
|
132
|
+
${roFilter}
|
|
133
|
+
${queryFilter}
|
|
134
|
+
ORDER BY
|
|
135
|
+
drg.created_at DESC
|
|
136
|
+
)
|
|
137
|
+
`,
|
|
91
138
|
[context.state.domain.id, fromDate.value, toDate.value]
|
|
92
139
|
)
|
|
93
140
|
|
|
@@ -104,20 +151,20 @@ export const shortageReport = {
|
|
|
104
151
|
)
|
|
105
152
|
|
|
106
153
|
let items = result.map(itm => {
|
|
107
|
-
return{
|
|
154
|
+
return {
|
|
108
155
|
bizplaceName: itm.company,
|
|
109
156
|
orderNo: itm.order_no,
|
|
110
|
-
refNo:itm.ref_no,
|
|
157
|
+
refNo: itm.ref_no,
|
|
111
158
|
productSku: itm.product_sku,
|
|
112
159
|
productName: itm.product_name,
|
|
113
|
-
orderQty:itm.order_quantity,
|
|
114
|
-
avQty:itm.available_qty,
|
|
115
|
-
nettStock:itm.Nett_Stock,
|
|
116
|
-
deliveryAddress:itm.delivery_address,
|
|
117
|
-
state:itm.state,
|
|
118
|
-
city:itm.city,
|
|
119
|
-
country:itm.country,
|
|
120
|
-
createdAt:itm.created_at
|
|
160
|
+
orderQty: itm.order_quantity,
|
|
161
|
+
avQty: itm.available_qty,
|
|
162
|
+
nettStock: itm.Nett_Stock,
|
|
163
|
+
deliveryAddress: itm.delivery_address,
|
|
164
|
+
state: itm.state,
|
|
165
|
+
city: itm.city,
|
|
166
|
+
country: itm.country,
|
|
167
|
+
createdAt: itm.created_at
|
|
121
168
|
}
|
|
122
169
|
})
|
|
123
170
|
|
|
@@ -129,4 +176,4 @@ export const shortageReport = {
|
|
|
129
176
|
throw error
|
|
130
177
|
}
|
|
131
178
|
}
|
|
132
|
-
}
|
|
179
|
+
}
|