@things-factory/operato-wms 4.0.9 → 4.0.13

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 (160) hide show
  1. package/client/pages/adjustment/transfer-inventory.js +368 -165
  2. package/client/pages/billing/claim-chit/claim-chit-list.js +7 -6
  3. package/client/pages/bulk-operation/bulk-operation.js +316 -0
  4. package/client/pages/bulk-operation/validate-ro-popup.js +445 -0
  5. package/client/pages/components/select-product-popup.js +15 -2
  6. package/client/pages/constants/inventory.js +1 -0
  7. package/client/pages/constants/location.js +33 -6
  8. package/client/pages/constants/order.js +10 -0
  9. package/client/pages/constants/worksheet.js +2 -2
  10. package/client/pages/inbound/inbound-worksheet.js +78 -9
  11. package/client/pages/inbound/putaway-product.js +214 -139
  12. package/client/pages/inbound/putaway-worksheet-generate-popup.js +24 -2
  13. package/client/pages/inbound/unload-product.js +149 -76
  14. package/client/pages/inbound/worksheet-putaway-return.js +22 -5
  15. package/client/pages/inbound/worksheet-putaway.js +21 -8
  16. package/client/pages/inbound/worksheet-unloading-return.js +22 -5
  17. package/client/pages/inbound/worksheet-unloading.js +8 -0
  18. package/client/pages/inventory/inventory-adjustment-approval.js +11 -19
  19. package/client/pages/inventory/inventory-adjustment.js +136 -101
  20. package/client/pages/inventory/inventory-by-product-detail.js +3 -5
  21. package/client/pages/inventory/inventory-by-product.js +8 -0
  22. package/client/pages/inventory/inventory-history-by-pallet.js +12 -5
  23. package/client/pages/inventory/inventory-history.js +14 -5
  24. package/client/pages/inventory/onhand-inventory.js +11 -2
  25. package/client/pages/inventory-check/create-cycle-count.js +12 -6
  26. package/client/pages/inventory-check/cycle-count-report.js +8 -0
  27. package/client/pages/inventory-check/inspecting-product.js +146 -80
  28. package/client/pages/inventory-check/worksheet-cycle-count.js +14 -0
  29. package/client/pages/manifest/create-loading-manifest.js +314 -0
  30. package/client/pages/manifest/dispatcher-verification-popup.js +86 -0
  31. package/client/pages/manifest/loading-manifest-detail.js +345 -0
  32. package/client/pages/manifest/loading-manifest-list.js +305 -0
  33. package/client/pages/master/location-list.js +58 -17
  34. package/client/pages/master/product/product-detail-bizplace-setting-popup.js +2 -2
  35. package/client/pages/master/product/product-details-popup.js +2 -2
  36. package/client/pages/master/product/product-list.js +5 -5
  37. package/client/pages/order/arrival-notice/arrival-notice-detail.js +134 -115
  38. package/client/pages/order/arrival-notice/arrival-notice-list.js +87 -6
  39. package/client/pages/order/arrival-notice/arrival-notice-requests.js +83 -6
  40. package/client/pages/order/arrival-notice/assign-buffer-location.js +8 -1
  41. package/client/pages/order/arrival-notice/check-arrived-notice.js +9 -1
  42. package/client/pages/order/arrival-notice/create-arrival-notice.js +38 -3
  43. package/client/pages/order/arrival-notice/duplicate-arrival-notice.js +290 -25
  44. package/client/pages/order/arrival-notice/edit-product-popup.js +36 -5
  45. package/client/pages/order/arrival-notice/receive-arrival-notice.js +8 -1
  46. package/client/pages/order/goods-received-note/received-note-list.js +138 -6
  47. package/client/pages/order/release-order/b2b/b2b-order-list.js +45 -5
  48. package/client/pages/order/release-order/b2b/b2b-order-requests.js +52 -12
  49. package/client/pages/order/release-order/b2c/b2c-order-requests.js +244 -24
  50. package/client/pages/order/release-order/bulk-print-packing-list.js +23 -0
  51. package/client/pages/order/release-order/create-release-order.js +55 -8
  52. package/client/pages/order/release-order/receive-release-order-request.js +35 -24
  53. package/client/pages/order/release-order/release-extra-product-popup.js +204 -63
  54. package/client/pages/order/release-order/release-order-detail.js +301 -74
  55. package/client/pages/order/return-order/check-return-order.js +9 -1
  56. package/client/pages/order/return-order/create-return-order.js +14 -2
  57. package/client/pages/order/return-order/receive-return-order-requests.js +9 -1
  58. package/client/pages/order/return-order/return-order-detail.js +15 -6
  59. package/client/pages/order/return-order/return-order-inventory-popup.js +7 -0
  60. package/client/pages/order/reverse-kitting-order/reverse-kitting-order-detail.js +124 -59
  61. package/client/pages/order/reverse-kitting-order/reverse-kitting-order-list.js +1 -6
  62. package/client/pages/order/reverse-kitting-order/reverse-kitting-pallet-label-popup.js +239 -0
  63. package/client/pages/order/transport-order/delivery-order-list.js +102 -59
  64. package/client/pages/outbound/inventory-assign-popup.js +23 -6
  65. package/client/pages/outbound/inventory-auto-assign-popup.js +22 -6
  66. package/client/pages/outbound/loading-product.js +4 -1
  67. package/client/pages/outbound/merged-outbound-worksheet.js +43 -1
  68. package/client/pages/outbound/packing-product.js +4 -1
  69. package/client/pages/outbound/packing-worksheet-list.js +39 -1
  70. package/client/pages/outbound/picking-product.js +803 -431
  71. package/client/pages/outbound/picking-replacement-popup.js +1 -1
  72. package/client/pages/outbound/serial-number-popup.js +280 -0
  73. package/client/pages/outbound/single-outbound-worksheet.js +47 -1
  74. package/client/pages/outbound/worksheet-batch-picking.js +22 -8
  75. package/client/pages/outbound/worksheet-loading.js +22 -5
  76. package/client/pages/outbound/worksheet-packing.js +8 -0
  77. package/client/pages/outbound/worksheet-picking.js +62 -8
  78. package/client/pages/outbound/worksheet-return.js +9 -1
  79. package/client/pages/outbound/worksheet-sorting.js +9 -1
  80. package/client/pages/report/custom-elccl/elccl-inventory-report.js +31 -30
  81. package/client/pages/report/custom-elccl/elccl-inventory-summary-report.js +23 -26
  82. package/client/pages/report/inventory-pallet-storage-report.js +11 -10
  83. package/client/pages/report/inventory-report.js +41 -43
  84. package/client/pages/report/inventory-summary-report.js +25 -28
  85. package/client/pages/report/product-label-report.js +401 -0
  86. package/client/pages/support/inventory-comparison.js +296 -0
  87. package/client/pages/vas/print-product-label.js +298 -132
  88. package/client/pages/vas/reverse-kitting/execute-reverse-kitting.js +38 -23
  89. package/client/pages/vas/reverse-kitting/popup-combination-sets.js +98 -15
  90. package/client/pages/vas/reverse-kitting/popup-reverse-kitting-template.js +129 -21
  91. package/client/pages/vas/vas-pallet-label-popup.js +5 -8
  92. package/client/route.js +28 -0
  93. package/dist-server/graphql/resolvers/custom/elccl/elccl-inventory-history-report.js +1 -1
  94. package/dist-server/graphql/resolvers/custom/elccl/elccl-inventory-history-report.js.map +1 -1
  95. package/dist-server/graphql/resolvers/custom/elccl/elccl-inventory-history-summary-report.js +64 -54
  96. package/dist-server/graphql/resolvers/custom/elccl/elccl-inventory-history-summary-report.js.map +1 -1
  97. package/dist-server/graphql/resolvers/extra/add-release-good-products.js +34 -9
  98. package/dist-server/graphql/resolvers/extra/add-release-good-products.js.map +1 -1
  99. package/dist-server/graphql/resolvers/index.js +5 -1
  100. package/dist-server/graphql/resolvers/index.js.map +1 -1
  101. package/dist-server/graphql/resolvers/inventory-comparison/index.js +6 -0
  102. package/dist-server/graphql/resolvers/inventory-comparison/index.js.map +1 -0
  103. package/dist-server/graphql/resolvers/inventory-comparison/inventory-comparison-list.js +78 -0
  104. package/dist-server/graphql/resolvers/inventory-comparison/inventory-comparison-list.js.map +1 -0
  105. package/dist-server/graphql/resolvers/reports/index.js +2 -1
  106. package/dist-server/graphql/resolvers/reports/index.js.map +1 -1
  107. package/dist-server/graphql/resolvers/reports/product-label-report.js +56 -0
  108. package/dist-server/graphql/resolvers/reports/product-label-report.js.map +1 -0
  109. package/dist-server/graphql/resolvers/shipping-provider/index.js +6 -0
  110. package/dist-server/graphql/resolvers/shipping-provider/index.js.map +1 -0
  111. package/dist-server/graphql/resolvers/shipping-provider/shipping-providers.js +20 -0
  112. package/dist-server/graphql/resolvers/shipping-provider/shipping-providers.js.map +1 -0
  113. package/dist-server/graphql/types/custom/elccl/elccl-inventory-report.js +1 -1
  114. package/dist-server/graphql/types/index.js +8 -2
  115. package/dist-server/graphql/types/index.js.map +1 -1
  116. package/dist-server/graphql/types/inventory-comparison/index.js +13 -0
  117. package/dist-server/graphql/types/inventory-comparison/index.js.map +1 -0
  118. package/dist-server/graphql/types/inventory-comparison/inventory-comparison-list.js +14 -0
  119. package/dist-server/graphql/types/inventory-comparison/inventory-comparison-list.js.map +1 -0
  120. package/dist-server/graphql/types/inventory-comparison/inventory-comparison.js +18 -0
  121. package/dist-server/graphql/types/inventory-comparison/inventory-comparison.js.map +1 -0
  122. package/dist-server/graphql/types/reports/index.js +6 -1
  123. package/dist-server/graphql/types/reports/index.js.map +1 -1
  124. package/dist-server/graphql/types/reports/product-label-report-list.js +14 -0
  125. package/dist-server/graphql/types/reports/product-label-report-list.js.map +1 -0
  126. package/dist-server/graphql/types/reports/product-label-report.js +16 -0
  127. package/dist-server/graphql/types/reports/product-label-report.js.map +1 -0
  128. package/dist-server/graphql/types/shipping-provider/index.js +10 -0
  129. package/dist-server/graphql/types/shipping-provider/index.js.map +1 -0
  130. package/dist-server/graphql/types/shipping-provider/shipping-provider-list.js +13 -0
  131. package/dist-server/graphql/types/shipping-provider/shipping-provider-list.js.map +1 -0
  132. package/dist-server/graphql/types/shipping-provider/shipping-provider.js +13 -0
  133. package/dist-server/graphql/types/shipping-provider/shipping-provider.js.map +1 -0
  134. package/package.json +65 -65
  135. package/server/graphql/resolvers/custom/elccl/elccl-inventory-history-report.ts +4 -2
  136. package/server/graphql/resolvers/custom/elccl/elccl-inventory-history-summary-report.ts +75 -65
  137. package/server/graphql/resolvers/extra/add-release-good-products.ts +57 -15
  138. package/server/graphql/resolvers/index.ts +5 -1
  139. package/server/graphql/resolvers/inventory-comparison/index.ts +5 -0
  140. package/server/graphql/resolvers/inventory-comparison/inventory-comparison-list.ts +99 -0
  141. package/server/graphql/resolvers/reports/index.ts +3 -1
  142. package/server/graphql/resolvers/reports/product-label-report.ts +56 -0
  143. package/server/graphql/resolvers/shipping-provider/index.ts +5 -0
  144. package/server/graphql/resolvers/shipping-provider/shipping-providers.ts +20 -0
  145. package/server/graphql/types/custom/elccl/elccl-inventory-report.ts +1 -1
  146. package/server/graphql/types/index.ts +8 -2
  147. package/server/graphql/types/inventory-comparison/index.ts +11 -0
  148. package/server/graphql/types/inventory-comparison/inventory-comparison-list.ts +8 -0
  149. package/server/graphql/types/inventory-comparison/inventory-comparison.ts +12 -0
  150. package/server/graphql/types/reports/index.ts +6 -1
  151. package/server/graphql/types/reports/product-label-report-list.ts +8 -0
  152. package/server/graphql/types/reports/product-label-report.ts +10 -0
  153. package/server/graphql/types/shipping-provider/index.ts +8 -0
  154. package/server/graphql/types/shipping-provider/shipping-provider-list.ts +7 -0
  155. package/server/graphql/types/shipping-provider/shipping-provider.ts +7 -0
  156. package/things-factory.config.js +30 -0
  157. package/translations/en.json +91 -11
  158. package/translations/ko.json +109 -11
  159. package/translations/ms.json +111 -12
  160. package/translations/zh.json +123 -26
@@ -167,7 +167,18 @@ class PutawayWorksheetGeneratePopup extends localize(i18next)(LitElement) {
167
167
 
168
168
  this.inventoryGristConfig = {
169
169
  list: {
170
- fields: ['batchId', 'product', 'packingType', 'palletId', 'cartonId', 'qty', 'uomValue', 'uom', 'updatedAt']
170
+ fields: [
171
+ 'batchId',
172
+ 'product',
173
+ 'packingType',
174
+ 'packingSize',
175
+ 'palletId',
176
+ 'cartonId',
177
+ 'qty',
178
+ 'uomValue',
179
+ 'uom',
180
+ 'updatedAt'
181
+ ]
171
182
  },
172
183
  pagination: { infinite: true },
173
184
  rows: { selectable: { multiple: true }, appendable: false },
@@ -178,6 +189,7 @@ class PutawayWorksheetGeneratePopup extends localize(i18next)(LitElement) {
178
189
  type: 'string',
179
190
  name: 'batchId',
180
191
  header: i18next.t('field.batch_id'),
192
+ label: true,
181
193
  sortable: true,
182
194
  width: 150
183
195
  },
@@ -185,6 +197,7 @@ class PutawayWorksheetGeneratePopup extends localize(i18next)(LitElement) {
185
197
  type: 'object',
186
198
  name: 'product',
187
199
  header: i18next.t('field.product'),
200
+ label: true,
188
201
  sortable: true,
189
202
  width: 200
190
203
  },
@@ -192,6 +205,7 @@ class PutawayWorksheetGeneratePopup extends localize(i18next)(LitElement) {
192
205
  type: 'string',
193
206
  name: 'packingType',
194
207
  header: i18next.t('field.packing_type'),
208
+ label: true,
195
209
  sortable: true,
196
210
  width: 200
197
211
  },
@@ -199,6 +213,7 @@ class PutawayWorksheetGeneratePopup extends localize(i18next)(LitElement) {
199
213
  type: 'number',
200
214
  name: 'packingSize',
201
215
  header: i18next.t('field.packing_size'),
216
+ label: true,
202
217
  sortable: true,
203
218
  width: 100
204
219
  },
@@ -206,36 +221,42 @@ class PutawayWorksheetGeneratePopup extends localize(i18next)(LitElement) {
206
221
  type: 'string',
207
222
  name: 'palletId',
208
223
  header: i18next.t('field.lot_id'),
224
+ label: true,
209
225
  width: 150
210
226
  },
211
227
  {
212
228
  type: 'string',
213
229
  name: 'cartonId',
214
230
  header: i18next.t('field.carton_id'),
231
+ label: true,
215
232
  width: 150
216
233
  },
217
234
  {
218
235
  type: 'number',
219
236
  name: 'qty',
220
237
  header: i18next.t('field.qty'),
238
+ label: true,
221
239
  width: 80
222
240
  },
223
241
  {
224
242
  type: 'number',
225
243
  name: 'uomValue',
226
244
  header: i18next.t('field.uom_value'),
245
+ label: true,
227
246
  width: 80
228
247
  },
229
248
  {
230
249
  type: 'string',
231
250
  name: 'uom',
232
251
  header: i18next.t('field.uom'),
252
+ label: true,
233
253
  width: 80
234
254
  },
235
255
  {
236
256
  type: 'datetime',
237
257
  name: 'updatedAt',
238
258
  header: i18next.t('field.updated_at'),
259
+ label: true,
239
260
  sortable: true,
240
261
  width: 150
241
262
  },
@@ -243,6 +264,7 @@ class PutawayWorksheetGeneratePopup extends localize(i18next)(LitElement) {
243
264
  type: 'object',
244
265
  name: 'updater',
245
266
  header: i18next.t('field.updater'),
267
+ label: true,
246
268
  width: 150
247
269
  }
248
270
  ]
@@ -271,7 +293,7 @@ class PutawayWorksheetGeneratePopup extends localize(i18next)(LitElement) {
271
293
  try {
272
294
  const response = await client.query({
273
295
  query: gql`
274
- query inventories($filters: [Filter!]) {
296
+ query inventories($filters: [Filter!]!) {
275
297
  inventories(filters: $filters) {
276
298
  items {
277
299
  id
@@ -35,6 +35,7 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
35
35
  _enableCartonLabel: Boolean,
36
36
  _enableInputQty: Boolean,
37
37
  _isRequiredCheckExpiry: Boolean,
38
+ _expirationPeriod: Number,
38
39
  customerCompanyDomainId: String,
39
40
  orderProductConfig: Object,
40
41
  orderProductData: Object,
@@ -47,7 +48,8 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
47
48
  _reusablePalletId: Array,
48
49
  _reusablePalletIdData: Object,
49
50
  orderVasData: Object,
50
- refOrderType: String
51
+ refOrderType: String,
52
+ _scanning: Boolean
51
53
  }
52
54
  }
53
55
 
@@ -160,8 +162,7 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
160
162
  })
161
163
  }
162
164
 
163
- if (this.orderProductData && this.orderProductData.records.length
164
- && this.completable) {
165
+ if (this.orderProductData && this.orderProductData.records.length && this.completable) {
165
166
  actions.push({
166
167
  title: i18next.t('button.complete'),
167
168
  action: this._complete.bind(this),
@@ -218,7 +219,7 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
218
219
  get productBarcodeInput() {
219
220
  return this.shadowRoot
220
221
  .querySelector('barcode-scanable-input[name=productBarcode]')
221
- .shadowRoot.querySelector('input')
222
+ ?.shadowRoot?.querySelector('input')
222
223
  }
223
224
 
224
225
  get actualQtyInput() {
@@ -402,6 +403,7 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
402
403
  this._isQtyChecked = false
403
404
  this._enableProductScanning = false
404
405
  this._isRequiredCheckExpiry = false
406
+ this._expirationPeriod = 0
405
407
  this._orderNo = ''
406
408
  this._productName = ''
407
409
  this._productSku = ''
@@ -409,6 +411,7 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
409
411
  this.orderProductData = { records: [] }
410
412
  this.reusablePalletIdData = { records: [] }
411
413
  this.orderVasData = { records: [] }
414
+ this._scanning = false
412
415
  }
413
416
 
414
417
  updated(changedProps) {
@@ -948,7 +951,6 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
948
951
  if (this._enableInputQty) {
949
952
  this.actualQtyInput.value = ''
950
953
  this.cartonInput.value = ''
951
- this._isRequiredCheckExpiry = false
952
954
  this._focusOnCartonInput()
953
955
  }
954
956
  } else {
@@ -1018,105 +1020,168 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
1018
1020
  }
1019
1021
 
1020
1022
  async _scanProductUnload() {
1021
- try {
1022
- const response = await client.mutate({
1023
- mutation: gql`
1024
- mutation scanProductUnload(
1025
- $worksheetDetailName: String!
1026
- $productBarcode: String!
1027
- $inventory: InventoryPatch!
1028
- ) {
1029
- scanProductUnload(
1030
- worksheetDetailName: $worksheetDetailName
1031
- productBarcode: $productBarcode
1032
- inventory: $inventory
1033
- )
1034
- }
1035
- `,
1036
- variables: {
1037
- worksheetDetailName: this._selectedOrderProduct.name,
1038
- productBarcode: this.productBarcodeInput.value.trim(),
1039
- inventory: {
1040
- palletId: this._enableCartonLabel ? null : this.palletInput.value.trim(),
1041
- cartonId: this._enableCartonLabel ? this.cartonInput.value.trim() : null,
1042
- expirationDate: this.expDateInput?.value ? this.expDateInput.value : null
1023
+ if (this._scanning === false) {
1024
+ this._scanning = true
1025
+ try {
1026
+ if (this._isRequiredCheckExpiry && this._expirationPeriod > 0) {
1027
+ let date = new Date()
1028
+ const acceptBefore = new Date(date.setDate(date.getDate() + this._expirationPeriod))
1029
+ let expiryDate = new Date(this.expDateInput.value)
1030
+ if (expiryDate < acceptBefore) {
1031
+ await CustomAlert({
1032
+ title: i18next.t('title.item_unloading_is_expiring_soon'),
1033
+ confirmButton: { text: i18next.t('button.confirm') }
1034
+ })
1043
1035
  }
1044
1036
  }
1045
- })
1046
1037
 
1047
- if (!response.errors) {
1048
- await this._fetchProducts(this._orderNo)
1038
+ const response = await client.mutate({
1039
+ mutation: gql`
1040
+ mutation scanProductUnload(
1041
+ $worksheetDetailName: String!
1042
+ $productBarcode: String!
1043
+ $inventory: InventoryPatch!
1044
+ ) {
1045
+ scanProductUnload(
1046
+ worksheetDetailName: $worksheetDetailName
1047
+ productBarcode: $productBarcode
1048
+ inventory: $inventory
1049
+ )
1050
+ }
1051
+ `,
1052
+ variables: {
1053
+ worksheetDetailName: this._selectedOrderProduct.name,
1054
+ productBarcode: this.productBarcodeInput.value.trim(),
1055
+ inventory: {
1056
+ palletId: this._enableCartonLabel ? null : this.palletInput.value.trim(),
1057
+ cartonId: this._enableCartonLabel ? this.cartonInput.value.trim() : null,
1058
+ expirationDate: this.expDateInput?.value ? this.expDateInput.value : null
1059
+ }
1060
+ }
1061
+ })
1062
+
1063
+ if (!response.errors) {
1064
+ await this._fetchProducts(this._orderNo)
1065
+ }
1066
+ } catch (e) {
1067
+ this._showToast(e)
1049
1068
  }
1050
- } catch (e) {
1051
- this._showToast(e)
1069
+
1070
+ this._scanning = false
1071
+ } else {
1072
+ this._showToast({ message: i18next.t('text.previous_scan_is_executing') })
1052
1073
  }
1053
1074
  }
1054
1075
 
1055
1076
  async _qtyUnload() {
1056
- try {
1057
- const response = await client.mutate({
1058
- mutation: gql`
1059
- mutation unload($worksheetDetailName: String!, $inventory: InventoryPatch!, $productBarcode: String) {
1060
- unload(worksheetDetailName: $worksheetDetailName, inventory: $inventory, productBarcode: $productBarcode)
1077
+ if (this._scanning === false) {
1078
+ this._scanning = true
1079
+ try {
1080
+ if (this._isRequiredCheckExpiry && this._expirationPeriod > 0) {
1081
+ let date = new Date()
1082
+ const acceptBefore = new Date(date.setDate(date.getDate() + this._expirationPeriod))
1083
+ let expiryDate = new Date(this.expDateInput.value)
1084
+ if (expiryDate < acceptBefore) {
1085
+ await CustomAlert({
1086
+ title: i18next.t('title.item_unloading_is_expiring_soon'),
1087
+ confirmButton: { text: i18next.t('button.confirm') }
1088
+ })
1061
1089
  }
1062
- `,
1063
- variables: {
1064
- worksheetDetailName: this._selectedOrderProduct.name,
1065
- inventory: {
1066
- palletId: this._enableCartonLabel ? null : this.palletInput.value.trim(),
1067
- cartonId: this._enableCartonLabel ? this.cartonInput.value.trim() : null,
1068
- qty: parseInt(this.actualQtyInput.value),
1069
- expirationDate: this._isRequiredCheckExpiry ? this.expDateInput.value : null
1070
- },
1071
- productBarcode: this._enableProductScanning ? this.productBarcodeInput?.value : null
1072
1090
  }
1073
- })
1074
- if (!response.errors) {
1075
- await this._fetchProducts(this._orderNo)
1091
+
1092
+ const response = await client.mutate({
1093
+ mutation: gql`
1094
+ mutation unload($worksheetDetailName: String!, $inventory: InventoryPatch!, $productBarcode: String) {
1095
+ unload(worksheetDetailName: $worksheetDetailName, inventory: $inventory, productBarcode: $productBarcode)
1096
+ }
1097
+ `,
1098
+ variables: {
1099
+ worksheetDetailName: this._selectedOrderProduct.name,
1100
+ inventory: {
1101
+ palletId: this._enableCartonLabel ? null : this.palletInput.value.trim(),
1102
+ cartonId: this._enableCartonLabel ? this.cartonInput.value.trim() : null,
1103
+ qty: parseInt(this.actualQtyInput.value),
1104
+ expirationDate: this._isRequiredCheckExpiry ? this.expDateInput.value : null
1105
+ },
1106
+ productBarcode: this._enableProductScanning ? this.productBarcodeInput?.value : null
1107
+ }
1108
+ })
1109
+ if (!response.errors) {
1110
+ await this._fetchProducts(this._orderNo)
1111
+ }
1112
+ } catch (e) {
1113
+ this._showToast(e)
1076
1114
  }
1077
- } catch (e) {
1078
- this._showToast(e)
1115
+
1116
+ this._scanning = false
1117
+ } else {
1118
+ this._showToast({ message: i18next.t('text.previous_scan_is_executing') })
1079
1119
  }
1080
1120
  }
1081
1121
 
1082
- async _checkedScannedProduct() {
1083
- try {
1084
- const response = await client.query({
1085
- query: gql`
1086
- query productDetail($gtin: String!, $customerCompanyDomainId: String!) {
1087
- productDetail(gtin: $gtin, customerCompanyDomainId: $customerCompanyDomainId) {
1122
+ async fetchProductDetail(gtin, productId) {
1123
+ return await client.query({
1124
+ query: gql`
1125
+ query productDetail($gtin: String!, $productId: String!, $customerCompanyDomainId: String!) {
1126
+ productDetail(gtin: $gtin, productId: $productId, customerCompanyDomainId: $customerCompanyDomainId) {
1127
+ id
1128
+ name
1129
+ packingType
1130
+ packingSize
1131
+ gtin
1132
+ product {
1088
1133
  id
1089
1134
  name
1090
- packingType
1091
- packingSize
1092
- gtin
1093
- product {
1094
- id
1095
- name
1096
- sku
1097
- isRequiredCheckExpiry
1098
- }
1135
+ sku
1136
+ isRequiredCheckExpiry
1137
+ expirationPeriod
1099
1138
  }
1100
1139
  }
1101
- `,
1102
- variables: { gtin: this.productBarcodeInput.value, customerCompanyDomainId: this.customerCompanyDomainId }
1103
- })
1140
+ }
1141
+ `,
1142
+ variables: {
1143
+ gtin,
1144
+ productId,
1145
+ customerCompanyDomainId: this.customerCompanyDomainId
1146
+ }
1147
+ })
1148
+ }
1149
+
1150
+ //need to enhance
1151
+ async _checkedLotScannedProduct() {
1152
+ const response = await this.fetchProductDetail('', this._selectedOrderProduct.product.id)
1153
+ if (!response.errors) {
1154
+ this._expirationPeriod = response.data.productDetail.product.expirationPeriod
1155
+ }
1156
+ }
1157
+
1158
+ async _checkedScannedProduct() {
1159
+ try {
1160
+ const response = await this.fetchProductDetail(this.productBarcodeInput?.value || '', '')
1161
+
1104
1162
  if (!response.errors) {
1105
- const { product, packingSize, packingType } = response.data.productDetail
1163
+ const { product, packingSize, packingType, id } = response.data.productDetail
1106
1164
  const foundOrderProducts = this.orderProductData.records.filter(
1107
1165
  orderProduct =>
1108
1166
  orderProduct.product.id === product.id &&
1109
1167
  orderProduct.packingType === packingType &&
1110
1168
  orderProduct.packingSize === packingSize
1111
1169
  )
1170
+ const foundParentProducts = this.orderProductData.records.filter(
1171
+ orderProduct => orderProduct.product.id === product.id
1172
+ )
1173
+
1112
1174
  if (!foundOrderProducts?.length) {
1113
- if (this._enableInputQty) {
1114
- if (this.actualQtyInput?.value) this.actualQtyInput.value = ''
1175
+ if (!foundParentProducts?.length) {
1176
+ if (this._enableInputQty) {
1177
+ if (this.actualQtyInput?.value) this.actualQtyInput.value = ''
1178
+ }
1179
+ this.productBarcodeInput.value = ''
1180
+ this._focusOnProductBarcodeInput()
1181
+ throw new Error(i18next.t('text.no_matching_product_found'))
1115
1182
  }
1116
- this.productBarcodeInput.value = ''
1117
- this._focusOnProductBarcodeInput()
1118
- throw new Error(i18next.t('text.no_matching_product_found'))
1119
1183
  }
1184
+ this._expirationPeriod = product.expirationPeriod
1120
1185
  this._isRequiredCheckExpiry = product.isRequiredCheckExpiry
1121
1186
 
1122
1187
  if (this._selectedOrderProduct && this._selectedOrderProduct.product.sku !== product.sku)
@@ -1127,6 +1192,13 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
1127
1192
  } else if (foundOrderProducts?.length == 1) {
1128
1193
  if (!this._selectedOrderProduct) this._selectedOrderProduct = foundOrderProducts[0]
1129
1194
 
1195
+ this._productName = `(${this._selectedOrderProduct.product.sku})${this._selectedOrderProduct.product.name} ${
1196
+ this._selectedOrderProduct.product.description ? `(${this._selectedOrderProduct.product.description})` : ''
1197
+ }`
1198
+ this._fillUpForm(this.inputForm, this._selectedOrderProduct)
1199
+ } else if (foundOrderProducts?.length == 0 && foundParentProducts?.length == 1 && !this._selectedOrderProduct) {
1200
+ this._selectedOrderProduct = foundParentProducts[0]
1201
+
1130
1202
  this._productName = `(${this._selectedOrderProduct.product.sku})${this._selectedOrderProduct.product.name} ${
1131
1203
  this._selectedOrderProduct.product.description ? `(${this._selectedOrderProduct.product.description})` : ''
1132
1204
  }`
@@ -1628,6 +1700,7 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
1628
1700
  this._openPopupUnloading(this.palletInput.value, this.orderProductData, this.palletProductData)
1629
1701
  } else {
1630
1702
  await this._validateUnloading()
1703
+ await this._checkedLotScannedProduct()
1631
1704
  this._qtyUnload()
1632
1705
  }
1633
1706
  }
@@ -15,6 +15,7 @@ class WorksheetPutawayReturn extends localize(i18next)(PageView) {
15
15
  _worksheetNo: String,
16
16
  _worksheetStatus: String,
17
17
  _returnOrderNo: String,
18
+ _statusList: Array,
18
19
  config: Object,
19
20
  data: Object
20
21
  }
@@ -107,6 +108,13 @@ class WorksheetPutawayReturn extends localize(i18next)(PageView) {
107
108
  }
108
109
  }
109
110
 
111
+ constructor() {
112
+ super()
113
+ this._statusList = Object.keys(WORKSHEET_STATUS).map(key => {
114
+ return { value: WORKSHEET_STATUS[key].value, display: WORKSHEET_STATUS[key].name }
115
+ })
116
+ }
117
+
110
118
  render() {
111
119
  return html`
112
120
  <div class="form-container">
@@ -126,11 +134,12 @@ class WorksheetPutawayReturn extends localize(i18next)(PageView) {
126
134
  <input name="refNo" readonly />
127
135
 
128
136
  <label>${i18next.t('label.status')}</label>
129
- <select name="status" disabled>
130
- ${Object.keys(WORKSHEET_STATUS).map(
131
- key => html` <option value="${WORKSHEET_STATUS[key].value}">${WORKSHEET_STATUS[key].name}</option> `
132
- )}
133
- </select>
137
+ <input
138
+ name="status"
139
+ value="${this._statusList.find(x => x.value == this._worksheetStatus)?.display || ''}"
140
+ readonly
141
+ disabled
142
+ />
134
143
  </fieldset>
135
144
  </form>
136
145
 
@@ -192,6 +201,12 @@ class WorksheetPutawayReturn extends localize(i18next)(PageView) {
192
201
  header: i18next.t('field.product'),
193
202
  width: 350
194
203
  },
204
+ {
205
+ type: 'string',
206
+ name: 'brand',
207
+ header: i18next.t('field.brand'),
208
+ width: 120
209
+ },
195
210
  {
196
211
  type: 'string',
197
212
  name: 'packingType',
@@ -250,6 +265,7 @@ class WorksheetPutawayReturn extends localize(i18next)(PageView) {
250
265
  cartonId
251
266
  product {
252
267
  name
268
+ brand
253
269
  description
254
270
  }
255
271
  packingType
@@ -285,6 +301,7 @@ class WorksheetPutawayReturn extends localize(i18next)(PageView) {
285
301
  return {
286
302
  ...worksheetDetail.targetInventory.inventory,
287
303
  name: worksheetDetail.name,
304
+ brand: worksheetDetail.targetInventory.inventory.product.brand,
288
305
  description: worksheetDetail.description,
289
306
  status: worksheetDetail.status
290
307
  }
@@ -1,13 +1,16 @@
1
1
  import '@things-factory/barcode-ui'
2
- import { MultiColumnFormStyles } from '@things-factory/form-ui'
3
2
  import '@things-factory/grist-ui'
3
+
4
+ import gql from 'graphql-tag'
5
+ import { css, html } from 'lit-element'
6
+
7
+ import { MultiColumnFormStyles } from '@things-factory/form-ui'
4
8
  import { getRenderer } from '@things-factory/grist-ui'
5
9
  import { i18next, localize } from '@things-factory/i18n-base'
6
10
  import { client, CustomAlert, navigate, PageView } from '@things-factory/shell'
7
11
  import { CommonButtonStyles } from '@things-factory/styles'
8
12
  import { isMobileDevice } from '@things-factory/utils'
9
- import gql from 'graphql-tag'
10
- import { css, html } from 'lit-element'
13
+
11
14
  import {
12
15
  VAS_BATCH_AND_PRODUCT_TYPE,
13
16
  VAS_BATCH_NO_TYPE,
@@ -231,6 +234,12 @@ class WorksheetPutaway extends localize(i18next)(PageView) {
231
234
  header: i18next.t('field.product'),
232
235
  width: 300
233
236
  },
237
+ {
238
+ type: 'string',
239
+ name: 'productBrand',
240
+ header: i18next.t('field.brand'),
241
+ width: 150
242
+ },
234
243
  {
235
244
  type: 'string',
236
245
  name: 'packingType',
@@ -404,6 +413,7 @@ class WorksheetPutaway extends localize(i18next)(PageView) {
404
413
  product {
405
414
  sku
406
415
  name
416
+ brand
407
417
  description
408
418
  }
409
419
  packingType
@@ -443,6 +453,7 @@ class WorksheetPutaway extends localize(i18next)(PageView) {
443
453
  name: worksheetDetail.name,
444
454
  description: worksheetDetail.description,
445
455
  productSku: worksheetDetail.targetInventory.inventory.product.sku,
456
+ productBrand: worksheetDetail.targetInventory.inventory.product.brand,
446
457
  status: worksheetDetail.status
447
458
  }
448
459
  })
@@ -505,17 +516,19 @@ class WorksheetPutaway extends localize(i18next)(PageView) {
505
516
  !this.preConfig.columns.some(e => e.name === 'status') &&
506
517
  this._worksheetStatus !== WORKSHEET_STATUS.DEACTIVATED.value
507
518
  ) {
508
- this.preConfig.columns = [...this.preConfig.columns, currentLocationColumn, statusColumnConfig]
519
+ this.preConfig.columns = [
520
+ ...this.preConfig.columns,
521
+ currentLocationColumn,
522
+ statusColumnConfig,
523
+ batchIdRefColumnConfig
524
+ ]
509
525
  } else if (
510
526
  this.preConfig.columns.some(e => e.name === 'status') &&
511
527
  this._worksheetStatus === WORKSHEET_STATUS.DEACTIVATED.value
512
528
  ) {
513
529
  this.preConfig.columns.splice(this.preConfig.columns.map(e => e.name).indexOf('location'))
514
530
  this.preConfig.columns.splice(this.preConfig.columns.map(e => e.name).indexOf('status'))
515
- }
516
-
517
- if (this.data.records.some(e => e.batchIdRef)) {
518
- this.preConfig.columns = [...this.preConfig.columns, batchIdRefColumnConfig]
531
+ this.preConfig.columns.splice(this.preConfig.columns.map(e => e.name).indexOf('batchIdRef'))
519
532
  }
520
533
 
521
534
  this.config = { ...this.preConfig }
@@ -19,6 +19,7 @@ class WorksheetUnloadingReturn extends localize(i18next)(PageView) {
19
19
  return {
20
20
  _worksheetNo: String,
21
21
  _worksheetStatus: String,
22
+ _statusList: Array,
22
23
  _returnOrderNo: String,
23
24
  _enableCartonLabel: Boolean,
24
25
  config: Object,
@@ -143,6 +144,13 @@ class WorksheetUnloadingReturn extends localize(i18next)(PageView) {
143
144
  }
144
145
  }
145
146
 
147
+ constructor() {
148
+ super()
149
+ this._statusList = Object.keys(WORKSHEET_STATUS).map(key => {
150
+ return { value: WORKSHEET_STATUS[key].value, display: WORKSHEET_STATUS[key].name }
151
+ })
152
+ }
153
+
146
154
  render() {
147
155
  return html`
148
156
  <div class="form-container">
@@ -159,11 +167,12 @@ class WorksheetUnloadingReturn extends localize(i18next)(PageView) {
159
167
  <input name="refNo" readonly />
160
168
 
161
169
  <label>${i18next.t('label.status')}</label>
162
- <select name="status" disabled>
163
- ${Object.keys(WORKSHEET_STATUS).map(
164
- key => html` <option value="${WORKSHEET_STATUS[key].value}">${WORKSHEET_STATUS[key].name}</option> `
165
- )}
166
- </select>
170
+ <input
171
+ name="status"
172
+ value="${this._statusList.find(x => x.value == this._worksheetStatus)?.display || ''}"
173
+ readonly
174
+ disabled
175
+ />
167
176
  </fieldset>
168
177
  </form>
169
178
 
@@ -230,6 +239,12 @@ class WorksheetUnloadingReturn extends localize(i18next)(PageView) {
230
239
  header: i18next.t('field.product'),
231
240
  width: 350
232
241
  },
242
+ {
243
+ type: 'string',
244
+ name: 'brand',
245
+ header: i18next.t('field.brand'),
246
+ width: 150
247
+ },
233
248
  {
234
249
  type: 'string',
235
250
  name: 'packingType',
@@ -302,6 +317,7 @@ class WorksheetUnloadingReturn extends localize(i18next)(PageView) {
302
317
  cartonId
303
318
  product {
304
319
  name
320
+ brand
305
321
  description
306
322
  }
307
323
  packingType
@@ -345,6 +361,7 @@ class WorksheetUnloadingReturn extends localize(i18next)(PageView) {
345
361
  id: worksheetDetail.id,
346
362
  name: worksheetDetail.name,
347
363
  description: worksheetDetail.description,
364
+ brand: worksheetDetail.targetInventory.inventory.product.brand,
348
365
  returnQty: worksheetDetail.targetInventory.returnQty,
349
366
  remark: worksheetDetail.targetInventory.remark,
350
367
  status: worksheetDetail.status,
@@ -287,6 +287,12 @@ class WorksheetUnloading extends localize(i18next)(PageView) {
287
287
  header: i18next.t('field.product'),
288
288
  width: 300
289
289
  },
290
+ {
291
+ type: 'string',
292
+ name: 'productBrand',
293
+ header: i18next.t('field.brand'),
294
+ width: 150
295
+ },
290
296
  {
291
297
  type: 'string',
292
298
  name: 'packingType',
@@ -514,6 +520,7 @@ class WorksheetUnloading extends localize(i18next)(PageView) {
514
520
  product {
515
521
  id
516
522
  sku
523
+ brand
517
524
  name
518
525
  type
519
526
  description
@@ -571,6 +578,7 @@ class WorksheetUnloading extends localize(i18next)(PageView) {
571
578
  issue: worksheetDetail.issue,
572
579
  initialBatchId: worksheetDetail.targetProduct.batchId,
573
580
  productSku: worksheetDetail.targetProduct.product.sku,
581
+ productBrand: worksheetDetail.targetProduct.product.brand,
574
582
  hasBatchChanges:
575
583
  worksheetDetail.targetProduct &&
576
584
  worksheetDetail.targetProduct.batchId !== worksheetDetail.targetProduct.initialBatchId