@things-factory/operato-wms 4.0.37 → 4.0.38

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.
@@ -411,8 +411,8 @@ class BulkOperation extends localize(i18next)(PageView) {
411
411
  packingSize: !isNaN(Number(record.packingSize || 'x')) ? Number(record.packingSize) : null,
412
412
  uom: record.uom && record.uom != '' ? String(record.uom) : null,
413
413
  releaseQty: Number(record.releaseQty),
414
- postalCode: String(record.postalCode),
415
- phone1: String(record.phone1),
414
+ postalCode: String(record.postalCode || ''),
415
+ phone1: String(record.phone1 || ''),
416
416
  exportOption: false
417
417
  }
418
418
  })}
@@ -206,7 +206,7 @@ class PutawayProduct extends connect(store)(localize(i18next)(PageView)) {
206
206
  <barcode-scanable-input name="cartonId" custom-input></barcode-scanable-input>
207
207
  `
208
208
  : html`
209
- <label>${i18next.t('label.lot_barcode')}</label>
209
+ <label>${i18next.t('label.lot_id')}</label>
210
210
  <barcode-scanable-input name="palletId" .value=${this._pallet} custom-input></barcode-scanable-input>
211
211
  `}
212
212
  ${this._operationType === OPERATION_TYPE.PUTAWAY
@@ -716,26 +716,22 @@ class PutawayProduct extends connect(store)(localize(i18next)(PageView)) {
716
716
  const locationDetails = await this._fetchLocation(this.locationInput.value.trim())
717
717
 
718
718
  if (this._enableCartonLabel) {
719
- let worksheetDetail = this._getSelectedOrderProducts(this.cartonInput.value)
720
- worksheetDetailNames.push(worksheetDetail[0].name)
721
- if (worksheetDetail[0].expirationDate) {
722
- await this._checkExpiry(
723
- worksheetDetail[0].expirationPeriod,
724
- new Date(worksheetDetail[0].expirationDate),
725
- locationDetails.type
726
- )
719
+ let worksheetDetails = this._getSelectedOrderProducts(this.cartonInput.value)
720
+ worksheetDetails.forEach(itm => {
721
+ worksheetDetailNames.push(itm.name)
722
+ })
723
+ if (worksheetDetails.find(itm => itm.expirationDate)) {
724
+ var answer = await this._checkExpiry(worksheetDetails, locationDetails.type)
727
725
  }
728
726
  } else {
729
727
  worksheetDetailNames.push(this._selectedOrderProduct.name)
730
728
  if (this._selectedOrderProduct.expirationDate) {
731
- await this._checkExpiry(
732
- this._selectedOrderProduct.expirationPeriod,
733
- new Date(this._selectedOrderProduct.expirationDate),
734
- locationDetails.type
735
- )
729
+ var answer = await this._checkExpiry(this._selectedOrderProduct, locationDetails.type)
736
730
  }
737
731
  }
738
732
 
733
+ if (!answer.value) return (this._scanning = false)
734
+
739
735
  const response = await client.mutate({
740
736
  mutation: gql`
741
737
  mutation putaway(
@@ -797,26 +793,22 @@ class PutawayProduct extends connect(store)(localize(i18next)(PageView)) {
797
793
  const locationDetails = await this._fetchLocation(this.locationInput.value.trim())
798
794
 
799
795
  if (this._enableCartonLabel) {
800
- let worksheetDetail = this._getSelectedOrderProducts(this.cartonInput.value)
801
- worksheetDetailNames.push(worksheetDetail[0].name)
802
- if (worksheetDetail[0].expirationDate) {
803
- await this._checkExpiry(
804
- worksheetDetail[0].expirationPeriod,
805
- new Date(worksheetDetail[0].expirationDate),
806
- locationDetails.type
807
- )
796
+ let worksheetDetails = this._getSelectedOrderProducts(this.cartonInput.value)
797
+ worksheetDetails.forEach(itm => {
798
+ worksheetDetailNames.push(itm.name)
799
+ })
800
+ if (worksheetDetails.find(itm => itm.expirationDate)) {
801
+ var answer = await this._checkExpiry(worksheetDetails, locationDetails.type)
808
802
  }
809
803
  } else {
810
804
  worksheetDetailNames.push(this._selectedOrderProduct.name)
811
805
  if (this._selectedOrderProduct.expirationDate) {
812
- await this._checkExpiry(
813
- this._selectedOrderProduct.expirationPeriod,
814
- new Date(this._selectedOrderProduct.expirationDate),
815
- locationDetails.type
816
- )
806
+ var answer = await this._checkExpiry(this._selectedOrderProduct, locationDetails.type)
817
807
  }
818
808
  }
819
809
 
810
+ if (!answer.value) return (this._scanning = false)
811
+
820
812
  const response = await client.mutate({
821
813
  mutation: gql`
822
814
  mutation putawayReturn(
@@ -977,11 +969,15 @@ class PutawayProduct extends connect(store)(localize(i18next)(PageView)) {
977
969
  }
978
970
  }
979
971
 
980
- async _expiryAlert() {
981
- await CustomAlert({
972
+ async _expiryAlert(expiringProducts) {
973
+ const answer = await CustomAlert({
982
974
  title: i18next.t('title.location_scanned_is_not_a_quarantine_zone'),
983
- confirmButton: { text: i18next.t('button.confirm') }
975
+ text: i18next.t('text.x_is_expiring', { x: expiringProducts }),
976
+ confirmButton: { text: i18next.t('button.confirm') },
977
+ cancelButton: { text: i18next.t('button.cancel') }
984
978
  })
979
+
980
+ return answer
985
981
  }
986
982
 
987
983
  _getSelectedOrderProducts(scannedCartonId) {
@@ -991,7 +987,8 @@ class PutawayProduct extends connect(store)(localize(i18next)(PageView)) {
991
987
  return {
992
988
  name: record.name,
993
989
  expirationDate: record.expirationDate,
994
- expirationPeriod: record.product.expirationPeriod
990
+ expirationPeriod: record.product.expirationPeriod,
991
+ palletId: record.palletId
995
992
  }
996
993
  })
997
994
  }
@@ -1048,13 +1045,21 @@ class PutawayProduct extends connect(store)(localize(i18next)(PageView)) {
1048
1045
  }
1049
1046
  }
1050
1047
 
1051
- async _checkExpiry(expirationPeriod, expiryDate, locationType) {
1052
- let date = new Date()
1053
- let acceptBefore = new Date(date.setDate(date.getDate() + expirationPeriod))
1048
+ async _checkExpiry(worksheetDetails, locationType) {
1049
+ let expiringProducts = []
1050
+ for (let wsd of worksheetDetails) {
1051
+ new Date(wsd.expirationDate)
1052
+ let date = new Date()
1053
+ let acceptBefore = new Date(date.setDate(date.getDate() + wsd.expirationPeriod))
1054
1054
 
1055
- if (expirationPeriod > 0) {
1056
- if (expiryDate < acceptBefore && locationType !== 'QUARANTINE') await this._expiryAlert()
1055
+ if (wsd.expirationPeriod > 0 && wsd.expirationDate) {
1056
+ if (new Date(wsd.expirationDate) < acceptBefore && locationType !== 'QUARANTINE') {
1057
+ expiringProducts.push(wsd.palletId)
1058
+ }
1059
+ }
1057
1060
  }
1061
+
1062
+ return this._expiryAlert(expiringProducts.toString())
1058
1063
  }
1059
1064
 
1060
1065
  _validateTransfer() {
@@ -792,6 +792,11 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
792
792
  async _scanProductUnload() {
793
793
  if (this._scanning) return this._showToast({ message: i18next.t('text.previous_scan_is_executing') })
794
794
  this._scanning = true
795
+
796
+ const answer = await this._checkExpiry()
797
+
798
+ if (!answer.value) return (this._scanning = false)
799
+
795
800
  try {
796
801
  const response = await client.mutate({
797
802
  mutation: gql`
@@ -819,7 +824,6 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
819
824
  })
820
825
 
821
826
  if (!response.errors) {
822
- await this._checkExpiry()
823
827
  await this._fetchProducts(this._orderNo)
824
828
  }
825
829
  } catch (e) {
@@ -839,17 +843,25 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
839
843
  const acceptBefore = new Date(date.setDate(date.getDate() + this._expirationPeriod))
840
844
  let expiryDate = new Date(this.expDateInput.value)
841
845
  if (expiryDate < acceptBefore) {
842
- await CustomAlert({
846
+ var answer = await CustomAlert({
843
847
  title: i18next.t('title.item_unloading_is_expiring_soon'),
844
- confirmButton: { text: i18next.t('button.confirm') }
848
+ confirmButton: { text: i18next.t('button.confirm') },
849
+ cancelButton: { text: i18next.t('button.cancel') }
845
850
  })
846
851
  }
847
852
  }
853
+
854
+ return answer
848
855
  }
849
856
 
850
857
  async _qtyUnload() {
851
858
  if (this._scanning) return this._showToast({ message: i18next.t('text.previous_scan_is_executing') })
852
859
  this._scanning = true
860
+
861
+ const answer = await this._checkExpiry()
862
+
863
+ if (!answer.value) return (this._scanning = false)
864
+
853
865
  try {
854
866
  const response = await client.mutate({
855
867
  mutation: gql`
@@ -870,7 +882,6 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
870
882
  }
871
883
  })
872
884
  if (!response.errors) {
873
- await this._checkExpiry()
874
885
  await this._fetchProducts(this._orderNo)
875
886
  }
876
887
  } catch (e) {
@@ -1350,11 +1361,11 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
1350
1361
  }
1351
1362
  }
1352
1363
 
1353
- _getWorksheetDetails(completeType) {
1364
+ _getWorksheetDetails(unloadType) {
1354
1365
  return this.orderProductData.records.map(task => {
1355
- return (completeType = 'partial'
1366
+ return unloadType == 'partial'
1356
1367
  ? { name: task.name, issue: task.issue ? task.issue : null, actualPackQty: task.actualPackQty }
1357
- : { name: task.name, issue: task.issue ? task.issue : null })
1368
+ : { name: task.name, issue: task.issue ? task.issue : null }
1358
1369
  })
1359
1370
  }
1360
1371
 
@@ -342,7 +342,7 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
342
342
  <barcode-scanable-input name="cartonId" custom-input></barcode-scanable-input>
343
343
  `
344
344
  : html`
345
- <label>${i18next.t('label.lot_barcode')}</label>
345
+ <label>${i18next.t('label.lot_id')}</label>
346
346
  <barcode-scanable-input name="palletId" custom-input></barcode-scanable-input>
347
347
  `}
348
348
  ${this._enableProductScanning
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/operato-wms",
3
- "version": "4.0.37",
3
+ "version": "4.0.38",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "client/index.js",
6
6
  "things-factory": true,
@@ -41,7 +41,7 @@
41
41
  "docker:run": "docker run --platform linux/amd64 -p 4000:3000 hatiolab/operato-wms:latest"
42
42
  },
43
43
  "dependencies": {
44
- "@operato/ghost-print": "^0.3.17",
44
+ "@operato/ghost-print": "^0.3.18",
45
45
  "@operato/scene-chartjs": "^0.1.2",
46
46
  "@operato/scene-clock": "^0.1.2",
47
47
  "@operato/scene-clone": "^0.1.2",
@@ -55,58 +55,58 @@
55
55
  "@operato/scene-tab": "^0.1.2",
56
56
  "@operato/scene-table": "^0.1.2",
57
57
  "@operato/scene-wheel-sorter": "^0.1.2",
58
- "@things-factory/apptool-ui": "^4.0.37",
59
- "@things-factory/attachment-ui": "^4.0.37",
60
- "@things-factory/auth-ui": "^4.0.37",
61
- "@things-factory/barcode-ui": "^4.0.37",
62
- "@things-factory/biz-ui": "^4.0.37",
63
- "@things-factory/board-service": "^4.0.37",
64
- "@things-factory/board-ui": "^4.0.37",
65
- "@things-factory/code-ui": "^4.0.37",
66
- "@things-factory/context-ui": "^4.0.37",
67
- "@things-factory/export-ui": "^4.0.37",
68
- "@things-factory/export-ui-csv": "^4.0.37",
69
- "@things-factory/export-ui-excel": "^4.0.37",
70
- "@things-factory/fav-base": "^4.0.37",
71
- "@things-factory/form-ui": "^4.0.37",
72
- "@things-factory/grist-ui": "^4.0.37",
73
- "@things-factory/help": "^4.0.37",
74
- "@things-factory/i18n-ui": "^4.0.37",
75
- "@things-factory/id-rule-base": "^4.0.37",
76
- "@things-factory/import-ui": "^4.0.37",
77
- "@things-factory/import-ui-excel": "^4.0.37",
78
- "@things-factory/menu-ui": "^4.0.37",
79
- "@things-factory/more-ui": "^4.0.37",
80
- "@things-factory/notification": "^4.0.37",
81
- "@things-factory/pdf": "^4.0.37",
82
- "@things-factory/print-proxy-service": "^4.0.37",
83
- "@things-factory/print-service": "^4.0.37",
84
- "@things-factory/print-ui": "^4.0.37",
85
- "@things-factory/product-base": "^4.0.37",
86
- "@things-factory/resource-ui": "^4.0.37",
87
- "@things-factory/sales-ui": "^4.0.37",
88
- "@things-factory/scene-data-transform": "^4.0.37",
89
- "@things-factory/scene-excel": "^4.0.37",
90
- "@things-factory/scene-firebase": "^4.0.37",
91
- "@things-factory/scene-form": "^4.0.37",
92
- "@things-factory/scene-google-map": "^4.0.37",
93
- "@things-factory/scene-graphql": "^4.0.37",
58
+ "@things-factory/apptool-ui": "^4.0.38",
59
+ "@things-factory/attachment-ui": "^4.0.38",
60
+ "@things-factory/auth-ui": "^4.0.38",
61
+ "@things-factory/barcode-ui": "^4.0.38",
62
+ "@things-factory/biz-ui": "^4.0.38",
63
+ "@things-factory/board-service": "^4.0.38",
64
+ "@things-factory/board-ui": "^4.0.38",
65
+ "@things-factory/code-ui": "^4.0.38",
66
+ "@things-factory/context-ui": "^4.0.38",
67
+ "@things-factory/export-ui": "^4.0.38",
68
+ "@things-factory/export-ui-csv": "^4.0.38",
69
+ "@things-factory/export-ui-excel": "^4.0.38",
70
+ "@things-factory/fav-base": "^4.0.38",
71
+ "@things-factory/form-ui": "^4.0.38",
72
+ "@things-factory/grist-ui": "^4.0.38",
73
+ "@things-factory/help": "^4.0.38",
74
+ "@things-factory/i18n-ui": "^4.0.38",
75
+ "@things-factory/id-rule-base": "^4.0.38",
76
+ "@things-factory/import-ui": "^4.0.38",
77
+ "@things-factory/import-ui-excel": "^4.0.38",
78
+ "@things-factory/menu-ui": "^4.0.38",
79
+ "@things-factory/more-ui": "^4.0.38",
80
+ "@things-factory/notification": "^4.0.38",
81
+ "@things-factory/pdf": "^4.0.38",
82
+ "@things-factory/print-proxy-service": "^4.0.38",
83
+ "@things-factory/print-service": "^4.0.38",
84
+ "@things-factory/print-ui": "^4.0.38",
85
+ "@things-factory/product-base": "^4.0.38",
86
+ "@things-factory/resource-ui": "^4.0.38",
87
+ "@things-factory/sales-ui": "^4.0.38",
88
+ "@things-factory/scene-data-transform": "^4.0.38",
89
+ "@things-factory/scene-excel": "^4.0.38",
90
+ "@things-factory/scene-firebase": "^4.0.38",
91
+ "@things-factory/scene-form": "^4.0.38",
92
+ "@things-factory/scene-google-map": "^4.0.38",
93
+ "@things-factory/scene-graphql": "^4.0.38",
94
94
  "@things-factory/scene-half-roundrect": "^4.0.9",
95
- "@things-factory/scene-label": "^4.0.37",
96
- "@things-factory/scene-marker": "^4.0.37",
97
- "@things-factory/scene-mqtt": "^4.0.37",
98
- "@things-factory/scene-news-ticker": "^4.0.37",
99
- "@things-factory/scene-restful": "^4.0.37",
100
- "@things-factory/scene-visualizer": "^4.0.37",
101
- "@things-factory/setting-ui": "^4.0.37",
102
- "@things-factory/system-ui": "^4.0.37",
103
- "@things-factory/transport-base": "^4.0.37",
104
- "@things-factory/tutorial-ui": "^4.0.37",
105
- "@things-factory/warehouse-base": "^4.0.37",
106
- "@things-factory/worksheet-base": "^4.0.37"
95
+ "@things-factory/scene-label": "^4.0.38",
96
+ "@things-factory/scene-marker": "^4.0.38",
97
+ "@things-factory/scene-mqtt": "^4.0.38",
98
+ "@things-factory/scene-news-ticker": "^4.0.38",
99
+ "@things-factory/scene-restful": "^4.0.38",
100
+ "@things-factory/scene-visualizer": "^4.0.38",
101
+ "@things-factory/setting-ui": "^4.0.38",
102
+ "@things-factory/system-ui": "^4.0.38",
103
+ "@things-factory/transport-base": "^4.0.38",
104
+ "@things-factory/tutorial-ui": "^4.0.38",
105
+ "@things-factory/warehouse-base": "^4.0.38",
106
+ "@things-factory/worksheet-base": "^4.0.38"
107
107
  },
108
108
  "devDependencies": {
109
- "@things-factory/builder": "^4.0.37"
109
+ "@things-factory/builder": "^4.0.38"
110
110
  },
111
- "gitHead": "7abd5ee06f7329c7fbb0c305f7b075a990bc2c18"
111
+ "gitHead": "c2b2638e6efec319d4024cedc8da513d560c126e"
112
112
  }
@@ -1353,6 +1353,7 @@
1353
1353
  "text.x_error": "{state.x} error",
1354
1354
  "text.x_exceed_limit": "{state.x} exceed limit",
1355
1355
  "text.x_is_empty": "{state.x} is empty",
1356
+ "text.x_is_expiring": "{x} is expiring",
1356
1357
  "text.x_should_be_positive": "{state.x} should be positive value",
1357
1358
  "text.yes": "yes",
1358
1359
  "text.you_can_only_select_one_transport_type": "you can only select one transport type",
@@ -1864,5 +1864,6 @@
1864
1864
  "text.reusable_pallet_id_empty": "[ko] plastic pallet id is empty",
1865
1865
  "text.use_normal_pallet": "[ko] use normal pallet",
1866
1866
  "text.invalid_return_location": "[ko] invalid return location",
1867
- "button.disable": "[ko] disable"
1867
+ "button.disable": "[ko] disable",
1868
+ "text.x_is_expiring": "[ko] {x} is expiring"
1868
1869
  }
@@ -1734,5 +1734,6 @@
1734
1734
  "text.reusable_pallet_id_empty": "[ms] plastic pallet id is empty",
1735
1735
  "text.invalid_return_location": "[ms] invalid return location",
1736
1736
  "text.use_normal_pallet": "[ms] use normal pallet",
1737
- "button.disable": "[ms] disable"
1737
+ "button.disable": "[ms] disable",
1738
+ "text.x_is_expiring": "[ko] {x} is expiring"
1738
1739
  }
@@ -1684,5 +1684,6 @@
1684
1684
  "text.reusable_pallet_id_empty": "[zh] plastic pallet id is empty",
1685
1685
  "text.invalid_return_location": "[zh] invalid return location",
1686
1686
  "text.use_normal_pallet": "[zh] use normal pallet",
1687
- "button.disable": "[zh] disable"
1687
+ "button.disable": "[zh] disable",
1688
+ "text.x_is_expiring": "[ko] {x} is expiring"
1688
1689
  }