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

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 (29) hide show
  1. package/client/pages/bulk-operation/bulk-operation.js +1 -5
  2. package/client/pages/inbound/unload-product.js +1 -0
  3. package/client/pages/inventory-check/check-inventory-popup.js +14 -3
  4. package/client/pages/inventory-check/inspecting-product.js +25 -7
  5. package/client/pages/inventory-check/inventory-check-list.js +2 -2
  6. package/client/pages/master/location-list.js +29 -7
  7. package/client/pages/master/pallet-list.js +69 -20
  8. package/client/pages/master/tote-list.js +5 -0
  9. package/client/pages/order/draft-release-good/draft-release-good-detail.js +32 -1
  10. package/client/pages/order/goods-received-note/received-note-detail.js +1 -1
  11. package/client/pages/order/release-order/create-release-order.js +0 -2
  12. package/client/pages/order/release-order/release-order-detail.js +20 -0
  13. package/client/pages/order/return-order/create-return-order.js +4 -0
  14. package/client/pages/order/transport-order/delivery-order-list.js +26 -0
  15. package/client/pages/outbound/packing-worksheet-list.js +3 -1
  16. package/client/pages/outbound/picking-product.js +7 -6
  17. package/client/pages/outbound/show-my-worksheet-list-popup.js +12 -3
  18. package/client/pages/report/custom-elccl/elccl-daily-collection-report.js +5 -2
  19. package/client/pages/report/custom-elccl/elccl-daily-order-inventory-report.js +2 -2
  20. package/client/pages/report/custom-elccl/elccl-delivery-order-summary.js +48 -8
  21. package/config.development.js +33 -27
  22. package/dist-server/graphql/resolvers/reports/release-inventory-report.js +3 -3
  23. package/dist-server/graphql/resolvers/reports/release-inventory-report.js.map +1 -1
  24. package/package.json +50 -50
  25. package/server/graphql/resolvers/reports/release-inventory-report.ts +6 -4
  26. package/translations/en.json +16 -2
  27. package/translations/ko.json +15 -1
  28. package/translations/ms.json +15 -1
  29. package/translations/zh.json +15 -1
@@ -478,11 +478,7 @@ class BulkOperation extends localize(i18next)(PageView) {
478
478
  packingType: record.packingType && record.packingType != '' ? String(record.packingType) : null,
479
479
  packingSize: !isNaN(Number(record.packingSize || 'x')) ? Number(record.packingSize) : null,
480
480
  uom: record.uom && record.uom != '' ? String(record.uom) : null,
481
- releaseQty: Number(record.releaseQty)
482
- ? Math.floor(Number(record.releaseQty)) < 1
483
- ? 1
484
- : Math.floor(Number(record.releaseQty))
485
- : null,
481
+ releaseQty: parseInt(record.releaseQty),
486
482
  postalCode: String(record.postalCode || ''),
487
483
  phone1: String(record.phone1 || ''),
488
484
  exportOption: false,
@@ -727,6 +727,7 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
727
727
  this._orderNo = orderNo
728
728
  const worksheetInfo = response.data.unloadingReturnWorksheet.worksheetInfo
729
729
  this._worksheetInfo = worksheetInfo
730
+ this._bizplaceName = worksheetInfo?.bizplaceName
730
731
 
731
732
  this.orderProductData = {
732
733
  records: orderBy(
@@ -127,7 +127,7 @@ class CheckInventoryPopup extends localize(i18next)(LitElement) {
127
127
 
128
128
  async _checkPalletId() {
129
129
  try {
130
- this._validateInput()
130
+ await this._validateInput()
131
131
 
132
132
  const isInventoryOwner = await this._checkInventoryOwnership(this.palletIdInput.value, this.bizplaceName)
133
133
  if (!isInventoryOwner)
@@ -149,7 +149,17 @@ class CheckInventoryPopup extends localize(i18next)(LitElement) {
149
149
  )
150
150
  } else {
151
151
  const invInfo = await this._checkCurrentLocationinCC(this.palletIdInput.value, this.cycleCountNo)
152
- if (invInfo.currentLocation !== this.locationInput.value) {
152
+
153
+ if (!invInfo) {
154
+ this.dispatchEvent(
155
+ new CustomEvent('not-in-cc', {
156
+ detail: {
157
+ palletId: this.palletIdInput.value,
158
+ cycleCountNo: this.cycleCountNo
159
+ }
160
+ })
161
+ )
162
+ } else if (invInfo?.currentLocation !== this.locationInput.value) {
153
163
  this.dispatchEvent(
154
164
  new CustomEvent('relocate-inventory', {
155
165
  detail: {
@@ -170,7 +180,6 @@ class CheckInventoryPopup extends localize(i18next)(LitElement) {
170
180
  }
171
181
  }
172
182
  } catch (e) {
173
- history.back()
174
183
  this._showToast(e)
175
184
  }
176
185
  }
@@ -223,6 +232,8 @@ class CheckInventoryPopup extends localize(i18next)(LitElement) {
223
232
 
224
233
  if (!response.errors) {
225
234
  return response.data.checkStockTakeCurrentLocation
235
+ } else {
236
+ return response.errors
226
237
  }
227
238
  } catch (e) {
228
239
  this.showToast(e)
@@ -331,10 +331,16 @@ class InspectingProduct extends connect(store)(localize(i18next)(PageView)) {
331
331
  }
332
332
 
333
333
  get locationInput() {
334
- if (this.viewType === VIEW_TYPE.INVENTORY_SELECTED) {
335
- return this.renderRoot.querySelector('input[name=location]')
336
- } else {
334
+ // if (this.viewType === VIEW_TYPE.INVENTORY_SELECTED) {
335
+ // return this.renderRoot.querySelector('input[name=location]')
336
+ // } else {
337
+ // return this.renderRoot.querySelector('barcode-scanable-input[name=location]').renderRoot.querySelector('input')
338
+ // }
339
+
340
+ if (this.renderRoot.querySelector('barcode-scanable-input[name=location]').renderRoot.querySelector('input')) {
337
341
  return this.renderRoot.querySelector('barcode-scanable-input[name=location]').renderRoot.querySelector('input')
342
+ } else {
343
+ return this.renderRoot.querySelector('input[name=location]')
338
344
  }
339
345
  }
340
346
 
@@ -833,7 +839,7 @@ class InspectingProduct extends connect(store)(localize(i18next)(PageView)) {
833
839
 
834
840
  async addExtraPallet() {
835
841
  try {
836
- this.checkInputFormValidity()
842
+ await this.checkInputFormValidity()
837
843
 
838
844
  const palletId = this.palletIdInput.value
839
845
 
@@ -993,13 +999,25 @@ class InspectingProduct extends connect(store)(localize(i18next)(PageView)) {
993
999
  this.viewType = VIEW_TYPE.INVENTORY_SELECTED
994
1000
  this.updateContext(this.viewType)
995
1001
  this.selectedInventory = e.detail.recordInformation
996
- this.locationInput.value = e.detail.locationInput
997
1002
  await CustomAlert({
998
1003
  title: i18next.t('title.inventory_in_current_location'),
999
1004
  text: i18next.t('text.kindly_continue_inspect_the_inventory'),
1000
1005
  confirmButton: { text: i18next.t('button.okay') }
1001
1006
  })
1002
1007
  }}"
1008
+ @not-in-cc="${async e => {
1009
+ history.back()
1010
+ this.viewType = VIEW_TYPE.INVENTORY_SELECTED
1011
+ this.updateContext(this.viewType)
1012
+ await CustomAlert({
1013
+ title: i18next.t('title.inventory_not_found'),
1014
+ text: i18next.t('text.pallet_(x)_is_not_found_in_cycle_count_worksheet_(y)', {
1015
+ x: e.detail.palletId,
1016
+ y: e.detail.cycleCountNo
1017
+ }),
1018
+ confirmButton: { text: i18next.t('button.okay') }
1019
+ })
1020
+ }}"
1003
1021
  ></check-inventory-popup>
1004
1022
  `,
1005
1023
  {
@@ -1276,7 +1294,7 @@ class InspectingProduct extends connect(store)(localize(i18next)(PageView)) {
1276
1294
  return response.data.checkInventoryOwner
1277
1295
  }
1278
1296
  } catch (e) {
1279
- this.showToast(e)
1297
+ return false
1280
1298
  }
1281
1299
  }
1282
1300
 
@@ -1348,7 +1366,7 @@ class InspectingProduct extends connect(store)(localize(i18next)(PageView)) {
1348
1366
  throw new Error(i18next.t('text.x_should_be_positive', { state: { x: i18next.t('field.inspected_uom_value') } }))
1349
1367
  }
1350
1368
 
1351
- const locationName = this.locationInput.value
1369
+ const locationName = this.locationInput?.value
1352
1370
  if (!locationName) {
1353
1371
  this.selectOnInput(this.locationInput)
1354
1372
  throw new Error(i18next.t('text.invalid_x', { state: { x: i18next.t('label.location') } }))
@@ -202,7 +202,7 @@ class InventoryCheckList extends localize(i18next)(PageView) {
202
202
  header: i18next.t('field.execution_date'),
203
203
  key: 'executionDate',
204
204
  width: 30,
205
- type: 'date'
205
+ type: 'string'
206
206
  }
207
207
  },
208
208
  {
@@ -451,7 +451,7 @@ class InventoryCheckList extends localize(i18next)(PageView) {
451
451
  record[column.imex.key] = column.imex.key
452
452
  .split('.')
453
453
  .reduce((obj, key) => (obj && obj[key] !== 'undefined' ? obj[key] : undefined), item)
454
- if (column.type === 'datetime') {
454
+ if (column.type === 'datetime' && record[column.imex.key] !== '' && record[column.imex.key] !== null) {
455
455
  record[column.imex.key] = new Date(parseInt(record[column.imex.key])).toLocaleString()
456
456
  }
457
457
  return record
@@ -7,6 +7,7 @@ import './print-location-label'
7
7
  import gql from 'graphql-tag'
8
8
  import { css, html } from 'lit-element'
9
9
  import { connect } from 'pwa-helpers/connect-mixin'
10
+ import isEmpty from 'lodash-es/isEmpty'
10
11
 
11
12
  import { DirectPrinter } from '@things-factory/barcode-base'
12
13
  import { i18next, localize } from '@things-factory/i18n-base'
@@ -15,6 +16,7 @@ import { client, CustomAlert, PageView, store } from '@things-factory/shell'
15
16
  import { CommonButtonStyles, ScrollbarStyles } from '@things-factory/styles'
16
17
  import { isMobileDevice } from '@things-factory/utils'
17
18
 
19
+ import { getCodeByName } from '@things-factory/code-base'
18
20
  import { LOCATION_LABEL_SETTING_KEY, LOCATION_STATUS, LOCATION_TYPE } from '../constants'
19
21
  import { showToast } from '../../util'
20
22
 
@@ -414,13 +416,31 @@ class LocationList extends connect(store)(localize(i18next)(PageView)) {
414
416
 
415
417
  async importHandler(patches) {
416
418
  try {
417
- if (
418
- patches.some(
419
- p => (!p.name || !p.type || !p.zone || !p.row || !p.column || !p.shelf || !p.status) && p.cuFlag == '+'
420
- )
421
- ) {
422
- throw new Error(i18next.t('text.empty_value_in_list'))
423
- }
419
+ let records = this.dataGrist.data.records
420
+ const locationType = await getCodeByName('LOCATION_TYPE')
421
+ const locationStatus = await getCodeByName('LOCATION_STATUS')
422
+ patches = patches.map(itm => {
423
+ // Error if there is an empty value
424
+ if (isEmpty(itm.name) || isEmpty(itm.type) || isEmpty(itm.zone) || isEmpty(itm.column) || isEmpty(itm.shelf) || isEmpty(itm.status) || '')
425
+ {
426
+ throw new Error(i18next.t('text.empty_value_in_list'))
427
+ }
428
+ // Error if location name is already existed
429
+ if (records.find(exist => exist.name == itm.name)) {
430
+ throw new Error(i18next.t('text.location_name(s)_already_existed'))
431
+ }
432
+ // Error if location status does not exist
433
+ let foundLocationType = locationType.find(exist => exist.name == itm.type)
434
+ if (!foundLocationType) {
435
+ throw new Error(i18next.t('text.location_type_does_not_exist'))
436
+ }
437
+ // Error if location type does not exist
438
+ let foundLocationStatus = locationStatus.find(exist => exist.name == itm.status)
439
+ if (!foundLocationStatus) {
440
+ throw new Error(i18next.t('text.location_status_does_not_exist'))
441
+ }
442
+ return itm
443
+ })
424
444
  if (patches && patches.length) {
425
445
  patches = patches.map(patch => {
426
446
  if (this._warehouseId) {
@@ -596,6 +616,7 @@ class LocationList extends connect(store)(localize(i18next)(PageView)) {
596
616
  text: i18next.t('text.you_wont_be_able_to_revert_this'),
597
617
  type: 'warning',
598
618
  confirmButton: { text: i18next.t('button.delete_all'), color: '#22a6a7' },
619
+
599
620
  cancelButton: { text: i18next.t('button.cancel'), color: '#cfcfcf' },
600
621
  callback: async result => {
601
622
  if (result.value && name !== '') {
@@ -608,6 +629,7 @@ class LocationList extends connect(store)(localize(i18next)(PageView)) {
608
629
  variables: { warehouseId: this._warehouseId }
609
630
  })
610
631
  if (!response.errors) this._clearTempLocation()
632
+ this.showToast({ message: i18next.t('text.all_locations_are_deleted') })
611
633
  }
612
634
  }
613
635
  })
@@ -13,6 +13,7 @@ import { REUSABLE_PALLET_LABEL_SETTING_KEY } from '../constants'
13
13
  import { DirectPrinter } from '@things-factory/barcode-base'
14
14
  import gql from 'graphql-tag'
15
15
  import { showToast } from '../../util/index'
16
+ import isEmpty from 'lodash-es/isEmpty'
16
17
 
17
18
  class PalletList extends connect(store)(localize(i18next)(PageView)) {
18
19
  static get properties() {
@@ -291,8 +292,35 @@ class PalletList extends connect(store)(localize(i18next)(PageView)) {
291
292
 
292
293
  async importHandler(patches) {
293
294
  try {
294
- if (patches.some(p => (!p.name || !p.owner || !p.holder || !p.status) && p.cuFlag == '+'))
295
- throw new Error(i18next.t('text.empty_value_in_list'))
295
+ const _palletStatus = await getCodeByName('PALLET_STATUS')
296
+ const getBizplace = await this.fetchBizplaces()
297
+ let records = this.dataGrist.data.records
298
+ patches = patches.map(itm => {
299
+ // Error if there is an empty value
300
+ if (isEmpty(itm.name) || isEmpty(itm.status) || isEmpty(itm.holder.name) || isEmpty(itm.owner.name) || ''){
301
+ throw new Error(i18next.t('text.empty_value_in_list'))
302
+ }
303
+ // Error if location name is already existed
304
+ if (records.find(exist => exist.name == itm.name)) {
305
+ throw new Error(i18next.t('text.pallet_name(s)_is_already_existed'))
306
+ }
307
+ // Error if pallet status is does not exist
308
+ let foundPalletStatus = _palletStatus.find(exist => exist.name == itm.status)
309
+ if (!foundPalletStatus) {
310
+ throw new Error(i18next.t('text.pallet_status_does_not_exist'))
311
+ }
312
+ // Error if the owner is not belong to the domain or doesn't exist
313
+ let foundOwner = getBizplace.find(exist => exist.name == itm.owner.name)
314
+ if (!foundOwner){
315
+ throw new Error(i18next.t('text.invalid_owner'))
316
+ }
317
+ // Error if the holder is not belong to the domain or doesn't exist
318
+ let foundHolder = getBizplace.find(exist=>exist.name == itm.holder.name)
319
+ if (!foundHolder) {
320
+ throw new Error(i18next.t('text.invalid_holder'))
321
+ }
322
+ return itm
323
+ })
296
324
 
297
325
  patches = patches.map(p => {
298
326
  return { ...p, cuFlag: '' }
@@ -362,6 +390,26 @@ class PalletList extends connect(store)(localize(i18next)(PageView)) {
362
390
  }
363
391
  }
364
392
 
393
+ async fetchBizplaces(bizplace = []) {
394
+ const response = await client.query({
395
+ query: gql`
396
+ query bizplaces($filters: [Filter!]) {
397
+ bizplaces(filters: $filters) {
398
+ items {
399
+ id
400
+ name
401
+ description
402
+ }
403
+ }
404
+ }
405
+ `,
406
+ variables: {
407
+ filters: [...bizplace]
408
+ }
409
+ })
410
+ return response.data.bizplaces.items
411
+ }
412
+
365
413
  async _deletePallet() {
366
414
  CustomAlert({
367
415
  title: i18next.t('text.are_you_sure'),
@@ -409,7 +457,7 @@ class PalletList extends connect(store)(localize(i18next)(PageView)) {
409
457
  return this.config.columns
410
458
  }
411
459
 
412
- _exportableData() {
460
+ async _exportableData() {
413
461
  let records = []
414
462
  if (this.dataGrist.selected && this.dataGrist.selected.length > 0) {
415
463
  records = this.dataGrist.selected
@@ -417,29 +465,30 @@ class PalletList extends connect(store)(localize(i18next)(PageView)) {
417
465
  records = this.dataGrist.data.records
418
466
  }
419
467
 
468
+ const getBizplace = await this.fetchBizplaces()
469
+
420
470
  var headerSetting = this.dataGrist._config.columns
421
471
  .filter(column => column.type !== 'gutter' && column.record !== undefined && column.imex !== undefined)
422
472
  .map(column => {
473
+ if (column.imex.key == 'holder.name') {
474
+ column.imex.arrData = getBizplace.map(item => {
475
+ return {
476
+ id: item.id,
477
+ name: item.name
478
+ }
479
+ })
480
+ }
481
+ if (column.imex.key == 'owner.name') {
482
+ column.imex.arrData = getBizplace.map(item => {
483
+ return {
484
+ id: item.id,
485
+ name: item.name
486
+ }
487
+ })
488
+ }
423
489
  return column.imex
424
490
  })
425
491
 
426
- let holders = this.dataGrist.data.records.map(r => r.holder)
427
- let owners = this.dataGrist.data.records.map(r => r.owner)
428
-
429
- headerSetting = headerSetting.map(column => {
430
- switch (column.key) {
431
- case 'holder.name':
432
- column.arrData = holders
433
- break
434
- case 'owner.name':
435
- column.arrData = owners
436
- break
437
- default:
438
- break
439
- }
440
- return column
441
- })
442
-
443
492
  var data = records.map(item => {
444
493
  return {
445
494
  id: item.id,
@@ -336,12 +336,17 @@ class ToteList extends connect(store)(localize(i18next)(PageView)) {
336
336
  }
337
337
 
338
338
  async importHandler(patches) {
339
+ let existedToteStatus = this._toteStatus
339
340
  try {
340
341
  patches.map(itm => {
341
342
  if (itm.cuFlag == '+') {
342
343
  if (!itm.bizplace?.id || !itm.status || !itm.name) {
343
344
  throw new Error(i18next.t('text.empty_value_in_list'))
344
345
  }
346
+ let foundToteStatus = existedToteStatus.find(exist => exist.name == itm.status)
347
+ if (!foundToteStatus) {
348
+ throw new Error(i18next.t('text.tote_status_does_not_exist'))
349
+ }
345
350
  }
346
351
  })
347
352
 
@@ -14,6 +14,7 @@ import { fetchSettingRule } from '@things-factory/setting-ui'
14
14
  import { client, CustomAlert, navigate, PageView, store } from '@things-factory/shell'
15
15
  import { CommonButtonStyles } from '@things-factory/styles'
16
16
  import { flattenObject, isMobileDevice } from '@things-factory/utils'
17
+ import isEmpty from 'lodash-es/isEmpty'
17
18
 
18
19
  import { DRAFT_RELEASE_ORDER_STATUS, PRODUCT_GROUP_TYPES } from '../../../constants'
19
20
 
@@ -223,6 +224,7 @@ class DraftReleaseGoodDetail extends connect(store)(localize(i18next)(PageView))
223
224
  get context() {
224
225
  let actions = []
225
226
 
227
+ // first time getting the draft order data
226
228
  if (this._draftOrderData) {
227
229
  actions = [
228
230
  {
@@ -480,6 +482,7 @@ class DraftReleaseGoodDetail extends connect(store)(localize(i18next)(PageView))
480
482
 
481
483
  if (!this._packingTypes) this._packingTypes = await getCodeByName('PACKING_TYPES')
482
484
 
485
+ // getting orderNo and see whether it's enw or existing draft order
483
486
  let orderNo = changes.resourceId || this._orderNo
484
487
  this._orderNo = orderNo == 'new' ? '' : orderNo
485
488
  await this._fetchOrder()
@@ -860,10 +863,10 @@ class DraftReleaseGoodDetail extends connect(store)(localize(i18next)(PageView))
860
863
 
861
864
  if (!response.errors) {
862
865
  this._draftOrderData = {
866
+ // this is where data is
863
867
  ...response.data.draftReleaseGoodByName
864
868
  // shippingOrder: this._exportOption ? this._serializeForm(this._shippingOrderForm) : null
865
869
  }
866
-
867
870
  this._productData = {
868
871
  records: response.data.draftReleaseGoodByName.orderProducts.map(itm => {
869
872
  return {
@@ -1033,6 +1036,17 @@ class DraftReleaseGoodDetail extends connect(store)(localize(i18next)(PageView))
1033
1036
  if (this._productGrist.dirtyData.records.some(record => !record.releaseQty))
1034
1037
  throw new Error(i18next.t('text.invalid_release_qty'))
1035
1038
 
1039
+
1040
+ if (this._draftOrderData.bizplace.id != null)
1041
+ {
1042
+ // check changes in form info
1043
+ let checkFormInfoChange = this._serializeForm(this._draftReleaseOrderForm).refNo == this._draftOrderData.refNo && this._serializeForm(this._draftReleaseOrderForm).refNo2 == this._draftOrderData.refNo2 && this._serializeForm(this._draftReleaseOrderForm).refNo3 == this._draftOrderData.refNo3 && this._serializeForm(this._draftReleaseOrderForm).releaseDate == this._draftOrderData.releaseDate && this._serializeForm(this._draftReleaseOrderForm).collectionOrderNo == this._draftOrderData.collectionOrderNo
1044
+
1045
+ // check changes in product
1046
+ let checkProductDataChange = this._compareArray(this._productGrist.dirtyData.records, this.___draftOrderData.orderProducts)
1047
+ if (checkFormInfoChange == true && checkProductDataChange != true)
1048
+ throw new Error(i18next.t('text.nothing_changed'))
1049
+ }
1036
1050
  return true
1037
1051
  }
1038
1052
 
@@ -1041,6 +1055,23 @@ class DraftReleaseGoodDetail extends connect(store)(localize(i18next)(PageView))
1041
1055
  return formData
1042
1056
  }
1043
1057
 
1058
+ _compareArray(a, b) {
1059
+ // Comparing the length of each array
1060
+ if (a.length != b.length) return true
1061
+ else {
1062
+ for (var i = 0; i < a.length; i++) {
1063
+ // compare releaseQty of both array
1064
+ if (a[i].releaseQty != b[i].releaseQty) {
1065
+ return true
1066
+ }
1067
+ // compare product of both array
1068
+ if (a[i].product.id != b[i].product.id) {
1069
+ return true
1070
+ }
1071
+ }
1072
+ }
1073
+ }
1074
+
1044
1075
  _getOrderProducts() {
1045
1076
  return this._productGrist.dirtyData.records.map(record => {
1046
1077
  let orderProduct = {
@@ -268,7 +268,7 @@ class ReceivedNoteDetail extends localize(i18next)(PageView) {
268
268
  type: 'string'
269
269
  },
270
270
  {
271
- header: i18next.t('field.batch_no'),
271
+ header: i18next.t('field.sku'),
272
272
  key: 'productSKU',
273
273
  width: 25,
274
274
  type: 'string'
@@ -2635,7 +2635,6 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
2635
2635
  }
2636
2636
  productDetail {
2637
2637
  id
2638
- name
2639
2638
  }
2640
2639
  }
2641
2640
  }
@@ -2775,7 +2774,6 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
2775
2774
  }
2776
2775
  productDetail {
2777
2776
  id
2778
- name
2779
2777
  }
2780
2778
  }
2781
2779
  }
@@ -1920,6 +1920,7 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
1920
1920
  this._validateForm()
1921
1921
 
1922
1922
  let releaseOrder = this._getFormInfo()
1923
+
1923
1924
  delete releaseOrder.warehouseTransport
1924
1925
  delete releaseOrder.bizplaceId
1925
1926
  delete releaseOrder.bizplaceName
@@ -1927,6 +1928,25 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
1927
1928
  delete releaseOrder.ganNo
1928
1929
  delete releaseOrder.recall
1929
1930
 
1931
+ let formChanged
1932
+ for (const key in releaseOrder) {
1933
+ if (releaseOrder.hasOwnProperty(key) && releaseOrder[key] !== this._releaseOrder[key]) {
1934
+ if (
1935
+ !(
1936
+ (releaseOrder[key] == '' || releaseOrder[key] == null) &&
1937
+ (this._releaseOrder[key] == '' || this._releaseOrder[key] == null)
1938
+ )
1939
+ ) {
1940
+ formChanged = true
1941
+ break
1942
+ }
1943
+ }
1944
+ }
1945
+
1946
+ if (!formChanged) {
1947
+ throw new Error(i18next.t('text.there_is_nothing_changed'))
1948
+ }
1949
+
1930
1950
  let shippingOrderInfo = {}
1931
1951
 
1932
1952
  let contactPointInfo = this._serializeForm(this.shippingInfoForm)
@@ -301,6 +301,10 @@ class CreateReturnOrder extends localize(i18next)(PageView) {
301
301
  }
302
302
  }
303
303
 
304
+ get _document() {
305
+ return this.shadowRoot.querySelector('#uploadDocument')
306
+ }
307
+
304
308
  pageInitialized() {
305
309
  this._configureInventoryGrist()
306
310
  }
@@ -325,6 +325,7 @@ class DeliveryOrderList extends localize(i18next)(PageView) {
325
325
  async fetchHandler({ page, limit, sorters = [] }) {
326
326
  let filters = this.searchForm.queryFilters
327
327
  var tzoffset = new Date().getTimezoneOffset() * 60
328
+ if (!this._validateDateRange()) return
328
329
 
329
330
  const response = await client.query({
330
331
  query: gql`
@@ -413,6 +414,20 @@ class DeliveryOrderList extends localize(i18next)(PageView) {
413
414
  }
414
415
  }
415
416
 
417
+ _validateDateRange() {
418
+ if (this._fromDateInput.value === '') {
419
+ this._showToast({ message: i18next.t('text.from_date_cannot_be_empty') })
420
+ return false
421
+ } else if (this._toDateInput.value === '') {
422
+ this._showToast({ message: i18next.t('text.to_date_cannot_be_empty') })
423
+ return false
424
+ } else if (this._fromDateInput.value > this._toDateInput.value) {
425
+ this._showToast({ message: i18next.t('text.to_date_cannot_be_before_from_date') })
426
+ return false
427
+ }
428
+ return true
429
+ }
430
+
416
431
  _compareValues(key, order = 'asc') {
417
432
  return function innerSort(a, b) {
418
433
  if (!a.hasOwnProperty(key) || !b.hasOwnProperty(key)) {
@@ -481,6 +496,17 @@ class DeliveryOrderList extends localize(i18next)(PageView) {
481
496
 
482
497
  this._toDateInput.min = min
483
498
  }
499
+
500
+ _showToast({ type, message }) {
501
+ document.dispatchEvent(
502
+ new CustomEvent('notify', {
503
+ detail: {
504
+ type,
505
+ message
506
+ }
507
+ })
508
+ )
509
+ }
484
510
  }
485
511
 
486
512
  window.customElements.define('delivery-order-list', DeliveryOrderList)
@@ -370,7 +370,9 @@ class PackingWorksheetList extends localize(i18next)(PageView) {
370
370
  async _activateWorksheet() {
371
371
  try {
372
372
  let selectedItem = this.dataGrist.selected.filter(i => i.status == 'DEACTIVATED')
373
- if (selectedItem.length > 0) {
373
+ if (selectedItem.length <= 0) {
374
+ this._showToast({ message: 'No orders have been selected' })
375
+ } else {
374
376
  const result = await CustomAlert({
375
377
  title: i18next.t('title.are_you_sure'),
376
378
  text: i18next.t('text.activate_packing_worksheet'),
@@ -145,9 +145,9 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
145
145
 
146
146
  if (
147
147
  (this.releaseGoodId || this.taskNo) &&
148
- this._selectedOrderInventory?.status !== 'MISSING' &&
148
+ (this._selectedOrderInventory?.status && this._selectedOrderInventory?.status !== 'MISSING') &&
149
149
  this._selectedOrderInventory?.hasMissingInventoryChanges !== true &&
150
- this._selectedOrderInventory?.status !== 'DONE'
150
+ (this._selectedOrderInventory?.status && this._selectedOrderInventory?.status !== 'DONE')
151
151
  ) {
152
152
  actions.push({
153
153
  title: i18next.t('button.missing_stock'),
@@ -504,19 +504,19 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
504
504
  if (this.palletInput) this.palletInput.value = ''
505
505
  if (this.serialInput) this.serialInput.value = ''
506
506
 
507
- this._selectedOrderInventory = record
508
-
509
507
  await this.fetchInventories(
510
508
  this.refPickingType === PICKING_TYPES.PICKING.value ? this.releaseGoodNo : this.taskNo
511
509
  )
512
510
 
513
- this.focusOnInput
511
+ this.focusOnInput()
514
512
  let updatedRecords = this._selectedOrderInventory
515
513
  if (updatedRecords.releaseQty === updatedRecords.pickedQty) {
516
514
  updatedRecords.status = 'DONE'
517
515
  } else {
518
516
  updatedRecords.status = 'PICKING'
519
517
  }
518
+ this._selectedOrderInventory = record
519
+ this.updateContext()
520
520
  }
521
521
  } catch (ex) {
522
522
  console.log(ex)
@@ -1637,6 +1637,7 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
1637
1637
  }
1638
1638
 
1639
1639
  this.updateContext()
1640
+ // if (this.data.records.every(record => record.completed))
1640
1641
  }
1641
1642
 
1642
1643
  async fetchPalletsHandler(releaseGoodNo) {
@@ -1918,7 +1919,7 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
1918
1919
 
1919
1920
  async showWorksheetList() {
1920
1921
  await sleep(1010)
1921
- openPopup(html` <show-my-worksheet-list-popup></show-my-worksheet-list-popup> `, {
1922
+ openPopup(html` <show-my-worksheet-list-popup .type=${this.refPickingType}></show-my-worksheet-list-popup> `, {
1922
1923
  backdrop: true,
1923
1924
  size: 'small',
1924
1925
  title: i18next.t('title.my_worksheet_list')
@@ -10,7 +10,8 @@ class ShowMyWorksheetListPopup extends localize(i18next)(LitElement) {
10
10
  return {
11
11
  pendingNum: Number,
12
12
  pickingNum: Number,
13
- userId: String
13
+ userId: String,
14
+ type: String
14
15
  }
15
16
  }
16
17
 
@@ -55,11 +56,19 @@ class ShowMyWorksheetListPopup extends localize(i18next)(LitElement) {
55
56
  }
56
57
 
57
58
  goToPendingList() {
58
- navigate(`single_outbound_worksheets?status=${WORKSHEET_STATUS.DEACTIVATED.value}&assigneeId=${this.userId}`)
59
+ if (this.type == 'PICKING') {
60
+ navigate(`single_outbound_worksheets?status=${WORKSHEET_STATUS.DEACTIVATED.value}&assigneeId=${this.userId}`)
61
+ } else {
62
+ navigate(`merged_outbound_worksheets?status=${WORKSHEET_STATUS.DEACTIVATED.value}&assigneeId=${this.userId}`)
63
+ }
59
64
  }
60
65
 
61
66
  goToPickingList() {
62
- navigate(`single_outbound_worksheets?status=${WORKSHEET_STATUS.EXECUTING.value}&assigneeId=${this.userId}`)
67
+ if (this.type == 'PICKING') {
68
+ navigate(`single_outbound_worksheets?status=${WORKSHEET_STATUS.EXECUTING.value}&assigneeId=${this.userId}`)
69
+ } else {
70
+ navigate(`merged_outbound_worksheets?status=${WORKSHEET_STATUS.EXECUTING.value}&assigneeId=${this.userId}`)
71
+ }
63
72
  }
64
73
 
65
74
  async getPickingAssignmentStatus() {