@things-factory/operato-wms 4.3.701 → 4.3.705

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.
@@ -17,6 +17,7 @@ class SelectInventoryPopUp extends localize(i18next)(LitElement) {
17
17
  productConfig: Object,
18
18
  data: Object,
19
19
  bizplaceId: String,
20
+ releaseShelfLifeOverride: Number,
20
21
  searchFields: Array,
21
22
  selectMultipleProducts: Boolean,
22
23
  switchTypePane: String,
@@ -427,10 +428,13 @@ class SelectInventoryPopUp extends localize(i18next)(LitElement) {
427
428
  }
428
429
 
429
430
  if (paneType === 'product') {
430
- const data = this.inventoryData.filter(res => res.batchId !== null)
431
+ const data = this.processedInventoryData ? this.processedInventoryData : this.inventoryData
432
+ const filtered = Array.isArray(data)
433
+ ? data.filter(res => res && res.batchId !== null)
434
+ : this.inventoryData.filter(res => res && res.batchId !== null)
431
435
 
432
- if (data?.length > 0) {
433
- const remapData = data.map(res => {
436
+ if (filtered?.length > 0) {
437
+ const remapData = filtered.map(res => {
434
438
  return {
435
439
  batchId: res.batchId,
436
440
  groupType: res.groupType,
@@ -443,6 +447,10 @@ class SelectInventoryPopUp extends localize(i18next)(LitElement) {
443
447
  })
444
448
  filters.push({ name: 'batch_product', operator: 'notin', value: remapData })
445
449
  }
450
+ // ensure release shelf-life override is passed for product selection as well
451
+ if (typeof this.releaseShelfLifeOverride !== 'undefined' && this.releaseShelfLifeOverride !== null) {
452
+ filters.push({ name: 'releaseShelfLifeOverride', operator: 'eq', value: Number(this.releaseShelfLifeOverride) })
453
+ }
446
454
 
447
455
  const response = await client.query({
448
456
  query: gql`
@@ -480,6 +488,13 @@ class SelectInventoryPopUp extends localize(i18next)(LitElement) {
480
488
  }
481
489
  }
482
490
  } else {
491
+ if (typeof this.releaseShelfLifeOverride !== 'undefined' && this.releaseShelfLifeOverride !== null) {
492
+ filters.push({
493
+ name: 'releaseShelfLifeOverride',
494
+ operator: 'eq',
495
+ value: Number(this.releaseShelfLifeOverride)
496
+ })
497
+ }
483
498
  filters.push({ name: 'status', operator: 'eq', value: INVENTORY_STATUS.STORED.value })
484
499
 
485
500
  const data = this.inventoryData
@@ -565,7 +580,7 @@ class SelectInventoryPopUp extends localize(i18next)(LitElement) {
565
580
  packingSize: selectedProduct.packingSize,
566
581
  primaryUnit: selectedProduct.uom,
567
582
  primaryValue: selectedProduct.uomValue,
568
- isInventoryDecimal: selectedProduct.isInventoryDecimal,
583
+ isInventoryDecimal: selectedProduct.isInventoryDecimal
569
584
  },
570
585
  productDetail: {
571
586
  id: selectedProduct.productDetailId
@@ -117,6 +117,7 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
117
117
 
118
118
  // refractor
119
119
  _contactPointInfo: Object,
120
+ _releaseShelfLifeOverride: Number,
120
121
 
121
122
  /* Tab Toggle*/
122
123
  _showReleasedOrderInfo: Boolean,
@@ -1433,6 +1434,7 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
1433
1434
  this.refNo = ''
1434
1435
  this.refNo2 = ''
1435
1436
  this.refNo3 = ''
1437
+ this._releaseShelfLifeOverride = null
1436
1438
  this.releaseDate = ''
1437
1439
  this.collectionOrderNo = ''
1438
1440
  this._files = []
@@ -2455,6 +2457,10 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
2455
2457
  releaseGood.vas = undefined
2456
2458
  releaseGood.orderInventories = await this._getOrderInventories()
2457
2459
  // releaseGood.orderVass = this._getOrderVass()
2460
+ // attach selected ContactPoint as relation if present (GraphQL expects a string ID)
2461
+ if (this._contactPointId) {
2462
+ releaseGood.deliverTo = this._contactPointId
2463
+ }
2458
2464
  releaseGood.ownTransport = this._ownTransport
2459
2465
  releaseGood.type = RO_TYPES.B2B.value
2460
2466
  releaseGood.orderMethod = this._pickingStd
@@ -2542,6 +2548,55 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
2542
2548
  ...this.inventoryData,
2543
2549
  records: data
2544
2550
  }
2551
+ return
2552
+ }
2553
+ const insufficientError = response.errors.find(err => err?.extensions?.exception?.errorCode == 'ins1')
2554
+ if (insufficientError) {
2555
+ let failed = []
2556
+ try {
2557
+ failed = JSON.parse(insufficientError?.extensions?.exception?.detail?.data || '[]')
2558
+ } catch (e) {
2559
+ // ignore parse error
2560
+ }
2561
+ const data = this.inventoryData.records
2562
+ const skus = []
2563
+ failed.forEach(dt => {
2564
+ if (dt?.productSku) {
2565
+ skus.push(dt.batchId ? `${dt.productSku} (${dt.batchId})` : `${dt.productSku}`)
2566
+ return
2567
+ }
2568
+ const idx = data.findIndex(
2569
+ x =>
2570
+ x.productId == dt.productId &&
2571
+ (x.batchId || '') == (dt.batchId || '') &&
2572
+ x.packingType == dt.packingType
2573
+ )
2574
+ if (idx >= 0) {
2575
+ const rec = data[idx]
2576
+ rec.isError = true
2577
+ const sku =
2578
+ rec.productSKU ||
2579
+ (rec.inventory ? rec.inventory.productSKU : undefined) ||
2580
+ (rec.product ? rec.product.sku : undefined) ||
2581
+ rec.sku
2582
+ if (sku) {
2583
+ skus.push(dt.batchId ? `${sku} (${dt.batchId})` : `${sku}`)
2584
+ } else {
2585
+ skus.push(dt.productId)
2586
+ }
2587
+ } else {
2588
+ // fallback if record not found in grid
2589
+ skus.push(dt.productId)
2590
+ }
2591
+ })
2592
+ this.inventoryData = { ...this.inventoryData, records: [...data] }
2593
+ const uniqueSkus = [...new Set(skus)]
2594
+ const msg =
2595
+ uniqueSkus.length > 0
2596
+ ? `Insufficient stock for: ${uniqueSkus.join(', ')}`
2597
+ : i18next.t('text.insufficient_stock')
2598
+ this._showToast({ type: 'error', message: msg })
2599
+ return
2545
2600
  }
2546
2601
  }
2547
2602
  } catch (e) {
@@ -2800,6 +2855,9 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
2800
2855
  .switchTypePane="${type}"
2801
2856
  .inventoryData="${this.inventoryGrist.dirtyData.records}"
2802
2857
  .recall="${this._recallInput.checked}"
2858
+ .releaseShelfLifeOverride="${this._releaseShelfLifeOverride != null
2859
+ ? Number(this._releaseShelfLifeOverride)
2860
+ : null}"
2803
2861
  @selected="${e => {
2804
2862
  let newRecords = []
2805
2863
  for (let i = 0; i < e.detail.multipleProducts.length; i++) {
@@ -3647,6 +3705,12 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
3647
3705
  <contact-points-popup
3648
3706
  @selected="${e => {
3649
3707
  this._fillUpDeliveryInfo(e.detail)
3708
+ this._contactPointInfo = e.detail || {}
3709
+ this._contactPointId = e.detail?.id || ''
3710
+ this._releaseShelfLifeOverride =
3711
+ e.detail && e.detail.releaseShelfLife != null && e.detail.releaseShelfLife !== 0
3712
+ ? Number(e.detail.releaseShelfLife)
3713
+ : null
3650
3714
  }}"
3651
3715
  .partnerBizplaceIds="${this._bizplaces.map(itm => itm.id)}"
3652
3716
  ></contact-points-popup>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/operato-wms",
3
- "version": "4.3.701",
3
+ "version": "4.3.705",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "client/index.js",
6
6
  "things-factory": true,
@@ -62,60 +62,60 @@
62
62
  "@operato/scene-tab": "^0.1.8",
63
63
  "@operato/scene-table": "^0.1.8",
64
64
  "@operato/scene-wheel-sorter": "^0.1.8",
65
- "@things-factory/apptool-ui": "^4.3.695",
66
- "@things-factory/attachment-ui": "^4.3.695",
67
- "@things-factory/auth-ui": "^4.3.695",
68
- "@things-factory/barcode-ui": "^4.3.695",
69
- "@things-factory/biz-ui": "^4.3.701",
70
- "@things-factory/board-service": "^4.3.695",
71
- "@things-factory/board-ui": "^4.3.695",
72
- "@things-factory/code-ui": "^4.3.695",
73
- "@things-factory/context-ui": "^4.3.695",
74
- "@things-factory/export-ui": "^4.3.695",
75
- "@things-factory/export-ui-csv": "^4.3.695",
76
- "@things-factory/export-ui-excel": "^4.3.695",
77
- "@things-factory/fav-base": "^4.3.695",
78
- "@things-factory/form-ui": "^4.3.695",
79
- "@things-factory/geography": "^4.3.695",
80
- "@things-factory/grist-ui": "^4.3.695",
81
- "@things-factory/help": "^4.3.695",
82
- "@things-factory/i18n-base": "^4.3.695",
83
- "@things-factory/id-rule-base": "^4.3.695",
84
- "@things-factory/import-ui": "^4.3.695",
85
- "@things-factory/import-ui-excel": "^4.3.701",
86
- "@things-factory/menu-ui": "^4.3.695",
87
- "@things-factory/more-ui": "^4.3.695",
88
- "@things-factory/notification": "^4.3.695",
89
- "@things-factory/pdf": "^4.3.591",
90
- "@things-factory/print-proxy-service": "^4.3.695",
91
- "@things-factory/print-ui": "^4.3.695",
92
- "@things-factory/product-base": "^4.3.701",
93
- "@things-factory/resource-ui": "^4.3.695",
94
- "@things-factory/sales-ui": "^4.3.701",
95
- "@things-factory/scene-data-transform": "^4.3.591",
96
- "@things-factory/scene-excel": "^4.3.591",
97
- "@things-factory/scene-firebase": "^4.3.591",
98
- "@things-factory/scene-form": "^4.3.591",
99
- "@things-factory/scene-google-map": "^4.3.591",
100
- "@things-factory/scene-graphql": "^4.3.591",
101
- "@things-factory/scene-label": "^4.3.695",
102
- "@things-factory/scene-marker": "^4.3.591",
103
- "@things-factory/scene-mqtt": "^4.3.591",
104
- "@things-factory/scene-restful": "^4.3.591",
105
- "@things-factory/scene-visualizer": "^4.3.591",
106
- "@things-factory/setting-ui": "^4.3.695",
107
- "@things-factory/system-ui": "^4.3.695",
108
- "@things-factory/transport-base": "^4.3.701",
109
- "@things-factory/tutorial-ui": "^4.3.695",
110
- "@things-factory/warehouse-base": "^4.3.701",
111
- "@things-factory/worksheet-base": "^4.3.701"
65
+ "@things-factory/apptool-ui": "^4.3.705",
66
+ "@things-factory/attachment-ui": "^4.3.705",
67
+ "@things-factory/auth-ui": "^4.3.705",
68
+ "@things-factory/barcode-ui": "^4.3.705",
69
+ "@things-factory/biz-ui": "^4.3.705",
70
+ "@things-factory/board-service": "^4.3.705",
71
+ "@things-factory/board-ui": "^4.3.705",
72
+ "@things-factory/code-ui": "^4.3.705",
73
+ "@things-factory/context-ui": "^4.3.705",
74
+ "@things-factory/export-ui": "^4.3.705",
75
+ "@things-factory/export-ui-csv": "^4.3.705",
76
+ "@things-factory/export-ui-excel": "^4.3.705",
77
+ "@things-factory/fav-base": "^4.3.705",
78
+ "@things-factory/form-ui": "^4.3.705",
79
+ "@things-factory/geography": "^4.3.705",
80
+ "@things-factory/grist-ui": "^4.3.705",
81
+ "@things-factory/help": "^4.3.705",
82
+ "@things-factory/i18n-base": "^4.3.705",
83
+ "@things-factory/id-rule-base": "^4.3.705",
84
+ "@things-factory/import-ui": "^4.3.705",
85
+ "@things-factory/import-ui-excel": "^4.3.705",
86
+ "@things-factory/menu-ui": "^4.3.705",
87
+ "@things-factory/more-ui": "^4.3.705",
88
+ "@things-factory/notification": "^4.3.705",
89
+ "@things-factory/pdf": "^4.3.705",
90
+ "@things-factory/print-proxy-service": "^4.3.705",
91
+ "@things-factory/print-ui": "^4.3.705",
92
+ "@things-factory/product-base": "^4.3.705",
93
+ "@things-factory/resource-ui": "^4.3.705",
94
+ "@things-factory/sales-ui": "^4.3.705",
95
+ "@things-factory/scene-data-transform": "^4.3.705",
96
+ "@things-factory/scene-excel": "^4.3.705",
97
+ "@things-factory/scene-firebase": "^4.3.705",
98
+ "@things-factory/scene-form": "^4.3.705",
99
+ "@things-factory/scene-google-map": "^4.3.705",
100
+ "@things-factory/scene-graphql": "^4.3.705",
101
+ "@things-factory/scene-label": "^4.3.705",
102
+ "@things-factory/scene-marker": "^4.3.705",
103
+ "@things-factory/scene-mqtt": "^4.3.705",
104
+ "@things-factory/scene-restful": "^4.3.705",
105
+ "@things-factory/scene-visualizer": "^4.3.705",
106
+ "@things-factory/setting-ui": "^4.3.705",
107
+ "@things-factory/system-ui": "^4.3.705",
108
+ "@things-factory/transport-base": "^4.3.705",
109
+ "@things-factory/tutorial-ui": "^4.3.705",
110
+ "@things-factory/warehouse-base": "^4.3.705",
111
+ "@things-factory/worksheet-base": "^4.3.705"
112
112
  },
113
113
  "devDependencies": {
114
- "@things-factory/builder": "^4.3.591",
114
+ "@things-factory/builder": "^4.3.705",
115
115
  "cypress": "^9.4.1",
116
116
  "cypress-file-upload": "^5.0.8",
117
117
  "cypress-localstorage-commands": "^1.6.1",
118
118
  "eslint-plugin-cypress": "^2.12.1"
119
119
  },
120
- "gitHead": "2cb46fe9d95770899e069846c590a3b24c847d9c"
120
+ "gitHead": "37ae3b066444a1094389a59b38414e5c2b75db20"
121
121
  }