@things-factory/operato-wms 3.8.4 → 3.8.5

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.
@@ -803,14 +803,18 @@ class PutawayProduct extends connect(store)(localize(i18next)(PageView)) {
803
803
  if (this._enableCartonLabel) {
804
804
  let worksheetDetail = this._getSelectedOrderProducts(this.cartonInput.value)
805
805
  worksheetDetailNames.push(worksheetDetail[0].name)
806
- if (worksheetDetail[0].expirationPeriod > 0 && locationDetails.type !== 'QUARANTINE') {
807
- await this._expiryAlert()
808
- }
806
+ await this._checkExpiry(
807
+ worksheetDetail[0].expirationPeriod,
808
+ new Date(worksheetDetail[0].expirationDate),
809
+ locationDetails.type
810
+ )
809
811
  } else {
810
812
  worksheetDetailNames.push(this._selectedOrderProduct.name)
811
- if (this._selectedOrderProduct.expirationPeriod > 0 && locationDetails.type !== 'QUARANTINE') {
812
- await this._expiryAlert()
813
- }
813
+ await this._checkExpiry(
814
+ this._selectedOrderProduct.expirationPeriod,
815
+ new Date(this._selectedOrderProduct.expirationDate),
816
+ locationDetails.type
817
+ )
814
818
  }
815
819
 
816
820
  const response = await client.mutate({
@@ -874,16 +878,20 @@ class PutawayProduct extends connect(store)(localize(i18next)(PageView)) {
874
878
  const locationDetails = await this._fetchLocation(this.locationInput.value.trim())
875
879
 
876
880
  if (this._enableCartonLabel) {
877
- worksheetDetailNames.push(worksheetDetail[0].name)
878
881
  let worksheetDetail = this._getSelectedOrderProducts(this.cartonInput.value)
879
- if (worksheetDetail[0].expirationPeriod > 0 && locationDetails.type !== 'QUARANTINE') {
880
- await this._expiryAlert()
881
- }
882
+ worksheetDetailNames.push(worksheetDetail[0].name)
883
+ await this._checkExpiry(
884
+ worksheetDetail[0].expirationPeriod,
885
+ new Date(worksheetDetail[0].expirationDate),
886
+ locationDetails.type
887
+ )
882
888
  } else {
883
889
  worksheetDetailNames.push(this._selectedOrderProduct.name)
884
- if (this._selectedOrderProduct.expirationPeriod > 0 && locationDetails.type !== 'QUARANTINE') {
885
- await this._expiryAlert()
886
- }
890
+ await this._checkExpiry(
891
+ this._selectedOrderProduct.expirationPeriod,
892
+ new Date(this._selectedOrderProduct.expirationDate),
893
+ locationDetails.type
894
+ )
887
895
  }
888
896
 
889
897
  const response = await client.mutate({
@@ -945,8 +953,10 @@ class PutawayProduct extends connect(store)(localize(i18next)(PageView)) {
945
953
  await this._validatePutaway()
946
954
  if (!this.incompleteLocationName) {
947
955
  let worksheetDetailNames = []
948
- if (this._enableCartonLabel) worksheetDetailNames = this._getSelectedOrderProducts(this.cartonInput.value)
949
- else worksheetDetailNames.push(this._selectedOrderProduct.name)
956
+ if (this._enableCartonLabel) {
957
+ const selectedWorksheetDetailName = this._getSelectedOrderProducts(this.cartonInput.value)
958
+ worksheetDetailNames.push(selectedWorksheetDetailName[0].name)
959
+ } else worksheetDetailNames.push(this._selectedOrderProduct.name)
950
960
 
951
961
  const response = await client.mutate({
952
962
  mutation: gql`
@@ -1096,6 +1106,15 @@ class PutawayProduct extends connect(store)(localize(i18next)(PageView)) {
1096
1106
  }
1097
1107
  }
1098
1108
 
1109
+ async _checkExpiry(expirationPeriod, expiryDate, locationType) {
1110
+ let date = new Date()
1111
+ let acceptBefore = new Date(date.setDate(date.getDate() + expirationPeriod))
1112
+
1113
+ if (expirationPeriod > 0) {
1114
+ if (expiryDate < acceptBefore && locationType !== 'QUARANTINE') await this._expiryAlert()
1115
+ }
1116
+ }
1117
+
1099
1118
  _validateTransfer() {
1100
1119
  // 1. validate for order selection
1101
1120
  if (!this._selectedOrderProduct) throw new Error(i18next.t('text.target_is_not_selected'))
@@ -328,7 +328,7 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
328
328
  <input name="batchIdRef" readonly />
329
329
 
330
330
  <label>${i18next.t('label.packing_type')}</label>
331
- <input name="packingTypeSize" readonly />
331
+ <input name="packingType" readonly />
332
332
 
333
333
  <label>${i18next.t('label.total_pallet_qty')}</label>
334
334
  <input name="palletQty" type="number" readonly />
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/operato-wms",
3
- "version": "3.8.4",
3
+ "version": "3.8.5",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "client/index.js",
6
6
  "things-factory": true,
@@ -71,7 +71,7 @@
71
71
  "@things-factory/print-ui": "^3.8.0",
72
72
  "@things-factory/product-base": "^3.8.3",
73
73
  "@things-factory/resource-ui": "^3.8.0",
74
- "@things-factory/sales-ui": "^3.8.3",
74
+ "@things-factory/sales-ui": "^3.8.5",
75
75
  "@things-factory/scene-chartjs": "^3.7.5",
76
76
  "@things-factory/scene-clock": "^3.7.5",
77
77
  "@things-factory/scene-clone": "^3.7.5",
@@ -102,11 +102,11 @@
102
102
  "@things-factory/system-ui": "^3.8.0",
103
103
  "@things-factory/transport-base": "^3.8.0",
104
104
  "@things-factory/tutorial-ui": "^3.8.0",
105
- "@things-factory/warehouse-base": "^3.8.3",
106
- "@things-factory/worksheet-base": "^3.8.4"
105
+ "@things-factory/warehouse-base": "^3.8.5",
106
+ "@things-factory/worksheet-base": "^3.8.5"
107
107
  },
108
108
  "devDependencies": {
109
109
  "@things-factory/builder": "^3.7.5"
110
110
  },
111
- "gitHead": "9dedf75962d3a804204ae3341588ee91533c63dd"
111
+ "gitHead": "1f8f8ca9c0d96737732388c9cc685e64b0759a96"
112
112
  }