@things-factory/operato-wms 4.3.59 → 4.3.62

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.
Files changed (65) hide show
  1. package/client/pages/components/select-inventory-popup.js +626 -0
  2. package/client/pages/inbound/select-product-batch.js +7 -1
  3. package/client/pages/inbound/unload-product.js +75 -25
  4. package/client/pages/inventory/inventory-adjustment.js +1 -1
  5. package/client/pages/inventory/inventory-by-product-detail.js +99 -92
  6. package/client/pages/inventory/inventory-by-product.js +170 -68
  7. package/client/pages/inventory-check/inspecting-product.js +1 -1
  8. package/client/pages/order/release-order/b2b/b2b-order-list.js +76 -80
  9. package/client/pages/order/release-order/b2c/b2c-order-requests.js +93 -81
  10. package/client/pages/order/release-order/batch-picking-popup.js +11 -0
  11. package/client/pages/order/release-order/create-release-order.js +258 -252
  12. package/client/pages/order/release-order/release-extra-product-popup.js +10 -3
  13. package/client/pages/order/release-order/release-order-detail.js +202 -63
  14. package/client/pages/order/transport-order/delivery-note-popup.js +12 -17
  15. package/client/pages/order/transport-order/upload-delivery-note.js +6 -4
  16. package/client/pages/order/transport-order/view-delivery-note.js +0 -1
  17. package/client/pages/outbound/generate-worksheet-popup.js +337 -0
  18. package/client/pages/outbound/inventory-reassign-popup.js +1097 -0
  19. package/client/pages/outbound/loading-product.js +2 -2
  20. package/client/pages/outbound/picking-product.js +174 -100
  21. package/client/pages/outbound/sorting-product.js +5 -5
  22. package/client/pages/outbound/worksheet-batch-picking.js +39 -5
  23. package/client/pages/outbound/worksheet-picking.js +45 -6
  24. package/client/pages/report/outbound-order-details-report.js +181 -49
  25. package/client/pages/report/release-inventory-report.js +503 -0
  26. package/client/route.js +5 -0
  27. package/dist-server/graphql/resolvers/dashboard/outbound-order-by-status.js +3 -3
  28. package/dist-server/graphql/resolvers/extra/add-release-good-products.js +54 -3
  29. package/dist-server/graphql/resolvers/extra/add-release-good-products.js.map +1 -1
  30. package/dist-server/graphql/resolvers/reports/index.js +2 -1
  31. package/dist-server/graphql/resolvers/reports/index.js.map +1 -1
  32. package/dist-server/graphql/resolvers/reports/outbound-order-details-report.js +63 -28
  33. package/dist-server/graphql/resolvers/reports/outbound-order-details-report.js.map +1 -1
  34. package/dist-server/graphql/resolvers/reports/release-inventory-report.js +180 -0
  35. package/dist-server/graphql/resolvers/reports/release-inventory-report.js.map +1 -0
  36. package/dist-server/graphql/types/reports/index.js +6 -1
  37. package/dist-server/graphql/types/reports/index.js.map +1 -1
  38. package/dist-server/graphql/types/reports/outbound-order-details-report.js +14 -1
  39. package/dist-server/graphql/types/reports/outbound-order-details-report.js.map +1 -1
  40. package/dist-server/graphql/types/reports/release-inventory-report-list.js +14 -0
  41. package/dist-server/graphql/types/reports/release-inventory-report-list.js.map +1 -0
  42. package/dist-server/graphql/types/reports/release-inventory-report.js +29 -0
  43. package/dist-server/graphql/types/reports/release-inventory-report.js.map +1 -0
  44. package/dist-server/utils/report-query-util.js +4 -2
  45. package/dist-server/utils/report-query-util.js.map +1 -1
  46. package/helps/release-note.ko.md +13 -7
  47. package/helps/release-note.md +13 -7
  48. package/helps/release-note.ms.md +13 -7
  49. package/helps/release-note.zh.md +13 -7
  50. package/package.json +10 -10
  51. package/server/graphql/resolvers/dashboard/outbound-order-by-status.ts +3 -3
  52. package/server/graphql/resolvers/extra/add-release-good-products.ts +66 -3
  53. package/server/graphql/resolvers/reports/index.ts +3 -1
  54. package/server/graphql/resolvers/reports/outbound-order-details-report.ts +66 -29
  55. package/server/graphql/resolvers/reports/release-inventory-report.ts +202 -0
  56. package/server/graphql/types/reports/index.ts +6 -1
  57. package/server/graphql/types/reports/outbound-order-details-report.ts +14 -1
  58. package/server/graphql/types/reports/release-inventory-report-list.ts +8 -0
  59. package/server/graphql/types/reports/release-inventory-report.ts +23 -0
  60. package/server/utils/report-query-util.ts +4 -2
  61. package/things-factory.config.js +4 -0
  62. package/translations/en.json +73 -16
  63. package/translations/ko.json +157 -110
  64. package/translations/ms.json +65 -16
  65. package/translations/zh.json +79 -29
@@ -11,11 +11,11 @@ import { sleep } from '@operato/utils'
11
11
  import { MultiColumnFormStyles, SingleColumnFormStyles } from '@things-factory/form-ui'
12
12
  import { i18next, localize } from '@things-factory/i18n-base'
13
13
  import { openPopup } from '@things-factory/layout-base'
14
- import { fetchSettingRule } from '../../fetch-setting-value'
15
14
  import { client, CustomAlert, PageView, store } from '@things-factory/shell'
16
15
  import { CommonButtonStyles } from '@things-factory/styles'
17
16
  import { isMobileDevice } from '@things-factory/utils'
18
17
 
18
+ import { fetchSettingRule } from '../../fetch-setting-value'
19
19
  import { WORKSHEET_STATUS } from '../constants'
20
20
 
21
21
  class LoadingProduct extends connect(store)(localize(i18next)(PageView)) {
@@ -805,7 +805,7 @@ class LoadingProduct extends connect(store)(localize(i18next)(PageView)) {
805
805
  variables: {
806
806
  filters: [
807
807
  {
808
- name: 'deliveryOrder',
808
+ name: 'deliveryOrderId',
809
809
  operator: 'eq',
810
810
  value: this._selectedDeliveryOrder.id
811
811
  }
@@ -21,7 +21,16 @@ import { isMobileDevice } from '@things-factory/utils'
21
21
 
22
22
  import { fetchLocationSortingRule } from '../../fetch-location-sorting-rule'
23
23
  import { fetchSettingRule } from '../../fetch-setting-value'
24
- import { BATCH_PICKING, LOCATION_SORTING_RULE, ORDER_SOURCES, PICKING } from '../constants'
24
+ import {
25
+ BATCH_PICKING,
26
+ LOCATION_SORTING_RULE,
27
+ LOCATION_STATUS,
28
+ LOCATION_TYPE,
29
+ ORDER_SOURCES,
30
+ ORDER_STATUS,
31
+ PICKING,
32
+ RO_TYPES
33
+ } from '../constants'
25
34
 
26
35
  const PICKING_TYPES = { PICKING, BATCH_PICKING }
27
36
  class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
@@ -42,10 +51,14 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
42
51
  _worksheetInfo: Object,
43
52
  _locationName: String,
44
53
  _scannable: Boolean,
54
+ _enableInputQty: Boolean,
55
+ _releaseGoodType: String,
56
+ _isLastUnit: Boolean,
45
57
  config: Object,
46
58
  data: Object,
47
59
  isWholePicking: Boolean,
48
60
  locationNameSplit: Array,
61
+ _isReleaseGoodRecall: Boolean,
49
62
  locations: Array,
50
63
  orderNo: String,
51
64
  refPickingType: String,
@@ -211,7 +224,9 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
211
224
  }
212
225
 
213
226
  get serialInput() {
214
- return this.shadowRoot.querySelector('barcode-scanable-input[name=serialNumber]')?.shadowRoot.querySelector('input')
227
+ return this.shadowRoot
228
+ ?.querySelector('barcode-scanable-input[name=serialNumber]')
229
+ ?.shadowRoot.querySelector('input')
215
230
  }
216
231
 
217
232
  _focusOnNewLocationInput() {
@@ -286,6 +301,7 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
286
301
  this._reusablePalletList = { records: [] }
287
302
  this._selectedOrderInventory = null
288
303
  this.scannable = false
304
+ this._isLastUnit = false
289
305
  }
290
306
 
291
307
  render() {
@@ -338,6 +354,7 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
338
354
  this.completeHandler()
339
355
  }
340
356
  }
357
+ this.focusOnInput()
341
358
  }
342
359
  }}"
343
360
  >
@@ -373,32 +390,41 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
373
390
  <label>${i18next.t('label.lot_id')}</label>
374
391
  <barcode-scanable-input name="palletId" custom-input></barcode-scanable-input>
375
392
  `}
376
- ${this._enableProductScanning
393
+ ${this._enableProductScanning && this._isCartonLabel
377
394
  ? html`
378
395
  <label>${i18next.t('label.product_barcode')}</label>
379
396
  <barcode-scanable-input name="productBarcode" custom-input></barcode-scanable-input>
380
397
  `
381
- : html`
382
- ${this._isRequireSerialNumberScanningOutbound
383
- ? ''
384
- : html`
385
- <label>${i18next.t('label.picked_qty')}</label>
386
- <input type="number" min="1" name="confirmedQty" />
387
- `}
388
- `}
398
+ : ''}
399
+ ${!this._isRequireSerialNumberScanningOutbound &&
400
+ ((this._enableInputQty !== 0 && this._releaseGoodType != RO_TYPES.B2B.value) || !this._isCartonLabel)
401
+ ? html`${(this._enableInputQty == 1 && !this._releaseGoodType) ||
402
+ (this._enableInputQty == 2 && this._releaseGoodType == RO_TYPES.B2C.value) ||
403
+ this._enableInputQty == 3 ||
404
+ !this._isCartonLabel
405
+ ? html`<label>${i18next.t('label.picked_qty')}</label>
406
+ <input type="number" min="1" name="confirmedQty" /> `
407
+ : ''} `
408
+ : ''}
409
+ ${this._isRequireSerialNumberScanningOutbound
410
+ ? html`
411
+ <label>${i18next.t('label.serial_number')}</label>
412
+ <barcode-scanable-input name="serialNumber" custom-input></barcode-scanable-input>
413
+ `
414
+ : ``}
389
415
  ${this.isWholePicking ||
390
416
  this._crossDocking ||
391
417
  this._isCartonLabel ||
392
- this._enableProductScanning ||
393
- this._isRequireSerialNumberScanningOutbound
418
+ (this._enableProductScanning && this._isCartonLabel)
394
419
  ? ''
395
420
  : html`
396
421
  ${this._incompleteLocationName
397
422
  ? ''
398
- : html`
399
- <label>${i18next.t('label.return_location')}</label>
400
- <barcode-scanable-input name="locationName" custom-input></barcode-scanable-input>
401
- `}
423
+ : html`${(this._isRequireSerialNumberScanningOutbound && this._isLastUnit) ||
424
+ !this._isRequireSerialNumberScanningOutbound
425
+ ? html` <label>${i18next.t('label.return_location')}</label>
426
+ <barcode-scanable-input name="locationName" custom-input></barcode-scanable-input>`
427
+ : ''}`}
402
428
  <select
403
429
  ?hidden="${!this._incompleteLocationName}"
404
430
  name="newLocationCode"
@@ -416,12 +442,6 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
416
442
  )}
417
443
  </select>
418
444
  `}
419
- ${this._isRequireSerialNumberScanningOutbound
420
- ? html`
421
- <label>${i18next.t('label.serial_number')}</label>
422
- <barcode-scanable-input name="serialNumber" custom-input></barcode-scanable-input>
423
- `
424
- : ``}
425
445
  </fieldset>
426
446
  `
427
447
  : ''}
@@ -487,6 +507,8 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
487
507
  await this.fetchInventories(
488
508
  this.refPickingType === PICKING_TYPES.PICKING.value ? this.releaseGoodNo : this.taskNo
489
509
  )
510
+
511
+ this.focusOnInput
490
512
  let updatedRecords = this._selectedOrderInventory
491
513
  if (updatedRecords.releaseQty === updatedRecords.pickedQty) {
492
514
  updatedRecords.status = 'DONE'
@@ -623,7 +645,9 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
623
645
  releaseGood {
624
646
  id
625
647
  name
648
+ recall
626
649
  crossDocking
650
+ type
627
651
  }
628
652
  bizplaceName
629
653
  partnerDomainId
@@ -692,10 +716,12 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
692
716
  })
693
717
 
694
718
  if (!response.errors) {
695
- this.releaseGoodNo = response.data.pickingWorksheet.worksheetInfo.releaseGood.name
696
- this.releaseGoodId = response.data.pickingWorksheet.worksheetInfo.releaseGood.id
697
- if (!response.data?.pickingWorksheet) return
719
+ this._isReleaseGoodRecall = response.data.pickingWorksheet.worksheetInfo.releaseGood.recall
720
+ let releaseGood = response.data.pickingWorksheet.worksheetInfo.releaseGood
721
+ this.releaseGoodId = releaseGood.id
722
+ this._releaseGoodType = releaseGood.type
698
723
 
724
+ if (!response.data?.pickingWorksheet) return
699
725
  const { worksheetInfo, worksheetDetailInfos } = response.data.pickingWorksheet
700
726
  this._crossDocking = worksheetInfo.releaseGood?._crossDocking
701
727
  this._bizplaceName = worksheetInfo.bizplaceName
@@ -757,12 +783,22 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
757
783
  ) {
758
784
  this._currentBinLocation = record?.binLocation ? record.binLocation : ''
759
785
  }
760
- this.focusOnInput()
786
+ }
787
+
788
+ if (
789
+ record.releaseQty - record.pickedQty == 1 &&
790
+ !this._isCartonLabel &&
791
+ this._isRequireSerialNumberScanningOutbound
792
+ ) {
793
+ this._isLastUnit = true
794
+ } else {
795
+ this._isLastUnit = false
761
796
  }
762
797
  }
763
798
 
764
799
  this._enableProductScanning = await fetchSettingRule('enable-product-scanning', worksheetInfo.partnerDomainId)
765
800
  this._enableToteScanning = await fetchSettingRule('enable-tote-scanning', worksheetInfo.partnerDomainId)
801
+ this._enableInputQty = await fetchSettingRule('enable-input-qty', worksheetInfo.partnerDomainId)
766
802
  }
767
803
  break
768
804
 
@@ -862,6 +898,7 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
862
898
  }
863
899
 
864
900
  this._enableProductScanning = await fetchSettingRule('enable-product-scanning', worksheetInfo.partnerDomainId)
901
+ this._enableInputQty = await fetchSettingRule('enable-input-qty', worksheetInfo.partnerDomainId)
865
902
 
866
903
  if (this._selectedOrderInventory) {
867
904
  const record = this.data.records.find(
@@ -882,7 +919,16 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
882
919
  this.fillUpForm(this.inputForm, record)
883
920
  } else {
884
921
  this.fillUpForm(this.inputForm, record)
885
- this.focusOnInput()
922
+ }
923
+
924
+ if (
925
+ record.releaseQty - record.pickedQty == 1 &&
926
+ !this._isCartonLabel &&
927
+ this._isRequireSerialNumberScanningOutbound
928
+ ) {
929
+ this._isLastUnit = true
930
+ } else {
931
+ this._isLastUnit = false
886
932
  }
887
933
  }
888
934
  }
@@ -1011,11 +1057,15 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
1011
1057
  let response = {}
1012
1058
  if (this.crossDocking) {
1013
1059
  response = await this.pickCrossDocking()
1014
- } else if (this._enableProductScanning || this._isCartonLabel) {
1060
+ } else if (this._enableProductScanning && this._isCartonLabel) {
1015
1061
  response = await this.productBarcodePicking()
1016
1062
  } else {
1017
1063
  if (this._isReplacement && !this._isCartonLabel) {
1018
- this.openPalletReplacementPopup()
1064
+ if (this._isReleaseGoodRecall) {
1065
+ throw new Error(i18next.t('text.lot_replacement_is_not_applicable_on_recall_release_order'))
1066
+ } else {
1067
+ this.openPalletReplacementPopup()
1068
+ }
1019
1069
  return
1020
1070
  } else {
1021
1071
  response = await this.pickCommonPicking()
@@ -1054,7 +1104,6 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
1054
1104
  }
1055
1105
  }
1056
1106
  } else {
1057
- this._selectedOrderInventory = null
1058
1107
  if (this.refPickingType === PICKING_TYPES.PICKING.value) {
1059
1108
  await this.fetchInventories(this.releaseGoodNo)
1060
1109
  } else {
@@ -1267,7 +1316,6 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
1267
1316
  } catch (e) {
1268
1317
  this._showToast(e)
1269
1318
  } finally {
1270
- this._selectedOrderInventory = null
1271
1319
  this._isExecuting = false
1272
1320
  }
1273
1321
  }
@@ -1289,6 +1337,7 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
1289
1337
  $binLocation: String
1290
1338
  $serialNumber: String
1291
1339
  $toteNo: String
1340
+ $pickingQty: Int
1292
1341
  ) {
1293
1342
  scanProductPicking(
1294
1343
  worksheetDetailName: $worksheetDetailName
@@ -1298,6 +1347,7 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
1298
1347
  binLocation: $binLocation
1299
1348
  serialNumber: $serialNumber
1300
1349
  toteNo: $toteNo
1350
+ pickingQty: $pickingQty
1301
1351
  )
1302
1352
  }
1303
1353
  `,
@@ -1309,7 +1359,8 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
1309
1359
  serialNumber: this._isRequireSerialNumberScanningOutbound ? this.serialInput.value : null,
1310
1360
  binLocation:
1311
1361
  this._hasBinPicking && (!this.toteNo || this.tote == '') ? this.binLocationInput.value : null,
1312
- toteNo: this._enableToteScanning && this.toteNo !== '' ? this.toteNo : null
1362
+ toteNo: this._enableToteScanning && this.toteNo !== '' ? this.toteNo : null,
1363
+ pickingQty: this.releaseQtyInput?.value ? parseInt(this.releaseQtyInput.value) : 1
1313
1364
  }
1314
1365
  })
1315
1366
 
@@ -1323,6 +1374,7 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
1323
1374
  $inventory: InventoryPatch!
1324
1375
  $productBarcode: String!
1325
1376
  $binLocationName: String
1377
+ $pickingQty: Int
1326
1378
  ) {
1327
1379
  scanProductBatchPicking(
1328
1380
  taskNo: $taskNo
@@ -1331,6 +1383,7 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
1331
1383
  inventory: $inventory
1332
1384
  productBarcode: $productBarcode
1333
1385
  binLocationName: $binLocationName
1386
+ pickingQty: $pickingQty
1334
1387
  )
1335
1388
  }
1336
1389
  `,
@@ -1346,7 +1399,8 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
1346
1399
  product: { id: this._selectedOrderInventory.product.id }
1347
1400
  },
1348
1401
  binLocationName:
1349
- this._hasBinPicking && (!this.toteNo || this.tote == '') ? this.binLocationInput.value : null
1402
+ this._hasBinPicking && (!this.toteNo || this.tote == '') ? this.binLocationInput.value : null,
1403
+ pickingQty: this.releaseQtyInput?.value ? parseInt(this.releaseQtyInput.value) : 1
1350
1404
  }
1351
1405
  })
1352
1406
  }
@@ -1360,6 +1414,14 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
1360
1414
  async validatePicking() {
1361
1415
  // validate for order selection
1362
1416
  // pallet id existing
1417
+
1418
+ if ((!this.palletInput?.value || !this.cartonInput?.value) && this._isRequireSerialNumberScanningOutbound) {
1419
+ if (!this.serialInput?.value) {
1420
+ this._focusOnSerialInput()
1421
+ throw new Error(i18next.t('text.empty_serial_number'))
1422
+ }
1423
+ }
1424
+
1363
1425
  if (!this._isCartonLabel) {
1364
1426
  if (!this.palletInput.value) {
1365
1427
  this._focusOnLotNoInput()
@@ -1383,29 +1445,51 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
1383
1445
  }
1384
1446
  }
1385
1447
  }
1448
+ } else {
1449
+ if (!this.cartonInput?.value) {
1450
+ this._focusOnCartonNoInput()
1451
+ throw new Error(i18next.t('text.carton_id_is_empty'))
1452
+ }
1386
1453
 
1387
- // Release qty existing
1388
- if (!this._isReplacement) {
1389
- if (!this._isRequireSerialNumberScanningOutbound) {
1390
- if (!parseInt(this.releaseQtyInput?.value)) {
1391
- this._focusOnReleaseQtyInput()
1392
- throw new Error(i18next.t('text.release_qty_is_empty'))
1393
- }
1454
+ if (this._selectedOrderInventory.cartonId) {
1455
+ if (this._selectedOrderInventory.cartonId !== this.cartonInput.value) {
1456
+ //carton replacement?
1457
+ throw new Error(i18next.t('text.invalid_carton_id'))
1458
+ this._isReplacement = await this.checkCartonIdenticality(
1459
+ this._selectedOrderInventory.cartonId,
1460
+ this._selectedOrderInventory.palletId,
1461
+ this.cartonInput.value
1462
+ )
1394
1463
 
1395
- if (!this.releaseQtyInput.checkValidity()) throw new Error(i18next.t('text.release_qty_invalid'))
1464
+ if (!this._isReplacement) {
1465
+ this.cartonInput.value = ''
1466
+ this._focusOnCartonNoInput()
1467
+ throw new Error(i18next.t('text.wrong_carton_id'))
1468
+ }
1469
+ }
1396
1470
 
1397
- // typed qty should be matched with release qty.
1471
+ if (this._enableProductScanning) {
1472
+ if (!this.productBarcodeInput?.value) {
1473
+ this._focusOnProductBarcodeInput()
1474
+ throw new Error(i18next.t('text.empty_product_barcode'))
1475
+ }
1476
+ }
1477
+ }
1478
+ }
1398
1479
 
1399
- if (
1400
- parseInt(this.releaseQtyInput.value) !==
1401
- this._selectedOrderInventory.releaseQty -
1402
- (this._selectedOrderInventory.pickedQty ? this._selectedOrderInventory.pickedQty : 0)
1403
- ) {
1480
+ if (!this._isReplacement) {
1481
+ if (!this._isRequireSerialNumberScanningOutbound) {
1482
+ if (this.releaseQtyInput) {
1483
+ if (!parseInt(this.releaseQtyInput?.value)) {
1404
1484
  this._focusOnReleaseQtyInput()
1405
- throw new Error(i18next.t('text.wrong_release_qty'))
1485
+ throw new Error(i18next.t('text.release_qty_is_empty'))
1406
1486
  }
1487
+
1488
+ if (!this.releaseQtyInput?.checkValidity()) throw new Error(i18next.t('text.release_qty_invalid'))
1407
1489
  }
1490
+ }
1408
1491
 
1492
+ if (!this._isCartonLabel) {
1409
1493
  // location id existing
1410
1494
  if (!this.isWholePicking && this.locationInput) {
1411
1495
  if (!this.locationInput.value) {
@@ -1427,9 +1511,21 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
1427
1511
  const zonePortions = this.locationNameSplit[0].match(/[a-zA-Z0-9]+/g)
1428
1512
  const rowPortions = this.locationNameSplit[1].match(/[a-zA-Z0-9]+/g)
1429
1513
  const columnPortions = this.locationNameSplit[2].match(/[a-zA-Z0-9]+/g)
1514
+ const shelfPortions = this.locationNameSplit[3].match(/[a-zA-Z0-9]+/g)
1430
1515
  if (this.locationNameSplit.length === 3) {
1431
1516
  this.locations = await this.fetchLocations(zonePortions[0], rowPortions[0], columnPortions[0])
1432
1517
  this._focusOnNewLocationInput()
1518
+
1519
+ const selectedLocations = this.locations.find(res => {
1520
+ return res.name === this._locationName
1521
+ })
1522
+
1523
+ if (this._isReleaseGoodRecall) {
1524
+ if (![selectedLocations.type].includes(LOCATION_TYPE.QUARANTINE.value, LOCATION_TYPE.RESERVE.value)) {
1525
+ throw new Error(i18next.t('text.location_scanned_is_not_a_quarantine_zone_or_reserved_zone'))
1526
+ }
1527
+ }
1528
+
1433
1529
  if (this.locations.length > 0) {
1434
1530
  this._incompleteLocationName = true
1435
1531
  throw new Error(i18next.t('text.please_select_the_location_again'))
@@ -1437,6 +1533,23 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
1437
1533
  throw new Error(i18next.t('text.invalid_return_location'))
1438
1534
  }
1439
1535
  } else if (this.locationNameSplit.length === 4) {
1536
+ this.locations = await this.fetchLocations(
1537
+ zonePortions[0],
1538
+ rowPortions[0],
1539
+ columnPortions[0],
1540
+ shelfPortions[0]
1541
+ )
1542
+
1543
+ const selectedLocations = this.locations.find(res => {
1544
+ return res.name === this._locationName
1545
+ })
1546
+
1547
+ if (this._isReleaseGoodRecall) {
1548
+ if (![selectedLocations.type].includes(LOCATION_TYPE.QUARANTINE.value, LOCATION_TYPE.RESERVE.value)) {
1549
+ throw new Error(i18next.t('text.location_scanned_is_not_a_quarantine_zone_or_reserved_zone'))
1550
+ }
1551
+ }
1552
+
1440
1553
  let relocateConfirmation = await CustomAlert({
1441
1554
  title: i18next.t('title.relocate'),
1442
1555
  text: i18next.t('text.are_you_sure'),
@@ -1453,43 +1566,6 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
1453
1566
  }
1454
1567
  }
1455
1568
  }
1456
- } else {
1457
- if (!this.cartonInput?.value) {
1458
- this._focusOnCartonNoInput()
1459
- throw new Error(i18next.t('text.carton_id_is_empty'))
1460
- }
1461
-
1462
- if (this._selectedOrderInventory.cartonId) {
1463
- if (this._selectedOrderInventory.cartonId !== this.cartonInput.value) {
1464
- //carton replacement?
1465
- throw new Error(i18next.t('text.invalid_carton_id'))
1466
- this._isReplacement = await this.checkCartonIdenticality(
1467
- this._selectedOrderInventory.cartonId,
1468
- this._selectedOrderInventory.palletId,
1469
- this.cartonInput.value
1470
- )
1471
-
1472
- if (!this._isReplacement) {
1473
- this.cartonInput.value = ''
1474
- this._focusOnCartonNoInput()
1475
- throw new Error(i18next.t('text.wrong_carton_id'))
1476
- }
1477
- }
1478
-
1479
- if (this._enableProductScanning) {
1480
- if (!this.productBarcodeInput?.value) {
1481
- this._focusOnProductBarcodeInput()
1482
- throw new Error(i18next.t('text.empty_product_barcode'))
1483
- }
1484
- }
1485
- }
1486
- }
1487
-
1488
- if (this._isRequireSerialNumberScanningOutbound) {
1489
- if (!this.serialInput?.value) {
1490
- this._focusOnSerialInput()
1491
- throw new Error(i18next.t('text.empty_serial_number'))
1492
- }
1493
1569
  }
1494
1570
 
1495
1571
  if (this._crossDocking) {
@@ -1567,6 +1643,7 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
1567
1643
  column
1568
1644
  shelf
1569
1645
  status
1646
+ type
1570
1647
  }
1571
1648
  }
1572
1649
  }
@@ -1838,39 +1915,36 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
1838
1915
  }
1839
1916
 
1840
1917
  if (this._hasBinPicking && this.binLocationInput && this.binLocationInput.value == '') {
1841
- this._focusOnBinLocationInput()
1842
- return true
1918
+ return this._focusOnBinLocationInput()
1843
1919
  } else {
1844
1920
  if (this._isCartonLabel) {
1845
1921
  if (!this._enableProductScanning) this.cartonInput.value = ''
1846
1922
 
1847
1923
  if (this.cartonInput.value == '') {
1848
- this._focusOnCartonNoInput()
1849
- return true
1924
+ return this._focusOnCartonNoInput()
1850
1925
  }
1851
1926
  } else {
1852
1927
  if (!this._enableProductScanning && !this._isRequireSerialNumberScanningOutbound) this.palletInput.value = ''
1853
1928
 
1854
1929
  if (this.palletInput.value == '') {
1855
- this._focusOnLotNoInput()
1856
- return true
1930
+ return this._focusOnLotNoInput()
1857
1931
  }
1858
1932
  }
1859
1933
  }
1860
1934
 
1861
- if (this._enableProductScanning && !this._isRequireSerialNumberScanningOutbound) {
1935
+ if (this._enableProductScanning && this._isCartonLabel && !this._isRequireSerialNumberScanningOutbound) {
1862
1936
  this.productBarcodeInput.value = ''
1863
- this._focusOnProductBarcodeInput()
1864
- return true
1937
+ return this._focusOnProductBarcodeInput()
1865
1938
  }
1866
1939
 
1867
1940
  if (this._isRequireSerialNumberScanningOutbound) {
1868
- this.serialInput.value = ''
1869
- this._focusOnSerialInput()
1870
- return true
1941
+ if (this._isLastUnit) {
1942
+ return this._focusOnNewLocationInput()
1943
+ } else {
1944
+ this.serialInput.value = ''
1945
+ return this._focusOnSerialInput()
1946
+ }
1871
1947
  }
1872
-
1873
- return true
1874
1948
  }
1875
1949
  }
1876
1950
 
@@ -3,12 +3,12 @@ import '@things-factory/grist-ui'
3
3
  import './show-ro-list-popup'
4
4
  import '../components/worksheet-information-popup'
5
5
  import './tote-popup'
6
- import { sleep } from '@operato/utils'
7
6
 
8
7
  import gql from 'graphql-tag'
9
8
  import { css, html } from 'lit-element'
10
9
  import { connect } from 'pwa-helpers/connect-mixin.js'
11
10
 
11
+ import { sleep } from '@operato/utils'
12
12
  import { MultiColumnFormStyles } from '@things-factory/form-ui'
13
13
  import { i18next, localize } from '@things-factory/i18n-base'
14
14
  import { openPopup } from '@things-factory/layout-base'
@@ -360,8 +360,8 @@ class SortingProduct extends connect(store)(localize(i18next)(PageView)) {
360
360
  try {
361
361
  const response = await client.query({
362
362
  query: gql`
363
- query findReleaseOrdersByTaskNo($taskNo: String!) {
364
- findReleaseOrdersByTaskNo(taskNo: $taskNo) {
363
+ query findSortingReleaseOrdersByTaskNo($taskNo: String!) {
364
+ findSortingReleaseOrdersByTaskNo(taskNo: $taskNo) {
365
365
  releaseGoods {
366
366
  id
367
367
  name
@@ -375,8 +375,8 @@ class SortingProduct extends connect(store)(localize(i18next)(PageView)) {
375
375
  })
376
376
 
377
377
  if (!response.errors) {
378
- this.releaseOrders = response.data.findReleaseOrdersByTaskNo.releaseGoods
379
- this.taskNo = response.data.findReleaseOrdersByTaskNo.taskNo
378
+ this.releaseOrders = response.data.findSortingReleaseOrdersByTaskNo.releaseGoods
379
+ this.taskNo = response.data.findSortingReleaseOrdersByTaskNo.taskNo
380
380
  if (this.releaseOrders?.length) {
381
381
  await this._openSelectReleaseOrderPopup()
382
382
  } else {
@@ -3,6 +3,7 @@ import '@things-factory/grist-ui'
3
3
  import './inventory-assign-popup'
4
4
  import './inventory-auto-assign-popup'
5
5
  import './select-operator-popup'
6
+ import './inventory-reassign-popup'
6
7
 
7
8
  import gql from 'graphql-tag'
8
9
  import { css, html } from 'lit-element'
@@ -133,11 +134,18 @@ class WorksheetBatchPicking extends localize(i18next)(PageView) {
133
134
  }
134
135
 
135
136
  if (this.activatable) {
136
- actions.push({
137
- title: i18next.t('button.activate'),
138
- action: this._activateWorksheet.bind(this),
139
- ...CommonButtonStyles.activate
140
- })
137
+ actions.push(
138
+ {
139
+ title: i18next.t('button.reassign'),
140
+ action: this._openReassignInventoryPopup.bind(this),
141
+ ...CommonButtonStyles.assignment
142
+ },
143
+ {
144
+ title: i18next.t('button.activate'),
145
+ action: this._activateWorksheet.bind(this),
146
+ ...CommonButtonStyles.activate
147
+ }
148
+ )
141
149
  }
142
150
 
143
151
  if (this.assignable) {
@@ -861,6 +869,7 @@ class WorksheetBatchPicking extends localize(i18next)(PageView) {
861
869
  description
862
870
  }
863
871
  packingType
872
+ packingSize
864
873
  inventory {
865
874
  qty
866
875
  lockedQty
@@ -1221,6 +1230,31 @@ class WorksheetBatchPicking extends localize(i18next)(PageView) {
1221
1230
  }
1222
1231
  }
1223
1232
 
1233
+ _openReassignInventoryPopup() {
1234
+ openPopup(
1235
+ html`
1236
+ <inventory-reassign-popup
1237
+ .bizplaceId=${this.targetBizpace?.id}
1238
+ .taskNo=${this._taskNo}
1239
+ .worksheetNo=${this._worksheetNo}
1240
+ @reassignment-completed="${async () => {
1241
+ await this.fetchOrderInventories()
1242
+ await this.fetchWorksheetDetails(this._worksheetNo)
1243
+
1244
+ this.updateContext()
1245
+ }}"
1246
+ ></inventory-reassign-popup>
1247
+ `,
1248
+ {
1249
+ escapable: false,
1250
+ closable: false,
1251
+ backdrop: true,
1252
+ size: 'large',
1253
+ title: i18next.t('title.reassign_inventory')
1254
+ }
1255
+ )
1256
+ }
1257
+
1224
1258
  _showToast({ type, message }) {
1225
1259
  document.dispatchEvent(
1226
1260
  new CustomEvent('notify', {