@things-factory/operato-wms 4.3.108 → 4.3.109

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 (65) hide show
  1. package/client/pages/bulk-operation/bulk-operation.js +15 -9
  2. package/client/pages/components/select-inventory-popup.js +1 -7
  3. package/client/pages/components/select-product-popup.js +2 -31
  4. package/client/pages/inbound/undo-putaway-popup.js +9 -5
  5. package/client/pages/inbound/undo-unload-popup.js +2 -15
  6. package/client/pages/inbound/unload-product.js +67 -72
  7. package/client/pages/inventory/inventory-adjustment-approval.js +5 -4
  8. package/client/pages/inventory/inventory-adjustment.js +2 -9
  9. package/client/pages/inventory/inventory-by-product-detail.js +13 -13
  10. package/client/pages/inventory-check/check-inventory-popup.js +3 -14
  11. package/client/pages/inventory-check/create-cycle-count.js +3 -2
  12. package/client/pages/inventory-check/inspecting-product.js +7 -25
  13. package/client/pages/inventory-check/inventory-check-list.js +10 -94
  14. package/client/pages/manifest/loading-manifest-detail.js +4 -7
  15. package/client/pages/master/generate-location-list.js +22 -30
  16. package/client/pages/master/location-list.js +71 -134
  17. package/client/pages/master/pallet-list.js +58 -137
  18. package/client/pages/master/product/product-details-popup.js +3 -3
  19. package/client/pages/master/tote-list.js +27 -40
  20. package/client/pages/master/transport-driver.js +41 -50
  21. package/client/pages/master/transport-vehicle.js +41 -45
  22. package/client/pages/master/warehouse-list.js +34 -56
  23. package/client/pages/order/arrival-notice/arrival-notice-detail.js +25 -36
  24. package/client/pages/order/arrival-notice/create-arrival-notice.js +32 -53
  25. package/client/pages/order/arrival-notice/duplicate-arrival-notice.js +0 -2
  26. package/client/pages/order/arrival-notice/edit-product-popup.js +7 -9
  27. package/client/pages/order/draft-release-good/draft-release-good-detail.js +4 -79
  28. package/client/pages/order/release-order/create-release-order.js +5 -22
  29. package/client/pages/order/release-order/release-extra-product-popup.js +1 -4
  30. package/client/pages/order/release-order/release-order-detail.js +0 -24
  31. package/client/pages/order/return-order/create-return-order.js +0 -5
  32. package/client/pages/order/return-order/return-order-inventory-popup.js +0 -1
  33. package/client/pages/order/transport-order/delivery-order-list.js +0 -26
  34. package/client/pages/outbound/inventory-reassign-popup.js +0 -6
  35. package/client/pages/outbound/packing-product.js +5 -5
  36. package/client/pages/outbound/packing-worksheet-list.js +1 -3
  37. package/client/pages/outbound/picking-product.js +7 -18
  38. package/client/pages/outbound/show-my-worksheet-list-popup.js +3 -12
  39. package/client/pages/report/custom-elccl/elccl-daily-collection-report.js +2 -5
  40. package/client/pages/report/custom-elccl/elccl-daily-order-inventory-report.js +2 -2
  41. package/client/pages/report/custom-elccl/elccl-delivery-order-summary.js +8 -48
  42. package/client/pages/report/custom-elccl/elccl-inventory-pallet-detail-report.js +4 -42
  43. package/client/pages/vas/print-product-label.js +11 -13
  44. package/dist-server/graphql/resolvers/custom/elccl/elccl-inventory-history-report.js +5 -6
  45. package/dist-server/graphql/resolvers/custom/elccl/elccl-inventory-history-report.js.map +1 -1
  46. package/dist-server/graphql/resolvers/other/add-release-good-products.js +11 -7
  47. package/dist-server/graphql/resolvers/other/add-release-good-products.js.map +1 -1
  48. package/dist-server/graphql/resolvers/reports/costing-report.js +24 -18
  49. package/dist-server/graphql/resolvers/reports/costing-report.js.map +1 -1
  50. package/dist-server/graphql/resolvers/reports/inbound-order-details-report.js +6 -6
  51. package/dist-server/graphql/resolvers/reports/outbound-order-details-report.js +6 -5
  52. package/dist-server/graphql/resolvers/reports/outbound-order-details-report.js.map +1 -1
  53. package/dist-server/graphql/resolvers/reports/release-inventory-report.js +3 -3
  54. package/dist-server/graphql/resolvers/reports/release-inventory-report.js.map +1 -1
  55. package/package.json +50 -50
  56. package/server/graphql/resolvers/custom/elccl/elccl-inventory-history-report.ts +5 -6
  57. package/server/graphql/resolvers/other/add-release-good-products.ts +12 -8
  58. package/server/graphql/resolvers/reports/costing-report.ts +24 -18
  59. package/server/graphql/resolvers/reports/inbound-order-details-report.ts +6 -6
  60. package/server/graphql/resolvers/reports/outbound-order-details-report.ts +6 -5
  61. package/server/graphql/resolvers/reports/release-inventory-report.ts +4 -6
  62. package/translations/en.json +13 -43
  63. package/translations/ko.json +11 -33
  64. package/translations/ms.json +11 -33
  65. package/translations/zh.json +4 -26
@@ -14,12 +14,10 @@ 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'
18
17
 
19
18
  import { DRAFT_RELEASE_ORDER_STATUS, PRODUCT_GROUP_TYPES } from '../../../constants'
20
19
 
21
20
  import '@things-factory/import-ui'
22
- import { t } from '@things-factory/i18n-base/dist-server/apis/t'
23
21
 
24
22
  class DraftReleaseGoodDetail extends connect(store)(localize(i18next)(PageView)) {
25
23
  static get properties() {
@@ -225,7 +223,6 @@ class DraftReleaseGoodDetail extends connect(store)(localize(i18next)(PageView))
225
223
  get context() {
226
224
  let actions = []
227
225
 
228
- // first time getting the draft order data
229
226
  if (this._draftOrderData) {
230
227
  actions = [
231
228
  {
@@ -483,7 +480,6 @@ class DraftReleaseGoodDetail extends connect(store)(localize(i18next)(PageView))
483
480
 
484
481
  if (!this._packingTypes) this._packingTypes = await getCodeByName('PACKING_TYPES')
485
482
 
486
- // getting orderNo and see whether it's enw or existing draft order
487
483
  let orderNo = changes.resourceId || this._orderNo
488
484
  this._orderNo = orderNo == 'new' ? '' : orderNo
489
485
  await this._fetchOrder()
@@ -547,8 +543,7 @@ class DraftReleaseGoodDetail extends connect(store)(localize(i18next)(PageView))
547
543
  let returnObj = {
548
544
  ...record,
549
545
  ...record.product,
550
- product: { ...record.product, id: record.product?.id || record.product.productId },
551
- productDetail: { id: record.productDetail?.id || record.product.productDetailId },
546
+ product: { ...record.product, id: record.product.id || record.product.productId },
552
547
  name: record.name ? record.name : idx,
553
548
  releaseQty: record.releaseQty < 0 ? 0 : record.releaseQty,
554
549
  id: record.id
@@ -602,7 +597,6 @@ class DraftReleaseGoodDetail extends connect(store)(localize(i18next)(PageView))
602
597
  select: [
603
598
  { name: 'id', hidden: true },
604
599
  { name: 'productId', hidden: true },
605
- { name: 'productDetailId', hidden: true },
606
600
  { name: 'remainUomValue', hidden: true },
607
601
  {
608
602
  name: 'groupType',
@@ -822,9 +816,6 @@ class DraftReleaseGoodDetail extends connect(store)(localize(i18next)(PageView))
822
816
  sku
823
817
  description
824
818
  }
825
- productDetail {
826
- id
827
- }
828
819
  packingType
829
820
  packingSize
830
821
  uomValue
@@ -864,10 +855,10 @@ class DraftReleaseGoodDetail extends connect(store)(localize(i18next)(PageView))
864
855
 
865
856
  if (!response.errors) {
866
857
  this._draftOrderData = {
867
- // this is where data is
868
858
  ...response.data.draftReleaseGoodByName
869
859
  // shippingOrder: this._exportOption ? this._serializeForm(this._shippingOrderForm) : null
870
860
  }
861
+
871
862
  this._productData = {
872
863
  records: response.data.draftReleaseGoodByName.orderProducts.map(itm => {
873
864
  return {
@@ -915,11 +906,6 @@ class DraftReleaseGoodDetail extends connect(store)(localize(i18next)(PageView))
915
906
  this._validateForm()
916
907
  this._validateProducts()
917
908
 
918
- if(this._draftOrderData.bizplace.id != null)
919
- {
920
- this._validateChanges()
921
- }
922
-
923
909
  const result = await CustomAlert({
924
910
  title: i18next.t('title.are_you_sure'),
925
911
  text: i18next.t('text.update_draft_release_order'),
@@ -1017,29 +1003,8 @@ class DraftReleaseGoodDetail extends connect(store)(localize(i18next)(PageView))
1017
1003
  _validateForm() {
1018
1004
  if (!this._draftReleaseOrderForm.checkValidity()) throw new Error(i18next.t('text.draft_order_form_invalid'))
1019
1005
 
1020
- // if (this._draftOrderData?.container && !this.containerNo.value)
1021
- // throw new Error(i18next.t('text.container_no_is_empty'))
1022
-
1023
-
1024
- if (this._exportOption == true){
1025
- let e = ''
1026
- if (isEmpty(this._shippingOrderForm.containerNo.value)|| isEmpty(this._shippingOrderForm.shipName.value)||isEmpty(this._shippingOrderForm.containerArrivalDate.value)|| isEmpty(this._shippingOrderForm.containerLeavingDate.value)){
1027
- if (isEmpty(this._shippingOrderForm.containerNo.value))
1028
- e = i18next.t('text.container_no_is_empty')
1029
-
1030
- if(isEmpty(this._shippingOrderForm.shipName.value))
1031
- e = i18next.t('text.ship_name_is_empty')
1032
-
1033
- if(isEmpty(this._shippingOrderForm.containerArrivalDate.value))
1034
- e = i18next.t('text.container_arrival_date_is_empty')
1035
-
1036
- if(isEmpty(this._shippingOrderForm.containerLeavingDate.value))
1037
- e = i18next.t('text.container_leaving_date_is_empty')
1038
- }
1039
-
1040
- if (e != '')
1041
- throw new Error(e)
1042
- }
1006
+ if (this._draftOrderData?.container && !this.containerNo.value)
1007
+ throw new Error(i18next.t('text.container_no_is_empty'))
1043
1008
  }
1044
1009
 
1045
1010
  _validateProducts() {
@@ -1063,17 +1028,6 @@ class DraftReleaseGoodDetail extends connect(store)(localize(i18next)(PageView))
1063
1028
  if (this._productGrist.dirtyData.records.some(record => !record.releaseQty))
1064
1029
  throw new Error(i18next.t('text.invalid_release_qty'))
1065
1030
 
1066
- // data changes validator
1067
- if (this._draftOrderData.bizplace.id != null)
1068
- {
1069
- // // check changes in form info
1070
- // 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
1071
-
1072
- // // check changes in product
1073
- // let checkProductDataChange = this._compareArray(this._productGrist.dirtyData.records, this.___draftOrderData.orderProducts)
1074
- // if (checkFormInfoChange == true && checkProductDataChange != true)
1075
- // throw new Error(i18next.t('text.nothing_changed'))
1076
- }
1077
1031
  return true
1078
1032
  }
1079
1033
 
@@ -1082,30 +1036,12 @@ class DraftReleaseGoodDetail extends connect(store)(localize(i18next)(PageView))
1082
1036
  return formData
1083
1037
  }
1084
1038
 
1085
- _compareArray(a, b) {
1086
- // Comparing the length of each array
1087
- if (a.length != b.length) return true
1088
- else {
1089
- for (var i = 0; i < a.length; i++) {
1090
- // compare releaseQty of both array
1091
- if (a[i].releaseQty != b[i].releaseQty) {
1092
- return true
1093
- }
1094
- // compare product of both array
1095
- if (a[i].product.id != b[i].product.id) {
1096
- return true
1097
- }
1098
- }
1099
- }
1100
- }
1101
-
1102
1039
  _getOrderProducts() {
1103
1040
  return this._productGrist.dirtyData.records.map(record => {
1104
1041
  let orderProduct = {
1105
1042
  id: record.id ? record.id.toString() : null,
1106
1043
  name: record.name ? record.name.toString() : null,
1107
1044
  product: { id: record.product.id },
1108
- productDetail: { id: record.productDetail.id },
1109
1045
  packingType: record.packingType,
1110
1046
  uomValue: record?.uomValue ? record.uomValue : 0,
1111
1047
  uom: record.uom,
@@ -1135,17 +1071,6 @@ class DraftReleaseGoodDetail extends connect(store)(localize(i18next)(PageView))
1135
1071
  return inputDate
1136
1072
  }
1137
1073
 
1138
- _validateChanges(){
1139
- // check changes in form info
1140
- 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
1141
- // check changes in shipping form info
1142
- let checkShippingFormInfo = this._draftOrderData.shippingOrder.containerNo == this._shippingOrderForm.containerNo.value && this._draftOrderData.shippingOrder.containerArrivalDate == this._shippingOrderForm.containerArrivalDate.value && this._draftOrderData.shippingOrder.containerLeavingDate == this._shippingOrderForm.containerLeavingDate.value && this._draftOrderData.shippingOrder.shipName == this._shippingOrderForm.shipName.value
1143
- // check changes in product
1144
- let checkProductDataChange = this._compareArray(this._productGrist.dirtyData.records, this.___draftOrderData.orderProducts)
1145
- if (checkFormInfoChange == true && checkProductDataChange != true && checkShippingFormInfo == true)
1146
- throw new Error(i18next.t('text.nothing_changed'))
1147
- }
1148
-
1149
1074
  _clearView() {
1150
1075
  this.refNo = ''
1151
1076
  this.refNo2 = ''
@@ -1202,10 +1202,14 @@ 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
+ }
1209
1213
  }
1210
1214
 
1211
1215
  async switchPickingType() {
@@ -1550,9 +1554,6 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
1550
1554
  product: {
1551
1555
  id: record?.inventory?.productId,
1552
1556
  name: record?.inventory?.productName
1553
- },
1554
- productDetail: {
1555
- id: record?.inventory?.productDetailId
1556
1557
  }
1557
1558
  }
1558
1559
  }
@@ -1785,7 +1786,6 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
1785
1786
  bundleId
1786
1787
  bundleQty
1787
1788
  productId
1788
- productDetailId
1789
1789
  productSku
1790
1790
  productName
1791
1791
  productDescription
@@ -2116,7 +2116,6 @@ 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,
2120
2119
  groupType: record?.inventory?.groupType,
2121
2120
  releaseQty: record.releaseQty || 0,
2122
2121
  releaseUomValue: record.releaseUomValue || 0
@@ -2291,7 +2290,6 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
2291
2290
  bundleReleaseDetail = bundleReleaseDetail.records.map(item => {
2292
2291
  return {
2293
2292
  product: { id: item.productId, name: item.productName },
2294
- productDetail: { id: item.productDetailId },
2295
2293
  batchId: item.batchId,
2296
2294
  packingType: item.packingType,
2297
2295
  packingSize: item.packingSize,
@@ -2328,17 +2326,11 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
2328
2326
  id: record.inventory.productId,
2329
2327
  name: record.inventory.productName
2330
2328
  }
2331
- newRecord.productDetail = {
2332
- id: record.inventory.productDetailId
2333
- }
2334
2329
  } else {
2335
2330
  newRecord.product = {
2336
2331
  id: record.inventory.productId || record.inventory.product.id,
2337
2332
  name: record.inventory.productName || record.inventory.product.name
2338
2333
  }
2339
- newRecord.productDetail = {
2340
- id: record.inventory.productDetailId || record.inventory.productDetail.id
2341
- }
2342
2334
  newRecord.inventory = { id: record.id }
2343
2335
  }
2344
2336
 
@@ -2633,9 +2625,6 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
2633
2625
  name
2634
2626
  description
2635
2627
  }
2636
- productDetail {
2637
- id
2638
- }
2639
2628
  }
2640
2629
  }
2641
2630
  }
@@ -2655,7 +2644,6 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
2655
2644
  op.inventory = {
2656
2645
  batchId: op.batchId,
2657
2646
  productId: op.product.id,
2658
- productDetailId: op.productDetail.id,
2659
2647
  product: op.product,
2660
2648
  productName: op.product.name,
2661
2649
  palletId: i18next.t('label.cross_docking'),
@@ -2740,7 +2728,6 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
2740
2728
  batchId
2741
2729
  batchIdRef
2742
2730
  productId
2743
- productDetailId
2744
2731
  productSKU
2745
2732
  productName
2746
2733
  remainQty
@@ -2757,7 +2744,6 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
2757
2744
  batchId
2758
2745
  batchIdRef
2759
2746
  productId
2760
- productDetailId
2761
2747
  productSKU
2762
2748
  productName
2763
2749
  remainQty
@@ -2772,9 +2758,6 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
2772
2758
  name
2773
2759
  sku
2774
2760
  }
2775
- productDetail {
2776
- id
2777
- }
2778
2761
  }
2779
2762
  }
2780
2763
  `,
@@ -356,7 +356,6 @@ 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 },
360
359
  { name: 'batchId', header: i18next.t('field.batch_id') },
361
360
  {
362
361
  name: 'location',
@@ -847,7 +846,6 @@ export class ReleaseExtraProductPopup extends localize(i18next)(LitElement) {
847
846
  } else {
848
847
  newRecord.product = { id: record.inventory.product.id, name: record.inventory.product.name }
849
848
  newRecord.inventory = { id: record.id }
850
- newRecord.productDetail = { id: record.inventory.productDetail.id }
851
849
  }
852
850
 
853
851
  return newRecord
@@ -867,14 +865,13 @@ export class ReleaseExtraProductPopup extends localize(i18next)(LitElement) {
867
865
  status: ORDER_INVENTORY_STATUS.PENDING.value
868
866
  }
869
867
 
870
- if (record.isCrossDocking) existRecord.crossDocking = true
868
+ if (record.isCrossDocking) newRecord.crossDocking = true
871
869
 
872
870
  if (this._pickingStd === PICKING_STANDARD.SELECT_BY_PRODUCT.value) {
873
871
  existRecord.product = { id: record.inventory.productId, name: record.inventory.productName }
874
872
  } else {
875
873
  existRecord.product = { id: record.inventory.product.id, name: record.inventory.product.name }
876
874
  existRecord.inventory = { id: record.id }
877
- existRecord.productDetail = { id: record.inventory.productDetail.id }
878
875
  }
879
876
 
880
877
  return existRecord
@@ -1270,9 +1270,6 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
1270
1270
  name
1271
1271
  description
1272
1272
  }
1273
- productDetail {
1274
- id
1275
- }
1276
1273
  productName
1277
1274
  packingType
1278
1275
  packingSize
@@ -1359,7 +1356,6 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
1359
1356
  name: inventoryInfo.name,
1360
1357
  palletId: inventoryInfo.palletId,
1361
1358
  product: inventoryInfo.product,
1362
- productDetail: inventoryInfo.productDetail,
1363
1359
  batchId: inventoryInfo.batchId,
1364
1360
  batchIdRef: inventoryInfo.batchIdRef,
1365
1361
  location: inventoryInfo.location,
@@ -1920,7 +1916,6 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
1920
1916
  this._validateForm()
1921
1917
 
1922
1918
  let releaseOrder = this._getFormInfo()
1923
-
1924
1919
  delete releaseOrder.warehouseTransport
1925
1920
  delete releaseOrder.bizplaceId
1926
1921
  delete releaseOrder.bizplaceName
@@ -1928,25 +1923,6 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
1928
1923
  delete releaseOrder.ganNo
1929
1924
  delete releaseOrder.recall
1930
1925
 
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
-
1950
1926
  let shippingOrderInfo = {}
1951
1927
 
1952
1928
  let contactPointInfo = this._serializeForm(this.shippingInfoForm)
@@ -301,10 +301,6 @@ class CreateReturnOrder extends localize(i18next)(PageView) {
301
301
  }
302
302
  }
303
303
 
304
- get _document() {
305
- return this.shadowRoot.querySelector('#uploadDocument')
306
- }
307
-
308
304
  pageInitialized() {
309
305
  this._configureInventoryGrist()
310
306
  }
@@ -796,7 +792,6 @@ class CreateReturnOrder extends localize(i18next)(PageView) {
796
792
  status: ORDER_INVENTORY_STATUS.PENDING.value
797
793
  }
798
794
  newRecord.product = { id: record?.productId, name: record?.productName }
799
- newRecord.productDetail = { id: record?.productDetailId }
800
795
  newRecord.inventory = { id: record.id }
801
796
  return newRecord
802
797
  })
@@ -247,7 +247,6 @@ class ReturnOrderInventoryPopup extends localize(i18next)(LitElement) {
247
247
  releaseUomValue
248
248
  palletId
249
249
  productId
250
- productDetailId
251
250
  releaseGoodName
252
251
  }
253
252
  total
@@ -325,7 +325,6 @@ 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
329
328
 
330
329
  const response = await client.query({
331
330
  query: gql`
@@ -414,20 +413,6 @@ class DeliveryOrderList extends localize(i18next)(PageView) {
414
413
  }
415
414
  }
416
415
 
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
-
431
416
  _compareValues(key, order = 'asc') {
432
417
  return function innerSort(a, b) {
433
418
  if (!a.hasOwnProperty(key) || !b.hasOwnProperty(key)) {
@@ -496,17 +481,6 @@ class DeliveryOrderList extends localize(i18next)(PageView) {
496
481
 
497
482
  this._toDateInput.min = min
498
483
  }
499
-
500
- _showToast({ type, message }) {
501
- document.dispatchEvent(
502
- new CustomEvent('notify', {
503
- detail: {
504
- type,
505
- message
506
- }
507
- })
508
- )
509
- }
510
484
  }
511
485
 
512
486
  window.customElements.define('delivery-order-list', DeliveryOrderList)
@@ -502,9 +502,6 @@ class InventoryReassignPopup extends localize(i18next)(LitElement) {
502
502
  description
503
503
  sku
504
504
  }
505
- productDetail {
506
- id
507
- }
508
505
  releaseGood {
509
506
  id
510
507
  name
@@ -1028,7 +1025,6 @@ class InventoryReassignPopup extends localize(i18next)(LitElement) {
1028
1025
  $worksheetNo: String!
1029
1026
  $batchId: String!
1030
1027
  $productId: String!
1031
- $productDetailId: String!
1032
1028
  $packingType: String!
1033
1029
  $packingSize: Float!
1034
1030
  $orderProductId: String!
@@ -1038,7 +1034,6 @@ class InventoryReassignPopup extends localize(i18next)(LitElement) {
1038
1034
  worksheetNo: $worksheetNo
1039
1035
  batchId: $batchId
1040
1036
  productId: $productId
1041
- productDetailId: $productDetailId
1042
1037
  packingType: $packingType
1043
1038
  packingSize: $packingSize
1044
1039
  orderProductId: $orderProductId
@@ -1050,7 +1045,6 @@ class InventoryReassignPopup extends localize(i18next)(LitElement) {
1050
1045
  worksheetNo: this.worksheetNo,
1051
1046
  batchId: this._selectedOrderProduct?.batchId,
1052
1047
  productId: this._selectedOrderProduct?.product?.id,
1053
- productDetailId: this._selectedOrderProduct?.productDetail?.id,
1054
1048
  packingType: this._selectedOrderProduct?.packingType,
1055
1049
  packingSize: this._selectedOrderProduct?.packingSize,
1056
1050
  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
- let releaseGood = response.data.packingWorksheet.worksheetInfo?.releaseGood
489
- if (releaseGood?.isOrderInventoryBin) {
490
- this.totalBinRO = releaseGood?.totalInventoriesByBin
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
491
491
  this.binRo = releaseGoodNo
492
492
  }
493
493
 
494
- this.releaseGoodNo = releaseGood?.name
495
- this.releaseGoodId = releaseGood?.id
494
+ this.releaseGoodNo = response.data.packingWorksheet.worksheetInfo.releaseGood.name
495
+ this.releaseGoodId = response.data.packingWorksheet.worksheetInfo.releaseGood.id
496
496
  if (!response.data?.packingWorksheet) return
497
497
 
498
498
  const { worksheetInfo, worksheetDetailInfos } = response.data.packingWorksheet
@@ -370,9 +370,7 @@ 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) {
374
- this._showToast({ message: 'No orders have been selected' })
375
- } else {
373
+ if (selectedItem.length > 0) {
376
374
  const result = await CustomAlert({
377
375
  title: i18next.t('title.are_you_sure'),
378
376
  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 && this._selectedOrderInventory?.status !== 'MISSING') &&
148
+ this._selectedOrderInventory?.status !== 'MISSING' &&
149
149
  this._selectedOrderInventory?.hasMissingInventoryChanges !== true &&
150
- (this._selectedOrderInventory?.status && this._selectedOrderInventory?.status !== 'DONE')
150
+ 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
+
507
509
  await this.fetchInventories(
508
510
  this.refPickingType === PICKING_TYPES.PICKING.value ? this.releaseGoodNo : this.taskNo
509
511
  )
510
512
 
511
- this.focusOnInput()
513
+ this.focusOnInput
512
514
  let updatedRecords = this._selectedOrderInventory
513
515
  if (updatedRecords.releaseQty === updatedRecords.pickedQty) {
514
516
  updatedRecords.status = 'DONE'
515
517
  } else {
516
518
  updatedRecords.status = 'PICKING'
517
519
  }
518
- this._selectedOrderInventory = record
519
- this.updateContext()
520
520
  }
521
521
  } catch (ex) {
522
522
  console.log(ex)
@@ -637,7 +637,6 @@ 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
641
640
 
642
641
  if (this._crossDocking) {
643
642
  record.batchId = record.relatedOrderInv.batchId
@@ -1031,7 +1030,7 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
1031
1030
  batchId: this._selectedOrderInventory.batchId,
1032
1031
  packingType: this._selectedOrderInventory.packingType,
1033
1032
  packingSize: this._selectedOrderInventory.packingSize,
1034
- productDetail: { id: this._selectedOrderInventory.productDetail.id }
1033
+ product: { id: this._selectedOrderInventory.product.id }
1035
1034
  },
1036
1035
  binLocationName:
1037
1036
  this._hasBinPicking && (!this.toteNo || this.tote == '') ? this.binLocationInput.value : null,
@@ -1392,9 +1391,6 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
1392
1391
  description
1393
1392
  isRequireSerialNumberScanningOutbound
1394
1393
  }
1395
- productDetail {
1396
- id
1397
- }
1398
1394
  }
1399
1395
  }
1400
1396
  }
@@ -1544,9 +1540,6 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
1544
1540
  description
1545
1541
  sku
1546
1542
  }
1547
- productDetail {
1548
- id
1549
- }
1550
1543
  }
1551
1544
  }
1552
1545
  }
@@ -1637,7 +1630,6 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
1637
1630
  }
1638
1631
 
1639
1632
  this.updateContext()
1640
- // if (this.data.records.every(record => record.completed))
1641
1633
  }
1642
1634
 
1643
1635
  async fetchPalletsHandler(releaseGoodNo) {
@@ -1863,9 +1855,6 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
1863
1855
  name
1864
1856
  description
1865
1857
  }
1866
- productDetail {
1867
- id
1868
- }
1869
1858
  }
1870
1859
  }
1871
1860
  }
@@ -1919,7 +1908,7 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
1919
1908
 
1920
1909
  async showWorksheetList() {
1921
1910
  await sleep(1010)
1922
- openPopup(html` <show-my-worksheet-list-popup .type=${this.refPickingType}></show-my-worksheet-list-popup> `, {
1911
+ openPopup(html` <show-my-worksheet-list-popup></show-my-worksheet-list-popup> `, {
1923
1912
  backdrop: true,
1924
1913
  size: 'small',
1925
1914
  title: i18next.t('title.my_worksheet_list')
@@ -10,8 +10,7 @@ class ShowMyWorksheetListPopup extends localize(i18next)(LitElement) {
10
10
  return {
11
11
  pendingNum: Number,
12
12
  pickingNum: Number,
13
- userId: String,
14
- type: String
13
+ userId: String
15
14
  }
16
15
  }
17
16
 
@@ -56,19 +55,11 @@ class ShowMyWorksheetListPopup extends localize(i18next)(LitElement) {
56
55
  }
57
56
 
58
57
  goToPendingList() {
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
- }
58
+ navigate(`single_outbound_worksheets?status=${WORKSHEET_STATUS.DEACTIVATED.value}&assigneeId=${this.userId}`)
64
59
  }
65
60
 
66
61
  goToPickingList() {
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
- }
62
+ navigate(`single_outbound_worksheets?status=${WORKSHEET_STATUS.EXECUTING.value}&assigneeId=${this.userId}`)
72
63
  }
73
64
 
74
65
  async getPickingAssignmentStatus() {
@@ -7,7 +7,6 @@ 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'
11
10
  class ElcclDailyCollectionReport extends connect(store)(localize(i18next)(PageView)) {
12
11
  static get styles() {
13
12
  return css`
@@ -268,7 +267,7 @@ class ElcclDailyCollectionReport extends connect(store)(localize(i18next)(PageVi
268
267
  records: this.data.records
269
268
  }
270
269
  } catch (e) {
271
- showToast(e)
270
+ console.log(e)
272
271
  }
273
272
  }
274
273
 
@@ -300,8 +299,6 @@ class ElcclDailyCollectionReport extends connect(store)(localize(i18next)(PageVi
300
299
  // if (!this._bizplaceSelector.value) throw new Error(i18next.t('text.company_does_not_selected'))
301
300
  if (!this._fromDateInput.value) throw new Error(i18next.t('text.from_date_is_empty'))
302
301
  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'))
305
302
  }
306
303
 
307
304
  _modifyDateRange(e) {
@@ -334,7 +331,7 @@ class ElcclDailyCollectionReport extends connect(store)(localize(i18next)(PageVi
334
331
  totals: []
335
332
  }
336
333
  } catch (e) {
337
- showToast(e)
334
+ this._showToast(e)
338
335
  }
339
336
  }
340
337
  }