@things-factory/product-ui 4.3.186 → 4.3.204

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.
@@ -88,6 +88,11 @@ class ProductList extends localize(i18next)(PageView) {
88
88
  handler: records => {
89
89
  records.map(record => {
90
90
  record.costPrice = record.costPrice == null ? '0.00' : parseFloat(record.costPrice).toFixed(2)
91
+ record.commissionFee = record.commissionFee == null ? '0.00' : parseFloat(record.commissionFee).toFixed(2)
92
+ record.platformFee = record.platformFee == null ? '0.00' : parseFloat(record.platformFee).toFixed(2)
93
+ record.serviceFee = record.serviceFee == null ? '0.00' : parseFloat(record.serviceFee).toFixed(2)
94
+ record.transactionFee =
95
+ record.transactionFee == null ? '0.00' : parseFloat(record.transactionFee).toFixed(2)
91
96
  })
92
97
  const config = {
93
98
  rows: this.productGristConfig.rows,
@@ -106,12 +111,39 @@ class ProductList extends localize(i18next)(PageView) {
106
111
  record: { editable: true, align: 'left' },
107
112
  header: i18next.t('field.packing_size'),
108
113
  width: 80
114
+ },
115
+ {
116
+ type: 'float',
117
+ name: 'commissionFee',
118
+ record: { editable: true, align: 'left' },
119
+ header: i18next.t('field.commission_fee'),
120
+ width: 80
121
+ },
122
+ {
123
+ type: 'float',
124
+ name: 'platformFee',
125
+ record: { editable: true, align: 'left' },
126
+ header: i18next.t('field.platform_fee'),
127
+ width: 80
128
+ },
129
+ {
130
+ type: 'float',
131
+ name: 'serviceFee',
132
+ record: { editable: true, align: 'left' },
133
+ header: i18next.t('field.service_fee'),
134
+ width: 80
135
+ },
136
+ {
137
+ type: 'float',
138
+ name: 'transactionFee',
139
+ record: { editable: true, align: 'left' },
140
+ header: i18next.t('field.transaction_fee'),
141
+ width: 80
109
142
  }
110
143
  ]
111
144
  }
112
145
  openImportPopUp(records, config, async patches => {
113
146
  await this._importProducts(patches)
114
- history.back()
115
147
  })
116
148
  }
117
149
  },
@@ -687,6 +719,34 @@ class ProductList extends localize(i18next)(PageView) {
687
719
  header: `${i18next.t('field.picking_strategy')}`,
688
720
  width: 100
689
721
  },
722
+ {
723
+ type: 'float',
724
+ name: 'commissionFee',
725
+ record: { editable: true },
726
+ header: i18next.t('field.commission_fee'),
727
+ width: 80
728
+ },
729
+ {
730
+ type: 'float',
731
+ name: 'platformFee',
732
+ record: { editable: true },
733
+ header: i18next.t('field.platform_fee'),
734
+ width: 80
735
+ },
736
+ {
737
+ type: 'float',
738
+ name: 'serviceFee',
739
+ record: { editable: true },
740
+ header: i18next.t('field.service_fee'),
741
+ width: 80
742
+ },
743
+ {
744
+ type: 'float',
745
+ name: 'transactionFee',
746
+ record: { editable: true },
747
+ header: i18next.t('field.transaction_fee'),
748
+ width: 80
749
+ },
690
750
  {
691
751
  type: 'object',
692
752
  name: 'updater',
@@ -782,6 +842,10 @@ class ProductList extends localize(i18next)(PageView) {
782
842
  subBrand
783
843
  gtin
784
844
  pickingStrategy
845
+ commissionFee
846
+ platformFee
847
+ serviceFee
848
+ transactionFee
785
849
  updater {
786
850
  name
787
851
  description
@@ -807,7 +871,17 @@ class ProductList extends localize(i18next)(PageView) {
807
871
  return {
808
872
  ...itm,
809
873
  productRef: { name: itm?.productRef ? '(' + itm.productRef.sku + ') ' + itm.productRef.name : '' },
810
- costPrice: parseFloat(itm.costPrice).toFixed(2)
874
+ costPrice: parseFloat(itm?.costPrice?.isNaN || itm?.costPrice == null ? 0 : itm.costPrice).toFixed(2),
875
+ commissionFee: parseFloat(
876
+ itm?.commissionFee?.isNaN || itm?.commissionFee == null ? 0 : itm.commissionFee
877
+ ).toFixed(2),
878
+ platformFee: parseFloat(
879
+ itm?.platformFee?.isNaN || itm?.platformFee == null ? 0 : itm.platformFee
880
+ ).toFixed(2),
881
+ serviceFee: parseFloat(itm?.serviceFee?.isNaN || itm?.serviceFee == null ? 0 : itm.serviceFee).toFixed(2),
882
+ transactionFee: parseFloat(
883
+ itm?.transactionFee?.isNaN || itm?.transactionFee == null ? 0 : itm.transactionFee
884
+ ).toFixed(2)
811
885
  }
812
886
  }) || []
813
887
  }
@@ -886,12 +960,23 @@ class ProductList extends localize(i18next)(PageView) {
886
960
  patches = patches.map(patch => {
887
961
  return {
888
962
  ...patch,
889
- costPrice: patch?.costPrice || patch.costPrice == 0 ? parseFloat(patch.costPrice) : undefined,
890
963
  expirationPeriod:
891
964
  patch?.expirationPeriod || patch?.expirationPeriod == 0 ? parseInt(patch.expirationPeriod) : undefined,
892
965
  shelfLife: patch?.shelfLife || patch?.shelfLife == 0 ? parseInt(patch.shelfLife) : undefined,
893
966
  productRef: patch.productRef?.id ? { id: patch.productRef?.id } : undefined,
894
- parentProductRef: patch.parentProductRef?.id ? { id: patch.parentProductRef?.id } : undefined
967
+ parentProductRef: patch.parentProductRef?.id ? { id: patch.parentProductRef?.id } : undefined,
968
+ costPrice: patch?.costPrice ? parseFloat(patch.costPrice) : undefined,
969
+ uomValue: patch?.uomValue ? parseFloat(patch.uomValue) : undefined,
970
+ bufferQty: patch?.bufferQty ? parseInt(patch.bufferQty) : undefined,
971
+ minQty: patch?.minQty ? parseInt(patch.minQty) : undefined,
972
+ maxQty: patch?.maxQty ? parseInt(patch.maxQty) : undefined,
973
+ packingSize: patch?.packingSize ? parseInt(patch.packingSize) : undefined,
974
+ expirationPeriod: patch?.expirationPeriod ? parseInt(patch.expirationPeriod) : undefined,
975
+ shelfLife: patch?.shelfLife ? parseInt(patch.shelfLife) : undefined,
976
+ commissionFee: patch?.commissionFee ? parseFloat(patch.commissionFee) : undefined,
977
+ platformFee: patch?.platformFee ? parseFloat(patch.platformFee) : undefined,
978
+ serviceFee: patch?.serviceFee ? parseFloat(patch.serviceFee) : undefined,
979
+ transactionFee: patch?.transactionFee ? parseFloat(patch.transactionFee) : undefined
895
980
  }
896
981
  })
897
982
 
@@ -921,6 +1006,11 @@ class ProductList extends localize(i18next)(PageView) {
921
1006
  if (!patches?.length) {
922
1007
  return this.showToast(i18next.t('text.nothing_changed'))
923
1008
  }
1009
+
1010
+ if (patches.find(itm => Object.values(itm).find(val => typeof val == 'number' && val < 0))) {
1011
+ return this.showToast(`Minimum value of 0 is required.`)
1012
+ }
1013
+
924
1014
  patches = patches.map(patch => {
925
1015
  patch.costPrice = patch.costPrice == null ? 0 : patch.costPrice
926
1016
 
@@ -936,7 +1026,11 @@ class ProductList extends localize(i18next)(PageView) {
936
1026
  shelfLife: patch?.shelfLife ? parseInt(patch.shelfLife) : undefined,
937
1027
  productRef: patch.productRef?.id ? { id: patch.productRef?.id } : undefined,
938
1028
  pickingStrategy: patch?.pickingStrategy ? patch.pickingStrategy.toUpperCase() : undefined,
939
- gtin: patch?.gtin ? patch.gtin : patch.sku
1029
+ gtin: patch?.gtin ? patch.gtin : patch.sku,
1030
+ commissionFee: patch?.commissionFee ? parseFloat(patch.commissionFee) : undefined,
1031
+ platformFee: patch?.platformFee ? parseFloat(patch.platformFee) : undefined,
1032
+ serviceFee: patch?.serviceFee ? parseFloat(patch.serviceFee) : undefined,
1033
+ transactionFee: patch?.transactionFee ? parseFloat(patch.transactionFee) : undefined
940
1034
  }
941
1035
  })
942
1036
 
@@ -957,6 +1051,7 @@ class ProductList extends localize(i18next)(PageView) {
957
1051
  if (!response.errors) {
958
1052
  this.showToast(i18next.t('text.data_import_successfully'))
959
1053
  this.dataGrist.fetch()
1054
+ history.back()
960
1055
  }
961
1056
  } catch (error) {
962
1057
  this.showToast(error.message)
@@ -1112,10 +1207,28 @@ class ProductList extends localize(i18next)(PageView) {
1112
1207
 
1113
1208
  headerSetting.push({ header: `${i18next.t('field.child_gtin')}`, key: 'childGtin', width: 20, type: 'string' })
1114
1209
  headerSetting.push({ header: `${i18next.t('field.packing_size')}`, key: 'packingSize', width: 20, type: 'float' })
1210
+ headerSetting.push({
1211
+ header: `${i18next.t('field.commission_fee')}`,
1212
+ key: 'commissionFee',
1213
+ width: 20,
1214
+ type: 'float'
1215
+ })
1216
+ headerSetting.push({ header: `${i18next.t('field.platform_fee')}`, key: 'platformFee', width: 20, type: 'float' })
1217
+ headerSetting.push({ header: `${i18next.t('field.service_fee')}`, key: 'serviceFee', width: 20, type: 'float' })
1218
+ headerSetting.push({
1219
+ header: `${i18next.t('field.transaction_fee')}`,
1220
+ key: 'transactionFee',
1221
+ width: 20,
1222
+ type: 'float'
1223
+ })
1115
1224
 
1116
1225
  var data = records.map(item => {
1117
1226
  return {
1118
1227
  id: '',
1228
+ commissionFee: item.commissionFee,
1229
+ platformFee: item.platformFee,
1230
+ serviceFee: item.serviceFee,
1231
+ transactionFee: item.transactionFee,
1119
1232
  ...this.productGristConfig.columns
1120
1233
  .filter(column => column.type !== 'gutter' && column.record !== undefined && column.imex !== undefined)
1121
1234
  .reduce((record, column) => {
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.204",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "client/index.js",
6
6
  "things-factory": true,
@@ -28,8 +28,8 @@
28
28
  "@things-factory/i18n-base": "^4.3.179",
29
29
  "@things-factory/import-ui": "^4.3.179",
30
30
  "@things-factory/layout-base": "^4.3.179",
31
- "@things-factory/product-base": "^4.3.186",
31
+ "@things-factory/product-base": "^4.3.204",
32
32
  "@things-factory/shell": "^4.3.179"
33
33
  },
34
- "gitHead": "854c79b134b5d94c5635c75c467eca229430183b"
34
+ "gitHead": "d7400c05d76662c2df54c0278078ade54e57f271"
35
35
  }
@@ -25,6 +25,7 @@
25
25
  "field.child_qty": "child qty",
26
26
  "field.cogs_account_code": "COGS account code",
27
27
  "field.combination": "combination",
28
+ "field.commission_fee": "commission fee",
28
29
  "field.deleted": "deleted",
29
30
  "field.density": "density",
30
31
  "field.depth": "depth",
@@ -43,6 +44,7 @@
43
44
  "field.packing_size": "packing size",
44
45
  "field.packing_type": "packing type",
45
46
  "field.picking_strategy": "picking strategy",
47
+ "field.platform_fee": "platform fee",
46
48
  "field.product_info": "product info",
47
49
  "field.product_ref": "product ref",
48
50
  "field.product_set_info": "product set info",
@@ -51,10 +53,12 @@
51
53
  "field.require_serial_number_scanning_outbound": "require serial number scanning outbound",
52
54
  "field.require_serial_number_scanning": "require serial number scanning",
53
55
  "field.required_checking_expiry": "required checking expiry",
56
+ "field.service_fee": "service fee",
54
57
  "field.shelf_life": "shelf life",
55
58
  "field.sku": "SKU",
56
59
  "field.sub_brand": "sub brand",
57
60
  "field.threshold_qty": "threshold qty",
61
+ "field.transaction_fee": "transaction fee",
58
62
  "field.type": "type",
59
63
  "field.updated_at": "updated at",
60
64
  "field.updater": "updater",
@@ -24,6 +24,7 @@
24
24
  "field.child_qty": "[ko]child qty",
25
25
  "field.cogs_account_code": "[ko]COGS account code",
26
26
  "field.combination": "[ko]combination",
27
+ "field.commission_fee": "[ko]commission fee",
27
28
  "field.deleted": "[ko]deleted",
28
29
  "field.density": "[ko]density",
29
30
  "field.depth": "[ko]depth",
@@ -41,6 +42,7 @@
41
42
  "field.nett_weight": "n[ko]ett weight",
42
43
  "field.packing_size": "[ko]packing size",
43
44
  "field.packing_type": "[ko]packing type",
45
+ "field.platform_fee": "[ko]platform fee",
44
46
  "field.product_info": "[ko]product info",
45
47
  "field.product_ref": "[ko]product ref",
46
48
  "field.product_set_info": "[ko]product set info",
@@ -49,9 +51,11 @@
49
51
  "field.required_checking_expiry": "[ko]required checking expiry",
50
52
  "field.require_serial_number_scanning_inbound": "[ko] require serial number scanning inbound",
51
53
  "field.require_serial_number_scanning_outbound": "[ko] require serial number scanning outbound",
54
+ "field.service_fee": "[ko]service fee",
52
55
  "field.sku": "[ko]SKU",
53
56
  "field.sub_brand": "[ko]sub brand",
54
57
  "field.threshold_qty": "[ko]threshold qty",
58
+ "field.transaction_fee": "[ko]transaction fee",
55
59
  "field.type": "[ko]type",
56
60
  "field.updated_at": "[ko]updated at",
57
61
  "field.updater": "[ko]updater",
@@ -24,6 +24,7 @@
24
24
  "field.child_qty": "[ms]child qty",
25
25
  "field.cogs_account_code": "[ms]COGS account code",
26
26
  "field.combination": "[ms] combination",
27
+ "field.commission_fee": "[ms]commission fee",
27
28
  "field.deleted": "[ms]deleted",
28
29
  "field.density": "[ms]density",
29
30
  "field.depth": "[ms]depth",
@@ -41,6 +42,7 @@
41
42
  "field.nett_weight": "n[ms]ett weight",
42
43
  "field.packing_size": "[ms]packing size",
43
44
  "field.packing_type": "[ms]packing type",
45
+ "field.platform_fee": "[ms]platform fee",
44
46
  "field.product_info": "[ms]product info",
45
47
  "field.product_ref": "[ms]product ref",
46
48
  "field.product_set_info": "[ms]product set info",
@@ -49,9 +51,11 @@
49
51
  "field.required_checking_expiry": "[ms]required checking expiry",
50
52
  "field.require_serial_number_scanning_inbound": "[ms]require serial number scanning inbound",
51
53
  "field.require_serial_number_scanning_outbound": "[ms]require serial number scanning outbound",
54
+ "field.service_fee": "[ms]service fee",
52
55
  "field.sku": "[ms]SKU",
53
56
  "field.sub_brand": "[ms]sub brand",
54
57
  "field.threshold_qty": "[ms]threshold qty",
58
+ "field.transaction_fee": "[ms]transaction fee",
55
59
  "field.type": "[ms]type",
56
60
  "field.updated_at": "[ms]updated at",
57
61
  "field.updater": "[ms]updater",
@@ -24,6 +24,7 @@
24
24
  "field.child_qty": "[zh]child qty",
25
25
  "field.cogs_account_code": "[zh]COGS account code",
26
26
  "field.combination": "[zh] combination",
27
+ "field.commission_fee": "[zh]commission fee",
27
28
  "field.deleted": "[zh]deleted",
28
29
  "field.density": "[zh]density",
29
30
  "field.depth": "[zh]depth",
@@ -41,6 +42,7 @@
41
42
  "field.nett_weight": "[zh]nett weight",
42
43
  "field.packing_size": "[zh]packing size",
43
44
  "field.packing_type": "[zh]packing type",
45
+ "field.platform_fee": "[zh]platform fee",
44
46
  "field.product_info": "[zh]product info",
45
47
  "field.product_ref": "[zh]product ref",
46
48
  "field.product_set_info": "[zh]product set info",
@@ -49,9 +51,11 @@
49
51
  "field.required_checking_expiry": "[zh]required checking expiry",
50
52
  "field.require_serial_number_scanning_inbound": "[zh]require serial number scanning inbound",
51
53
  "field.require_serial_number_scanning_outbound": "[zh]require serial number scanning outbound",
54
+ "field.service_fee": "[zh]service fee",
52
55
  "field.sku": "[zh]SKU",
53
56
  "field.sub_brand": "[zh]sub brand",
54
57
  "field.threshold_qty": "[zh]threshold qty",
58
+ "field.transaction_fee": "[zh]transaction fee",
55
59
  "field.type": "[zh]type",
56
60
  "field.updated_at": "[zh]updated at",
57
61
  "field.updater": "[zh]updater",