@things-factory/product-ui 4.3.187 → 4.3.227

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,6 +111,34 @@ 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
  }
@@ -686,6 +719,34 @@ class ProductList extends localize(i18next)(PageView) {
686
719
  header: `${i18next.t('field.picking_strategy')}`,
687
720
  width: 100
688
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
+ },
689
750
  {
690
751
  type: 'object',
691
752
  name: 'updater',
@@ -781,6 +842,10 @@ class ProductList extends localize(i18next)(PageView) {
781
842
  subBrand
782
843
  gtin
783
844
  pickingStrategy
845
+ commissionFee
846
+ platformFee
847
+ serviceFee
848
+ transactionFee
784
849
  updater {
785
850
  name
786
851
  description
@@ -806,7 +871,17 @@ class ProductList extends localize(i18next)(PageView) {
806
871
  return {
807
872
  ...itm,
808
873
  productRef: { name: itm?.productRef ? '(' + itm.productRef.sku + ') ' + itm.productRef.name : '' },
809
- 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)
810
885
  }
811
886
  }) || []
812
887
  }
@@ -885,7 +960,6 @@ class ProductList extends localize(i18next)(PageView) {
885
960
  patches = patches.map(patch => {
886
961
  return {
887
962
  ...patch,
888
- costPrice: patch?.costPrice || patch.costPrice == 0 ? parseFloat(patch.costPrice) : undefined,
889
963
  expirationPeriod:
890
964
  patch?.expirationPeriod || patch?.expirationPeriod == 0 ? parseInt(patch.expirationPeriod) : undefined,
891
965
  shelfLife: patch?.shelfLife || patch?.shelfLife == 0 ? parseInt(patch.shelfLife) : undefined,
@@ -898,7 +972,11 @@ class ProductList extends localize(i18next)(PageView) {
898
972
  maxQty: patch?.maxQty ? parseInt(patch.maxQty) : undefined,
899
973
  packingSize: patch?.packingSize ? parseInt(patch.packingSize) : undefined,
900
974
  expirationPeriod: patch?.expirationPeriod ? parseInt(patch.expirationPeriod) : undefined,
901
- shelfLife: patch?.shelfLife ? parseInt(patch.shelfLife) : 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
902
980
  }
903
981
  })
904
982
 
@@ -948,7 +1026,11 @@ class ProductList extends localize(i18next)(PageView) {
948
1026
  shelfLife: patch?.shelfLife ? parseInt(patch.shelfLife) : undefined,
949
1027
  productRef: patch.productRef?.id ? { id: patch.productRef?.id } : undefined,
950
1028
  pickingStrategy: patch?.pickingStrategy ? patch.pickingStrategy.toUpperCase() : undefined,
951
- 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
952
1034
  }
953
1035
  })
954
1036
 
@@ -1125,10 +1207,28 @@ class ProductList extends localize(i18next)(PageView) {
1125
1207
 
1126
1208
  headerSetting.push({ header: `${i18next.t('field.child_gtin')}`, key: 'childGtin', width: 20, type: 'string' })
1127
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
+ })
1128
1224
 
1129
1225
  var data = records.map(item => {
1130
1226
  return {
1131
1227
  id: '',
1228
+ commissionFee: item.commissionFee,
1229
+ platformFee: item.platformFee,
1230
+ serviceFee: item.serviceFee,
1231
+ transactionFee: item.transactionFee,
1132
1232
  ...this.productGristConfig.columns
1133
1233
  .filter(column => column.type !== 'gutter' && column.record !== undefined && column.imex !== undefined)
1134
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.187",
3
+ "version": "4.3.227",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "client/index.js",
6
6
  "things-factory": true,
@@ -23,13 +23,13 @@
23
23
  "migration:create": "node ../../node_modules/typeorm/cli.js migration:create -d ./server/migrations"
24
24
  },
25
25
  "dependencies": {
26
- "@things-factory/form-ui": "^4.3.179",
27
- "@things-factory/grist-ui": "^4.3.179",
28
- "@things-factory/i18n-base": "^4.3.179",
29
- "@things-factory/import-ui": "^4.3.179",
30
- "@things-factory/layout-base": "^4.3.179",
31
- "@things-factory/product-base": "^4.3.186",
32
- "@things-factory/shell": "^4.3.179"
26
+ "@things-factory/form-ui": "^4.3.227",
27
+ "@things-factory/grist-ui": "^4.3.227",
28
+ "@things-factory/i18n-base": "^4.3.227",
29
+ "@things-factory/import-ui": "^4.3.227",
30
+ "@things-factory/layout-base": "^4.3.227",
31
+ "@things-factory/product-base": "^4.3.227",
32
+ "@things-factory/shell": "^4.3.227"
33
33
  },
34
- "gitHead": "a6192bef4662aafeb4e9d4e715dca07aa1459b2d"
34
+ "gitHead": "e745df475dd3ee67be6d42b3e8a273f07a7a11bc"
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",