@things-factory/operato-wms 4.3.301 → 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.
- package/client/pages/inventory/onhand-inventory.js +23 -19
- package/client/pages/outbound/route-label-popup.js +56 -3
- package/client/pages/report/outbound-order-details-report.js +1 -0
- package/client/pages/report/shortage-report.js +475 -0
- package/client/route.js +4 -0
- package/dist-server/graphql/resolvers/reports/index.js +2 -1
- package/dist-server/graphql/resolvers/reports/index.js.map +1 -1
- package/dist-server/graphql/resolvers/reports/shortage-report.js +115 -0
- package/dist-server/graphql/resolvers/reports/shortage-report.js.map +1 -0
- package/dist-server/graphql/types/reports/index.js +5 -0
- package/dist-server/graphql/types/reports/index.js.map +1 -1
- package/dist-server/graphql/types/reports/shortage-report-list.js +14 -0
- package/dist-server/graphql/types/reports/shortage-report-list.js.map +1 -0
- package/dist-server/graphql/types/reports/shortage-report-type.js +25 -0
- package/dist-server/graphql/types/reports/shortage-report-type.js.map +1 -0
- package/package.json +5 -5
- package/server/graphql/resolvers/reports/index.ts +6 -1
- package/server/graphql/resolvers/reports/shortage-report.ts +132 -0
- package/server/graphql/types/reports/index.ts +13 -2
- package/server/graphql/types/reports/shortage-report-list.ts +8 -0
- package/server/graphql/types/reports/shortage-report-type.ts +19 -0
- package/things-factory.config.js +6 -0
- package/translations/en.json +1 -0
- package/translations/ko.json +1 -0
- package/translations/ms.json +1 -0
- package/translations/zh.json +1 -0
|
@@ -2,14 +2,27 @@ 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
11
|
import { getCodeByName } from '@things-factory/code-base'
|
|
9
|
-
import {
|
|
10
|
-
|
|
12
|
+
import {
|
|
13
|
+
i18next,
|
|
14
|
+
localize
|
|
15
|
+
} from '@things-factory/i18n-base'
|
|
16
|
+
import {
|
|
17
|
+
client,
|
|
18
|
+
PageView,
|
|
19
|
+
store
|
|
20
|
+
} from '@things-factory/shell'
|
|
11
21
|
import { ScrollbarStyles } from '@things-factory/styles'
|
|
12
|
-
import {
|
|
22
|
+
import {
|
|
23
|
+
flattenObject,
|
|
24
|
+
isMobileDevice
|
|
25
|
+
} from '@things-factory/utils'
|
|
13
26
|
|
|
14
27
|
class OnhandInventory extends connect(store)(localize(i18next)(PageView)) {
|
|
15
28
|
static get styles() {
|
|
@@ -423,6 +436,7 @@ class OnhandInventory extends connect(store)(localize(i18next)(PageView)) {
|
|
|
423
436
|
packingType
|
|
424
437
|
uom
|
|
425
438
|
uomValue
|
|
439
|
+
expiry
|
|
426
440
|
bizplace {
|
|
427
441
|
id
|
|
428
442
|
name
|
|
@@ -435,6 +449,8 @@ class OnhandInventory extends connect(store)(localize(i18next)(PageView)) {
|
|
|
435
449
|
brand
|
|
436
450
|
description
|
|
437
451
|
volume
|
|
452
|
+
outboundAlert
|
|
453
|
+
minOutboundShelfLife
|
|
438
454
|
}
|
|
439
455
|
qty
|
|
440
456
|
remainQty
|
|
@@ -481,6 +497,9 @@ class OnhandInventory extends connect(store)(localize(i18next)(PageView)) {
|
|
|
481
497
|
}
|
|
482
498
|
})
|
|
483
499
|
|
|
500
|
+
// Logging response for debugging
|
|
501
|
+
console.log(response);
|
|
502
|
+
|
|
484
503
|
return {
|
|
485
504
|
total: response.data.onhandInventories.total || 0,
|
|
486
505
|
records:
|
|
@@ -496,7 +515,6 @@ class OnhandInventory extends connect(store)(localize(i18next)(PageView)) {
|
|
|
496
515
|
volume: parseFloat(item.product.volume * item.remainQty).toFixed(2),
|
|
497
516
|
// Need to move to serverside processing and fetch with db query for consistent performance
|
|
498
517
|
condition: this.getCondition(item.location.type),
|
|
499
|
-
expiry: this.getStatus(item.expirationDate)
|
|
500
518
|
// Need to move to serverside processing and fetch with db query for consistent performance
|
|
501
519
|
},
|
|
502
520
|
'_'
|
|
@@ -520,23 +538,9 @@ class OnhandInventory extends connect(store)(localize(i18next)(PageView)) {
|
|
|
520
538
|
return 'Damage'
|
|
521
539
|
case 'QUARANTINE':
|
|
522
540
|
return 'Quarantine'
|
|
523
|
-
default:
|
|
524
|
-
return ''
|
|
525
541
|
}
|
|
526
542
|
}
|
|
527
543
|
|
|
528
|
-
getStatus(exp_date, outbound_alert, min_outbound_shelf_life) {
|
|
529
|
-
const now = new Date()
|
|
530
|
-
if (exp_date < now) {
|
|
531
|
-
return 'Expired'
|
|
532
|
-
} else if (exp_date > outbound_alert) {
|
|
533
|
-
return 'Expiring'
|
|
534
|
-
} else if (exp_date >= outbound_alert && exp_date <= min_outbound_shelf_life) {
|
|
535
|
-
return 'Risky'
|
|
536
|
-
} else {
|
|
537
|
-
return 'Normal'
|
|
538
|
-
}
|
|
539
|
-
}
|
|
540
544
|
// Need to move to serverside processing and fetch with db query for consistent performance
|
|
541
545
|
|
|
542
546
|
async _fetchPartners() {
|
|
@@ -178,6 +178,7 @@ class RouteLabelPopup extends connect(store)(localize(i18next)(LitElement)) {
|
|
|
178
178
|
.mode=${isMobileDevice() ? 'LIST' : 'GRID'}
|
|
179
179
|
.config=${this.config}
|
|
180
180
|
.fetchHandler=${this.fetchHandler.bind(this)}
|
|
181
|
+
@field-change="${this._packingSizeChange.bind(this)}"
|
|
181
182
|
></data-grist>
|
|
182
183
|
</div>
|
|
183
184
|
|
|
@@ -241,6 +242,38 @@ class RouteLabelPopup extends connect(store)(localize(i18next)(LitElement)) {
|
|
|
241
242
|
sortable: true,
|
|
242
243
|
width: 150
|
|
243
244
|
},
|
|
245
|
+
{
|
|
246
|
+
type: 'select',
|
|
247
|
+
name: 'packingType',
|
|
248
|
+
header: i18next.t('field.packing_type'),
|
|
249
|
+
record: {
|
|
250
|
+
options: [''],
|
|
251
|
+
editable: true
|
|
252
|
+
},
|
|
253
|
+
handlers: {
|
|
254
|
+
click: (columns, data, column, record, rowIndex) => {
|
|
255
|
+
if (
|
|
256
|
+
!record ||
|
|
257
|
+
JSON.stringify(this.dataGrist._config.columns.find(c => c.name === 'packingType').record.options) ===
|
|
258
|
+
JSON.stringify(record.productDetails.map(item => item.packingType))
|
|
259
|
+
) {
|
|
260
|
+
return
|
|
261
|
+
}
|
|
262
|
+
this.dataGrist._config.columns
|
|
263
|
+
.filter(c => c.name === 'packingType')
|
|
264
|
+
.map(items => (items.record.options = record.productDetails.map(pd => pd.packingType)))
|
|
265
|
+
this.dataGrist.render()
|
|
266
|
+
}
|
|
267
|
+
},
|
|
268
|
+
sortable: true,
|
|
269
|
+
width: 150
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
type: 'integer',
|
|
273
|
+
name: 'packingSize',
|
|
274
|
+
header: i18next.t('field.packing_size'),
|
|
275
|
+
width: 150
|
|
276
|
+
},
|
|
244
277
|
{
|
|
245
278
|
type: 'integer',
|
|
246
279
|
name: 'releaseQty',
|
|
@@ -322,6 +355,14 @@ class RouteLabelPopup extends connect(store)(localize(i18next)(LitElement)) {
|
|
|
322
355
|
productName
|
|
323
356
|
releaseQty
|
|
324
357
|
releaseGoodName
|
|
358
|
+
productDetails {
|
|
359
|
+
packingType
|
|
360
|
+
packingSize
|
|
361
|
+
}
|
|
362
|
+
productDetail {
|
|
363
|
+
packingType
|
|
364
|
+
packingSize
|
|
365
|
+
}
|
|
325
366
|
routeId
|
|
326
367
|
storeId
|
|
327
368
|
storeName
|
|
@@ -354,7 +395,9 @@ class RouteLabelPopup extends connect(store)(localize(i18next)(LitElement)) {
|
|
|
354
395
|
...itm,
|
|
355
396
|
roName: itm.releaseGoodName,
|
|
356
397
|
productSku: itm.productSKU,
|
|
357
|
-
createdAt: createdAt
|
|
398
|
+
createdAt: createdAt,
|
|
399
|
+
packingType: itm.productDetail.packingType,
|
|
400
|
+
packingSize: itm.productDetail.packingSize
|
|
358
401
|
}
|
|
359
402
|
}) || {}
|
|
360
403
|
})
|
|
@@ -364,6 +407,16 @@ class RouteLabelPopup extends connect(store)(localize(i18next)(LitElement)) {
|
|
|
364
407
|
}
|
|
365
408
|
}
|
|
366
409
|
|
|
410
|
+
async _packingSizeChange(e) {
|
|
411
|
+
const selectedColumn = e.detail.column.name
|
|
412
|
+
|
|
413
|
+
if (selectedColumn === 'packingType') {
|
|
414
|
+
this.dataGrist._data.records[e.detail.row].packingSize = e.detail.record.productDetails.find(
|
|
415
|
+
item => item.packingType == e.detail.after
|
|
416
|
+
).packingSize
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
|
|
367
420
|
async _printRouteLabel() {
|
|
368
421
|
const records = this.dataGrist.selected
|
|
369
422
|
let labelId = this._routeLabel && this._routeLabel.id
|
|
@@ -379,7 +432,7 @@ class RouteLabelPopup extends connect(store)(localize(i18next)(LitElement)) {
|
|
|
379
432
|
} else {
|
|
380
433
|
let index = 1
|
|
381
434
|
for (var record of records) {
|
|
382
|
-
let max = record.releaseQty ? record.releaseQty : 1
|
|
435
|
+
let max = record.releaseQty ? record.releaseQty / record.packingSize : 1
|
|
383
436
|
for (let qty = 1; qty <= max; qty++) {
|
|
384
437
|
var searchParams = new URLSearchParams()
|
|
385
438
|
|
|
@@ -391,7 +444,7 @@ class RouteLabelPopup extends connect(store)(localize(i18next)(LitElement)) {
|
|
|
391
444
|
if (!record?.toteNumber) {
|
|
392
445
|
searchParams.append('qty', record.qty)
|
|
393
446
|
searchParams.append('releaseQty', record.releaseQty)
|
|
394
|
-
searchParams.append('counter', `${qty} of ${
|
|
447
|
+
searchParams.append('counter', `${qty} of ${max}`)
|
|
395
448
|
searchParams.append('productSku', record.productSku)
|
|
396
449
|
searchParams.append('productName', record.productName)
|
|
397
450
|
} else {
|
|
@@ -963,6 +963,7 @@ class OutboundOrderDetailsReport extends connect(store)(localize(i18next)(PageVi
|
|
|
963
963
|
{ header: i18next.t('field.remark_checked_at'), key: 'checkedRemarkAt', width: 15, type: 'string' },
|
|
964
964
|
{ header: i18next.t('field.loaded_by'), key: 'loadedBy', width: 15, type: 'string' },
|
|
965
965
|
{ header: i18next.t('field.loaded_at'), key: 'loadedAt', width: 15, type: 'string' },
|
|
966
|
+
{ header: i18next.t('field.picking_bin'), key: 'binLocation', width: 15, type: 'string' },
|
|
966
967
|
{ header: i18next.t('field.manifested_by'), key: 'manifestedBy', width: 15, type: 'string' },
|
|
967
968
|
{ header: i18next.t('field.manifested_at'), key: 'manifestedAt', width: 15, type: 'string' },
|
|
968
969
|
{ header: i18next.t('field.dispatched_at'), key: 'dispatchedAt', width: 15, type: 'string' }
|
|
@@ -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,10 @@ 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
|
+
|
|
500
504
|
case 'analysis_picking_packing_report':
|
|
501
505
|
import('./pages/report/analysis-picking-packing-report')
|
|
502
506
|
return page
|
|
@@ -9,7 +9,8 @@ const outbound_order_details_report_1 = require("./outbound-order-details-report
|
|
|
9
9
|
const outbound_serial_number_report_1 = require("./outbound-serial-number-report");
|
|
10
10
|
const product_label_report_1 = require("./product-label-report");
|
|
11
11
|
const release_inventory_report_1 = require("./release-inventory-report");
|
|
12
|
+
const shortage_report_1 = require("./shortage-report");
|
|
12
13
|
const tote_loading_qc_report_1 = require("./tote-loading-qc-report");
|
|
13
14
|
const vas_report_1 = require("./vas-report");
|
|
14
|
-
exports.Query = 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), tote_loading_qc_report_1.loadingQcReport), vas_report_1.orderVasReport), vas_report_1.vasReport), analysis_picking_packing_report_1.analysisPickingPackingReport);
|
|
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);
|
|
15
16
|
//# 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,qEAA0D;AAC1D,
|
|
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"}
|
|
@@ -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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"}
|
|
@@ -19,6 +19,8 @@ const product_label_report_1 = require("./product-label-report");
|
|
|
19
19
|
const product_label_report_list_1 = require("./product-label-report-list");
|
|
20
20
|
const release_inventory_report_1 = require("./release-inventory-report");
|
|
21
21
|
const release_inventory_report_list_1 = require("./release-inventory-report-list");
|
|
22
|
+
const shortage_report_list_1 = require("./shortage-report-list");
|
|
23
|
+
const shortage_report_type_1 = require("./shortage-report-type");
|
|
22
24
|
const vas_report_1 = require("./vas-report");
|
|
23
25
|
const vas_report_list_1 = require("./vas-report-list");
|
|
24
26
|
exports.Query = `
|
|
@@ -29,6 +31,7 @@ exports.Query = `
|
|
|
29
31
|
productLabelReport(filters: [Filter!], pagination: Pagination, sortings: [Sorting!]): ProductLabelReportList @transaction
|
|
30
32
|
costingReport(filters: [Filter!], pagination: Pagination, sortings: [Sorting!]): CostingReportList @transaction
|
|
31
33
|
releaseInventoryReport(filters: [Filter!], pagination: Pagination, sortings: [Sorting!]): ReleaseInventoryReportList @transaction
|
|
34
|
+
shortageReport(filters: [Filter!], pagination: Pagination, sortings: [Sorting!]):ShortageReportList @transaction
|
|
32
35
|
loadingQcReport(filters: [Filter!], pagination: Pagination, sortings: [Sorting!]): [LoadingQcReport] @transaction
|
|
33
36
|
orderVasReport(filters: [Filter!], pagination: Pagination, sortings: [Sorting!]): OrderVasReportList @transaction
|
|
34
37
|
vasReport(filters: [Filter!], pagination: Pagination, sortings: [Sorting!]): OrderVasReportList @transaction
|
|
@@ -49,6 +52,8 @@ exports.Types = [
|
|
|
49
52
|
costing_report_list_1.CostingReportList,
|
|
50
53
|
release_inventory_report_1.ReleaseInventoryReport,
|
|
51
54
|
release_inventory_report_list_1.ReleaseInventoryReportList,
|
|
55
|
+
shortage_report_type_1.ShortageReport,
|
|
56
|
+
shortage_report_list_1.ShortageReportList,
|
|
52
57
|
loading_qc_report_1.LoadingQcReport,
|
|
53
58
|
loading_qc_report_list_1.LoadingQcReportList,
|
|
54
59
|
vas_report_1.OrderVasReport,
|
|
@@ -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,
|
|
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;;;;;;;;;;;;;CAapB,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;CACjC,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"}
|
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.302",
|
|
4
4
|
"main": "dist-server/index.js",
|
|
5
5
|
"browser": "client/index.js",
|
|
6
6
|
"things-factory": true,
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
"@things-factory/print-ui": "^4.3.281",
|
|
92
92
|
"@things-factory/product-base": "^4.3.301",
|
|
93
93
|
"@things-factory/resource-ui": "^4.3.281",
|
|
94
|
-
"@things-factory/sales-ui": "^4.3.
|
|
94
|
+
"@things-factory/sales-ui": "^4.3.302",
|
|
95
95
|
"@things-factory/scene-data-transform": "^4.3.281",
|
|
96
96
|
"@things-factory/scene-excel": "^4.3.281",
|
|
97
97
|
"@things-factory/scene-firebase": "^4.3.281",
|
|
@@ -107,8 +107,8 @@
|
|
|
107
107
|
"@things-factory/system-ui": "^4.3.281",
|
|
108
108
|
"@things-factory/transport-base": "^4.3.301",
|
|
109
109
|
"@things-factory/tutorial-ui": "^4.3.281",
|
|
110
|
-
"@things-factory/warehouse-base": "^4.3.
|
|
111
|
-
"@things-factory/worksheet-base": "^4.3.
|
|
110
|
+
"@things-factory/warehouse-base": "^4.3.302",
|
|
111
|
+
"@things-factory/worksheet-base": "^4.3.302"
|
|
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": "6fe836d24b5a0ba58a9e77f48a32e990865e1a97"
|
|
121
121
|
}
|
|
@@ -6,8 +6,12 @@ import { outboundOrderDetailsReport } from './outbound-order-details-report'
|
|
|
6
6
|
import { outboundSerialNumberReport } from './outbound-serial-number-report'
|
|
7
7
|
import { productLabelReport } from './product-label-report'
|
|
8
8
|
import { releaseInventoryReport } from './release-inventory-report'
|
|
9
|
+
import { shortageReport } from './shortage-report'
|
|
9
10
|
import { loadingQcReport } from './tote-loading-qc-report'
|
|
10
|
-
import {
|
|
11
|
+
import {
|
|
12
|
+
orderVasReport,
|
|
13
|
+
vasReport
|
|
14
|
+
} from './vas-report'
|
|
11
15
|
|
|
12
16
|
export const Query = {
|
|
13
17
|
...inboundSerialNumberReport,
|
|
@@ -17,6 +21,7 @@ export const Query = {
|
|
|
17
21
|
...outboundOrderDetailsReport,
|
|
18
22
|
...productLabelReport,
|
|
19
23
|
...releaseInventoryReport,
|
|
24
|
+
...shortageReport,
|
|
20
25
|
...loadingQcReport,
|
|
21
26
|
...orderVasReport,
|
|
22
27
|
...vasReport,
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { EntityManager } from 'typeorm'
|
|
2
|
+
|
|
3
|
+
import { ListParam } from '@things-factory/shell'
|
|
4
|
+
|
|
5
|
+
export const shortageReport = {
|
|
6
|
+
async shortageReport(_: any, params: ListParam, context: any) {
|
|
7
|
+
try {
|
|
8
|
+
const { tx }: { tx: EntityManager } = context.state
|
|
9
|
+
let bizplaceFilter = { name: '', operator: '', value: '' }
|
|
10
|
+
let order = params.filters.find(items => items.name === 'order')
|
|
11
|
+
let fromDate = params.filters.find(items => items.name === 'fromDate')
|
|
12
|
+
let toDate = params.filters.find(items => items.name === 'toDate')
|
|
13
|
+
let orderNo = params.filters.find(items => items.name === 'orderNo')
|
|
14
|
+
let product = params.filters.find(items => items.name === 'product')
|
|
15
|
+
let bizplace = params.filters.find(items => items.name === 'bizplace')
|
|
16
|
+
|
|
17
|
+
if (!bizplace) throw 'Invalid input'
|
|
18
|
+
|
|
19
|
+
let roFilter = '',
|
|
20
|
+
queryFilter = ''
|
|
21
|
+
|
|
22
|
+
if (product) {
|
|
23
|
+
let productInfoValue = product.value
|
|
24
|
+
.toLowerCase()
|
|
25
|
+
.split(',')
|
|
26
|
+
.map(prod => {
|
|
27
|
+
return "'%" + prod.trim().replace(/'/g, "''") + "%'"
|
|
28
|
+
})
|
|
29
|
+
.join(',')
|
|
30
|
+
|
|
31
|
+
roFilter += `AND (
|
|
32
|
+
Lower(drg.name) LIKE ANY(ARRAY[${productInfoValue}])
|
|
33
|
+
OR Lower(p.sku) LIKE ANY(ARRAY[${productInfoValue}])
|
|
34
|
+
OR Lower(p.sku) LIKE ANY(ARRAY[${productInfoValue}])
|
|
35
|
+
OR Lower(p.sku) LIKE ANY(ARRAY[${productInfoValue}])
|
|
36
|
+
OR Lower(p."name") LIKE ANY(ARRAY[${productInfoValue}])
|
|
37
|
+
OR Lower(p."name") LIKE ANY(ARRAY[${productInfoValue}])
|
|
38
|
+
OR Lower(p."name") LIKE ANY(ARRAY[${productInfoValue}])
|
|
39
|
+
|
|
40
|
+
)`
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if (orderNo) {
|
|
44
|
+
let orderValue = orderNo.value
|
|
45
|
+
.toLowerCase()
|
|
46
|
+
.split(',')
|
|
47
|
+
.map(prod => {
|
|
48
|
+
return "'%" + prod.trim().replace(/'/g, "''") + "%'"
|
|
49
|
+
})
|
|
50
|
+
.join(',')
|
|
51
|
+
|
|
52
|
+
roFilter += `AND (
|
|
53
|
+
Lower(drg.name) LIKE ANY(ARRAY[${orderValue}])
|
|
54
|
+
OR Lower(drg.ref_no) LIKE ANY(ARRAY[${orderValue}])
|
|
55
|
+
OR Lower(drg.ref_no_2) LIKE ANY(ARRAY[${orderValue}])
|
|
56
|
+
OR Lower(drg.ref_no_3) LIKE ANY(ARRAY[${orderValue}])
|
|
57
|
+
)`
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
if (bizplace) {
|
|
61
|
+
queryFilter += ` AND drg.bizplace_id = '${bizplace.value}'`
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
if (!bizplaceFilter || !fromDate || !toDate) throw 'Invalid input'
|
|
65
|
+
|
|
66
|
+
await tx.query(
|
|
67
|
+
`
|
|
68
|
+
create temp table shortage_report on commit drop as (
|
|
69
|
+
select b."name" as "company", drg.name as "order_no",drg.ref_no, p.sku as "product_sku", p."name" as "product_name", op.release_qty as "order_quantity",
|
|
70
|
+
coalesce(src.av_qty,0) as available_qty, coalesce(src.av_qty - op.release_qty,0)as "Nett_Stock",
|
|
71
|
+
concat(drg.delivery_address_1, ' ', drg.delivery_address_2, ' ', drg.delivery_address_3, ' ', drg.delivery_address_4, ' ', drg.delivery_address_5) as "delivery_address",
|
|
72
|
+
drg.state,drg.city, drg.country, drg.created_at
|
|
73
|
+
from draft_release_goods drg
|
|
74
|
+
inner join bizplaces b on b.id = drg.bizplace_id
|
|
75
|
+
inner join order_products op on op.draft_release_good_id = drg.id
|
|
76
|
+
inner join products p on p.id = op.product_id
|
|
77
|
+
left join (
|
|
78
|
+
select product_id, sum(qty - locked_qty)as "av_qty" from inventories i where i.domain_id = $1
|
|
79
|
+
group by product_id ) src
|
|
80
|
+
on op.product_id = src.product_id
|
|
81
|
+
where drg.status = 'DRAFT'
|
|
82
|
+
and drg.domain_id = $1
|
|
83
|
+
and coalesce(src.av_qty - op.release_qty,0) < 0
|
|
84
|
+
and drg.created_at >= $2
|
|
85
|
+
and drg.created_at <= $3
|
|
86
|
+
${roFilter}
|
|
87
|
+
${queryFilter}
|
|
88
|
+
order by drg.created_at desc
|
|
89
|
+
);
|
|
90
|
+
`,
|
|
91
|
+
[context.state.domain.id, fromDate.value, toDate.value]
|
|
92
|
+
)
|
|
93
|
+
|
|
94
|
+
const total: any = await tx.query(`
|
|
95
|
+
select count(*) from shortage_report
|
|
96
|
+
`)
|
|
97
|
+
|
|
98
|
+
const result: any = await tx.query(
|
|
99
|
+
`
|
|
100
|
+
select * from shortage_report
|
|
101
|
+
offset $1 limit $2
|
|
102
|
+
`,
|
|
103
|
+
[(params.pagination.page - 1) * params.pagination.limit, params.pagination.limit]
|
|
104
|
+
)
|
|
105
|
+
|
|
106
|
+
let items = result.map(itm => {
|
|
107
|
+
return{
|
|
108
|
+
bizplaceName: itm.company,
|
|
109
|
+
orderNo: itm.order_no,
|
|
110
|
+
refNo:itm.ref_no,
|
|
111
|
+
productSku: itm.product_sku,
|
|
112
|
+
productName: itm.product_name,
|
|
113
|
+
orderQty:itm.order_quantity,
|
|
114
|
+
avQty:itm.available_qty,
|
|
115
|
+
nettStock:itm.Nett_Stock,
|
|
116
|
+
deliveryAddress:itm.delivery_address,
|
|
117
|
+
state:itm.state,
|
|
118
|
+
city:itm.city,
|
|
119
|
+
country:itm.country,
|
|
120
|
+
createdAt:itm.created_at
|
|
121
|
+
}
|
|
122
|
+
})
|
|
123
|
+
|
|
124
|
+
return {
|
|
125
|
+
items,
|
|
126
|
+
total: total[0].count
|
|
127
|
+
}
|
|
128
|
+
} catch (error) {
|
|
129
|
+
throw error
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
@@ -16,8 +16,16 @@ import { ProductLabelReport } from './product-label-report'
|
|
|
16
16
|
import { ProductLabelReportList } from './product-label-report-list'
|
|
17
17
|
import { ReleaseInventoryReport } from './release-inventory-report'
|
|
18
18
|
import { ReleaseInventoryReportList } from './release-inventory-report-list'
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
19
|
+
import { ShortageReportList } from './shortage-report-list'
|
|
20
|
+
import { ShortageReport } from './shortage-report-type'
|
|
21
|
+
import {
|
|
22
|
+
OrderVasReport,
|
|
23
|
+
VasReport
|
|
24
|
+
} from './vas-report'
|
|
25
|
+
import {
|
|
26
|
+
OrderVasReportList,
|
|
27
|
+
VasReportList
|
|
28
|
+
} from './vas-report-list'
|
|
21
29
|
|
|
22
30
|
export const Query = `
|
|
23
31
|
inboundSerialNumberReport(filters: [Filter!], pagination: Pagination, sortings: [Sorting!]): InboundSerialNumberReportList @transaction
|
|
@@ -27,6 +35,7 @@ export const Query = `
|
|
|
27
35
|
productLabelReport(filters: [Filter!], pagination: Pagination, sortings: [Sorting!]): ProductLabelReportList @transaction
|
|
28
36
|
costingReport(filters: [Filter!], pagination: Pagination, sortings: [Sorting!]): CostingReportList @transaction
|
|
29
37
|
releaseInventoryReport(filters: [Filter!], pagination: Pagination, sortings: [Sorting!]): ReleaseInventoryReportList @transaction
|
|
38
|
+
shortageReport(filters: [Filter!], pagination: Pagination, sortings: [Sorting!]):ShortageReportList @transaction
|
|
30
39
|
loadingQcReport(filters: [Filter!], pagination: Pagination, sortings: [Sorting!]): [LoadingQcReport] @transaction
|
|
31
40
|
orderVasReport(filters: [Filter!], pagination: Pagination, sortings: [Sorting!]): OrderVasReportList @transaction
|
|
32
41
|
vasReport(filters: [Filter!], pagination: Pagination, sortings: [Sorting!]): OrderVasReportList @transaction
|
|
@@ -48,6 +57,8 @@ export const Types = [
|
|
|
48
57
|
CostingReportList,
|
|
49
58
|
ReleaseInventoryReport,
|
|
50
59
|
ReleaseInventoryReportList,
|
|
60
|
+
ShortageReport,
|
|
61
|
+
ShortageReportList,
|
|
51
62
|
LoadingQcReport,
|
|
52
63
|
LoadingQcReportList,
|
|
53
64
|
OrderVasReport,
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import gql from 'graphql-tag'
|
|
2
|
+
|
|
3
|
+
export const ShortageReport = gql`
|
|
4
|
+
type ShortageReport {
|
|
5
|
+
bizplaceName: String
|
|
6
|
+
orderNo: String
|
|
7
|
+
refNo: String
|
|
8
|
+
productSku: String
|
|
9
|
+
productName: String
|
|
10
|
+
orderQty: String
|
|
11
|
+
avQty: String
|
|
12
|
+
nettStock: String
|
|
13
|
+
deliveryAddress: String
|
|
14
|
+
state: String
|
|
15
|
+
city: String
|
|
16
|
+
country: String
|
|
17
|
+
createdAt: Date
|
|
18
|
+
}
|
|
19
|
+
`
|
package/things-factory.config.js
CHANGED
|
@@ -43,6 +43,8 @@ export default {
|
|
|
43
43
|
tagname: 'tote-list',
|
|
44
44
|
page: 'totes'
|
|
45
45
|
},
|
|
46
|
+
|
|
47
|
+
|
|
46
48
|
|
|
47
49
|
/**
|
|
48
50
|
* Order Menus Section
|
|
@@ -512,6 +514,10 @@ export default {
|
|
|
512
514
|
tagname: 'vas-report',
|
|
513
515
|
page: 'vas_report'
|
|
514
516
|
},
|
|
517
|
+
{
|
|
518
|
+
tagname:'shortage-report',
|
|
519
|
+
page:'shortage_report'
|
|
520
|
+
},
|
|
515
521
|
{
|
|
516
522
|
tagname: 'analysis-picking-packing-report',
|
|
517
523
|
page: 'analysis_picking_packing_report'
|
package/translations/en.json
CHANGED
|
@@ -388,6 +388,7 @@
|
|
|
388
388
|
"field.name": "name",
|
|
389
389
|
"field.need_fleet": "need fleet",
|
|
390
390
|
"field.need_transport": "need transport",
|
|
391
|
+
"field.nett_stock":"nett stock",
|
|
391
392
|
"field.nett_weight": "nett weight",
|
|
392
393
|
"field.new_sku_same_as_original_sku": "new SKU same as original SKU",
|
|
393
394
|
"field.new_sku": "new SKU",
|
package/translations/ko.json
CHANGED
package/translations/ms.json
CHANGED
|
@@ -375,6 +375,7 @@
|
|
|
375
375
|
"field.name": "nama",
|
|
376
376
|
"field.need_fleet": "keperluan armada",
|
|
377
377
|
"field.need_transport": "kenderaan diperlukan",
|
|
378
|
+
"field.nett_stock":"[ms]nett stock",
|
|
378
379
|
"field.nett_weight": "[ms]nett weight",
|
|
379
380
|
"field.no_of_items": "[ms] no of items",
|
|
380
381
|
"field.no": "[ms]no",
|
package/translations/zh.json
CHANGED
|
@@ -359,6 +359,7 @@
|
|
|
359
359
|
"field.name": "名称",
|
|
360
360
|
"field.need_fleet": "需要车队",
|
|
361
361
|
"field.need_transport": "[zh]need transport",
|
|
362
|
+
"field.nett_stock":"[zh]nett stock",
|
|
362
363
|
"field.nett_weight": "[zh]nett weight",
|
|
363
364
|
"field.no": "[zh]no",
|
|
364
365
|
"field.non_tally": "[zh]non tally",
|