@things-factory/operato-wms 4.3.330 → 4.3.331
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/non-loaded-inventory.js +41 -6
- 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/non-loaded-inventory-report.js +141 -0
- package/dist-server/graphql/resolvers/reports/non-loaded-inventory-report.js.map +1 -0
- package/dist-server/graphql/types/reports/index.js +6 -1
- package/dist-server/graphql/types/reports/index.js.map +1 -1
- package/dist-server/graphql/types/reports/non-loaded-inventory-report-list.js +14 -0
- package/dist-server/graphql/types/reports/non-loaded-inventory-report-list.js.map +1 -0
- package/dist-server/graphql/types/reports/non-loaded-inventory-report.js +23 -0
- package/dist-server/graphql/types/reports/non-loaded-inventory-report.js.map +1 -0
- package/package.json +4 -4
- package/server/graphql/resolvers/reports/index.ts +3 -1
- package/server/graphql/resolvers/reports/non-loaded-inventory-report.ts +178 -0
- package/server/graphql/types/reports/index.ts +6 -1
- package/server/graphql/types/reports/non-loaded-inventory-report-list.ts +8 -0
- package/server/graphql/types/reports/non-loaded-inventory-report.ts +17 -0
|
@@ -2,11 +2,21 @@ import '@things-factory/form-ui'
|
|
|
2
2
|
import '@things-factory/grist-ui'
|
|
3
3
|
|
|
4
4
|
import gql from 'graphql-tag'
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
css,
|
|
7
|
+
html
|
|
8
|
+
} from 'lit-element'
|
|
6
9
|
import { connect } from 'pwa-helpers/connect-mixin'
|
|
7
10
|
|
|
8
|
-
import {
|
|
9
|
-
|
|
11
|
+
import {
|
|
12
|
+
i18next,
|
|
13
|
+
localize
|
|
14
|
+
} from '@things-factory/i18n-base'
|
|
15
|
+
import {
|
|
16
|
+
client,
|
|
17
|
+
PageView,
|
|
18
|
+
store
|
|
19
|
+
} from '@things-factory/shell'
|
|
10
20
|
import { ScrollbarStyles } from '@things-factory/styles'
|
|
11
21
|
import { isMobileDevice } from '@things-factory/utils'
|
|
12
22
|
|
|
@@ -93,7 +103,7 @@ class NonLoadedInventory extends connect(store)(localize(i18next)(PageView)) {
|
|
|
93
103
|
'binLocation'
|
|
94
104
|
]
|
|
95
105
|
},
|
|
96
|
-
pagination: { pages: [50, 100, 200, 500] },
|
|
106
|
+
pagination: { limit: 50, pages: [50, 100, 200, 500] },
|
|
97
107
|
rows: { appendable: false },
|
|
98
108
|
columns: [
|
|
99
109
|
{ type: 'gutter', gutterName: 'sequence' },
|
|
@@ -202,6 +212,12 @@ class NonLoadedInventory extends connect(store)(localize(i18next)(PageView)) {
|
|
|
202
212
|
label: true,
|
|
203
213
|
sortable: true,
|
|
204
214
|
width: 120
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
type: 'datetime',
|
|
218
|
+
name: 'createdAt',
|
|
219
|
+
header: i18next.t('field.created_at'),
|
|
220
|
+
width: 150
|
|
205
221
|
}
|
|
206
222
|
]
|
|
207
223
|
}
|
|
@@ -266,6 +282,16 @@ class NonLoadedInventory extends connect(store)(localize(i18next)(PageView)) {
|
|
|
266
282
|
name: 'binLocation',
|
|
267
283
|
type: 'text',
|
|
268
284
|
props: { searchOper: 'i_like' }
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
label: i18next.t('field.date'),
|
|
288
|
+
name: 'createdAt',
|
|
289
|
+
type: 'date',
|
|
290
|
+
props: {
|
|
291
|
+
searchOper: 'eq',
|
|
292
|
+
max: new Date().toISOString().split('T')[0]
|
|
293
|
+
},
|
|
294
|
+
value: new Date().toISOString().split('T')[0]
|
|
269
295
|
}
|
|
270
296
|
]
|
|
271
297
|
}
|
|
@@ -316,6 +342,7 @@ class NonLoadedInventory extends connect(store)(localize(i18next)(PageView)) {
|
|
|
316
342
|
binLocation {
|
|
317
343
|
name
|
|
318
344
|
}
|
|
345
|
+
createdAt
|
|
319
346
|
updatedAt
|
|
320
347
|
}
|
|
321
348
|
total
|
|
@@ -323,7 +350,7 @@ class NonLoadedInventory extends connect(store)(localize(i18next)(PageView)) {
|
|
|
323
350
|
}
|
|
324
351
|
`,
|
|
325
352
|
variables: {
|
|
326
|
-
filters,
|
|
353
|
+
filters: [...filters, { name: 'timezoneOffset', operator: 'eq', value: new Date().getTimezoneOffset() }],
|
|
327
354
|
pagination: { page, limit },
|
|
328
355
|
sortings: sorters
|
|
329
356
|
}
|
|
@@ -367,7 +394,8 @@ class NonLoadedInventory extends connect(store)(localize(i18next)(PageView)) {
|
|
|
367
394
|
{ header: i18next.t('field.qty'), key: 'pickedQty', width: 25, type: 'string' },
|
|
368
395
|
{ header: i18next.t('field.total_uom_value'), key: 'pickedUomValue', width: 25, type: 'float' },
|
|
369
396
|
{ header: i18next.t('field.uom'), key: 'uom', width: 25, type: 'string' },
|
|
370
|
-
{ header: i18next.t('field.bin_location'), key: 'binLocation', width: 25, type: 'string' }
|
|
397
|
+
{ header: i18next.t('field.bin_location'), key: 'binLocation', width: 25, type: 'string' },
|
|
398
|
+
{ header: i18next.t('field.created_at'), key: 'createdAt', width: 25, type: 'datetime' }
|
|
371
399
|
]
|
|
372
400
|
|
|
373
401
|
if (this.dataGrist.selected && this.dataGrist.selected.length > 0) {
|
|
@@ -376,6 +404,13 @@ class NonLoadedInventory extends connect(store)(localize(i18next)(PageView)) {
|
|
|
376
404
|
data = (await this.fetchHandler({ page: 1, limit: 9999999 })).records
|
|
377
405
|
}
|
|
378
406
|
|
|
407
|
+
data = data.map(itm => {
|
|
408
|
+
return {
|
|
409
|
+
...itm,
|
|
410
|
+
createdAt: itm.createdAt ? new Date(parseInt(itm.createdAt)).toLocaleString() : ''
|
|
411
|
+
}
|
|
412
|
+
})
|
|
413
|
+
|
|
379
414
|
return { header: headerSetting, data }
|
|
380
415
|
} catch (e) {
|
|
381
416
|
this._showToast(e)
|
|
@@ -5,6 +5,7 @@ const analysis_picking_packing_report_1 = require("./analysis-picking-packing-re
|
|
|
5
5
|
const costing_report_1 = require("./costing-report");
|
|
6
6
|
const inbound_order_details_report_1 = require("./inbound-order-details-report");
|
|
7
7
|
const inbound_serial_number_report_1 = require("./inbound-serial-number-report");
|
|
8
|
+
const non_loaded_inventory_report_1 = require("./non-loaded-inventory-report");
|
|
8
9
|
const outbound_order_details_report_1 = require("./outbound-order-details-report");
|
|
9
10
|
const outbound_serial_number_report_1 = require("./outbound-serial-number-report");
|
|
10
11
|
const product_label_report_1 = require("./product-label-report");
|
|
@@ -12,5 +13,5 @@ const release_inventory_report_1 = require("./release-inventory-report");
|
|
|
12
13
|
const shortage_report_1 = require("./shortage-report");
|
|
13
14
|
const tote_loading_qc_report_1 = require("./tote-loading-qc-report");
|
|
14
15
|
const vas_report_1 = require("./vas-report");
|
|
15
|
-
exports.Query = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, inbound_serial_number_report_1.inboundSerialNumberReport), outbound_serial_number_report_1.outboundSerialNumberReport), costing_report_1.costingReport), inbound_order_details_report_1.inboundOrderDetailsReport), outbound_order_details_report_1.outboundOrderDetailsReport), product_label_report_1.productLabelReport), release_inventory_report_1.releaseInventoryReport), shortage_report_1.shortageReport), tote_loading_qc_report_1.loadingQcReport), vas_report_1.orderVasReport), vas_report_1.vasReport), analysis_picking_packing_report_1.analysisPickingPackingReport);
|
|
16
|
+
exports.Query = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, inbound_serial_number_report_1.inboundSerialNumberReport), outbound_serial_number_report_1.outboundSerialNumberReport), costing_report_1.costingReport), inbound_order_details_report_1.inboundOrderDetailsReport), outbound_order_details_report_1.outboundOrderDetailsReport), product_label_report_1.productLabelReport), release_inventory_report_1.releaseInventoryReport), shortage_report_1.shortageReport), tote_loading_qc_report_1.loadingQcReport), vas_report_1.orderVasReport), vas_report_1.vasReport), analysis_picking_packing_report_1.analysisPickingPackingReport), non_loaded_inventory_report_1.nonLoadedOrderInventoriesReport);
|
|
16
17
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/reports/index.ts"],"names":[],"mappings":";;;AAAA,uFAAgF;AAChF,qDAAgD;AAChD,iFAA0E;AAC1E,iFAA0E;AAC1E,mFAA4E;AAC5E,mFAA4E;AAC5E,iEAA2D;AAC3D,yEAAmE;AACnE,uDAAkD;AAClD,qEAA0D;AAC1D,6CAGqB;AAER,QAAA,KAAK
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/reports/index.ts"],"names":[],"mappings":";;;AAAA,uFAAgF;AAChF,qDAAgD;AAChD,iFAA0E;AAC1E,iFAA0E;AAC1E,+EAA+E;AAC/E,mFAA4E;AAC5E,mFAA4E;AAC5E,iEAA2D;AAC3D,yEAAmE;AACnE,uDAAkD;AAClD,qEAA0D;AAC1D,6CAGqB;AAER,QAAA,KAAK,6LACb,wDAAyB,GACzB,0DAA0B,GAC1B,8BAAa,GACb,wDAAyB,GACzB,0DAA0B,GAC1B,yCAAkB,GAClB,iDAAsB,GACtB,gCAAc,GACd,wCAAe,GACf,2BAAc,GACd,sBAAS,GACT,8DAA4B,GAC5B,6DAA+B,EACnC"}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.nonLoadedOrderInventoriesReport = void 0;
|
|
4
|
+
const typeorm_1 = require("typeorm");
|
|
5
|
+
const product_base_1 = require("@things-factory/product-base");
|
|
6
|
+
const sales_base_1 = require("@things-factory/sales-base");
|
|
7
|
+
const worksheet_base_1 = require("@things-factory/worksheet-base");
|
|
8
|
+
exports.nonLoadedOrderInventoriesReport = {
|
|
9
|
+
async nonLoadedOrderInventories(_, params, context) {
|
|
10
|
+
const { domain } = context.state;
|
|
11
|
+
try {
|
|
12
|
+
const productFilter = params.filters.find(x => x.name == 'productInfo');
|
|
13
|
+
const roNoFilter = params.filters.find(x => x.name == 'roNo');
|
|
14
|
+
const refNoFilter = params.filters.find(x => x.name == 'refNo');
|
|
15
|
+
const binLocationFilter = params.filters.find(x => x.name == 'binLocation');
|
|
16
|
+
const lotIdFilter = params.filters.find(x => x.name == 'palletId');
|
|
17
|
+
const cartonIdFilter = params.filters.find(x => x.name == 'cartonId');
|
|
18
|
+
const createdAtFilter = params.filters.find(x => x.name == 'createdAt');
|
|
19
|
+
const timezoneOffset = params.filters.find(x => x.name === 'timezoneOffset').value + ' minutes';
|
|
20
|
+
params.filters = params.filters.filter(filter => ['productInfo', 'roNo', 'refNo', 'binLocation', 'palletId', 'cartonId', 'createdAt'].indexOf(filter.name) ==
|
|
21
|
+
-1);
|
|
22
|
+
const qb = (0, typeorm_1.getRepository)(sales_base_1.OrderInventory).createQueryBuilder('oi');
|
|
23
|
+
qb.select('oi')
|
|
24
|
+
.addSelect('(oi.release_uom_value / oi.release_qty) * oi.picked_qty', 'picked_uom_value')
|
|
25
|
+
.innerJoinAndSelect('oi.inventory', 'inv')
|
|
26
|
+
.innerJoinAndSelect('oi.releaseGood', 'rg')
|
|
27
|
+
.innerJoinAndSelect('rg.bizplace', 'bz')
|
|
28
|
+
.innerJoinAndSelect('oi.product', 'product')
|
|
29
|
+
.leftJoinAndSelect('oi.binLocation', 'bin_loc')
|
|
30
|
+
.innerJoinAndMapMany('w.worksheetDetails', worksheet_base_1.WorksheetDetail, 'wd', 'wd.targetInventory = oi.id')
|
|
31
|
+
.innerJoinAndMapMany('oi.releaseGood', worksheet_base_1.Worksheet, 'w', 'w.id = wd.worksheet')
|
|
32
|
+
.andWhere('rg.status IN (:...releaseGoodStatus)', {
|
|
33
|
+
releaseGoodStatus: [sales_base_1.ORDER_STATUS.PICKING, sales_base_1.ORDER_STATUS.LOADING]
|
|
34
|
+
})
|
|
35
|
+
.andWhere('oi.status IN (:...orderInventoryStatus)', {
|
|
36
|
+
orderInventoryStatus: [
|
|
37
|
+
sales_base_1.ORDER_INVENTORY_STATUS.PICKED,
|
|
38
|
+
sales_base_1.ORDER_INVENTORY_STATUS.LOADING,
|
|
39
|
+
sales_base_1.ORDER_INVENTORY_STATUS.LOADED
|
|
40
|
+
]
|
|
41
|
+
})
|
|
42
|
+
.andWhere('wd.type = :worksheetDetailType AND wd.status = :worksheetDetailStatus', {
|
|
43
|
+
worksheetDetailType: worksheet_base_1.WORKSHEET_TYPE.LOADING,
|
|
44
|
+
worksheetDetailStatus: worksheet_base_1.WORKSHEET_STATUS.EXECUTING
|
|
45
|
+
})
|
|
46
|
+
.andWhere('oi.domain = :domain', { domain: domain.id });
|
|
47
|
+
if (productFilter) {
|
|
48
|
+
let productFilterValue = `%${productFilter.value.toLowerCase()}%`;
|
|
49
|
+
qb.andWhere(qb => {
|
|
50
|
+
const subQuery = qb
|
|
51
|
+
.subQuery()
|
|
52
|
+
.select()
|
|
53
|
+
.from(product_base_1.Product, `products`)
|
|
54
|
+
.where(`products.id = oi.product_id`)
|
|
55
|
+
.andWhere(new typeorm_1.Brackets(qb => {
|
|
56
|
+
qb.where('Lower(products.sku) LIKE :productInfo', { productInfo: productFilterValue })
|
|
57
|
+
.orWhere('Lower(products.name) LIKE :productInfo', { productInfo: productFilterValue })
|
|
58
|
+
.orWhere('Lower(products.description) LIKE :productInfo', { productInfo: productFilterValue })
|
|
59
|
+
.orWhere('Lower(products.brand) LIKE :productInfo', { productInfo: productFilterValue });
|
|
60
|
+
}))
|
|
61
|
+
.getQuery();
|
|
62
|
+
return `EXISTS ${subQuery}`;
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
if (roNoFilter) {
|
|
66
|
+
qb.andWhere('Lower(rg.name) LIKE :roNo', { roNo: roNoFilter.value.toLowerCase() });
|
|
67
|
+
}
|
|
68
|
+
if (refNoFilter) {
|
|
69
|
+
qb.andWhere('Lower(rg.ref_no) LIKE :refNo', { refNo: refNoFilter.value.toLowerCase() });
|
|
70
|
+
}
|
|
71
|
+
if (binLocationFilter) {
|
|
72
|
+
qb.andWhere('Lower(bin_loc.name) LIKE :binLocation', { binLocation: binLocationFilter.value.toLowerCase() });
|
|
73
|
+
}
|
|
74
|
+
if (lotIdFilter) {
|
|
75
|
+
qb.andWhere('Lower(inv.pallet_id) LIKE :palletId', { palletId: lotIdFilter.value.toLowerCase() });
|
|
76
|
+
}
|
|
77
|
+
if (cartonIdFilter) {
|
|
78
|
+
qb.andWhere('Lower(inv.carton_id) LIKE :cartonId', { cartonId: cartonIdFilter.value.toLowerCase() });
|
|
79
|
+
}
|
|
80
|
+
if (createdAtFilter) {
|
|
81
|
+
qb.andWhere('DATE(wd.created_at) = :createdAt', { createdAt: createdAtFilter.value });
|
|
82
|
+
}
|
|
83
|
+
qb.groupBy('oi.id')
|
|
84
|
+
.addGroupBy('inv.id')
|
|
85
|
+
.addGroupBy('rg.id')
|
|
86
|
+
.addGroupBy('bz.id')
|
|
87
|
+
.addGroupBy('product.id')
|
|
88
|
+
.addGroupBy('bin_loc.id')
|
|
89
|
+
.addGroupBy('w.id')
|
|
90
|
+
.addGroupBy('wd.id');
|
|
91
|
+
qb.orderBy('rg.name');
|
|
92
|
+
const items = await qb
|
|
93
|
+
.offset((params.pagination.page - 1) * params.pagination.limit)
|
|
94
|
+
.limit(params.pagination.limit)
|
|
95
|
+
.getRawMany();
|
|
96
|
+
const total = await qb.getCount();
|
|
97
|
+
return {
|
|
98
|
+
total,
|
|
99
|
+
items: items.reduce((acc, item) => {
|
|
100
|
+
acc.push(Object.assign(new sales_base_1.OrderInventory(), {
|
|
101
|
+
id: item.oi_id,
|
|
102
|
+
batchId: item.oi_batch_id,
|
|
103
|
+
packingType: item.oi_packing_type,
|
|
104
|
+
packingSize: item.oi_packing_size,
|
|
105
|
+
uom: item.oi_uom,
|
|
106
|
+
pickedQty: item.oi_picked_qty,
|
|
107
|
+
pickedUomValue: item.picked_uom_value,
|
|
108
|
+
product: new product_base_1.Product(item),
|
|
109
|
+
binLocation: {
|
|
110
|
+
id: item.bin_loc_id,
|
|
111
|
+
name: item.bin_loc_name,
|
|
112
|
+
description: item.bin_loc_description
|
|
113
|
+
},
|
|
114
|
+
releaseGood: {
|
|
115
|
+
id: item.rg_id,
|
|
116
|
+
name: item.rg_name,
|
|
117
|
+
refNo: item.rg_ref_no,
|
|
118
|
+
description: item.rg_description,
|
|
119
|
+
bizplace: {
|
|
120
|
+
id: item.bz_id,
|
|
121
|
+
name: item.bz_name
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
inventory: {
|
|
125
|
+
id: item.inv_id,
|
|
126
|
+
palletId: item.inv_pallet_id,
|
|
127
|
+
cartonId: item.inv_carton_id
|
|
128
|
+
},
|
|
129
|
+
createdAt: item.wd_created_at,
|
|
130
|
+
updatedAt: item.oi_updated_at
|
|
131
|
+
}));
|
|
132
|
+
return acc;
|
|
133
|
+
}, [])
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
catch (error) {
|
|
137
|
+
throw error;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
//# sourceMappingURL=non-loaded-inventory-report.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"non-loaded-inventory-report.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/reports/non-loaded-inventory-report.ts"],"names":[],"mappings":";;;AAAA,qCAIgB;AAEhB,+DAAsD;AACtD,2DAImC;AAKnC,mEAKuC;AAE1B,QAAA,+BAA+B,GAAG;IAC7C,KAAK,CAAC,yBAAyB,CAAC,CAAM,EAAE,MAAiB,EAAE,OAAY;QACrE,MAAM,EAAE,MAAM,EAAE,GAAuB,OAAO,CAAC,KAAK,CAAA;QAEpD,IAAI;YACF,MAAM,aAAa,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IA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SAAS,EAAE,IAAI,CAAC,aAAa;wBAC7B,cAAc,EAAE,IAAI,CAAC,gBAAgB;wBACrC,OAAO,EAAE,IAAI,sBAAO,CAAC,IAAI,CAAC;wBAC1B,WAAW,EAAE;4BACX,EAAE,EAAE,IAAI,CAAC,UAAU;4BACnB,IAAI,EAAE,IAAI,CAAC,YAAY;4BACvB,WAAW,EAAE,IAAI,CAAC,mBAAmB;yBACtC;wBACD,WAAW,EAAE;4BACX,EAAE,EAAE,IAAI,CAAC,KAAK;4BACd,IAAI,EAAE,IAAI,CAAC,OAAO;4BAClB,KAAK,EAAE,IAAI,CAAC,SAAS;4BACrB,WAAW,EAAE,IAAI,CAAC,cAAc;4BAChC,QAAQ,EAAE;gCACR,EAAE,EAAE,IAAI,CAAC,KAAK;gCACd,IAAI,EAAE,IAAI,CAAC,OAAO;6BACnB;yBACF;wBACD,SAAS,EAAE;4BACT,EAAE,EAAE,IAAI,CAAC,MAAM;4BACf,QAAQ,EAAE,IAAI,CAAC,aAAa;4BAC5B,QAAQ,EAAE,IAAI,CAAC,aAAa;yBAC7B;wBACD,SAAS,EAAE,IAAI,CAAC,aAAa;wBAC7B,SAAS,EAAE,IAAI,CAAC,aAAa;qBAC9B,CAAC,CACH,CAAA;oBACD,OAAO,GAAG,CAAA;gBACZ,CAAC,EAAE,EAAE,CAAC;aACP,CAAA;SACF;QAAC,OAAO,KAAK,EAAE;YACd,MAAM,KAAK,CAAA;SACZ;IACH,CAAC;CACF,CAAA"}
|
|
@@ -11,6 +11,8 @@ const inbound_serial_number_report_1 = require("./inbound-serial-number-report")
|
|
|
11
11
|
const inbound_serial_number_report_list_1 = require("./inbound-serial-number-report-list");
|
|
12
12
|
const loading_qc_report_1 = require("./loading-qc-report");
|
|
13
13
|
const loading_qc_report_list_1 = require("./loading-qc-report-list");
|
|
14
|
+
const non_loaded_inventory_report_1 = require("./non-loaded-inventory-report");
|
|
15
|
+
const non_loaded_inventory_report_list_1 = require("./non-loaded-inventory-report-list");
|
|
14
16
|
const outbound_order_details_report_1 = require("./outbound-order-details-report");
|
|
15
17
|
const outbound_order_details_report_list_1 = require("./outbound-order-details-report-list");
|
|
16
18
|
const outbound_serial_number_report_1 = require("./outbound-serial-number-report");
|
|
@@ -36,6 +38,7 @@ exports.Query = `
|
|
|
36
38
|
orderVasReport(filters: [Filter!], pagination: Pagination, sortings: [Sorting!]): OrderVasReportList @transaction
|
|
37
39
|
vasReport(filters: [Filter!], pagination: Pagination, sortings: [Sorting!]): OrderVasReportList @transaction
|
|
38
40
|
analysisPickingPackingReport(filters: [Filter!], pagination: Pagination, sortings: [Sorting!]): AnalysisPickingPackingReportList @transaction
|
|
41
|
+
nonLoadedOrderInventories(filters: [Filter!], pagination: Pagination, sortings: [Sorting!]): NonLoadedOrderInventoryReportList @transaction
|
|
39
42
|
`;
|
|
40
43
|
exports.Types = [
|
|
41
44
|
inbound_serial_number_report_1.InboundSerialNumberReport,
|
|
@@ -61,6 +64,8 @@ exports.Types = [
|
|
|
61
64
|
vas_report_1.VasReport,
|
|
62
65
|
vas_report_list_1.VasReportList,
|
|
63
66
|
analysis_picking_packing_report_1.AnalysisPickingPackingReport,
|
|
64
|
-
analysis_picking_packing_report_list_1.AnalysisPickingPackingReportList
|
|
67
|
+
analysis_picking_packing_report_list_1.AnalysisPickingPackingReportList,
|
|
68
|
+
non_loaded_inventory_report_1.NonLoadedOrderInventoryReport,
|
|
69
|
+
non_loaded_inventory_report_list_1.NonLoadedOrderInventoryReportList
|
|
65
70
|
];
|
|
66
71
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../server/graphql/types/reports/index.ts"],"names":[],"mappings":";;;AAAA,uFAAgF;AAChF,iGAAyF;AACzF,qDAAgD;AAChD,+DAAyD;AACzD,iFAA0E;AAC1E,2FAAmF;AACnF,iFAA0E;AAC1E,2FAAmF;AACnF,2DAAqD;AACrD,qEAA8D;AAC9D,mFAA4E;AAC5E,6FAAqF;AACrF,mFAA4E;AAC5E,6FAAqF;AACrF,iEAA2D;AAC3D,2EAAoE;AACpE,yEAAmE;AACnE,mFAA4E;AAC5E,iEAA2D;AAC3D,iEAAuD;AACvD,6CAGqB;AACrB,uDAG0B;AAEb,QAAA,KAAK,GAAG
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../server/graphql/types/reports/index.ts"],"names":[],"mappings":";;;AAAA,uFAAgF;AAChF,iGAAyF;AACzF,qDAAgD;AAChD,+DAAyD;AACzD,iFAA0E;AAC1E,2FAAmF;AACnF,iFAA0E;AAC1E,2FAAmF;AACnF,2DAAqD;AACrD,qEAA8D;AAC9D,+EAA6E;AAC7E,yFAAsF;AACtF,mFAA4E;AAC5E,6FAAqF;AACrF,mFAA4E;AAC5E,6FAAqF;AACrF,iEAA2D;AAC3D,2EAAoE;AACpE,yEAAmE;AACnE,mFAA4E;AAC5E,iEAA2D;AAC3D,iEAAuD;AACvD,6CAGqB;AACrB,uDAG0B;AAEb,QAAA,KAAK,GAAG;;;;;;;;;;;;;;CAcpB,CAAA;AAEY,QAAA,KAAK,GAAG;IACnB,wDAAyB;IACzB,iEAA6B;IAC7B,0DAA0B;IAC1B,mEAA8B;IAC9B,wDAAyB;IACzB,iEAA6B;IAC7B,0DAA0B;IAC1B,mEAA8B;IAC9B,yCAAkB;IAClB,kDAAsB;IACtB,8BAAa;IACb,uCAAiB;IACjB,iDAAsB;IACtB,0DAA0B;IAC1B,qCAAc;IACd,yCAAkB;IAClB,mCAAe;IACf,4CAAmB;IACnB,2BAAc;IACd,oCAAkB;IAClB,sBAAS;IACT,+BAAa;IACb,8DAA4B;IAC5B,uEAAgC;IAChC,2DAA6B;IAC7B,oEAAiC;CAClC,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
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.NonLoadedOrderInventoryReportList = void 0;
|
|
7
|
+
const graphql_tag_1 = __importDefault(require("graphql-tag"));
|
|
8
|
+
exports.NonLoadedOrderInventoryReportList = (0, graphql_tag_1.default) `
|
|
9
|
+
type NonLoadedOrderInventoryReportList {
|
|
10
|
+
items: [NonLoadedOrderInventoryReport]
|
|
11
|
+
total: Int
|
|
12
|
+
}
|
|
13
|
+
`;
|
|
14
|
+
//# sourceMappingURL=non-loaded-inventory-report-list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"non-loaded-inventory-report-list.js","sourceRoot":"","sources":["../../../../server/graphql/types/reports/non-loaded-inventory-report-list.ts"],"names":[],"mappings":";;;;;;AAAA,8DAA6B;AAEhB,QAAA,iCAAiC,GAAG,IAAA,qBAAG,EAAA;;;;;CAKnD,CAAA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
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.NonLoadedOrderInventoryReport = void 0;
|
|
7
|
+
const graphql_tag_1 = __importDefault(require("graphql-tag"));
|
|
8
|
+
exports.NonLoadedOrderInventoryReport = (0, graphql_tag_1.default) `
|
|
9
|
+
type NonLoadedOrderInventoryReport {
|
|
10
|
+
releaseGood: ReleaseGood
|
|
11
|
+
inventory: Inventory
|
|
12
|
+
packingType: String
|
|
13
|
+
batchId: String
|
|
14
|
+
pickedQty: Int
|
|
15
|
+
pickedUomValue: Float
|
|
16
|
+
uom: String
|
|
17
|
+
product: Product
|
|
18
|
+
binLocation: Location
|
|
19
|
+
createdAt: String
|
|
20
|
+
updatedAt: String
|
|
21
|
+
}
|
|
22
|
+
`;
|
|
23
|
+
//# sourceMappingURL=non-loaded-inventory-report.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"non-loaded-inventory-report.js","sourceRoot":"","sources":["../../../../server/graphql/types/reports/non-loaded-inventory-report.ts"],"names":[],"mappings":";;;;;;AAAA,8DAA6B;AAEhB,QAAA,6BAA6B,GAAG,IAAA,qBAAG,EAAA;;;;;;;;;;;;;;CAc/C,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.331",
|
|
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.318",
|
|
93
93
|
"@things-factory/resource-ui": "^4.3.281",
|
|
94
|
-
"@things-factory/sales-ui": "^4.3.
|
|
94
|
+
"@things-factory/sales-ui": "^4.3.331",
|
|
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",
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
"@things-factory/transport-base": "^4.3.301",
|
|
109
109
|
"@things-factory/tutorial-ui": "^4.3.281",
|
|
110
110
|
"@things-factory/warehouse-base": "^4.3.329",
|
|
111
|
-
"@things-factory/worksheet-base": "^4.3.
|
|
111
|
+
"@things-factory/worksheet-base": "^4.3.331"
|
|
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": "6d43fef3e22afc1e43ecbce142d5763dda6e91fd"
|
|
121
121
|
}
|
|
@@ -2,6 +2,7 @@ import { analysisPickingPackingReport } from './analysis-picking-packing-report'
|
|
|
2
2
|
import { costingReport } from './costing-report'
|
|
3
3
|
import { inboundOrderDetailsReport } from './inbound-order-details-report'
|
|
4
4
|
import { inboundSerialNumberReport } from './inbound-serial-number-report'
|
|
5
|
+
import { nonLoadedOrderInventoriesReport } from './non-loaded-inventory-report'
|
|
5
6
|
import { outboundOrderDetailsReport } from './outbound-order-details-report'
|
|
6
7
|
import { outboundSerialNumberReport } from './outbound-serial-number-report'
|
|
7
8
|
import { productLabelReport } from './product-label-report'
|
|
@@ -25,5 +26,6 @@ export const Query = {
|
|
|
25
26
|
...loadingQcReport,
|
|
26
27
|
...orderVasReport,
|
|
27
28
|
...vasReport,
|
|
28
|
-
...analysisPickingPackingReport
|
|
29
|
+
...analysisPickingPackingReport,
|
|
30
|
+
...nonLoadedOrderInventoriesReport
|
|
29
31
|
}
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Brackets,
|
|
3
|
+
getRepository,
|
|
4
|
+
SelectQueryBuilder
|
|
5
|
+
} from 'typeorm'
|
|
6
|
+
|
|
7
|
+
import { Product } from '@things-factory/product-base'
|
|
8
|
+
import {
|
|
9
|
+
ORDER_INVENTORY_STATUS,
|
|
10
|
+
ORDER_STATUS,
|
|
11
|
+
OrderInventory
|
|
12
|
+
} from '@things-factory/sales-base'
|
|
13
|
+
import {
|
|
14
|
+
Domain,
|
|
15
|
+
ListParam
|
|
16
|
+
} from '@things-factory/shell'
|
|
17
|
+
import {
|
|
18
|
+
Worksheet,
|
|
19
|
+
WORKSHEET_STATUS,
|
|
20
|
+
WORKSHEET_TYPE,
|
|
21
|
+
WorksheetDetail
|
|
22
|
+
} from '@things-factory/worksheet-base'
|
|
23
|
+
|
|
24
|
+
export const nonLoadedOrderInventoriesReport = {
|
|
25
|
+
async nonLoadedOrderInventories(_: any, params: ListParam, context: any) {
|
|
26
|
+
const { domain }: { domain: Domain } = context.state
|
|
27
|
+
|
|
28
|
+
try {
|
|
29
|
+
const productFilter = params.filters.find(x => x.name == 'productInfo')
|
|
30
|
+
const roNoFilter = params.filters.find(x => x.name == 'roNo')
|
|
31
|
+
const refNoFilter = params.filters.find(x => x.name == 'refNo')
|
|
32
|
+
const binLocationFilter = params.filters.find(x => x.name == 'binLocation')
|
|
33
|
+
const lotIdFilter = params.filters.find(x => x.name == 'palletId')
|
|
34
|
+
const cartonIdFilter = params.filters.find(x => x.name == 'cartonId')
|
|
35
|
+
const createdAtFilter = params.filters.find(x => x.name == 'createdAt')
|
|
36
|
+
const timezoneOffset = params.filters.find(x => x.name === 'timezoneOffset').value + ' minutes'
|
|
37
|
+
|
|
38
|
+
params.filters = params.filters.filter(
|
|
39
|
+
filter =>
|
|
40
|
+
['productInfo', 'roNo', 'refNo', 'binLocation', 'palletId', 'cartonId', 'createdAt'].indexOf(filter.name) ==
|
|
41
|
+
-1
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
const qb: SelectQueryBuilder<OrderInventory> = getRepository(OrderInventory).createQueryBuilder('oi')
|
|
45
|
+
|
|
46
|
+
qb.select('oi')
|
|
47
|
+
.addSelect('(oi.release_uom_value / oi.release_qty) * oi.picked_qty', 'picked_uom_value')
|
|
48
|
+
.innerJoinAndSelect('oi.inventory', 'inv')
|
|
49
|
+
.innerJoinAndSelect('oi.releaseGood', 'rg')
|
|
50
|
+
.innerJoinAndSelect('rg.bizplace', 'bz')
|
|
51
|
+
.innerJoinAndSelect('oi.product', 'product')
|
|
52
|
+
.leftJoinAndSelect('oi.binLocation', 'bin_loc')
|
|
53
|
+
.innerJoinAndMapMany('w.worksheetDetails', WorksheetDetail, 'wd', 'wd.targetInventory = oi.id')
|
|
54
|
+
.innerJoinAndMapMany('oi.releaseGood', Worksheet, 'w', 'w.id = wd.worksheet')
|
|
55
|
+
.andWhere('rg.status IN (:...releaseGoodStatus)', {
|
|
56
|
+
releaseGoodStatus: [ORDER_STATUS.PICKING, ORDER_STATUS.LOADING]
|
|
57
|
+
})
|
|
58
|
+
.andWhere('oi.status IN (:...orderInventoryStatus)', {
|
|
59
|
+
orderInventoryStatus: [
|
|
60
|
+
ORDER_INVENTORY_STATUS.PICKED,
|
|
61
|
+
ORDER_INVENTORY_STATUS.LOADING,
|
|
62
|
+
ORDER_INVENTORY_STATUS.LOADED
|
|
63
|
+
]
|
|
64
|
+
})
|
|
65
|
+
.andWhere('wd.type = :worksheetDetailType AND wd.status = :worksheetDetailStatus', {
|
|
66
|
+
worksheetDetailType: WORKSHEET_TYPE.LOADING,
|
|
67
|
+
worksheetDetailStatus: WORKSHEET_STATUS.EXECUTING
|
|
68
|
+
})
|
|
69
|
+
.andWhere('oi.domain = :domain', { domain: domain.id })
|
|
70
|
+
|
|
71
|
+
if (productFilter) {
|
|
72
|
+
let productFilterValue = `%${productFilter.value.toLowerCase()}%`
|
|
73
|
+
qb.andWhere(qb => {
|
|
74
|
+
const subQuery = qb
|
|
75
|
+
.subQuery()
|
|
76
|
+
.select()
|
|
77
|
+
.from(Product, `products`)
|
|
78
|
+
.where(`products.id = oi.product_id`)
|
|
79
|
+
.andWhere(
|
|
80
|
+
new Brackets(qb => {
|
|
81
|
+
qb.where('Lower(products.sku) LIKE :productInfo', { productInfo: productFilterValue })
|
|
82
|
+
.orWhere('Lower(products.name) LIKE :productInfo', { productInfo: productFilterValue })
|
|
83
|
+
.orWhere('Lower(products.description) LIKE :productInfo', { productInfo: productFilterValue })
|
|
84
|
+
.orWhere('Lower(products.brand) LIKE :productInfo', { productInfo: productFilterValue })
|
|
85
|
+
})
|
|
86
|
+
)
|
|
87
|
+
.getQuery()
|
|
88
|
+
return `EXISTS ${subQuery}`
|
|
89
|
+
})
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
if (roNoFilter) {
|
|
93
|
+
qb.andWhere('Lower(rg.name) LIKE :roNo', { roNo: roNoFilter.value.toLowerCase() })
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
if (refNoFilter) {
|
|
97
|
+
qb.andWhere('Lower(rg.ref_no) LIKE :refNo', { refNo: refNoFilter.value.toLowerCase() })
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
if (binLocationFilter) {
|
|
101
|
+
qb.andWhere('Lower(bin_loc.name) LIKE :binLocation', { binLocation: binLocationFilter.value.toLowerCase() })
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
if (lotIdFilter) {
|
|
105
|
+
qb.andWhere('Lower(inv.pallet_id) LIKE :palletId', { palletId: lotIdFilter.value.toLowerCase() })
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
if (cartonIdFilter) {
|
|
109
|
+
qb.andWhere('Lower(inv.carton_id) LIKE :cartonId', { cartonId: cartonIdFilter.value.toLowerCase() })
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
if (createdAtFilter) {
|
|
113
|
+
qb.andWhere('DATE(wd.created_at) = :createdAt', { createdAt: createdAtFilter.value })
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
qb.groupBy('oi.id')
|
|
117
|
+
.addGroupBy('inv.id')
|
|
118
|
+
.addGroupBy('rg.id')
|
|
119
|
+
.addGroupBy('bz.id')
|
|
120
|
+
.addGroupBy('product.id')
|
|
121
|
+
.addGroupBy('bin_loc.id')
|
|
122
|
+
.addGroupBy('w.id')
|
|
123
|
+
.addGroupBy('wd.id')
|
|
124
|
+
|
|
125
|
+
qb.orderBy('rg.name')
|
|
126
|
+
|
|
127
|
+
const items = await qb
|
|
128
|
+
.offset((params.pagination.page - 1) * params.pagination.limit)
|
|
129
|
+
.limit(params.pagination.limit)
|
|
130
|
+
.getRawMany()
|
|
131
|
+
|
|
132
|
+
const total = await qb.getCount()
|
|
133
|
+
|
|
134
|
+
return {
|
|
135
|
+
total,
|
|
136
|
+
items: items.reduce((acc, item) => {
|
|
137
|
+
acc.push(
|
|
138
|
+
Object.assign(new OrderInventory(), {
|
|
139
|
+
id: item.oi_id,
|
|
140
|
+
batchId: item.oi_batch_id,
|
|
141
|
+
packingType: item.oi_packing_type,
|
|
142
|
+
packingSize: item.oi_packing_size,
|
|
143
|
+
uom: item.oi_uom,
|
|
144
|
+
pickedQty: item.oi_picked_qty,
|
|
145
|
+
pickedUomValue: item.picked_uom_value,
|
|
146
|
+
product: new Product(item),
|
|
147
|
+
binLocation: {
|
|
148
|
+
id: item.bin_loc_id,
|
|
149
|
+
name: item.bin_loc_name,
|
|
150
|
+
description: item.bin_loc_description
|
|
151
|
+
},
|
|
152
|
+
releaseGood: {
|
|
153
|
+
id: item.rg_id,
|
|
154
|
+
name: item.rg_name,
|
|
155
|
+
refNo: item.rg_ref_no,
|
|
156
|
+
description: item.rg_description,
|
|
157
|
+
bizplace: {
|
|
158
|
+
id: item.bz_id,
|
|
159
|
+
name: item.bz_name
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
inventory: {
|
|
163
|
+
id: item.inv_id,
|
|
164
|
+
palletId: item.inv_pallet_id,
|
|
165
|
+
cartonId: item.inv_carton_id
|
|
166
|
+
},
|
|
167
|
+
createdAt: item.wd_created_at,
|
|
168
|
+
updatedAt: item.oi_updated_at
|
|
169
|
+
})
|
|
170
|
+
)
|
|
171
|
+
return acc
|
|
172
|
+
}, [])
|
|
173
|
+
}
|
|
174
|
+
} catch (error) {
|
|
175
|
+
throw error
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
@@ -8,6 +8,8 @@ import { InboundSerialNumberReport } from './inbound-serial-number-report'
|
|
|
8
8
|
import { InboundSerialNumberReportList } from './inbound-serial-number-report-list'
|
|
9
9
|
import { LoadingQcReport } from './loading-qc-report'
|
|
10
10
|
import { LoadingQcReportList } from './loading-qc-report-list'
|
|
11
|
+
import { NonLoadedOrderInventoryReport } from './non-loaded-inventory-report'
|
|
12
|
+
import { NonLoadedOrderInventoryReportList } from './non-loaded-inventory-report-list'
|
|
11
13
|
import { OutboundOrderDetailsReport } from './outbound-order-details-report'
|
|
12
14
|
import { OutboundOrderDetailsReportList } from './outbound-order-details-report-list'
|
|
13
15
|
import { OutboundSerialNumberReport } from './outbound-serial-number-report'
|
|
@@ -40,6 +42,7 @@ export const Query = `
|
|
|
40
42
|
orderVasReport(filters: [Filter!], pagination: Pagination, sortings: [Sorting!]): OrderVasReportList @transaction
|
|
41
43
|
vasReport(filters: [Filter!], pagination: Pagination, sortings: [Sorting!]): OrderVasReportList @transaction
|
|
42
44
|
analysisPickingPackingReport(filters: [Filter!], pagination: Pagination, sortings: [Sorting!]): AnalysisPickingPackingReportList @transaction
|
|
45
|
+
nonLoadedOrderInventories(filters: [Filter!], pagination: Pagination, sortings: [Sorting!]): NonLoadedOrderInventoryReportList @transaction
|
|
43
46
|
`
|
|
44
47
|
|
|
45
48
|
export const Types = [
|
|
@@ -66,5 +69,7 @@ export const Types = [
|
|
|
66
69
|
VasReport,
|
|
67
70
|
VasReportList,
|
|
68
71
|
AnalysisPickingPackingReport,
|
|
69
|
-
AnalysisPickingPackingReportList
|
|
72
|
+
AnalysisPickingPackingReportList,
|
|
73
|
+
NonLoadedOrderInventoryReport,
|
|
74
|
+
NonLoadedOrderInventoryReportList
|
|
70
75
|
]
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import gql from 'graphql-tag'
|
|
2
|
+
|
|
3
|
+
export const NonLoadedOrderInventoryReport = gql`
|
|
4
|
+
type NonLoadedOrderInventoryReport {
|
|
5
|
+
releaseGood: ReleaseGood
|
|
6
|
+
inventory: Inventory
|
|
7
|
+
packingType: String
|
|
8
|
+
batchId: String
|
|
9
|
+
pickedQty: Int
|
|
10
|
+
pickedUomValue: Float
|
|
11
|
+
uom: String
|
|
12
|
+
product: Product
|
|
13
|
+
binLocation: Location
|
|
14
|
+
createdAt: String
|
|
15
|
+
updatedAt: String
|
|
16
|
+
}
|
|
17
|
+
`
|