@things-factory/operato-wms 4.3.549 → 4.3.551

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.
@@ -1,24 +1,45 @@
1
1
  import '@things-factory/barcode-ui'
2
2
  import '@things-factory/grist-ui'
3
3
  import './undo-putaway-popup'
4
- import './select-location-popup'
5
- import '../components/worksheet-information-popup'
4
+ import '../select-location-popup'
5
+ import '../../components/worksheet-information-popup'
6
6
  import './putaway-same-carton-popup'
7
7
  import './putaway-replenishment-inventory-popup'
8
+ import './putaway-replenishment-same-product-popup'
8
9
 
9
10
  import gql from 'graphql-tag'
10
- import { css, html } from 'lit-element'
11
+ import {
12
+ css,
13
+ html
14
+ } from 'lit-element'
11
15
  import { connect } from 'pwa-helpers/connect-mixin.js'
12
16
 
13
17
  import { MultiColumnFormStyles } from '@things-factory/form-ui'
14
- import { i18next, localize } from '@things-factory/i18n-base'
18
+ import {
19
+ i18next,
20
+ localize
21
+ } from '@things-factory/i18n-base'
15
22
  import { openPopup } from '@things-factory/layout-base'
16
- import { client, CustomAlert, PageView, store } from '@things-factory/shell'
23
+ import {
24
+ client,
25
+ CustomAlert,
26
+ PageView,
27
+ store
28
+ } from '@things-factory/shell'
17
29
  import { CommonButtonStyles } from '@things-factory/styles'
18
- import { isMobileDevice, sleep } from '@things-factory/utils'
19
-
20
- import { fetchSettingRule } from '../../fetch-setting-value'
21
- import { ARRIVAL_NOTICE, CUSTOMER_RETURN, REPLENISHMENT, WAREHOUSE_RETURN, WORKSHEET_STATUS } from '../constants'
30
+ import {
31
+ isMobileDevice,
32
+ sleep
33
+ } from '@things-factory/utils'
34
+
35
+ import { fetchSettingRule } from '../../../fetch-setting-value'
36
+ import {
37
+ ARRIVAL_NOTICE,
38
+ CUSTOMER_RETURN,
39
+ REPLENISHMENT,
40
+ WAREHOUSE_RETURN,
41
+ WORKSHEET_STATUS
42
+ } from '../../constants'
22
43
 
23
44
  const OPERATION_TYPE = {
24
45
  PUTAWAY: 'putaway',
@@ -32,11 +53,13 @@ class PutawayProduct extends connect(store)(localize(i18next)(PageView)) {
32
53
  return {
33
54
  config: Object,
34
55
  data: Object,
56
+ orderProductData: Object,
35
57
  incompleteLocationName: Boolean,
36
58
  locations: Array,
37
59
  orderNo: String,
38
60
  refOrderType: String,
39
61
  recommendLocationName: String,
62
+ customerCompanyDomainId: String,
40
63
  _bizplaceName: String,
41
64
  _enableCartonLabel: Boolean,
42
65
  _expirationDate: Number,
@@ -53,7 +76,8 @@ class PutawayProduct extends connect(store)(localize(i18next)(PageView)) {
53
76
  _worksheetInfo: Object,
54
77
  _records: Array,
55
78
  _selectedLocation: String,
56
- _pageSettings: Object
79
+ _pageSettings: Object,
80
+ _enableProductScanning: Boolean
57
81
  }
58
82
  }
59
83
 
@@ -129,7 +153,7 @@ class PutawayProduct extends connect(store)(localize(i18next)(PageView)) {
129
153
  icon: 'reorder',
130
154
  handlers: {
131
155
  click: (columns, data, column, record, rowIndex, _orderNo) => {
132
- this._openReplenishmentPutawayInventoriesPopup(this._replenishmentId, record.cartonId)
156
+ this._openReplenishmentPutawayInventoriesPopup(this._replenishmentId, record.inventory.id)
133
157
  }
134
158
  },
135
159
  exclude: this.refOrderType != AVAIL_ORDER_TYPES.REPLENISHMENT.value
@@ -294,6 +318,10 @@ class PutawayProduct extends connect(store)(localize(i18next)(PageView)) {
294
318
  return this.shadowRoot.querySelector('barcode-scanable-input[name=toPalletId]').shadowRoot.querySelector('input')
295
319
  }
296
320
 
321
+ get productBarcodeInput() {
322
+ return this.shadowRoot.querySelector('barcode-scanable-input[name=productBarcode]')
323
+ }
324
+
297
325
  getInput = inputSelector => {
298
326
  return inputSelector?.shadowRoot.querySelector('input')
299
327
  }
@@ -343,36 +371,52 @@ class PutawayProduct extends connect(store)(localize(i18next)(PageView)) {
343
371
  ? html` <label>${i18next.t('label.recommend_location')}</label>
344
372
  <input name="recommendLocation" type="text" value=${this.recommendLocationName} readonly />`
345
373
  : html``}
346
- ${this._enableCartonLabel
374
+ ${this._enableCartonLabel
347
375
  ? html`
348
- <label>${i18next.t('label.carton_id')}</label>
349
- <barcode-scanable-input
350
- name="cartonId"
351
- custom-input
352
- ?scan-only=${this._pageSettings?.cameraScanOnly}
353
- @keypress="${async e => {
354
- if (e.keyCode === 13) {
355
- e.preventDefault()
356
- await this._putaway(e)
357
- }
358
- }}"
359
- ></barcode-scanable-input>
360
- `
376
+ ${this.refOrderType === AVAIL_ORDER_TYPES.REPLENISHMENT.value && this._enableProductScanning
377
+ ? html`
378
+ <label>${i18next.t('label.product_barcode')}</label>
379
+ <barcode-scanable-input
380
+ name="productBarcode"
381
+ without-enter
382
+ custom-input
383
+ ?scan-only=${this._pageSettings?.cameraScanOnly}
384
+ @keypress="${async e => {
385
+ if (e.keyCode === 13) {
386
+ e.preventDefault()
387
+ await this._putaway(e)
388
+ }
389
+ }}"
390
+ ></barcode-scanable-input>`
391
+ : html`
392
+ <label>${i18next.t('label.carton_id')}</label>
393
+ <barcode-scanable-input
394
+ name="cartonId"
395
+ custom-input
396
+ ?scan-only=${this._pageSettings?.cameraScanOnly}
397
+ @keypress="${async e => {
398
+ if (e.keyCode === 13) {
399
+ e.preventDefault()
400
+ await this._putaway(e)
401
+ }
402
+ }}"
403
+ ></barcode-scanable-input>`
404
+ }`
361
405
  : html`
362
- <label>${i18next.t('label.lot_id')}</label>
363
- <barcode-scanable-input
364
- name="palletId"
365
- .value=${this._pallet}
366
- custom-input
367
- ?scan-only=${this._pageSettings?.cameraScanOnly}
368
- @keypress="${async e => {
369
- if (e.keyCode === 13) {
370
- e.preventDefault()
371
- await this._putaway(e)
372
- }
373
- }}"
374
- ></barcode-scanable-input>
375
- `}
406
+ <label>${i18next.t('label.lot_id')}</label>
407
+ <barcode-scanable-input
408
+ name="palletId"
409
+ .value=${this._pallet}
410
+ custom-input
411
+ ?scan-only=${this._pageSettings?.cameraScanOnly}
412
+ @keypress="${async e => {
413
+ if (e.keyCode === 13) {
414
+ e.preventDefault()
415
+ await this._putaway(e)
416
+ }
417
+ }}"
418
+ ></barcode-scanable-input>
419
+ `}
376
420
  ${this._operationType === OPERATION_TYPE.PUTAWAY
377
421
  ? html`
378
422
  ${!this.incompleteLocationName
@@ -452,7 +496,7 @@ class PutawayProduct extends connect(store)(localize(i18next)(PageView)) {
452
496
  : html``}
453
497
  </fieldset>
454
498
  </form>
455
-
499
+
456
500
  <data-grist .mode=${isMobileDevice() ? 'LIST' : 'GRID'} .config=${this.config} .data=${this.data}>
457
501
  <div slot="headroom" id="form-section">
458
502
  <form id="info-form" class="multi-column-form">
@@ -485,6 +529,7 @@ class PutawayProduct extends connect(store)(localize(i18next)(PageView)) {
485
529
  this._expirationDate = 0
486
530
  this._locationType = ''
487
531
  this._records = []
532
+ this._enableProductScanning = false
488
533
  }
489
534
 
490
535
  get completed() {
@@ -548,6 +593,14 @@ class PutawayProduct extends connect(store)(localize(i18next)(PageView)) {
548
593
  setTimeout(() => this.qtyInput.focus(), 100)
549
594
  }
550
595
 
596
+ _focusOnProductBarcodeInput() {
597
+ setTimeout(() => this.productBarcodeInput.focus(), 100)
598
+ }
599
+
600
+ _focusOnActualQtyInput() {
601
+ setTimeout(() => this.actualQtyInput.focus(), 100)
602
+ }
603
+
551
604
  async _fetchProducts(orderNo) {
552
605
  this._clearView()
553
606
 
@@ -821,20 +874,27 @@ class PutawayProduct extends connect(store)(localize(i18next)(PageView)) {
821
874
  query putawayReplenishmentWorksheet($replenishmentNo: String!) {
822
875
  putawayReplenishmentWorksheet(replenishmentNo: $replenishmentNo) {
823
876
  worksheetInfo {
877
+ bizplaceName
824
878
  status
879
+ partnerDomainId
825
880
  replenishment {
826
881
  id
827
882
  name
828
883
  }
884
+ customerCompanyDomainId
829
885
  }
830
886
  worksheetDetailInfos {
831
887
  name
888
+ inventory {
889
+ id
890
+ }
832
891
  palletId
833
892
  cartonId
834
893
  batchId
835
894
  expirationDate
836
895
  batchIdRef
837
896
  product {
897
+ id
838
898
  sku
839
899
  name
840
900
  description
@@ -866,6 +926,7 @@ class PutawayProduct extends connect(store)(localize(i18next)(PageView)) {
866
926
  if (worksheetInfo?.replenishment) {
867
927
  this._replenishmentId = worksheetInfo.replenishment.id
868
928
  this._orderNo = worksheetInfo.replenishment.name
929
+ this._bizplaceName = worksheetInfo.bizplaceName
869
930
  } else {
870
931
  this._orderNo = orderNo
871
932
  }
@@ -879,6 +940,7 @@ class PutawayProduct extends connect(store)(localize(i18next)(PageView)) {
879
940
  }
880
941
  return {
881
942
  ...record,
943
+ inventoryId: record.inventory.id,
882
944
  completed: record.status === WORKSHEET_STATUS.DONE.value,
883
945
  packingTypeSize: `${record.packingType}(${record.packingSize})`,
884
946
  reusablePalletName: reusablePalletName,
@@ -906,6 +968,7 @@ class PutawayProduct extends connect(store)(localize(i18next)(PageView)) {
906
968
  }
907
969
 
908
970
  this._enableCartonLabel = await fetchSettingRule('enable-carton-label', null)
971
+ this._enableProductScanning = await fetchSettingRule('enable-product-scanning', worksheetInfo.partnerDomainId)
909
972
  if (this._enableCartonLabel) this._focusOnCartonInput()
910
973
  else this._focusOnPalletInput()
911
974
  this._completeHandler()
@@ -1169,19 +1232,31 @@ class PutawayProduct extends connect(store)(localize(i18next)(PageView)) {
1169
1232
  if (this._scanning === false) {
1170
1233
  this._scanning = true
1171
1234
  try {
1235
+ let worksheetDetailNames = []
1172
1236
  const locationDetails = await this._fetchLocation(
1173
1237
  this.locationInput ? this.locationInput.value.trim() : this._selectedLocation.trim()
1174
1238
  )
1175
1239
 
1176
- let worksheetDetailNames = await this._getWorksheetDetailNames(locationDetails)
1240
+ if (this._enableCartonLabel && this._enableProductScanning) {
1241
+ this._records.forEach(record => {
1242
+ worksheetDetailNames.push(record.name);
1243
+ })
1244
+ } else {
1245
+ worksheetDetailNames = await this._getWorksheetDetailNames(locationDetails)
1246
+ }
1177
1247
 
1178
1248
  if (!worksheetDetailNames) {
1179
1249
  return (this._scanning = false)
1180
1250
  }
1181
1251
 
1182
- const actualQtyValue = this.actualQtyInput ? this.actualQtyInput.value.trim() : ''
1183
- if (!actualQtyValue || isNaN(parseInt(actualQtyValue))) {
1184
- throw new Error(i18next.t('text.actual_qty_is_invalid'))
1252
+ let productBarcode
1253
+ let cartonId
1254
+ if (this._enableCartonLabel && this._enableProductScanning) {
1255
+ productBarcode = this.getInput(this.productBarcodeInput)?.value
1256
+ cartonId = this.locationInput.value
1257
+ } else {
1258
+ productBarcode = null
1259
+ cartonId = this.getInput(this.cartonInput).value
1185
1260
  }
1186
1261
 
1187
1262
  const response = await client.mutate({
@@ -1191,28 +1266,34 @@ class PutawayProduct extends connect(store)(localize(i18next)(PageView)) {
1191
1266
  $cartonId: String
1192
1267
  $toLocation: String!
1193
1268
  $actualQty: Int!
1269
+ $productBarcode: String
1194
1270
  ) {
1195
1271
  replenishmentPutaway(
1196
1272
  worksheetDetailName: $worksheetDetailName
1197
1273
  cartonId: $cartonId
1198
1274
  toLocation: $toLocation
1199
1275
  actualQty: $actualQty
1276
+ productBarcode: $productBarcode
1200
1277
  )
1201
1278
  }
1202
1279
  `,
1203
1280
  variables: {
1204
1281
  worksheetDetailName: worksheetDetailNames,
1205
- cartonId: this._enableCartonLabel ? this.getInput(this.cartonInput).value : null,
1282
+ cartonId: cartonId,
1206
1283
  toLocation: this.locationInput ? this.locationInput.value : this._selectedLocation,
1207
- actualQty: this.actualQtyInput ? parseInt(this.actualQtyInput.value) : null
1284
+ actualQty: this.actualQtyInput ? parseInt(this.actualQtyInput.value) : null,
1285
+ productBarcode: productBarcode
1208
1286
  }
1209
1287
  })
1210
1288
 
1211
1289
  if (!response.errors) {
1212
1290
  this._fetchProducts(this._orderNo)
1213
- if (this._enableCartonLabel) {
1291
+ if (this._enableCartonLabel && !this._enableProductScanning) {
1214
1292
  this.getInput(this.cartonInput).value = ''
1215
1293
  this._focusOnCartonInput()
1294
+ } else if (this._enableCartonLabel && this._enableProductScanning) {
1295
+ this.getInput(this.productBarcodeInput).value = ''
1296
+ this._focusOnProductBarcodeInput()
1216
1297
  } else {
1217
1298
  this.getInput(this.palletInput).value = ''
1218
1299
  this._focusOnPalletInput()
@@ -1221,6 +1302,7 @@ class PutawayProduct extends connect(store)(localize(i18next)(PageView)) {
1221
1302
  this._selectedTaskStatus = null
1222
1303
  this._selectedOrderProduct = null
1223
1304
  this.recommendLocationName = null
1305
+ this._records = []
1224
1306
  if (this.locationInput) {
1225
1307
  this.locationInput.value = ''
1226
1308
  } else {
@@ -1237,10 +1319,10 @@ class PutawayProduct extends connect(store)(localize(i18next)(PageView)) {
1237
1319
  }
1238
1320
  }
1239
1321
 
1240
- _openReplenishmentPutawayInventoriesPopup(replenishmentId, cartonId) {
1322
+ _openReplenishmentPutawayInventoriesPopup(replenishmentId, inventoryId) {
1241
1323
  openPopup(
1242
1324
  html`
1243
- <putaway-replenishment-inventory-popup .replenishmentId="${replenishmentId}" .cartonId="${cartonId}">
1325
+ <putaway-replenishment-inventory-popup .replenishmentId="${replenishmentId}" .inventoryId="${inventoryId}">
1244
1326
  </putaway-replenishment-inventory-popup>
1245
1327
  `,
1246
1328
  {
@@ -1324,7 +1406,7 @@ class PutawayProduct extends connect(store)(localize(i18next)(PageView)) {
1324
1406
  try {
1325
1407
  let records = []
1326
1408
  await this._validatePutaway()
1327
- if (this._enableCartonLabel) {
1409
+ if (this._enableCartonLabel && this.refOrderType !== AVAIL_ORDER_TYPES.REPLENISHMENT.value) {
1328
1410
  records = this.data.records
1329
1411
  .filter(record => record.cartonId === this.getInput(this.cartonInput).value && record.status !== 'DONE')
1330
1412
  .map(record => {
@@ -1336,6 +1418,23 @@ class PutawayProduct extends connect(store)(localize(i18next)(PageView)) {
1336
1418
  cartonId: record.cartonId
1337
1419
  }
1338
1420
  })
1421
+ } else if (this.refOrderType === AVAIL_ORDER_TYPES.REPLENISHMENT.value) {
1422
+ if(this._enableProductScanning) {
1423
+ await this._checkedScannedProduct(e)
1424
+ return
1425
+ } else {
1426
+ records = this.data.records
1427
+ .filter(record => record.cartonId === this.getInput(this.cartonInput).value && record.status !== 'DONE')
1428
+ .map(record => {
1429
+ return {
1430
+ name: record.name,
1431
+ expirationDate: record.expirationDate,
1432
+ minInboundShelfLife: record.product.minInboundShelfLife,
1433
+ palletId: record.palletId,
1434
+ cartonId: record.cartonId
1435
+ }
1436
+ })
1437
+ }
1339
1438
  }
1340
1439
  if (records.length > 1) {
1341
1440
  this._openPutawaySameCartonPopup(this.getInput(this.cartonInput).value)
@@ -1372,8 +1471,38 @@ class PutawayProduct extends connect(store)(localize(i18next)(PageView)) {
1372
1471
  )
1373
1472
  }
1374
1473
 
1474
+ _openPutawaySameProductPopup(orderProduct) {
1475
+ openPopup(
1476
+ html`
1477
+ <putaway-replenishment-same-product-popup
1478
+ .putawayInventories="${this.data.records.filter(
1479
+ record => (orderProduct.some(op => op.sku === record.sku)) && record.completed === false
1480
+ )}"
1481
+ @selections="${async e => {
1482
+ this._selectedOrderProduct = e.detail
1483
+ this._records = e.detail
1484
+
1485
+ if (this._records.expirationDate && locationDetails) {
1486
+ let answer = await this._checkExpiry([this._records], locationDetails.type)
1487
+ if (answer) {
1488
+ if (!answer?.value) return false
1489
+ }
1490
+ }
1491
+
1492
+ e.keyCode = 13
1493
+ this._transactionHandler(e)
1494
+ }}"
1495
+ ></putaway-replenishment-same-product-popup>
1496
+ `,
1497
+ {
1498
+ backdrop: true,
1499
+ size: 'medium',
1500
+ title: i18next.t('title.select_product_batch')
1501
+ }
1502
+ )
1503
+ }
1375
1504
  async _validatePutaway() {
1376
- if (this._enableCartonLabel) {
1505
+ if (this._enableCartonLabel && this.refOrderType !== AVAIL_ORDER_TYPES.REPLENISHMENT.value) {
1377
1506
  let cartonInputValue = this.getInput(this.cartonInput).value
1378
1507
 
1379
1508
  // 2. carton id existing
@@ -1391,6 +1520,35 @@ class PutawayProduct extends connect(store)(localize(i18next)(PageView)) {
1391
1520
  this.data.records.find(x => x.cartonId == cartonInputValue && x.status !== 'DONE')
1392
1521
  ]
1393
1522
  }
1523
+ } else if (this._enableCartonLabel && this.refOrderType === AVAIL_ORDER_TYPES.REPLENISHMENT.value) {
1524
+ //validate input for replenishment with carton
1525
+ if (this._enableProductScanning) {
1526
+ if (!this.getInput(this.productBarcodeInput).value) {
1527
+ this._focusOnProductBarcodeInput()
1528
+ throw new Error(i18next.t('text.product_barcode_is_empty'))
1529
+ }
1530
+ } else {
1531
+ let cartonInputValue = this.getInput(this.cartonInput).value
1532
+ if (!cartonInputValue) {
1533
+ this._focusOnCartonInput()
1534
+ throw new Error(i18next.t('text.carton_id_is_empty'))
1535
+ }
1536
+
1537
+ if (!this.data.records.map(record => record.cartonId).includes(cartonInputValue)) {
1538
+ this.getInput(this.cartonInput).value = ''
1539
+ this._focusOnCartonInput()
1540
+ throw new Error(i18next.t('text.unable_to_find_matching_x', { state: { x: i18next.t('label.carton') } }))
1541
+ } else {
1542
+ this._selectedOrderProduct = [
1543
+ this.data.records.find(x => x.cartonId == cartonInputValue && x.status !== 'DONE')
1544
+ ]
1545
+ }
1546
+ }
1547
+
1548
+ if(!this.actualQtyInput || isNaN(parseInt(this.actualQtyInput.value))) {
1549
+ this._focusOnActualQtyInput()
1550
+ throw new Error(i18next.t('text.actual_qty_is_invalid'))
1551
+ }
1394
1552
  } else {
1395
1553
  let palletInputValue = this.getInput(this.palletInput).value
1396
1554
 
@@ -1422,7 +1580,7 @@ class PutawayProduct extends connect(store)(localize(i18next)(PageView)) {
1422
1580
  if (!this.locationInput?.value && !this._selectedLocation) {
1423
1581
  this._focusOnLocationInput()
1424
1582
  throw new Error(i18next.t('text.location_code_is_empty'))
1425
- } else if (this.locationInput?.value && !this.selectedLocation) {
1583
+ } else if (this.locationInput?.value && !this._selectedLocation) {
1426
1584
  const foundLocation = await this._fetchLocation(this.locationInput.value.trim())
1427
1585
  if (!foundLocation) {
1428
1586
  const locationNameSplit = this.locationInput.value.split('-')
@@ -1594,6 +1752,8 @@ class PutawayProduct extends connect(store)(localize(i18next)(PageView)) {
1594
1752
  html`
1595
1753
  <undo-putaway-popup
1596
1754
  .enableCartonLabel="${this._enableCartonLabel}"
1755
+ .enableProductScanning="${this._enableProductScanning}"
1756
+ .replenishmentId= "${this.refOrderType === AVAIL_ORDER_TYPES.REPLENISHMENT.value ? this._replenishmentId : null}"
1597
1757
  .orderType="${this.refOrderType}"
1598
1758
  .orderNo="${this._orderNo}"
1599
1759
  .putawayInventories="${this.data.records.filter(itm => itm.status == 'DONE')}"
@@ -1757,6 +1917,76 @@ class PutawayProduct extends connect(store)(localize(i18next)(PageView)) {
1757
1917
  }
1758
1918
  }
1759
1919
 
1920
+ async _checkedScannedProduct(e) {
1921
+ const response = await this.fetchProductDetails(this.getInput(this.productBarcodeInput).value.trim() || '')
1922
+ const locationDetails = await this._fetchLocation(
1923
+ this.locationInput ? this.locationInput.value.trim() : this._selectedLocation.trim()
1924
+ )
1925
+
1926
+ if (!response.errors) {
1927
+ let orderProductData = this.data.records.filter(record => record.completed === false)
1928
+ let checkedProductDetails = response.data.checkGtin.items
1929
+
1930
+ const foundOrderProducts = orderProductData.filter(op => {
1931
+ return checkedProductDetails.some(
1932
+ itm =>
1933
+ itm.product.id == op.product.id && itm.packingType == op.packingType && itm.packingSize == op.packingSize
1934
+ )
1935
+ })
1936
+
1937
+ const foundParentProducts = orderProductData.filter(op => {
1938
+ return checkedProductDetails.some(itm => itm.product.id == op.product.id)
1939
+ })
1940
+
1941
+ if (foundOrderProducts?.length > 1) {
1942
+ this._openPutawaySameProductPopup(foundOrderProducts)
1943
+ return
1944
+ } else if (foundOrderProducts?.length == 1) {
1945
+ this._records.push(foundOrderProducts[0])
1946
+ } else if (foundOrderProducts?.length == 0 && foundParentProducts?.length > 0) {
1947
+ this._records.push(foundParentProducts[0])
1948
+ }
1949
+
1950
+ if (this._records.some(record => record.expirationDate) && locationDetails) {
1951
+ let answer = await this._checkExpiry([this._records], locationDetails.type)
1952
+ if (answer) {
1953
+ if (!answer?.value) return false
1954
+ }
1955
+ }
1956
+ this._transactionHandler(e)
1957
+ } else {
1958
+ return this._showToast({ message: i18next.t('text.no_matching_product_found')})
1959
+ }
1960
+ }
1961
+
1962
+ async fetchProductDetails(gtin) {
1963
+ return await client.query({
1964
+ query: gql`
1965
+ query checkGtin($gtin: String!, $customerCompanyDomainId: String!) {
1966
+ checkGtin(gtin: $gtin, customerCompanyDomainId: $customerCompanyDomainId) {
1967
+ items {
1968
+ id
1969
+ name
1970
+ packingType
1971
+ packingSize
1972
+ gtin
1973
+ product {
1974
+ id
1975
+ name
1976
+ sku
1977
+ }
1978
+ }
1979
+ total
1980
+ }
1981
+ }
1982
+ `,
1983
+ variables: {
1984
+ gtin,
1985
+ customerCompanyDomainId: this._worksheetInfo.customerCompanyDomainId
1986
+ }
1987
+ })
1988
+ }
1989
+
1760
1990
  _massageItemList(worksheetDetailInfos) {
1761
1991
  if (this._enableCartonLabel) {
1762
1992
  if (this.cartonInput) this.getInput(this.cartonInput).value = ''
@@ -99,12 +99,12 @@ class PutawayReplenishmentInventoryPopup extends localize(i18next)(LitElement) {
99
99
 
100
100
  async fetchHandler({}) {
101
101
  const replenishmentId = this.replenishmentId
102
- const cartonId = this.cartonId
102
+ const inventoryId = this.inventoryId
103
103
 
104
104
  const response = await client.query({
105
105
  query: gql`
106
- query putawayReplenishmentInventories($replenishmentId: String!, $cartonId: String!) {
107
- putawayReplenishmentInventories(replenishmentId: $replenishmentId, cartonId: $cartonId) {
106
+ query putawayReplenishmentInventories($replenishmentId: String!, $inventoryId: [String!]!) {
107
+ putawayReplenishmentInventories(replenishmentId: $replenishmentId, inventoryId: $inventoryId) {
108
108
  items {
109
109
  productSKU
110
110
  cartonId
@@ -119,7 +119,7 @@ class PutawayReplenishmentInventoryPopup extends localize(i18next)(LitElement) {
119
119
  `,
120
120
  variables: {
121
121
  replenishmentId: replenishmentId,
122
- cartonId: cartonId
122
+ inventoryId: inventoryId
123
123
  }
124
124
  })
125
125