@things-factory/operato-wms 4.3.301 → 4.3.303
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/inventory/onhand-inventory.js +23 -19
- package/client/pages/order/release-order/release-order-detail.js +57 -14
- package/client/pages/outbound/route-label-popup.js +56 -3
- package/client/pages/report/outbound-order-details-report.js +1 -0
- package/client/pages/report/shortage-report.js +475 -0
- package/client/route.js +4 -0
- package/dist-server/graphql/resolvers/reports/index.js +2 -1
- package/dist-server/graphql/resolvers/reports/index.js.map +1 -1
- package/dist-server/graphql/resolvers/reports/shortage-report.js +115 -0
- package/dist-server/graphql/resolvers/reports/shortage-report.js.map +1 -0
- package/dist-server/graphql/types/reports/index.js +5 -0
- package/dist-server/graphql/types/reports/index.js.map +1 -1
- package/dist-server/graphql/types/reports/shortage-report-list.js +14 -0
- package/dist-server/graphql/types/reports/shortage-report-list.js.map +1 -0
- package/dist-server/graphql/types/reports/shortage-report-type.js +25 -0
- package/dist-server/graphql/types/reports/shortage-report-type.js.map +1 -0
- package/package.json +5 -5
- package/server/graphql/resolvers/reports/index.ts +6 -1
- package/server/graphql/resolvers/reports/shortage-report.ts +132 -0
- package/server/graphql/types/reports/index.ts +13 -2
- package/server/graphql/types/reports/shortage-report-list.ts +8 -0
- package/server/graphql/types/reports/shortage-report-type.ts +19 -0
- package/things-factory.config.js +6 -0
- package/translations/en.json +2 -0
- package/translations/ko.json +2 -0
- package/translations/ms.json +2 -0
- package/translations/zh.json +2 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ShortageReport = void 0;
|
|
7
|
+
const graphql_tag_1 = __importDefault(require("graphql-tag"));
|
|
8
|
+
exports.ShortageReport = (0, graphql_tag_1.default) `
|
|
9
|
+
type ShortageReport {
|
|
10
|
+
bizplaceName: String
|
|
11
|
+
orderNo: String
|
|
12
|
+
refNo: String
|
|
13
|
+
productSku: String
|
|
14
|
+
productName: String
|
|
15
|
+
orderQty: String
|
|
16
|
+
avQty: String
|
|
17
|
+
nettStock: String
|
|
18
|
+
deliveryAddress: String
|
|
19
|
+
state: String
|
|
20
|
+
city: String
|
|
21
|
+
country: String
|
|
22
|
+
createdAt: Date
|
|
23
|
+
}
|
|
24
|
+
`;
|
|
25
|
+
//# sourceMappingURL=shortage-report-type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shortage-report-type.js","sourceRoot":"","sources":["../../../../server/graphql/types/reports/shortage-report-type.ts"],"names":[],"mappings":";;;;;;AAAA,8DAA6B;AAEhB,QAAA,cAAc,GAAG,IAAA,qBAAG,EAAA;;;;;;;;;;;;;;;;CAgBhC,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.303",
|
|
4
4
|
"main": "dist-server/index.js",
|
|
5
5
|
"browser": "client/index.js",
|
|
6
6
|
"things-factory": true,
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
"@things-factory/print-ui": "^4.3.281",
|
|
92
92
|
"@things-factory/product-base": "^4.3.301",
|
|
93
93
|
"@things-factory/resource-ui": "^4.3.281",
|
|
94
|
-
"@things-factory/sales-ui": "^4.3.
|
|
94
|
+
"@things-factory/sales-ui": "^4.3.303",
|
|
95
95
|
"@things-factory/scene-data-transform": "^4.3.281",
|
|
96
96
|
"@things-factory/scene-excel": "^4.3.281",
|
|
97
97
|
"@things-factory/scene-firebase": "^4.3.281",
|
|
@@ -107,8 +107,8 @@
|
|
|
107
107
|
"@things-factory/system-ui": "^4.3.281",
|
|
108
108
|
"@things-factory/transport-base": "^4.3.301",
|
|
109
109
|
"@things-factory/tutorial-ui": "^4.3.281",
|
|
110
|
-
"@things-factory/warehouse-base": "^4.3.
|
|
111
|
-
"@things-factory/worksheet-base": "^4.3.
|
|
110
|
+
"@things-factory/warehouse-base": "^4.3.302",
|
|
111
|
+
"@things-factory/worksheet-base": "^4.3.303"
|
|
112
112
|
},
|
|
113
113
|
"devDependencies": {
|
|
114
114
|
"@things-factory/builder": "^4.3.281",
|
|
@@ -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": "7c72e05d9d87671bf1e8e03786c4de42d7d14847"
|
|
121
121
|
}
|
|
@@ -6,8 +6,12 @@ import { outboundOrderDetailsReport } from './outbound-order-details-report'
|
|
|
6
6
|
import { outboundSerialNumberReport } from './outbound-serial-number-report'
|
|
7
7
|
import { productLabelReport } from './product-label-report'
|
|
8
8
|
import { releaseInventoryReport } from './release-inventory-report'
|
|
9
|
+
import { shortageReport } from './shortage-report'
|
|
9
10
|
import { loadingQcReport } from './tote-loading-qc-report'
|
|
10
|
-
import {
|
|
11
|
+
import {
|
|
12
|
+
orderVasReport,
|
|
13
|
+
vasReport
|
|
14
|
+
} from './vas-report'
|
|
11
15
|
|
|
12
16
|
export const Query = {
|
|
13
17
|
...inboundSerialNumberReport,
|
|
@@ -17,6 +21,7 @@ export const Query = {
|
|
|
17
21
|
...outboundOrderDetailsReport,
|
|
18
22
|
...productLabelReport,
|
|
19
23
|
...releaseInventoryReport,
|
|
24
|
+
...shortageReport,
|
|
20
25
|
...loadingQcReport,
|
|
21
26
|
...orderVasReport,
|
|
22
27
|
...vasReport,
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { EntityManager } from 'typeorm'
|
|
2
|
+
|
|
3
|
+
import { ListParam } from '@things-factory/shell'
|
|
4
|
+
|
|
5
|
+
export const shortageReport = {
|
|
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
|
+
queryFilter = ''
|
|
21
|
+
|
|
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
|
+
roFilter += `AND (
|
|
32
|
+
Lower(drg.name) LIKE ANY(ARRAY[${productInfoValue}])
|
|
33
|
+
OR Lower(p.sku) LIKE ANY(ARRAY[${productInfoValue}])
|
|
34
|
+
OR Lower(p.sku) LIKE ANY(ARRAY[${productInfoValue}])
|
|
35
|
+
OR Lower(p.sku) LIKE ANY(ARRAY[${productInfoValue}])
|
|
36
|
+
OR Lower(p."name") LIKE ANY(ARRAY[${productInfoValue}])
|
|
37
|
+
OR Lower(p."name") LIKE ANY(ARRAY[${productInfoValue}])
|
|
38
|
+
OR Lower(p."name") LIKE ANY(ARRAY[${productInfoValue}])
|
|
39
|
+
|
|
40
|
+
)`
|
|
41
|
+
}
|
|
42
|
+
|
|
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
|
+
|
|
52
|
+
roFilter += `AND (
|
|
53
|
+
Lower(drg.name) LIKE ANY(ARRAY[${orderValue}])
|
|
54
|
+
OR Lower(drg.ref_no) LIKE ANY(ARRAY[${orderValue}])
|
|
55
|
+
OR Lower(drg.ref_no_2) LIKE ANY(ARRAY[${orderValue}])
|
|
56
|
+
OR Lower(drg.ref_no_3) LIKE ANY(ARRAY[${orderValue}])
|
|
57
|
+
)`
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
if (bizplace) {
|
|
61
|
+
queryFilter += ` AND drg.bizplace_id = '${bizplace.value}'`
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
if (!bizplaceFilter || !fromDate || !toDate) throw 'Invalid input'
|
|
65
|
+
|
|
66
|
+
await tx.query(
|
|
67
|
+
`
|
|
68
|
+
create temp table shortage_report on commit drop as (
|
|
69
|
+
select b."name" as "company", drg.name as "order_no",drg.ref_no, p.sku as "product_sku", p."name" as "product_name", op.release_qty as "order_quantity",
|
|
70
|
+
coalesce(src.av_qty,0) as available_qty, coalesce(src.av_qty - op.release_qty,0)as "Nett_Stock",
|
|
71
|
+
concat(drg.delivery_address_1, ' ', drg.delivery_address_2, ' ', drg.delivery_address_3, ' ', drg.delivery_address_4, ' ', drg.delivery_address_5) as "delivery_address",
|
|
72
|
+
drg.state,drg.city, drg.country, drg.created_at
|
|
73
|
+
from draft_release_goods drg
|
|
74
|
+
inner join bizplaces b on b.id = drg.bizplace_id
|
|
75
|
+
inner join order_products op on op.draft_release_good_id = drg.id
|
|
76
|
+
inner join products p on p.id = op.product_id
|
|
77
|
+
left join (
|
|
78
|
+
select product_id, sum(qty - locked_qty)as "av_qty" from inventories i where i.domain_id = $1
|
|
79
|
+
group by product_id ) src
|
|
80
|
+
on op.product_id = src.product_id
|
|
81
|
+
where drg.status = 'DRAFT'
|
|
82
|
+
and drg.domain_id = $1
|
|
83
|
+
and coalesce(src.av_qty - op.release_qty,0) < 0
|
|
84
|
+
and drg.created_at >= $2
|
|
85
|
+
and drg.created_at <= $3
|
|
86
|
+
${roFilter}
|
|
87
|
+
${queryFilter}
|
|
88
|
+
order by drg.created_at desc
|
|
89
|
+
);
|
|
90
|
+
`,
|
|
91
|
+
[context.state.domain.id, fromDate.value, toDate.value]
|
|
92
|
+
)
|
|
93
|
+
|
|
94
|
+
const total: any = await tx.query(`
|
|
95
|
+
select count(*) from shortage_report
|
|
96
|
+
`)
|
|
97
|
+
|
|
98
|
+
const result: any = await tx.query(
|
|
99
|
+
`
|
|
100
|
+
select * from shortage_report
|
|
101
|
+
offset $1 limit $2
|
|
102
|
+
`,
|
|
103
|
+
[(params.pagination.page - 1) * params.pagination.limit, params.pagination.limit]
|
|
104
|
+
)
|
|
105
|
+
|
|
106
|
+
let items = result.map(itm => {
|
|
107
|
+
return{
|
|
108
|
+
bizplaceName: itm.company,
|
|
109
|
+
orderNo: itm.order_no,
|
|
110
|
+
refNo:itm.ref_no,
|
|
111
|
+
productSku: itm.product_sku,
|
|
112
|
+
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
|
|
121
|
+
}
|
|
122
|
+
})
|
|
123
|
+
|
|
124
|
+
return {
|
|
125
|
+
items,
|
|
126
|
+
total: total[0].count
|
|
127
|
+
}
|
|
128
|
+
} catch (error) {
|
|
129
|
+
throw error
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
@@ -16,8 +16,16 @@ import { ProductLabelReport } from './product-label-report'
|
|
|
16
16
|
import { ProductLabelReportList } from './product-label-report-list'
|
|
17
17
|
import { ReleaseInventoryReport } from './release-inventory-report'
|
|
18
18
|
import { ReleaseInventoryReportList } from './release-inventory-report-list'
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
19
|
+
import { ShortageReportList } from './shortage-report-list'
|
|
20
|
+
import { ShortageReport } from './shortage-report-type'
|
|
21
|
+
import {
|
|
22
|
+
OrderVasReport,
|
|
23
|
+
VasReport
|
|
24
|
+
} from './vas-report'
|
|
25
|
+
import {
|
|
26
|
+
OrderVasReportList,
|
|
27
|
+
VasReportList
|
|
28
|
+
} from './vas-report-list'
|
|
21
29
|
|
|
22
30
|
export const Query = `
|
|
23
31
|
inboundSerialNumberReport(filters: [Filter!], pagination: Pagination, sortings: [Sorting!]): InboundSerialNumberReportList @transaction
|
|
@@ -27,6 +35,7 @@ export const Query = `
|
|
|
27
35
|
productLabelReport(filters: [Filter!], pagination: Pagination, sortings: [Sorting!]): ProductLabelReportList @transaction
|
|
28
36
|
costingReport(filters: [Filter!], pagination: Pagination, sortings: [Sorting!]): CostingReportList @transaction
|
|
29
37
|
releaseInventoryReport(filters: [Filter!], pagination: Pagination, sortings: [Sorting!]): ReleaseInventoryReportList @transaction
|
|
38
|
+
shortageReport(filters: [Filter!], pagination: Pagination, sortings: [Sorting!]):ShortageReportList @transaction
|
|
30
39
|
loadingQcReport(filters: [Filter!], pagination: Pagination, sortings: [Sorting!]): [LoadingQcReport] @transaction
|
|
31
40
|
orderVasReport(filters: [Filter!], pagination: Pagination, sortings: [Sorting!]): OrderVasReportList @transaction
|
|
32
41
|
vasReport(filters: [Filter!], pagination: Pagination, sortings: [Sorting!]): OrderVasReportList @transaction
|
|
@@ -48,6 +57,8 @@ export const Types = [
|
|
|
48
57
|
CostingReportList,
|
|
49
58
|
ReleaseInventoryReport,
|
|
50
59
|
ReleaseInventoryReportList,
|
|
60
|
+
ShortageReport,
|
|
61
|
+
ShortageReportList,
|
|
51
62
|
LoadingQcReport,
|
|
52
63
|
LoadingQcReportList,
|
|
53
64
|
OrderVasReport,
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import gql from 'graphql-tag'
|
|
2
|
+
|
|
3
|
+
export const ShortageReport = gql`
|
|
4
|
+
type ShortageReport {
|
|
5
|
+
bizplaceName: String
|
|
6
|
+
orderNo: String
|
|
7
|
+
refNo: String
|
|
8
|
+
productSku: String
|
|
9
|
+
productName: String
|
|
10
|
+
orderQty: String
|
|
11
|
+
avQty: String
|
|
12
|
+
nettStock: String
|
|
13
|
+
deliveryAddress: String
|
|
14
|
+
state: String
|
|
15
|
+
city: String
|
|
16
|
+
country: String
|
|
17
|
+
createdAt: Date
|
|
18
|
+
}
|
|
19
|
+
`
|
package/things-factory.config.js
CHANGED
|
@@ -43,6 +43,8 @@ export default {
|
|
|
43
43
|
tagname: 'tote-list',
|
|
44
44
|
page: 'totes'
|
|
45
45
|
},
|
|
46
|
+
|
|
47
|
+
|
|
46
48
|
|
|
47
49
|
/**
|
|
48
50
|
* Order Menus Section
|
|
@@ -512,6 +514,10 @@ export default {
|
|
|
512
514
|
tagname: 'vas-report',
|
|
513
515
|
page: 'vas_report'
|
|
514
516
|
},
|
|
517
|
+
{
|
|
518
|
+
tagname:'shortage-report',
|
|
519
|
+
page:'shortage_report'
|
|
520
|
+
},
|
|
515
521
|
{
|
|
516
522
|
tagname: 'analysis-picking-packing-report',
|
|
517
523
|
page: 'analysis_picking_packing_report'
|
package/translations/en.json
CHANGED
|
@@ -388,6 +388,7 @@
|
|
|
388
388
|
"field.name": "name",
|
|
389
389
|
"field.need_fleet": "need fleet",
|
|
390
390
|
"field.need_transport": "need transport",
|
|
391
|
+
"field.nett_stock":"nett stock",
|
|
391
392
|
"field.nett_weight": "nett weight",
|
|
392
393
|
"field.new_sku_same_as_original_sku": "new SKU same as original SKU",
|
|
393
394
|
"field.new_sku": "new SKU",
|
|
@@ -1274,6 +1275,7 @@
|
|
|
1274
1275
|
"text.do_you_want_to_print": "do you want to print",
|
|
1275
1276
|
"text.do_you_want_to_proceed": "do you want to proceed",
|
|
1276
1277
|
"text.do_you_wish_to_proceed_the_selected_products_will_be_removed": "Do you wish to proceed? The selected product will be removed.",
|
|
1278
|
+
"text.does_not_support_multi_package": "Does not support multi-package",
|
|
1277
1279
|
"text.document_has_been_generated": "document has been generated",
|
|
1278
1280
|
"text.draft_order_form_invalid": "draft order form invalid",
|
|
1279
1281
|
"text.draft_purchase_order": "draft purchase order",
|
package/translations/ko.json
CHANGED
|
@@ -392,6 +392,7 @@
|
|
|
392
392
|
"field.name": "이름",
|
|
393
393
|
"field.need_fleet": "선적 필요여부",
|
|
394
394
|
"field.need_transport": "운송 필요여부",
|
|
395
|
+
"field.nett_stock":"[ko]nett stock",
|
|
395
396
|
"field.nett_weight": "[ko]nett weight",
|
|
396
397
|
"field.no_of_items": "[ko] no of items",
|
|
397
398
|
"field.no": "[ko]no",
|
|
@@ -1268,6 +1269,7 @@
|
|
|
1268
1269
|
"text.do_you_want_to_print": "인쇄 하시겠습니까?",
|
|
1269
1270
|
"text.do_you_want_to_proceed": "[ko] do you want to proceed",
|
|
1270
1271
|
"text.do_you_wish_to_proceed_the_selected_products_will_be_removed": "[ko] Do you wish to proceed? The selected product will be removed.",
|
|
1272
|
+
"text.does_not_support_multi_package": "[ko] Does not support multi-package",
|
|
1271
1273
|
"text.document_has_been_generated": "[ko] document has been generated",
|
|
1272
1274
|
"text.draft_order_form_invalid": "[ko] draft order form invalid",
|
|
1273
1275
|
"text.driver_and_vehicle_is_not_selected": "운송기사와 차량이 선택되지 않았습니다",
|
package/translations/ms.json
CHANGED
|
@@ -375,6 +375,7 @@
|
|
|
375
375
|
"field.name": "nama",
|
|
376
376
|
"field.need_fleet": "keperluan armada",
|
|
377
377
|
"field.need_transport": "kenderaan diperlukan",
|
|
378
|
+
"field.nett_stock":"[ms]nett stock",
|
|
378
379
|
"field.nett_weight": "[ms]nett weight",
|
|
379
380
|
"field.no_of_items": "[ms] no of items",
|
|
380
381
|
"field.no": "[ms]no",
|
|
@@ -1240,6 +1241,7 @@
|
|
|
1240
1241
|
"text.do_you_want_to_print": "adakah anda mahu catak",
|
|
1241
1242
|
"text.do_you_want_to_proceed": "[ms] do you want to proceed",
|
|
1242
1243
|
"text.do_you_wish_to_proceed_the_selected_products_will_be_removed": "[ms] Do you wish to proceed? The selected product will be removed.",
|
|
1244
|
+
"text.does_not_support_multi_package": "[ms] Does not support multi-package",
|
|
1243
1245
|
"text.document_has_been_generated": "[ms] document has been generated",
|
|
1244
1246
|
"text.draft_order_form_invalid": "[ms] draft order form invalid",
|
|
1245
1247
|
"text.driver_and_vehicle_is_not_selected": "pemandu dan kenderaan belum dipilih",
|
package/translations/zh.json
CHANGED
|
@@ -359,6 +359,7 @@
|
|
|
359
359
|
"field.name": "名称",
|
|
360
360
|
"field.need_fleet": "需要车队",
|
|
361
361
|
"field.need_transport": "[zh]need transport",
|
|
362
|
+
"field.nett_stock":"[zh]nett stock",
|
|
362
363
|
"field.nett_weight": "[zh]nett weight",
|
|
363
364
|
"field.no": "[zh]no",
|
|
364
365
|
"field.non_tally": "[zh]non tally",
|
|
@@ -1208,6 +1209,7 @@
|
|
|
1208
1209
|
"text.do_you_want_to_print": "do you want to print",
|
|
1209
1210
|
"text.do_you_want_to_proceed": "[zh] do you want to proceed",
|
|
1210
1211
|
"text.do_you_wish_to_proceed_the_selected_products_will_be_removed": "Do you wish to proceed? The selected product will be removed.",
|
|
1212
|
+
"text.does_not_support_multi_package": "[zh] Does not support multi-package",
|
|
1211
1213
|
"text.document_has_been_generated": "[zh] document has been generated",
|
|
1212
1214
|
"text.draft_order_form_invalid": "[zh] draft order form invalid",
|
|
1213
1215
|
"text.driver_and_vehicle_is_not_selected": "driver and vehicle is not selected",
|