@things-factory/operato-hub 4.3.384 → 4.3.386
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/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 +11 -1
- 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/openapi/v1/Inventory.yaml +205 -0
- package/openapi/v1/inventory.yaml +205 -0
- package/package.json +2 -2
- package/server/graphql/resolvers/reports/index.ts +3 -1
- package/server/graphql/resolvers/reports/shortage-report.ts +132 -0
- package/server/graphql/types/reports/index.ts +11 -1
- package/server/graphql/types/reports/shortage-report-list.ts +8 -0
- package/server/graphql/types/reports/shortage-report-type.ts +19 -0
|
@@ -3,5 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Query = void 0;
|
|
4
4
|
const inbound_order_details_report_1 = require("./inbound-order-details-report");
|
|
5
5
|
const outbound_order_details_report_1 = require("./outbound-order-details-report");
|
|
6
|
-
|
|
6
|
+
const shortage_report_1 = require("./shortage-report");
|
|
7
|
+
exports.Query = Object.assign(Object.assign(Object.assign({}, inbound_order_details_report_1.inboundOrderDetailsReport), outbound_order_details_report_1.outboundOrderDetailsReport), shortage_report_1.shortageReport);
|
|
7
8
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/reports/index.ts"],"names":[],"mappings":";;;AAAA,iFAA0E;AAC1E,mFAA4E;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/reports/index.ts"],"names":[],"mappings":";;;AAAA,iFAA0E;AAC1E,mFAA4E;AAC5E,uDAAkD;AAErC,QAAA,KAAK,iDACb,wDAAyB,GACzB,0DAA0B,GAC1B,gCAAc,EAClB"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.shortageReport = void 0;
|
|
4
|
+
exports.shortageReport = {
|
|
5
|
+
async shortageReport(_, params, context) {
|
|
6
|
+
try {
|
|
7
|
+
const { tx } = context.state;
|
|
8
|
+
let bizplaceFilter = { name: '', operator: '', value: '' };
|
|
9
|
+
let order = params.filters.find(items => items.name === 'order');
|
|
10
|
+
let fromDate = params.filters.find(items => items.name === 'fromDate');
|
|
11
|
+
let toDate = params.filters.find(items => items.name === 'toDate');
|
|
12
|
+
let orderNo = params.filters.find(items => items.name === 'orderNo');
|
|
13
|
+
let product = params.filters.find(items => items.name === 'product');
|
|
14
|
+
let bizplace = params.filters.find(items => items.name === 'bizplace');
|
|
15
|
+
if (!bizplace)
|
|
16
|
+
throw 'Invalid input';
|
|
17
|
+
let roFilter = '', queryFilter = '';
|
|
18
|
+
if (product) {
|
|
19
|
+
let productInfoValue = product.value
|
|
20
|
+
.toLowerCase()
|
|
21
|
+
.split(',')
|
|
22
|
+
.map(prod => {
|
|
23
|
+
return "'%" + prod.trim().replace(/'/g, "''") + "%'";
|
|
24
|
+
})
|
|
25
|
+
.join(',');
|
|
26
|
+
roFilter += `AND (
|
|
27
|
+
Lower(drg.name) LIKE ANY(ARRAY[${productInfoValue}])
|
|
28
|
+
OR Lower(p.sku) LIKE ANY(ARRAY[${productInfoValue}])
|
|
29
|
+
OR Lower(p.sku) LIKE ANY(ARRAY[${productInfoValue}])
|
|
30
|
+
OR Lower(p.sku) LIKE ANY(ARRAY[${productInfoValue}])
|
|
31
|
+
OR Lower(p."name") LIKE ANY(ARRAY[${productInfoValue}])
|
|
32
|
+
OR Lower(p."name") LIKE ANY(ARRAY[${productInfoValue}])
|
|
33
|
+
OR Lower(p."name") LIKE ANY(ARRAY[${productInfoValue}])
|
|
34
|
+
|
|
35
|
+
)`;
|
|
36
|
+
}
|
|
37
|
+
if (orderNo) {
|
|
38
|
+
let orderValue = orderNo.value
|
|
39
|
+
.toLowerCase()
|
|
40
|
+
.split(',')
|
|
41
|
+
.map(prod => {
|
|
42
|
+
return "'%" + prod.trim().replace(/'/g, "''") + "%'";
|
|
43
|
+
})
|
|
44
|
+
.join(',');
|
|
45
|
+
roFilter += `AND (
|
|
46
|
+
Lower(drg.name) LIKE ANY(ARRAY[${orderValue}])
|
|
47
|
+
OR Lower(drg.ref_no) LIKE ANY(ARRAY[${orderValue}])
|
|
48
|
+
OR Lower(drg.ref_no_2) LIKE ANY(ARRAY[${orderValue}])
|
|
49
|
+
OR Lower(drg.ref_no_3) LIKE ANY(ARRAY[${orderValue}])
|
|
50
|
+
)`;
|
|
51
|
+
}
|
|
52
|
+
if (bizplace) {
|
|
53
|
+
queryFilter += ` AND drg.bizplace_id = '${bizplace.value}'`;
|
|
54
|
+
}
|
|
55
|
+
if (!bizplaceFilter || !fromDate || !toDate)
|
|
56
|
+
throw 'Invalid input';
|
|
57
|
+
await tx.query(`
|
|
58
|
+
create temp table shortage_report on commit drop as (
|
|
59
|
+
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",
|
|
60
|
+
coalesce(src.av_qty,0) as available_qty, coalesce(src.av_qty - op.release_qty,0)as "Nett_Stock",
|
|
61
|
+
concat(drg.delivery_address_1, ' ', drg.delivery_address_2, ' ', drg.delivery_address_3, ' ', drg.delivery_address_4, ' ', drg.delivery_address_5) as "delivery_address",
|
|
62
|
+
drg.state,drg.city, drg.country, drg.created_at
|
|
63
|
+
from draft_release_goods drg
|
|
64
|
+
inner join bizplaces b on b.id = drg.bizplace_id
|
|
65
|
+
inner join order_products op on op.draft_release_good_id = drg.id
|
|
66
|
+
inner join products p on p.id = op.product_id
|
|
67
|
+
left join (
|
|
68
|
+
select product_id, sum(qty - locked_qty)as "av_qty" from inventories i where i.domain_id = $1
|
|
69
|
+
group by product_id ) src
|
|
70
|
+
on op.product_id = src.product_id
|
|
71
|
+
where drg.status = 'DRAFT'
|
|
72
|
+
and drg.domain_id = $1
|
|
73
|
+
and coalesce(src.av_qty - op.release_qty,0) <= 0
|
|
74
|
+
and drg.created_at >= $2
|
|
75
|
+
and drg.created_at <= $3
|
|
76
|
+
${roFilter}
|
|
77
|
+
${queryFilter}
|
|
78
|
+
order by drg.created_at desc
|
|
79
|
+
);
|
|
80
|
+
`, [context.state.domain.id, fromDate.value, toDate.value]);
|
|
81
|
+
const total = await tx.query(`
|
|
82
|
+
select count(*) from shortage_report
|
|
83
|
+
`);
|
|
84
|
+
const result = await tx.query(`
|
|
85
|
+
select * from shortage_report
|
|
86
|
+
offset $1 limit $2
|
|
87
|
+
`, [(params.pagination.page - 1) * params.pagination.limit, params.pagination.limit]);
|
|
88
|
+
let items = result.map(itm => {
|
|
89
|
+
return {
|
|
90
|
+
bizplaceName: itm.company,
|
|
91
|
+
orderNo: itm.order_no,
|
|
92
|
+
refNo: itm.ref_no,
|
|
93
|
+
productSku: itm.product_sku,
|
|
94
|
+
productName: itm.product_name,
|
|
95
|
+
orderQty: itm.order_quantity,
|
|
96
|
+
avQty: itm.available_qty,
|
|
97
|
+
nettStock: itm.Nett_Stock,
|
|
98
|
+
deliveryAddress: itm.delivery_address,
|
|
99
|
+
state: itm.state,
|
|
100
|
+
city: itm.city,
|
|
101
|
+
country: itm.country,
|
|
102
|
+
createdAt: itm.created_at
|
|
103
|
+
};
|
|
104
|
+
});
|
|
105
|
+
return {
|
|
106
|
+
items,
|
|
107
|
+
total: total[0].count
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
catch (error) {
|
|
111
|
+
throw error;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
//# sourceMappingURL=shortage-report.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shortage-report.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/reports/shortage-report.ts"],"names":[],"mappings":"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"}
|
|
@@ -5,9 +5,19 @@ const inbound_order_details_report_1 = require("./inbound-order-details-report")
|
|
|
5
5
|
const inbound_order_details_report_list_1 = require("./inbound-order-details-report-list");
|
|
6
6
|
const outbound_order_details_report_1 = require("./outbound-order-details-report");
|
|
7
7
|
const outbound_order_details_report_list_1 = require("./outbound-order-details-report-list");
|
|
8
|
+
const shortage_report_list_1 = require("./shortage-report-list");
|
|
9
|
+
const shortage_report_type_1 = require("./shortage-report-type");
|
|
8
10
|
exports.Query = `
|
|
9
11
|
inboundOrderDetailsReport(filters: [Filter!], pagination: Pagination, sortings: [Sorting!]): InboundOrderDetailsReportList @transaction
|
|
10
12
|
outboundOrderDetailsReport(filters: [Filter!], pagination: Pagination, sortings: [Sorting!]): OutboundOrderDetailsReportList @transaction
|
|
13
|
+
shortageReport(filters: [Filter!], pagination: Pagination, sortings: [Sorting!]):ShortageReportList @transaction
|
|
11
14
|
`;
|
|
12
|
-
exports.Types = [
|
|
15
|
+
exports.Types = [
|
|
16
|
+
inbound_order_details_report_1.InboundOrderDetailsReport,
|
|
17
|
+
inbound_order_details_report_list_1.InboundOrderDetailsReportList,
|
|
18
|
+
outbound_order_details_report_1.OutboundOrderDetailsReport,
|
|
19
|
+
outbound_order_details_report_list_1.OutboundOrderDetailsReportList,
|
|
20
|
+
shortage_report_type_1.ShortageReport,
|
|
21
|
+
shortage_report_list_1.ShortageReportList
|
|
22
|
+
];
|
|
13
23
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../server/graphql/types/reports/index.ts"],"names":[],"mappings":";;;AAAA,iFAA0E;AAC1E,2FAAmF;AACnF,mFAA4E;AAC5E,6FAAqF;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../server/graphql/types/reports/index.ts"],"names":[],"mappings":";;;AAAA,iFAA0E;AAC1E,2FAAmF;AACnF,mFAA4E;AAC5E,6FAAqF;AACrF,iEAA2D;AAC3D,iEAAuD;AAE1C,QAAA,KAAK,GAAG;;;;CAIpB,CAAA;AAEY,QAAA,KAAK,GAAG;IACnB,wDAAyB;IACzB,iEAA6B;IAC7B,0DAA0B;IAC1B,mEAA8B;IAC9B,qCAAc;IACd,yCAAkB;CACnB,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.ShortageReportList = void 0;
|
|
7
|
+
const graphql_tag_1 = __importDefault(require("graphql-tag"));
|
|
8
|
+
exports.ShortageReportList = (0, graphql_tag_1.default) `
|
|
9
|
+
type ShortageReportList {
|
|
10
|
+
items: [ShortageReport]
|
|
11
|
+
total: Int
|
|
12
|
+
}
|
|
13
|
+
`;
|
|
14
|
+
//# sourceMappingURL=shortage-report-list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shortage-report-list.js","sourceRoot":"","sources":["../../../../server/graphql/types/reports/shortage-report-list.ts"],"names":[],"mappings":";;;;;;AAAA,8DAA6B;AAEhB,QAAA,kBAAkB,GAAG,IAAA,qBAAG,EAAA;;;;;CAKpC,CAAA"}
|
|
@@ -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"}
|
|
@@ -173,6 +173,155 @@ definitions:
|
|
|
173
173
|
xml:
|
|
174
174
|
name: 'GetInventoryProductGroupList'
|
|
175
175
|
|
|
176
|
+
# GetInventoryAdjustmentList
|
|
177
|
+
GetInventoryAdjustmentList:
|
|
178
|
+
type: 'object'
|
|
179
|
+
properties:
|
|
180
|
+
data:
|
|
181
|
+
type: 'array'
|
|
182
|
+
items:
|
|
183
|
+
type: 'object'
|
|
184
|
+
properties:
|
|
185
|
+
id:
|
|
186
|
+
type: 'string'
|
|
187
|
+
example: 'b60feaf2-1940-40cd-9c53-9e9ac072049d'
|
|
188
|
+
original:
|
|
189
|
+
type: 'object'
|
|
190
|
+
properties:
|
|
191
|
+
productDetail:
|
|
192
|
+
type: 'object'
|
|
193
|
+
properties:
|
|
194
|
+
sku:
|
|
195
|
+
type: 'string'
|
|
196
|
+
example: 'LB-18'
|
|
197
|
+
name:
|
|
198
|
+
type: 'string'
|
|
199
|
+
example: '50PCS PLASTIC LUNCH BOX'
|
|
200
|
+
palletId:
|
|
201
|
+
type: 'string'
|
|
202
|
+
example: 'string'
|
|
203
|
+
cartonId:
|
|
204
|
+
type: 'string'
|
|
205
|
+
example: 'string'
|
|
206
|
+
batchNo:
|
|
207
|
+
type: 'string'
|
|
208
|
+
example: 'string'
|
|
209
|
+
batchNoRef:
|
|
210
|
+
type: 'string'
|
|
211
|
+
example: 'string'
|
|
212
|
+
packingType:
|
|
213
|
+
type: 'string'
|
|
214
|
+
example: 'string'
|
|
215
|
+
packingSize:
|
|
216
|
+
type: 'string'
|
|
217
|
+
example: 'string'
|
|
218
|
+
qty:
|
|
219
|
+
type: 'integer'
|
|
220
|
+
example: 1
|
|
221
|
+
uom:
|
|
222
|
+
type: 'string'
|
|
223
|
+
example: ''
|
|
224
|
+
uomValue:
|
|
225
|
+
type: 'integer'
|
|
226
|
+
format: 'double'
|
|
227
|
+
example: 0
|
|
228
|
+
expirationDate:
|
|
229
|
+
type: 'date'
|
|
230
|
+
example: ' '
|
|
231
|
+
manufactureDate:
|
|
232
|
+
type: 'date'
|
|
233
|
+
example: ''
|
|
234
|
+
adjustmentCode:
|
|
235
|
+
type: 'string'
|
|
236
|
+
example: ''
|
|
237
|
+
adjustmentNote:
|
|
238
|
+
type: 'string'
|
|
239
|
+
example: ''
|
|
240
|
+
inventoryStatus:
|
|
241
|
+
type: 'string'
|
|
242
|
+
example: 'STORED'
|
|
243
|
+
new:
|
|
244
|
+
type: 'object'
|
|
245
|
+
properties:
|
|
246
|
+
productDetail:
|
|
247
|
+
type: 'object'
|
|
248
|
+
properties:
|
|
249
|
+
sku:
|
|
250
|
+
type: 'string'
|
|
251
|
+
example: 'LB-18'
|
|
252
|
+
name:
|
|
253
|
+
type: 'string'
|
|
254
|
+
example: '50PCS PLASTIC LUNCH BOX'
|
|
255
|
+
palletId:
|
|
256
|
+
type: 'string'
|
|
257
|
+
example: 'string'
|
|
258
|
+
cartonId:
|
|
259
|
+
type: 'string'
|
|
260
|
+
example: 'string'
|
|
261
|
+
batchNo:
|
|
262
|
+
type: 'string'
|
|
263
|
+
example: 'string'
|
|
264
|
+
batchNoRef:
|
|
265
|
+
type: 'string'
|
|
266
|
+
example: 'string'
|
|
267
|
+
packingType:
|
|
268
|
+
type: 'string'
|
|
269
|
+
example: 'string'
|
|
270
|
+
packingSize:
|
|
271
|
+
type: 'string'
|
|
272
|
+
example: 'string'
|
|
273
|
+
qty:
|
|
274
|
+
type: 'integer'
|
|
275
|
+
example: 3
|
|
276
|
+
uom:
|
|
277
|
+
type: 'string'
|
|
278
|
+
example: ''
|
|
279
|
+
uomValue:
|
|
280
|
+
type: 'integer'
|
|
281
|
+
format: 'double'
|
|
282
|
+
example: 0
|
|
283
|
+
expirationDate:
|
|
284
|
+
type: 'date'
|
|
285
|
+
example: ' '
|
|
286
|
+
manufactureDate:
|
|
287
|
+
type: 'date'
|
|
288
|
+
example: ''
|
|
289
|
+
adjustmentCode:
|
|
290
|
+
type: 'string'
|
|
291
|
+
example: ''
|
|
292
|
+
adjustmentNote:
|
|
293
|
+
type: 'string'
|
|
294
|
+
example: ''
|
|
295
|
+
inventoryStatus:
|
|
296
|
+
type: 'string'
|
|
297
|
+
example: 'MISSING'
|
|
298
|
+
type:
|
|
299
|
+
type: 'string'
|
|
300
|
+
example: 'MISSING'
|
|
301
|
+
submittedAt:
|
|
302
|
+
type: 'string'
|
|
303
|
+
example: '13-12-2023T11:05:02'
|
|
304
|
+
updatedAt:
|
|
305
|
+
type: 'string'
|
|
306
|
+
example: '13-12-2023T11:05:02'
|
|
307
|
+
adjusted:
|
|
308
|
+
type: 'object'
|
|
309
|
+
properties:
|
|
310
|
+
qty:
|
|
311
|
+
type: 'integer'
|
|
312
|
+
example: '+2'
|
|
313
|
+
limit:
|
|
314
|
+
type: 'integer'
|
|
315
|
+
example: 100
|
|
316
|
+
offset:
|
|
317
|
+
type: 'integer'
|
|
318
|
+
example: 0
|
|
319
|
+
totalCount:
|
|
320
|
+
type: 'integer'
|
|
321
|
+
example: 35
|
|
322
|
+
xml:
|
|
323
|
+
name: 'GetInventoryAdjustmentList'
|
|
324
|
+
|
|
176
325
|
paths:
|
|
177
326
|
# get-onhand-inventory-list
|
|
178
327
|
api/v1/warehouse/get-onhand-inventory-list:
|
|
@@ -267,3 +416,59 @@ paths:
|
|
|
267
416
|
type: 'array'
|
|
268
417
|
items:
|
|
269
418
|
$ref: '#/definitions/GetInventoryProductGroupList'
|
|
419
|
+
|
|
420
|
+
# get-inventory-adjustment
|
|
421
|
+
api/v1/warehouse/get-inventory-adjustment-list:
|
|
422
|
+
get:
|
|
423
|
+
tags:
|
|
424
|
+
- 'Inventory'
|
|
425
|
+
summary: 'Get inventory adjustment list'
|
|
426
|
+
description: 'Get Inventory Adjustment List'
|
|
427
|
+
operationId: 'getInventoryAdjustmentList'
|
|
428
|
+
consumes:
|
|
429
|
+
- 'application/json'
|
|
430
|
+
produces:
|
|
431
|
+
- 'application/json'
|
|
432
|
+
parameters:
|
|
433
|
+
- in: 'query'
|
|
434
|
+
name: 'domainId'
|
|
435
|
+
type: 'string'
|
|
436
|
+
required: true
|
|
437
|
+
- in: 'query'
|
|
438
|
+
name: 'bizplaceId'
|
|
439
|
+
type: 'string'
|
|
440
|
+
required: true
|
|
441
|
+
- in: 'query'
|
|
442
|
+
name: 'batchId'
|
|
443
|
+
type: 'string'
|
|
444
|
+
- in: 'query'
|
|
445
|
+
name: 'fromDate'
|
|
446
|
+
type: 'string'
|
|
447
|
+
required: true
|
|
448
|
+
- in: 'query'
|
|
449
|
+
name: 'toDate'
|
|
450
|
+
type: 'string'
|
|
451
|
+
required: true
|
|
452
|
+
- in: 'query'
|
|
453
|
+
name: 'limit'
|
|
454
|
+
type: 'integer'
|
|
455
|
+
default: 100
|
|
456
|
+
- in: 'query'
|
|
457
|
+
name: 'offset'
|
|
458
|
+
type: 'integer'
|
|
459
|
+
default: 0
|
|
460
|
+
- in: 'query'
|
|
461
|
+
name: 'sku'
|
|
462
|
+
type: 'string'
|
|
463
|
+
- in: 'query'
|
|
464
|
+
name: 'adjustmentStatus'
|
|
465
|
+
type: 'string'
|
|
466
|
+
responses:
|
|
467
|
+
'200':
|
|
468
|
+
description: 'successful operation'
|
|
469
|
+
content:
|
|
470
|
+
application/json:
|
|
471
|
+
schema:
|
|
472
|
+
type: 'array'
|
|
473
|
+
items:
|
|
474
|
+
$ref: '#/definitions/GetInventoryAdjustmentList'
|
|
@@ -173,6 +173,155 @@ definitions:
|
|
|
173
173
|
xml:
|
|
174
174
|
name: 'GetInventoryProductGroupList'
|
|
175
175
|
|
|
176
|
+
# GetInventoryAdjustmentList
|
|
177
|
+
GetInventoryAdjustmentList:
|
|
178
|
+
type: 'object'
|
|
179
|
+
properties:
|
|
180
|
+
data:
|
|
181
|
+
type: 'array'
|
|
182
|
+
items:
|
|
183
|
+
type: 'object'
|
|
184
|
+
properties:
|
|
185
|
+
id:
|
|
186
|
+
type: 'string'
|
|
187
|
+
example: 'b60feaf2-1940-40cd-9c53-9e9ac072049d'
|
|
188
|
+
original:
|
|
189
|
+
type: 'object'
|
|
190
|
+
properties:
|
|
191
|
+
productDetail:
|
|
192
|
+
type: 'object'
|
|
193
|
+
properties:
|
|
194
|
+
sku:
|
|
195
|
+
type: 'string'
|
|
196
|
+
example: 'LB-18'
|
|
197
|
+
name:
|
|
198
|
+
type: 'string'
|
|
199
|
+
example: '50PCS PLASTIC LUNCH BOX'
|
|
200
|
+
palletId:
|
|
201
|
+
type: 'string'
|
|
202
|
+
example: 'string'
|
|
203
|
+
cartonId:
|
|
204
|
+
type: 'string'
|
|
205
|
+
example: 'string'
|
|
206
|
+
batchNo:
|
|
207
|
+
type: 'string'
|
|
208
|
+
example: 'string'
|
|
209
|
+
batchNoRef:
|
|
210
|
+
type: 'string'
|
|
211
|
+
example: 'string'
|
|
212
|
+
packingType:
|
|
213
|
+
type: 'string'
|
|
214
|
+
example: 'string'
|
|
215
|
+
packingSize:
|
|
216
|
+
type: 'string'
|
|
217
|
+
example: 'string'
|
|
218
|
+
qty:
|
|
219
|
+
type: 'integer'
|
|
220
|
+
example: 1
|
|
221
|
+
uom:
|
|
222
|
+
type: 'string'
|
|
223
|
+
example: ''
|
|
224
|
+
uomValue:
|
|
225
|
+
type: 'integer'
|
|
226
|
+
format: 'double'
|
|
227
|
+
example: 0
|
|
228
|
+
expirationDate:
|
|
229
|
+
type: 'date'
|
|
230
|
+
example: ' '
|
|
231
|
+
manufactureDate:
|
|
232
|
+
type: 'date'
|
|
233
|
+
example: ''
|
|
234
|
+
adjustmentCode:
|
|
235
|
+
type: 'string'
|
|
236
|
+
example: ''
|
|
237
|
+
adjustmentNote:
|
|
238
|
+
type: 'string'
|
|
239
|
+
example: ''
|
|
240
|
+
inventoryStatus:
|
|
241
|
+
type: 'string'
|
|
242
|
+
example: 'STORED'
|
|
243
|
+
new:
|
|
244
|
+
type: 'object'
|
|
245
|
+
properties:
|
|
246
|
+
productDetail:
|
|
247
|
+
type: 'object'
|
|
248
|
+
properties:
|
|
249
|
+
sku:
|
|
250
|
+
type: 'string'
|
|
251
|
+
example: 'LB-18'
|
|
252
|
+
name:
|
|
253
|
+
type: 'string'
|
|
254
|
+
example: '50PCS PLASTIC LUNCH BOX'
|
|
255
|
+
palletId:
|
|
256
|
+
type: 'string'
|
|
257
|
+
example: 'string'
|
|
258
|
+
cartonId:
|
|
259
|
+
type: 'string'
|
|
260
|
+
example: 'string'
|
|
261
|
+
batchNo:
|
|
262
|
+
type: 'string'
|
|
263
|
+
example: 'string'
|
|
264
|
+
batchNoRef:
|
|
265
|
+
type: 'string'
|
|
266
|
+
example: 'string'
|
|
267
|
+
packingType:
|
|
268
|
+
type: 'string'
|
|
269
|
+
example: 'string'
|
|
270
|
+
packingSize:
|
|
271
|
+
type: 'string'
|
|
272
|
+
example: 'string'
|
|
273
|
+
qty:
|
|
274
|
+
type: 'integer'
|
|
275
|
+
example: 3
|
|
276
|
+
uom:
|
|
277
|
+
type: 'string'
|
|
278
|
+
example: ''
|
|
279
|
+
uomValue:
|
|
280
|
+
type: 'integer'
|
|
281
|
+
format: 'double'
|
|
282
|
+
example: 0
|
|
283
|
+
expirationDate:
|
|
284
|
+
type: 'date'
|
|
285
|
+
example: ' '
|
|
286
|
+
manufactureDate:
|
|
287
|
+
type: 'date'
|
|
288
|
+
example: ''
|
|
289
|
+
adjustmentCode:
|
|
290
|
+
type: 'string'
|
|
291
|
+
example: ''
|
|
292
|
+
adjustmentNote:
|
|
293
|
+
type: 'string'
|
|
294
|
+
example: ''
|
|
295
|
+
inventoryStatus:
|
|
296
|
+
type: 'string'
|
|
297
|
+
example: 'MISSING'
|
|
298
|
+
type:
|
|
299
|
+
type: 'string'
|
|
300
|
+
example: 'MISSING'
|
|
301
|
+
submittedAt:
|
|
302
|
+
type: 'string'
|
|
303
|
+
example: '13-12-2023T11:05:02'
|
|
304
|
+
updatedAt:
|
|
305
|
+
type: 'string'
|
|
306
|
+
example: '13-12-2023T11:05:02'
|
|
307
|
+
adjusted:
|
|
308
|
+
type: 'object'
|
|
309
|
+
properties:
|
|
310
|
+
qty:
|
|
311
|
+
type: 'integer'
|
|
312
|
+
example: '+2'
|
|
313
|
+
limit:
|
|
314
|
+
type: 'integer'
|
|
315
|
+
example: 100
|
|
316
|
+
offset:
|
|
317
|
+
type: 'integer'
|
|
318
|
+
example: 0
|
|
319
|
+
totalCount:
|
|
320
|
+
type: 'integer'
|
|
321
|
+
example: 35
|
|
322
|
+
xml:
|
|
323
|
+
name: 'GetInventoryAdjustmentList'
|
|
324
|
+
|
|
176
325
|
paths:
|
|
177
326
|
# get-onhand-inventory-list
|
|
178
327
|
api/v1/warehouse/get-onhand-inventory-list:
|
|
@@ -267,3 +416,59 @@ paths:
|
|
|
267
416
|
type: 'array'
|
|
268
417
|
items:
|
|
269
418
|
$ref: '#/definitions/GetInventoryProductGroupList'
|
|
419
|
+
|
|
420
|
+
# get-inventory-adjustment
|
|
421
|
+
api/v1/warehouse/get-inventory-adjustment-list:
|
|
422
|
+
get:
|
|
423
|
+
tags:
|
|
424
|
+
- 'Inventory'
|
|
425
|
+
summary: 'Get inventory adjustment list'
|
|
426
|
+
description: 'Get Inventory Adjustment List'
|
|
427
|
+
operationId: 'getInventoryAdjustmentList'
|
|
428
|
+
consumes:
|
|
429
|
+
- 'application/json'
|
|
430
|
+
produces:
|
|
431
|
+
- 'application/json'
|
|
432
|
+
parameters:
|
|
433
|
+
- in: 'query'
|
|
434
|
+
name: 'domainId'
|
|
435
|
+
type: 'string'
|
|
436
|
+
required: true
|
|
437
|
+
- in: 'query'
|
|
438
|
+
name: 'bizplaceId'
|
|
439
|
+
type: 'string'
|
|
440
|
+
required: true
|
|
441
|
+
- in: 'query'
|
|
442
|
+
name: 'batchId'
|
|
443
|
+
type: 'string'
|
|
444
|
+
- in: 'query'
|
|
445
|
+
name: 'fromDate'
|
|
446
|
+
type: 'string'
|
|
447
|
+
required: true
|
|
448
|
+
- in: 'query'
|
|
449
|
+
name: 'toDate'
|
|
450
|
+
type: 'string'
|
|
451
|
+
required: true
|
|
452
|
+
- in: 'query'
|
|
453
|
+
name: 'limit'
|
|
454
|
+
type: 'integer'
|
|
455
|
+
default: 100
|
|
456
|
+
- in: 'query'
|
|
457
|
+
name: 'offset'
|
|
458
|
+
type: 'integer'
|
|
459
|
+
default: 0
|
|
460
|
+
- in: 'query'
|
|
461
|
+
name: 'sku'
|
|
462
|
+
type: 'string'
|
|
463
|
+
- in: 'query'
|
|
464
|
+
name: 'adjustmentStatus'
|
|
465
|
+
type: 'string'
|
|
466
|
+
responses:
|
|
467
|
+
'200':
|
|
468
|
+
description: 'successful operation'
|
|
469
|
+
content:
|
|
470
|
+
application/json:
|
|
471
|
+
schema:
|
|
472
|
+
type: 'array'
|
|
473
|
+
items:
|
|
474
|
+
$ref: '#/definitions/GetInventoryAdjustmentList'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@things-factory/operato-hub",
|
|
3
|
-
"version": "4.3.
|
|
3
|
+
"version": "4.3.386",
|
|
4
4
|
"main": "dist-server/index.js",
|
|
5
5
|
"browser": "client/index.js",
|
|
6
6
|
"things-factory": true,
|
|
@@ -121,5 +121,5 @@
|
|
|
121
121
|
"resolutions": {
|
|
122
122
|
"core-js": "^3.16.0"
|
|
123
123
|
},
|
|
124
|
-
"gitHead": "
|
|
124
|
+
"gitHead": "d504ae7551567b12cd2011fb1c958300159c545f"
|
|
125
125
|
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { inboundOrderDetailsReport } from './inbound-order-details-report'
|
|
2
2
|
import { outboundOrderDetailsReport } from './outbound-order-details-report'
|
|
3
|
+
import { shortageReport } from './shortage-report'
|
|
3
4
|
|
|
4
5
|
export const Query = {
|
|
5
6
|
...inboundOrderDetailsReport,
|
|
6
|
-
...outboundOrderDetailsReport
|
|
7
|
+
...outboundOrderDetailsReport,
|
|
8
|
+
...shortageReport
|
|
7
9
|
}
|
|
@@ -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
|
+
}
|
|
@@ -2,10 +2,20 @@ import { InboundOrderDetailsReport } from './inbound-order-details-report'
|
|
|
2
2
|
import { InboundOrderDetailsReportList } from './inbound-order-details-report-list'
|
|
3
3
|
import { OutboundOrderDetailsReport } from './outbound-order-details-report'
|
|
4
4
|
import { OutboundOrderDetailsReportList } from './outbound-order-details-report-list'
|
|
5
|
+
import { ShortageReportList } from './shortage-report-list'
|
|
6
|
+
import { ShortageReport } from './shortage-report-type'
|
|
5
7
|
|
|
6
8
|
export const Query = `
|
|
7
9
|
inboundOrderDetailsReport(filters: [Filter!], pagination: Pagination, sortings: [Sorting!]): InboundOrderDetailsReportList @transaction
|
|
8
10
|
outboundOrderDetailsReport(filters: [Filter!], pagination: Pagination, sortings: [Sorting!]): OutboundOrderDetailsReportList @transaction
|
|
11
|
+
shortageReport(filters: [Filter!], pagination: Pagination, sortings: [Sorting!]):ShortageReportList @transaction
|
|
9
12
|
`
|
|
10
13
|
|
|
11
|
-
export const Types = [
|
|
14
|
+
export const Types = [
|
|
15
|
+
InboundOrderDetailsReport,
|
|
16
|
+
InboundOrderDetailsReportList,
|
|
17
|
+
OutboundOrderDetailsReport,
|
|
18
|
+
OutboundOrderDetailsReportList,
|
|
19
|
+
ShortageReport,
|
|
20
|
+
ShortageReportList
|
|
21
|
+
]
|
|
@@ -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
|
+
`
|