@things-factory/operato-wms 4.0.36 → 4.0.40
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/bootstrap.js +24 -1
- package/client/pages/bulk-operation/bulk-operation.js +4 -3
- package/client/pages/bulk-operation/validate-gan-popup.js +10 -2
- package/client/pages/bulk-operation/validate-ro-popup.js +3 -5
- package/client/pages/components/popup-reusable-pallet.js +8 -1
- package/client/pages/components/worksheet-information-popup.js +1 -1
- package/client/pages/inbound/putaway-product.js +45 -38
- package/client/pages/inbound/unload-product.js +36 -43
- package/client/pages/inventory/inventory-adjustment.js +22 -26
- package/client/pages/inventory/inventory-by-product.js +0 -12
- package/client/pages/manifest/create-loading-manifest.js +1 -1
- package/client/pages/manifest/loading-manifest-list.js +3 -3
- package/client/pages/order/arrival-notice/assign-buffer-location.js +24 -9
- package/client/pages/order/arrival-notice/create-arrival-notice.js +1 -1
- package/client/pages/order/release-order/b2b/b2b-order-list.js +12 -1
- package/client/pages/order/release-order/b2c/b2c-order-requests.js +55 -3
- package/client/pages/order/release-order/create-release-order.js +14 -0
- package/client/pages/order/release-order/release-order-detail.js +2 -1
- package/client/pages/order/reverse-kitting-order/reverse-kitting-order-detail.js +21 -45
- package/client/pages/order/transport-order/contact-point-selector-popup.js +11 -10
- package/client/pages/outbound/picking-product.js +226 -231
- package/client/pages/outbound/show-ro-list-popup.js +1 -1
- package/client/pages/outbound/single-outbound-worksheet.js +3 -3
- package/client/pages/outbound/sorting-product.js +23 -27
- package/client/pages/outbound/worksheet-picking.js +1 -1
- package/client/pages/report/custom-elccl/elccl-daily-order-inventory-report.js +5 -1
- package/client/pages/report/custom-elccl/elccl-delivery-order-summary.js +1 -1
- package/client/pages/report/custom-elccl/elccl-inventory-report.js +13 -1
- package/client/pages/report/inventory-report.js +1 -0
- package/client/pages/report/product-label-report.js +0 -39
- package/client/pages/vas/reverse-kitting/popup-combination-sets.js +1 -1
- package/helps/release-note.ko.md +3 -0
- package/helps/release-note.md +3 -0
- package/helps/release-note.ms.md +3 -0
- package/helps/release-note.zh.md +3 -0
- package/package.json +65 -65
- package/translations/en.json +15 -6
- package/translations/ko.json +12 -3
- package/translations/ms.json +12 -3
- package/translations/zh.json +12 -3
package/client/bootstrap.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import '@things-factory/barcode-base'
|
|
2
2
|
import '@things-factory/notification'
|
|
3
|
+
import '@things-factory/system-ui'
|
|
3
4
|
|
|
4
5
|
import gql from 'graphql-tag'
|
|
5
6
|
import { html } from 'lit-element'
|
|
@@ -8,12 +9,14 @@ import { registerDefaultGroups } from '@operato/board/register-default-groups.js
|
|
|
8
9
|
import { APPEND_APP_TOOL } from '@things-factory/apptool-base'
|
|
9
10
|
import { auth } from '@things-factory/auth-base'
|
|
10
11
|
import { setAuthManagementMenus } from '@things-factory/auth-ui'
|
|
11
|
-
import {
|
|
12
|
+
import { i18next } from '@things-factory/i18n-base'
|
|
13
|
+
import { appendViewpart, openPopup, toggleOverlay, TOOL_POSITION, VIEWPART_POSITION } from '@things-factory/layout-base'
|
|
12
14
|
import { updateMenuProvider } from '@things-factory/menu-base'
|
|
13
15
|
import { USE_ROLE_BY_MENUS_MANAGEMENT } from '@things-factory/menu-base/client/actions/menu'
|
|
14
16
|
import { ADD_MORENDA } from '@things-factory/more-base'
|
|
15
17
|
import { ADD_REFRESH_HANDLER, ADD_SETTING } from '@things-factory/setting-base'
|
|
16
18
|
import { client, navigate, store, UPDATE_BASE_URL } from '@things-factory/shell'
|
|
19
|
+
import { ReleaseNoteNotice } from '@things-factory/system-ui/client/viewparts/release-note-notice'
|
|
17
20
|
import { isMobileDevice } from '@things-factory/utils'
|
|
18
21
|
|
|
19
22
|
import { UPDATE_DASHBOARD_SETTINGS } from './actions/dashboard-settings'
|
|
@@ -81,6 +84,14 @@ export default function bootstrap() {
|
|
|
81
84
|
}
|
|
82
85
|
})
|
|
83
86
|
|
|
87
|
+
store.dispatch({
|
|
88
|
+
type: ADD_SETTING,
|
|
89
|
+
setting: {
|
|
90
|
+
seq: 30,
|
|
91
|
+
template: html` <release-note-setting-let></release-note-setting-let> `
|
|
92
|
+
}
|
|
93
|
+
})
|
|
94
|
+
|
|
84
95
|
store.dispatch({
|
|
85
96
|
type: ADD_MORENDA,
|
|
86
97
|
morenda: {
|
|
@@ -162,6 +173,18 @@ export default function bootstrap() {
|
|
|
162
173
|
})
|
|
163
174
|
|
|
164
175
|
store.dispatch({ type: USE_ROLE_BY_MENUS_MANAGEMENT })
|
|
176
|
+
|
|
177
|
+
if (!ReleaseNoteNotice.seen) {
|
|
178
|
+
i18next.on('initialized', () =>
|
|
179
|
+
setTimeout(() => {
|
|
180
|
+
openPopup(html` <release-note-notice></release-note-notice> `, {
|
|
181
|
+
backdrop: true,
|
|
182
|
+
size: 'large',
|
|
183
|
+
title: i18next.t('title.release-note')
|
|
184
|
+
})
|
|
185
|
+
}, 1000)
|
|
186
|
+
)
|
|
187
|
+
}
|
|
165
188
|
}
|
|
166
189
|
|
|
167
190
|
async function loadOpaAppSettings() {
|
|
@@ -175,7 +175,7 @@ class BulkOperation extends localize(i18next)(PageView) {
|
|
|
175
175
|
importCargo: false,
|
|
176
176
|
sku: '',
|
|
177
177
|
batchId: '',
|
|
178
|
-
|
|
178
|
+
batchIdRef: '',
|
|
179
179
|
packingType: '',
|
|
180
180
|
packingSize: 0,
|
|
181
181
|
uom: '',
|
|
@@ -362,6 +362,7 @@ class BulkOperation extends localize(i18next)(PageView) {
|
|
|
362
362
|
containerSize: String(raw.containerSize || ''),
|
|
363
363
|
sku: String(raw.sku || ''),
|
|
364
364
|
batchId: String(raw.batchId || ''),
|
|
365
|
+
batchIdRef: String(raw.batchIdRef || ''),
|
|
365
366
|
packingType: raw.packingType && raw.packingType != '' ? String(raw.packingType) : null,
|
|
366
367
|
packingSize: !isNaN(Number(raw.packingSize || 'x')) ? Number(raw.packingSize) : null,
|
|
367
368
|
uom: raw.uom && raw.uom != '' ? String(raw.uom) : null,
|
|
@@ -411,8 +412,8 @@ class BulkOperation extends localize(i18next)(PageView) {
|
|
|
411
412
|
packingSize: !isNaN(Number(record.packingSize || 'x')) ? Number(record.packingSize) : null,
|
|
412
413
|
uom: record.uom && record.uom != '' ? String(record.uom) : null,
|
|
413
414
|
releaseQty: Number(record.releaseQty),
|
|
414
|
-
postalCode: String(record.postalCode),
|
|
415
|
-
phone1: String(record.phone1),
|
|
415
|
+
postalCode: String(record.postalCode || ''),
|
|
416
|
+
phone1: String(record.phone1 || ''),
|
|
416
417
|
exportOption: false
|
|
417
418
|
}
|
|
418
419
|
})}
|
|
@@ -71,7 +71,7 @@ class ValidateGanPopup extends localize(i18next)(LitElement) {
|
|
|
71
71
|
appendable: false,
|
|
72
72
|
classifier: (record, rowIndex) => {
|
|
73
73
|
return {
|
|
74
|
-
emphasized: record.
|
|
74
|
+
emphasized: record.errorMsg && record.errorMsg != ''
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
77
|
},
|
|
@@ -162,6 +162,12 @@ class ValidateGanPopup extends localize(i18next)(LitElement) {
|
|
|
162
162
|
header: i18next.t('field.batch_no'),
|
|
163
163
|
width: 150
|
|
164
164
|
},
|
|
165
|
+
{
|
|
166
|
+
type: 'string',
|
|
167
|
+
name: 'batchIdRef',
|
|
168
|
+
header: i18next.t('field.batch_no_ref'),
|
|
169
|
+
width: 150
|
|
170
|
+
},
|
|
165
171
|
{
|
|
166
172
|
type: 'integer',
|
|
167
173
|
name: 'packQty',
|
|
@@ -276,6 +282,7 @@ class ValidateGanPopup extends localize(i18next)(LitElement) {
|
|
|
276
282
|
sku
|
|
277
283
|
productInfo
|
|
278
284
|
batchId
|
|
285
|
+
batchIdRef
|
|
279
286
|
packingType
|
|
280
287
|
packingSize
|
|
281
288
|
uom
|
|
@@ -332,6 +339,7 @@ class ValidateGanPopup extends localize(i18next)(LitElement) {
|
|
|
332
339
|
containerSize: raw.containerSize,
|
|
333
340
|
sku: raw.sku,
|
|
334
341
|
batchId: raw.batchId,
|
|
342
|
+
batchIdRef: raw.batchIdRef,
|
|
335
343
|
packingType: raw.packingType,
|
|
336
344
|
packingSize: raw.packingSize,
|
|
337
345
|
uom: raw.uom,
|
|
@@ -364,7 +372,7 @@ class ValidateGanPopup extends localize(i18next)(LitElement) {
|
|
|
364
372
|
}
|
|
365
373
|
|
|
366
374
|
_validateArrivalNotices() {
|
|
367
|
-
if (this.records.some(record => record.
|
|
375
|
+
if (this.records.some(record => record.errorMsg && record.errorMsg != '')) {
|
|
368
376
|
throw new Error(i18next.t('text.please_recheck_your_request_data'))
|
|
369
377
|
}
|
|
370
378
|
}
|
|
@@ -367,11 +367,9 @@ class ValidateRoPopup extends localize(i18next)(LitElement) {
|
|
|
367
367
|
this._showToast({ message: i18next.t('text.release_order_created') })
|
|
368
368
|
history.back()
|
|
369
369
|
} else {
|
|
370
|
-
let
|
|
371
|
-
if (
|
|
372
|
-
|
|
373
|
-
// display the available items again.
|
|
374
|
-
await this._getAvailableItems(this.records, this.bizplaceId)
|
|
370
|
+
let invalidDataError = response.errors.find(err => err.extensions.exception.errorCode == 'ivd1')
|
|
371
|
+
if (invalidDataError) {
|
|
372
|
+
this.records = JSON.parse(invalidDataError.extensions.exception.detail.data)
|
|
375
373
|
this._showToast({ message: i18next.t('text.please_recheck_your_request_data') })
|
|
376
374
|
}
|
|
377
375
|
}
|
|
@@ -84,8 +84,15 @@ class PopupReusablePallet extends localize(i18next)(LitElement) {
|
|
|
84
84
|
@click="${async () => await this._verifyInput()}"
|
|
85
85
|
label="${i18next.t('button.confirm')}"
|
|
86
86
|
></mwc-button>
|
|
87
|
+
<mwc-button
|
|
88
|
+
raised
|
|
89
|
+
@click="${async () => {
|
|
90
|
+
this.dispatchEvent(new CustomEvent('normalPallet'))
|
|
91
|
+
history.back()
|
|
92
|
+
}}"
|
|
93
|
+
label="${i18next.t('button.disable')}"
|
|
94
|
+
></mwc-button>
|
|
87
95
|
</div>
|
|
88
|
-
}
|
|
89
96
|
`
|
|
90
97
|
}
|
|
91
98
|
|
|
@@ -67,7 +67,7 @@ class WorksheetInformationPopup extends connect(store)(localize(i18next)(LitElem
|
|
|
67
67
|
<label>${i18next.t('label.started_at')}</label>
|
|
68
68
|
<input name="startedAt" type="datetime-local" readonly />
|
|
69
69
|
|
|
70
|
-
<label>${i18next.t('label.
|
|
70
|
+
<label>${i18next.t('label.reusable_pallet_id')}</label>
|
|
71
71
|
<input name="plasticPallet" readonly />
|
|
72
72
|
</fieldset>
|
|
73
73
|
</form>
|
|
@@ -206,7 +206,7 @@ class PutawayProduct extends connect(store)(localize(i18next)(PageView)) {
|
|
|
206
206
|
<barcode-scanable-input name="cartonId" custom-input></barcode-scanable-input>
|
|
207
207
|
`
|
|
208
208
|
: html`
|
|
209
|
-
<label>${i18next.t('label.
|
|
209
|
+
<label>${i18next.t('label.lot_id')}</label>
|
|
210
210
|
<barcode-scanable-input name="palletId" .value=${this._pallet} custom-input></barcode-scanable-input>
|
|
211
211
|
`}
|
|
212
212
|
${this._operationType === OPERATION_TYPE.PUTAWAY
|
|
@@ -716,23 +716,19 @@ class PutawayProduct extends connect(store)(localize(i18next)(PageView)) {
|
|
|
716
716
|
const locationDetails = await this._fetchLocation(this.locationInput.value.trim())
|
|
717
717
|
|
|
718
718
|
if (this._enableCartonLabel) {
|
|
719
|
-
let
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
)
|
|
719
|
+
let worksheetDetails = this._getSelectedOrderProducts(this.cartonInput.value)
|
|
720
|
+
worksheetDetails.forEach(itm => {
|
|
721
|
+
worksheetDetailNames.push(itm.name)
|
|
722
|
+
})
|
|
723
|
+
if (worksheetDetails.find(itm => itm.expirationDate)) {
|
|
724
|
+
let answer = await this._checkExpiry(worksheetDetails, locationDetails.type)
|
|
725
|
+
if (!answer?.value) return (this._scanning = false)
|
|
727
726
|
}
|
|
728
727
|
} else {
|
|
729
728
|
worksheetDetailNames.push(this._selectedOrderProduct.name)
|
|
730
729
|
if (this._selectedOrderProduct.expirationDate) {
|
|
731
|
-
await this._checkExpiry(
|
|
732
|
-
|
|
733
|
-
new Date(this._selectedOrderProduct.expirationDate),
|
|
734
|
-
locationDetails.type
|
|
735
|
-
)
|
|
730
|
+
let answer = await this._checkExpiry(this._selectedOrderProduct, locationDetails.type)
|
|
731
|
+
if (!answer?.value) return (this._scanning = false)
|
|
736
732
|
}
|
|
737
733
|
}
|
|
738
734
|
|
|
@@ -797,23 +793,19 @@ class PutawayProduct extends connect(store)(localize(i18next)(PageView)) {
|
|
|
797
793
|
const locationDetails = await this._fetchLocation(this.locationInput.value.trim())
|
|
798
794
|
|
|
799
795
|
if (this._enableCartonLabel) {
|
|
800
|
-
let
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
)
|
|
796
|
+
let worksheetDetails = this._getSelectedOrderProducts(this.cartonInput.value)
|
|
797
|
+
worksheetDetails.forEach(itm => {
|
|
798
|
+
worksheetDetailNames.push(itm.name)
|
|
799
|
+
})
|
|
800
|
+
if (worksheetDetails.find(itm => itm.expirationDate)) {
|
|
801
|
+
let answer = await this._checkExpiry(worksheetDetails, locationDetails.type)
|
|
802
|
+
if (!answer?.value) return (this._scanning = false)
|
|
808
803
|
}
|
|
809
804
|
} else {
|
|
810
805
|
worksheetDetailNames.push(this._selectedOrderProduct.name)
|
|
811
806
|
if (this._selectedOrderProduct.expirationDate) {
|
|
812
|
-
await this._checkExpiry(
|
|
813
|
-
|
|
814
|
-
new Date(this._selectedOrderProduct.expirationDate),
|
|
815
|
-
locationDetails.type
|
|
816
|
-
)
|
|
807
|
+
let answer = await this._checkExpiry(this._selectedOrderProduct, locationDetails.type)
|
|
808
|
+
if (!answer?.value) return (this._scanning = false)
|
|
817
809
|
}
|
|
818
810
|
}
|
|
819
811
|
|
|
@@ -890,8 +882,10 @@ class PutawayProduct extends connect(store)(localize(i18next)(PageView)) {
|
|
|
890
882
|
if (!this.incompleteLocationName) {
|
|
891
883
|
let worksheetDetailNames = []
|
|
892
884
|
if (this._enableCartonLabel) {
|
|
893
|
-
|
|
894
|
-
|
|
885
|
+
let worksheetDetails = this._getSelectedOrderProducts(this.cartonInput.value)
|
|
886
|
+
worksheetDetails.forEach(itm => {
|
|
887
|
+
worksheetDetailNames.push(itm.name)
|
|
888
|
+
})
|
|
895
889
|
} else worksheetDetailNames.push(this._selectedOrderProduct.name)
|
|
896
890
|
|
|
897
891
|
const response = await client.mutate({
|
|
@@ -977,11 +971,15 @@ class PutawayProduct extends connect(store)(localize(i18next)(PageView)) {
|
|
|
977
971
|
}
|
|
978
972
|
}
|
|
979
973
|
|
|
980
|
-
async _expiryAlert() {
|
|
981
|
-
await CustomAlert({
|
|
974
|
+
async _expiryAlert(expiringProducts) {
|
|
975
|
+
const answer = await CustomAlert({
|
|
982
976
|
title: i18next.t('title.location_scanned_is_not_a_quarantine_zone'),
|
|
983
|
-
|
|
977
|
+
text: i18next.t('text.x_is_expiring', { x: expiringProducts }),
|
|
978
|
+
confirmButton: { text: i18next.t('button.confirm') },
|
|
979
|
+
cancelButton: { text: i18next.t('button.cancel') }
|
|
984
980
|
})
|
|
981
|
+
|
|
982
|
+
return answer
|
|
985
983
|
}
|
|
986
984
|
|
|
987
985
|
_getSelectedOrderProducts(scannedCartonId) {
|
|
@@ -991,7 +989,8 @@ class PutawayProduct extends connect(store)(localize(i18next)(PageView)) {
|
|
|
991
989
|
return {
|
|
992
990
|
name: record.name,
|
|
993
991
|
expirationDate: record.expirationDate,
|
|
994
|
-
expirationPeriod: record.product.expirationPeriod
|
|
992
|
+
expirationPeriod: record.product.expirationPeriod,
|
|
993
|
+
palletId: record.palletId
|
|
995
994
|
}
|
|
996
995
|
})
|
|
997
996
|
}
|
|
@@ -1048,13 +1047,21 @@ class PutawayProduct extends connect(store)(localize(i18next)(PageView)) {
|
|
|
1048
1047
|
}
|
|
1049
1048
|
}
|
|
1050
1049
|
|
|
1051
|
-
async _checkExpiry(
|
|
1052
|
-
let
|
|
1053
|
-
let
|
|
1050
|
+
async _checkExpiry(worksheetDetails, locationType) {
|
|
1051
|
+
let expiringProducts = []
|
|
1052
|
+
for (let wsd of worksheetDetails) {
|
|
1053
|
+
new Date(wsd.expirationDate)
|
|
1054
|
+
let date = new Date()
|
|
1055
|
+
let acceptBefore = new Date(date.setDate(date.getDate() + wsd.expirationPeriod))
|
|
1054
1056
|
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
+
if (wsd.expirationPeriod > 0 && wsd.expirationDate) {
|
|
1058
|
+
if (new Date(wsd.expirationDate) < acceptBefore && locationType !== 'QUARANTINE') {
|
|
1059
|
+
expiringProducts.push(wsd.palletId)
|
|
1060
|
+
}
|
|
1061
|
+
}
|
|
1057
1062
|
}
|
|
1063
|
+
|
|
1064
|
+
return this._expiryAlert(expiringProducts.toString())
|
|
1058
1065
|
}
|
|
1059
1066
|
|
|
1060
1067
|
_validateTransfer() {
|
|
@@ -109,19 +109,11 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
|
|
|
109
109
|
get context() {
|
|
110
110
|
var actions = []
|
|
111
111
|
if (this._worksheetLoaded && !this._enableCartonLabel) {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
})
|
|
118
|
-
} else {
|
|
119
|
-
actions.push({
|
|
120
|
-
title: i18next.t('button.plastic_pallet'),
|
|
121
|
-
action: this._reusablePalletMode.bind(this),
|
|
122
|
-
...CommonButtonStyles.activate
|
|
123
|
-
})
|
|
124
|
-
}
|
|
112
|
+
actions.push({
|
|
113
|
+
title: i18next.t('button.plastic_pallet'),
|
|
114
|
+
action: this._reusablePalletMode.bind(this),
|
|
115
|
+
...CommonButtonStyles.activate
|
|
116
|
+
})
|
|
125
117
|
}
|
|
126
118
|
|
|
127
119
|
if (this._isLooseItem) {
|
|
@@ -468,14 +460,14 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
|
|
|
468
460
|
type: 'integer',
|
|
469
461
|
name: 'palletQty',
|
|
470
462
|
label: true,
|
|
471
|
-
header: i18next.t('field.
|
|
463
|
+
header: i18next.t('field.lot_qty'),
|
|
472
464
|
width: 90
|
|
473
465
|
},
|
|
474
466
|
{
|
|
475
467
|
type: 'integer',
|
|
476
468
|
name: 'actualPalletQty',
|
|
477
469
|
label: true,
|
|
478
|
-
header: i18next.t('field.
|
|
470
|
+
header: i18next.t('field.actual_lot_qty'),
|
|
479
471
|
width: 100
|
|
480
472
|
},
|
|
481
473
|
{
|
|
@@ -800,6 +792,12 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
|
|
|
800
792
|
async _scanProductUnload() {
|
|
801
793
|
if (this._scanning) return this._showToast({ message: i18next.t('text.previous_scan_is_executing') })
|
|
802
794
|
this._scanning = true
|
|
795
|
+
|
|
796
|
+
if (this._isRequiredCheckExpiry && this._expirationPeriod > 0) {
|
|
797
|
+
const answer = await this._checkExpiry()
|
|
798
|
+
if (answer && !answer.value) return (this._scanning = false)
|
|
799
|
+
}
|
|
800
|
+
|
|
803
801
|
try {
|
|
804
802
|
const response = await client.mutate({
|
|
805
803
|
mutation: gql`
|
|
@@ -827,7 +825,6 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
|
|
|
827
825
|
})
|
|
828
826
|
|
|
829
827
|
if (!response.errors) {
|
|
830
|
-
await this._checkExpiry()
|
|
831
828
|
await this._fetchProducts(this._orderNo)
|
|
832
829
|
}
|
|
833
830
|
} catch (e) {
|
|
@@ -842,22 +839,27 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
|
|
|
842
839
|
}
|
|
843
840
|
|
|
844
841
|
async _checkExpiry() {
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
}
|
|
842
|
+
let date = new Date()
|
|
843
|
+
const acceptBefore = new Date(date.setDate(date.getDate() + this._expirationPeriod))
|
|
844
|
+
let expiryDate = new Date(this.expDateInput.value)
|
|
845
|
+
if (expiryDate < acceptBefore) {
|
|
846
|
+
return await CustomAlert({
|
|
847
|
+
title: i18next.t('title.item_unloading_is_expiring_soon'),
|
|
848
|
+
confirmButton: { text: i18next.t('button.confirm') },
|
|
849
|
+
cancelButton: { text: i18next.t('button.cancel') }
|
|
850
|
+
})
|
|
855
851
|
}
|
|
856
852
|
}
|
|
857
853
|
|
|
858
854
|
async _qtyUnload() {
|
|
859
855
|
if (this._scanning) return this._showToast({ message: i18next.t('text.previous_scan_is_executing') })
|
|
860
856
|
this._scanning = true
|
|
857
|
+
|
|
858
|
+
if (this._isRequiredCheckExpiry && this._expirationPeriod > 0) {
|
|
859
|
+
const answer = await this._checkExpiry()
|
|
860
|
+
if (answer && !answer.value) return (this._scanning = false)
|
|
861
|
+
}
|
|
862
|
+
|
|
861
863
|
try {
|
|
862
864
|
const response = await client.mutate({
|
|
863
865
|
mutation: gql`
|
|
@@ -878,7 +880,6 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
|
|
|
878
880
|
}
|
|
879
881
|
})
|
|
880
882
|
if (!response.errors) {
|
|
881
|
-
await this._checkExpiry()
|
|
882
883
|
await this._fetchProducts(this._orderNo)
|
|
883
884
|
}
|
|
884
885
|
} catch (e) {
|
|
@@ -1138,16 +1139,7 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
|
|
|
1138
1139
|
}
|
|
1139
1140
|
|
|
1140
1141
|
if (!response.errors) {
|
|
1141
|
-
|
|
1142
|
-
title: i18next.t('title.completed'),
|
|
1143
|
-
text: i18next.t('text.unloading_completed'),
|
|
1144
|
-
confirmButton: { text: i18next.t('button.confirm') }
|
|
1145
|
-
})
|
|
1146
|
-
|
|
1147
|
-
if (this._enableProductScanning) {
|
|
1148
|
-
if (this.cartonInput?.value) this.cartonInput.value = ''
|
|
1149
|
-
}
|
|
1150
|
-
|
|
1142
|
+
if (this._enableProductScanning && this.cartonInput?.value) this.cartonInput.value = ''
|
|
1151
1143
|
await this._fetchProducts(this._orderNo)
|
|
1152
1144
|
}
|
|
1153
1145
|
} catch (e) {
|
|
@@ -1309,6 +1301,7 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
|
|
|
1309
1301
|
this._worksheetInfo.plasticPallet = this._reusablePallet.name
|
|
1310
1302
|
this.updateContext()
|
|
1311
1303
|
}}
|
|
1304
|
+
@normalPallet=${async () => this._normalPalletMode()}
|
|
1312
1305
|
></popup-reusable-pallet>
|
|
1313
1306
|
`,
|
|
1314
1307
|
{
|
|
@@ -1320,10 +1313,10 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
|
|
|
1320
1313
|
)
|
|
1321
1314
|
}
|
|
1322
1315
|
|
|
1323
|
-
async
|
|
1316
|
+
async _normalPalletMode() {
|
|
1324
1317
|
const result = await CustomAlert({
|
|
1325
1318
|
title: i18next.t('title.are_you_sure'),
|
|
1326
|
-
text: i18next.t('text.
|
|
1319
|
+
text: i18next.t('text.use_normal_pallet'),
|
|
1327
1320
|
confirmButton: { text: i18next.t('button.confirm') },
|
|
1328
1321
|
cancelButton: { text: i18next.t('button.cancel') }
|
|
1329
1322
|
})
|
|
@@ -1331,7 +1324,7 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
|
|
|
1331
1324
|
if (!result.value) return
|
|
1332
1325
|
this._usingReusablePallet = false
|
|
1333
1326
|
this._reusablePalletName = this._worksheetInfo.plasticPallet = ''
|
|
1334
|
-
this._showToast({ message: i18next.t('text.
|
|
1327
|
+
this._showToast({ message: i18next.t('text.now_using_normal_pallet') })
|
|
1335
1328
|
this.updateContext()
|
|
1336
1329
|
}
|
|
1337
1330
|
|
|
@@ -1357,11 +1350,11 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
|
|
|
1357
1350
|
}
|
|
1358
1351
|
}
|
|
1359
1352
|
|
|
1360
|
-
_getWorksheetDetails(
|
|
1353
|
+
_getWorksheetDetails(unloadType) {
|
|
1361
1354
|
return this.orderProductData.records.map(task => {
|
|
1362
|
-
return
|
|
1355
|
+
return unloadType == 'partial'
|
|
1363
1356
|
? { name: task.name, issue: task.issue ? task.issue : null, actualPackQty: task.actualPackQty }
|
|
1364
|
-
: { name: task.name, issue: task.issue ? task.issue : null }
|
|
1357
|
+
: { name: task.name, issue: task.issue ? task.issue : null }
|
|
1365
1358
|
})
|
|
1366
1359
|
}
|
|
1367
1360
|
|
|
@@ -117,7 +117,7 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
|
|
|
117
117
|
this._searchFields = [
|
|
118
118
|
{
|
|
119
119
|
label: i18next.t('field.company'),
|
|
120
|
-
name: '
|
|
120
|
+
name: 'bizplace',
|
|
121
121
|
type: 'select',
|
|
122
122
|
options: [
|
|
123
123
|
{ value: '' },
|
|
@@ -511,6 +511,7 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
|
|
|
511
511
|
id
|
|
512
512
|
name
|
|
513
513
|
sku
|
|
514
|
+
productInformation
|
|
514
515
|
brand
|
|
515
516
|
auxUnit1
|
|
516
517
|
auxValue1
|
|
@@ -571,8 +572,8 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
|
|
|
571
572
|
const filters = await this.searchForm.getQueryFilters()
|
|
572
573
|
const response = await client.query({
|
|
573
574
|
query: gql`
|
|
574
|
-
query
|
|
575
|
-
|
|
575
|
+
query inventoriesForExport($filters: [Filter!]!, $pagination: Pagination, $sortings: [Sorting!]!) {
|
|
576
|
+
inventoriesForExport(filters: $filters, pagination: $pagination, sortings: $sortings) {
|
|
576
577
|
items {
|
|
577
578
|
id
|
|
578
579
|
palletId
|
|
@@ -598,6 +599,7 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
|
|
|
598
599
|
brand
|
|
599
600
|
name
|
|
600
601
|
description
|
|
602
|
+
productInformation
|
|
601
603
|
}
|
|
602
604
|
qty
|
|
603
605
|
warehouse {
|
|
@@ -612,10 +614,6 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
|
|
|
612
614
|
description
|
|
613
615
|
}
|
|
614
616
|
updatedAt
|
|
615
|
-
updater {
|
|
616
|
-
name
|
|
617
|
-
description
|
|
618
|
-
}
|
|
619
617
|
}
|
|
620
618
|
total
|
|
621
619
|
}
|
|
@@ -628,7 +626,7 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
|
|
|
628
626
|
}
|
|
629
627
|
})
|
|
630
628
|
|
|
631
|
-
return response.data.
|
|
629
|
+
return response.data.inventoriesForExport.items || []
|
|
632
630
|
}
|
|
633
631
|
|
|
634
632
|
async _fetchPartners(filters = []) {
|
|
@@ -836,7 +834,7 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
|
|
|
836
834
|
})
|
|
837
835
|
]
|
|
838
836
|
|
|
839
|
-
const bizplaceFilters = (await this.searchForm.getQueryFilters()).filter(x => x.name === '
|
|
837
|
+
const bizplaceFilters = (await this.searchForm.getQueryFilters()).filter(x => x.name === 'bizplace')
|
|
840
838
|
|
|
841
839
|
if (bizplaceFilters.length == 0) {
|
|
842
840
|
throw new Error(`Please select a customer for export.`)
|
|
@@ -848,7 +846,7 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
|
|
|
848
846
|
data = await this.fetchInventoriesForExport()
|
|
849
847
|
}
|
|
850
848
|
|
|
851
|
-
let [
|
|
849
|
+
let [products, bizplaces, locations] = await Promise.all([
|
|
852
850
|
this.fetchProduct(bizplaceFilters),
|
|
853
851
|
this.fetchBizplaces([{ ...bizplaceFilters[0], name: 'bizplace' }]),
|
|
854
852
|
this.fetchLocation()
|
|
@@ -857,15 +855,13 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
|
|
|
857
855
|
headerSetting = headerSetting.map(column => {
|
|
858
856
|
switch (column.key) {
|
|
859
857
|
case 'bizplace.name':
|
|
860
|
-
column.arrData =
|
|
858
|
+
column.arrData = bizplaces
|
|
861
859
|
break
|
|
862
860
|
case 'product.name':
|
|
863
|
-
column.arrData =
|
|
864
|
-
return { ...itm, name: `(${itm.sku}) ${itm.name} - ${itm.description}` }
|
|
865
|
-
})
|
|
861
|
+
column.arrData = products
|
|
866
862
|
break
|
|
867
863
|
case 'location.name':
|
|
868
|
-
column.arrData =
|
|
864
|
+
column.arrData = locations
|
|
869
865
|
break
|
|
870
866
|
default:
|
|
871
867
|
break
|
|
@@ -878,7 +874,7 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
|
|
|
878
874
|
item.expirationDate = new Date(item.expirationDate).getTime()
|
|
879
875
|
}
|
|
880
876
|
|
|
881
|
-
item.product.name =
|
|
877
|
+
item.product.name = item.product.productInformation
|
|
882
878
|
return {
|
|
883
879
|
id: item.id,
|
|
884
880
|
...this.columns
|
|
@@ -893,7 +889,6 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
|
|
|
893
889
|
}
|
|
894
890
|
})
|
|
895
891
|
|
|
896
|
-
// throw new error('test')
|
|
897
892
|
return { header: headerSetting, data: data }
|
|
898
893
|
} catch (e) {
|
|
899
894
|
this._showToast(e)
|
|
@@ -930,20 +925,20 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
|
|
|
930
925
|
bizplace[0].name = 'bizplace'
|
|
931
926
|
const response = await client.query({
|
|
932
927
|
query: gql`
|
|
933
|
-
query
|
|
934
|
-
|
|
928
|
+
query pureProductsByBizplace($filters: [Filter!]!) {
|
|
929
|
+
pureProductsByBizplace(filters: $filters) {
|
|
935
930
|
items {
|
|
936
931
|
id
|
|
937
|
-
|
|
938
|
-
name
|
|
939
|
-
description
|
|
932
|
+
productInformation
|
|
940
933
|
}
|
|
941
934
|
}
|
|
942
935
|
}
|
|
943
936
|
`,
|
|
944
937
|
variables: { filters: [...bizplace] }
|
|
945
938
|
})
|
|
946
|
-
return response.data.
|
|
939
|
+
return response.data.pureProductsByBizplace.items.map(product => {
|
|
940
|
+
return { id: product.id, name: product.productInformation }
|
|
941
|
+
})
|
|
947
942
|
} catch (ex) {
|
|
948
943
|
throw ex
|
|
949
944
|
}
|
|
@@ -952,8 +947,8 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
|
|
|
952
947
|
async fetchLocation() {
|
|
953
948
|
const response = await client.query({
|
|
954
949
|
query: gql`
|
|
955
|
-
query
|
|
956
|
-
|
|
950
|
+
query pureLocations($filters: [Filter!]!) {
|
|
951
|
+
pureLocations(filters: $filters) {
|
|
957
952
|
items {
|
|
958
953
|
id
|
|
959
954
|
name
|
|
@@ -963,7 +958,8 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
|
|
|
963
958
|
`,
|
|
964
959
|
variables: { filters: [] }
|
|
965
960
|
})
|
|
966
|
-
|
|
961
|
+
this._locations = response.data.pureLocations.items
|
|
962
|
+
return response.data.pureLocations.items
|
|
967
963
|
}
|
|
968
964
|
|
|
969
965
|
async updateRemark(id, remark) {
|
|
@@ -164,11 +164,6 @@ class InventoryByProduct extends localize(i18next)(PageView) {
|
|
|
164
164
|
type: 'object',
|
|
165
165
|
name: 'bizplace',
|
|
166
166
|
header: i18next.t('field.company'),
|
|
167
|
-
record: {
|
|
168
|
-
options: {
|
|
169
|
-
queryName: 'bizplaces'
|
|
170
|
-
}
|
|
171
|
-
},
|
|
172
167
|
imex: {
|
|
173
168
|
header: i18next.t('field.company'),
|
|
174
169
|
key: 'bizplace.name',
|
|
@@ -243,13 +238,6 @@ class InventoryByProduct extends localize(i18next)(PageView) {
|
|
|
243
238
|
header: i18next.t('field.qty'),
|
|
244
239
|
width: 80
|
|
245
240
|
}
|
|
246
|
-
// {
|
|
247
|
-
// type: 'decimal',
|
|
248
|
-
// name: 'averageUnitCost',
|
|
249
|
-
// imex: { header: i18next.t('field.average_unit_cost'), key: 'averageUnitCost', width: 50, type: 'decimal' },
|
|
250
|
-
// header: i18next.t('field.average_unit_cost'),
|
|
251
|
-
// width: 160
|
|
252
|
-
// }
|
|
253
241
|
]
|
|
254
242
|
}
|
|
255
243
|
}
|