@things-factory/operato-wms 4.3.103 → 4.3.105-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 (52) hide show
  1. package/client/pages/bulk-operation/bulk-operation.js +8 -10
  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 +71 -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/create-cycle-count.js +2 -3
  10. package/client/pages/inventory-check/inventory-check-list.js +94 -10
  11. package/client/pages/manifest/loading-manifest-detail.js +7 -4
  12. package/client/pages/master/generate-location-list.js +30 -22
  13. package/client/pages/master/location-list.js +114 -73
  14. package/client/pages/master/pallet-list.js +88 -58
  15. package/client/pages/master/product/product-details-popup.js +3 -3
  16. package/client/pages/master/tote-list.js +35 -27
  17. package/client/pages/master/transport-driver.js +50 -41
  18. package/client/pages/master/transport-vehicle.js +45 -41
  19. package/client/pages/master/warehouse-list.js +56 -34
  20. package/client/pages/order/arrival-notice/arrival-notice-detail.js +36 -25
  21. package/client/pages/order/arrival-notice/create-arrival-notice.js +53 -32
  22. package/client/pages/order/arrival-notice/duplicate-arrival-notice.js +2 -0
  23. package/client/pages/order/arrival-notice/edit-product-popup.js +9 -7
  24. package/client/pages/order/draft-release-good/draft-release-good-detail.js +7 -1
  25. package/client/pages/order/release-order/create-release-order.js +24 -5
  26. package/client/pages/order/release-order/release-extra-product-popup.js +4 -1
  27. package/client/pages/order/release-order/release-order-detail.js +4 -0
  28. package/client/pages/order/return-order/create-return-order.js +1 -0
  29. package/client/pages/order/return-order/return-order-inventory-popup.js +1 -0
  30. package/client/pages/outbound/inventory-reassign-popup.js +6 -0
  31. package/client/pages/outbound/packing-product.js +115 -13
  32. package/client/pages/outbound/picking-product.js +44 -32
  33. package/config.development.js +27 -33
  34. package/dist-server/graphql/resolvers/custom/elccl/elccl-inventory-history-report.js +4 -5
  35. package/dist-server/graphql/resolvers/custom/elccl/elccl-inventory-history-report.js.map +1 -1
  36. package/dist-server/graphql/resolvers/other/add-release-good-products.js +7 -11
  37. package/dist-server/graphql/resolvers/other/add-release-good-products.js.map +1 -1
  38. package/dist-server/graphql/resolvers/reports/costing-report.js +18 -24
  39. package/dist-server/graphql/resolvers/reports/costing-report.js.map +1 -1
  40. package/dist-server/graphql/resolvers/reports/inbound-order-details-report.js +6 -6
  41. package/dist-server/graphql/resolvers/reports/outbound-order-details-report.js +5 -6
  42. package/dist-server/graphql/resolvers/reports/outbound-order-details-report.js.map +1 -1
  43. package/package.json +50 -50
  44. package/server/graphql/resolvers/custom/elccl/elccl-inventory-history-report.ts +4 -5
  45. package/server/graphql/resolvers/other/add-release-good-products.ts +8 -12
  46. package/server/graphql/resolvers/reports/costing-report.ts +18 -24
  47. package/server/graphql/resolvers/reports/inbound-order-details-report.ts +6 -6
  48. package/server/graphql/resolvers/reports/outbound-order-details-report.ts +5 -6
  49. package/translations/en.json +11 -10
  50. package/translations/ko.json +11 -10
  51. package/translations/ms.json +11 -10
  52. package/translations/zh.json +4 -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,6 +474,7 @@ 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,
@@ -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
@@ -784,6 +786,9 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
784
786
  id
785
787
  name
786
788
  }
789
+ inventoryItems {
790
+ serialNumber
791
+ }
787
792
  }
788
793
  }
789
794
  `,
@@ -867,16 +872,19 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
867
872
  try {
868
873
  if (!this._enableCartonLabel) return this._unloadSelected()
869
874
  let orderProducts = await this._validateUnloading()
870
- if (orderProducts?.length > 1) {
871
- this.selectOrderProduct(orderProducts)
872
- } else {
873
- if (this._isRequireSerialNumberScanningInbound) {
874
- return this._scanSerialNumberUnload()
875
+
876
+ if (!orderProducts || !orderProducts.errors) {
877
+ if (orderProducts?.length > 1) {
878
+ this.selectOrderProduct(orderProducts)
875
879
  } else {
876
- if (!(this._enableProductScanning && (this._enableInputQty < 0 || this._enableInputQty > 3)))
877
- return this._qtyUnload()
880
+ if (this._isRequireSerialNumberScanningInbound) {
881
+ return this._scanSerialNumberUnload()
882
+ } else {
883
+ if (!(this._enableProductScanning && (this._enableInputQty < 0 || this._enableInputQty > 3)))
884
+ return this._qtyUnload()
885
+ }
886
+ this._scanProductUnload()
878
887
  }
879
- this._scanProductUnload()
880
888
  }
881
889
  } catch (e) {
882
890
  this._showToast(e)
@@ -1108,74 +1116,72 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
1108
1116
  }
1109
1117
 
1110
1118
  async _checkedScannedProduct() {
1111
- try {
1112
- //fetch any product details that has entered gtin
1113
- const response = await this.fetchProductDetails(this.productBarcodeInput?.value || '', '')
1119
+ //fetch any product details that has entered gtin
1120
+ const response = await this.fetchProductDetails(this.productBarcodeInput?.value.trim() || '', '')
1114
1121
 
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
- })
1122
+ if (!response.errors) {
1123
+ let orderProductData = this.orderProductData.records
1124
+ let checkedProductDetails = response.data.checkGtin.items
1125
+
1126
+ //check from grist if any is matched
1127
+ const foundOrderProducts = orderProductData.filter(op => {
1128
+ return checkedProductDetails.some(
1129
+ itm =>
1130
+ itm.product.id == op.product.id && itm.packingType == op.packingType && itm.packingSize == op.packingSize
1131
+ )
1132
+ })
1130
1133
 
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
- }
1134
+ const foundParentProducts = orderProductData.filter(op => {
1135
+ return checkedProductDetails.some(itm => itm.product.id == op.product.id)
1136
+ })
1136
1137
 
1137
- if (this._isRequireSerialNumberScanningInbound) {
1138
- if (this.serialNumberInput?.value) this.serialNumberInput.value = ''
1139
- }
1138
+ if (!foundOrderProducts?.length) {
1139
+ if (!foundParentProducts?.length) {
1140
+ if (this._enableInputQty >= 0 && this._enableInputQty < 4 && !this._isRequireSerialNumberScanningInbound) {
1141
+ if (this.actualQtyInput?.value) this.actualQtyInput.value = ''
1142
+ }
1140
1143
 
1141
- this.productBarcodeInput.value = ''
1142
- this._focusOnProductBarcodeInput()
1143
- throw new Error(i18next.t('text.no_matching_product_found'))
1144
+ if (this._isRequireSerialNumberScanningInbound) {
1145
+ if (this.serialNumberInput?.value) this.serialNumberInput.value = ''
1144
1146
  }
1147
+
1148
+ this.productBarcodeInput.value = ''
1149
+ this._focusOnProductBarcodeInput()
1150
+ throw new Error(i18next.t('text.no_matching_product_found'))
1145
1151
  }
1152
+ }
1146
1153
 
1147
- const product =
1148
- foundOrderProducts?.length >= 1
1149
- ? foundOrderProducts[0].product
1150
- : foundOrderProducts?.length == 0 && foundParentProducts?.length > 0
1151
- ? foundParentProducts[0].product
1152
- : null
1154
+ const product =
1155
+ foundOrderProducts?.length >= 1
1156
+ ? foundOrderProducts[0].product
1157
+ : foundOrderProducts?.length == 0 && foundParentProducts?.length > 0
1158
+ ? foundParentProducts[0].product
1159
+ : null
1153
1160
 
1154
- if (this._selectedOrderProduct && this._selectedOrderProduct.product.sku !== product.sku)
1155
- this._selectedOrderProduct = null
1161
+ if (this._selectedOrderProduct && this._selectedOrderProduct.product.sku !== product.sku)
1162
+ this._selectedOrderProduct = null
1156
1163
 
1157
- if (foundOrderProducts?.length > 1) {
1158
- if (this._isRequireSerialNumberScanningInbound) {
1159
- if (!this._selectedOrderProduct) {
1160
- return foundOrderProducts
1161
- }
1162
- } else {
1164
+ if (foundOrderProducts?.length > 1) {
1165
+ if (this._isRequireSerialNumberScanningInbound) {
1166
+ if (!this._selectedOrderProduct) {
1163
1167
  return foundOrderProducts
1164
1168
  }
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]
1169
+ } else {
1170
+ return foundOrderProducts
1175
1171
  }
1172
+ } else if (foundOrderProducts?.length == 1) {
1173
+ this._expirationPeriod = product.expirationPeriod
1174
+ this._isRequiredCheckExpiry = product.isRequiredCheckExpiry
1175
+ this._isRequireSerialNumberScanningInbound = product.isRequireSerialNumberScanningInbound
1176
+ this._selectedOrderProduct = foundOrderProducts[0]
1177
+ } else if (foundOrderProducts?.length == 0 && foundParentProducts?.length > 0) {
1178
+ this._expirationPeriod = product.expirationPeriod
1179
+ this._isRequiredCheckExpiry = product.isRequiredCheckExpiry
1180
+ this._isRequireSerialNumberScanningInbound = product.isRequireSerialNumberScanningInbound
1181
+ this._selectedOrderProduct = foundParentProducts[0]
1176
1182
  }
1177
- } catch (e) {
1178
- this._showToast(e)
1183
+ } else {
1184
+ return response
1179
1185
  }
1180
1186
  }
1181
1187
 
@@ -1292,9 +1298,7 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
1292
1298
  }
1293
1299
  }
1294
1300
 
1295
- if (orderProducts?.length > 1) {
1296
- return orderProducts
1297
- }
1301
+ return orderProducts
1298
1302
  }
1299
1303
  }
1300
1304
 
@@ -1493,7 +1497,7 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
1493
1497
  await this._validateUnloading()
1494
1498
  await this._checkedLotScannedProduct()
1495
1499
 
1496
- if (this._isRequireSerialNumberScanningInbound) this._scanSerialNumberUnload()
1500
+ if (this._isRequireSerialNumberScanningInbound) return this._scanSerialNumberUnload()
1497
1501
  this._qtyUnload()
1498
1502
  } catch (e) {
1499
1503
  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
@@ -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
 
@@ -170,56 +170,105 @@ class InventoryCheckList extends localize(i18next)(PageView) {
170
170
  name: 'inventoryCheck',
171
171
  header: i18next.t('field.inventory_check_no'),
172
172
  sortable: true,
173
- width: 150
173
+ width: 150,
174
+ imex: {
175
+ header: i18next.t('field.inventory_check_no'),
176
+ key: 'inventoryCheck.name',
177
+ width: 50,
178
+ type: 'string'
179
+ }
174
180
  },
175
181
  {
176
182
  type: 'object',
177
183
  name: 'bizplace',
178
184
  header: i18next.t('field.company'),
179
185
  sortable: true,
180
- width: 250
186
+ width: 250,
187
+ imex: {
188
+ header: i18next.t('field.company'),
189
+ key: 'bizplace.name',
190
+ width: 30,
191
+ type: 'array',
192
+ arrData: []
193
+ }
181
194
  },
182
195
  {
183
196
  type: 'date',
184
197
  name: 'executionDate',
185
198
  header: i18next.t('field.execution_date'),
186
199
  sortable: true,
187
- width: 120
200
+ width: 120,
201
+ imex: {
202
+ header: i18next.t('field.execution_date'),
203
+ key: 'executionDate',
204
+ width: 30,
205
+ type: 'date'
206
+ }
188
207
  },
189
208
  {
190
209
  type: 'string',
191
210
  name: 'inventoryCheckStatus',
192
211
  header: i18next.t('field.order_status'),
193
212
  sortable: true,
194
- width: 120
213
+ width: 120,
214
+ imex: {
215
+ header: i18next.t('field.order_status'),
216
+ key: 'inventoryCheckStatus',
217
+ width: 20,
218
+ type: 'string'
219
+ }
195
220
  },
196
221
  {
197
222
  type: 'string',
198
223
  name: 'status',
199
224
  header: i18next.t('field.task_status'),
200
225
  sortable: true,
201
- width: 120
226
+ width: 120,
227
+ imex: {
228
+ header: i18next.t('field.task_status'),
229
+ key: 'status',
230
+ width: 20,
231
+ type: 'string'
232
+ }
202
233
  },
203
234
  {
204
235
  type: 'datetime',
205
236
  name: 'startedAt',
206
237
  header: i18next.t('field.started_at'),
207
238
  sortable: true,
208
- width: 160
239
+ width: 160,
240
+ imex: {
241
+ header: i18next.t('field.started_at'),
242
+ key: 'startedAt',
243
+ width: 30,
244
+ type: 'datetime'
245
+ }
209
246
  },
210
247
  {
211
248
  type: 'datetime',
212
249
  name: 'endedAt',
213
250
  header: i18next.t('field.ended_at'),
214
251
  sortable: true,
215
- width: 160
252
+ width: 160,
253
+ imex: {
254
+ header: i18next.t('field.ended_at'),
255
+ key: 'endedAt',
256
+ width: 30,
257
+ type: 'datetime'
258
+ }
216
259
  },
217
260
  {
218
261
  type: 'object',
219
262
  name: 'updater',
220
263
  header: i18next.t('field.updater'),
221
264
  sortable: true,
222
- width: 150
265
+ width: 150,
266
+ imex: {
267
+ header: i18next.t('field.updater'),
268
+ key: 'updater.name',
269
+ width: 30,
270
+ type: 'object'
271
+ }
223
272
  }
224
273
  ]
225
274
  }
@@ -373,8 +422,43 @@ class InventoryCheckList extends localize(i18next)(PageView) {
373
422
  return this.config.columns
374
423
  }
375
424
 
376
- _exportableData() {
377
- return this.dataGrist.exportRecords()
425
+ async _exportableData() {
426
+ let records = []
427
+ records = this.dataGrist.data.records
428
+
429
+ const fetchBizplaces = await this._fetchBizplaceList()
430
+
431
+ var headerSetting = this.dataGrist._config.columns
432
+ .filter(column => column.type !== 'gutter' && column.record !== undefined && column.imex !== undefined)
433
+ .map(column => {
434
+ if (column.imex.key == 'bizplace.name') {
435
+ column.imex.arrData = fetchBizplaces.map(item => {
436
+ return {
437
+ id: item.id,
438
+ name: item.name
439
+ }
440
+ })
441
+ }
442
+ return column.imex
443
+ })
444
+
445
+ var data = records.map(item => {
446
+ return {
447
+ id: item.id,
448
+ ...this.config.columns
449
+ .filter(column => column.type !== 'gutter' /* && column.record !== undefined */ && column.imex !== undefined)
450
+ .reduce((record, column) => {
451
+ record[column.imex.key] = column.imex.key
452
+ .split('.')
453
+ .reduce((obj, key) => (obj && obj[key] !== 'undefined' ? obj[key] : undefined), item)
454
+ if (column.type === 'datetime') {
455
+ record[column.imex.key] = new Date(parseInt(record[column.imex.key])).toLocaleString()
456
+ }
457
+ return record
458
+ }, {})
459
+ }
460
+ })
461
+ return { header: headerSetting, data: data }
378
462
  }
379
463
  }
380
464