@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
@@ -14,6 +14,7 @@ import { fetchSettingRule } from '@things-factory/setting-ui'
14
14
  import { client, CustomAlert, navigate, PageView, store } from '@things-factory/shell'
15
15
  import { CommonButtonStyles } from '@things-factory/styles'
16
16
  import { flattenObject, isMobileDevice } from '@things-factory/utils'
17
+ import isEmpty from 'lodash-es/isEmpty'
17
18
 
18
19
  import { DRAFT_RELEASE_ORDER_STATUS, PRODUCT_GROUP_TYPES } from '../../../constants'
19
20
 
@@ -223,6 +224,7 @@ class DraftReleaseGoodDetail extends connect(store)(localize(i18next)(PageView))
223
224
  get context() {
224
225
  let actions = []
225
226
 
227
+ // first time getting the draft order data
226
228
  if (this._draftOrderData) {
227
229
  actions = [
228
230
  {
@@ -480,6 +482,7 @@ class DraftReleaseGoodDetail extends connect(store)(localize(i18next)(PageView))
480
482
 
481
483
  if (!this._packingTypes) this._packingTypes = await getCodeByName('PACKING_TYPES')
482
484
 
485
+ // getting orderNo and see whether it's enw or existing draft order
483
486
  let orderNo = changes.resourceId || this._orderNo
484
487
  this._orderNo = orderNo == 'new' ? '' : orderNo
485
488
  await this._fetchOrder()
@@ -543,7 +546,8 @@ class DraftReleaseGoodDetail extends connect(store)(localize(i18next)(PageView))
543
546
  let returnObj = {
544
547
  ...record,
545
548
  ...record.product,
546
- product: { ...record.product, id: record.product.id || record.product.productId },
549
+ product: { ...record.product, id: record.product?.id || record.product.productId },
550
+ productDetail: { id: record.productDetail?.id || record.product.productDetailId },
547
551
  name: record.name ? record.name : idx,
548
552
  releaseQty: record.releaseQty < 0 ? 0 : record.releaseQty,
549
553
  id: record.id
@@ -597,6 +601,7 @@ class DraftReleaseGoodDetail extends connect(store)(localize(i18next)(PageView))
597
601
  select: [
598
602
  { name: 'id', hidden: true },
599
603
  { name: 'productId', hidden: true },
604
+ { name: 'productDetailId', hidden: true },
600
605
  { name: 'remainUomValue', hidden: true },
601
606
  {
602
607
  name: 'groupType',
@@ -816,6 +821,9 @@ class DraftReleaseGoodDetail extends connect(store)(localize(i18next)(PageView))
816
821
  sku
817
822
  description
818
823
  }
824
+ productDetail {
825
+ id
826
+ }
819
827
  packingType
820
828
  packingSize
821
829
  uomValue
@@ -855,10 +863,10 @@ class DraftReleaseGoodDetail extends connect(store)(localize(i18next)(PageView))
855
863
 
856
864
  if (!response.errors) {
857
865
  this._draftOrderData = {
866
+ // this is where data is
858
867
  ...response.data.draftReleaseGoodByName
859
868
  // shippingOrder: this._exportOption ? this._serializeForm(this._shippingOrderForm) : null
860
869
  }
861
-
862
870
  this._productData = {
863
871
  records: response.data.draftReleaseGoodByName.orderProducts.map(itm => {
864
872
  return {
@@ -1028,6 +1036,17 @@ class DraftReleaseGoodDetail extends connect(store)(localize(i18next)(PageView))
1028
1036
  if (this._productGrist.dirtyData.records.some(record => !record.releaseQty))
1029
1037
  throw new Error(i18next.t('text.invalid_release_qty'))
1030
1038
 
1039
+
1040
+ if (this._draftOrderData.bizplace.id != null)
1041
+ {
1042
+ // check changes in form info
1043
+ let checkFormInfoChange = this._serializeForm(this._draftReleaseOrderForm).refNo == this._draftOrderData.refNo && this._serializeForm(this._draftReleaseOrderForm).refNo2 == this._draftOrderData.refNo2 && this._serializeForm(this._draftReleaseOrderForm).refNo3 == this._draftOrderData.refNo3 && this._serializeForm(this._draftReleaseOrderForm).releaseDate == this._draftOrderData.releaseDate && this._serializeForm(this._draftReleaseOrderForm).collectionOrderNo == this._draftOrderData.collectionOrderNo
1044
+
1045
+ // check changes in product
1046
+ let checkProductDataChange = this._compareArray(this._productGrist.dirtyData.records, this.___draftOrderData.orderProducts)
1047
+ if (checkFormInfoChange == true && checkProductDataChange != true)
1048
+ throw new Error(i18next.t('text.nothing_changed'))
1049
+ }
1031
1050
  return true
1032
1051
  }
1033
1052
 
@@ -1036,12 +1055,30 @@ class DraftReleaseGoodDetail extends connect(store)(localize(i18next)(PageView))
1036
1055
  return formData
1037
1056
  }
1038
1057
 
1058
+ _compareArray(a, b) {
1059
+ // Comparing the length of each array
1060
+ if (a.length != b.length) return true
1061
+ else {
1062
+ for (var i = 0; i < a.length; i++) {
1063
+ // compare releaseQty of both array
1064
+ if (a[i].releaseQty != b[i].releaseQty) {
1065
+ return true
1066
+ }
1067
+ // compare product of both array
1068
+ if (a[i].product.id != b[i].product.id) {
1069
+ return true
1070
+ }
1071
+ }
1072
+ }
1073
+ }
1074
+
1039
1075
  _getOrderProducts() {
1040
1076
  return this._productGrist.dirtyData.records.map(record => {
1041
1077
  let orderProduct = {
1042
1078
  id: record.id ? record.id.toString() : null,
1043
1079
  name: record.name ? record.name.toString() : null,
1044
1080
  product: { id: record.product.id },
1081
+ productDetail: { id: record.productDetail.id },
1045
1082
  packingType: record.packingType,
1046
1083
  uomValue: record?.uomValue ? record.uomValue : 0,
1047
1084
  uom: record.uom,
@@ -1202,14 +1202,10 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
1202
1202
  this.matchDeliveryAddressInput.checked = false
1203
1203
  this.quickFindContent.currentTabKey = i18next.t('label.order')
1204
1204
 
1205
- this.initProperties()
1205
+ // this.initProperties()
1206
1206
  this._clearGristConditions()
1207
1207
  this._validateTransport()
1208
1208
  this._getAllPostCode()
1209
-
1210
- if (this._exportOptionInput.checked === true && this._recallInput.checked === false) {
1211
- this._exportOption = true
1212
- }
1213
1209
  }
1214
1210
 
1215
1211
  async switchPickingType() {
@@ -1554,6 +1550,9 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
1554
1550
  product: {
1555
1551
  id: record?.inventory?.productId,
1556
1552
  name: record?.inventory?.productName
1553
+ },
1554
+ productDetail: {
1555
+ id: record?.inventory?.productDetailId
1557
1556
  }
1558
1557
  }
1559
1558
  }
@@ -1786,6 +1785,7 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
1786
1785
  bundleId
1787
1786
  bundleQty
1788
1787
  productId
1788
+ productDetailId
1789
1789
  productSku
1790
1790
  productName
1791
1791
  productDescription
@@ -2116,6 +2116,7 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
2116
2116
  packingType: record?.inventory?.packingType,
2117
2117
  packingSize: record?.inventory?.packingSize,
2118
2118
  productId: record?.inventory?.productId,
2119
+ productDetailId: record?.inventory?.productDetailId,
2119
2120
  groupType: record?.inventory?.groupType,
2120
2121
  releaseQty: record.releaseQty || 0,
2121
2122
  releaseUomValue: record.releaseUomValue || 0
@@ -2290,6 +2291,7 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
2290
2291
  bundleReleaseDetail = bundleReleaseDetail.records.map(item => {
2291
2292
  return {
2292
2293
  product: { id: item.productId, name: item.productName },
2294
+ productDetail: { id: item.productDetailId },
2293
2295
  batchId: item.batchId,
2294
2296
  packingType: item.packingType,
2295
2297
  packingSize: item.packingSize,
@@ -2326,11 +2328,17 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
2326
2328
  id: record.inventory.productId,
2327
2329
  name: record.inventory.productName
2328
2330
  }
2331
+ newRecord.productDetail = {
2332
+ id: record.inventory.productDetailId
2333
+ }
2329
2334
  } else {
2330
2335
  newRecord.product = {
2331
2336
  id: record.inventory.productId || record.inventory.product.id,
2332
2337
  name: record.inventory.productName || record.inventory.product.name
2333
2338
  }
2339
+ newRecord.productDetail = {
2340
+ id: record.inventory.productDetailId || record.inventory.productDetail.id
2341
+ }
2334
2342
  newRecord.inventory = { id: record.id }
2335
2343
  }
2336
2344
 
@@ -2625,6 +2633,9 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
2625
2633
  name
2626
2634
  description
2627
2635
  }
2636
+ productDetail {
2637
+ id
2638
+ }
2628
2639
  }
2629
2640
  }
2630
2641
  }
@@ -2644,6 +2655,7 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
2644
2655
  op.inventory = {
2645
2656
  batchId: op.batchId,
2646
2657
  productId: op.product.id,
2658
+ productDetailId: op.productDetail.id,
2647
2659
  product: op.product,
2648
2660
  productName: op.product.name,
2649
2661
  palletId: i18next.t('label.cross_docking'),
@@ -2728,6 +2740,7 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
2728
2740
  batchId
2729
2741
  batchIdRef
2730
2742
  productId
2743
+ productDetailId
2731
2744
  productSKU
2732
2745
  productName
2733
2746
  remainQty
@@ -2744,6 +2757,7 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
2744
2757
  batchId
2745
2758
  batchIdRef
2746
2759
  productId
2760
+ productDetailId
2747
2761
  productSKU
2748
2762
  productName
2749
2763
  remainQty
@@ -2758,6 +2772,9 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
2758
2772
  name
2759
2773
  sku
2760
2774
  }
2775
+ productDetail {
2776
+ id
2777
+ }
2761
2778
  }
2762
2779
  }
2763
2780
  `,
@@ -356,6 +356,7 @@ export class ReleaseExtraProductPopup extends localize(i18next)(LitElement) {
356
356
  { name: 'palletId', header: i18next.t('field.lot_id') },
357
357
  { name: 'cartonId', header: i18next.t('field.carton_id') },
358
358
  { name: 'product', type: 'object', queryName: 'products' },
359
+ { name: 'productDetail', type: 'object', queryName: 'products', hidden: true },
359
360
  { name: 'batchId', header: i18next.t('field.batch_id') },
360
361
  {
361
362
  name: 'location',
@@ -846,6 +847,7 @@ export class ReleaseExtraProductPopup extends localize(i18next)(LitElement) {
846
847
  } else {
847
848
  newRecord.product = { id: record.inventory.product.id, name: record.inventory.product.name }
848
849
  newRecord.inventory = { id: record.id }
850
+ newRecord.productDetail = { id: record.inventory.productDetail.id }
849
851
  }
850
852
 
851
853
  return newRecord
@@ -865,13 +867,14 @@ export class ReleaseExtraProductPopup extends localize(i18next)(LitElement) {
865
867
  status: ORDER_INVENTORY_STATUS.PENDING.value
866
868
  }
867
869
 
868
- if (record.isCrossDocking) newRecord.crossDocking = true
870
+ if (record.isCrossDocking) existRecord.crossDocking = true
869
871
 
870
872
  if (this._pickingStd === PICKING_STANDARD.SELECT_BY_PRODUCT.value) {
871
873
  existRecord.product = { id: record.inventory.productId, name: record.inventory.productName }
872
874
  } else {
873
875
  existRecord.product = { id: record.inventory.product.id, name: record.inventory.product.name }
874
876
  existRecord.inventory = { id: record.id }
877
+ existRecord.productDetail = { id: record.inventory.productDetail.id }
875
878
  }
876
879
 
877
880
  return existRecord
@@ -1270,6 +1270,9 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
1270
1270
  name
1271
1271
  description
1272
1272
  }
1273
+ productDetail {
1274
+ id
1275
+ }
1273
1276
  productName
1274
1277
  packingType
1275
1278
  packingSize
@@ -1356,6 +1359,7 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
1356
1359
  name: inventoryInfo.name,
1357
1360
  palletId: inventoryInfo.palletId,
1358
1361
  product: inventoryInfo.product,
1362
+ productDetail: inventoryInfo.productDetail,
1359
1363
  batchId: inventoryInfo.batchId,
1360
1364
  batchIdRef: inventoryInfo.batchIdRef,
1361
1365
  location: inventoryInfo.location,
@@ -1916,6 +1920,7 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
1916
1920
  this._validateForm()
1917
1921
 
1918
1922
  let releaseOrder = this._getFormInfo()
1923
+
1919
1924
  delete releaseOrder.warehouseTransport
1920
1925
  delete releaseOrder.bizplaceId
1921
1926
  delete releaseOrder.bizplaceName
@@ -1923,6 +1928,25 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
1923
1928
  delete releaseOrder.ganNo
1924
1929
  delete releaseOrder.recall
1925
1930
 
1931
+ let formChanged
1932
+ for (const key in releaseOrder) {
1933
+ if (releaseOrder.hasOwnProperty(key) && releaseOrder[key] !== this._releaseOrder[key]) {
1934
+ if (
1935
+ !(
1936
+ (releaseOrder[key] == '' || releaseOrder[key] == null) &&
1937
+ (this._releaseOrder[key] == '' || this._releaseOrder[key] == null)
1938
+ )
1939
+ ) {
1940
+ formChanged = true
1941
+ break
1942
+ }
1943
+ }
1944
+ }
1945
+
1946
+ if (!formChanged) {
1947
+ throw new Error(i18next.t('text.there_is_nothing_changed'))
1948
+ }
1949
+
1926
1950
  let shippingOrderInfo = {}
1927
1951
 
1928
1952
  let contactPointInfo = this._serializeForm(this.shippingInfoForm)
@@ -301,6 +301,10 @@ class CreateReturnOrder extends localize(i18next)(PageView) {
301
301
  }
302
302
  }
303
303
 
304
+ get _document() {
305
+ return this.shadowRoot.querySelector('#uploadDocument')
306
+ }
307
+
304
308
  pageInitialized() {
305
309
  this._configureInventoryGrist()
306
310
  }
@@ -792,6 +796,7 @@ class CreateReturnOrder extends localize(i18next)(PageView) {
792
796
  status: ORDER_INVENTORY_STATUS.PENDING.value
793
797
  }
794
798
  newRecord.product = { id: record?.productId, name: record?.productName }
799
+ newRecord.productDetail = { id: record?.productDetailId }
795
800
  newRecord.inventory = { id: record.id }
796
801
  return newRecord
797
802
  })
@@ -247,6 +247,7 @@ class ReturnOrderInventoryPopup extends localize(i18next)(LitElement) {
247
247
  releaseUomValue
248
248
  palletId
249
249
  productId
250
+ productDetailId
250
251
  releaseGoodName
251
252
  }
252
253
  total
@@ -325,6 +325,7 @@ class DeliveryOrderList extends localize(i18next)(PageView) {
325
325
  async fetchHandler({ page, limit, sorters = [] }) {
326
326
  let filters = this.searchForm.queryFilters
327
327
  var tzoffset = new Date().getTimezoneOffset() * 60
328
+ if (!this._validateDateRange()) return
328
329
 
329
330
  const response = await client.query({
330
331
  query: gql`
@@ -413,6 +414,20 @@ class DeliveryOrderList extends localize(i18next)(PageView) {
413
414
  }
414
415
  }
415
416
 
417
+ _validateDateRange() {
418
+ if (this._fromDateInput.value === '') {
419
+ this._showToast({ message: i18next.t('text.from_date_cannot_be_empty') })
420
+ return false
421
+ } else if (this._toDateInput.value === '') {
422
+ this._showToast({ message: i18next.t('text.to_date_cannot_be_empty') })
423
+ return false
424
+ } else if (this._fromDateInput.value > this._toDateInput.value) {
425
+ this._showToast({ message: i18next.t('text.to_date_cannot_be_before_from_date') })
426
+ return false
427
+ }
428
+ return true
429
+ }
430
+
416
431
  _compareValues(key, order = 'asc') {
417
432
  return function innerSort(a, b) {
418
433
  if (!a.hasOwnProperty(key) || !b.hasOwnProperty(key)) {
@@ -481,6 +496,17 @@ class DeliveryOrderList extends localize(i18next)(PageView) {
481
496
 
482
497
  this._toDateInput.min = min
483
498
  }
499
+
500
+ _showToast({ type, message }) {
501
+ document.dispatchEvent(
502
+ new CustomEvent('notify', {
503
+ detail: {
504
+ type,
505
+ message
506
+ }
507
+ })
508
+ )
509
+ }
484
510
  }
485
511
 
486
512
  window.customElements.define('delivery-order-list', DeliveryOrderList)
@@ -502,6 +502,9 @@ class InventoryReassignPopup extends localize(i18next)(LitElement) {
502
502
  description
503
503
  sku
504
504
  }
505
+ productDetail {
506
+ id
507
+ }
505
508
  releaseGood {
506
509
  id
507
510
  name
@@ -1025,6 +1028,7 @@ class InventoryReassignPopup extends localize(i18next)(LitElement) {
1025
1028
  $worksheetNo: String!
1026
1029
  $batchId: String!
1027
1030
  $productId: String!
1031
+ $productDetailId: String!
1028
1032
  $packingType: String!
1029
1033
  $packingSize: Float!
1030
1034
  $orderProductId: String!
@@ -1034,6 +1038,7 @@ class InventoryReassignPopup extends localize(i18next)(LitElement) {
1034
1038
  worksheetNo: $worksheetNo
1035
1039
  batchId: $batchId
1036
1040
  productId: $productId
1041
+ productDetailId: $productDetailId
1037
1042
  packingType: $packingType
1038
1043
  packingSize: $packingSize
1039
1044
  orderProductId: $orderProductId
@@ -1045,6 +1050,7 @@ class InventoryReassignPopup extends localize(i18next)(LitElement) {
1045
1050
  worksheetNo: this.worksheetNo,
1046
1051
  batchId: this._selectedOrderProduct?.batchId,
1047
1052
  productId: this._selectedOrderProduct?.product?.id,
1053
+ productDetailId: this._selectedOrderProduct?.productDetail?.id,
1048
1054
  packingType: this._selectedOrderProduct?.packingType,
1049
1055
  packingSize: this._selectedOrderProduct?.packingSize,
1050
1056
  orderProductId: this._selectedOrderProduct?.id,
@@ -485,14 +485,14 @@ class PackingProduct extends connect(store)(localize(i18next)(PageView)) {
485
485
  })
486
486
 
487
487
  if (!response.errors) {
488
- // @oscar a more efficient writing of this line of code would be defining a const for the response of accessing releaseGood, kindly improve this.
489
- if (response.data.packingWorksheet.worksheetInfo.releaseGood.isOrderInventoryBin) {
490
- this.totalBinRO = response.data.packingWorksheet.worksheetInfo.releaseGood.totalInventoriesByBin
488
+ let releaseGood = response.data.packingWorksheet.worksheetInfo?.releaseGood
489
+ if (releaseGood?.isOrderInventoryBin) {
490
+ this.totalBinRO = releaseGood?.totalInventoriesByBin
491
491
  this.binRo = releaseGoodNo
492
492
  }
493
493
 
494
- this.releaseGoodNo = response.data.packingWorksheet.worksheetInfo.releaseGood.name
495
- this.releaseGoodId = response.data.packingWorksheet.worksheetInfo.releaseGood.id
494
+ this.releaseGoodNo = releaseGood?.name
495
+ this.releaseGoodId = releaseGood?.id
496
496
  if (!response.data?.packingWorksheet) return
497
497
 
498
498
  const { worksheetInfo, worksheetDetailInfos } = response.data.packingWorksheet
@@ -370,7 +370,9 @@ class PackingWorksheetList extends localize(i18next)(PageView) {
370
370
  async _activateWorksheet() {
371
371
  try {
372
372
  let selectedItem = this.dataGrist.selected.filter(i => i.status == 'DEACTIVATED')
373
- if (selectedItem.length > 0) {
373
+ if (selectedItem.length <= 0) {
374
+ this._showToast({ message: 'No orders have been selected' })
375
+ } else {
374
376
  const result = await CustomAlert({
375
377
  title: i18next.t('title.are_you_sure'),
376
378
  text: i18next.t('text.activate_packing_worksheet'),
@@ -145,9 +145,9 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
145
145
 
146
146
  if (
147
147
  (this.releaseGoodId || this.taskNo) &&
148
- this._selectedOrderInventory?.status !== 'MISSING' &&
148
+ (this._selectedOrderInventory?.status && this._selectedOrderInventory?.status !== 'MISSING') &&
149
149
  this._selectedOrderInventory?.hasMissingInventoryChanges !== true &&
150
- this._selectedOrderInventory?.status !== 'DONE'
150
+ (this._selectedOrderInventory?.status && this._selectedOrderInventory?.status !== 'DONE')
151
151
  ) {
152
152
  actions.push({
153
153
  title: i18next.t('button.missing_stock'),
@@ -504,19 +504,19 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
504
504
  if (this.palletInput) this.palletInput.value = ''
505
505
  if (this.serialInput) this.serialInput.value = ''
506
506
 
507
- this._selectedOrderInventory = record
508
-
509
507
  await this.fetchInventories(
510
508
  this.refPickingType === PICKING_TYPES.PICKING.value ? this.releaseGoodNo : this.taskNo
511
509
  )
512
510
 
513
- this.focusOnInput
511
+ this.focusOnInput()
514
512
  let updatedRecords = this._selectedOrderInventory
515
513
  if (updatedRecords.releaseQty === updatedRecords.pickedQty) {
516
514
  updatedRecords.status = 'DONE'
517
515
  } else {
518
516
  updatedRecords.status = 'PICKING'
519
517
  }
518
+ this._selectedOrderInventory = record
519
+ this.updateContext()
520
520
  }
521
521
  } catch (ex) {
522
522
  console.log(ex)
@@ -637,6 +637,7 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
637
637
  }
638
638
  record.locationName = record?.location?.name
639
639
  record.product = record?.relatedOrderInv && record?.relatedOrderInv?.product
640
+ record.productDetail = record?.relatedOrderInv.productDetail
640
641
 
641
642
  if (this._crossDocking) {
642
643
  record.batchId = record.relatedOrderInv.batchId
@@ -1030,7 +1031,7 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
1030
1031
  batchId: this._selectedOrderInventory.batchId,
1031
1032
  packingType: this._selectedOrderInventory.packingType,
1032
1033
  packingSize: this._selectedOrderInventory.packingSize,
1033
- product: { id: this._selectedOrderInventory.product.id }
1034
+ productDetail: { id: this._selectedOrderInventory.productDetail.id }
1034
1035
  },
1035
1036
  binLocationName:
1036
1037
  this._hasBinPicking && (!this.toteNo || this.tote == '') ? this.binLocationInput.value : null,
@@ -1391,6 +1392,9 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
1391
1392
  description
1392
1393
  isRequireSerialNumberScanningOutbound
1393
1394
  }
1395
+ productDetail {
1396
+ id
1397
+ }
1394
1398
  }
1395
1399
  }
1396
1400
  }
@@ -1540,6 +1544,9 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
1540
1544
  description
1541
1545
  sku
1542
1546
  }
1547
+ productDetail {
1548
+ id
1549
+ }
1543
1550
  }
1544
1551
  }
1545
1552
  }
@@ -1630,6 +1637,7 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
1630
1637
  }
1631
1638
 
1632
1639
  this.updateContext()
1640
+ // if (this.data.records.every(record => record.completed))
1633
1641
  }
1634
1642
 
1635
1643
  async fetchPalletsHandler(releaseGoodNo) {
@@ -1855,6 +1863,9 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
1855
1863
  name
1856
1864
  description
1857
1865
  }
1866
+ productDetail {
1867
+ id
1868
+ }
1858
1869
  }
1859
1870
  }
1860
1871
  }
@@ -1908,7 +1919,7 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
1908
1919
 
1909
1920
  async showWorksheetList() {
1910
1921
  await sleep(1010)
1911
- openPopup(html` <show-my-worksheet-list-popup></show-my-worksheet-list-popup> `, {
1922
+ openPopup(html` <show-my-worksheet-list-popup .type=${this.refPickingType}></show-my-worksheet-list-popup> `, {
1912
1923
  backdrop: true,
1913
1924
  size: 'small',
1914
1925
  title: i18next.t('title.my_worksheet_list')
@@ -10,7 +10,8 @@ class ShowMyWorksheetListPopup extends localize(i18next)(LitElement) {
10
10
  return {
11
11
  pendingNum: Number,
12
12
  pickingNum: Number,
13
- userId: String
13
+ userId: String,
14
+ type: String
14
15
  }
15
16
  }
16
17
 
@@ -55,11 +56,19 @@ class ShowMyWorksheetListPopup extends localize(i18next)(LitElement) {
55
56
  }
56
57
 
57
58
  goToPendingList() {
58
- navigate(`single_outbound_worksheets?status=${WORKSHEET_STATUS.DEACTIVATED.value}&assigneeId=${this.userId}`)
59
+ if (this.type == 'PICKING') {
60
+ navigate(`single_outbound_worksheets?status=${WORKSHEET_STATUS.DEACTIVATED.value}&assigneeId=${this.userId}`)
61
+ } else {
62
+ navigate(`merged_outbound_worksheets?status=${WORKSHEET_STATUS.DEACTIVATED.value}&assigneeId=${this.userId}`)
63
+ }
59
64
  }
60
65
 
61
66
  goToPickingList() {
62
- navigate(`single_outbound_worksheets?status=${WORKSHEET_STATUS.EXECUTING.value}&assigneeId=${this.userId}`)
67
+ if (this.type == 'PICKING') {
68
+ navigate(`single_outbound_worksheets?status=${WORKSHEET_STATUS.EXECUTING.value}&assigneeId=${this.userId}`)
69
+ } else {
70
+ navigate(`merged_outbound_worksheets?status=${WORKSHEET_STATUS.EXECUTING.value}&assigneeId=${this.userId}`)
71
+ }
63
72
  }
64
73
 
65
74
  async getPickingAssignmentStatus() {
@@ -7,6 +7,7 @@ import { connect } from 'pwa-helpers/connect-mixin'
7
7
 
8
8
  import { i18next, localize } from '@things-factory/i18n-base'
9
9
  import { client, PageView, store } from '@things-factory/shell'
10
+ import { showToast } from '../../../util'
10
11
  class ElcclDailyCollectionReport extends connect(store)(localize(i18next)(PageView)) {
11
12
  static get styles() {
12
13
  return css`
@@ -267,7 +268,7 @@ class ElcclDailyCollectionReport extends connect(store)(localize(i18next)(PageVi
267
268
  records: this.data.records
268
269
  }
269
270
  } catch (e) {
270
- console.log(e)
271
+ showToast(e)
271
272
  }
272
273
  }
273
274
 
@@ -299,6 +300,8 @@ class ElcclDailyCollectionReport extends connect(store)(localize(i18next)(PageVi
299
300
  // if (!this._bizplaceSelector.value) throw new Error(i18next.t('text.company_does_not_selected'))
300
301
  if (!this._fromDateInput.value) throw new Error(i18next.t('text.from_date_is_empty'))
301
302
  if (!this._toDateInput.value) throw new Error(i18next.t('text.to_date_is_empty'))
303
+ if (this._fromDateInput.value > this._toDateInput.value)
304
+ throw new Error(i18next.t('text.to_date_cannot_be_before_from_date'))
302
305
  }
303
306
 
304
307
  _modifyDateRange(e) {
@@ -331,7 +334,7 @@ class ElcclDailyCollectionReport extends connect(store)(localize(i18next)(PageVi
331
334
  totals: []
332
335
  }
333
336
  } catch (e) {
334
- this._showToast(e)
337
+ showToast(e)
335
338
  }
336
339
  }
337
340
  }
@@ -295,7 +295,7 @@ class ElcclDailyOrderInventoryReport extends connect(store)(localize(i18next)(Pa
295
295
  records: response.data.elcclDailyOrderInventoryReport.items.map(item => flattenObject(item)) || []
296
296
  }
297
297
  } catch (e) {
298
- console.log(e)
298
+ this._showToast(e)
299
299
  }
300
300
  }
301
301
 
@@ -324,7 +324,7 @@ class ElcclDailyOrderInventoryReport extends connect(store)(localize(i18next)(Pa
324
324
  _validate() {
325
325
  if (!this.searchForm.shadowRoot.querySelector('form').checkValidity())
326
326
  throw new Error(i18next.t('text.invalid_form_value'))
327
- if (!this._bizplaceSelector.value) throw new Error(i18next.t('text.customer_does_not_selected'))
327
+ if (!this._bizplaceSelector.value) throw new Error(i18next.t('text.no_company_selected'))
328
328
  if (!this._monthInput.value) throw new Error(i18next.t('text.month_is_empty'))
329
329
  }
330
330