@things-factory/operato-wms 4.3.113-alpha.0 → 4.3.115

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 (68) hide show
  1. package/client/pages/bulk-operation/bulk-operation.js +3 -23
  2. package/client/pages/components/select-inventory-popup.js +1 -7
  3. package/client/pages/components/select-product-popup.js +2 -31
  4. package/client/pages/inbound/undo-putaway-popup.js +9 -5
  5. package/client/pages/inbound/undo-unload-popup.js +24 -19
  6. package/client/pages/inbound/unload-product.js +67 -72
  7. package/client/pages/inventory/inventory-adjustment-approval.js +5 -4
  8. package/client/pages/inventory/inventory-adjustment.js +0 -7
  9. package/client/pages/inventory-check/check-inventory-popup.js +1 -4
  10. package/client/pages/inventory-check/create-cycle-count.js +3 -2
  11. package/client/pages/inventory-check/cycle-count-report.js +32 -19
  12. package/client/pages/inventory-check/inspecting-product.js +14 -30
  13. package/client/pages/inventory-check/inventory-check-list.js +0 -2
  14. package/client/pages/manifest/loading-manifest-detail.js +4 -7
  15. package/client/pages/master/generate-location-list.js +22 -30
  16. package/client/pages/master/location-list.js +71 -134
  17. package/client/pages/master/pallet-list.js +58 -137
  18. package/client/pages/master/product/product-details-popup.js +3 -3
  19. package/client/pages/master/tote-list.js +27 -40
  20. package/client/pages/master/transport-driver.js +41 -50
  21. package/client/pages/master/transport-vehicle.js +41 -45
  22. package/client/pages/master/warehouse-list.js +34 -56
  23. package/client/pages/order/arrival-notice/arrival-notice-detail.js +25 -36
  24. package/client/pages/order/arrival-notice/create-arrival-notice.js +32 -53
  25. package/client/pages/order/arrival-notice/duplicate-arrival-notice.js +0 -2
  26. package/client/pages/order/arrival-notice/edit-product-popup.js +7 -9
  27. package/client/pages/order/draft-release-good/draft-release-good-detail.js +2 -39
  28. package/client/pages/order/goods-received-note/received-note-list.js +32 -9
  29. package/client/pages/order/release-order/create-release-order.js +5 -22
  30. package/client/pages/order/release-order/release-extra-product-popup.js +1 -4
  31. package/client/pages/order/release-order/release-order-detail.js +0 -24
  32. package/client/pages/order/return-order/create-return-order.js +0 -5
  33. package/client/pages/order/return-order/return-order-inventory-popup.js +0 -1
  34. package/client/pages/order/transport-order/delivery-order-list.js +0 -26
  35. package/client/pages/outbound/inventory-reassign-popup.js +0 -6
  36. package/client/pages/outbound/packing-product.js +5 -5
  37. package/client/pages/outbound/packing-worksheet-list.js +1 -3
  38. package/client/pages/outbound/picking-product.js +7 -22
  39. package/client/pages/outbound/show-my-worksheet-list-popup.js +3 -12
  40. package/client/pages/outbound/show-ro-list-popup.js +0 -2
  41. package/client/pages/outbound/sorting-product.js +0 -6
  42. package/client/pages/report/custom-elccl/elccl-daily-collection-report.js +2 -5
  43. package/client/pages/report/custom-elccl/elccl-daily-order-inventory-report.js +2 -2
  44. package/client/pages/report/custom-elccl/elccl-delivery-order-summary.js +8 -48
  45. package/client/pages/vas/print-product-label.js +11 -13
  46. package/dist-server/graphql/resolvers/custom/elccl/elccl-inventory-history-report.js +5 -4
  47. package/dist-server/graphql/resolvers/custom/elccl/elccl-inventory-history-report.js.map +1 -1
  48. package/dist-server/graphql/resolvers/other/add-release-good-products.js +11 -7
  49. package/dist-server/graphql/resolvers/other/add-release-good-products.js.map +1 -1
  50. package/dist-server/graphql/resolvers/reports/costing-report.js +24 -18
  51. package/dist-server/graphql/resolvers/reports/costing-report.js.map +1 -1
  52. package/dist-server/graphql/resolvers/reports/inbound-order-details-report.js +6 -6
  53. package/dist-server/graphql/resolvers/reports/outbound-order-details-report.js +6 -5
  54. package/dist-server/graphql/resolvers/reports/outbound-order-details-report.js.map +1 -1
  55. package/dist-server/graphql/resolvers/reports/release-inventory-report.js +3 -3
  56. package/dist-server/graphql/resolvers/reports/release-inventory-report.js.map +1 -1
  57. package/package.json +50 -50
  58. package/server/graphql/resolvers/custom/elccl/elccl-inventory-history-report.ts +5 -4
  59. package/server/graphql/resolvers/other/add-release-good-products.ts +12 -8
  60. package/server/graphql/resolvers/reports/costing-report.ts +24 -18
  61. package/server/graphql/resolvers/reports/inbound-order-details-report.ts +6 -6
  62. package/server/graphql/resolvers/reports/outbound-order-details-report.ts +6 -5
  63. package/server/graphql/resolvers/reports/release-inventory-report.ts +4 -6
  64. package/translations/en.json +5 -18
  65. package/translations/ko.json +4 -17
  66. package/translations/ms.json +4 -17
  67. package/translations/zh.json +4 -17
  68. package/config.development.js +0 -110
@@ -23,14 +23,12 @@ class BulkOperation extends localize(i18next)(PageView) {
23
23
  display: block;
24
24
  --menu-cards-size: 300px;
25
25
  }
26
-
27
26
  ul {
28
27
  margin: var(--margin-wide) 0;
29
28
  padding: 0;
30
29
  overflow: hidden;
31
30
  list-style: none;
32
31
  }
33
-
34
32
  li {
35
33
  display: block;
36
34
  float: left;
@@ -42,17 +40,14 @@ class BulkOperation extends localize(i18next)(PageView) {
42
40
  padding: var(--padding-default) var(--padding-default) var(--padding-narrow) var(--padding-default);
43
41
  text-align: center;
44
42
  }
45
-
46
43
  li:hover {
47
44
  border: 1px solid var(--primary-color);
48
45
  }
49
-
50
46
  a {
51
47
  cursor: pointer;
52
48
  text-decoration: none;
53
49
  color: var(--secondary-color);
54
50
  }
55
-
56
51
  mwc-icon {
57
52
  font-size: 18px;
58
53
  color: var(--primary-color);
@@ -60,14 +55,12 @@ class BulkOperation extends localize(i18next)(PageView) {
60
55
  border-radius: var(--border-radius);
61
56
  background-color: var(--theme-white-color);
62
57
  }
63
-
64
58
  a,
65
59
  span {
66
60
  overflow: hidden;
67
61
  white-space: nowrap;
68
62
  text-overflow: ellipsis;
69
63
  }
70
-
71
64
  [subtitle] {
72
65
  padding: var(--subtitle-padding);
73
66
  font: var(--subtitle-font);
@@ -77,28 +70,23 @@ class BulkOperation extends localize(i18next)(PageView) {
77
70
  justify-content: center;
78
71
  align-items: center;
79
72
  }
80
-
81
73
  form {
82
74
  display: block;
83
75
  width: var(--menu-cards-size);
84
76
  }
85
-
86
77
  .multi-column-form input {
87
78
  min-width: 85% !important;
88
79
  }
89
-
90
80
  [attachment-wrap] {
91
81
  display: flex;
92
82
  flex-direction: row;
93
83
  justify-content: center;
94
84
  grid-column: span 24;
95
85
  }
96
-
97
86
  [attachment-wrap] file-uploader {
98
87
  flex: 1;
99
88
  background-color: var(--theme-white-color);
100
89
  }
101
-
102
90
  .button-container {
103
91
  padding: var(--button-container-padding);
104
92
  margin: var(--button-container-margin);
@@ -106,7 +94,6 @@ class BulkOperation extends localize(i18next)(PageView) {
106
94
  background-color: var(--button-container-background);
107
95
  height: var(--button-container-height);
108
96
  }
109
-
110
97
  @media screen and (max-width: 600px) {
111
98
  ul {
112
99
  display: grid;
@@ -117,7 +104,6 @@ class BulkOperation extends localize(i18next)(PageView) {
117
104
  grid-column: span 2;
118
105
  }
119
106
  }
120
-
121
107
  @media screen and (max-width: 460px) {
122
108
  [attachment-wrap] {
123
109
  grid-column: span 12;
@@ -170,12 +156,13 @@ class BulkOperation extends localize(i18next)(PageView) {
170
156
  }
171
157
 
172
158
  get _ganData() {
159
+ let date = (new Date().getMonth() + 1).toString() + '-' + new Date().getDate().toString() + '-' + new Date().getFullYear()
173
160
  return [
174
161
  {
175
162
  refNo: '',
176
163
  refNo2: '',
177
164
  refNo3: '',
178
- etaDate: new Date(),
165
+ etaDate: date,
179
166
  truckNo: '',
180
167
  containerNo: '',
181
168
  containerSize: '',
@@ -189,7 +176,7 @@ class BulkOperation extends localize(i18next)(PageView) {
189
176
  uom: '',
190
177
  packQty: 0,
191
178
  palletQty: 0,
192
- manufactureDate: new Date(),
179
+ manufactureDate: '',
193
180
  unitPrice: ''
194
181
  }
195
182
  ]
@@ -268,7 +255,6 @@ class BulkOperation extends localize(i18next)(PageView) {
268
255
  >
269
256
  </div>
270
257
  </li>
271
-
272
258
  <li>
273
259
  <div subtitle>
274
260
  Release Order &nbsp;
@@ -276,7 +262,6 @@ class BulkOperation extends localize(i18next)(PageView) {
276
262
  <mwc-icon>file_download</mwc-icon>
277
263
  </a>
278
264
  </div>
279
-
280
265
  <form name="input-form" class="multi-column-form" autocomplete="off">
281
266
  <fieldset>
282
267
  <div attachment-wrap>
@@ -302,7 +287,6 @@ class BulkOperation extends localize(i18next)(PageView) {
302
287
  </div>
303
288
  </fieldset>
304
289
  </form>
305
-
306
290
  <div class="button-container">
307
291
  <mwc-button raised @click=${async () => await this._extractRawDataFromExcel(this._roDocument, 'RO')}
308
292
  >${i18next.t('button.validate')}</mwc-button
@@ -406,10 +390,8 @@ class BulkOperation extends localize(i18next)(PageView) {
406
390
  .records=${records.map(raw => {
407
391
  // let etaDate = new Date((raw.etaDate - (25567 + 1)) * 86400 * 1000 || null)
408
392
  // let mfgDate = new Date((raw.manufactureDate - (25567 + 1)) * 86400 * 1000 || null)
409
-
410
393
  let etaDate = new Date(String(raw.etaDate || ''))
411
394
  let mfgDate = new Date(String(raw.manufactureDate || ''))
412
-
413
395
  return {
414
396
  refNo: String(raw.refNo || ''),
415
397
  refNo2: String(raw.refNo2 || ''),
@@ -458,7 +440,6 @@ class BulkOperation extends localize(i18next)(PageView) {
458
440
  <validate-ro-popup
459
441
  .records=${records.map(record => {
460
442
  let releaseDate = new Date(String(record.releaseDate || ''))
461
-
462
443
  return {
463
444
  refNo: String(record.refNo || ''),
464
445
  refNo2: String(record.refNo2 || ''),
@@ -474,7 +455,6 @@ class BulkOperation extends localize(i18next)(PageView) {
474
455
  country: String(record.country || ''),
475
456
  sku: String(record.sku || ''),
476
457
  productId: String(record.productId || ''),
477
- productDetailId: String(record.productDetailId || ''),
478
458
  packingType: record.packingType && record.packingType != '' ? String(record.packingType) : null,
479
459
  packingSize: !isNaN(Number(record.packingSize || 'x')) ? Number(record.packingSize) : null,
480
460
  uom: record.uom && record.uom != '' ? String(record.uom) : null,
@@ -446,7 +446,6 @@ class SelectInventoryPopUp extends localize(i18next)(LitElement) {
446
446
  items {
447
447
  id
448
448
  productId
449
- productDetailId
450
449
  batchId
451
450
  batchIdRef
452
451
  groupType
@@ -494,7 +493,6 @@ class SelectInventoryPopUp extends localize(i18next)(LitElement) {
494
493
  palletId
495
494
  cartonId
496
495
  productId
497
- productDetailId
498
496
  productSKU
499
497
  productName
500
498
  productBrand
@@ -542,6 +540,7 @@ class SelectInventoryPopUp extends localize(i18next)(LitElement) {
542
540
  this.dispatchEvent(
543
541
  new CustomEvent('selected', {
544
542
  detail: {
543
+ productDetailId: selectedProduct.id,
545
544
  packingType: selectedProduct.packingType,
546
545
  uom: selectedProduct.uom,
547
546
  uomValue: selectedProduct.uomValue,
@@ -556,9 +555,6 @@ class SelectInventoryPopUp extends localize(i18next)(LitElement) {
556
555
  packingSize: selectedProduct.packingSize,
557
556
  primaryUnit: selectedProduct.uom,
558
557
  primaryValue: selectedProduct.uomValue
559
- },
560
- productDetail: {
561
- id: selectedProduct.productDetailId
562
558
  }
563
559
  }
564
560
  })
@@ -586,7 +582,6 @@ class SelectInventoryPopUp extends localize(i18next)(LitElement) {
586
582
  remainQty: itm.remainQty,
587
583
  remainUomValueWithUom: itm.remainUomValueWithUom,
588
584
  productId: itm.productId,
589
- productDetailId: itm.productDetailId,
590
585
  remainUomValue: itm.remainUomValue,
591
586
  batchId: itm.batchId,
592
587
  batchIdRef: itm.batchIdRef,
@@ -608,7 +603,6 @@ class SelectInventoryPopUp extends localize(i18next)(LitElement) {
608
603
  remainQty: itm.remainQty,
609
604
  remainUomValueWithUom: itm.remainUomValueWithUom,
610
605
  productId: itm.productId,
611
- productDetailId: itm.productDetailId,
612
606
  remainUomValue: itm.remainUomValue,
613
607
  batchId: itm.batchId,
614
608
  batchIdRef: itm.batchIdRef,
@@ -121,8 +121,7 @@ class SelectProductPopup extends localize(i18next)(LitElement) {
121
121
  pagination: { pages: [10, 20, 50, 100] },
122
122
  rows: {
123
123
  appendable: false,
124
- selectable: { multiple: this.selectMultipleProducts ? this.selectMultipleProducts : false },
125
- handlers: { dblclick: this._dblClickHandler.bind(this) }
124
+ selectable: { multiple: this.selectMultipleProducts ? this.selectMultipleProducts : false }
126
125
  },
127
126
  columns: [
128
127
  { type: 'gutter', gutterName: 'sequence' },
@@ -230,7 +229,6 @@ class SelectProductPopup extends localize(i18next)(LitElement) {
230
229
  response.data.productDetails.items.map(item => {
231
230
  return {
232
231
  ...item,
233
- productName: item.product.name,
234
232
  productId: item.product.id,
235
233
  sku: item.product.sku,
236
234
  brand: item.product.brand,
@@ -242,34 +240,7 @@ class SelectProductPopup extends localize(i18next)(LitElement) {
242
240
  }
243
241
  }
244
242
 
245
- _dblClickHandler(columns, data, column, record, rowIndex, target) {
246
- if (this.selectMultipleProducts) return
247
- this.dispatchEvent(
248
- new CustomEvent('selected', {
249
- detail: {
250
- productDetailId: record.id,
251
- packingType: record.packingType,
252
- uom: record.uom,
253
- uomValue: record.uomValue,
254
- productName: `${record.name}(${record.description}(${record.sku}))`,
255
- isError: false,
256
- productBrand: record.brand,
257
- product: {
258
- id: record.productId,
259
- name: record.name,
260
- sku: record.sku,
261
- packingType: record.packingType,
262
- packingSize: record.packingSize,
263
- primaryUnit: record.uom,
264
- primaryValue: record.uomValue
265
- }
266
- }
267
- })
268
- )
269
- history.back()
270
- }
271
-
272
- selectProduct(record) {
243
+ selectProduct() {
273
244
  if (this.selectMultipleProducts !== true) {
274
245
  const selectedProduct = this.productGrist.selected[0]
275
246
  if (selectedProduct) {
@@ -202,8 +202,11 @@ class UndoPutawayPopup extends connect(store)(localize(i18next)(LitElement)) {
202
202
  async _undoPutaway() {
203
203
  try {
204
204
  let selectedInventories = []
205
- selectedInventories = this.dataGrist.selected
206
-
205
+ if (this._autoSelectInventory?.length) {
206
+ selectedInventories = this._autoSelectInventory
207
+ } else {
208
+ selectedInventories = this.dataGrist.selected
209
+ }
207
210
  if (!selectedInventories?.length) throw new Error(i18next.t('text.select_at_least_one_inventory_to_undo'))
208
211
 
209
212
  this._validateScanInventory()
@@ -247,11 +250,12 @@ class UndoPutawayPopup extends connect(store)(localize(i18next)(LitElement)) {
247
250
  this.lotInput.value = ''
248
251
  }
249
252
  this._showToast({ message: i18next.t('text.no_matching_putaway_inventory_found') })
253
+ } else if (targetedUndoInventories?.length == 1) {
254
+ this.data = { records: targetedUndoInventories }
255
+ this._autoSelectInventory = targetedUndoInventories
256
+ this._undoPutaway()
250
257
  } else {
251
258
  this.data = { records: targetedUndoInventories }
252
- if (targetedUndoInventories?.length == 1) {
253
- this.data.records[0].__selected__ = true
254
- }
255
259
  }
256
260
  }
257
261
  }
@@ -1,12 +1,22 @@
1
1
  import '@things-factory/grist-ui'
2
2
 
3
3
  import gql from 'graphql-tag'
4
- import { css, html, LitElement } from 'lit-element'
4
+ import {
5
+ css,
6
+ html,
7
+ LitElement
8
+ } from 'lit-element'
5
9
  import { connect } from 'pwa-helpers/connect-mixin'
6
10
 
7
11
  import { SingleColumnFormStyles } from '@things-factory/form-ui'
8
- import { i18next, localize } from '@things-factory/i18n-base'
9
- import { client, store, CustomAlert } from '@things-factory/shell'
12
+ import {
13
+ i18next,
14
+ localize
15
+ } from '@things-factory/i18n-base'
16
+ import {
17
+ client,
18
+ store
19
+ } from '@things-factory/shell'
10
20
  import { isMobileDevice } from '@things-factory/utils'
11
21
 
12
22
  class UndoUnloadPopup extends connect(store)(localize(i18next)(LitElement)) {
@@ -19,13 +29,15 @@ class UndoUnloadPopup extends connect(store)(localize(i18next)(LitElement)) {
19
29
  enableProductScanning: Boolean,
20
30
  orderType: String,
21
31
  orderNo: String,
22
- unloadedInventories: Array
32
+ unloadedInventories: Array,
33
+ _isExecuting: Boolean
23
34
  }
24
35
  }
25
36
 
26
37
  constructor() {
27
38
  super()
28
39
  this._selectedRecords = []
40
+ this._isExecuting= false
29
41
  }
30
42
 
31
43
  static get styles() {
@@ -123,7 +135,7 @@ class UndoUnloadPopup extends connect(store)(localize(i18next)(LitElement)) {
123
135
  </div>
124
136
 
125
137
  <div class="button-container">
126
- <mwc-button raised @click="${this._undoUnloading.bind(this)}" label="${i18next.t('button.undo')}"></mwc-button>
138
+ <mwc-button raised @click="${this._undoUnloading.bind(this)}" label="${i18next.t('button.undo')}" ?disabled=${this._isExecuting}></mwc-button>
127
139
  </div>
128
140
  `
129
141
  }
@@ -214,16 +226,8 @@ class UndoUnloadPopup extends connect(store)(localize(i18next)(LitElement)) {
214
226
 
215
227
  async _undoUnloading() {
216
228
  try {
217
- if (this.dataGrist.selected.some(s => s.inventoryItems?.length > 0)) {
218
- const result = await CustomAlert({
219
- title: i18next.t('title.are_you_sure'),
220
- text: i18next.t('text.all_related_serial_number_will_be_deleted'),
221
- confirmButton: { text: i18next.t('button.confirm') },
222
- cancelButton: { text: i18next.t('button.cancel') }
223
- })
224
-
225
- if (!result.value) return
226
- }
229
+ if(!this._isExecuting){
230
+ this._isExecuting = true
227
231
  let selectedInventoryIds = []
228
232
  selectedInventoryIds = this.dataGrist.selected.map(inventory => inventory.id)
229
233
 
@@ -243,9 +247,13 @@ class UndoUnloadPopup extends connect(store)(localize(i18next)(LitElement)) {
243
247
  if (!response.errors) {
244
248
  this.dispatchEvent(new CustomEvent('undo-inventory'))
245
249
  }
250
+ }
246
251
  } catch (e) {
247
252
  this._showToast(e)
253
+ }finally {
254
+ this._isExecuting = false
248
255
  }
256
+
249
257
  }
250
258
 
251
259
  _populateTargetedInventory(e) {
@@ -277,10 +285,7 @@ class UndoUnloadPopup extends connect(store)(localize(i18next)(LitElement)) {
277
285
  return { ...itm, sku: itm.product.sku }
278
286
  })
279
287
  }
280
- if (targetedUndoInventories?.length == 1) {
281
- this._selectedRecords = targetedUndoInventories
282
- this.data.records[0].__selected__ = true
283
- }
288
+ this._selectedRecords = targetedUndoInventories?.length == 1 ? targetedUndoInventories : []
284
289
  }
285
290
  } catch (e) {
286
291
  this._showToast(e)
@@ -576,7 +576,6 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
576
576
  description
577
577
  isRequiredCheckExpiry
578
578
  isRequireSerialNumberScanningInbound
579
- expirationPeriod
580
579
  }
581
580
  name
582
581
  targetName
@@ -700,7 +699,6 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
700
699
  sku
701
700
  isRequiredCheckExpiry
702
701
  isRequireSerialNumberScanningInbound
703
- expirationPeriod
704
702
  }
705
703
  inventory {
706
704
  id
@@ -727,7 +725,6 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
727
725
  this._orderNo = orderNo
728
726
  const worksheetInfo = response.data.unloadingReturnWorksheet.worksheetInfo
729
727
  this._worksheetInfo = worksheetInfo
730
- this._bizplaceName = worksheetInfo?.bizplaceName
731
728
 
732
729
  this.orderProductData = {
733
730
  records: orderBy(
@@ -787,9 +784,6 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
787
784
  id
788
785
  name
789
786
  }
790
- inventoryItems {
791
- serialNumber
792
- }
793
787
  }
794
788
  }
795
789
  `,
@@ -873,19 +867,16 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
873
867
  try {
874
868
  if (!this._enableCartonLabel) return this._unloadSelected()
875
869
  let orderProducts = await this._validateUnloading()
876
-
877
- if (!orderProducts || !orderProducts.errors) {
878
- if (orderProducts?.length > 1) {
879
- this.selectOrderProduct(orderProducts)
870
+ if (orderProducts?.length > 1) {
871
+ this.selectOrderProduct(orderProducts)
872
+ } else {
873
+ if (this._isRequireSerialNumberScanningInbound) {
874
+ return this._scanSerialNumberUnload()
880
875
  } else {
881
- if (this._isRequireSerialNumberScanningInbound) {
882
- return this._scanSerialNumberUnload()
883
- } else {
884
- if (!(this._enableProductScanning && (this._enableInputQty < 0 || this._enableInputQty > 3)))
885
- return this._qtyUnload()
886
- }
887
- this._scanProductUnload()
876
+ if (!(this._enableProductScanning && (this._enableInputQty < 0 || this._enableInputQty > 3)))
877
+ return this._qtyUnload()
888
878
  }
879
+ this._scanProductUnload()
889
880
  }
890
881
  } catch (e) {
891
882
  this._showToast(e)
@@ -1117,72 +1108,74 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
1117
1108
  }
1118
1109
 
1119
1110
  async _checkedScannedProduct() {
1120
- //fetch any product details that has entered gtin
1121
- const response = await this.fetchProductDetails(this.productBarcodeInput?.value.trim() || '', '')
1111
+ try {
1112
+ //fetch any product details that has entered gtin
1113
+ const response = await this.fetchProductDetails(this.productBarcodeInput?.value || '', '')
1122
1114
 
1123
- if (!response.errors) {
1124
- let orderProductData = this.orderProductData.records
1125
- let checkedProductDetails = response.data.checkGtin.items
1126
-
1127
- //check from grist if any is matched
1128
- const foundOrderProducts = orderProductData.filter(op => {
1129
- return checkedProductDetails.some(
1130
- itm =>
1131
- itm.product.id == op.product.id && itm.packingType == op.packingType && itm.packingSize == op.packingSize
1132
- )
1133
- })
1115
+ if (!response.errors) {
1116
+ let orderProductData = this.orderProductData.records
1117
+ let checkedProductDetails = response.data.checkGtin.items
1118
+
1119
+ //check from grist if any is matched
1120
+ const foundOrderProducts = orderProductData.filter(op => {
1121
+ return checkedProductDetails.some(
1122
+ itm =>
1123
+ itm.product.id == op.product.id && itm.packingType == op.packingType && itm.packingSize == op.packingSize
1124
+ )
1125
+ })
1134
1126
 
1135
- const foundParentProducts = orderProductData.filter(op => {
1136
- return checkedProductDetails.some(itm => itm.product.id == op.product.id)
1137
- })
1127
+ const foundParentProducts = orderProductData.filter(op => {
1128
+ return checkedProductDetails.some(itm => itm.product.id == op.product.id)
1129
+ })
1138
1130
 
1139
- if (!foundOrderProducts?.length) {
1140
- if (!foundParentProducts?.length) {
1141
- if (this._enableInputQty >= 0 && this._enableInputQty < 4 && !this._isRequireSerialNumberScanningInbound) {
1142
- if (this.actualQtyInput?.value) this.actualQtyInput.value = ''
1143
- }
1131
+ if (!foundOrderProducts?.length) {
1132
+ if (!foundParentProducts?.length) {
1133
+ if (this._enableInputQty >= 0 && this._enableInputQty < 4 && !this._isRequireSerialNumberScanningInbound) {
1134
+ if (this.actualQtyInput?.value) this.actualQtyInput.value = ''
1135
+ }
1144
1136
 
1145
- if (this._isRequireSerialNumberScanningInbound) {
1146
- if (this.serialNumberInput?.value) this.serialNumberInput.value = ''
1147
- }
1137
+ if (this._isRequireSerialNumberScanningInbound) {
1138
+ if (this.serialNumberInput?.value) this.serialNumberInput.value = ''
1139
+ }
1148
1140
 
1149
- this.productBarcodeInput.value = ''
1150
- this._focusOnProductBarcodeInput()
1151
- throw new Error(i18next.t('text.no_matching_product_found'))
1141
+ this.productBarcodeInput.value = ''
1142
+ this._focusOnProductBarcodeInput()
1143
+ throw new Error(i18next.t('text.no_matching_product_found'))
1144
+ }
1152
1145
  }
1153
- }
1154
1146
 
1155
- const product =
1156
- foundOrderProducts?.length >= 1
1157
- ? foundOrderProducts[0].product
1158
- : foundOrderProducts?.length == 0 && foundParentProducts?.length > 0
1159
- ? foundParentProducts[0].product
1160
- : null
1147
+ const product =
1148
+ foundOrderProducts?.length >= 1
1149
+ ? foundOrderProducts[0].product
1150
+ : foundOrderProducts?.length == 0 && foundParentProducts?.length > 0
1151
+ ? foundParentProducts[0].product
1152
+ : null
1161
1153
 
1162
- if (this._selectedOrderProduct && this._selectedOrderProduct.product.sku !== product.sku)
1163
- this._selectedOrderProduct = null
1154
+ if (this._selectedOrderProduct && this._selectedOrderProduct.product.sku !== product.sku)
1155
+ this._selectedOrderProduct = null
1164
1156
 
1165
- if (foundOrderProducts?.length > 1) {
1166
- if (this._isRequireSerialNumberScanningInbound) {
1167
- if (!this._selectedOrderProduct) {
1157
+ if (foundOrderProducts?.length > 1) {
1158
+ if (this._isRequireSerialNumberScanningInbound) {
1159
+ if (!this._selectedOrderProduct) {
1160
+ return foundOrderProducts
1161
+ }
1162
+ } else {
1168
1163
  return foundOrderProducts
1169
1164
  }
1170
- } else {
1171
- return foundOrderProducts
1165
+ } else if (foundOrderProducts?.length == 1) {
1166
+ this._expirationPeriod = product.expirationPeriod
1167
+ this._isRequiredCheckExpiry = product.isRequiredCheckExpiry
1168
+ this._isRequireSerialNumberScanningInbound = product.isRequireSerialNumberScanningInbound
1169
+ this._selectedOrderProduct = foundOrderProducts[0]
1170
+ } else if (foundOrderProducts?.length == 0 && foundParentProducts?.length > 0) {
1171
+ this._expirationPeriod = product.expirationPeriod
1172
+ this._isRequiredCheckExpiry = product.isRequiredCheckExpiry
1173
+ this._isRequireSerialNumberScanningInbound = product.isRequireSerialNumberScanningInbound
1174
+ this._selectedOrderProduct = foundParentProducts[0]
1172
1175
  }
1173
- } else if (foundOrderProducts?.length == 1) {
1174
- this._expirationPeriod = product.expirationPeriod
1175
- this._isRequiredCheckExpiry = product.isRequiredCheckExpiry
1176
- this._isRequireSerialNumberScanningInbound = product.isRequireSerialNumberScanningInbound
1177
- this._selectedOrderProduct = foundOrderProducts[0]
1178
- } else if (foundOrderProducts?.length == 0 && foundParentProducts?.length > 0) {
1179
- this._expirationPeriod = product.expirationPeriod
1180
- this._isRequiredCheckExpiry = product.isRequiredCheckExpiry
1181
- this._isRequireSerialNumberScanningInbound = product.isRequireSerialNumberScanningInbound
1182
- this._selectedOrderProduct = foundParentProducts[0]
1183
1176
  }
1184
- } else {
1185
- return response
1177
+ } catch (e) {
1178
+ this._showToast(e)
1186
1179
  }
1187
1180
  }
1188
1181
 
@@ -1299,7 +1292,9 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
1299
1292
  }
1300
1293
  }
1301
1294
 
1302
- return orderProducts
1295
+ if (orderProducts?.length > 1) {
1296
+ return orderProducts
1297
+ }
1303
1298
  }
1304
1299
  }
1305
1300
 
@@ -1498,7 +1493,7 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
1498
1493
  await this._validateUnloading()
1499
1494
  await this._checkedLotScannedProduct()
1500
1495
 
1501
- if (this._isRequireSerialNumberScanningInbound) return this._scanSerialNumberUnload()
1496
+ if (this._isRequireSerialNumberScanningInbound) this._scanSerialNumberUnload()
1502
1497
  this._qtyUnload()
1503
1498
  } catch (e) {
1504
1499
  this._showToast(e)
@@ -8,7 +8,7 @@ import { connect } from 'pwa-helpers/connect-mixin'
8
8
 
9
9
  import { getCodeByName } from '@things-factory/code-base'
10
10
  import { i18next, localize } from '@things-factory/i18n-base'
11
- import { client, PageView, store, gqlContext } from '@things-factory/shell'
11
+ import { client, PageView, store,gqlContext } from '@things-factory/shell'
12
12
  import { CommonButtonStyles, ScrollbarStyles } from '@things-factory/styles'
13
13
  import { isMobileDevice } from '@things-factory/utils'
14
14
  import { openPopup } from '@things-factory/layout-base'
@@ -142,7 +142,8 @@ class InventoryAdjustmentApproval extends connect(store)(localize(i18next)(PageV
142
142
  { column: 'manufactureDate', name: 'Mfg. Date' },
143
143
  { column: 'unitCost', name: 'Unit Cost' },
144
144
  { column: 'inventoryItemChange', name: 'Inventory Item Changes' },
145
- { column: 'status', name: 'Status' }
145
+ { column: 'status', name: 'Status' },
146
+
146
147
  ]
147
148
 
148
149
  this.config = {
@@ -199,7 +200,7 @@ class InventoryAdjustmentApproval extends connect(store)(localize(i18next)(PageV
199
200
 
200
201
  if (item.column == 'status' && record.transactionType == 'MISSING') {
201
202
  updatedVal = record.transactionType || '[N/A]'
202
- } else if (item.column == 'status') {
203
+ }else if(item.column == 'status'){
203
204
  updatedVal = '[N/A]'
204
205
  }
205
206
 
@@ -691,4 +692,4 @@ class InventoryAdjustmentApproval extends connect(store)(localize(i18next)(PageV
691
692
  }
692
693
  }
693
694
 
694
- window.customElements.define('inventory-adjustment-approval', InventoryAdjustmentApproval)
695
+ window.customElements.define('inventory-adjustment-approval', InventoryAdjustmentApproval)
@@ -586,9 +586,6 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
586
586
  isRequireSerialNumberScanningOutbound
587
587
  isRequireSerialNumberScanningInbound
588
588
  }
589
- productDetail {
590
- id
591
- }
592
589
  qty
593
590
  lockedQty
594
591
  warehouse {
@@ -657,9 +654,6 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
657
654
  description
658
655
  productInformation
659
656
  }
660
- productDetail {
661
- id
662
- }
663
657
  qty
664
658
  lockedQty
665
659
  warehouse {
@@ -904,7 +898,6 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
904
898
 
905
899
  row.bizplace = row.bizplace ? { id: row.bizplace.id } : undefined
906
900
  row.location = row.location ? { id: row.location.id } : undefined
907
- row.productDetailId = row.product ? row.product.id : undefined
908
901
  row.product = row.product ? { id: row.product.productId } : undefined
909
902
  row.uomValue = row.uomValue ? parseFloat(row.uomValue) : undefined
910
903
  row.unitCost = row.unitCost ? parseFloat(row.unitCost) : undefined