@things-factory/operato-wms 3.7.7 → 3.7.11

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.
@@ -519,71 +519,75 @@ export class ReleaseExtraProductPopup extends localize(i18next)(LitElement) {
519
519
  let columnName = e.detail.column.name
520
520
  let packageUomValue = 0
521
521
 
522
- if (!e.detail.after) {
523
- throw new Error(i18next.t('text.invalid_form_value'))
524
- }
525
-
526
- const result = this._calculateQtyAndUom(
527
- packageUomValue,
528
- columnName,
529
- e.detail.record.uomValue,
530
- e.detail.record.qty,
531
- e.detail.record.__origin__.releaseUomValue,
532
- e.detail.record.__origin__.releaseQty,
533
- e.detail.record.__origin__.addableUomValue,
534
- e.detail.record.__origin__.addableQty,
535
- e.detail.record.__origin__.remainUomValue,
536
- e.detail.record.__origin__.remainQty,
537
- e.detail.after
538
- )
522
+ try {
523
+ if (e.details?.after && e.details?.after !== 0) {
524
+ throw new Error(i18next.t('text.invalid_form_value'))
525
+ }
539
526
 
540
- this.existingInventoryData = {
541
- ...this.existingInventoryGrist.dirtyData,
542
- records: this.existingInventoryGrist.dirtyData.records.map((record, idx) => {
543
- if (result.releaseQty >= 0 && result.roundedUom >= 0) {
544
- if ((columnName == 'releaseUomValue' || columnName == 'releaseQty') && idx === e.detail.row) {
545
- if (columnName == 'releaseUomValue') {
546
- record.releaseQty = result.releaseQty
547
- }
548
- record.releaseUomValue = result.roundedUom
549
- record.addableQty = record.__origin__.releaseQty + record.__origin__.addableQty - result.releaseQty
550
- if (record.addableQty <= 0) {
551
- record.addableQty = 0
552
- }
553
- if (record.addableUomValue == 0) {
554
- record.addableUomValue =
555
- record.addableQty * (record.__origin__.releaseUomValue / record.__origin__.releaseQty)
556
- } else {
557
- if (record.addableQty == 0) {
558
- record.addableUomValue = 0
527
+ const result = this._calculateQtyAndUom(
528
+ packageUomValue,
529
+ columnName,
530
+ e.detail.record.uomValue,
531
+ e.detail.record.qty,
532
+ e.detail.record.__origin__.releaseUomValue,
533
+ e.detail.record.__origin__.releaseQty,
534
+ e.detail.record.__origin__.addableUomValue,
535
+ e.detail.record.__origin__.addableQty,
536
+ e.detail.record.__origin__.remainUomValue,
537
+ e.detail.record.__origin__.remainQty,
538
+ e.detail.after
539
+ )
540
+
541
+ this.existingInventoryData = {
542
+ ...this.existingInventoryGrist.dirtyData,
543
+ records: this.existingInventoryGrist.dirtyData.records.map((record, idx) => {
544
+ if (result.releaseQty >= 0 && result.roundedUom >= 0) {
545
+ if ((columnName == 'releaseUomValue' || columnName == 'releaseQty') && idx === e.detail.row) {
546
+ if (columnName == 'releaseUomValue') {
547
+ record.releaseQty = result.releaseQty
548
+ }
549
+ record.releaseUomValue = result.roundedUom
550
+ record.addableQty = record.__origin__.releaseQty + record.__origin__.addableQty - result.releaseQty
551
+ if (record.addableQty <= 0) {
552
+ record.addableQty = 0
553
+ }
554
+ if (record.addableUomValue == 0) {
555
+ record.addableUomValue =
556
+ record.addableQty * (record.__origin__.releaseUomValue / record.__origin__.releaseQty)
559
557
  } else {
560
- if (e.detail.record.__origin__.releaseQty == 0 || e.detail.record.__origin__.releaseUomValue == 0) {
561
- record.addableUomValue =
562
- record.addableQty *
563
- (e.detail.record.__origin__.addableUomValue / e.detail.record.__origin__.addableQty)
558
+ if (record.addableQty == 0) {
559
+ record.addableUomValue = 0
564
560
  } else {
565
- record.addableUomValue =
566
- record.addableQty *
567
- (e.detail.record.__origin__.releaseUomValue / e.detail.record.__origin__.releaseQty)
561
+ if (e.detail.record.__origin__.releaseQty == 0 || e.detail.record.__origin__.releaseUomValue == 0) {
562
+ record.addableUomValue =
563
+ record.addableQty *
564
+ (e.detail.record.__origin__.addableUomValue / e.detail.record.__origin__.addableQty)
565
+ } else {
566
+ record.addableUomValue =
567
+ record.addableQty *
568
+ (e.detail.record.__origin__.releaseUomValue / e.detail.record.__origin__.releaseQty)
569
+ }
568
570
  }
569
571
  }
570
572
  }
571
573
  }
572
- }
573
574
 
574
- let returnObj = {
575
- ...record
576
- }
575
+ let returnObj = {
576
+ ...record
577
+ }
577
578
 
578
- if (this._pickingStd === PICKING_STANDARD.SELECT_BY_PRODUCT.value) {
579
- returnObj.product = {
580
- id: record.inventory.productId,
581
- name: record.inventory.productName
579
+ if (this._pickingStd === PICKING_STANDARD.SELECT_BY_PRODUCT.value) {
580
+ returnObj.product = {
581
+ id: record.inventory.productId,
582
+ name: record.inventory.productName
583
+ }
582
584
  }
583
- }
584
585
 
585
- return returnObj
586
- })
586
+ return returnObj
587
+ })
588
+ }
589
+ } catch (e) {
590
+ this._showToast(e)
587
591
  }
588
592
  }
589
593
 
@@ -605,18 +609,14 @@ export class ReleaseExtraProductPopup extends localize(i18next)(LitElement) {
605
609
 
606
610
  if (afterValue >= 0) {
607
611
  if (columnName == 'releaseUomValue' || columnName == 'releaseQty') {
608
- if (detailUom && detailQty) {
609
- packageUom = detailUom / detailQty
610
- } else {
611
- if (originQty) {
612
- if (originQty == 0 || originUom == 0) {
613
- packageUom = originAddableUom / originAddableQty
614
- } else {
615
- packageUom = originUom / originQty
616
- }
612
+ if (originQty) {
613
+ if (originQty == 0 || originUom == 0) {
614
+ packageUom = originAddableUom / originAddableQty
617
615
  } else {
618
- packageUom = originRemainUom / originRemainQty
616
+ packageUom = originUom / originQty
619
617
  }
618
+ } else {
619
+ packageUom = originRemainUom / originRemainQty
620
620
  }
621
621
 
622
622
  if (columnName === 'releaseQty') {
@@ -785,9 +785,7 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
785
785
 
786
786
  this.roType = releaseOrder.type
787
787
  const orderInventories = releaseOrder.inventoryInfos.map(inventoryInfo => {
788
- let roundedUomValue =
789
- inventoryInfo.releaseQty *
790
- ((inventoryInfo.uomValue + inventoryInfo.releaseUomValue) / (inventoryInfo.qty + inventoryInfo.releaseQty))
788
+ let roundedUomValue = parseFloat(inventoryInfo.releaseUomValue.toFixed(2))
791
789
  return {
792
790
  ...inventoryInfo,
793
791
  productSKU: inventoryInfo?.product?.sku || '',
@@ -365,6 +365,8 @@ class ExecuteReverseKitting extends connect(store)(localize(i18next)(PageView))
365
365
  `,
366
366
  {
367
367
  backdrop: true,
368
+ escapable: false,
369
+ closable: false,
368
370
  size: 'large',
369
371
  title: record.palletId
370
372
  }
@@ -142,13 +142,16 @@ class PopupCombinationSets extends localize(i18next)(LitElement) {
142
142
  @click=${this._openIssueNote.bind(this)}
143
143
  label="${i18next.t('button.issue')}"
144
144
  ></mwc-button>
145
+ <mwc-button raised @click=${this._closePopup.bind(this)} label="${i18next.t('button.back')}"></mwc-button>
145
146
  </div>`
146
- : ''}
147
+ : html`<div class="button-container">
148
+ <mwc-button raised @click=${this._closePopup.bind(this)} label="${i18next.t('button.back')}"></mwc-button>
149
+ </div>`}
147
150
  `
148
151
  }
149
152
 
150
153
  async fetchReverseKittingOrder() {
151
- if (!this._orderNo) return
154
+ if (!this.orderNo) return
152
155
  const response = await client.query({
153
156
  query: gql`
154
157
  query executingReverseKittingOrder($name: String!) {
@@ -205,15 +208,30 @@ class PopupCombinationSets extends localize(i18next)(LitElement) {
205
208
  }
206
209
  }
207
210
  `,
208
- variables: { name: this._orderNo }
211
+ variables: { name: this.orderNo }
209
212
  })
210
213
 
211
214
  if (!response.errors) {
212
215
  const reverseKittingOrder = response.data.executingReverseKittingOrder
213
216
  const orderReverseKittings = reverseKittingOrder.orderReverseKittings
214
217
 
215
- this.data = {
216
- records: orderReverseKittings.map(orderReverseKitting => {
218
+ // this.data = {
219
+ // records: orderReverseKittings.map(orderReverseKitting => {
220
+ // const inventory = orderReverseKitting.inventory
221
+ // return {
222
+ // ...orderReverseKitting,
223
+ // batchId: inventory.batchId,
224
+ // palletId: inventory.palletId,
225
+ // location: inventory.location,
226
+ // product: inventory.product
227
+ // }
228
+ // })
229
+ // }
230
+
231
+ const previousOrderReverseKittingName = this.data.name
232
+ const matchedOrderReverseKitting = orderReverseKittings
233
+ .filter(item => item.name === previousOrderReverseKittingName)
234
+ .map(orderReverseKitting => {
217
235
  const inventory = orderReverseKitting.inventory
218
236
  return {
219
237
  ...orderReverseKitting,
@@ -223,7 +241,8 @@ class PopupCombinationSets extends localize(i18next)(LitElement) {
223
241
  product: inventory.product
224
242
  }
225
243
  })
226
- }
244
+
245
+ this.data = { ...matchedOrderReverseKitting[0] }
227
246
 
228
247
  this.getProductCombination()
229
248
  }
@@ -301,12 +320,19 @@ class PopupCombinationSets extends localize(i18next)(LitElement) {
301
320
  `,
302
321
  {
303
322
  backdrop: true,
323
+ escapable: false,
324
+ closable: false,
304
325
  size: 'large',
305
326
  title: i18next.t('title.reverse_kitting')
306
327
  }
307
328
  )
308
329
  }
309
330
 
331
+ _closePopup() {
332
+ this.dispatchEvent(new CustomEvent('order-reverse-kitting-data', { detail: {} }))
333
+ history.back()
334
+ }
335
+
310
336
  _showToast({ type, message }) {
311
337
  document.dispatchEvent(
312
338
  new CustomEvent('notify', {
@@ -130,13 +130,24 @@ class PopupReverseKittingTemplate extends localize(i18next)(LitElement) {
130
130
  ></data-grist>
131
131
  </div>
132
132
  <div class="button-container">
133
+ <mwc-button
134
+ raised
135
+ @click=${this._confirmInventory.bind(this)}
136
+ label="${i18next.t('button.confirm')}"
137
+ ></mwc-button>
133
138
  <mwc-button
134
139
  raised
135
140
  @click=${this._undoInventory.bind(this)}
136
141
  label="${i18next.t('button.undo')}"
137
142
  ></mwc-button>
138
143
  </div> `
139
- : ''}
144
+ : html`<div class="button-container">
145
+ <mwc-button
146
+ raised
147
+ @click=${this._confirmInventory.bind(this)}
148
+ label="${i18next.t('button.confirm')}"
149
+ ></mwc-button>
150
+ </div> `}
140
151
  `
141
152
  }
142
153
 
@@ -352,6 +363,11 @@ class PopupReverseKittingTemplate extends localize(i18next)(LitElement) {
352
363
  }
353
364
  }
354
365
 
366
+ _confirmInventory() {
367
+ this.dispatchEvent(new CustomEvent('updated', { detail: {} }))
368
+ history.back()
369
+ }
370
+
355
371
  _fillUpForm(form, data) {
356
372
  for (let key in data) {
357
373
  Array.from(form.querySelectorAll('input')).forEach(field => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/operato-wms",
3
- "version": "3.7.7",
3
+ "version": "3.7.11",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "client/index.js",
6
6
  "things-factory": true,
@@ -69,9 +69,9 @@
69
69
  "@things-factory/print-proxy-service": "^3.7.5",
70
70
  "@things-factory/print-service": "^3.7.5",
71
71
  "@things-factory/print-ui": "^3.7.5",
72
- "@things-factory/product-base": "^3.7.7",
72
+ "@things-factory/product-base": "^3.7.8",
73
73
  "@things-factory/resource-ui": "^3.7.7",
74
- "@things-factory/sales-ui": "^3.7.7",
74
+ "@things-factory/sales-ui": "^3.7.11",
75
75
  "@things-factory/scene-chartjs": "^3.7.5",
76
76
  "@things-factory/scene-clock": "^3.7.5",
77
77
  "@things-factory/scene-clone": "^3.7.5",
@@ -102,11 +102,11 @@
102
102
  "@things-factory/system-ui": "^3.7.5",
103
103
  "@things-factory/transport-base": "^3.7.5",
104
104
  "@things-factory/tutorial-ui": "^3.7.5",
105
- "@things-factory/warehouse-base": "^3.7.7",
106
- "@things-factory/worksheet-base": "^3.7.7"
105
+ "@things-factory/warehouse-base": "^3.7.11",
106
+ "@things-factory/worksheet-base": "^3.7.11"
107
107
  },
108
108
  "devDependencies": {
109
109
  "@things-factory/builder": "^3.7.5"
110
110
  },
111
- "gitHead": "7e1cfc771ca9e8970d90493d3049d4d589e96f08"
111
+ "gitHead": "fea83ab8a7f82df4d78e69a504a4877c3b93248e"
112
112
  }