@things-factory/operato-wms 4.3.137 → 4.3.138

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 (77) hide show
  1. package/client/pages/adjustment/transfer-inventory.js +14 -6
  2. package/client/pages/bulk-operation/bulk-operation.js +3 -1
  3. package/client/pages/components/select-inventory-popup.js +7 -1
  4. package/client/pages/components/select-product-popup.js +33 -3
  5. package/client/pages/constants/order.js +3 -1
  6. package/client/pages/inbound/external-return-worksheet.js +39 -2
  7. package/client/pages/inbound/undo-putaway-popup.js +5 -9
  8. package/client/pages/inbound/undo-unload-popup.js +42 -35
  9. package/client/pages/inbound/unload-product.js +79 -69
  10. package/client/pages/inventory/inventory-adjustment-approval.js +4 -5
  11. package/client/pages/inventory/inventory-adjustment.js +56 -2
  12. package/client/pages/inventory/inventory-by-product-detail.js +23 -17
  13. package/client/pages/inventory/inventory-by-product.js +7 -0
  14. package/client/pages/inventory/inventory-history-by-pallet.js +14 -5
  15. package/client/pages/inventory/inventory-history.js +10 -0
  16. package/client/pages/inventory-check/check-inventory-popup.js +1 -1
  17. package/client/pages/inventory-check/create-cycle-count.js +2 -3
  18. package/client/pages/inventory-check/inspecting-product.js +7 -3
  19. package/client/pages/manifest/create-loading-manifest.js +8 -1
  20. package/client/pages/manifest/loading-manifest-detail.js +7 -4
  21. package/client/pages/master/generate-location-list.js +30 -22
  22. package/client/pages/master/location-list.js +134 -71
  23. package/client/pages/master/pallet-list.js +137 -58
  24. package/client/pages/master/product/product-details-popup.js +3 -3
  25. package/client/pages/master/tote-list.js +40 -27
  26. package/client/pages/master/transport-driver.js +48 -41
  27. package/client/pages/master/transport-vehicle.js +45 -41
  28. package/client/pages/master/warehouse-list.js +56 -34
  29. package/client/pages/order/arrival-notice/arrival-notice-detail.js +36 -25
  30. package/client/pages/order/arrival-notice/create-arrival-notice.js +78 -95
  31. package/client/pages/order/arrival-notice/duplicate-arrival-notice.js +2 -0
  32. package/client/pages/order/arrival-notice/edit-product-popup.js +10 -8
  33. package/client/pages/order/draft-release-good/draft-release-good-detail.js +88 -4
  34. package/client/pages/order/draft-release-good/draft-release-good-list.js +1 -1
  35. package/client/pages/order/release-order/create-release-order.js +34 -9
  36. package/client/pages/order/release-order/release-extra-product-popup.js +4 -1
  37. package/client/pages/order/release-order/release-order-detail.js +40 -3
  38. package/client/pages/order/return-order/create-return-order.js +5 -0
  39. package/client/pages/order/return-order/return-order-inventory-popup.js +1 -0
  40. package/client/pages/order/return-order/return-order-requests.js +37 -2
  41. package/client/pages/order/transport-order/delivery-note-popup.js +30 -24
  42. package/client/pages/order/transport-order/delivery-order-list.js +27 -1
  43. package/client/pages/outbound/inventory-reassign-popup.js +7 -3
  44. package/client/pages/outbound/packing-product.js +7 -7
  45. package/client/pages/outbound/packing-worksheet-list.js +3 -1
  46. package/client/pages/outbound/picking-product.js +17 -5
  47. package/client/pages/outbound/serial-number-popup.js +1 -1
  48. package/client/pages/outbound/show-my-worksheet-list-popup.js +12 -3
  49. package/client/pages/report/custom-elccl/elccl-daily-collection-report.js +5 -2
  50. package/client/pages/report/custom-elccl/elccl-daily-order-inventory-report.js +2 -2
  51. package/client/pages/report/custom-elccl/elccl-delivery-order-summary.js +34 -8
  52. package/client/pages/report/custom-elccl/elccl-inventory-pallet-detail-report.js +42 -4
  53. package/client/pages/report/custom-elccl/elccl-inventory-summary-report.js +46 -4
  54. package/client/pages/report/volume-summary-report.js +8 -3
  55. package/config.development.js +28 -21
  56. package/dist-server/graphql/resolvers/custom/elccl/elccl-inventory-history-report.js +6 -5
  57. package/dist-server/graphql/resolvers/custom/elccl/elccl-inventory-history-report.js.map +1 -1
  58. package/dist-server/graphql/resolvers/other/add-release-good-products.js +7 -11
  59. package/dist-server/graphql/resolvers/other/add-release-good-products.js.map +1 -1
  60. package/dist-server/graphql/resolvers/reports/costing-report.js +18 -24
  61. package/dist-server/graphql/resolvers/reports/costing-report.js.map +1 -1
  62. package/dist-server/graphql/resolvers/reports/inbound-order-details-report.js +6 -6
  63. package/dist-server/graphql/resolvers/reports/outbound-order-details-report.js +8 -9
  64. package/dist-server/graphql/resolvers/reports/outbound-order-details-report.js.map +1 -1
  65. package/dist-server/graphql/resolvers/reports/release-inventory-report.js +3 -3
  66. package/dist-server/graphql/resolvers/reports/release-inventory-report.js.map +1 -1
  67. package/package.json +24 -24
  68. package/server/graphql/resolvers/custom/elccl/elccl-inventory-history-report.ts +6 -5
  69. package/server/graphql/resolvers/other/add-release-good-products.ts +8 -12
  70. package/server/graphql/resolvers/reports/costing-report.ts +18 -24
  71. package/server/graphql/resolvers/reports/inbound-order-details-report.ts +6 -6
  72. package/server/graphql/resolvers/reports/outbound-order-details-report.ts +8 -9
  73. package/server/graphql/resolvers/reports/release-inventory-report.ts +6 -4
  74. package/translations/en.json +28 -3
  75. package/translations/ko.json +26 -2
  76. package/translations/ms.json +26 -2
  77. package/translations/zh.json +26 -2
@@ -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
@@ -611,12 +611,13 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
611
611
  this._releaseOrder.billingAddress || ''
612
612
  }"></textarea>
613
613
 
614
- <input type="checkbox" id="matchDeliveryAddress" name="matchDeliveryAddressInputa" ?checked=${
614
+ <input type="checkbox" id="matchDeliveryAddress" name="matchDeliveryAddressInput" ?checked=${
615
615
  this._releaseOrder.postalCode == this._releaseOrder.billingPostalCode &&
616
616
  this._releaseOrder.billingAddress == this._releaseOrder.deliveryAddress1
617
617
  } @click=${e => {
618
618
  e.currentTarget.checked ? (this._disableBillingAddress = true) : (this._disableBillingAddress = false)
619
619
  e.currentTarget.checked ? this.matchDeliveryAddress() : ''
620
+ this.matchDeliveryAddressInput.value = this.matchDeliveryAddressInput.value === 'on' ? 'off' : 'on'
620
621
  }} />
621
622
  <label for="matchDeliveryAddress">${i18next.t('label.match_delivery_address')}</label>
622
623
 
@@ -954,7 +955,7 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
954
955
  }
955
956
 
956
957
  get matchDeliveryAddressInput() {
957
- return this.shadowRoot?.querySelector('input[name=matchDeliveryAddressInputa]')
958
+ return this.shadowRoot?.querySelector('input[name=matchDeliveryAddressInput]')
958
959
  }
959
960
 
960
961
  get _cityInput() {
@@ -1274,6 +1275,9 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
1274
1275
  name
1275
1276
  description
1276
1277
  }
1278
+ productDetail {
1279
+ id
1280
+ }
1277
1281
  productName
1278
1282
  packingType
1279
1283
  packingSize
@@ -1360,6 +1364,7 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
1360
1364
  name: inventoryInfo.name,
1361
1365
  palletId: inventoryInfo.palletId,
1362
1366
  product: inventoryInfo.product,
1367
+ productDetail: inventoryInfo.productDetail,
1363
1368
  batchId: inventoryInfo.batchId,
1364
1369
  batchIdRef: inventoryInfo.batchIdRef,
1365
1370
  location: inventoryInfo.location,
@@ -1920,6 +1925,7 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
1920
1925
  this._validateForm()
1921
1926
 
1922
1927
  let releaseOrder = this._getFormInfo()
1928
+
1923
1929
  delete releaseOrder.warehouseTransport
1924
1930
  delete releaseOrder.bizplaceId
1925
1931
  delete releaseOrder.bizplaceName
@@ -1927,6 +1933,25 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
1927
1933
  delete releaseOrder.ganNo
1928
1934
  delete releaseOrder.recall
1929
1935
 
1936
+ let formChanged
1937
+ for (const key in releaseOrder) {
1938
+ if (releaseOrder.hasOwnProperty(key) && releaseOrder[key] !== this._releaseOrder[key]) {
1939
+ if (
1940
+ !(
1941
+ (releaseOrder[key] == '' || releaseOrder[key] == null) &&
1942
+ (this._releaseOrder[key] == '' || this._releaseOrder[key] == null)
1943
+ )
1944
+ ) {
1945
+ formChanged = true
1946
+ break
1947
+ }
1948
+ }
1949
+ }
1950
+
1951
+ if (!formChanged) {
1952
+ throw new Error(i18next.t('text.there_is_nothing_changed'))
1953
+ }
1954
+
1930
1955
  let shippingOrderInfo = {}
1931
1956
 
1932
1957
  let contactPointInfo = this._serializeForm(this.shippingInfoForm)
@@ -1936,7 +1961,7 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
1936
1961
  }
1937
1962
 
1938
1963
  delete shippingOrderInfo['']
1939
- delete shippingOrderInfo.matchDeliveryAddressInputa
1964
+ delete shippingOrderInfo.matchDeliveryAddressInput
1940
1965
 
1941
1966
  // If match delivery address is ticked, all the billing address info will be the same with delivery address info
1942
1967
  if (this._disableBillingAddress) {
@@ -2072,6 +2097,11 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
2072
2097
  if (name == 'postalCode') {
2073
2098
  this._cityInput.value = ''
2074
2099
  this._stateInput.value = ''
2100
+ if (this.matchDeliveryAddressInput.value === 'on') {
2101
+ this._cityBillingInput.value = ''
2102
+ this._stateBillingInput.value = ''
2103
+ this._billingPostCode.value = ''
2104
+ }
2075
2105
  return
2076
2106
  } else if (name == 'billingPostalCode') {
2077
2107
  this._cityBillingInput.value = ''
@@ -2100,6 +2130,13 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
2100
2130
 
2101
2131
  switch (name) {
2102
2132
  case 'postalCode':
2133
+ this._cityInput.value = stateName
2134
+ this._stateInput.value = cityName.toUpperCase()
2135
+ if (this.matchDeliveryAddressInput.value === 'on') {
2136
+ this._cityBillingInput.value = stateName
2137
+ this._stateBillingInput.value = cityName.toUpperCase()
2138
+ this._billingPostCode.value = postcode
2139
+ }
2103
2140
  this._releaseOrder = { ...this._releaseOrder, city: cityName.toUpperCase(), state: stateName }
2104
2141
  break
2105
2142
 
@@ -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
@@ -313,8 +313,43 @@ class ReturnOrderRequests extends localize(i18next)(PageView) {
313
313
  return this.config.columns
314
314
  }
315
315
 
316
- _exportableData() {
317
- return this.dataGrist.exportRecords()
316
+ async _exportableData() {
317
+ try {
318
+ let data = []
319
+
320
+ var headerSetting = [
321
+ { header: i18next.t('field.return_order_no'), key: 'name', width: 25, type: 'string' },
322
+ { header: i18next.t('field.company'), key: 'bizplaceName', width: 25, type: 'string' },
323
+ { header: i18next.t('field.ref_no'), key: 'refNo', width: 25, type: 'string' },
324
+ { header: i18next.t('field.eta_date'), key: 'etaDate', width: 30, type: 'string' },
325
+ { header: i18next.t('field.own_transport'), key: 'ownTransport', width: 30, type: 'string' },
326
+ { header: i18next.t('field.status'), key: 'status', width: 25, type: 'string' },
327
+ { header: i18next.t('field.updated_at'), key: 'updatedAt', width: 30, type: 'date' },
328
+ { header: i18next.t('field.accepted_by'), key: 'acceptedByName', width: 25, type: 'string' }
329
+ ]
330
+
331
+ if (this.dataGrist.selected && this.dataGrist.selected.length > 0) {
332
+ data = this.dataGrist.selected.map(record => {
333
+ return {
334
+ ...record,
335
+ bizplaceName: record.bizplace?.name,
336
+ acceptedByName: record.acceptedBy?.name
337
+ }
338
+ })
339
+ } else {
340
+ data = (await this.fetchHandler({ page: 1, limit: 9999999 })).records.map(record => {
341
+ return {
342
+ ...record,
343
+ bizplaceName: record.bizplace?.name,
344
+ acceptedByName: record.acceptedBy?.name
345
+ }
346
+ })
347
+ }
348
+
349
+ return { header: headerSetting, data }
350
+ } catch (e) {
351
+ this._showToast(e)
352
+ }
318
353
  }
319
354
  }
320
355
 
@@ -1069,34 +1069,40 @@ class DeliveryNotePopup extends localize(i18next)(LitElement) {
1069
1069
  }
1070
1070
 
1071
1071
  async _saveDeliveryInfo() {
1072
- let shippingOrderInfo = {}
1072
+ try {
1073
+ let shippingOrderInfo = {}
1073
1074
 
1074
- let contactPointInfo = this._serializeForm(this.shippingInfoForm)
1075
+ let contactPointInfo = this._serializeForm(this.shippingInfoForm)
1075
1076
 
1076
- let exportInfo = {}
1077
- if (this.shippingOrderForm != null) {
1078
- exportInfo = this._serializeForm(this.shippingOrderForm)
1079
- } else {
1080
- exportInfo = {}
1081
- }
1077
+ let deliveryInfo = this._getDeliveryInfo()
1082
1078
 
1083
- shippingOrderInfo = {
1084
- ...contactPointInfo
1085
- }
1079
+ let exportInfo = {}
1080
+ if (this.shippingOrderForm != null) {
1081
+ exportInfo = this._serializeForm(this.shippingOrderForm)
1086
1082
 
1087
- delete shippingOrderInfo['']
1088
- delete shippingOrderInfo.matchDeliveryAddressInputa
1083
+ if (!exportInfo.containerNo && deliveryInfo.exportOption) {
1084
+ throw new Error(i18next.t('text.container_no_is_empty'))
1085
+ }
1086
+ } else {
1087
+ exportInfo = {}
1088
+ }
1089
1089
 
1090
- // If match delivery address is ticked, all the billing address info will be the same with delivery address info
1091
- if (this._disableBillingAddress) {
1092
- shippingOrderInfo.billingAddress = contactPointInfo.deliveryAddress1
1093
- shippingOrderInfo.billingPostalCode = contactPointInfo.postalCode
1094
- shippingOrderInfo.billingCity = contactPointInfo.city
1095
- shippingOrderInfo.billingState = contactPointInfo.state
1096
- shippingOrderInfo.billingCountry = contactPointInfo.country
1097
- }
1090
+ shippingOrderInfo = {
1091
+ ...contactPointInfo
1092
+ }
1093
+
1094
+ delete shippingOrderInfo['']
1095
+ delete shippingOrderInfo.matchDeliveryAddressInputa
1096
+
1097
+ // If match delivery address is ticked, all the billing address info will be the same with delivery address info
1098
+ if (this._disableBillingAddress) {
1099
+ shippingOrderInfo.billingAddress = contactPointInfo.deliveryAddress1
1100
+ shippingOrderInfo.billingPostalCode = contactPointInfo.postalCode
1101
+ shippingOrderInfo.billingCity = contactPointInfo.city
1102
+ shippingOrderInfo.billingState = contactPointInfo.state
1103
+ shippingOrderInfo.billingCountry = contactPointInfo.country
1104
+ }
1098
1105
 
1099
- try {
1100
1106
  let response = null
1101
1107
  if (this.manualDo) {
1102
1108
  response = await client.mutate({
@@ -1111,7 +1117,7 @@ class DeliveryNotePopup extends localize(i18next)(LitElement) {
1111
1117
  }
1112
1118
  `,
1113
1119
  variables: {
1114
- orderInfo: { ...this._getDeliveryInfo() },
1120
+ orderInfo: { ...deliveryInfo },
1115
1121
  orderItems: this._getOrderItems()
1116
1122
  }
1117
1123
  })
@@ -1138,7 +1144,7 @@ class DeliveryNotePopup extends localize(i18next)(LitElement) {
1138
1144
  }
1139
1145
  `,
1140
1146
  variables: {
1141
- orderInfo: { ...this._getDeliveryInfo() },
1147
+ orderInfo: { ...deliveryInfo },
1142
1148
  orderItems: this._getOrderItems(),
1143
1149
  shippingInfo: shippingOrderInfo ? shippingOrderInfo : null,
1144
1150
  exportInfo: exportInfo ? exportInfo : null
@@ -226,7 +226,7 @@ class DeliveryOrderList extends localize(i18next)(PageView) {
226
226
  type: 'string',
227
227
  name: 'refNo',
228
228
  header: i18next.t('field.ref_no'),
229
- imex: { header: i18next.t('field.refNo'), key: 'refNo', width: 25, type: 'string' },
229
+ imex: { header: i18next.t('field.ref_no'), key: 'refNo', width: 25, type: 'string' },
230
230
  sortable: true,
231
231
  width: 150
232
232
  },
@@ -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
@@ -953,9 +956,7 @@ class InventoryReassignPopup extends localize(i18next)(LitElement) {
953
956
  column.record.options.basicArgs.filters = [
954
957
  { name: 'status', operator: 'eq', value: INVENTORY_STATUS.STORED.value },
955
958
  { name: 'productName', operator: 'eq', value: this._selectedOrderProduct.product.sku },
956
- { name: 'packingType', operator: 'eq', value: this._selectedOrderProduct.packingType },
957
- { name: 'packingSize', operator: 'eq', value: this._selectedOrderProduct.packingSize },
958
- { name: 'uom', operator: 'eq', value: this._selectedOrderProduct.uom },
959
+ { name: 'productDetailId', operator: 'eq', value: this._selectedOrderProduct.productDetail.id },
959
960
  { name: 'recall', operator: '', value: this.recallOption },
960
961
  { name: 'skipLockCheck', operator: '', value: true }
961
962
  ]
@@ -1025,6 +1026,7 @@ class InventoryReassignPopup extends localize(i18next)(LitElement) {
1025
1026
  $worksheetNo: String!
1026
1027
  $batchId: String!
1027
1028
  $productId: String!
1029
+ $productDetailId: String!
1028
1030
  $packingType: String!
1029
1031
  $packingSize: Float!
1030
1032
  $orderProductId: String!
@@ -1034,6 +1036,7 @@ class InventoryReassignPopup extends localize(i18next)(LitElement) {
1034
1036
  worksheetNo: $worksheetNo
1035
1037
  batchId: $batchId
1036
1038
  productId: $productId
1039
+ productDetailId: $productDetailId
1037
1040
  packingType: $packingType
1038
1041
  packingSize: $packingSize
1039
1042
  orderProductId: $orderProductId
@@ -1045,6 +1048,7 @@ class InventoryReassignPopup extends localize(i18next)(LitElement) {
1045
1048
  worksheetNo: this.worksheetNo,
1046
1049
  batchId: this._selectedOrderProduct?.batchId,
1047
1050
  productId: this._selectedOrderProduct?.product?.id,
1051
+ productDetailId: this._selectedOrderProduct?.productDetail?.id,
1048
1052
  packingType: this._selectedOrderProduct?.packingType,
1049
1053
  packingSize: this._selectedOrderProduct?.packingSize,
1050
1054
  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
@@ -779,7 +779,7 @@ class PackingProduct extends connect(store)(localize(i18next)(PageView)) {
779
779
  else if (this._enableProductScanning && !this._isRequireSerialNumberScanningOutbound) {
780
780
  this.focusOnProductBarcodeInput()
781
781
  } else {
782
- this._focusOnReleaseQtyInput()
782
+ this.focusOnReleaseQtyInput()
783
783
  this._selectedTaskStatus = null
784
784
  }
785
785
  this._selectedOrderInventory = null
@@ -1022,7 +1022,7 @@ class PackingProduct extends connect(store)(localize(i18next)(PageView)) {
1022
1022
  this.checkedRemarkAt = ''
1023
1023
  await this.fetchInventories(this.binRo)
1024
1024
  this.toggleComplete = false
1025
- this.focusOnProductBarcodeInput()
1025
+ if (this._enableProductScanning) this.focusOnProductBarcodeInput()
1026
1026
  } else {
1027
1027
  this.toggleComplete = false
1028
1028
 
@@ -384,7 +384,9 @@ class PackingWorksheetList extends localize(i18next)(PageView) {
384
384
  async _activateWorksheet() {
385
385
  try {
386
386
  let selectedItem = this.dataGrist.selected.filter(i => i.status == 'DEACTIVATED')
387
- if (selectedItem.length > 0) {
387
+ if (selectedItem.length <= 0) {
388
+ this._showToast({ message: 'No orders have been selected' })
389
+ } else {
388
390
  const result = await CustomAlert({
389
391
  title: i18next.t('title.are_you_sure'),
390
392
  text: i18next.t('text.activate_packing_worksheet'),
@@ -149,6 +149,7 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
149
149
  this._releaseGoodType === 'b2b' &&
150
150
  this._selectedOrderInventory?.status !== 'MISSING' &&
151
151
  this._selectedOrderInventory?.hasMissingInventoryChanges !== true &&
152
+ this._selectedOrderInventory?.status &&
152
153
  this._selectedOrderInventory?.status !== 'DONE'
153
154
  ) {
154
155
  actions.push({
@@ -564,19 +565,19 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
564
565
  if (this.palletInput) this.palletInput.value = ''
565
566
  if (this.serialInput) this.serialInput.value = ''
566
567
 
567
- this._selectedOrderInventory = record
568
-
569
568
  await this.fetchInventories(
570
569
  this.refPickingType === PICKING_TYPES.PICKING.value ? this.releaseGoodNo : this.taskNo
571
570
  )
572
571
 
573
- this.focusOnInput
572
+ this.focusOnInput()
574
573
  let updatedRecords = this._selectedOrderInventory
575
574
  if (updatedRecords.releaseQty === updatedRecords.pickedQty) {
576
575
  updatedRecords.status = 'DONE'
577
576
  } else {
578
577
  updatedRecords.status = 'PICKING'
579
578
  }
579
+ this._selectedOrderInventory = record
580
+ this.updateContext()
580
581
  }
581
582
  } catch (ex) {
582
583
  console.log(ex)
@@ -702,6 +703,7 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
702
703
  }
703
704
  record.locationName = record?.location?.name
704
705
  record.product = record?.relatedOrderInv && record?.relatedOrderInv?.product
706
+ record.productDetail = record?.relatedOrderInv.productDetail
705
707
 
706
708
  if (this._crossDocking) {
707
709
  record.batchId = record.relatedOrderInv.batchId
@@ -1095,7 +1097,7 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
1095
1097
  batchId: this._selectedOrderInventory.batchId,
1096
1098
  packingType: this._selectedOrderInventory.packingType,
1097
1099
  packingSize: this._selectedOrderInventory.packingSize,
1098
- product: { id: this._selectedOrderInventory.product.id }
1100
+ productDetail: { id: this._selectedOrderInventory.productDetail.id }
1099
1101
  },
1100
1102
  binLocationName:
1101
1103
  this._hasBinPicking && (!this.toteNo || this.tote == '') ? this.binLocationInput.value : null,
@@ -1464,6 +1466,9 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
1464
1466
  description
1465
1467
  isRequireSerialNumberScanningOutbound
1466
1468
  }
1469
+ productDetail {
1470
+ id
1471
+ }
1467
1472
  }
1468
1473
  }
1469
1474
  }
@@ -1613,6 +1618,9 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
1613
1618
  description
1614
1619
  sku
1615
1620
  }
1621
+ productDetail {
1622
+ id
1623
+ }
1616
1624
  }
1617
1625
  }
1618
1626
  }
@@ -1719,6 +1727,7 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
1719
1727
  }
1720
1728
 
1721
1729
  this.updateContext()
1730
+ // if (this.data.records.every(record => record.completed))
1722
1731
  }
1723
1732
 
1724
1733
  async fetchPalletsHandler(releaseGoodNo) {
@@ -1944,6 +1953,9 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
1944
1953
  name
1945
1954
  description
1946
1955
  }
1956
+ productDetail {
1957
+ id
1958
+ }
1947
1959
  }
1948
1960
  }
1949
1961
  }
@@ -1997,7 +2009,7 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
1997
2009
 
1998
2010
  async showWorksheetList() {
1999
2011
  await sleep(1010)
2000
- openPopup(html` <show-my-worksheet-list-popup></show-my-worksheet-list-popup> `, {
2012
+ openPopup(html` <show-my-worksheet-list-popup .type=${this.refPickingType}></show-my-worksheet-list-popup> `, {
2001
2013
  backdrop: true,
2002
2014
  size: 'small',
2003
2015
  title: i18next.t('title.my_worksheet_list')
@@ -241,7 +241,7 @@ class SerialNumberPopup extends localize(i18next)(LitElement) {
241
241
  { name: 'orderType', operator: 'eq', value: this.orderType },
242
242
  { name: 'orderId', operator: 'eq', value: this.orderId },
243
243
  { name: 'productId', operator: 'eq', value: this.data.product.id },
244
- { name: 'inventory_info', operator: 'i_like', value: `%${this.data.palletId}%` }
244
+ { name: 'inventory_info', operator: 'i_like', value: `${this.data.palletId}` }
245
245
  ]
246
246
 
247
247
  const pagination = { page: 1, limit: 9999999 }
@@ -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