@things-factory/operato-wms 4.3.137 → 4.3.139
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/adjustment/transfer-inventory.js +14 -6
- package/client/pages/bulk-operation/bulk-operation.js +3 -1
- package/client/pages/components/select-inventory-popup.js +7 -1
- package/client/pages/components/select-product-popup.js +33 -3
- package/client/pages/constants/order.js +3 -1
- package/client/pages/inbound/external-return-worksheet.js +39 -2
- package/client/pages/inbound/undo-putaway-popup.js +5 -9
- package/client/pages/inbound/undo-unload-popup.js +42 -35
- package/client/pages/inbound/unload-product.js +79 -69
- package/client/pages/inventory/inventory-adjustment-approval.js +4 -5
- package/client/pages/inventory/inventory-adjustment.js +56 -2
- package/client/pages/inventory/inventory-by-product-detail.js +23 -17
- package/client/pages/inventory/inventory-by-product.js +7 -0
- package/client/pages/inventory/inventory-history-by-pallet.js +14 -5
- package/client/pages/inventory/inventory-history.js +10 -0
- package/client/pages/inventory-check/check-inventory-popup.js +1 -1
- package/client/pages/inventory-check/create-cycle-count.js +2 -3
- package/client/pages/inventory-check/inspecting-product.js +7 -3
- package/client/pages/manifest/create-loading-manifest.js +8 -1
- package/client/pages/manifest/loading-manifest-detail.js +7 -4
- package/client/pages/master/generate-location-list.js +30 -22
- package/client/pages/master/location-list.js +141 -70
- package/client/pages/master/pallet-list.js +137 -58
- package/client/pages/master/product/product-details-popup.js +3 -3
- package/client/pages/master/tote-list.js +40 -27
- package/client/pages/master/transport-driver.js +48 -41
- package/client/pages/master/transport-vehicle.js +45 -41
- package/client/pages/master/warehouse-list.js +56 -34
- package/client/pages/order/arrival-notice/arrival-notice-detail.js +36 -25
- package/client/pages/order/arrival-notice/create-arrival-notice.js +79 -97
- package/client/pages/order/arrival-notice/duplicate-arrival-notice.js +2 -0
- package/client/pages/order/arrival-notice/edit-product-popup.js +10 -8
- package/client/pages/order/draft-release-good/draft-release-good-detail.js +88 -4
- package/client/pages/order/draft-release-good/draft-release-good-list.js +1 -1
- package/client/pages/order/release-order/create-release-order.js +34 -9
- package/client/pages/order/release-order/release-extra-product-popup.js +4 -1
- package/client/pages/order/release-order/release-order-detail.js +40 -3
- package/client/pages/order/return-order/create-return-order.js +5 -0
- package/client/pages/order/return-order/return-order-inventory-popup.js +1 -0
- package/client/pages/order/return-order/return-order-requests.js +37 -2
- package/client/pages/order/transport-order/delivery-note-popup.js +30 -24
- package/client/pages/order/transport-order/delivery-order-list.js +27 -1
- package/client/pages/outbound/inventory-reassign-popup.js +7 -3
- package/client/pages/outbound/packing-product.js +7 -7
- package/client/pages/outbound/packing-worksheet-list.js +3 -1
- package/client/pages/outbound/picking-product.js +17 -5
- package/client/pages/outbound/serial-number-popup.js +1 -1
- package/client/pages/outbound/show-my-worksheet-list-popup.js +12 -3
- package/client/pages/report/custom-elccl/elccl-daily-collection-report.js +5 -2
- package/client/pages/report/custom-elccl/elccl-daily-order-inventory-report.js +2 -2
- package/client/pages/report/custom-elccl/elccl-delivery-order-summary.js +34 -8
- package/client/pages/report/custom-elccl/elccl-inventory-pallet-detail-report.js +42 -4
- package/client/pages/report/custom-elccl/elccl-inventory-summary-report.js +46 -4
- package/client/pages/report/volume-summary-report.js +8 -3
- package/config.development.js +28 -21
- package/dist-server/graphql/resolvers/custom/elccl/elccl-inventory-history-report.js +6 -5
- package/dist-server/graphql/resolvers/custom/elccl/elccl-inventory-history-report.js.map +1 -1
- package/dist-server/graphql/resolvers/other/add-release-good-products.js +7 -11
- package/dist-server/graphql/resolvers/other/add-release-good-products.js.map +1 -1
- package/dist-server/graphql/resolvers/reports/costing-report.js +18 -24
- package/dist-server/graphql/resolvers/reports/costing-report.js.map +1 -1
- package/dist-server/graphql/resolvers/reports/inbound-order-details-report.js +6 -6
- package/dist-server/graphql/resolvers/reports/inbound-serial-number-report.js +1 -1
- package/dist-server/graphql/resolvers/reports/outbound-order-details-report.js +8 -9
- package/dist-server/graphql/resolvers/reports/outbound-order-details-report.js.map +1 -1
- package/dist-server/graphql/resolvers/reports/release-inventory-report.js +3 -3
- package/dist-server/graphql/resolvers/reports/release-inventory-report.js.map +1 -1
- package/package.json +24 -24
- package/server/graphql/resolvers/custom/elccl/elccl-inventory-history-report.ts +6 -5
- package/server/graphql/resolvers/other/add-release-good-products.ts +8 -12
- package/server/graphql/resolvers/reports/costing-report.ts +18 -24
- package/server/graphql/resolvers/reports/inbound-order-details-report.ts +6 -6
- package/server/graphql/resolvers/reports/inbound-serial-number-report.ts +1 -1
- package/server/graphql/resolvers/reports/outbound-order-details-report.ts +8 -9
- package/server/graphql/resolvers/reports/release-inventory-report.ts +6 -4
- package/translations/en.json +28 -3
- package/translations/ko.json +26 -2
- package/translations/ms.json +26 -2
- package/translations/zh.json +26 -2
|
@@ -301,15 +301,20 @@ class TransferInventory extends connect(store)(localize(i18next)(PageView)) {
|
|
|
301
301
|
name="qty"
|
|
302
302
|
min="0"
|
|
303
303
|
@change="${e => {
|
|
304
|
-
|
|
304
|
+
let qtyInputValue = parseInt(this.qtyInput.value) || null
|
|
305
|
+
if (!Number.isInteger(parseFloat(this.qtyInput.value))) {
|
|
306
|
+
this.qtyInput.value = qtyInputValue
|
|
307
|
+
}
|
|
308
|
+
if (qtyInputValue < 0) {
|
|
305
309
|
this.qtyInput.value = 0
|
|
306
310
|
}
|
|
307
311
|
if (this._selectedInventory) {
|
|
308
|
-
if (this._selectedInventory.availableQty
|
|
312
|
+
if (this._selectedInventory.availableQty >= qtyInputValue) {
|
|
309
313
|
this._requireNewId = true
|
|
310
314
|
} else {
|
|
311
|
-
if (
|
|
312
|
-
this.qtyInput.value =
|
|
315
|
+
if (qtyInputValue > this._selectedInventory.availableQty) {
|
|
316
|
+
this.qtyInput.value = null
|
|
317
|
+
this.showToast({ message: 'Transferred quantity cannot be more than available quantity' })
|
|
313
318
|
}
|
|
314
319
|
this._requireNewId = false
|
|
315
320
|
}
|
|
@@ -579,11 +584,14 @@ class TransferInventory extends connect(store)(localize(i18next)(PageView)) {
|
|
|
579
584
|
})
|
|
580
585
|
|
|
581
586
|
if (!response.errors) {
|
|
587
|
+
|
|
588
|
+
// let foundId = response.data.inventories.total
|
|
582
589
|
if (response.data.inventories.total == 0) {
|
|
583
590
|
if (this.refInventoryType === INVENTORY_TYPES.LOT.value) {
|
|
584
591
|
this.focusOnPalletInput()
|
|
585
592
|
throw new Error(i18next.t('text.lot_id_not_found'))
|
|
586
|
-
}
|
|
593
|
+
}
|
|
594
|
+
if (this.refInventoryType === INVENTORY_TYPES.CARTON.value) {
|
|
587
595
|
this.focusOnCartonInput()
|
|
588
596
|
throw new Error(i18next.t('text.carton_id_not_found'))
|
|
589
597
|
}
|
|
@@ -667,7 +675,7 @@ class TransferInventory extends connect(store)(localize(i18next)(PageView)) {
|
|
|
667
675
|
let id = this.refInventoryType === INVENTORY_TYPES.LOT.value ? this._palletId : this._cartonId
|
|
668
676
|
this.showToast({ message: i18next.t('text.transfer_location_completed') })
|
|
669
677
|
this.clearView()
|
|
670
|
-
this.fetchInventory(id)
|
|
678
|
+
// this.fetchInventory(id)
|
|
671
679
|
this.updateContext()
|
|
672
680
|
}
|
|
673
681
|
} catch (e) {
|
|
@@ -156,7 +156,8 @@ class BulkOperation extends localize(i18next)(PageView) {
|
|
|
156
156
|
}
|
|
157
157
|
|
|
158
158
|
get _ganData() {
|
|
159
|
-
let date =
|
|
159
|
+
let date =
|
|
160
|
+
(new Date().getMonth() + 1).toString() + '-' + new Date().getDate().toString() + '-' + new Date().getFullYear()
|
|
160
161
|
return [
|
|
161
162
|
{
|
|
162
163
|
refNo: '',
|
|
@@ -455,6 +456,7 @@ class BulkOperation extends localize(i18next)(PageView) {
|
|
|
455
456
|
country: String(record.country || ''),
|
|
456
457
|
sku: String(record.sku || ''),
|
|
457
458
|
productId: String(record.productId || ''),
|
|
459
|
+
productDetailId: String(record.productDetailId || ''),
|
|
458
460
|
packingType: record.packingType && record.packingType != '' ? String(record.packingType) : null,
|
|
459
461
|
packingSize: !isNaN(Number(record.packingSize || 'x')) ? Number(record.packingSize) : null,
|
|
460
462
|
uom: record.uom && record.uom != '' ? String(record.uom) : null,
|
|
@@ -446,6 +446,7 @@ class SelectInventoryPopUp extends localize(i18next)(LitElement) {
|
|
|
446
446
|
items {
|
|
447
447
|
id
|
|
448
448
|
productId
|
|
449
|
+
productDetailId
|
|
449
450
|
batchId
|
|
450
451
|
batchIdRef
|
|
451
452
|
groupType
|
|
@@ -493,6 +494,7 @@ class SelectInventoryPopUp extends localize(i18next)(LitElement) {
|
|
|
493
494
|
palletId
|
|
494
495
|
cartonId
|
|
495
496
|
productId
|
|
497
|
+
productDetailId
|
|
496
498
|
productSKU
|
|
497
499
|
productName
|
|
498
500
|
productBrand
|
|
@@ -540,7 +542,6 @@ class SelectInventoryPopUp extends localize(i18next)(LitElement) {
|
|
|
540
542
|
this.dispatchEvent(
|
|
541
543
|
new CustomEvent('selected', {
|
|
542
544
|
detail: {
|
|
543
|
-
productDetailId: selectedProduct.id,
|
|
544
545
|
packingType: selectedProduct.packingType,
|
|
545
546
|
uom: selectedProduct.uom,
|
|
546
547
|
uomValue: selectedProduct.uomValue,
|
|
@@ -555,6 +556,9 @@ class SelectInventoryPopUp extends localize(i18next)(LitElement) {
|
|
|
555
556
|
packingSize: selectedProduct.packingSize,
|
|
556
557
|
primaryUnit: selectedProduct.uom,
|
|
557
558
|
primaryValue: selectedProduct.uomValue
|
|
559
|
+
},
|
|
560
|
+
productDetail: {
|
|
561
|
+
id: selectedProduct.productDetailId
|
|
558
562
|
}
|
|
559
563
|
}
|
|
560
564
|
})
|
|
@@ -582,6 +586,7 @@ class SelectInventoryPopUp extends localize(i18next)(LitElement) {
|
|
|
582
586
|
remainQty: itm.remainQty,
|
|
583
587
|
remainUomValueWithUom: itm.remainUomValueWithUom,
|
|
584
588
|
productId: itm.productId,
|
|
589
|
+
productDetailId: itm.productDetailId,
|
|
585
590
|
remainUomValue: itm.remainUomValue,
|
|
586
591
|
batchId: itm.batchId,
|
|
587
592
|
batchIdRef: itm.batchIdRef,
|
|
@@ -603,6 +608,7 @@ class SelectInventoryPopUp extends localize(i18next)(LitElement) {
|
|
|
603
608
|
remainQty: itm.remainQty,
|
|
604
609
|
remainUomValueWithUom: itm.remainUomValueWithUom,
|
|
605
610
|
productId: itm.productId,
|
|
611
|
+
productDetailId: itm.productDetailId,
|
|
606
612
|
remainUomValue: itm.remainUomValue,
|
|
607
613
|
batchId: itm.batchId,
|
|
608
614
|
batchIdRef: itm.batchIdRef,
|
|
@@ -121,7 +121,8 @@ class SelectProductPopup extends localize(i18next)(LitElement) {
|
|
|
121
121
|
pagination: { pages: [10, 20, 50, 100] },
|
|
122
122
|
rows: {
|
|
123
123
|
appendable: false,
|
|
124
|
-
selectable: { multiple: this.selectMultipleProducts ? this.selectMultipleProducts : false }
|
|
124
|
+
selectable: { multiple: this.selectMultipleProducts ? this.selectMultipleProducts : false },
|
|
125
|
+
handlers: { dblclick: this._dblClickHandler.bind(this) }
|
|
125
126
|
},
|
|
126
127
|
columns: [
|
|
127
128
|
{ type: 'gutter', gutterName: 'sequence' },
|
|
@@ -202,6 +203,7 @@ class SelectProductPopup extends localize(i18next)(LitElement) {
|
|
|
202
203
|
productDetails(filters: $filters, pagination: $pagination, sortings: $sortings) {
|
|
203
204
|
items {
|
|
204
205
|
id
|
|
206
|
+
name
|
|
205
207
|
packingType
|
|
206
208
|
packingSize
|
|
207
209
|
uom
|
|
@@ -229,10 +231,11 @@ class SelectProductPopup extends localize(i18next)(LitElement) {
|
|
|
229
231
|
response.data.productDetails.items.map(item => {
|
|
230
232
|
return {
|
|
231
233
|
...item,
|
|
234
|
+
productName: item.product.name,
|
|
232
235
|
productId: item.product.id,
|
|
233
236
|
sku: item.product.sku,
|
|
234
237
|
brand: item.product.brand,
|
|
235
|
-
name: item.
|
|
238
|
+
name: item.name,
|
|
236
239
|
description: item.product.description
|
|
237
240
|
}
|
|
238
241
|
}) || []
|
|
@@ -240,7 +243,34 @@ class SelectProductPopup extends localize(i18next)(LitElement) {
|
|
|
240
243
|
}
|
|
241
244
|
}
|
|
242
245
|
|
|
243
|
-
|
|
246
|
+
_dblClickHandler(columns, data, column, record, rowIndex, target) {
|
|
247
|
+
if (this.selectMultipleProducts) return
|
|
248
|
+
this.dispatchEvent(
|
|
249
|
+
new CustomEvent('selected', {
|
|
250
|
+
detail: {
|
|
251
|
+
productDetailId: record.id,
|
|
252
|
+
packingType: record.packingType,
|
|
253
|
+
uom: record.uom,
|
|
254
|
+
uomValue: record.uomValue,
|
|
255
|
+
productName: `${record.name}(${record.description}(${record.sku}))`,
|
|
256
|
+
isError: false,
|
|
257
|
+
productBrand: record.brand,
|
|
258
|
+
product: {
|
|
259
|
+
id: record.productId,
|
|
260
|
+
name: record.name,
|
|
261
|
+
sku: record.sku,
|
|
262
|
+
packingType: record.packingType,
|
|
263
|
+
packingSize: record.packingSize,
|
|
264
|
+
primaryUnit: record.uom,
|
|
265
|
+
primaryValue: record.uomValue
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
})
|
|
269
|
+
)
|
|
270
|
+
history.back()
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
selectProduct(record) {
|
|
244
274
|
if (this.selectMultipleProducts !== true) {
|
|
245
275
|
const selectedProduct = this.productGrist.selected[0]
|
|
246
276
|
if (selectedProduct) {
|
|
@@ -121,7 +121,9 @@ export const ORDER_INVENTORY_STATUS = {
|
|
|
121
121
|
RELOCATED: { name: 'inventory_status_relocated', value: 'RELOCATED' },
|
|
122
122
|
ADDED: { name: 'inventory_status_added', value: 'ADDED' },
|
|
123
123
|
TERMINATED: { name: 'inventory_status_terminated', value: 'TERMINATED' },
|
|
124
|
-
DONE: { name: 'inventory_status_done', value: 'DONE' }
|
|
124
|
+
DONE: { name: 'inventory_status_done', value: 'DONE' },
|
|
125
|
+
CANCELLED: { name: 'inventory_status_cancelled', value: 'CANCELLED' },
|
|
126
|
+
PENDING_CANCEL: { name: 'inventory_status_pending_cancel', value: 'PENDING_CANCEL' }
|
|
125
127
|
}
|
|
126
128
|
|
|
127
129
|
export const ORDER_VAS_STATUS = {
|
|
@@ -310,8 +310,45 @@ class ExternalReturnWorksheet extends localize(i18next)(PageView) {
|
|
|
310
310
|
}
|
|
311
311
|
}
|
|
312
312
|
|
|
313
|
-
_exportableData() {
|
|
314
|
-
|
|
313
|
+
async _exportableData() {
|
|
314
|
+
try {
|
|
315
|
+
let data = []
|
|
316
|
+
|
|
317
|
+
var headerSetting = [
|
|
318
|
+
{ header: i18next.t('field.return_order_no'), key: 'returnOrderName', width: 25, type: 'string' },
|
|
319
|
+
{ header: i18next.t('field.ref_no'), key: 'returnOrderRefNo', width: 25, type: 'string' },
|
|
320
|
+
{ header: i18next.t('field.company'), key: 'bizplaceName', width: 25, type: 'string' },
|
|
321
|
+
{ header: i18next.t('field.type'), key: 'type', width: 30, type: 'string' },
|
|
322
|
+
{ header: i18next.t('field.status'), key: 'status', width: 25, type: 'string' },
|
|
323
|
+
{ header: i18next.t('field.started_at'), key: 'startedAt', width: 30, type: 'date' },
|
|
324
|
+
{ header: i18next.t('field.ended_at'), key: 'endedAt', width: 25, type: 'date' },
|
|
325
|
+
{ header: i18next.t('field.updated_by'), key: 'updaterName', width: 25, type: 'string' }
|
|
326
|
+
]
|
|
327
|
+
|
|
328
|
+
if (this.dataGrist.selected && this.dataGrist.selected.length > 0) {
|
|
329
|
+
data = this.dataGrist.selected.map(record => {
|
|
330
|
+
return {
|
|
331
|
+
...record,
|
|
332
|
+
returnOrderName: record.returnOrder?.name,
|
|
333
|
+
bizplaceName: record.bizplace?.name,
|
|
334
|
+
updaterName: record.updater?.name
|
|
335
|
+
}
|
|
336
|
+
})
|
|
337
|
+
} else {
|
|
338
|
+
data = (await this.fetchHandler({ page: 1, limit: 9999999 })).records.map(record => {
|
|
339
|
+
return {
|
|
340
|
+
...record,
|
|
341
|
+
returnOrderName: record.returnOrder?.name,
|
|
342
|
+
bizplaceName: record.bizplace?.name,
|
|
343
|
+
updaterName: record.updater?.name
|
|
344
|
+
}
|
|
345
|
+
})
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
return { header: headerSetting, data }
|
|
349
|
+
} catch (e) {
|
|
350
|
+
this._showToast(e)
|
|
351
|
+
}
|
|
315
352
|
}
|
|
316
353
|
}
|
|
317
354
|
|
|
@@ -202,11 +202,8 @@ class UndoPutawayPopup extends connect(store)(localize(i18next)(LitElement)) {
|
|
|
202
202
|
async _undoPutaway() {
|
|
203
203
|
try {
|
|
204
204
|
let selectedInventories = []
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
} else {
|
|
208
|
-
selectedInventories = this.dataGrist.selected
|
|
209
|
-
}
|
|
205
|
+
selectedInventories = this.dataGrist.selected
|
|
206
|
+
|
|
210
207
|
if (!selectedInventories?.length) throw new Error(i18next.t('text.select_at_least_one_inventory_to_undo'))
|
|
211
208
|
|
|
212
209
|
this._validateScanInventory()
|
|
@@ -250,12 +247,11 @@ class UndoPutawayPopup extends connect(store)(localize(i18next)(LitElement)) {
|
|
|
250
247
|
this.lotInput.value = ''
|
|
251
248
|
}
|
|
252
249
|
this._showToast({ message: i18next.t('text.no_matching_putaway_inventory_found') })
|
|
253
|
-
} else if (targetedUndoInventories?.length == 1) {
|
|
254
|
-
this.data = { records: targetedUndoInventories }
|
|
255
|
-
this._autoSelectInventory = targetedUndoInventories
|
|
256
|
-
this._undoPutaway()
|
|
257
250
|
} else {
|
|
258
251
|
this.data = { records: targetedUndoInventories }
|
|
252
|
+
if (targetedUndoInventories?.length == 1) {
|
|
253
|
+
this.data.records[0].__selected__ = true
|
|
254
|
+
}
|
|
259
255
|
}
|
|
260
256
|
}
|
|
261
257
|
}
|
|
@@ -1,22 +1,12 @@
|
|
|
1
1
|
import '@things-factory/grist-ui'
|
|
2
2
|
|
|
3
3
|
import gql from 'graphql-tag'
|
|
4
|
-
import {
|
|
5
|
-
css,
|
|
6
|
-
html,
|
|
7
|
-
LitElement
|
|
8
|
-
} from 'lit-element'
|
|
4
|
+
import { css, html, LitElement } from 'lit-element'
|
|
9
5
|
import { connect } from 'pwa-helpers/connect-mixin'
|
|
10
6
|
|
|
11
7
|
import { SingleColumnFormStyles } from '@things-factory/form-ui'
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
localize
|
|
15
|
-
} from '@things-factory/i18n-base'
|
|
16
|
-
import {
|
|
17
|
-
client,
|
|
18
|
-
store
|
|
19
|
-
} from '@things-factory/shell'
|
|
8
|
+
import { i18next, localize } from '@things-factory/i18n-base'
|
|
9
|
+
import { client, store, CustomAlert } from '@things-factory/shell'
|
|
20
10
|
import { isMobileDevice } from '@things-factory/utils'
|
|
21
11
|
|
|
22
12
|
class UndoUnloadPopup extends connect(store)(localize(i18next)(LitElement)) {
|
|
@@ -37,7 +27,7 @@ class UndoUnloadPopup extends connect(store)(localize(i18next)(LitElement)) {
|
|
|
37
27
|
constructor() {
|
|
38
28
|
super()
|
|
39
29
|
this._selectedRecords = []
|
|
40
|
-
this._isExecuting= false
|
|
30
|
+
this._isExecuting = false
|
|
41
31
|
}
|
|
42
32
|
|
|
43
33
|
static get styles() {
|
|
@@ -135,7 +125,12 @@ class UndoUnloadPopup extends connect(store)(localize(i18next)(LitElement)) {
|
|
|
135
125
|
</div>
|
|
136
126
|
|
|
137
127
|
<div class="button-container">
|
|
138
|
-
<mwc-button
|
|
128
|
+
<mwc-button
|
|
129
|
+
raised
|
|
130
|
+
@click="${this._undoUnloading.bind(this)}"
|
|
131
|
+
label="${i18next.t('button.undo')}"
|
|
132
|
+
?disabled=${this._isExecuting}
|
|
133
|
+
></mwc-button>
|
|
139
134
|
</div>
|
|
140
135
|
`
|
|
141
136
|
}
|
|
@@ -226,34 +221,43 @@ class UndoUnloadPopup extends connect(store)(localize(i18next)(LitElement)) {
|
|
|
226
221
|
|
|
227
222
|
async _undoUnloading() {
|
|
228
223
|
try {
|
|
229
|
-
if(
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
224
|
+
if (this.dataGrist.selected.some(s => s.inventoryItems?.length > 0)) {
|
|
225
|
+
const result = await CustomAlert({
|
|
226
|
+
title: i18next.t('title.are_you_sure'),
|
|
227
|
+
text: i18next.t('text.all_related_serial_number_will_be_deleted'),
|
|
228
|
+
confirmButton: { text: i18next.t('button.confirm') },
|
|
229
|
+
cancelButton: { text: i18next.t('button.cancel') }
|
|
230
|
+
})
|
|
233
231
|
|
|
234
|
-
|
|
232
|
+
if (!result.value) return
|
|
233
|
+
}
|
|
234
|
+
if (!this._isExecuting) {
|
|
235
|
+
this._isExecuting = true
|
|
236
|
+
let selectedInventoryIds = []
|
|
237
|
+
selectedInventoryIds = this.dataGrist.selected.map(inventory => inventory.id)
|
|
235
238
|
|
|
236
|
-
|
|
239
|
+
if (!selectedInventoryIds?.length) throw new Error(i18next.t('text.select_at_least_one_inventory_to_undo'))
|
|
237
240
|
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
241
|
+
this._validateScanInventory()
|
|
242
|
+
|
|
243
|
+
const response = await client.mutate({
|
|
244
|
+
mutation: gql`
|
|
245
|
+
mutation undoUnloading($orderType: String!, $orderNo: String!, $inventoryIds: [String]!) {
|
|
246
|
+
undoUnloading(orderType: $orderType, orderNo: $orderNo, inventoryIds: $inventoryIds)
|
|
247
|
+
}
|
|
248
|
+
`,
|
|
249
|
+
variables: { orderType: this.orderType, orderNo: this.orderNo, inventoryIds: selectedInventoryIds }
|
|
250
|
+
})
|
|
246
251
|
|
|
247
|
-
|
|
248
|
-
|
|
252
|
+
if (!response.errors) {
|
|
253
|
+
this.dispatchEvent(new CustomEvent('undo-inventory'))
|
|
254
|
+
}
|
|
249
255
|
}
|
|
250
|
-
}
|
|
251
256
|
} catch (e) {
|
|
252
257
|
this._showToast(e)
|
|
253
|
-
}finally {
|
|
258
|
+
} finally {
|
|
254
259
|
this._isExecuting = false
|
|
255
260
|
}
|
|
256
|
-
|
|
257
261
|
}
|
|
258
262
|
|
|
259
263
|
_populateTargetedInventory(e) {
|
|
@@ -285,7 +289,10 @@ class UndoUnloadPopup extends connect(store)(localize(i18next)(LitElement)) {
|
|
|
285
289
|
return { ...itm, sku: itm.product.sku }
|
|
286
290
|
})
|
|
287
291
|
}
|
|
288
|
-
|
|
292
|
+
if (targetedUndoInventories?.length == 1) {
|
|
293
|
+
this._selectedRecords = targetedUndoInventories
|
|
294
|
+
this.data.records[0].__selected__ = true
|
|
295
|
+
}
|
|
289
296
|
}
|
|
290
297
|
} catch (e) {
|
|
291
298
|
this._showToast(e)
|
|
@@ -637,6 +637,7 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
|
|
|
637
637
|
description
|
|
638
638
|
isRequiredCheckExpiry
|
|
639
639
|
isRequireSerialNumberScanningInbound
|
|
640
|
+
expirationPeriod
|
|
640
641
|
}
|
|
641
642
|
name
|
|
642
643
|
targetName
|
|
@@ -693,7 +694,9 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
|
|
|
693
694
|
...worksheetDetailInfo,
|
|
694
695
|
validity:
|
|
695
696
|
worksheetDetailInfo.actualPackQty === worksheetDetailInfo.packQty &&
|
|
696
|
-
worksheetDetailInfo.
|
|
697
|
+
(worksheetDetailInfo.palletQty
|
|
698
|
+
? worksheetDetailInfo.actualPalletQty === worksheetDetailInfo.palletQty
|
|
699
|
+
: true),
|
|
697
700
|
sku: worksheetDetailInfo.product.sku
|
|
698
701
|
}
|
|
699
702
|
}),
|
|
@@ -760,6 +763,7 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
|
|
|
760
763
|
sku
|
|
761
764
|
isRequiredCheckExpiry
|
|
762
765
|
isRequireSerialNumberScanningInbound
|
|
766
|
+
expirationPeriod
|
|
763
767
|
}
|
|
764
768
|
inventory {
|
|
765
769
|
id
|
|
@@ -786,6 +790,7 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
|
|
|
786
790
|
this._orderNo = orderNo
|
|
787
791
|
const worksheetInfo = response.data.unloadingReturnWorksheet.worksheetInfo
|
|
788
792
|
this._worksheetInfo = worksheetInfo
|
|
793
|
+
this._bizplaceName = worksheetInfo?.bizplaceName
|
|
789
794
|
|
|
790
795
|
this.orderProductData = {
|
|
791
796
|
records: orderBy(
|
|
@@ -845,6 +850,9 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
|
|
|
845
850
|
id
|
|
846
851
|
name
|
|
847
852
|
}
|
|
853
|
+
inventoryItems {
|
|
854
|
+
serialNumber
|
|
855
|
+
}
|
|
848
856
|
}
|
|
849
857
|
}
|
|
850
858
|
`,
|
|
@@ -928,16 +936,19 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
|
|
|
928
936
|
try {
|
|
929
937
|
if (!this._enableCartonLabel) return this._unloadSelected()
|
|
930
938
|
let orderProducts = await this._validateUnloading()
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
return this._scanSerialNumberUnload()
|
|
939
|
+
|
|
940
|
+
if (!orderProducts || !orderProducts.errors) {
|
|
941
|
+
if (orderProducts?.length > 1) {
|
|
942
|
+
this.selectOrderProduct(orderProducts)
|
|
936
943
|
} else {
|
|
937
|
-
if (
|
|
938
|
-
return this.
|
|
944
|
+
if (this._isRequireSerialNumberScanningInbound) {
|
|
945
|
+
return this._scanSerialNumberUnload()
|
|
946
|
+
} else {
|
|
947
|
+
if (!(this._enableProductScanning && (this._enableInputQty < 0 || this._enableInputQty > 3)))
|
|
948
|
+
return this._qtyUnload()
|
|
949
|
+
}
|
|
950
|
+
this._scanProductUnload()
|
|
939
951
|
}
|
|
940
|
-
this._scanProductUnload()
|
|
941
952
|
}
|
|
942
953
|
} catch (e) {
|
|
943
954
|
this._showToast(e)
|
|
@@ -1169,74 +1180,72 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
|
|
|
1169
1180
|
}
|
|
1170
1181
|
|
|
1171
1182
|
async _checkedScannedProduct() {
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
const response = await this.fetchProductDetails(this.productBarcodeInput?.value || '', '')
|
|
1175
|
-
|
|
1176
|
-
if (!response.errors) {
|
|
1177
|
-
let orderProductData = this.orderProductData.records
|
|
1178
|
-
let checkedProductDetails = response.data.checkGtin.items
|
|
1179
|
-
|
|
1180
|
-
//check from grist if any is matched
|
|
1181
|
-
const foundOrderProducts = orderProductData.filter(op => {
|
|
1182
|
-
return checkedProductDetails.some(
|
|
1183
|
-
itm =>
|
|
1184
|
-
itm.product.id == op.product.id && itm.packingType == op.packingType && itm.packingSize == op.packingSize
|
|
1185
|
-
)
|
|
1186
|
-
})
|
|
1183
|
+
//fetch any product details that has entered gtin
|
|
1184
|
+
const response = await this.fetchProductDetails(this.productBarcodeInput?.value.trim() || '', '')
|
|
1187
1185
|
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1186
|
+
if (!response.errors) {
|
|
1187
|
+
let orderProductData = this.orderProductData.records
|
|
1188
|
+
let checkedProductDetails = response.data.checkGtin.items
|
|
1189
|
+
|
|
1190
|
+
//check from grist if any is matched
|
|
1191
|
+
const foundOrderProducts = orderProductData.filter(op => {
|
|
1192
|
+
return checkedProductDetails.some(
|
|
1193
|
+
itm =>
|
|
1194
|
+
itm.product.id == op.product.id && itm.packingType == op.packingType && itm.packingSize == op.packingSize
|
|
1195
|
+
)
|
|
1196
|
+
})
|
|
1191
1197
|
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
if (this.actualQtyInput?.value) this.actualQtyInput.value = ''
|
|
1196
|
-
}
|
|
1198
|
+
const foundParentProducts = orderProductData.filter(op => {
|
|
1199
|
+
return checkedProductDetails.some(itm => itm.product.id == op.product.id)
|
|
1200
|
+
})
|
|
1197
1201
|
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1202
|
+
if (!foundOrderProducts?.length) {
|
|
1203
|
+
if (!foundParentProducts?.length) {
|
|
1204
|
+
if (this._enableInputQty >= 0 && this._enableInputQty < 4 && !this._isRequireSerialNumberScanningInbound) {
|
|
1205
|
+
if (this.actualQtyInput?.value) this.actualQtyInput.value = ''
|
|
1206
|
+
}
|
|
1201
1207
|
|
|
1202
|
-
|
|
1203
|
-
this.
|
|
1204
|
-
throw new Error(i18next.t('text.no_matching_product_found'))
|
|
1208
|
+
if (this._isRequireSerialNumberScanningInbound) {
|
|
1209
|
+
if (this.serialNumberInput?.value) this.serialNumberInput.value = ''
|
|
1205
1210
|
}
|
|
1211
|
+
|
|
1212
|
+
this.productBarcodeInput.value = ''
|
|
1213
|
+
this._focusOnProductBarcodeInput()
|
|
1214
|
+
throw new Error(i18next.t('text.no_matching_product_found'))
|
|
1206
1215
|
}
|
|
1216
|
+
}
|
|
1207
1217
|
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1218
|
+
const product =
|
|
1219
|
+
foundOrderProducts?.length >= 1
|
|
1220
|
+
? foundOrderProducts[0].product
|
|
1221
|
+
: foundOrderProducts?.length == 0 && foundParentProducts?.length > 0
|
|
1222
|
+
? foundParentProducts[0].product
|
|
1223
|
+
: null
|
|
1214
1224
|
|
|
1215
|
-
|
|
1216
|
-
|
|
1225
|
+
if (this._selectedOrderProduct && this._selectedOrderProduct.product.sku !== product.sku)
|
|
1226
|
+
this._selectedOrderProduct = null
|
|
1217
1227
|
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
return foundOrderProducts
|
|
1222
|
-
}
|
|
1223
|
-
} else {
|
|
1228
|
+
if (foundOrderProducts?.length > 1) {
|
|
1229
|
+
if (this._isRequireSerialNumberScanningInbound) {
|
|
1230
|
+
if (!this._selectedOrderProduct) {
|
|
1224
1231
|
return foundOrderProducts
|
|
1225
1232
|
}
|
|
1226
|
-
} else
|
|
1227
|
-
|
|
1228
|
-
this._isRequiredCheckExpiry = product.isRequiredCheckExpiry
|
|
1229
|
-
this._isRequireSerialNumberScanningInbound = product.isRequireSerialNumberScanningInbound
|
|
1230
|
-
this._selectedOrderProduct = foundOrderProducts[0]
|
|
1231
|
-
} else if (foundOrderProducts?.length == 0 && foundParentProducts?.length > 0) {
|
|
1232
|
-
this._expirationPeriod = product.expirationPeriod
|
|
1233
|
-
this._isRequiredCheckExpiry = product.isRequiredCheckExpiry
|
|
1234
|
-
this._isRequireSerialNumberScanningInbound = product.isRequireSerialNumberScanningInbound
|
|
1235
|
-
this._selectedOrderProduct = foundParentProducts[0]
|
|
1233
|
+
} else {
|
|
1234
|
+
return foundOrderProducts
|
|
1236
1235
|
}
|
|
1236
|
+
} else if (foundOrderProducts?.length == 1) {
|
|
1237
|
+
this._expirationPeriod = product.expirationPeriod
|
|
1238
|
+
this._isRequiredCheckExpiry = product.isRequiredCheckExpiry
|
|
1239
|
+
this._isRequireSerialNumberScanningInbound = product.isRequireSerialNumberScanningInbound
|
|
1240
|
+
this._selectedOrderProduct = foundOrderProducts[0]
|
|
1241
|
+
} else if (foundOrderProducts?.length == 0 && foundParentProducts?.length > 0) {
|
|
1242
|
+
this._expirationPeriod = product.expirationPeriod
|
|
1243
|
+
this._isRequiredCheckExpiry = product.isRequiredCheckExpiry
|
|
1244
|
+
this._isRequireSerialNumberScanningInbound = product.isRequireSerialNumberScanningInbound
|
|
1245
|
+
this._selectedOrderProduct = foundParentProducts[0]
|
|
1237
1246
|
}
|
|
1238
|
-
}
|
|
1239
|
-
|
|
1247
|
+
} else {
|
|
1248
|
+
return response
|
|
1240
1249
|
}
|
|
1241
1250
|
}
|
|
1242
1251
|
|
|
@@ -1353,9 +1362,7 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
|
|
|
1353
1362
|
}
|
|
1354
1363
|
}
|
|
1355
1364
|
|
|
1356
|
-
|
|
1357
|
-
return orderProducts
|
|
1358
|
-
}
|
|
1365
|
+
return orderProducts
|
|
1359
1366
|
}
|
|
1360
1367
|
}
|
|
1361
1368
|
|
|
@@ -1554,7 +1561,7 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
|
|
|
1554
1561
|
await this._validateUnloading()
|
|
1555
1562
|
await this._checkedLotScannedProduct()
|
|
1556
1563
|
|
|
1557
|
-
if (this._isRequireSerialNumberScanningInbound) this._scanSerialNumberUnload()
|
|
1564
|
+
if (this._isRequireSerialNumberScanningInbound) return this._scanSerialNumberUnload()
|
|
1558
1565
|
this._qtyUnload()
|
|
1559
1566
|
} catch (e) {
|
|
1560
1567
|
this._showToast(e)
|
|
@@ -1670,7 +1677,10 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
|
|
|
1670
1677
|
|
|
1671
1678
|
if (
|
|
1672
1679
|
!this.orderProductData.records
|
|
1673
|
-
.filter(
|
|
1680
|
+
.filter(
|
|
1681
|
+
task =>
|
|
1682
|
+
(task.palletQty ? task.actualPalletQty !== task.palletQty : false) || task.actualPackQty !== task.packQty
|
|
1683
|
+
)
|
|
1674
1684
|
.every(task => task.issue)
|
|
1675
1685
|
)
|
|
1676
1686
|
throw new Error(i18next.t('text.there_is_no_issue_noted'))
|
|
@@ -8,7 +8,7 @@ import { connect } from 'pwa-helpers/connect-mixin'
|
|
|
8
8
|
|
|
9
9
|
import { getCodeByName } from '@things-factory/code-base'
|
|
10
10
|
import { i18next, localize } from '@things-factory/i18n-base'
|
|
11
|
-
import { client, PageView, store,gqlContext } from '@things-factory/shell'
|
|
11
|
+
import { client, PageView, store, gqlContext } from '@things-factory/shell'
|
|
12
12
|
import { CommonButtonStyles, ScrollbarStyles } from '@things-factory/styles'
|
|
13
13
|
import { isMobileDevice } from '@things-factory/utils'
|
|
14
14
|
import { openPopup } from '@things-factory/layout-base'
|
|
@@ -142,8 +142,7 @@ class InventoryAdjustmentApproval extends connect(store)(localize(i18next)(PageV
|
|
|
142
142
|
{ column: 'manufactureDate', name: 'Mfg. Date' },
|
|
143
143
|
{ column: 'unitCost', name: 'Unit Cost' },
|
|
144
144
|
{ column: 'inventoryItemChange', name: 'Inventory Item Changes' },
|
|
145
|
-
{ column: 'status', name: 'Status' }
|
|
146
|
-
|
|
145
|
+
{ column: 'status', name: 'Status' }
|
|
147
146
|
]
|
|
148
147
|
|
|
149
148
|
this.config = {
|
|
@@ -200,7 +199,7 @@ class InventoryAdjustmentApproval extends connect(store)(localize(i18next)(PageV
|
|
|
200
199
|
|
|
201
200
|
if (item.column == 'status' && record.transactionType == 'MISSING') {
|
|
202
201
|
updatedVal = record.transactionType || '[N/A]'
|
|
203
|
-
}else if(item.column == 'status'){
|
|
202
|
+
} else if (item.column == 'status') {
|
|
204
203
|
updatedVal = '[N/A]'
|
|
205
204
|
}
|
|
206
205
|
|
|
@@ -692,4 +691,4 @@ class InventoryAdjustmentApproval extends connect(store)(localize(i18next)(PageV
|
|
|
692
691
|
}
|
|
693
692
|
}
|
|
694
693
|
|
|
695
|
-
window.customElements.define('inventory-adjustment-approval', InventoryAdjustmentApproval)
|
|
694
|
+
window.customElements.define('inventory-adjustment-approval', InventoryAdjustmentApproval)
|