@things-factory/operato-wms 4.0.27 → 4.0.31

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 (71) hide show
  1. package/client/fetch-setting-value.js +10 -2
  2. package/client/pages/bulk-operation/bulk-operation.js +44 -10
  3. package/client/pages/bulk-operation/validate-gan-popup.js +5 -4
  4. package/client/pages/bulk-operation/validate-ro-popup.js +7 -39
  5. package/client/pages/components/popup-reusable-pallet.js +145 -0
  6. package/client/pages/components/vas-templates/vas-pallet-add-popup.js +12 -11
  7. package/client/pages/components/vas-templates/vas-relabel.js +57 -34
  8. package/client/pages/components/vas-templates/vas-repack-relabel.js +56 -36
  9. package/client/pages/components/vas-templates/vas-repack.js +45 -31
  10. package/client/pages/components/vas-templates/vas-repalletizing.js +58 -39
  11. package/client/pages/components/vas-templates/vas-unpack.js +38 -24
  12. package/client/pages/components/worksheet-information-popup.js +4 -1
  13. package/client/pages/inbound/unload-product.js +116 -91
  14. package/client/pages/inventory/onhand-inventory.js +1 -0
  15. package/client/pages/master/location-list.js +1 -0
  16. package/client/pages/master/print-location-label.js +131 -146
  17. package/client/pages/order/arrival-notice/arrival-notice-detail.js +52 -44
  18. package/client/pages/order/arrival-notice/arrival-notice-list.js +2 -5
  19. package/client/pages/order/goods-received-note/received-note-detail.js +7 -6
  20. package/client/pages/order/release-order/b2b/b2b-order-list.js +1 -5
  21. package/client/pages/order/release-order/batch-generate-single-picking-worksheet-popup.js +1 -1
  22. package/client/pages/order/release-order/batch-picking-popup.js +4 -3
  23. package/client/pages/order/release-order/create-release-order.js +1 -1
  24. package/client/pages/order/release-order/release-extra-product-popup.js +10 -5
  25. package/client/pages/order/release-order/release-order-detail.js +29 -12
  26. package/client/pages/order/return-order/create-return-order.js +41 -52
  27. package/client/pages/order/reverse-kitting-order/reverse-kitting-order-detail.js +2 -2
  28. package/client/pages/order/transport-order/create-delivery-order.js +4 -2
  29. package/client/pages/order/transport-order/delivery-note-popup.js +2 -2
  30. package/client/pages/outbound/packing-product.js +6 -0
  31. package/client/pages/outbound/packing-worksheet-list.js +64 -4
  32. package/client/pages/outbound/picking-product.js +12 -7
  33. package/client/pages/outbound/worksheet-batch-picking.js +1 -1
  34. package/client/pages/outbound/worksheet-loading.js +16 -14
  35. package/client/pages/outbound/worksheet-packing.js +15 -13
  36. package/client/pages/outbound/worksheet-picking.js +2 -2
  37. package/client/pages/report/custom-elccl/elccl-daily-collection-report.js +8 -9
  38. package/client/pages/report/custom-elccl/elccl-daily-order-inventory-report.js +26 -25
  39. package/client/pages/report/custom-elccl/elccl-delivery-order-summary.js +10 -9
  40. package/client/pages/report/custom-elccl/elccl-inventory-pallet-detail-report.js +13 -8
  41. package/client/pages/report/custom-elccl/elccl-inventory-report.js +11 -10
  42. package/client/pages/report/custom-elccl/elccl-inventory-summary-report.js +5 -1
  43. package/client/pages/report/inbound-order-details-report.js +3 -5
  44. package/client/pages/report/inventory-pallet-report.js +13 -12
  45. package/client/pages/report/job-sheet-popup.js +9 -9
  46. package/client/pages/report/job-sheet-report.js +6 -6
  47. package/client/pages/system/location-sorting-rule.js +53 -46
  48. package/client/pages/vas/abstract-execute-vas.js +51 -35
  49. package/client/pages/vas/execute-pure-vas.js +63 -64
  50. package/client/pages/vas/execute-ref-vas.js +39 -41
  51. package/client/pages/vas/related-vas-list.js +7 -6
  52. package/client/pages/vas/reverse-kitting/execute-reverse-kitting.js +3 -3
  53. package/client/pages/vas/reverse-kitting/popup-combination-sets.js +3 -3
  54. package/client/pages/vas/reverse-kitting/popup-reverse-kitting-template.js +1 -1
  55. package/client/pages/vas/target-inventory-assignment-popup.js +16 -14
  56. package/client/pages/vas/vas-pallet-label-popup.js +1 -1
  57. package/client/pages/vas/vas-worksheet-list.js +9 -8
  58. package/client/pages/vas/worksheet-ref-vas.js +7 -6
  59. package/client/pages/vas/worksheet-vas.js +16 -14
  60. package/dist-server/graphql/resolvers/reports/inbound-order-details-report.js +2 -4
  61. package/dist-server/graphql/resolvers/reports/inbound-order-details-report.js.map +1 -1
  62. package/dist-server/graphql/types/reports/inbound-order-details-report.js +2 -1
  63. package/dist-server/graphql/types/reports/inbound-order-details-report.js.map +1 -1
  64. package/package.json +65 -65
  65. package/server/graphql/resolvers/reports/inbound-order-details-report.ts +2 -4
  66. package/server/graphql/types/reports/inbound-order-details-report.ts +2 -1
  67. package/translations/en.json +15 -1
  68. package/translations/ko.json +20 -7
  69. package/translations/ms.json +21 -8
  70. package/translations/zh.json +21 -8
  71. package/client/pages/components/popup-unloading.js +0 -610
@@ -1,7 +1,7 @@
1
1
  import '@things-factory/barcode-ui'
2
2
  import '@things-factory/grist-ui'
3
3
  import '../components/popup-note'
4
- import '../components/popup-unloading'
4
+ import '../components/popup-reusable-pallet'
5
5
  import './palletizing-pallets-popup'
6
6
  import '../components/worksheet-information-popup'
7
7
  import './unloaded-inventories-popup'
@@ -21,12 +21,14 @@ import { CommonButtonStyles } from '@things-factory/styles'
21
21
  import { isMobileDevice } from '@things-factory/utils'
22
22
 
23
23
  import { fetchSettingRule } from '../../fetch-setting-value'
24
- import { ARRIVAL_NOTICE, PALLET_STATUS, RETURN_ORDER, VAS_TYPE } from '../constants'
24
+ import { ARRIVAL_NOTICE, RETURN_ORDER, VAS_TYPE } from '../constants'
25
25
 
26
26
  const AVAIL_ORDER_TYPES = { ARRIVAL_NOTICE, RETURN_ORDER }
27
27
  class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
28
28
  static get properties() {
29
29
  return {
30
+ _worksheetLoaded: Boolean,
31
+ _usingReusablePallet: Boolean,
30
32
  _bizplaceName: String,
31
33
  _cartonId: String,
32
34
  _enableProductScanning: Boolean,
@@ -36,11 +38,9 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
36
38
  _isLooseItem: Boolean,
37
39
  _isQtyChecked: Boolean,
38
40
  _isRequiredCheckExpiry: Boolean,
39
- _isReusablePallet: Boolean,
40
41
  _orderNo: String,
41
42
  _palletId: String,
42
- _reusablePalletId: Array,
43
- _reusablePalletIdData: Object,
43
+ _reusablePallet: Object,
44
44
  _scanning: Boolean,
45
45
  _selectedOrderProduct: Object,
46
46
  _selectedInventory: Object,
@@ -108,6 +108,22 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
108
108
 
109
109
  get context() {
110
110
  var actions = []
111
+ if (this._worksheetLoaded && !this._enableCartonLabel) {
112
+ if (this._usingReusablePallet) {
113
+ actions.push({
114
+ title: i18next.t('button.wooden_pallet'),
115
+ action: this._woodenPalletMode.bind(this),
116
+ ...CommonButtonStyles.activate
117
+ })
118
+ } else {
119
+ actions.push({
120
+ title: i18next.t('button.plastic_pallet'),
121
+ action: this._reusablePalletMode.bind(this),
122
+ ...CommonButtonStyles.activate
123
+ })
124
+ }
125
+ }
126
+
111
127
  if (this._isLooseItem) {
112
128
  actions.push({
113
129
  title: i18next.t('button.vas'),
@@ -290,6 +306,8 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
290
306
 
291
307
  constructor() {
292
308
  super()
309
+ this._worksheetLoaded = false
310
+ this._usingReusablePallet = false
293
311
  this._enableCartonLabel = false
294
312
  this._enableInputQty = true
295
313
  this._enableProductScanning = false
@@ -297,7 +315,6 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
297
315
  this._isLooseItem = false
298
316
  this._isQtyChecked = false
299
317
  this._isRequiredCheckExpiry = false
300
- this._isReusablePallet = false
301
318
  this._orderNo = ''
302
319
  this._scanning = false
303
320
  this.refOrderType = AVAIL_ORDER_TYPES.ARRIVAL_NOTICE.value
@@ -310,7 +327,8 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
310
327
  if (
311
328
  changedProps.has('_orderNo') ||
312
329
  changedProps.has('_selectedOrderProduct') ||
313
- changedProps.has('_unloadedInventories')
330
+ changedProps.has('_unloadedInventories') ||
331
+ changedProps.has('_usingReusablePallet')
314
332
  ) {
315
333
  this.updateContext()
316
334
  }
@@ -547,6 +565,7 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
547
565
  })
548
566
 
549
567
  if (!response.errors) {
568
+ this._worksheetLoaded = true
550
569
  const worksheetInfo = response.data.unloadingWorksheet.worksheetInfo
551
570
  const orderVasInfo = worksheetInfo.orderVas
552
571
 
@@ -648,7 +667,6 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
648
667
  if (!response.errors) {
649
668
  this._orderNo = orderNo
650
669
  const worksheetInfo = response.data.unloadingReturnWorksheet.worksheetInfo
651
- this._fillUpForm(this.infoForm, worksheetInfo)
652
670
 
653
671
  this.orderProductData = {
654
672
  records: orderBy(
@@ -766,22 +784,15 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
766
784
  }
767
785
 
768
786
  async _transactionHandler(e) {
769
- if (e.keyCode === 13) {
770
- e.preventDefault()
771
- try {
772
- if (this._enableCartonLabel) {
773
- await this._validateUnloading()
774
- if (this._enableProductScanning && !this._enableInputQty) {
775
- this._scanProductUnload()
776
- } else {
777
- this._qtyUnload()
778
- }
779
- } else {
780
- this._checkReusablePallet()
781
- }
782
- } catch (e) {
783
- this._showToast(e)
784
- }
787
+ if (e.keyCode !== 13) return
788
+ e.preventDefault()
789
+ try {
790
+ if (!this._enableCartonLabel) return this._unloadSelected()
791
+ await this._validateUnloading()
792
+ if (!(this._enableProductScanning && !this._enableInputQty)) return this._qtyUnload()
793
+ this._scanProductUnload()
794
+ } catch (e) {
795
+ this._showToast(e)
785
796
  }
786
797
  }
787
798
 
@@ -839,50 +850,48 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
839
850
  }
840
851
  }
841
852
 
842
- async _qtyUnload() {
843
- if (this._scanning === false) {
844
- this._scanning = true
845
- try {
846
- if (this._isRequiredCheckExpiry && this._expirationPeriod > 0) {
847
- let date = new Date()
848
- const acceptBefore = new Date(date.setDate(date.getDate() + this._expirationPeriod))
849
- let expiryDate = new Date(this.expDateInput.value)
850
- if (expiryDate < acceptBefore) {
851
- await CustomAlert({
852
- title: i18next.t('title.item_unloading_is_expiring_soon'),
853
- confirmButton: { text: i18next.t('button.confirm') }
854
- })
855
- }
856
- }
857
-
858
- const response = await client.mutate({
859
- mutation: gql`
860
- mutation unload($worksheetDetailName: String!, $inventory: InventoryPatch!, $productBarcode: String) {
861
- unload(worksheetDetailName: $worksheetDetailName, inventory: $inventory, productBarcode: $productBarcode)
862
- }
863
- `,
864
- variables: {
865
- worksheetDetailName: this._selectedOrderProduct.name,
866
- inventory: {
867
- palletId: this._enableCartonLabel ? null : this.lotInput.value.trim(),
868
- cartonId: this._enableCartonLabel ? this.cartonInput.value.trim() : null,
869
- qty: parseInt(this.actualQtyInput.value),
870
- expirationDate: this._isRequiredCheckExpiry ? this.expDateInput.value : null
871
- },
872
- productBarcode: this._enableProductScanning ? this.productBarcodeInput?.value : null
873
- }
853
+ async _checkExpiry() {
854
+ if (this._isRequiredCheckExpiry && this._expirationPeriod > 0) {
855
+ let date = new Date()
856
+ const acceptBefore = new Date(date.setDate(date.getDate() + this._expirationPeriod))
857
+ let expiryDate = new Date(this.expDateInput.value)
858
+ if (expiryDate < acceptBefore) {
859
+ await CustomAlert({
860
+ title: i18next.t('title.item_unloading_is_expiring_soon'),
861
+ confirmButton: { text: i18next.t('button.confirm') }
874
862
  })
875
- if (!response.errors) {
876
- await this._fetchProducts(this._orderNo)
877
- }
878
- } catch (e) {
879
- this._showToast(e)
880
863
  }
864
+ }
865
+ }
881
866
 
882
- this._scanning = false
883
- } else {
884
- this._showToast({ message: i18next.t('text.previous_scan_is_executing') })
867
+ async _qtyUnload() {
868
+ if (this._scanning) return this._showToast({ message: i18next.t('text.previous_scan_is_executing') })
869
+ this._scanning = true
870
+ await this._checkExpiry()
871
+ try {
872
+ const response = await client.mutate({
873
+ mutation: gql`
874
+ mutation unload($worksheetDetailName: String!, $inventory: InventoryPatch!, $productBarcode: String) {
875
+ unload(worksheetDetailName: $worksheetDetailName, inventory: $inventory, productBarcode: $productBarcode)
876
+ }
877
+ `,
878
+ variables: {
879
+ worksheetDetailName: this._selectedOrderProduct.name,
880
+ inventory: {
881
+ palletId: this._enableCartonLabel ? null : this.lotInput.value.trim(),
882
+ cartonId: this._enableCartonLabel ? this.cartonInput.value.trim() : null,
883
+ qty: parseInt(this.actualQtyInput.value),
884
+ expirationDate: this._isRequiredCheckExpiry ? this.expDateInput.value : null,
885
+ reusablePallet: this._usingReusablePallet ? this._reusablePallet : null
886
+ },
887
+ productBarcode: this._enableProductScanning ? this.productBarcodeInput?.value : null
888
+ }
889
+ })
890
+ if (!response.errors) await this._fetchProducts(this._orderNo)
891
+ } catch (e) {
892
+ this._showToast(e)
885
893
  }
894
+ this._scanning = false
886
895
  }
887
896
 
888
897
  async fetchProductDetail(gtin, productId) {
@@ -1017,7 +1026,7 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
1017
1026
 
1018
1027
  if (this._isRequiredCheckExpiry) {
1019
1028
  if (!this.expDateInput.value) {
1020
- this._focusOnExipryDateInput()
1029
+ this._focusOnExpiryDateInput()
1021
1030
  throw new Error(i18next.t('text.expiry_date_is_empty'))
1022
1031
  }
1023
1032
  }
@@ -1045,7 +1054,7 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
1045
1054
 
1046
1055
  if (this._isRequiredCheckExpiry) {
1047
1056
  if (!this.expDateInput.value) {
1048
- this._focusOnExipryDateInput()
1057
+ this._focusOnExpiryDateInput()
1049
1058
  throw new Error(i18next.t('text.expiry_date_is_empty'))
1050
1059
  }
1051
1060
  }
@@ -1248,33 +1257,13 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
1248
1257
  }
1249
1258
  }
1250
1259
 
1251
- async _checkReusablePallet() {
1260
+ async _unloadSelected() {
1252
1261
  try {
1253
1262
  if (!this._selectedOrderProduct) throw new Error(i18next.t('text.target_is_not_selected'))
1254
1263
  if (!this.lotInput.value) return
1255
-
1256
- const response = await client.query({
1257
- query: gql`
1258
- query palletByStatus($name: String!, $status: String!) {
1259
- palletByStatus(name: $name, status: $status) {
1260
- id
1261
- name
1262
- }
1263
- }
1264
- `,
1265
- variables: { name: this.lotInput.value, status: PALLET_STATUS.ACTIVE.value }
1266
- })
1267
-
1268
- if (!response.errors) {
1269
- if (response.data.palletByStatus) {
1270
- this.reusablePalletIdData = response.data.palletByStatus
1271
- this._isReusablePallet = true
1272
- } else {
1273
- await this._validateUnloading()
1274
- await this._checkedLotScannedProduct()
1275
- this._qtyUnload()
1276
- }
1277
- }
1264
+ await this._validateUnloading()
1265
+ await this._checkedLotScannedProduct()
1266
+ this._qtyUnload()
1278
1267
  } catch (e) {
1279
1268
  this._showToast(e)
1280
1269
  }
@@ -1316,6 +1305,42 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
1316
1305
  }
1317
1306
  )
1318
1307
  }
1308
+ _reusablePalletMode() {
1309
+ openPopup(
1310
+ html`
1311
+ <popup-reusable-pallet
1312
+ .label="${i18next.t('label.reusable_pallet_id')}"
1313
+ @submit=${async e => {
1314
+ this._usingReusablePallet = true
1315
+ this._reusablePallet = e.detail.reusablePallet
1316
+ this._worksheetInfo.plasticPallet = this._reusablePallet.name
1317
+ this.updateContext()
1318
+ }}
1319
+ ></popup-reusable-pallet>
1320
+ `,
1321
+ {
1322
+ backdrop: true,
1323
+ escapable: false,
1324
+ size: 'small',
1325
+ title: i18next.t('title.unloading_with_reusable_pallet')
1326
+ }
1327
+ )
1328
+ }
1329
+
1330
+ async _woodenPalletMode() {
1331
+ const result = await CustomAlert({
1332
+ title: i18next.t('title.are_you_sure'),
1333
+ text: i18next.t('text.use_wooden_pallet'),
1334
+ confirmButton: { text: i18next.t('button.confirm') },
1335
+ cancelButton: { text: i18next.t('button.cancel') }
1336
+ })
1337
+
1338
+ if (!result.value) return
1339
+ this._usingReusablePallet = false
1340
+ this._reusablePalletName = this._worksheetInfo.plasticPallet = ''
1341
+ this._showToast({ message: i18next.t('text.now_using_wooden_pallet') })
1342
+ this.updateContext()
1343
+ }
1319
1344
 
1320
1345
  _validateComplete() {
1321
1346
  if (this.refOrderType === AVAIL_ORDER_TYPES.ARRIVAL_NOTICE.value) {
@@ -1381,7 +1406,7 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
1381
1406
  setTimeout(() => this.actualQtyInput.focus(), 100)
1382
1407
  }
1383
1408
 
1384
- _focusOnExipryDateInput() {
1409
+ _focusOnExpiryDateInput() {
1385
1410
  setTimeout(() => this.expDateInput.focus(), 100)
1386
1411
  }
1387
1412
 
@@ -479,6 +479,7 @@ class OnhandInventory extends connect(store)(localize(i18next)(PageView)) {
479
479
  { header: i18next.t('field.company'), key: 'bizplace_name', width: 30, type: 'string' },
480
480
  { header: i18next.t('field.sku_code'), key: 'product_sku', width: 25, type: 'string' },
481
481
  { header: i18next.t('field.product'), key: 'product_name', width: 40, type: 'string' },
482
+ { header: i18next.t('field.brand'), key: 'product_brand', width: 25, type: 'string' },
482
483
  { header: i18next.t('field.product_description'), key: 'product_description', width: 50, type: 'string' },
483
484
  { header: i18next.t('field.packing_type'), key: 'packingType', width: 20, type: 'string' },
484
485
  { header: i18next.t('field.qty'), key: 'remainQty', width: 15, type: 'string' },
@@ -673,6 +673,7 @@ class LocationList extends connect(store)(localize(i18next)(PageView)) {
673
673
 
674
674
  /* for location record mapping */
675
675
  searchParams.append('location', record.name)
676
+ searchParams.append('originalName', record.originalName)
676
677
  searchParams.append('label', record.indicator)
677
678
 
678
679
  try {