@things-factory/product-ui 4.3.237 → 4.3.248

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.
@@ -78,7 +78,7 @@ class ProductList extends localize(i18next)(PageView) {
78
78
  ]
79
79
 
80
80
  return {
81
- title: i18next.t('title.product'),
81
+ title: i18next.t('title.product'),
82
82
  actions,
83
83
  exportable: {
84
84
  name: i18next.t('title.product'),
@@ -387,19 +387,37 @@ class ProductList extends localize(i18next)(PageView) {
387
387
  },
388
388
  {
389
389
  type: 'integer',
390
- name: 'expirationPeriod',
390
+ name: 'minOutboundShelfLife',
391
+ record: { editable: true, options: { min: 0 } },
392
+ imex: { header: i18next.t('field.min_inbound_shelf_life'), key: 'minOutboundShelfLife', width: 30, type: 'integer' },
393
+ header: i18next.t('field.min_inbound_shelf_life'),
394
+ sortable: true,
395
+ width: 140
396
+ },
397
+ {
398
+ type: 'integer',
399
+ name: 'minInboundShelfLife',
391
400
  record: { editable: true },
392
- imex: { header: i18next.t('field.expiration_period'), key: 'expirationPeriod', width: 30, type: 'integer' },
393
- header: i18next.t('field.expiration_period'),
401
+ imex: { header: i18next.t('field.min_outbound_shelf_life'), key: 'minInboundShelfLife', width: 30, type: 'integer' },
402
+ header: i18next.t('field.min_outbound_shelf_life'),
394
403
  sortable: true,
395
404
  width: 140
396
405
  },
397
406
  {
398
407
  type: 'integer',
399
- name: 'shelfLife',
408
+ name: 'outboundAlert',
400
409
  record: { editable: true, options: { min: 0 } },
401
- imex: { header: i18next.t('field.shelf_life'), key: 'shelfLife', width: 30, type: 'integer' },
402
- header: i18next.t('field.shelf_life'),
410
+ imex: { header: i18next.t('field.outbound_alert'), key: 'outboundAlert', width: 30, type: 'integer' },
411
+ header: i18next.t('field.outbound_alert'),
412
+ sortable: true,
413
+ width: 140
414
+ },
415
+ {
416
+ type: 'integer',
417
+ name: 'productShelfLife',
418
+ record: { editable: true, options: { min: 0 } },
419
+ imex: { header: i18next.t('field.product_shelf_life'), key: 'productShelfLife', width: 30, type: 'integer' },
420
+ header: i18next.t('field.product_shelf_life'),
403
421
  sortable: true,
404
422
  width: 140
405
423
  },
@@ -795,14 +813,17 @@ class ProductList extends localize(i18next)(PageView) {
795
813
  name
796
814
  description
797
815
  }
816
+
798
817
  refCode
799
818
  bundleQty
800
819
  packingType
801
820
  type
802
821
  inventoryAccountCode
803
822
  cogsAccountCode
804
- expirationPeriod
805
- shelfLife
823
+ minInboundShelfLife
824
+ minOutboundShelfLife
825
+ outboundAlert
826
+ productShelfLife
806
827
  isRequiredCheckExpiry
807
828
  isRequireSerialNumberScanning
808
829
  isRequireSerialNumberScanningInbound
@@ -960,9 +981,9 @@ class ProductList extends localize(i18next)(PageView) {
960
981
  patches = patches.map(patch => {
961
982
  return {
962
983
  ...patch,
963
- expirationPeriod:
964
- patch?.expirationPeriod || patch?.expirationPeriod == 0 ? parseInt(patch.expirationPeriod) : undefined,
965
- shelfLife: patch?.shelfLife || patch?.shelfLife == 0 ? parseInt(patch.shelfLife) : undefined,
984
+ minInboundShelfLife:
985
+ patch?.minInboundShelfLife || patch?.minInboundShelfLife == 0 ? parseInt(patch.minInboundShelfLife) : undefined,
986
+ minOutboundShelfLife: patch?.minOutboundShelfLife || patch?.minOutboundShelfLife == 0 ? parseInt(patch.minOutboundShelfLife) : undefined,
966
987
  productRef: patch.productRef?.id ? { id: patch.productRef?.id } : undefined,
967
988
  parentProductRef: patch.parentProductRef?.id ? { id: patch.parentProductRef?.id } : undefined,
968
989
  costPrice: patch?.costPrice ? parseFloat(patch.costPrice) : undefined,
@@ -971,8 +992,10 @@ class ProductList extends localize(i18next)(PageView) {
971
992
  minQty: patch?.minQty ? parseInt(patch.minQty) : undefined,
972
993
  maxQty: patch?.maxQty ? parseInt(patch.maxQty) : undefined,
973
994
  packingSize: patch?.packingSize ? parseInt(patch.packingSize) : undefined,
974
- expirationPeriod: patch?.expirationPeriod ? parseInt(patch.expirationPeriod) : undefined,
975
- shelfLife: patch?.shelfLife ? parseInt(patch.shelfLife) : undefined,
995
+ minInboundShelfLife: patch?.minInboundShelfLife ? parseInt(patch.minInboundShelfLife) : undefined,
996
+ minOutboundShelfLife: patch?.minOutboundShelfLife ? parseInt(patch.minOutboundShelfLife) : undefined,
997
+ outboundAlert: patch?.outboundAlert ? parseInt(patch.outboundAlert) : undefined,
998
+ productShelfLife: patch?.productShelfLife ? parseInt(patch.productShelfLife) : undefined,
976
999
  commissionFee: patch?.commissionFee ? parseFloat(patch.commissionFee) : undefined,
977
1000
  platformFee: patch?.platformFee ? parseFloat(patch.platformFee) : undefined,
978
1001
  serviceFee: patch?.serviceFee ? parseFloat(patch.serviceFee) : undefined,
@@ -1022,8 +1045,8 @@ class ProductList extends localize(i18next)(PageView) {
1022
1045
  minQty: patch?.minQty ? parseInt(patch.minQty) : undefined,
1023
1046
  maxQty: patch?.maxQty ? parseInt(patch.maxQty) : undefined,
1024
1047
  packingSize: patch?.packingSize ? parseInt(patch.packingSize) : undefined,
1025
- expirationPeriod: patch?.expirationPeriod ? parseInt(patch.expirationPeriod) : undefined,
1026
- shelfLife: patch?.shelfLife ? parseInt(patch.shelfLife) : undefined,
1048
+ minInboundShelfLife: patch?.minInboundShelfLife ? parseInt(patch.minInboundShelfLife) : undefined,
1049
+ minOutboundShelfLife: patch?.minOutboundShelfLife ? parseInt(patch.minOutboundShelfLife) : undefined,
1027
1050
  productRef: patch.productRef?.id ? { id: patch.productRef?.id } : undefined,
1028
1051
  pickingStrategy: patch?.pickingStrategy ? patch.pickingStrategy.toUpperCase() : undefined,
1029
1052
  gtin: patch?.gtin ? patch.gtin : patch.sku,
@@ -1081,13 +1104,13 @@ class ProductList extends localize(i18next)(PageView) {
1081
1104
  if (!errors.find(err => err.type == 'uomValue'))
1082
1105
  errors.push({ type: 'uomValue', value: 'UOM Value is required' })
1083
1106
  }
1084
- if (itm?.shelfLife < 0) {
1085
- if (!errors.find(err => err.type == 'shelfLife'))
1086
- errors.push({ type: 'shelfLife', value: 'Shelf Life cannot be negative' })
1107
+ if (itm?.minOutboundShelfLife < 0) {
1108
+ if (!errors.find(err => err.type == 'minOutboundShelfLife'))
1109
+ errors.push({ type: 'minOutboundShelfLife', value: 'Shelf Life cannot be negative' })
1087
1110
  }
1088
- if (itm?.expirationPeriod < 0) {
1089
- if (!errors.find(err => err.type == 'expirationPeriod'))
1090
- errors.push({ type: 'expirationPeriod', value: 'Expiration period cannot be negative' })
1111
+ if (itm?.minInboundShelfLife < 0) {
1112
+ if (!errors.find(err => err.type == 'minInboundShelfLife'))
1113
+ errors.push({ type: 'minInboundShelfLife', value: 'Expiration period cannot be negative' })
1091
1114
  }
1092
1115
 
1093
1116
  if (isNaN(itm.costPrice) && itm.costPrice !== undefined) {
@@ -1222,24 +1245,172 @@ class ProductList extends localize(i18next)(PageView) {
1222
1245
  type: 'float'
1223
1246
  })
1224
1247
 
1225
- var data = records.map(item => {
1226
- return {
1227
- id: '',
1228
- commissionFee: item.commissionFee,
1229
- platformFee: item.platformFee,
1230
- serviceFee: item.serviceFee,
1231
- transactionFee: item.transactionFee,
1232
- ...this.productGristConfig.columns
1233
- .filter(column => column.type !== 'gutter' && column.record !== undefined && column.imex !== undefined)
1234
- .reduce((record, column) => {
1235
- record[column.imex.key] = column.imex.key
1236
- .split('.')
1237
- .reduce((obj, key) => (obj && obj[key] !== 'undefined' ? obj[key] : undefined), item)
1238
- return record
1239
- }, {})
1240
- }
1248
+ const pagination = { page: 0, limit: 99999 }
1249
+ const sorters =[{ name: 'sku' }]
1250
+ const sortings = sorters
1251
+ const filters = await this.searchForm.getQueryFilters()
1252
+
1253
+ if(records.length > 0){
1254
+ const ids = records.map(record => { return record.id })
1255
+ filters.push({ name: 'id', value: ids, operator: 'in' })
1256
+ }
1257
+
1258
+ const response = await client.query({
1259
+ query: gql`
1260
+ query myBizplaceProducts($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
1261
+ myBizplaceProducts(filters: $filters, pagination: $pagination, sortings: $sortings) {
1262
+ items {
1263
+ sku
1264
+ id
1265
+ name
1266
+ description
1267
+ productRef {
1268
+ sku
1269
+ name
1270
+ description
1271
+ }
1272
+ parentProductRef {
1273
+ sku
1274
+ name
1275
+ description
1276
+ }
1277
+ productDetails{
1278
+ id
1279
+ sku
1280
+ name
1281
+ type
1282
+ packingType
1283
+ uom
1284
+ uomValue
1285
+ productBarcodes {
1286
+ gtin
1287
+ }
1288
+ }
1289
+ refCode
1290
+ bundleQty
1291
+ packingType
1292
+ type
1293
+ inventoryAccountCode
1294
+ cogsAccountCode
1295
+ minInboundShelfLife
1296
+ minOutboundShelfLife
1297
+ outboundAlert
1298
+ productShelfLife
1299
+ isRequiredCheckExpiry
1300
+ isRequireSerialNumberScanning
1301
+ isRequireSerialNumberScanningInbound
1302
+ isRequireSerialNumberScanningOutbound
1303
+ weightUnit
1304
+ nettWeight
1305
+ grossWeight
1306
+ density
1307
+ lengthUnit
1308
+ volume
1309
+ width
1310
+ depth
1311
+ height
1312
+ volumeSize
1313
+ uom
1314
+ uomValue
1315
+ costPrice
1316
+ afterTaxCostPrice
1317
+ sellPrice
1318
+ afterTaxSalesPrice
1319
+ mrpPrice
1320
+ bufferQty
1321
+ minQty
1322
+ maxQty
1323
+ auxUnit1
1324
+ auxValue1
1325
+ auxUnit2
1326
+ auxValue2
1327
+ auxUnit3
1328
+ auxValue3
1329
+ auxUnit4
1330
+ auxValue4
1331
+ auxUnit5
1332
+ auxValue5
1333
+ brandSku
1334
+ brand
1335
+ subBrand
1336
+ gtin
1337
+ pickingStrategy
1338
+ commissionFee
1339
+ platformFee
1340
+ serviceFee
1341
+ transactionFee
1342
+ updater {
1343
+ name
1344
+ description
1345
+ }
1346
+ updatedAt
1347
+ }
1348
+ total
1349
+ }
1350
+ }
1351
+ `,
1352
+ variables: { filters, pagination, sortings },
1353
+ context: gqlContext()
1241
1354
  })
1242
1355
 
1356
+ if (!response.errors) {
1357
+
1358
+ const exportData = response.data.myBizplaceProducts.items.map(itm => {
1359
+ if (itm.costPrice == NaN || itm.costPrice == null) {
1360
+ itm.costPrice = 0
1361
+ }
1362
+ return {
1363
+ ...itm,
1364
+ productRef: { name: itm?.productRef ? '(' + itm.productRef.sku + ') ' + itm.productRef.name : '' },
1365
+ costPrice: parseFloat(itm?.costPrice?.isNaN || itm?.costPrice == null ? 0 : itm.costPrice).toFixed(2),
1366
+ commissionFee: parseFloat(
1367
+ itm?.commissionFee?.isNaN || itm?.commissionFee == null ? 0 : itm.commissionFee
1368
+ ).toFixed(2),
1369
+ platformFee: parseFloat(
1370
+ itm?.platformFee?.isNaN || itm?.platformFee == null ? 0 : itm.platformFee
1371
+ ).toFixed(2),
1372
+ serviceFee: parseFloat(itm?.serviceFee?.isNaN || itm?.serviceFee == null ? 0 : itm.serviceFee).toFixed(2),
1373
+ transactionFee: parseFloat(
1374
+ itm?.transactionFee?.isNaN || itm?.transactionFee == null ? 0 : itm.transactionFee
1375
+ ).toFixed(2)
1376
+ }
1377
+ }) || []
1378
+
1379
+ const flattenedList = []
1380
+ for (let product of exportData) {
1381
+ const pds = product.productDetails.map(pd => {
1382
+ return {
1383
+ ...product,
1384
+ name: pd.name,
1385
+ packingType: pd.packingType,
1386
+ uom: pd.uom,
1387
+ uomValue: pd.uomValue,
1388
+ gtin: pd.productBarcodes.map(pb => {return pb.gtin}).reduce((acc, cur) => acc + ',' + cur)
1389
+
1390
+ }
1391
+ })
1392
+ flattenedList.push(...pds)
1393
+ }
1394
+
1395
+ var data = flattenedList.map(item => {
1396
+ return {
1397
+ id: '',
1398
+ commissionFee: item.commissionFee,
1399
+ platformFee: item.platformFee,
1400
+ serviceFee: item.serviceFee,
1401
+ transactionFee: item.transactionFee,
1402
+ ...this.productGristConfig.columns
1403
+ .filter(column => column.type !== 'gutter' && column.record !== undefined && column.imex !== undefined)
1404
+ .reduce((record, column) => {
1405
+ record[column.imex.key] = column.imex.key
1406
+ .split('.')
1407
+ .reduce((obj, key) => (obj && obj[key] !== 'undefined' ? obj[key] : undefined), item)
1408
+ return record
1409
+ }, {})
1410
+ }
1411
+ })
1412
+ }
1413
+
1243
1414
  return { header: headerSetting, data: data }
1244
1415
  }
1245
1416
 
@@ -288,9 +288,9 @@ export class ProductSetLinkPopup extends localize(i18next)(LitElement) {
288
288
  },
289
289
  {
290
290
  type: 'integer',
291
- name: 'expirationPeriod',
291
+ name: 'minInboundShelfLife',
292
292
  record: { editable: true },
293
- imex: { header: 'Expiration Period', key: 'expirationPeriod', width: 50, type: 'integer' },
293
+ imex: { header: 'Expiration Period', key: 'minInboundShelfLife', width: 50, type: 'integer' },
294
294
  header: i18next.t('field.expiration_period'),
295
295
  sortable: true,
296
296
  width: 80
@@ -544,7 +544,7 @@ export class ProductSetLinkPopup extends localize(i18next)(LitElement) {
544
544
  type
545
545
  inventoryAccountCode
546
546
  cogsAccountCode
547
- expirationPeriod
547
+ minInboundShelfLife
548
548
  weightUnit
549
549
  weight
550
550
  density
@@ -669,7 +669,7 @@ export class ProductSetLinkPopup extends localize(i18next)(LitElement) {
669
669
  patch.width = parseFloat(patch.width)
670
670
  patch.depth = parseFloat(patch.depth)
671
671
  patch.height = parseFloat(patch.height)
672
- patch.expirationPeriod = parseFloat(patch.expirationPeriod)
672
+ patch.minInboundShelfLife = parseFloat(patch.minInboundShelfLife)
673
673
  patch.bundleQty = parseFloat(patch.bundleQty)
674
674
 
675
675
  if (patch.parentProductRef) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/product-ui",
3
- "version": "4.3.237",
3
+ "version": "4.3.248",
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.237",
29
29
  "@things-factory/import-ui": "^4.3.237",
30
30
  "@things-factory/layout-base": "^4.3.237",
31
- "@things-factory/product-base": "^4.3.237",
31
+ "@things-factory/product-base": "^4.3.248",
32
32
  "@things-factory/shell": "^4.3.237"
33
33
  },
34
- "gitHead": "90cda1a8580b7be252a474c138bea4b6870d7dfc"
34
+ "gitHead": "c45a9863ca451fa4d4fe3dbc797d7cc883b5bfd5"
35
35
  }
@@ -38,9 +38,12 @@
38
38
  "field.length_unit": "length unit",
39
39
  "field.max_qty": "max qty",
40
40
  "field.min_qty": "min qty",
41
+ "field.min_inbound_shelf_life": "min inbound shelf life",
42
+ "field.min_outbound_shelf_life": "min outbound shelf life",
41
43
  "field.movement": "movement",
42
44
  "field.name": "name",
43
45
  "field.nett_weight": "nett weight",
46
+ "field.outbound_alert": "outbound alert",
44
47
  "field.packing_size": "packing size",
45
48
  "field.packing_type": "packing type",
46
49
  "field.picking_strategy": "picking strategy",
@@ -48,6 +51,7 @@
48
51
  "field.product_info": "product info",
49
52
  "field.product_ref": "product ref",
50
53
  "field.product_set_info": "product set info",
54
+ "field.product_shelf_life": "product shelf life",
51
55
  "field.ref_code": "ref code",
52
56
  "field.require_serial_number_scanning_inbound": "require serial number scanning inbound",
53
57
  "field.require_serial_number_scanning_outbound": "require serial number scanning outbound",
@@ -37,15 +37,19 @@
37
37
  "field.length_unit": "[ko]length unit",
38
38
  "field.max_qty": "[ko]max qty",
39
39
  "field.min_qty": "[ko]min qty",
40
+ "field.min_inbound_shelf_life": "[ko] min inbound shelf life",
41
+ "field.min_outbound_shelf_life": "[ko] min outbound shelf life",
40
42
  "field.movement": "[ko]movement",
41
43
  "field.name": "[ko]name",
42
44
  "field.nett_weight": "n[ko]ett weight",
45
+ "field.outbound_alert": "[ko] outbound alert",
43
46
  "field.packing_size": "[ko]packing size",
44
47
  "field.packing_type": "[ko]packing type",
45
48
  "field.platform_fee": "[ko]platform fee",
46
49
  "field.product_info": "[ko]product info",
47
50
  "field.product_ref": "[ko]product ref",
48
51
  "field.product_set_info": "[ko]product set info",
52
+ "field.product_shelf_life": "[ko] product shelf life",
49
53
  "field.ref_code": "[ko]ref code",
50
54
  "field.require_serial_number_scanning": "[ko]require serial number scanning",
51
55
  "field.required_checking_expiry": "[ko]required checking expiry",
@@ -37,15 +37,19 @@
37
37
  "field.length_unit": "[ms]length unit",
38
38
  "field.max_qty": "[ms]max qty",
39
39
  "field.min_qty": "[ms]min qty",
40
+ "field.min_inbound_shelf_life": "[ms] min inbound shelf life",
41
+ "field.min_outbound_shelf_life": "[ms] min outbound shelf life",
40
42
  "field.movement": "[ms]movement",
41
43
  "field.name": "[ms]name",
42
- "field.nett_weight": "n[ms]ett weight",
44
+ "field.nett_weight": "[ms]ett weight",
45
+ "field.outbound_alert": "[ms] outbound alert",
43
46
  "field.packing_size": "[ms]packing size",
44
47
  "field.packing_type": "[ms]packing type",
45
48
  "field.platform_fee": "[ms]platform fee",
46
49
  "field.product_info": "[ms]product info",
47
50
  "field.product_ref": "[ms]product ref",
48
51
  "field.product_set_info": "[ms]product set info",
52
+ "field.product_shelf_life": "[ms] product shelf life",
49
53
  "field.ref_code": "[ms]ref code",
50
54
  "field.require_serial_number_scanning": "[ms]require serial number scanning",
51
55
  "field.required_checking_expiry": "[ms]required checking expiry",
@@ -37,8 +37,11 @@
37
37
  "field.length_unit": "[zh]length unit",
38
38
  "field.max_qty": "[zh]max qty",
39
39
  "field.min_qty": "[zh]min qty",
40
+ "field.min_inbound_shelf_life": "[zh] min inbound shelf life",
41
+ "field.min_outbound_shelf_life": "[zh] min outbound shelf life",
40
42
  "field.movement": "[zh]movement",
41
43
  "field.name": "[zh]name",
44
+ "field.outbound_alert": "[zh] outbound alert",
42
45
  "field.nett_weight": "[zh]nett weight",
43
46
  "field.packing_size": "[zh]packing size",
44
47
  "field.packing_type": "[zh]packing type",
@@ -46,6 +49,7 @@
46
49
  "field.product_info": "[zh]product info",
47
50
  "field.product_ref": "[zh]product ref",
48
51
  "field.product_set_info": "[zh]product set info",
52
+ "field.product_shelf_life": "[zh] product shelf life",
49
53
  "field.ref_code": "[zh]ref code",
50
54
  "field.require_serial_number_scanning": "[zh]require serial number scanning",
51
55
  "field.required_checking_expiry": "[zh]required checking expiry",