@things-factory/product-ui 4.3.186 → 4.3.187

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.
@@ -111,7 +111,6 @@ class ProductList extends localize(i18next)(PageView) {
111
111
  }
112
112
  openImportPopUp(records, config, async patches => {
113
113
  await this._importProducts(patches)
114
- history.back()
115
114
  })
116
115
  }
117
116
  },
@@ -891,7 +890,15 @@ class ProductList extends localize(i18next)(PageView) {
891
890
  patch?.expirationPeriod || patch?.expirationPeriod == 0 ? parseInt(patch.expirationPeriod) : undefined,
892
891
  shelfLife: patch?.shelfLife || patch?.shelfLife == 0 ? parseInt(patch.shelfLife) : undefined,
893
892
  productRef: patch.productRef?.id ? { id: patch.productRef?.id } : undefined,
894
- parentProductRef: patch.parentProductRef?.id ? { id: patch.parentProductRef?.id } : undefined
893
+ parentProductRef: patch.parentProductRef?.id ? { id: patch.parentProductRef?.id } : undefined,
894
+ costPrice: patch?.costPrice ? parseFloat(patch.costPrice) : undefined,
895
+ uomValue: patch?.uomValue ? parseFloat(patch.uomValue) : undefined,
896
+ bufferQty: patch?.bufferQty ? parseInt(patch.bufferQty) : undefined,
897
+ minQty: patch?.minQty ? parseInt(patch.minQty) : undefined,
898
+ maxQty: patch?.maxQty ? parseInt(patch.maxQty) : undefined,
899
+ packingSize: patch?.packingSize ? parseInt(patch.packingSize) : undefined,
900
+ expirationPeriod: patch?.expirationPeriod ? parseInt(patch.expirationPeriod) : undefined,
901
+ shelfLife: patch?.shelfLife ? parseInt(patch.shelfLife) : undefined
895
902
  }
896
903
  })
897
904
 
@@ -921,6 +928,11 @@ class ProductList extends localize(i18next)(PageView) {
921
928
  if (!patches?.length) {
922
929
  return this.showToast(i18next.t('text.nothing_changed'))
923
930
  }
931
+
932
+ if (patches.find(itm => Object.values(itm).find(val => typeof val == 'number' && val < 0))) {
933
+ return this.showToast(`Minimum value of 0 is required.`)
934
+ }
935
+
924
936
  patches = patches.map(patch => {
925
937
  patch.costPrice = patch.costPrice == null ? 0 : patch.costPrice
926
938
 
@@ -957,6 +969,7 @@ class ProductList extends localize(i18next)(PageView) {
957
969
  if (!response.errors) {
958
970
  this.showToast(i18next.t('text.data_import_successfully'))
959
971
  this.dataGrist.fetch()
972
+ history.back()
960
973
  }
961
974
  } catch (error) {
962
975
  this.showToast(error.message)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/product-ui",
3
- "version": "4.3.186",
3
+ "version": "4.3.187",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "client/index.js",
6
6
  "things-factory": true,
@@ -31,5 +31,5 @@
31
31
  "@things-factory/product-base": "^4.3.186",
32
32
  "@things-factory/shell": "^4.3.179"
33
33
  },
34
- "gitHead": "854c79b134b5d94c5635c75c467eca229430183b"
34
+ "gitHead": "a6192bef4662aafeb4e9d4e715dca07aa1459b2d"
35
35
  }