@things-factory/operato-wms 4.3.300 → 4.3.302

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.
Files changed (36) hide show
  1. package/client/pages/inventory/onhand-inventory.js +23 -19
  2. package/client/pages/outbound/route-label-popup.js +56 -3
  3. package/client/pages/report/analysis-picking-packing-report.js +490 -0
  4. package/client/pages/report/outbound-order-details-report.js +1 -0
  5. package/client/pages/report/shortage-report.js +475 -0
  6. package/client/route.js +8 -0
  7. package/dist-server/graphql/resolvers/reports/analysis-picking-packing-report.js +128 -0
  8. package/dist-server/graphql/resolvers/reports/analysis-picking-packing-report.js.map +1 -0
  9. package/dist-server/graphql/resolvers/reports/index.js +5 -3
  10. package/dist-server/graphql/resolvers/reports/index.js.map +1 -1
  11. package/dist-server/graphql/resolvers/reports/shortage-report.js +115 -0
  12. package/dist-server/graphql/resolvers/reports/shortage-report.js.map +1 -0
  13. package/dist-server/graphql/types/reports/analysis-picking-packing-report-list.js +14 -0
  14. package/dist-server/graphql/types/reports/analysis-picking-packing-report-list.js.map +1 -0
  15. package/dist-server/graphql/types/reports/analysis-picking-packing-report.js +18 -0
  16. package/dist-server/graphql/types/reports/analysis-picking-packing-report.js.map +1 -0
  17. package/dist-server/graphql/types/reports/index.js +19 -9
  18. package/dist-server/graphql/types/reports/index.js.map +1 -1
  19. package/dist-server/graphql/types/reports/shortage-report-list.js +14 -0
  20. package/dist-server/graphql/types/reports/shortage-report-list.js.map +1 -0
  21. package/dist-server/graphql/types/reports/shortage-report-type.js +25 -0
  22. package/dist-server/graphql/types/reports/shortage-report-type.js.map +1 -0
  23. package/package.json +8 -8
  24. package/server/graphql/resolvers/reports/analysis-picking-packing-report.ts +146 -0
  25. package/server/graphql/resolvers/reports/index.ts +11 -5
  26. package/server/graphql/resolvers/reports/shortage-report.ts +132 -0
  27. package/server/graphql/types/reports/analysis-picking-packing-report-list.ts +8 -0
  28. package/server/graphql/types/reports/analysis-picking-packing-report.ts +12 -0
  29. package/server/graphql/types/reports/index.ts +27 -14
  30. package/server/graphql/types/reports/shortage-report-list.ts +8 -0
  31. package/server/graphql/types/reports/shortage-report-type.ts +19 -0
  32. package/things-factory.config.js +10 -0
  33. package/translations/en.json +7 -0
  34. package/translations/ko.json +7 -0
  35. package/translations/ms.json +7 -0
  36. package/translations/zh.json +7 -0
@@ -0,0 +1,475 @@
1
+ import '@things-factory/form-ui'
2
+ import '@things-factory/grist-ui'
3
+ import '../inventory/inventory-by-product-detail'
4
+
5
+ import gql from 'graphql-tag'
6
+ import {
7
+ css,
8
+ html
9
+ } from 'lit-element'
10
+ import { connect } from 'pwa-helpers/connect-mixin'
11
+
12
+ import {
13
+ i18next,
14
+ localize
15
+ } from '@things-factory/i18n-base'
16
+ import {
17
+ client,
18
+ gqlContext,
19
+ PageView,
20
+ store
21
+ } from '@things-factory/shell'
22
+ // import { ScrollbarStyles } from '@things-factory/styles'
23
+ import { isMobileDevice } from '@things-factory/utils'
24
+
25
+ import { showToast } from '../../util'
26
+
27
+ class shortageReport extends connect(store)(localize(i18next)(PageView)){
28
+ static get styles(){
29
+ return [
30
+ // ScrollbarStyles,
31
+ css`
32
+ :host {
33
+ display:flex;
34
+ flex-direction: column;
35
+ width: 100%
36
+ }
37
+
38
+ data-grist{
39
+ overflow-y: auto;
40
+ flex: 1;
41
+ }
42
+
43
+ .summary {
44
+ background-color: var(--main-section-background-color);
45
+ display: flex;
46
+ flex-direction: column;
47
+ overflow-y: auto;
48
+ align-items: flex-end;
49
+ padding: var(--data-list-item-padding);
50
+ display: grid;
51
+ font-size: 14px;
52
+ color: #394e64;
53
+ grid-template-columns: repeat(2, 1fr);
54
+ grid-auto-rows: minmax(24px, auto);
55
+ }
56
+ `
57
+ ]
58
+ }
59
+
60
+ static get properties() {
61
+ return{
62
+ _searchFields: Array,
63
+ _config: Object,
64
+ _gristData:Object,
65
+ _partners:Object,
66
+ items: Object,
67
+ // importHandler: Object
68
+ }
69
+ }
70
+
71
+ get context() {
72
+ return {
73
+ title: i18next.t('Shortage Report'),
74
+ exportable: {
75
+ name: i18next.t('this.Shortage_report'),
76
+ data: this._exportableData.bind(this)
77
+ },
78
+ help: 'operato-wms/report/shortage-report'
79
+ }
80
+ }
81
+
82
+ get dataGrist() {
83
+ return this.shadowRoot.querySelector('data-grist')
84
+ }
85
+
86
+ get searchForm() {
87
+ return this.shadowRoot.querySelector('search-form')
88
+ }
89
+
90
+ get _bizplaceSelector() {
91
+ return this.searchForm.shadowRoot.querySelector('select[name=bizplace]')
92
+ }
93
+
94
+ get _fromDateInput() {
95
+ return this.searchForm.shadowRoot.querySelector('input[name=fromDate]')
96
+ }
97
+
98
+ get _toDateInput() {
99
+ return this.searchForm.shadowRoot.querySelector('input[name=toDate]')
100
+ }
101
+
102
+ render () {
103
+ return html`
104
+ <search-form
105
+ id="search-form"
106
+ .fields=${this._searchFields}
107
+ initFocus="description"
108
+ @submit=${e => this.dataGrist.fetch()}
109
+ ></search-form>
110
+
111
+ <data-grist
112
+ .mode=${isMobileDevice() ? 'LIST' : 'GRID'}
113
+ .config=${this._config}
114
+ .fetchHandler="${this.fetchHandler.bind(this)}"
115
+ ></data-grist>
116
+ `
117
+ }
118
+
119
+ get searchFields() {
120
+ return [
121
+ {
122
+ label: i18next.t('Company'),
123
+ name:'bizplace',
124
+ type:'select',
125
+ options: [
126
+ { value: ''},
127
+ ...this._partners
128
+ .map(partner => {
129
+ return {
130
+ name: `${partner.name} ${partner.description ? `(${partner.description})` : ''}`,
131
+ value: partner.id
132
+ }
133
+ })
134
+ .sort(this._compareValues('name', 'asc'))
135
+ ],
136
+ props: {searchOper: 'eq'}
137
+ },
138
+ {
139
+ label: i18next.t('field.from_date'),
140
+ name: 'fromDate',
141
+ type: 'date',
142
+ props: {
143
+ searchOper: 'eq',
144
+ max: new Date().toISOString().split('T')[0]
145
+ },
146
+ value: (() => {
147
+ let date = new Date()
148
+ date.setMonth(date.getMonth() - 1)
149
+ return date.toISOString().split('T')[0]
150
+ })(),
151
+ handlers: { change: this._modifyDateRange.bind(this) }
152
+ },
153
+ {
154
+ label: i18next.t('field.to_date'),
155
+ name: 'toDate',
156
+ type: 'date',
157
+ props: {
158
+ searchOper: 'eq',
159
+ min: (() => {
160
+ let date = new Date()
161
+ date.setMonth(date.getMonth() - 1)
162
+ return date.toISOString().split('T')[0]
163
+ })(),
164
+ max: new Date().toISOString().split('T')[0]
165
+ },
166
+ value: new Date().toISOString().split('T')[0],
167
+ handlers: { change: this._submit.bind(this) }
168
+ },
169
+ {
170
+ label: i18next.t('field.product_info'),
171
+ name: 'product',
172
+ type: 'string',
173
+ props: { searchOper: 'in' }
174
+ },
175
+ {
176
+ label: i18next.t('field.order_no'),
177
+ name: 'orderNo',
178
+ type: 'text',
179
+ props: { searchOper: 'custom' }
180
+ }
181
+ ]
182
+ }
183
+
184
+
185
+ get reportConfig() {
186
+ // let rows = {
187
+ // selectable: false,
188
+ // insertable: false,
189
+ // appendable: false
190
+ // }
191
+ let columns = [
192
+ { type: 'gutter', gutterName: 'sequence' },
193
+ {
194
+ type: 'string',
195
+ name: 'bizplaceName',
196
+ header: i18next.t('field.company'),
197
+ width: 200
198
+ },
199
+ {
200
+ type: 'string',
201
+ name: 'orderNo',
202
+ header: i18next.t('field.order_no'),
203
+ width: 200
204
+ },
205
+ {
206
+ type: 'string',
207
+ name: 'refNo',
208
+ header: i18next.t('field.ref_no'),
209
+ width: 150
210
+ },
211
+ {
212
+ type: 'string',
213
+ name: 'productSku',
214
+ header: i18next.t('field.sku'),
215
+ width: 200
216
+ },
217
+ {
218
+ type: 'string',
219
+ name: 'productName',
220
+ header: i18next.t('field.product'),
221
+ width: 200
222
+ },
223
+ {
224
+ type: 'string',
225
+ name: 'orderQty',
226
+ header: i18next.t('field.order_quantity'),
227
+ width: 170
228
+ },
229
+ {
230
+ type: 'string',
231
+ name: 'avQty',
232
+ header: i18next.t('field.available_qty'),
233
+ width: 150
234
+ },
235
+ {
236
+ type: 'string',
237
+ name: 'nettStock',
238
+ header: i18next.t('field.nett_stock'),
239
+ width: 150
240
+ },
241
+ {
242
+ type: 'datetime',
243
+ name: 'createdAt',
244
+ header: i18next.t('field.created_at'),
245
+ width: 170
246
+ }
247
+ ]
248
+ let list = {
249
+ fields: [
250
+ 'bizplaceName',
251
+ 'orderNo',
252
+ 'refNo',
253
+ 'productSku',
254
+ 'productName',
255
+ 'orderQty',
256
+ 'avQty',
257
+ 'nettStock',
258
+ 'createdAt'
259
+ ]
260
+ }
261
+
262
+ return {
263
+ // rows: rows,
264
+ columns: columns,
265
+ list,
266
+ pagination: { limit: 50, pages: [50, 100, 200, 500, 1000] },
267
+ rows: {
268
+ selectable: false,
269
+ insertable: false,
270
+ appendable: false
271
+ }
272
+ }
273
+ }
274
+
275
+ async pageInitialized(){
276
+ this._gristData = { total: 0, records: [] }
277
+ this._products = []
278
+
279
+ const [_partnersReq] = await Promise.allSettled([this._fetchPartners()])
280
+
281
+ this._partners = _partnersReq.status == 'fulfilled' ? _partnersReq.value : []
282
+
283
+ this._searchFields = this.searchFields
284
+ this._config = this.reportConfig
285
+
286
+ }
287
+
288
+ pageUpdated(changes, lifecycle) {
289
+ if (this.active) {
290
+ this.dataGrist.fetch()
291
+ }
292
+ }
293
+
294
+ async fetchHandler({page, limit, sorters = []}) {
295
+ try {
296
+ this._validate()
297
+ let filters = this.searchForm.queryFilters.map(filter => {
298
+ switch (filter.name) {
299
+ case 'fromDate':
300
+ let fromDt = new Date(filter.value)
301
+ fromDt.setHours(0)
302
+ filter.value = fromDt.toISOString()
303
+ break
304
+ case 'toDate':
305
+ let toDt = new Date(filter.value)
306
+ toDt.setHours(23, 59, 59)
307
+ filter.value = toDt.toISOString()
308
+ break
309
+ default:
310
+ break
311
+ }
312
+ return filter
313
+ })
314
+
315
+ const pagination = { page, limit }
316
+ const sortings = sorters
317
+
318
+ const response = await client.query({
319
+ query:gql`
320
+ query shortageReport($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
321
+ shortageReport(filters: $filters, pagination: $pagination, sortings: $sortings) {
322
+ items {
323
+ bizplaceName
324
+ orderNo
325
+ refNo
326
+ productSku
327
+ productName
328
+ orderQty
329
+ avQty
330
+ nettStock
331
+ deliveryAddress
332
+ state
333
+ city
334
+ country
335
+ createdAt
336
+ }
337
+ total
338
+ }
339
+ }
340
+ `,
341
+ variables: { filters,pagination,sortings},
342
+ context:gqlContext()
343
+ })
344
+
345
+ return{
346
+ total: response.data.shortageReport.total || 0,
347
+ records: response.data.shortageReport.items || []
348
+ }
349
+
350
+ this._gristData = {
351
+ ...items
352
+ }
353
+
354
+ return items
355
+ } catch (e) {
356
+ showToast(e)
357
+ }
358
+ }
359
+
360
+ async _fetchPartners() {
361
+ const filters = []
362
+ const response = await client.query({
363
+ query: gql`
364
+ query partnersBizplaces($filters: [Filter!]) {
365
+ partnersBizplaces(filters: $filters) {
366
+ items {
367
+ id
368
+ name
369
+ description
370
+ }
371
+ }
372
+ }
373
+ `,
374
+ variables: { filters }
375
+ })
376
+
377
+ if (!response.errors) {
378
+ return response.data.partnersBizplaces.items
379
+ }
380
+ }
381
+
382
+ _validate() {
383
+ if (!this.searchForm.shadowRoot.querySelector('form').checkValidity())
384
+ throw new Error(i18next.t('text.invalid_form_value'))
385
+ if (!this._bizplaceSelector.value) throw new Error(i18next.t('text.no_company_selected'))
386
+ if (!this._fromDateInput.value) throw new Error(i18next.t('text.from_date_is_empty'))
387
+ if (!this._toDateInput.value) throw new Error(i18next.t('text.to_date_is_empty'))
388
+ }
389
+
390
+ _compareValues(key, order = 'asc') {
391
+ return function innerSort(a, b) {
392
+ if (!a.hasOwnProperty(key) || !b.hasOwnProperty(key)) {
393
+ return 0
394
+ }
395
+
396
+ const varA = typeof a[key] === 'string' ? a[key].toUpperCase() : a[key]
397
+ const varB = typeof b[key] === 'string' ? b[key].toUpperCase() : b[key]
398
+
399
+ let comparison = 0
400
+ if (varA > varB) {
401
+ comparison = 1
402
+ } else if (varA < varB) {
403
+ comparison = -1
404
+ }
405
+ return order === 'desc' ? comparison * -1 : comparison
406
+ }
407
+ }
408
+
409
+ _modifyDateRange(e) {
410
+ const fromDate = e.currentTarget.value
411
+
412
+ if (this._toDateInput.value < fromDate) this._toDateInput.value = fromDate
413
+
414
+ let min = new Date(fromDate)
415
+ let today = new Date()
416
+ today.setHours(0, 0, 0, 0)
417
+
418
+ min = min.toISOString().split('T')[0]
419
+
420
+ this._toDateInput.min = min
421
+ this._submit()
422
+ }
423
+
424
+ _submit(e) {
425
+ this._config = { ...this.reportConfig }
426
+ this.searchForm.submit()
427
+ }
428
+
429
+ async _exportableData() {
430
+ try {
431
+ var headerSetting = [
432
+ { header: i18next.t('field.company'), key: 'bizplaceName', width: 60, type: 'string' },
433
+ { header: i18next.t('field.order_no'), key: 'orderNo', width: 30, type: 'string' },
434
+ { header: i18next.t('field.ref_no'), key: 'refNo', width: 60, type: 'string' },
435
+ { header: i18next.t('field.sku'), key: 'productSku', width: 25, type: 'string' },
436
+ {header: i18next.t('field.product'), key: 'productName', width: 50, type: 'string' },
437
+ {header: i18next.t('field.order_quantity'), key: 'orderQty', width: 15, type: 'string' },
438
+ {header: i18next.t('field.available_qty'), key: 'avQty', width: 15, type: 'string' },
439
+ {header: i18next.t('field.nett_stock'), key: 'nettStock', width: 15, type: 'string' },
440
+ {header: i18next.t('field.delivery_address'), key: 'deliveryAddress', width: 15, type: 'string' },
441
+ {header: i18next.t('field.state'), key: 'state', width: 15, type: 'string' },
442
+ {header: i18next.t('field.city'), key: 'city', width: 15, type: 'string' },
443
+ {header: i18next.t('field.country'), key: 'country', width: 15, type: 'string' },
444
+ { header: i18next.t('field.created_at'), key: 'createdAt', width: 30, type: 'string' }
445
+ ]
446
+
447
+ var exportData = {
448
+ header: [...headerSetting],
449
+ data: (await this.fetchHandler({ page: 1, limit: 9999999 })).records.map(itm => {
450
+ return {
451
+ ...itm,
452
+ createdAt: itm.createdAt ? new Date(parseInt(itm.createdAt)).toLocaleString() : '',
453
+ }
454
+ })
455
+ }
456
+
457
+ return exportData
458
+ } catch (e) {
459
+ this._showToast(e)
460
+ }
461
+ }
462
+
463
+ _showToast({ type, message }) {
464
+ document.dispatchEvent(
465
+ new CustomEvent('notify', {
466
+ detail: {
467
+ type,
468
+ message
469
+ }
470
+ })
471
+ )
472
+ }
473
+ }
474
+
475
+ window.customElements.define('shortage-report', shortageReport)
package/client/route.js CHANGED
@@ -497,6 +497,14 @@ export default function route(page) {
497
497
  import('./pages/report/vas-report')
498
498
  return page
499
499
 
500
+ case 'shortage_report':
501
+ import('./pages/report/shortage-report')
502
+ return page
503
+
504
+ case 'analysis_picking_packing_report':
505
+ import('./pages/report/analysis-picking-packing-report')
506
+ return page
507
+
500
508
  /**
501
509
  * Custom ELCCL Menus Section
502
510
  */
@@ -0,0 +1,128 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.analysisPickingPackingReport = void 0;
4
+ const biz_base_1 = require("@things-factory/biz-base");
5
+ const utils_1 = require("../../../utils");
6
+ exports.analysisPickingPackingReport = {
7
+ async analysisPickingPackingReport(_, params, context) {
8
+ try {
9
+ const { tx, domain } = context.state;
10
+ let bizplace = params.filters.find((data) => data.name === 'bizplace');
11
+ let fromDate = params.filters.find((data) => data.name == 'fromDate');
12
+ let toDate = params.filters.find((data) => data.name == 'toDate');
13
+ let name = params.filters.find((data) => data.name === 'name');
14
+ let rate = params.filters.find((data) => data.name === 'rate');
15
+ let type = params.filters.find((data) => data.name === 'type');
16
+ // throw error bizplace filter missing
17
+ if (!bizplace)
18
+ throw 'Invalid input';
19
+ let queryFilter = '';
20
+ if (name) {
21
+ let nameValue = name.value
22
+ .toLowerCase()
23
+ .split(',')
24
+ .map((prod) => {
25
+ return "'%" + prod.trim().replace(/'/g, "''") + "%'";
26
+ })
27
+ .join(',');
28
+ queryFilter += `AND (
29
+ Lower(u.name) LIKE ANY(ARRAY[${nameValue}])
30
+ )`;
31
+ }
32
+ let sortingTypes = '';
33
+ if (type) {
34
+ let typeValue = type.value;
35
+ if (typeValue === 'packing' || typeValue === 'picking') {
36
+ sortingTypes = `AND ih.transaction_type = '${typeValue.toUpperCase()}'`;
37
+ }
38
+ }
39
+ let sortingOptions = '';
40
+ if (rate) {
41
+ let rateValue = rate.value;
42
+ if (rateValue === 'asc' || rateValue === 'desc') {
43
+ sortingOptions = `ORDER BY packing_rates."packingRate" ${rateValue.toUpperCase()}`;
44
+ }
45
+ }
46
+ if (bizplace) {
47
+ queryFilter += ` AND ih.bizplace_id = '${bizplace.value}'`;
48
+ }
49
+ const bizplaceObj = await tx.getRepository(biz_base_1.Bizplace).findOne({
50
+ id: bizplace.value
51
+ });
52
+ await (0, utils_1.rawProductsQuery)(tx, params, bizplaceObj);
53
+ const fromDateValue = new Date(fromDate.value);
54
+ const toDateValue = new Date(toDate.value);
55
+ // Check if the date objects are valid
56
+ if (isNaN(fromDateValue.getTime()) || isNaN(toDateValue.getTime())) {
57
+ throw new Error('Invalid date format. Please provide valid date values.');
58
+ }
59
+ const sqlQuery = `
60
+ WITH packing_rates AS (
61
+ SELECT
62
+ u.name,
63
+ SUM(CASE WHEN EXTRACT(HOUR FROM (ih.created_at + INTERVAL '8 HOUR')) = 7 THEN 1 ELSE 0 END) AS "7",
64
+ SUM(CASE WHEN EXTRACT(HOUR FROM (ih.created_at + INTERVAL '8 HOUR')) = 8 THEN 1 ELSE 0 END) AS "8",
65
+ SUM(CASE WHEN EXTRACT(HOUR FROM (ih.created_at + INTERVAL '8 HOUR')) = 9 THEN 1 ELSE 0 END) AS "9",
66
+ SUM(CASE WHEN EXTRACT(HOUR FROM (ih.created_at + INTERVAL '8 HOUR')) = 10 THEN 1 ELSE 0 END) AS "10",
67
+ SUM(CASE WHEN EXTRACT(HOUR FROM (ih.created_at + INTERVAL '8 HOUR')) = 11 THEN 1 ELSE 0 END) AS "11",
68
+ SUM(CASE WHEN EXTRACT(HOUR FROM (ih.created_at + INTERVAL '8 HOUR')) = 12 THEN 1 ELSE 0 END) AS "12",
69
+ SUM(CASE WHEN EXTRACT(HOUR FROM (ih.created_at + INTERVAL '8 HOUR')) = 13 THEN 1 ELSE 0 END) AS "13",
70
+ SUM(CASE WHEN EXTRACT(HOUR FROM (ih.created_at + INTERVAL '8 HOUR')) = 14 THEN 1 ELSE 0 END) AS "14",
71
+ SUM(CASE WHEN EXTRACT(HOUR FROM (ih.created_at + INTERVAL '8 HOUR')) = 15 THEN 1 ELSE 0 END) AS "15",
72
+ SUM(CASE WHEN EXTRACT(HOUR FROM (ih.created_at + INTERVAL '8 HOUR')) = 16 THEN 1 ELSE 0 END) AS "16",
73
+ SUM(CASE WHEN EXTRACT(HOUR FROM (ih.created_at + INTERVAL '8 HOUR')) = 17 THEN 1 ELSE 0 END) AS "17",
74
+ SUM(CASE WHEN EXTRACT(HOUR FROM (ih.created_at + INTERVAL '8 HOUR')) = 18 THEN 1 ELSE 0 END) AS "18",
75
+ COUNT(DISTINCT DATE(ih.created_at)) AS "totalDaysWorked",
76
+ COUNT(DISTINCT DATE_TRUNC('hour', (ih.created_at + INTERVAL '8 HOUR'))) AS "totalHoursWorked",
77
+ COUNT(*) AS "totalPacks",
78
+ ROUND(COUNT(*) / COUNT(DISTINCT DATE_TRUNC('hour', (ih.created_at + INTERVAL '8 HOUR')))) AS "packingRate"
79
+ FROM
80
+ inventory_histories ih
81
+ INNER JOIN
82
+ users u ON ih.creator_id = u.id
83
+ WHERE
84
+ ih.domain_id = $1
85
+ AND ih.created_at BETWEEN $2 AND $3
86
+ ${queryFilter}
87
+ ${sortingTypes}
88
+ GROUP BY
89
+ u.name
90
+ )
91
+ SELECT
92
+ "name",
93
+ "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18",
94
+ packing_rates."totalDaysWorked",
95
+ "totalPacks",
96
+ packing_rates."totalHoursWorked",
97
+ packing_rates."packingRate"
98
+ FROM
99
+ packing_rates
100
+ ${sortingOptions}
101
+ `;
102
+ const result = await tx.query(sqlQuery, [domain.id, fromDate.value, toDate.value]);
103
+ return {
104
+ items: result.map((data) => {
105
+ return Object.assign(Object.assign({}, data), { name: data.name, hourlyData: JSON.stringify({
106
+ 7: data["7"],
107
+ 8: data["8"],
108
+ 9: data["9"],
109
+ 10: data["10"],
110
+ 11: data["11"],
111
+ 12: data["12"],
112
+ 13: data["13"],
113
+ 14: data["14"],
114
+ 15: data["15"],
115
+ 16: data["16"],
116
+ 17: data["17"],
117
+ 18: data["18"],
118
+ }) });
119
+ }),
120
+ total: result.length
121
+ };
122
+ }
123
+ catch (error) {
124
+ throw error;
125
+ }
126
+ }
127
+ };
128
+ //# sourceMappingURL=analysis-picking-packing-report.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analysis-picking-packing-report.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/reports/analysis-picking-packing-report.ts"],"names":[],"mappings":";;;AAEA,uDAAmD;AAMnD,0CAAiD;AAEpC,QAAA,4BAA4B,GAAG;IAC1C,KAAK,CAAC,4BAA4B,CAAC,CAAM,EAAE,MAAiB,EAAE,OAAY;QACxE,IAAI;YACF,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,GAA0C,OAAO,CAAC,KAAK,CAAA;YAC3E,IAAI,QAAQ,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,IAAsB,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,UAAU,CAAC,CAAA;YACxF,IAAI,QAAQ,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,IAAsB,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,IAAI,UAAU,CAAC,CAAA;YACvF,IAAI,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,IAAsB,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,IAAI,QAAQ,CAAC,CAAA;YACnF,IAAI,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,IAAsB,EAAE,EAAE,CAAC,IAAI,CAAC,IAA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C,GAAG,CAAC;4BACZ,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC;4BACd,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC;4BACd,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC;4BACd,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC;4BACd,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC;4BACd,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC;4BACd,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC;4BACd,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC;4BACd,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC;yBACf,CAAC,IACH;gBACH,CAAC,CAAC;gBACF,KAAK,EAAE,MAAM,CAAC,MAAM;aACrB,CAAA;SAEF;QAAC,OAAO,KAAK,EAAE;YACd,MAAM,KAAK,CAAA;SACZ;IACH,CAAC;CACF,CAAA"}
@@ -1,14 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Query = void 0;
4
- const inbound_serial_number_report_1 = require("./inbound-serial-number-report");
5
- const outbound_serial_number_report_1 = require("./outbound-serial-number-report");
4
+ const analysis_picking_packing_report_1 = require("./analysis-picking-packing-report");
6
5
  const costing_report_1 = require("./costing-report");
7
6
  const inbound_order_details_report_1 = require("./inbound-order-details-report");
7
+ const inbound_serial_number_report_1 = require("./inbound-serial-number-report");
8
8
  const outbound_order_details_report_1 = require("./outbound-order-details-report");
9
+ const outbound_serial_number_report_1 = require("./outbound-serial-number-report");
9
10
  const product_label_report_1 = require("./product-label-report");
10
11
  const release_inventory_report_1 = require("./release-inventory-report");
12
+ const shortage_report_1 = require("./shortage-report");
11
13
  const tote_loading_qc_report_1 = require("./tote-loading-qc-report");
12
14
  const vas_report_1 = require("./vas-report");
13
- exports.Query = 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), tote_loading_qc_report_1.loadingQcReport), vas_report_1.orderVasReport), vas_report_1.vasReport);
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);
14
16
  //# 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;AAE5E,qDAAgD;AAChD,iFAA0E;AAC1E,mFAA4E;AAC5E,iEAA2D;AAC3D,yEAAmE;AACnE,qEAA0D;AAC1D,6CAAwD;AAE3C,QAAA,KAAK,mJACb,wDAAyB,GACzB,0DAA0B,GAC1B,8BAAa,GACb,wDAAyB,GACzB,0DAA0B,GAC1B,yCAAkB,GAClB,iDAAsB,GACtB,wCAAe,GACf,2BAAc,GACd,sBAAS,EACb"}
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,+KACb,wDAAyB,GACzB,0DAA0B,GAC1B,8BAAa,GACb,wDAAyB,GACzB,0DAA0B,GAC1B,yCAAkB,GAClB,iDAAsB,GACtB,gCAAc,GACd,wCAAe,GACf,2BAAc,GACd,sBAAS,GACT,8DAA4B,EAChC"}