@things-factory/operato-wms 4.3.105 → 4.3.113-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/client/pages/bulk-operation/bulk-operation.js +9 -15
  2. package/client/pages/components/select-inventory-popup.js +7 -1
  3. package/client/pages/components/select-product-popup.js +31 -2
  4. package/client/pages/inbound/undo-putaway-popup.js +5 -9
  5. package/client/pages/inbound/undo-unload-popup.js +15 -2
  6. package/client/pages/inbound/unload-product.js +72 -67
  7. package/client/pages/inventory/inventory-adjustment-approval.js +4 -5
  8. package/client/pages/inventory/inventory-adjustment.js +7 -0
  9. package/client/pages/inventory-check/check-inventory-popup.js +14 -3
  10. package/client/pages/inventory-check/create-cycle-count.js +2 -3
  11. package/client/pages/inventory-check/inspecting-product.js +25 -7
  12. package/client/pages/inventory-check/inventory-check-list.js +94 -10
  13. package/client/pages/manifest/loading-manifest-detail.js +7 -4
  14. package/client/pages/master/generate-location-list.js +30 -22
  15. package/client/pages/master/location-list.js +134 -71
  16. package/client/pages/master/pallet-list.js +137 -58
  17. package/client/pages/master/product/product-details-popup.js +3 -3
  18. package/client/pages/master/tote-list.js +40 -27
  19. package/client/pages/master/transport-driver.js +50 -41
  20. package/client/pages/master/transport-vehicle.js +45 -41
  21. package/client/pages/master/warehouse-list.js +56 -34
  22. package/client/pages/order/arrival-notice/arrival-notice-detail.js +36 -25
  23. package/client/pages/order/arrival-notice/create-arrival-notice.js +53 -32
  24. package/client/pages/order/arrival-notice/duplicate-arrival-notice.js +2 -0
  25. package/client/pages/order/arrival-notice/edit-product-popup.js +9 -7
  26. package/client/pages/order/draft-release-good/draft-release-good-detail.js +39 -2
  27. package/client/pages/order/release-order/create-release-order.js +22 -5
  28. package/client/pages/order/release-order/release-extra-product-popup.js +4 -1
  29. package/client/pages/order/release-order/release-order-detail.js +24 -0
  30. package/client/pages/order/return-order/create-return-order.js +5 -0
  31. package/client/pages/order/return-order/return-order-inventory-popup.js +1 -0
  32. package/client/pages/order/transport-order/delivery-order-list.js +26 -0
  33. package/client/pages/outbound/inventory-reassign-popup.js +6 -0
  34. package/client/pages/outbound/packing-product.js +5 -5
  35. package/client/pages/outbound/packing-worksheet-list.js +3 -1
  36. package/client/pages/outbound/picking-product.js +18 -7
  37. package/client/pages/outbound/show-my-worksheet-list-popup.js +12 -3
  38. package/client/pages/report/custom-elccl/elccl-daily-collection-report.js +5 -2
  39. package/client/pages/report/custom-elccl/elccl-daily-order-inventory-report.js +2 -2
  40. package/client/pages/report/custom-elccl/elccl-delivery-order-summary.js +48 -8
  41. package/dist-server/graphql/resolvers/custom/elccl/elccl-inventory-history-report.js +4 -5
  42. package/dist-server/graphql/resolvers/custom/elccl/elccl-inventory-history-report.js.map +1 -1
  43. package/dist-server/graphql/resolvers/other/add-release-good-products.js +7 -11
  44. package/dist-server/graphql/resolvers/other/add-release-good-products.js.map +1 -1
  45. package/dist-server/graphql/resolvers/reports/costing-report.js +18 -24
  46. package/dist-server/graphql/resolvers/reports/costing-report.js.map +1 -1
  47. package/dist-server/graphql/resolvers/reports/inbound-order-details-report.js +6 -6
  48. package/dist-server/graphql/resolvers/reports/outbound-order-details-report.js +5 -6
  49. package/dist-server/graphql/resolvers/reports/outbound-order-details-report.js.map +1 -1
  50. package/dist-server/graphql/resolvers/reports/release-inventory-report.js +3 -3
  51. package/dist-server/graphql/resolvers/reports/release-inventory-report.js.map +1 -1
  52. package/package.json +50 -50
  53. package/server/graphql/resolvers/custom/elccl/elccl-inventory-history-report.ts +4 -5
  54. package/server/graphql/resolvers/other/add-release-good-products.ts +8 -12
  55. package/server/graphql/resolvers/reports/costing-report.ts +18 -24
  56. package/server/graphql/resolvers/reports/inbound-order-details-report.ts +6 -6
  57. package/server/graphql/resolvers/reports/outbound-order-details-report.ts +5 -6
  58. package/server/graphql/resolvers/reports/release-inventory-report.ts +6 -4
  59. package/translations/en.json +27 -12
  60. package/translations/ko.json +25 -10
  61. package/translations/ms.json +25 -10
  62. package/translations/zh.json +18 -3
@@ -404,8 +404,11 @@ class BulkOperation extends localize(i18next)(PageView) {
404
404
  html`
405
405
  <validate-gan-popup
406
406
  .records=${records.map(raw => {
407
- let etaDate = new Date((raw.etaDate - (25567 + 1)) * 86400 * 1000 || null)
408
- let mfgDate = new Date((raw.manufactureDate - (25567 + 1)) * 86400 * 1000 || null)
407
+ // let etaDate = new Date((raw.etaDate - (25567 + 1)) * 86400 * 1000 || null)
408
+ // let mfgDate = new Date((raw.manufactureDate - (25567 + 1)) * 86400 * 1000 || null)
409
+
410
+ let etaDate = new Date(String(raw.etaDate || ''))
411
+ let mfgDate = new Date(String(raw.manufactureDate || ''))
409
412
 
410
413
  return {
411
414
  refNo: String(raw.refNo || ''),
@@ -426,14 +429,8 @@ class BulkOperation extends localize(i18next)(PageView) {
426
429
  packQty: parseInt(raw.packQty || 0),
427
430
  palletQty: parseInt(raw.palletQty || 0),
428
431
  unitPrice: Number(raw.unitPrice || 0),
429
- manufactureDate: `${mfgDate.getFullYear()}-${(mfgDate.getMonth() + 1).toString().padStart(2, 0)}-${mfgDate
430
- .getDate()
431
- .toString()
432
- .padStart(2, 0)}`,
433
- etaDate: `${etaDate.getFullYear()}-${(etaDate.getMonth() + 1).toString().padStart(2, 0)}-${etaDate
434
- .getDate()
435
- .toString()
436
- .padStart(2, 0)}`
432
+ manufactureDate: this._getStdDateStr(mfgDate),
433
+ etaDate: this._getStdDateStr(etaDate)
437
434
  }
438
435
  })}
439
436
  .ganProcessing=${this.ganProcessingSetting}
@@ -477,14 +474,11 @@ class BulkOperation extends localize(i18next)(PageView) {
477
474
  country: String(record.country || ''),
478
475
  sku: String(record.sku || ''),
479
476
  productId: String(record.productId || ''),
477
+ productDetailId: String(record.productDetailId || ''),
480
478
  packingType: record.packingType && record.packingType != '' ? String(record.packingType) : null,
481
479
  packingSize: !isNaN(Number(record.packingSize || 'x')) ? Number(record.packingSize) : null,
482
480
  uom: record.uom && record.uom != '' ? String(record.uom) : null,
483
- releaseQty: Number(record.releaseQty)
484
- ? Math.floor(Number(record.releaseQty)) < 1
485
- ? 1
486
- : Math.floor(Number(record.releaseQty))
487
- : null,
481
+ releaseQty: parseInt(record.releaseQty),
488
482
  postalCode: String(record.postalCode || ''),
489
483
  phone1: String(record.phone1 || ''),
490
484
  exportOption: false,
@@ -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' },
@@ -229,6 +230,7 @@ class SelectProductPopup extends localize(i18next)(LitElement) {
229
230
  response.data.productDetails.items.map(item => {
230
231
  return {
231
232
  ...item,
233
+ productName: item.product.name,
232
234
  productId: item.product.id,
233
235
  sku: item.product.sku,
234
236
  brand: item.product.brand,
@@ -240,7 +242,34 @@ class SelectProductPopup extends localize(i18next)(LitElement) {
240
242
  }
241
243
  }
242
244
 
243
- selectProduct() {
245
+ _dblClickHandler(columns, data, column, record, rowIndex, target) {
246
+ if (this.selectMultipleProducts) return
247
+ this.dispatchEvent(
248
+ new CustomEvent('selected', {
249
+ detail: {
250
+ productDetailId: record.id,
251
+ packingType: record.packingType,
252
+ uom: record.uom,
253
+ uomValue: record.uomValue,
254
+ productName: `${record.name}(${record.description}(${record.sku}))`,
255
+ isError: false,
256
+ productBrand: record.brand,
257
+ product: {
258
+ id: record.productId,
259
+ name: record.name,
260
+ sku: record.sku,
261
+ packingType: record.packingType,
262
+ packingSize: record.packingSize,
263
+ primaryUnit: record.uom,
264
+ primaryValue: record.uomValue
265
+ }
266
+ }
267
+ })
268
+ )
269
+ history.back()
270
+ }
271
+
272
+ selectProduct(record) {
244
273
  if (this.selectMultipleProducts !== true) {
245
274
  const selectedProduct = this.productGrist.selected[0]
246
275
  if (selectedProduct) {
@@ -202,11 +202,8 @@ class UndoPutawayPopup extends connect(store)(localize(i18next)(LitElement)) {
202
202
  async _undoPutaway() {
203
203
  try {
204
204
  let selectedInventories = []
205
- if (this._autoSelectInventory?.length) {
206
- selectedInventories = this._autoSelectInventory
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
  }
@@ -6,7 +6,7 @@ import { connect } from 'pwa-helpers/connect-mixin'
6
6
 
7
7
  import { SingleColumnFormStyles } from '@things-factory/form-ui'
8
8
  import { i18next, localize } from '@things-factory/i18n-base'
9
- import { client, store } from '@things-factory/shell'
9
+ import { client, store, CustomAlert } from '@things-factory/shell'
10
10
  import { isMobileDevice } from '@things-factory/utils'
11
11
 
12
12
  class UndoUnloadPopup extends connect(store)(localize(i18next)(LitElement)) {
@@ -214,6 +214,16 @@ class UndoUnloadPopup extends connect(store)(localize(i18next)(LitElement)) {
214
214
 
215
215
  async _undoUnloading() {
216
216
  try {
217
+ if (this.dataGrist.selected.some(s => s.inventoryItems?.length > 0)) {
218
+ const result = await CustomAlert({
219
+ title: i18next.t('title.are_you_sure'),
220
+ text: i18next.t('text.all_related_serial_number_will_be_deleted'),
221
+ confirmButton: { text: i18next.t('button.confirm') },
222
+ cancelButton: { text: i18next.t('button.cancel') }
223
+ })
224
+
225
+ if (!result.value) return
226
+ }
217
227
  let selectedInventoryIds = []
218
228
  selectedInventoryIds = this.dataGrist.selected.map(inventory => inventory.id)
219
229
 
@@ -267,7 +277,10 @@ class UndoUnloadPopup extends connect(store)(localize(i18next)(LitElement)) {
267
277
  return { ...itm, sku: itm.product.sku }
268
278
  })
269
279
  }
270
- this._selectedRecords = targetedUndoInventories?.length == 1 ? targetedUndoInventories : []
280
+ if (targetedUndoInventories?.length == 1) {
281
+ this._selectedRecords = targetedUndoInventories
282
+ this.data.records[0].__selected__ = true
283
+ }
271
284
  }
272
285
  } catch (e) {
273
286
  this._showToast(e)
@@ -576,6 +576,7 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
576
576
  description
577
577
  isRequiredCheckExpiry
578
578
  isRequireSerialNumberScanningInbound
579
+ expirationPeriod
579
580
  }
580
581
  name
581
582
  targetName
@@ -699,6 +700,7 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
699
700
  sku
700
701
  isRequiredCheckExpiry
701
702
  isRequireSerialNumberScanningInbound
703
+ expirationPeriod
702
704
  }
703
705
  inventory {
704
706
  id
@@ -725,6 +727,7 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
725
727
  this._orderNo = orderNo
726
728
  const worksheetInfo = response.data.unloadingReturnWorksheet.worksheetInfo
727
729
  this._worksheetInfo = worksheetInfo
730
+ this._bizplaceName = worksheetInfo?.bizplaceName
728
731
 
729
732
  this.orderProductData = {
730
733
  records: orderBy(
@@ -784,6 +787,9 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
784
787
  id
785
788
  name
786
789
  }
790
+ inventoryItems {
791
+ serialNumber
792
+ }
787
793
  }
788
794
  }
789
795
  `,
@@ -867,16 +873,19 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
867
873
  try {
868
874
  if (!this._enableCartonLabel) return this._unloadSelected()
869
875
  let orderProducts = await this._validateUnloading()
870
- if (orderProducts?.length > 1) {
871
- this.selectOrderProduct(orderProducts)
872
- } else {
873
- if (this._isRequireSerialNumberScanningInbound) {
874
- return this._scanSerialNumberUnload()
876
+
877
+ if (!orderProducts || !orderProducts.errors) {
878
+ if (orderProducts?.length > 1) {
879
+ this.selectOrderProduct(orderProducts)
875
880
  } else {
876
- if (!(this._enableProductScanning && (this._enableInputQty < 0 || this._enableInputQty > 3)))
877
- return this._qtyUnload()
881
+ if (this._isRequireSerialNumberScanningInbound) {
882
+ return this._scanSerialNumberUnload()
883
+ } else {
884
+ if (!(this._enableProductScanning && (this._enableInputQty < 0 || this._enableInputQty > 3)))
885
+ return this._qtyUnload()
886
+ }
887
+ this._scanProductUnload()
878
888
  }
879
- this._scanProductUnload()
880
889
  }
881
890
  } catch (e) {
882
891
  this._showToast(e)
@@ -1108,74 +1117,72 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
1108
1117
  }
1109
1118
 
1110
1119
  async _checkedScannedProduct() {
1111
- try {
1112
- //fetch any product details that has entered gtin
1113
- const response = await this.fetchProductDetails(this.productBarcodeInput?.value || '', '')
1120
+ //fetch any product details that has entered gtin
1121
+ const response = await this.fetchProductDetails(this.productBarcodeInput?.value.trim() || '', '')
1114
1122
 
1115
- if (!response.errors) {
1116
- let orderProductData = this.orderProductData.records
1117
- let checkedProductDetails = response.data.checkGtin.items
1118
-
1119
- //check from grist if any is matched
1120
- const foundOrderProducts = orderProductData.filter(op => {
1121
- return checkedProductDetails.some(
1122
- itm =>
1123
- itm.product.id == op.product.id && itm.packingType == op.packingType && itm.packingSize == op.packingSize
1124
- )
1125
- })
1126
-
1127
- const foundParentProducts = orderProductData.filter(op => {
1128
- return checkedProductDetails.some(itm => itm.product.id == op.product.id)
1129
- })
1123
+ if (!response.errors) {
1124
+ let orderProductData = this.orderProductData.records
1125
+ let checkedProductDetails = response.data.checkGtin.items
1126
+
1127
+ //check from grist if any is matched
1128
+ const foundOrderProducts = orderProductData.filter(op => {
1129
+ return checkedProductDetails.some(
1130
+ itm =>
1131
+ itm.product.id == op.product.id && itm.packingType == op.packingType && itm.packingSize == op.packingSize
1132
+ )
1133
+ })
1130
1134
 
1131
- if (!foundOrderProducts?.length) {
1132
- if (!foundParentProducts?.length) {
1133
- if (this._enableInputQty >= 0 && this._enableInputQty < 4 && !this._isRequireSerialNumberScanningInbound) {
1134
- if (this.actualQtyInput?.value) this.actualQtyInput.value = ''
1135
- }
1135
+ const foundParentProducts = orderProductData.filter(op => {
1136
+ return checkedProductDetails.some(itm => itm.product.id == op.product.id)
1137
+ })
1136
1138
 
1137
- if (this._isRequireSerialNumberScanningInbound) {
1138
- if (this.serialNumberInput?.value) this.serialNumberInput.value = ''
1139
- }
1139
+ if (!foundOrderProducts?.length) {
1140
+ if (!foundParentProducts?.length) {
1141
+ if (this._enableInputQty >= 0 && this._enableInputQty < 4 && !this._isRequireSerialNumberScanningInbound) {
1142
+ if (this.actualQtyInput?.value) this.actualQtyInput.value = ''
1143
+ }
1140
1144
 
1141
- this.productBarcodeInput.value = ''
1142
- this._focusOnProductBarcodeInput()
1143
- throw new Error(i18next.t('text.no_matching_product_found'))
1145
+ if (this._isRequireSerialNumberScanningInbound) {
1146
+ if (this.serialNumberInput?.value) this.serialNumberInput.value = ''
1144
1147
  }
1148
+
1149
+ this.productBarcodeInput.value = ''
1150
+ this._focusOnProductBarcodeInput()
1151
+ throw new Error(i18next.t('text.no_matching_product_found'))
1145
1152
  }
1153
+ }
1146
1154
 
1147
- const product =
1148
- foundOrderProducts?.length >= 1
1149
- ? foundOrderProducts[0].product
1150
- : foundOrderProducts?.length == 0 && foundParentProducts?.length > 0
1151
- ? foundParentProducts[0].product
1152
- : null
1155
+ const product =
1156
+ foundOrderProducts?.length >= 1
1157
+ ? foundOrderProducts[0].product
1158
+ : foundOrderProducts?.length == 0 && foundParentProducts?.length > 0
1159
+ ? foundParentProducts[0].product
1160
+ : null
1153
1161
 
1154
- if (this._selectedOrderProduct && this._selectedOrderProduct.product.sku !== product.sku)
1155
- this._selectedOrderProduct = null
1162
+ if (this._selectedOrderProduct && this._selectedOrderProduct.product.sku !== product.sku)
1163
+ this._selectedOrderProduct = null
1156
1164
 
1157
- if (foundOrderProducts?.length > 1) {
1158
- if (this._isRequireSerialNumberScanningInbound) {
1159
- if (!this._selectedOrderProduct) {
1160
- return foundOrderProducts
1161
- }
1162
- } else {
1165
+ if (foundOrderProducts?.length > 1) {
1166
+ if (this._isRequireSerialNumberScanningInbound) {
1167
+ if (!this._selectedOrderProduct) {
1163
1168
  return foundOrderProducts
1164
1169
  }
1165
- } else if (foundOrderProducts?.length == 1) {
1166
- this._expirationPeriod = product.expirationPeriod
1167
- this._isRequiredCheckExpiry = product.isRequiredCheckExpiry
1168
- this._isRequireSerialNumberScanningInbound = product.isRequireSerialNumberScanningInbound
1169
- this._selectedOrderProduct = foundOrderProducts[0]
1170
- } else if (foundOrderProducts?.length == 0 && foundParentProducts?.length > 0) {
1171
- this._expirationPeriod = product.expirationPeriod
1172
- this._isRequiredCheckExpiry = product.isRequiredCheckExpiry
1173
- this._isRequireSerialNumberScanningInbound = product.isRequireSerialNumberScanningInbound
1174
- this._selectedOrderProduct = foundParentProducts[0]
1170
+ } else {
1171
+ return foundOrderProducts
1175
1172
  }
1173
+ } else if (foundOrderProducts?.length == 1) {
1174
+ this._expirationPeriod = product.expirationPeriod
1175
+ this._isRequiredCheckExpiry = product.isRequiredCheckExpiry
1176
+ this._isRequireSerialNumberScanningInbound = product.isRequireSerialNumberScanningInbound
1177
+ this._selectedOrderProduct = foundOrderProducts[0]
1178
+ } else if (foundOrderProducts?.length == 0 && foundParentProducts?.length > 0) {
1179
+ this._expirationPeriod = product.expirationPeriod
1180
+ this._isRequiredCheckExpiry = product.isRequiredCheckExpiry
1181
+ this._isRequireSerialNumberScanningInbound = product.isRequireSerialNumberScanningInbound
1182
+ this._selectedOrderProduct = foundParentProducts[0]
1176
1183
  }
1177
- } catch (e) {
1178
- this._showToast(e)
1184
+ } else {
1185
+ return response
1179
1186
  }
1180
1187
  }
1181
1188
 
@@ -1292,9 +1299,7 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
1292
1299
  }
1293
1300
  }
1294
1301
 
1295
- if (orderProducts?.length > 1) {
1296
- return orderProducts
1297
- }
1302
+ return orderProducts
1298
1303
  }
1299
1304
  }
1300
1305
 
@@ -1493,7 +1498,7 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
1493
1498
  await this._validateUnloading()
1494
1499
  await this._checkedLotScannedProduct()
1495
1500
 
1496
- if (this._isRequireSerialNumberScanningInbound) this._scanSerialNumberUnload()
1501
+ if (this._isRequireSerialNumberScanningInbound) return this._scanSerialNumberUnload()
1497
1502
  this._qtyUnload()
1498
1503
  } catch (e) {
1499
1504
  this._showToast(e)
@@ -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)
@@ -586,6 +586,9 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
586
586
  isRequireSerialNumberScanningOutbound
587
587
  isRequireSerialNumberScanningInbound
588
588
  }
589
+ productDetail {
590
+ id
591
+ }
589
592
  qty
590
593
  lockedQty
591
594
  warehouse {
@@ -654,6 +657,9 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
654
657
  description
655
658
  productInformation
656
659
  }
660
+ productDetail {
661
+ id
662
+ }
657
663
  qty
658
664
  lockedQty
659
665
  warehouse {
@@ -898,6 +904,7 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
898
904
 
899
905
  row.bizplace = row.bizplace ? { id: row.bizplace.id } : undefined
900
906
  row.location = row.location ? { id: row.location.id } : undefined
907
+ row.productDetailId = row.product ? row.product.id : undefined
901
908
  row.product = row.product ? { id: row.product.productId } : undefined
902
909
  row.uomValue = row.uomValue ? parseFloat(row.uomValue) : undefined
903
910
  row.unitCost = row.unitCost ? parseFloat(row.unitCost) : undefined
@@ -127,7 +127,7 @@ class CheckInventoryPopup extends localize(i18next)(LitElement) {
127
127
 
128
128
  async _checkPalletId() {
129
129
  try {
130
- this._validateInput()
130
+ await this._validateInput()
131
131
 
132
132
  const isInventoryOwner = await this._checkInventoryOwnership(this.palletIdInput.value, this.bizplaceName)
133
133
  if (!isInventoryOwner)
@@ -149,7 +149,17 @@ class CheckInventoryPopup extends localize(i18next)(LitElement) {
149
149
  )
150
150
  } else {
151
151
  const invInfo = await this._checkCurrentLocationinCC(this.palletIdInput.value, this.cycleCountNo)
152
- if (invInfo.currentLocation !== this.locationInput.value) {
152
+
153
+ if (!invInfo) {
154
+ this.dispatchEvent(
155
+ new CustomEvent('not-in-cc', {
156
+ detail: {
157
+ palletId: this.palletIdInput.value,
158
+ cycleCountNo: this.cycleCountNo
159
+ }
160
+ })
161
+ )
162
+ } else if (invInfo?.currentLocation !== this.locationInput.value) {
153
163
  this.dispatchEvent(
154
164
  new CustomEvent('relocate-inventory', {
155
165
  detail: {
@@ -170,7 +180,6 @@ class CheckInventoryPopup extends localize(i18next)(LitElement) {
170
180
  }
171
181
  }
172
182
  } catch (e) {
173
- history.back()
174
183
  this._showToast(e)
175
184
  }
176
185
  }
@@ -223,6 +232,8 @@ class CheckInventoryPopup extends localize(i18next)(LitElement) {
223
232
 
224
233
  if (!response.errors) {
225
234
  return response.data.checkStockTakeCurrentLocation
235
+ } else {
236
+ return response.errors
226
237
  }
227
238
  } catch (e) {
228
239
  this.showToast(e)
@@ -166,6 +166,7 @@ class CreateCycleCount extends localize(i18next)(PageView) {
166
166
  descriptionField: 'productName',
167
167
  select: [
168
168
  { name: 'productId', hidden: true },
169
+ { name: 'productDetailId', hidden: true },
169
170
  { name: 'remainUomValue', hidden: true },
170
171
  { name: 'uom', hidden: true },
171
172
  { name: 'batchId', header: i18next.t('field.batch_id') },
@@ -553,9 +554,7 @@ class CreateCycleCount extends localize(i18next)(PageView) {
553
554
  return {
554
555
  batchId: itm.batchId,
555
556
  batchIdRef: itm.batchIdRef,
556
- packingSize: itm.packingSize,
557
- packingType: itm.packingType,
558
- productId: itm.productId
557
+ productDetailId: itm.productDetailId
559
558
  }
560
559
  }) || []
561
560
 
@@ -331,10 +331,16 @@ class InspectingProduct extends connect(store)(localize(i18next)(PageView)) {
331
331
  }
332
332
 
333
333
  get locationInput() {
334
- if (this.viewType === VIEW_TYPE.INVENTORY_SELECTED) {
335
- return this.renderRoot.querySelector('input[name=location]')
336
- } else {
334
+ // if (this.viewType === VIEW_TYPE.INVENTORY_SELECTED) {
335
+ // return this.renderRoot.querySelector('input[name=location]')
336
+ // } else {
337
+ // return this.renderRoot.querySelector('barcode-scanable-input[name=location]').renderRoot.querySelector('input')
338
+ // }
339
+
340
+ if (this.renderRoot.querySelector('barcode-scanable-input[name=location]').renderRoot.querySelector('input')) {
337
341
  return this.renderRoot.querySelector('barcode-scanable-input[name=location]').renderRoot.querySelector('input')
342
+ } else {
343
+ return this.renderRoot.querySelector('input[name=location]')
338
344
  }
339
345
  }
340
346
 
@@ -833,7 +839,7 @@ class InspectingProduct extends connect(store)(localize(i18next)(PageView)) {
833
839
 
834
840
  async addExtraPallet() {
835
841
  try {
836
- this.checkInputFormValidity()
842
+ await this.checkInputFormValidity()
837
843
 
838
844
  const palletId = this.palletIdInput.value
839
845
 
@@ -993,13 +999,25 @@ class InspectingProduct extends connect(store)(localize(i18next)(PageView)) {
993
999
  this.viewType = VIEW_TYPE.INVENTORY_SELECTED
994
1000
  this.updateContext(this.viewType)
995
1001
  this.selectedInventory = e.detail.recordInformation
996
- this.locationInput.value = e.detail.locationInput
997
1002
  await CustomAlert({
998
1003
  title: i18next.t('title.inventory_in_current_location'),
999
1004
  text: i18next.t('text.kindly_continue_inspect_the_inventory'),
1000
1005
  confirmButton: { text: i18next.t('button.okay') }
1001
1006
  })
1002
1007
  }}"
1008
+ @not-in-cc="${async e => {
1009
+ history.back()
1010
+ this.viewType = VIEW_TYPE.INVENTORY_SELECTED
1011
+ this.updateContext(this.viewType)
1012
+ await CustomAlert({
1013
+ title: i18next.t('title.inventory_not_found'),
1014
+ text: i18next.t('text.pallet_(x)_is_not_found_in_cycle_count_worksheet_(y)', {
1015
+ x: e.detail.palletId,
1016
+ y: e.detail.cycleCountNo
1017
+ }),
1018
+ confirmButton: { text: i18next.t('button.okay') }
1019
+ })
1020
+ }}"
1003
1021
  ></check-inventory-popup>
1004
1022
  `,
1005
1023
  {
@@ -1276,7 +1294,7 @@ class InspectingProduct extends connect(store)(localize(i18next)(PageView)) {
1276
1294
  return response.data.checkInventoryOwner
1277
1295
  }
1278
1296
  } catch (e) {
1279
- this.showToast(e)
1297
+ return false
1280
1298
  }
1281
1299
  }
1282
1300
 
@@ -1348,7 +1366,7 @@ class InspectingProduct extends connect(store)(localize(i18next)(PageView)) {
1348
1366
  throw new Error(i18next.t('text.x_should_be_positive', { state: { x: i18next.t('field.inspected_uom_value') } }))
1349
1367
  }
1350
1368
 
1351
- const locationName = this.locationInput.value
1369
+ const locationName = this.locationInput?.value
1352
1370
  if (!locationName) {
1353
1371
  this.selectOnInput(this.locationInput)
1354
1372
  throw new Error(i18next.t('text.invalid_x', { state: { x: i18next.t('label.location') } }))