@things-factory/operato-wms 5.0.13 → 6.0.0-alpha.1

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 (206) hide show
  1. package/client/pages/bulk-operation/bulk-operation.js +96 -8
  2. package/client/pages/bulk-operation/validate-gan-popup.js +37 -27
  3. package/client/pages/bulk-operation/validate-ro-popup.js +40 -0
  4. package/client/pages/components/select-inventory-popup.js +633 -0
  5. package/client/pages/constants/order.js +2 -1
  6. package/client/pages/inbound/pallet-label-popup.js +2 -0
  7. package/client/pages/inbound/select-product-batch.js +7 -1
  8. package/client/pages/inbound/undo-unload-popup.js +37 -21
  9. package/client/pages/inbound/unload-product.js +147 -59
  10. package/client/pages/inbound/worksheet-putaway.js +1 -1
  11. package/client/pages/inbound/worksheet-unloading.js +11 -7
  12. package/client/pages/inventory/inventory-adjustment.js +261 -238
  13. package/client/pages/inventory/inventory-by-product-detail.js +99 -92
  14. package/client/pages/inventory/inventory-by-product.js +170 -68
  15. package/client/pages/inventory/onhand-inventory.js +10 -12
  16. package/client/pages/inventory/serial-number-list-popup.js +36 -5
  17. package/client/pages/inventory-check/inspecting-product.js +1 -1
  18. package/client/pages/manifest/create-loading-manifest.js +47 -22
  19. package/client/pages/manifest/dispatcher-verification-popup.js +24 -13
  20. package/client/pages/manifest/loading-manifest-detail.js +311 -46
  21. package/client/pages/manifest/loading-manifest-list.js +86 -13
  22. package/client/pages/order/arrival-notice/arrival-notice-detail.js +305 -52
  23. package/client/pages/order/arrival-notice/arrival-notice-list.js +20 -1
  24. package/client/pages/order/arrival-notice/create-arrival-notice.js +2 -2
  25. package/client/pages/order/goods-received-note/received-note-detail.js +187 -15
  26. package/client/pages/order/release-order/b2b/b2b-order-list.js +76 -80
  27. package/client/pages/order/release-order/b2c/b2c-order-requests.js +148 -123
  28. package/client/pages/order/release-order/batch-picking-popup.js +11 -0
  29. package/client/pages/order/release-order/create-release-order.js +762 -250
  30. package/client/pages/order/release-order/release-extra-product-popup.js +10 -3
  31. package/client/pages/order/release-order/release-order-detail.js +897 -215
  32. package/client/pages/order/transport-order/delivery-note-popup.js +1050 -107
  33. package/client/pages/order/transport-order/print-delivery-note.js +214 -33
  34. package/client/pages/order/transport-order/upload-delivery-note.js +6 -4
  35. package/client/pages/order/transport-order/view-delivery-note.js +0 -1
  36. package/client/pages/outbound/generate-worksheet-popup.js +374 -0
  37. package/client/pages/outbound/inventory-reassign-popup.js +1097 -0
  38. package/client/pages/outbound/loading-product.js +88 -78
  39. package/client/pages/outbound/merged-outbound-worksheet.js +1 -1
  40. package/client/pages/outbound/packing-product.js +193 -82
  41. package/client/pages/outbound/packing-worksheet-list.js +10 -9
  42. package/client/pages/outbound/picking-product.js +979 -905
  43. package/client/pages/outbound/route-label-popup.js +283 -191
  44. package/client/pages/outbound/serial-number-popup.js +1 -0
  45. package/client/pages/outbound/sorting-product.js +12 -12
  46. package/client/pages/outbound/worksheet-batch-picking.js +39 -5
  47. package/client/pages/outbound/worksheet-packing.js +17 -4
  48. package/client/pages/outbound/worksheet-picking.js +45 -6
  49. package/client/pages/report/inbound-serial-number-report.js +86 -9
  50. package/client/pages/report/inventory-report.js +10 -0
  51. package/client/pages/report/inventory-summary-report.js +28 -19
  52. package/client/pages/report/outbound-order-details-report.js +204 -43
  53. package/client/pages/report/outbound-serial-number-report.js +87 -9
  54. package/client/pages/report/release-inventory-report.js +503 -0
  55. package/client/route.js +5 -0
  56. package/client/util/index.js +2 -0
  57. package/client/util/page-settings.js +43 -0
  58. package/client/util/toast.js +10 -0
  59. package/dist-server/graphql/resolvers/board-setting/board-settings.js +3 -3
  60. package/dist-server/graphql/resolvers/board-setting/board-settings.js.map +1 -1
  61. package/dist-server/graphql/resolvers/custom/elccl/elccl-daily-collection-report.js +2 -2
  62. package/dist-server/graphql/resolvers/custom/elccl/elccl-daily-collection-report.js.map +1 -1
  63. package/dist-server/graphql/resolvers/custom/elccl/elccl-daily-order-inventory-report.js +1 -1
  64. package/dist-server/graphql/resolvers/custom/elccl/elccl-daily-order-inventory-report.js.map +1 -1
  65. package/dist-server/graphql/resolvers/custom/elccl/elccl-inventory-history-pallet-detail-report.js +2 -2
  66. package/dist-server/graphql/resolvers/custom/elccl/elccl-inventory-history-pallet-detail-report.js.map +1 -1
  67. package/dist-server/graphql/resolvers/custom/elccl/elccl-inventory-history-report.js +9 -10
  68. package/dist-server/graphql/resolvers/custom/elccl/elccl-inventory-history-report.js.map +1 -1
  69. package/dist-server/graphql/resolvers/custom/elccl/elccl-inventory-history-summary-report.js +2 -2
  70. package/dist-server/graphql/resolvers/custom/elccl/elccl-inventory-history-summary-report.js.map +1 -1
  71. package/dist-server/graphql/resolvers/custom/elccl/elccl-onhand-inventory-counter.js +6 -4
  72. package/dist-server/graphql/resolvers/custom/elccl/elccl-onhand-inventory-counter.js.map +1 -1
  73. package/dist-server/graphql/resolvers/custom/kimeda/kimeda-onhand-inventory-counter.js +6 -4
  74. package/dist-server/graphql/resolvers/custom/kimeda/kimeda-onhand-inventory-counter.js.map +1 -1
  75. package/dist-server/graphql/resolvers/dashboard/arrival-notices-by-status.js +21 -10
  76. package/dist-server/graphql/resolvers/dashboard/arrival-notices-by-status.js.map +1 -1
  77. package/dist-server/graphql/resolvers/dashboard/collection-orders-by-status.js +1 -2
  78. package/dist-server/graphql/resolvers/dashboard/collection-orders-by-status.js.map +1 -1
  79. package/dist-server/graphql/resolvers/dashboard/delivery-orders-by-status.js +1 -2
  80. package/dist-server/graphql/resolvers/dashboard/delivery-orders-by-status.js.map +1 -1
  81. package/dist-server/graphql/resolvers/dashboard/index.js +2 -1
  82. package/dist-server/graphql/resolvers/dashboard/index.js.map +1 -1
  83. package/dist-server/graphql/resolvers/dashboard/inventory-expiry-monitor.js +17 -1
  84. package/dist-server/graphql/resolvers/dashboard/inventory-expiry-monitor.js.map +1 -1
  85. package/dist-server/graphql/resolvers/dashboard/outbound-order-by-status.js +113 -75
  86. package/dist-server/graphql/resolvers/dashboard/outbound-order-by-status.js.map +1 -1
  87. package/dist-server/graphql/resolvers/dashboard/release-goods-by-status.js +21 -10
  88. package/dist-server/graphql/resolvers/dashboard/release-goods-by-status.js.map +1 -1
  89. package/dist-server/graphql/resolvers/dashboard/unit-inbounded-outbounded.js +56 -0
  90. package/dist-server/graphql/resolvers/dashboard/unit-inbounded-outbounded.js.map +1 -0
  91. package/dist-server/graphql/resolvers/index.js +5 -4
  92. package/dist-server/graphql/resolvers/index.js.map +1 -1
  93. package/dist-server/graphql/resolvers/inventory-comparison/inventory-comparison-list.js.map +1 -1
  94. package/dist-server/graphql/resolvers/opa-menu/opa-menus.js +8 -7
  95. package/dist-server/graphql/resolvers/opa-menu/opa-menus.js.map +1 -1
  96. package/dist-server/graphql/resolvers/{extra → other}/add-release-good-products.js +59 -8
  97. package/dist-server/graphql/resolvers/other/add-release-good-products.js.map +1 -0
  98. package/dist-server/graphql/resolvers/{extra → other}/index.js +3 -1
  99. package/dist-server/graphql/resolvers/other/index.js.map +1 -0
  100. package/dist-server/graphql/resolvers/other/page-settings.js +87 -0
  101. package/dist-server/graphql/resolvers/other/page-settings.js.map +1 -0
  102. package/dist-server/graphql/resolvers/reports/costing-report.js +4 -4
  103. package/dist-server/graphql/resolvers/reports/costing-report.js.map +1 -1
  104. package/dist-server/graphql/resolvers/reports/inbound-order-details-report.js +3 -3
  105. package/dist-server/graphql/resolvers/reports/inbound-order-details-report.js.map +1 -1
  106. package/dist-server/graphql/resolvers/reports/inbound-serial-number-report.js +36 -7
  107. package/dist-server/graphql/resolvers/reports/inbound-serial-number-report.js.map +1 -1
  108. package/dist-server/graphql/resolvers/reports/index.js +2 -1
  109. package/dist-server/graphql/resolvers/reports/index.js.map +1 -1
  110. package/dist-server/graphql/resolvers/reports/outbound-order-details-report.js +69 -30
  111. package/dist-server/graphql/resolvers/reports/outbound-order-details-report.js.map +1 -1
  112. package/dist-server/graphql/resolvers/reports/outbound-serial-number-report.js +36 -11
  113. package/dist-server/graphql/resolvers/reports/outbound-serial-number-report.js.map +1 -1
  114. package/dist-server/graphql/resolvers/reports/product-label-report.js +3 -3
  115. package/dist-server/graphql/resolvers/reports/product-label-report.js.map +1 -1
  116. package/dist-server/graphql/resolvers/reports/release-inventory-report.js +180 -0
  117. package/dist-server/graphql/resolvers/reports/release-inventory-report.js.map +1 -0
  118. package/dist-server/graphql/resolvers/shipping-provider/shipping-providers.js +2 -2
  119. package/dist-server/graphql/resolvers/shipping-provider/shipping-providers.js.map +1 -1
  120. package/dist-server/graphql/resolvers/warehouse-inventory-adjustment/warehouse-intentory-adjustment.js +1 -1
  121. package/dist-server/graphql/resolvers/warehouse-inventory-adjustment/warehouse-intentory-adjustment.js.map +1 -1
  122. package/dist-server/graphql/types/dashboard/index.js +1 -0
  123. package/dist-server/graphql/types/dashboard/index.js.map +1 -1
  124. package/dist-server/graphql/types/index.js +7 -2
  125. package/dist-server/graphql/types/index.js.map +1 -1
  126. package/dist-server/graphql/types/other/index.js +19 -0
  127. package/dist-server/graphql/types/other/index.js.map +1 -0
  128. package/dist-server/graphql/types/other/page-setting.js +34 -0
  129. package/dist-server/graphql/types/other/page-setting.js.map +1 -0
  130. package/dist-server/graphql/types/reports/index.js +6 -1
  131. package/dist-server/graphql/types/reports/index.js.map +1 -1
  132. package/dist-server/graphql/types/reports/outbound-order-details-report.js +17 -1
  133. package/dist-server/graphql/types/reports/outbound-order-details-report.js.map +1 -1
  134. package/dist-server/graphql/types/reports/release-inventory-report-list.js +12 -0
  135. package/dist-server/graphql/types/reports/release-inventory-report-list.js.map +1 -0
  136. package/dist-server/graphql/types/reports/release-inventory-report.js +27 -0
  137. package/dist-server/graphql/types/reports/release-inventory-report.js.map +1 -0
  138. package/dist-server/migrations/1568858861188-SeedSetting.js +5 -6
  139. package/dist-server/migrations/1568858861188-SeedSetting.js.map +1 -1
  140. package/dist-server/migrations/1623308919899-SeedLocationRecommendSetting.js +1 -1
  141. package/dist-server/migrations/1623308919899-SeedLocationRecommendSetting.js.map +1 -1
  142. package/dist-server/migrations/1623381200659-SeedStoringRule.js +1 -1
  143. package/dist-server/migrations/1623381200659-SeedStoringRule.js.map +1 -1
  144. package/dist-server/tsconfig.tsbuildinfo +1 -1
  145. package/dist-server/utils/report-query-util.js +5 -2
  146. package/dist-server/utils/report-query-util.js.map +1 -1
  147. package/helps/release-note.ko.md +8 -20
  148. package/helps/release-note.md +8 -20
  149. package/helps/release-note.ms.md +8 -20
  150. package/helps/release-note.zh.md +8 -20
  151. package/package.json +42 -42
  152. package/server/graphql/resolvers/board-setting/board-settings.ts +4 -6
  153. package/server/graphql/resolvers/custom/elccl/elccl-daily-collection-report.ts +4 -5
  154. package/server/graphql/resolvers/custom/elccl/elccl-daily-order-inventory-report.ts +9 -10
  155. package/server/graphql/resolvers/custom/elccl/elccl-inventory-history-pallet-detail-report.ts +4 -5
  156. package/server/graphql/resolvers/custom/elccl/elccl-inventory-history-report.ts +17 -19
  157. package/server/graphql/resolvers/custom/elccl/elccl-inventory-history-summary-report.ts +10 -8
  158. package/server/graphql/resolvers/custom/elccl/elccl-onhand-inventory-counter.ts +9 -9
  159. package/server/graphql/resolvers/custom/kimeda/kimeda-onhand-inventory-counter.ts +9 -9
  160. package/server/graphql/resolvers/dashboard/arrival-notices-by-status.ts +23 -14
  161. package/server/graphql/resolvers/dashboard/collection-orders-by-status.ts +4 -5
  162. package/server/graphql/resolvers/dashboard/delivery-orders-by-status.ts +4 -5
  163. package/server/graphql/resolvers/dashboard/index.ts +3 -1
  164. package/server/graphql/resolvers/dashboard/inventory-expiry-monitor.ts +18 -6
  165. package/server/graphql/resolvers/dashboard/outbound-order-by-status.ts +114 -81
  166. package/server/graphql/resolvers/dashboard/release-goods-by-status.ts +23 -14
  167. package/server/graphql/resolvers/dashboard/unit-inbounded-outbounded.ts +61 -0
  168. package/server/graphql/resolvers/index.ts +5 -4
  169. package/server/graphql/resolvers/inventory-comparison/inventory-comparison-list.ts +11 -9
  170. package/server/graphql/resolvers/opa-menu/opa-menus.ts +7 -6
  171. package/server/graphql/resolvers/{extra → other}/add-release-good-products.ts +73 -12
  172. package/server/graphql/resolvers/other/index.ts +10 -0
  173. package/server/graphql/resolvers/other/page-settings.ts +105 -0
  174. package/server/graphql/resolvers/reports/costing-report.ts +8 -10
  175. package/server/graphql/resolvers/reports/inbound-order-details-report.ts +7 -9
  176. package/server/graphql/resolvers/reports/inbound-serial-number-report.ts +41 -13
  177. package/server/graphql/resolvers/reports/index.ts +3 -1
  178. package/server/graphql/resolvers/reports/outbound-order-details-report.ts +76 -38
  179. package/server/graphql/resolvers/reports/outbound-serial-number-report.ts +42 -18
  180. package/server/graphql/resolvers/reports/product-label-report.ts +4 -6
  181. package/server/graphql/resolvers/reports/release-inventory-report.ts +201 -0
  182. package/server/graphql/resolvers/shipping-provider/shipping-providers.ts +3 -5
  183. package/server/graphql/resolvers/warehouse-inventory-adjustment/warehouse-intentory-adjustment.ts +10 -10
  184. package/server/graphql/types/dashboard/index.ts +1 -0
  185. package/server/graphql/types/index.ts +8 -2
  186. package/server/graphql/types/other/index.ts +19 -0
  187. package/server/graphql/types/other/page-setting.ts +33 -0
  188. package/server/graphql/types/reports/index.ts +6 -1
  189. package/server/graphql/types/reports/outbound-order-details-report.ts +17 -1
  190. package/server/graphql/types/reports/release-inventory-report-list.ts +8 -0
  191. package/server/graphql/types/reports/release-inventory-report.ts +23 -0
  192. package/server/migrations/1568858861188-SeedSetting.ts +4 -4
  193. package/server/migrations/1623308919899-SeedLocationRecommendSetting.ts +3 -2
  194. package/server/migrations/1623381200659-SeedStoringRule.ts +3 -2
  195. package/server/utils/report-query-util.ts +5 -2
  196. package/things-factory.config.js +4 -0
  197. package/translations/en.json +148 -27
  198. package/translations/ko.json +185 -105
  199. package/translations/ms.json +183 -98
  200. package/translations/zh.json +197 -112
  201. package/dist-server/graphql/resolvers/extra/add-release-good-products.js.map +0 -1
  202. package/dist-server/graphql/resolvers/extra/index.js.map +0 -1
  203. package/dist-server/graphql/types/extra/index.js +0 -11
  204. package/dist-server/graphql/types/extra/index.js.map +0 -1
  205. package/server/graphql/resolvers/extra/index.ts +0 -5
  206. package/server/graphql/types/extra/index.ts +0 -7
@@ -12,8 +12,7 @@ import { isMobileDevice } from '@things-factory/utils'
12
12
  class UndoUnloadPopup extends connect(store)(localize(i18next)(LitElement)) {
13
13
  static get properties() {
14
14
  return {
15
- _autoSelectInventoryIds: Array,
16
- _selectedInventoryIds: Array,
15
+ _selectedRecords: Array,
17
16
  config: Object,
18
17
  data: Object,
19
18
  enableCartonLabel: Boolean,
@@ -26,8 +25,7 @@ class UndoUnloadPopup extends connect(store)(localize(i18next)(LitElement)) {
26
25
 
27
26
  constructor() {
28
27
  super()
29
- this._selectedInventoryIds = []
30
- this._autoSelectInventoryIds = []
28
+ this._selectedRecords = []
31
29
  }
32
30
 
33
31
  static get styles() {
@@ -96,13 +94,21 @@ class UndoUnloadPopup extends connect(store)(localize(i18next)(LitElement)) {
96
94
 
97
95
  render() {
98
96
  return html`
99
- <form id="input-form" class="single-column-form" @keypress="${this._populateTargetedInventory.bind(this)}">
97
+ <form id="input-form" class="single-column-form">
100
98
  <fieldset>
101
99
  ${this.enableCartonLabel
102
100
  ? html`<label>${i18next.t('label.carton_id')}</label>
103
- <barcode-scanable-input name="cartonId" without-enter custom-input></barcode-scanable-input>`
101
+ <barcode-scanable-input
102
+ name="cartonId"
103
+ custom-input
104
+ @keypress="${this._populateTargetedInventory.bind(this)}"
105
+ ></barcode-scanable-input>`
104
106
  : html`<label>${i18next.t('label.lot_id')}</label>
105
- <barcode-scanable-input name="lotId" without-enter custom-input></barcode-scanable-input>`}
107
+ <barcode-scanable-input
108
+ name="lotId"
109
+ custom-input
110
+ @keypress="${this._populateTargetedInventory.bind(this)}"
111
+ ></barcode-scanable-input>`}
106
112
  </fieldset>
107
113
  </form>
108
114
 
@@ -112,6 +118,7 @@ class UndoUnloadPopup extends connect(store)(localize(i18next)(LitElement)) {
112
118
  .mode=${isMobileDevice() ? 'LIST' : 'GRID'}
113
119
  .config=${this.config}
114
120
  .data="${this.data}"
121
+ .selectedRecords=${this._selectedRecords}
115
122
  ></data-grist>
116
123
  </div>
117
124
 
@@ -125,7 +132,9 @@ class UndoUnloadPopup extends connect(store)(localize(i18next)(LitElement)) {
125
132
  this.config = {
126
133
  pagination: { infinite: true },
127
134
  rows: { selectable: { multiple: true }, appendable: false },
128
- list: { fields: ['palletId', 'cartonId', 'batchId', 'product', 'packingType', 'packingSize', 'qty', 'status'] },
135
+ list: {
136
+ fields: ['palletId', 'cartonId', 'batchId', 'sku', 'product', 'packingType', 'packingSize', 'qty', 'status']
137
+ },
129
138
  columns: [
130
139
  { type: 'gutter', gutterName: 'sequence' },
131
140
  { type: 'gutter', gutterName: 'row-selector', multiple: true },
@@ -151,6 +160,13 @@ class UndoUnloadPopup extends connect(store)(localize(i18next)(LitElement)) {
151
160
  header: i18next.t('field.batch_id'),
152
161
  width: 150
153
162
  },
163
+ {
164
+ type: 'string',
165
+ name: 'sku',
166
+ label: true,
167
+ header: i18next.t('field.sku'),
168
+ width: 120
169
+ },
154
170
  {
155
171
  type: 'object',
156
172
  name: 'product',
@@ -199,11 +215,8 @@ class UndoUnloadPopup extends connect(store)(localize(i18next)(LitElement)) {
199
215
  async _undoUnloading() {
200
216
  try {
201
217
  let selectedInventoryIds = []
202
- if (this._autoSelectInventoryIds?.length) {
203
- selectedInventoryIds = this._autoSelectInventoryIds
204
- } else {
205
- selectedInventoryIds = this.dataGrist.selected.map(inventory => inventory.id)
206
- }
218
+ selectedInventoryIds = this.dataGrist.selected.map(inventory => inventory.id)
219
+
207
220
  if (!selectedInventoryIds?.length) throw new Error(i18next.t('text.select_at_least_one_inventory_to_undo'))
208
221
 
209
222
  this._validateScanInventory()
@@ -226,9 +239,9 @@ class UndoUnloadPopup extends connect(store)(localize(i18next)(LitElement)) {
226
239
  }
227
240
 
228
241
  _populateTargetedInventory(e) {
229
- if (e.keyCode === 13) {
230
- e.preventDefault()
231
-
242
+ if (e.keyCode !== 13) return
243
+ e.preventDefault()
244
+ try {
232
245
  let targetedUndoInventories = []
233
246
 
234
247
  if (this.enableCartonLabel) {
@@ -248,13 +261,16 @@ class UndoUnloadPopup extends connect(store)(localize(i18next)(LitElement)) {
248
261
  this.lotInput.value = ''
249
262
  }
250
263
  this._showToast({ message: i18next.t('text.no_matching_unloaded_inventory_found') })
251
- } else if (targetedUndoInventories?.length == 1) {
252
- this.data = { records: targetedUndoInventories }
253
- this._autoSelectInventoryIds = targetedUndoInventories.map(inventory => inventory.id)
254
- this._undoUnloading()
255
264
  } else {
256
- this.data = { records: targetedUndoInventories }
265
+ this.data = {
266
+ records: targetedUndoInventories.map(itm => {
267
+ return { ...itm, sku: itm.product.sku }
268
+ })
269
+ }
270
+ this._selectedRecords = targetedUndoInventories?.length == 1 ? targetedUndoInventories : []
257
271
  }
272
+ } catch (e) {
273
+ this._showToast(e)
258
274
  }
259
275
  }
260
276
 
@@ -35,7 +35,7 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
35
35
  _enableProductScanning: Boolean,
36
36
  _expirationPeriod: Number,
37
37
  _enableCartonLabel: Boolean,
38
- _enableInputQty: Boolean,
38
+ _enableInputQty: Number,
39
39
  _isLooseItem: Boolean,
40
40
  _isQtyChecked: Boolean,
41
41
  _isRequiredCheckExpiry: Boolean,
@@ -274,7 +274,7 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
274
274
  <barcode-scanable-input name="productBarcode" without-enter custom-input></barcode-scanable-input>
275
275
  `
276
276
  : ''}
277
- ${this._enableInputQty && !this._isRequireSerialNumberScanningInbound
277
+ ${this._enableInputQty >= 0 && this._enableInputQty < 4 && !this._isRequireSerialNumberScanningInbound
278
278
  ? html`
279
279
  <label>${i18next.t('label.actual_qty')}</label>
280
280
  <input name="qty" type="number" min="1" />
@@ -322,7 +322,7 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
322
322
  this._worksheetLoaded = false
323
323
  this._usingReusablePallet = false
324
324
  this._enableCartonLabel = false
325
- this._enableInputQty = true
325
+ this._enableInputQty = 0
326
326
  this._enableProductScanning = false
327
327
  this._expirationPeriod = 0
328
328
  this._isLooseItem = false
@@ -644,11 +644,24 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
644
644
  records: worksheetDetailInfo
645
645
  }
646
646
 
647
- if (!this._selectedOrderProduct) {
648
- this._selectedOrderProduct = worksheetDetailInfo[0]
649
- this._isRequiredCheckExpiry = worksheetDetailInfo[0].product?.isRequiredCheckExpiry
650
- this._isRequireSerialNumberScanningInbound =
651
- worksheetDetailInfo[0].product?.isRequireSerialNumberScanningInbound
647
+ if (this._selectedOrderProduct) {
648
+ let quantityTally = worksheetDetailInfo.filter(
649
+ itm => itm.id == this._selectedOrderProduct.id && itm.actualPackQty == itm.packQty
650
+ )
651
+ if (quantityTally?.length == 1) {
652
+ this._selectedOrderProduct = null
653
+ if (this._isRequireSerialNumberScanningInbound) {
654
+ this.serialNumberInput.value = ''
655
+ if (this._enableCartonLabel) {
656
+ this.cartonInput.value = ''
657
+ this.productBarcodeInput.value = ''
658
+ this._focusOnCartonInput()
659
+ } else {
660
+ this.lotInput.value = ''
661
+ this._focusOnLotInput()
662
+ }
663
+ }
664
+ }
652
665
  }
653
666
 
654
667
  const partnerDomainId = worksheetInfo.partnerDomainId
@@ -656,7 +669,7 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
656
669
  this._enableProductScanning = await fetchSettingRule('enable-product-scanning', partnerDomainId)
657
670
  this._enableCartonLabel = await fetchSettingRule('enable-carton-label', partnerDomainId)
658
671
  if (this._enableProductScanning)
659
- this._enableInputQty = await fetchSettingRule('enable-input-qty', partnerDomainId)
672
+ this._enableInputQty = parseInt(await fetchSettingRule('enable-input-qty', partnerDomainId))
660
673
 
661
674
  this._fetchInventories()
662
675
  }
@@ -803,23 +816,29 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
803
816
 
804
817
  if (this._enableCartonLabel) {
805
818
  if (this._isRequireSerialNumberScanningInbound) {
806
- this.serialNumberInput.value = ''
807
- this._focusOnSerialNumberInput()
819
+ if (this.cartonInput.value == '') {
820
+ this._focusOnCartonInput()
821
+ } else {
822
+ this.serialNumberInput.value = ''
823
+ this._focusOnSerialNumberInput()
824
+ }
808
825
  } else {
809
- if (this._enableInputQty) {
826
+ if (this._enableInputQty >= 0 && this._enableInputQty < 4) {
810
827
  this.actualQtyInput.value = ''
811
- this.cartonInput.value = ''
812
- this._focusOnCartonInput()
813
828
  }
829
+ this.cartonInput.value = ''
830
+ this._focusOnCartonInput()
814
831
  }
815
832
  } else {
816
- if (this._isRequireSerialNumberScanningInbound) {
817
- this.serialNumberInput.value = ''
818
- this._focusOnSerialNumberInput()
819
- } else {
820
- this.lotInput.value = ''
821
- if (this._enableInputQty) this.actualQtyInput.value = ''
822
- this._focusOnLotInput()
833
+ if (this.lotInput.value !== '') {
834
+ if (this._isRequireSerialNumberScanningInbound) {
835
+ this.serialNumberInput.value = ''
836
+ this._focusOnSerialNumberInput()
837
+ } else {
838
+ this.lotInput.value = ''
839
+ if (this._enableInputQty >= 0 && this._enableInputQty < 4) this.actualQtyInput.value = ''
840
+ this._focusOnLotInput()
841
+ }
823
842
  }
824
843
  }
825
844
 
@@ -847,14 +866,18 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
847
866
  e.preventDefault()
848
867
  try {
849
868
  if (!this._enableCartonLabel) return this._unloadSelected()
850
- await this._validateUnloading()
851
-
852
- if (this._isRequireSerialNumberScanningInbound) {
853
- return this._scanSerialNumberUnload()
869
+ let orderProducts = await this._validateUnloading()
870
+ if (orderProducts?.length > 1) {
871
+ this.selectOrderProduct(orderProducts)
854
872
  } else {
855
- if (!(this._enableProductScanning && !this._enableInputQty)) return this._qtyUnload()
873
+ if (this._isRequireSerialNumberScanningInbound) {
874
+ return this._scanSerialNumberUnload()
875
+ } else {
876
+ if (!(this._enableProductScanning && (this._enableInputQty < 0 || this._enableInputQty > 3)))
877
+ return this._qtyUnload()
878
+ }
879
+ this._scanProductUnload()
856
880
  }
857
- this._scanProductUnload()
858
881
  } catch (e) {
859
882
  this._showToast(e)
860
883
  }
@@ -890,7 +913,7 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
890
913
  inventory: {
891
914
  palletId: this._enableCartonLabel ? null : this.lotInput.value.trim(),
892
915
  cartonId: this._enableCartonLabel ? this.cartonInput.value.trim() : null,
893
- expirationDate: this.expDateInput?.value ? this.expDateInput.value : null
916
+ expirationDate: this._isRequiredCheckExpiry ? this.expDateInput.value : null
894
917
  }
895
918
  }
896
919
  })
@@ -917,6 +940,7 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
917
940
 
918
941
  if (this.serialNumberInput.value == '') {
919
942
  this._scanning = false
943
+ this._focusOnSerialNumberInput()
920
944
  return this._showToast({ message: i18next.t('text.enter_serial_number') })
921
945
  }
922
946
 
@@ -946,7 +970,7 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
946
970
  inventory: {
947
971
  palletId: this._enableCartonLabel ? null : this.lotInput.value.trim(),
948
972
  cartonId: this._enableCartonLabel ? this.cartonInput.value.trim() : null,
949
- expirationDate: this.expDateInput?.value ? this.expDateInput.value : null
973
+ expirationDate: this._isRequiredCheckExpiry ? this.expDateInput.value : null
950
974
  }
951
975
  }
952
976
  })
@@ -1044,6 +1068,37 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
1044
1068
  })
1045
1069
  }
1046
1070
 
1071
+ async fetchProductDetails(gtin) {
1072
+ return await client.query({
1073
+ query: gql`
1074
+ query checkGtin($gtin: String!, $customerCompanyDomainId: String!) {
1075
+ checkGtin(gtin: $gtin, customerCompanyDomainId: $customerCompanyDomainId) {
1076
+ items {
1077
+ id
1078
+ name
1079
+ packingType
1080
+ packingSize
1081
+ gtin
1082
+ product {
1083
+ id
1084
+ name
1085
+ sku
1086
+ isRequiredCheckExpiry
1087
+ isRequireSerialNumberScanningInbound
1088
+ expirationPeriod
1089
+ }
1090
+ }
1091
+ total
1092
+ }
1093
+ }
1094
+ `,
1095
+ variables: {
1096
+ gtin,
1097
+ customerCompanyDomainId: this.customerCompanyDomainId
1098
+ }
1099
+ })
1100
+ }
1101
+
1047
1102
  //need to enhance
1048
1103
  async _checkedLotScannedProduct() {
1049
1104
  const response = await this.fetchProductDetail('', this._selectedOrderProduct.product.id)
@@ -1054,23 +1109,28 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
1054
1109
 
1055
1110
  async _checkedScannedProduct() {
1056
1111
  try {
1057
- const response = await this.fetchProductDetail(this.productBarcodeInput?.value || '', '')
1112
+ //fetch any product details that has entered gtin
1113
+ const response = await this.fetchProductDetails(this.productBarcodeInput?.value || '', '')
1058
1114
 
1059
1115
  if (!response.errors) {
1060
- const { product, packingSize, packingType } = response.data.productDetail
1061
- const foundOrderProducts = this.orderProductData.records.filter(
1062
- orderProduct =>
1063
- orderProduct.product.id === product.id &&
1064
- orderProduct.packingType === packingType &&
1065
- orderProduct.packingSize === packingSize
1066
- )
1067
- const foundParentProducts = this.orderProductData.records.filter(
1068
- orderProduct => orderProduct.product.id === product.id
1069
- )
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
+ })
1126
+
1127
+ const foundParentProducts = orderProductData.filter(op => {
1128
+ return checkedProductDetails.some(itm => itm.product.id == op.product.id)
1129
+ })
1070
1130
 
1071
1131
  if (!foundOrderProducts?.length) {
1072
1132
  if (!foundParentProducts?.length) {
1073
- if (this._enableInputQty && !this._isRequireSerialNumberScanningInbound) {
1133
+ if (this._enableInputQty >= 0 && this._enableInputQty < 4 && !this._isRequireSerialNumberScanningInbound) {
1074
1134
  if (this.actualQtyInput?.value) this.actualQtyInput.value = ''
1075
1135
  }
1076
1136
 
@@ -1083,21 +1143,35 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
1083
1143
  throw new Error(i18next.t('text.no_matching_product_found'))
1084
1144
  }
1085
1145
  }
1086
- this._expirationPeriod = product.expirationPeriod
1087
- this._isRequiredCheckExpiry = product.isRequiredCheckExpiry
1088
- this._isRequireSerialNumberScanningInbound = product.isRequireSerialNumberScanningInbound
1146
+
1147
+ const product =
1148
+ foundOrderProducts?.length >= 1
1149
+ ? foundOrderProducts[0].product
1150
+ : foundOrderProducts?.length == 0 && foundParentProducts?.length > 0
1151
+ ? foundParentProducts[0].product
1152
+ : null
1089
1153
 
1090
1154
  if (this._selectedOrderProduct && this._selectedOrderProduct.product.sku !== product.sku)
1091
1155
  this._selectedOrderProduct = null
1092
1156
 
1093
- if (!this._selectedOrderProduct) {
1094
- if (foundOrderProducts?.length > 1) {
1095
- this.selectOrderProduct(foundOrderProducts)
1096
- } else if (foundOrderProducts?.length == 1) {
1097
- this._selectedOrderProduct = foundOrderProducts[0]
1098
- } else if (foundOrderProducts?.length == 0 && foundParentProducts?.length > 0) {
1099
- this._selectedOrderProduct = foundParentProducts[0]
1157
+ if (foundOrderProducts?.length > 1) {
1158
+ if (this._isRequireSerialNumberScanningInbound) {
1159
+ if (!this._selectedOrderProduct) {
1160
+ return foundOrderProducts
1161
+ }
1162
+ } else {
1163
+ return foundOrderProducts
1100
1164
  }
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]
1101
1175
  }
1102
1176
  }
1103
1177
  } catch (e) {
@@ -1112,14 +1186,22 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
1112
1186
  .orderProducts="${orderProducts}"
1113
1187
  @selected-batch="${async e => {
1114
1188
  this._selectedOrderProduct = e.detail
1115
-
1189
+ this._expirationPeriod = this._selectedOrderProduct.product.expirationPeriod
1190
+ this._isRequiredCheckExpiry = this._selectedOrderProduct.product.isRequiredCheckExpiry
1191
+ this._isRequireSerialNumberScanningInbound =
1192
+ this._selectedOrderProduct.product.isRequireSerialNumberScanningInbound
1116
1193
  if (e.detail.product.isRequireSerialNumberScanningInbound) {
1194
+ this._isRequireSerialNumberScanningInbound = true
1195
+ if (!this.serialNumberInput.value) {
1196
+ this._focusOnSerialNumberInput()
1197
+ this._showToast(Error(i18next.t('text.serial_number_is_empty')))
1198
+ }
1117
1199
  await this._scanSerialNumberUnload()
1118
1200
  } else {
1119
- if (this._enableProductScanning && !this._enableInputQty) {
1201
+ if (this._enableProductScanning && (this._enableInputQty < 0 || this._enableInputQty > 3)) {
1120
1202
  await this._scanProductUnload()
1121
1203
  } else {
1122
- this._focusOnActualQtyInput()
1204
+ await this._qtyUnload()
1123
1205
  }
1124
1206
  }
1125
1207
  }}"
@@ -1182,9 +1264,9 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
1182
1264
  throw new Error(i18next.t('text.scan_product_barcode'))
1183
1265
  }
1184
1266
 
1185
- await this._checkedScannedProduct()
1267
+ let orderProducts = await this._checkedScannedProduct()
1186
1268
 
1187
- if (this._enableInputQty && !this._isRequireSerialNumberScanningInbound) {
1269
+ if (this._enableInputQty >= 0 && this._enableInputQty < 4 && !this._isRequireSerialNumberScanningInbound) {
1188
1270
  if (!parseInt(this.actualQtyInput.value)) {
1189
1271
  this._focusOnActualQtyInput()
1190
1272
  throw new Error(i18next.t('text.enter_qty'))
@@ -1195,9 +1277,11 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
1195
1277
  throw new Error(i18next.t('text.qty_should_be_positive'))
1196
1278
  }
1197
1279
  } else if (this._isRequireSerialNumberScanningInbound) {
1198
- if (!this.serialNumberInput.value) {
1199
- this._focusOnSerialNumberInput()
1200
- throw new Error(i18next.t('text.enter_serial_number'))
1280
+ if (this.serialNumberInput) {
1281
+ if (!this.serialNumberInput.value) {
1282
+ this._focusOnSerialNumberInput()
1283
+ throw new Error(i18next.t('text.enter_serial_number'))
1284
+ }
1201
1285
  }
1202
1286
  }
1203
1287
 
@@ -1207,6 +1291,10 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
1207
1291
  throw new Error(i18next.t('text.expiry_date_is_empty'))
1208
1292
  }
1209
1293
  }
1294
+
1295
+ if (orderProducts?.length > 1) {
1296
+ return orderProducts
1297
+ }
1210
1298
  }
1211
1299
  }
1212
1300
 
@@ -485,7 +485,7 @@ class WorksheetPutaway extends localize(i18next)(PageView) {
485
485
  const currentLocationColumn = {
486
486
  type: 'object',
487
487
  name: 'location',
488
- header: i18next.t('field.current_location'),
488
+ header: i18next.t('field.location'),
489
489
  width: 170
490
490
  }
491
491
  const statusColumnConfig = {
@@ -17,7 +17,7 @@ import { i18next, localize } from '@things-factory/i18n-base'
17
17
  import { openPopup } from '@things-factory/layout-base'
18
18
  import { client, CustomAlert, navigate, PageView } from '@things-factory/shell'
19
19
  import { CommonButtonStyles } from '@things-factory/styles'
20
- import { isMobileDevice } from '@things-factory/utils'
20
+ import { isMobileDevice, sleep } from '@things-factory/utils'
21
21
 
22
22
  import { fetchSettingRule } from '../../fetch-setting-value'
23
23
  import {
@@ -253,7 +253,7 @@ class WorksheetUnloading extends localize(i18next)(PageView) {
253
253
  // await this.fetchVas()
254
254
  // await this.fetchOrderVas()
255
255
  this.updateContext()
256
- this._updateGristConfig()
256
+ await this._updateGristConfig()
257
257
  }
258
258
  }
259
259
 
@@ -435,6 +435,7 @@ class WorksheetUnloading extends localize(i18next)(PageView) {
435
435
  }
436
436
  ]
437
437
  }
438
+ this.config = this.preConfig
438
439
  }
439
440
 
440
441
  updated(changedProps) {
@@ -723,7 +724,7 @@ class WorksheetUnloading extends localize(i18next)(PageView) {
723
724
  })
724
725
  }
725
726
 
726
- _updateGristConfig() {
727
+ async _updateGristConfig() {
727
728
  const statusColumnConfig = {
728
729
  type: 'string',
729
730
  name: 'status',
@@ -886,7 +887,7 @@ class WorksheetUnloading extends localize(i18next)(PageView) {
886
887
 
887
888
  await this.fetchWorksheet()
888
889
  this.updateContext()
889
- this._updateGristConfig()
890
+ await this._updateGristConfig()
890
891
  }
891
892
  } catch (e) {
892
893
  this._showToast(e)
@@ -935,7 +936,8 @@ class WorksheetUnloading extends localize(i18next)(PageView) {
935
936
  })
936
937
  }
937
938
 
938
- _openLotLabelPrintPopup() {
939
+ async _openLotLabelPrintPopup() {
940
+ await sleep(1010)
939
941
  const _pallets = {
940
942
  records: this.data.records.map(record => {
941
943
  return {
@@ -957,7 +959,8 @@ class WorksheetUnloading extends localize(i18next)(PageView) {
957
959
  })
958
960
  }
959
961
 
960
- _openCartonLabelPrintPopup() {
962
+ async _openCartonLabelPrintPopup() {
963
+ await sleep(1010)
961
964
  openPopup(html` <carton-label-popup .bizplaceName="${this._bizplace}"></carton-label-popup> `, {
962
965
  backdrop: true,
963
966
  size: 'small',
@@ -965,7 +968,8 @@ class WorksheetUnloading extends localize(i18next)(PageView) {
965
968
  })
966
969
  }
967
970
 
968
- _showPutawayWorksheetPopup() {
971
+ async _showPutawayWorksheetPopup() {
972
+ await sleep(1010)
969
973
  openPopup(
970
974
  html`
971
975
  <putaway-worksheet-generate-popup