@things-factory/operato-wms 4.3.576 → 4.3.577

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.
@@ -192,6 +192,7 @@ class BulkOperation extends localize(i18next)(PageView) {
192
192
  sku: '',
193
193
  batchId: '',
194
194
  batchIdRef: '',
195
+ lotId:'',
195
196
  packingType: '',
196
197
  packingSize: 0,
197
198
  uom: '',
@@ -543,6 +544,7 @@ class BulkOperation extends localize(i18next)(PageView) {
543
544
  uom: raw.uom && raw.uom != '' ? String(raw.uom) : null,
544
545
  packQty: parseInt(raw.packQty || 0),
545
546
  palletQty: parseInt(raw.palletQty || 0),
547
+ palletId: String(raw.lotId || ''),
546
548
  unitPrice: raw.unitPrice,
547
549
  manufactureDate: this._getStdDateStr(mfgDate),
548
550
  etaDate: this._getStdDateStr(etaDate)
@@ -9,6 +9,8 @@ import { client, CustomAlert } from '@things-factory/shell'
9
9
  import { ScrollbarStyles } from '@things-factory/styles'
10
10
  import { isMobileDevice, sleep } from '@things-factory/utils'
11
11
 
12
+ import { fetchSettingRule } from '../../fetch-setting-value'
13
+
12
14
  class ValidateGanPopup extends localize(i18next)(LitElement) {
13
15
  static get properties() {
14
16
  return {
@@ -169,6 +171,12 @@ class ValidateGanPopup extends localize(i18next)(LitElement) {
169
171
  header: i18next.t('field.batch_no_ref'),
170
172
  width: 150
171
173
  },
174
+ {
175
+ type: 'string',
176
+ name: 'palletId',
177
+ header: i18next.t('field.lot_id'),
178
+ width: 100
179
+ },
172
180
  {
173
181
  type: 'integer',
174
182
  name: 'packQty',
@@ -247,8 +255,14 @@ class ValidateGanPopup extends localize(i18next)(LitElement) {
247
255
  `
248
256
  }
249
257
 
258
+ constructor() {
259
+ super()
260
+ this._enableLotIdInput = false
261
+ }
262
+
250
263
  async firstUpdated() {
251
264
  this._ganConfig = this._config
265
+ this._enableLotIdInput = await fetchSettingRule('enable-lot-id-input')
252
266
  await this._getValidatedArrivalNoticeItems(this.records, this.bizplaceId)
253
267
  }
254
268
 
@@ -296,6 +310,7 @@ class ValidateGanPopup extends localize(i18next)(LitElement) {
296
310
  uomValue
297
311
  totalUomValue
298
312
  palletQty
313
+ palletId
299
314
  unitPrice
300
315
  manufactureDate
301
316
  errorMsg
@@ -345,6 +360,7 @@ class ValidateGanPopup extends localize(i18next)(LitElement) {
345
360
  uom: raw.uom,
346
361
  packQty: raw.packQty,
347
362
  palletQty: raw.palletQty,
363
+ palletId: raw.palletId,
348
364
  unitPrice: parseFloat(raw.unitPrice),
349
365
  manufactureDate: new Date(parseInt(raw.manufactureDate))
350
366
  }
@@ -394,6 +410,26 @@ class ValidateGanPopup extends localize(i18next)(LitElement) {
394
410
  if (this.records.some(record => record.errorMsg && record.errorMsg != '')) {
395
411
  throw new Error(i18next.t('text.please_recheck_your_request_data'))
396
412
  }
413
+ if (this._enableLotIdInput == false) {
414
+ let batchIds = this.records
415
+ .map(item => item.batchId)
416
+ .filter(batchId => batchId !== null)
417
+ .map(batchId => batchId.toLowerCase())
418
+
419
+ let uniqueBatchIds = new Set(batchIds)
420
+ if (uniqueBatchIds.size !== batchIds.length) {
421
+ throw new Error(i18next.t('text.duplicated_batch_id'))
422
+ }
423
+ } else {
424
+ let palletIds = this.records
425
+ .map(item => item.palletId)
426
+ .filter(palletId => palletId !== null)
427
+
428
+ let uniquePalletIds = new Set(palletIds);
429
+ if (uniquePalletIds.size !== palletIds.length) {
430
+ throw new Error(i18next.t('text.duplicated_lot_id'));
431
+ }
432
+ }
397
433
  }
398
434
 
399
435
  _getStdDateStr(date) {
@@ -10,6 +10,7 @@ import { client, store } from '@things-factory/shell'
10
10
  import { isMobileDevice } from '@things-factory/utils'
11
11
 
12
12
  import { PALLET_LABEL_SETTING_KEY } from '../constants'
13
+ import { fetchSettingRule } from '../../fetch-setting-value'
13
14
 
14
15
  class PalletLabelPopup extends connect(store)(localize(i18next)(LitElement)) {
15
16
  static get properties() {
@@ -17,7 +18,8 @@ class PalletLabelPopup extends connect(store)(localize(i18next)(LitElement)) {
17
18
  config: Object,
18
19
  data: Object,
19
20
  pallets: Object,
20
- _palletLabel: Object
21
+ _palletLabel: Object,
22
+ _enableLotIdInput: Boolean
21
23
  }
22
24
  }
23
25
 
@@ -53,7 +55,8 @@ class PalletLabelPopup extends connect(store)(localize(i18next)(LitElement)) {
53
55
  ]
54
56
  }
55
57
 
56
- firstUpdated() {
58
+ async firstUpdated() {
59
+ this._enableLotIdInput = await fetchSettingRule('enable-lot-id-input')
57
60
  this.config = {
58
61
  pagination: { infinite: true },
59
62
  rows: { selectable: { multiple: true }, appendable: false },
@@ -61,6 +64,14 @@ class PalletLabelPopup extends connect(store)(localize(i18next)(LitElement)) {
61
64
  columns: [
62
65
  { type: 'gutter', gutterName: 'sequence' },
63
66
  { type: 'gutter', gutterName: 'row-selector', multiple: true },
67
+ ...(this._enableLotIdInput
68
+ ? [{
69
+ type: 'string',
70
+ name: 'palletId',
71
+ header: i18next.t('field.lot_id'),
72
+ width: 200
73
+ }]
74
+ : []),
64
75
  {
65
76
  type: 'string',
66
77
  name: 'batchId',
@@ -111,6 +122,11 @@ class PalletLabelPopup extends connect(store)(localize(i18next)(LitElement)) {
111
122
  `
112
123
  }
113
124
 
125
+ constructor() {
126
+ super()
127
+ this._enableLotIdInput = false
128
+ }
129
+
114
130
  updated(changeProps) {
115
131
  if (changeProps.has('pallets')) {
116
132
  if (this.pallets && this.pallets.records && this.pallets.records.length) {
@@ -118,7 +134,6 @@ class PalletLabelPopup extends connect(store)(localize(i18next)(LitElement)) {
118
134
  records: this.pallets.records
119
135
  .map(record => ({ ...record, startSeq: 1 }))
120
136
  }
121
- //console.log(this.data.records)
122
137
  }
123
138
  }
124
139
  }
@@ -35,6 +35,7 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
35
35
  _enableProductScanning: Boolean,
36
36
  __minInboundShelfLife: Number,
37
37
  _enableCartonLabel: Boolean,
38
+ _enableLotIdInput: Boolean,
38
39
  _enableInputQty: Number,
39
40
  _isLooseItem: Boolean,
40
41
  _isQtyChecked: Boolean,
@@ -392,6 +393,7 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
392
393
  this._enableCartonLabel = false
393
394
  this._enableInputQty = 0
394
395
  this._enableProductScanning = false
396
+ this._enableLotIdInput = false
395
397
  this.__minInboundShelfLife = 0
396
398
  this._isLooseItem = false
397
399
  this._isQtyChecked = false
@@ -425,7 +427,8 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
425
427
  async pageInitialized() {
426
428
  this._pageSettings = {
427
429
  ...this._pageSettings,
428
- cameraScanOnly: await fetchSettingRule('camera-scan-only')
430
+ cameraScanOnly: await fetchSettingRule('camera-scan-only'),
431
+ enableLotIdInput : await fetchSettingRule('enable-lot-id-input')
429
432
  }
430
433
 
431
434
  this.orderProductConfig = {
@@ -468,6 +471,7 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
468
471
  'packingSize',
469
472
  'batchId',
470
473
  'batchIdRef',
474
+ 'palletId',
471
475
  'palletQty',
472
476
  'actualPalletQty',
473
477
  'packQty',
@@ -598,6 +602,22 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
598
602
  width: 30
599
603
  }
600
604
  },
605
+ ...(this._pageSettings.enableLotIdInput
606
+ ? [
607
+ {
608
+ type: 'string',
609
+ name: 'palletId',
610
+ label: true,
611
+ header: i18next.t('field.lot_id'),
612
+ width: 150,
613
+ imex: {
614
+ type: 'string',
615
+ key: 'palletId',
616
+ width: 25
617
+ }
618
+ }
619
+ ]
620
+ : []),
601
621
  {
602
622
  type: 'integer',
603
623
  name: 'palletQty',
@@ -735,6 +755,7 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
735
755
  packingSize
736
756
  packingType
737
757
  palletQty
758
+ palletId
738
759
  actualPalletQty
739
760
  packQty
740
761
  actualPackQty
@@ -1042,8 +1063,10 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
1042
1063
  this._productBarcode = this.productBarcodeInput.value
1043
1064
  }
1044
1065
  if (!this._enableCartonLabel) return this._unloadSelected()
1066
+ if (this._pageSettings.enableLotIdInput) {
1067
+ this._palletId = this.palletId.value
1068
+ }
1045
1069
  let orderProducts = await this._validateUnloading()
1046
-
1047
1070
  if (!orderProducts || !orderProducts.errors) {
1048
1071
  this.orderProductData = { records: [] }
1049
1072
  if (orderProducts?.length > 1) {
@@ -1192,6 +1215,12 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
1192
1215
  }
1193
1216
  }
1194
1217
 
1218
+ async _checkLotInput(){
1219
+ if (this._selectedOrderProduct.palletId)
1220
+ if (this.lotInput.value !== this._selectedOrderProduct.palletId)
1221
+ throw new Error(i18next.t('text.incorrect_lot_id'))
1222
+ }
1223
+
1195
1224
  async _qtyUnload() {
1196
1225
  if (this._scanning) return this._showToast({ message: i18next.t('text.previous_scan_is_executing') })
1197
1226
  this._scanning = true
@@ -1473,6 +1502,10 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
1473
1502
 
1474
1503
  await this._checkExpiryFormat()
1475
1504
  }
1505
+
1506
+ if (this._pageSettings.enableLotIdInput){
1507
+ await this._checkLotInput()
1508
+ }
1476
1509
  }
1477
1510
 
1478
1511
  if (this._enableProductScanning) {
@@ -1706,7 +1739,6 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
1706
1739
  async _unloadSelected() {
1707
1740
  try {
1708
1741
  if (!this._selectedOrderProduct) throw new Error(i18next.t('text.target_is_not_selected'))
1709
- if (!this.lotInput.value) return
1710
1742
  await this._validateUnloading()
1711
1743
  await this._checkedLotScannedProduct()
1712
1744
 
@@ -538,6 +538,7 @@ class WorksheetUnloading extends localize(i18next)(PageView) {
538
538
  remark
539
539
  totalUomValue
540
540
  palletQty
541
+ palletId
541
542
  }
542
543
  status
543
544
  issue
@@ -869,6 +869,12 @@ class ArrivalNoticeDetail extends localize(i18next)(PageView) {
869
869
  header: i18next.t('field.pallet_qty'),
870
870
  width: 80
871
871
  },
872
+ {
873
+ type: 'string',
874
+ name: 'palletId',
875
+ header: i18next.t('field.lot_id'),
876
+ width: 150
877
+ },
872
878
  {
873
879
  type: 'date',
874
880
  name: 'manufactureDate',
@@ -914,6 +920,7 @@ class ArrivalNoticeDetail extends localize(i18next)(PageView) {
914
920
  'packQty',
915
921
  'totalUomValue',
916
922
  'palletQty',
923
+ 'palletId',
917
924
  'manufactureDate',
918
925
  'batchIdRef',
919
926
  'unitPrice',
@@ -1006,6 +1013,7 @@ class ArrivalNoticeDetail extends localize(i18next)(PageView) {
1006
1013
  totalUomValue
1007
1014
  adjustedTotalUomValue
1008
1015
  palletQty
1016
+ palletId
1009
1017
  adjustedPalletQty
1010
1018
  manufactureDate
1011
1019
  releaseQty
@@ -1620,6 +1628,7 @@ class ArrivalNoticeDetail extends localize(i18next)(PageView) {
1620
1628
  batchId
1621
1629
  packingType
1622
1630
  palletQty
1631
+ palletId
1623
1632
  }
1624
1633
  }
1625
1634
  }
@@ -40,6 +40,7 @@ class CreateArrivalNotice extends localize(i18next)(PageView) {
40
40
  _crossDocking: Boolean,
41
41
  _hasContainer: Boolean,
42
42
  _looseItem: Boolean,
43
+ _enableLotIdInput: Boolean,
43
44
  _files: Array,
44
45
  _disableCrossDockingSetting: Boolean,
45
46
  _hideCrossDockingSetting: Boolean,
@@ -413,6 +414,7 @@ class CreateArrivalNotice extends localize(i18next)(PageView) {
413
414
  this._crossDocking = false
414
415
  this._orderType = null
415
416
  this._enableTransportationServiceSetting = false
417
+ this._enableLotIdInput = false
416
418
  this._enableTransportForCustomClearanceSetting = false
417
419
  this._disableTransport = false
418
420
  this._strictProductSelection = false
@@ -464,6 +466,7 @@ class CreateArrivalNotice extends localize(i18next)(PageView) {
464
466
  async pageInitialized() {
465
467
  this._enableTransportationServiceSetting = await fetchSettingRule('enable-transportation-service')
466
468
  this._enableTransportForCustomClearanceSetting = await fetchSettingRule('enable-custom-clearance-transportation')
469
+ this._enableLotIdInput = await fetchSettingRule('enable-lot-id-input')
467
470
  this._disableCrossDockingSetting = await fetchSettingRule('disable-cross-dock')
468
471
  this._hideCrossDockingSetting = await fetchSettingRule('hide-cross-dock')
469
472
  this._bizplaces = await this.fetchBizplaces()
@@ -711,6 +714,16 @@ class CreateArrivalNotice extends localize(i18next)(PageView) {
711
714
  record: { editable: editable, options: { min: 0 } },
712
715
  width: 80
713
716
  },
717
+ ...(this._enableLotIdInput
718
+ ? [{
719
+ type: 'string',
720
+ name: 'palletId',
721
+ header: i18next.t('field.lot_id'),
722
+ imex: { header: i18next.t('field.lot_id'), key: 'palletId', width: 25, type: 'string' },
723
+ record: { editable: editable },
724
+ width: 150
725
+ }]
726
+ : []),
714
727
  {
715
728
  type: 'date',
716
729
  name: 'manufactureDate',
@@ -936,19 +949,35 @@ class CreateArrivalNotice extends localize(i18next)(PageView) {
936
949
 
937
950
  _checkProductDuplication() {
938
951
  // batchId, product.id, packingType
939
- let isDuplicated = false
940
- const completedRows = this.productGrist.dirtyData.records
941
- .filter(record => record.batchId && record.product && record.product.id && record.packingType)
942
- .map(record => `${record.batchId}-${record.product.id}-${record.packingType}`)
943
-
944
- completedRows.forEach((row, idx, rows) => {
945
- if (rows.lastIndexOf(row) !== idx) {
946
- isDuplicated = true
952
+ if (!this._enableLotIdInput) {
953
+ let isDuplicated = false
954
+ const completedRows = this.productGrist.dirtyData.records
955
+ .filter(record => record.batchId && record.product && record.product.id && record.packingType)
956
+ .map(record => `${record.batchId.toLowerCase()}-${record.product.id}-${record.packingType}`)
957
+
958
+ completedRows.forEach((row, idx, rows) => {
959
+ if (rows.lastIndexOf(row) !== idx) {
960
+ isDuplicated = true
961
+ }
962
+ })
963
+ if (isDuplicated) {
964
+ throw new Error(i18next.t('text.there_is_duplicated_products'))
947
965
  }
948
- })
966
+ } else {
967
+ let isDuplicated = false
968
+ const completedRows = this.productGrist.dirtyData.records
969
+ .filter(record => record.palletId)
970
+ .map(record => `${record.palletId}`)
971
+
972
+ completedRows.forEach((row, idx, rows) => {
973
+ if (rows.lastIndexOf(row) !== idx) {
974
+ isDuplicated = true
975
+ }
976
+ })
949
977
 
950
- if (isDuplicated) {
951
- throw new Error(i18next.t('text.there_is_duplicated_products'))
978
+ if (isDuplicated) {
979
+ throw new Error(i18next.t('Lot ID is already in used. Please use a new Lot ID'))
980
+ }
952
981
  }
953
982
  }
954
983
 
@@ -1377,7 +1406,8 @@ class CreateArrivalNotice extends localize(i18next)(PageView) {
1377
1406
  totalUomValue: record?.totalUomValue ? record?.totalUomValue : 0,
1378
1407
  unitPrice: record?.unitPrice ? record.unitPrice : 0,
1379
1408
  remark: record?.remark ? record.remark : null,
1380
- manufactureDate: record?.manufactureDate ? record.manufactureDate : null
1409
+ manufactureDate: record?.manufactureDate ? record.manufactureDate : null,
1410
+ palletId: record?.palletId ? record.palletId : null
1381
1411
  }
1382
1412
 
1383
1413
  if (record.palletQty) orderProduct.palletQty = record.palletQty
@@ -1634,6 +1664,15 @@ class CreateArrivalNotice extends localize(i18next)(PageView) {
1634
1664
  imex: { header: i18next.t('field.pallet_qty'), key: 'palletQty', width: 25, type: 'float' },
1635
1665
  width: 100
1636
1666
  },
1667
+ ...(this._enableLotIdInput
1668
+ ? [{
1669
+ type: 'string',
1670
+ name: 'palletId',
1671
+ header: i18next.t('field.lot_id'),
1672
+ imex: { header: i18next.t('field.lot_id'), key: 'palletId', width: 25, type: 'string' },
1673
+ width: 100
1674
+ }]
1675
+ : []),
1637
1676
  {
1638
1677
  type: 'date',
1639
1678
  name: 'manufactureDate',
@@ -1696,6 +1735,7 @@ class CreateArrivalNotice extends localize(i18next)(PageView) {
1696
1735
  totalUomValue
1697
1736
  packQty
1698
1737
  palletQty
1738
+ palletId
1699
1739
  manufactureDate
1700
1740
  batchId
1701
1741
  batchIdRef
@@ -1729,6 +1769,20 @@ class CreateArrivalNotice extends localize(i18next)(PageView) {
1729
1769
  if (foundErrors) {
1730
1770
  return this._showToast({ message: i18next.t('text.invalid_product_sku') })
1731
1771
  }
1772
+
1773
+ if (this._enableLotIdInput) {
1774
+ let palletIds = response.data.bulkUploadValidateOrderProducts
1775
+ .map(item => item.palletId)
1776
+ .filter(palletId => palletId !== null);
1777
+
1778
+ let uniquePalletIds = new Set(palletIds);
1779
+ let isDuplicated = uniquePalletIds.size !== palletIds.length;
1780
+ if (isDuplicated) {
1781
+ return this._showToast({ message: i18next.t('text.duplicated_lot_id') })
1782
+ }
1783
+ }
1784
+
1785
+
1732
1786
  if (!foundErrors) {
1733
1787
  if (!response.errors) {
1734
1788
  const data = response.data.bulkUploadValidateOrderProducts.map(item => {
@@ -9,6 +9,7 @@ import { openPopup } from '@things-factory/layout-base'
9
9
  import { client, CustomAlert } from '@things-factory/shell'
10
10
  import { ScrollbarStyles } from '@things-factory/styles'
11
11
  import { isMobileDevice } from '@things-factory/utils'
12
+ import { fetchSettingRule } from '../../../fetch-setting-value'
12
13
 
13
14
  import { ORDER_PRODUCT_STATUS } from '../../constants'
14
15
 
@@ -146,6 +147,7 @@ export class EditProductPopup extends localize(i18next)(LitElement) {
146
147
  }
147
148
 
148
149
  async firstUpdated() {
150
+ this.enableLotIdInput = await fetchSettingRule('enable-lot-id-input')
149
151
  this.editProductConfig = {
150
152
  pagination: { infinite: true },
151
153
  rows: { selectable: { multiple: true }, appendable: false },
@@ -161,6 +163,7 @@ export class EditProductPopup extends localize(i18next)(LitElement) {
161
163
  'packQty',
162
164
  'totalUomValue',
163
165
  'palletQty',
166
+ 'palletId',
164
167
  'manufactureDate',
165
168
  'batchIdRef',
166
169
  'unitPrice',
@@ -241,6 +244,12 @@ export class EditProductPopup extends localize(i18next)(LitElement) {
241
244
  record: { editable: true, options: { min: 0 } },
242
245
  width: 80
243
246
  },
247
+ {
248
+ type: 'string',
249
+ name: 'palletId',
250
+ header: i18next.t('field.lot_id'),
251
+ width: 80
252
+ },
244
253
  {
245
254
  type: 'date',
246
255
  name: 'manufactureDate',
@@ -291,6 +300,7 @@ export class EditProductPopup extends localize(i18next)(LitElement) {
291
300
  'packQty',
292
301
  'totalUomValue',
293
302
  'palletQty',
303
+ 'palletId',
294
304
  'manufactureDate',
295
305
  'batchIdRef',
296
306
  'unitPrice',
@@ -382,6 +392,13 @@ export class EditProductPopup extends localize(i18next)(LitElement) {
382
392
  record: { editable: true, options: { min: 0 } },
383
393
  width: 80
384
394
  },
395
+ {
396
+ type: 'string',
397
+ name: 'palletId',
398
+ header: i18next.t('field.lot_id'),
399
+ record: { editable: true },
400
+ width: 120
401
+ },
385
402
  {
386
403
  type: 'date',
387
404
  name: 'manufactureDate',
@@ -484,10 +501,8 @@ export class EditProductPopup extends localize(i18next)(LitElement) {
484
501
  if (changedColumn === 'uom' && !uom)
485
502
  throw new Error(i18next.t('text.x_is_empty', { state: { x: i18next.t('label.uom') } }))
486
503
  if (uomValue && uom) {
487
- if (packQty !== 0)
488
- calcedRecord.totalUomValue = `${(uomValue * packQty).toFixed(2)} ${uom}`
489
- if (packQty === 0)
490
- calcedRecord.totalUomValue = `0 ${uom}`
504
+ if (packQty !== 0) calcedRecord.totalUomValue = `${(uomValue * packQty).toFixed(2)} ${uom}`
505
+ if (packQty === 0) calcedRecord.totalUomValue = `0 ${uom}`
491
506
  } else {
492
507
  calcedRecord.totalUomValue = ''
493
508
  }
@@ -541,9 +556,37 @@ export class EditProductPopup extends localize(i18next)(LitElement) {
541
556
 
542
557
  _checkProductDuplication() {
543
558
  let isDuplicated = false
544
- const addedNewRows = this.addProductGrist.dirtyData.records
545
- .filter(record => record.batchId && record.product && record.product.id && record.packingType)
546
- .map(record => `${record.batchId}-${record.product.id}-${record.packingType}`)
559
+ if (!this.enableLotIdInput) {
560
+ const addedNewRows = this.addProductGrist.dirtyData.records
561
+ .filter(record => record.batchId && record.product && record.product.id && record.packingType)
562
+ .map(record => `${record.batchId}-${record.product.id}-${record.packingType}`)
563
+
564
+ addedNewRows.forEach((row, idx, rows) => {
565
+ if (rows.lastIndexOf(row) !== idx) {
566
+ isDuplicated = true
567
+ }
568
+ })
569
+
570
+ const existingRows = this.editProductGrist.dirtyData.records
571
+ .filter(record => record.batchId && record.product && record.product.id && record.packingType)
572
+ .map(record => `${record.batchId}-${record.product.id}-${record.packingType}`)
573
+
574
+ existingRows.forEach((row, idx, rows) => {
575
+ if (rows.lastIndexOf(row) !== idx) {
576
+ isDuplicated = true
577
+ }
578
+ })
579
+
580
+ const matchingRow = addedNewRows.filter(newRow => existingRows.includes(newRow))
581
+ if (matchingRow?.length > 0) isDuplicated = true
582
+
583
+ if (isDuplicated) {
584
+ throw new Error(i18next.t('text.duplicated_lot_id'))
585
+ }
586
+ }else if (this.enableLotIdInput) {
587
+ const addedNewRows = this.addProductGrist.dirtyData.records
588
+ .filter(record => record.palletId)
589
+ .map(record => `${record.palletId}`)
547
590
 
548
591
  addedNewRows.forEach((row, idx, rows) => {
549
592
  if (rows.lastIndexOf(row) !== idx) {
@@ -552,8 +595,8 @@ export class EditProductPopup extends localize(i18next)(LitElement) {
552
595
  })
553
596
 
554
597
  const existingRows = this.editProductGrist.dirtyData.records
555
- .filter(record => record.batchId && record.product && record.product.id && record.packingType)
556
- .map(record => `${record.batchId}-${record.product.id}-${record.packingType}`)
598
+ .filter(record => record.palletId )
599
+ .map(record => `${record.palletId}`)
557
600
 
558
601
  existingRows.forEach((row, idx, rows) => {
559
602
  if (rows.lastIndexOf(row) !== idx) {
@@ -565,7 +608,8 @@ export class EditProductPopup extends localize(i18next)(LitElement) {
565
608
  if (matchingRow?.length > 0) isDuplicated = true
566
609
 
567
610
  if (isDuplicated) {
568
- throw new Error(i18next.t('text.there_is_duplicated_products'))
611
+ throw new Error(i18next.t('text.there_is_duplicated_lot_id'))
612
+ }
569
613
  }
570
614
  }
571
615
 
@@ -612,7 +656,6 @@ export class EditProductPopup extends localize(i18next)(LitElement) {
612
656
 
613
657
  async _addEditProducts(approveAdminAddEditProducts) {
614
658
  try {
615
-
616
659
  this._validateProducts()
617
660
 
618
661
  let existingOrderProducts = []
@@ -677,27 +720,28 @@ export class EditProductPopup extends localize(i18next)(LitElement) {
677
720
  record.unitPrice = parseFloat(record.unitPrice)
678
721
  return {
679
722
  batchId: isStatusPending ? record.batchId : `N/A`,
680
- adjustedBatchId: !(isStatusPending) ? record.batchId : null,
681
- palletQty: isStatusPending ? (record.palletQty ? record.palletQty : 0 ): 0,
682
- adjustedPalletQty: !(isStatusPending) ? (record?.palletQty ? record.palletQty : null) : null,
723
+ adjustedBatchId: !isStatusPending ? record.batchId : null,
724
+ palletQty: isStatusPending ? (record.palletQty ? record.palletQty : 0) : 0,
725
+ adjustedPalletQty: !isStatusPending ? (record?.palletQty ? record.palletQty : null) : null,
726
+ palletId: isStatusPending ? record.palletId : `N/A`,
683
727
  product: { id: record.product.id },
684
728
  productDetail: { id: record.productDetailId },
685
729
  packingType: isStatusPending ? record.packingType : 'N/A',
686
- adjustedPackingType: !(isStatusPending) ? record.packingType : null,
730
+ adjustedPackingType: !isStatusPending ? record.packingType : null,
687
731
  uomValue: isStatusPending ? record.uomValue : 0,
688
732
  status: ORDER_PRODUCT_STATUS.ADDED.value,
689
- adjustedUomValue: !(isStatusPending) ? (record?.uomValue ? record.uomValue : 0) : null,
733
+ adjustedUomValue: !isStatusPending ? (record?.uomValue ? record.uomValue : 0) : null,
690
734
  uom: isStatusPending ? record.uom : 'N/A',
691
- adjustedUom: !(isStatusPending) ? record.uom : null,
692
- packQty: isStatusPending ? (record.packQty ? record.packQty : 0 ): 0,
693
- adjustedPackQty: !(isStatusPending) ? record.packQty : null,
735
+ adjustedUom: !isStatusPending ? record.uom : null,
736
+ packQty: isStatusPending ? (record.packQty ? record.packQty : 0) : 0,
737
+ adjustedPackQty: !isStatusPending ? record.packQty : null,
694
738
  totalUomValue: isStatusPending ? record.totalUomValue : 'N/A',
695
- adjustedTotalUomValue: record?.totalUomValue && !(isStatusPending) ? record.totalUomValue : 'N/A',
739
+ adjustedTotalUomValue: record?.totalUomValue && !isStatusPending ? record.totalUomValue : 'N/A',
696
740
  manufactureDate: record?.manufactureDate ? record.manufactureDate : null,
697
741
  batchIdRef: isStatusPending ? record?.batchIdRef : 'N/A',
698
- adjustedBatchIdRef: record?.batchIdRef && !(isStatusPending) ? record.batchIdRef : null,
742
+ adjustedBatchIdRef: record?.batchIdRef && !isStatusPending ? record.batchIdRef : null,
699
743
  unitPrice: isStatusPending ? record.unitPrice : 0,
700
- adjustedUnitPrice: record?.unitPrice && !(isStatusPending) ? record.unitPrice : null,
744
+ adjustedUnitPrice: record?.unitPrice && !isStatusPending ? record.unitPrice : null,
701
745
  remark: record?.remark ? record.remark : null,
702
746
  packingSize: record.packingSize || record.product.packingSize
703
747
  }
@@ -712,18 +756,47 @@ export class EditProductPopup extends localize(i18next)(LitElement) {
712
756
  record.unitPrice = parseFloat(record.unitPrice)
713
757
  editedOrderProducts.push({
714
758
  id: record.id,
715
- adjustedBatchId: !(isStatusPending) ? (record.batchId === record.__origin__.batchId ? null : record.batchId) : null,
716
- adjustedBatchIdRef: !(isStatusPending) ? (record.batchIdRef === record.__origin__.batchIdRef ? null : record.batchIdRef) : null,
717
- adjustedPalletQty: !(isStatusPending) ? (record.palletQty === record.__origin__.palletQty ? null : record.palletQty) : null,
759
+ adjustedBatchId: !isStatusPending
760
+ ? record.batchId === record.__origin__.batchId
761
+ ? null
762
+ : record.batchId
763
+ : null,
764
+ adjustedBatchIdRef: !isStatusPending
765
+ ? record.batchIdRef === record.__origin__.batchIdRef
766
+ ? null
767
+ : record.batchIdRef
768
+ : null,
769
+ adjustedPalletQty: !isStatusPending
770
+ ? record.palletQty === record.__origin__.palletQty
771
+ ? null
772
+ : record.palletQty
773
+ : null,
718
774
  product: { id: record.product.id },
719
775
  productDetail: { id: record.productDetail.id },
720
- adjustedPackingType: !(isStatusPending) ? (record.packingType === record.__origin__.packingType ? null : record.packingType) : null,
721
- adjustedUomValue: !(isStatusPending) ? (record.uomValue == record.__origin__.uomValue ? null : record.uomValue) : null,
722
- adjustedUom: !(isStatusPending) ? (record.uom === record.__origin__.uom ? null : record.uom) : null,
723
- adjustedPackQty: !(isStatusPending) ? (record.packQty == record.__origin__.packQty ? null : record.packQty) : null,
724
- adjustedTotalUomValue: !(isStatusPending) ? (record.totalUomValue == record.__origin__.totalUomValue ? null : record.totalUomValue) : null,
776
+ adjustedPackingType: !isStatusPending
777
+ ? record.packingType === record.__origin__.packingType
778
+ ? null
779
+ : record.packingType
780
+ : null,
781
+ adjustedUomValue: !isStatusPending
782
+ ? record.uomValue == record.__origin__.uomValue
783
+ ? null
784
+ : record.uomValue
785
+ : null,
786
+ adjustedUom: !isStatusPending ? (record.uom === record.__origin__.uom ? null : record.uom) : null,
787
+ adjustedPackQty: !isStatusPending
788
+ ? record.packQty == record.__origin__.packQty
789
+ ? null
790
+ : record.packQty
791
+ : null,
792
+ adjustedTotalUomValue: !isStatusPending
793
+ ? record.totalUomValue == record.__origin__.totalUomValue
794
+ ? null
795
+ : record.totalUomValue
796
+ : null,
725
797
  manufactureDate: record?.manufactureDate ? record.manufactureDate : null,
726
- adjustedUnitPrice: record?.unitPrice && !(isStatusPending) ? record.unitPrice : null,
798
+ palletId: record?.palletId ? record.palletId : null,
799
+ adjustedUnitPrice: record?.unitPrice && !isStatusPending ? record.unitPrice : null,
727
800
  remark: record?.remark ? record.remark : null,
728
801
  ...(isStatusPending && {
729
802
  unitPrice: record.unitPrice,
@@ -736,7 +809,6 @@ export class EditProductPopup extends localize(i18next)(LitElement) {
736
809
  batchId: record.batchId,
737
810
  totalUomValue: record.totalUomValue
738
811
  })
739
-
740
812
  })
741
813
  })
742
814
  }
@@ -755,17 +827,17 @@ export class EditProductPopup extends localize(i18next)(LitElement) {
755
827
  !record.uom ||
756
828
  !record.packQty
757
829
  ).length
758
- ){
830
+ ) {
759
831
  throw new Error(i18next.t('text.empty_value_in_add_product_list'))
760
832
  }
761
- this.editProductGrist.dirtyData.records.forEach(record => {
762
- if (record.packQty === 0 && !record.remark) {
763
- throw new Error(i18next.t('text.remark_is_empty_kindly_fill_in_to_proceed'));
764
- }
765
- if (isNaN(record.packQty)) {
766
- throw new Error(i18next.t('text.pack_qty_is_empty_kindly_fill_in_to_proceed'))
767
- }
768
- });
833
+ this.editProductGrist.dirtyData.records.forEach(record => {
834
+ if (record.packQty === 0 && !record.remark) {
835
+ throw new Error(i18next.t('text.remark_is_empty_kindly_fill_in_to_proceed'))
836
+ }
837
+ if (isNaN(record.packQty)) {
838
+ throw new Error(i18next.t('text.pack_qty_is_empty_kindly_fill_in_to_proceed'))
839
+ }
840
+ })
769
841
  }
770
842
 
771
843
  async fetchUserRoleHandler() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/operato-wms",
3
- "version": "4.3.576",
3
+ "version": "4.3.577",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "client/index.js",
6
6
  "things-factory": true,
@@ -91,7 +91,7 @@
91
91
  "@things-factory/print-ui": "^4.3.535",
92
92
  "@things-factory/product-base": "^4.3.563",
93
93
  "@things-factory/resource-ui": "^4.3.563",
94
- "@things-factory/sales-ui": "^4.3.576",
94
+ "@things-factory/sales-ui": "^4.3.577",
95
95
  "@things-factory/scene-data-transform": "^4.3.534",
96
96
  "@things-factory/scene-excel": "^4.3.534",
97
97
  "@things-factory/scene-firebase": "^4.3.534",
@@ -108,7 +108,7 @@
108
108
  "@things-factory/transport-base": "^4.3.563",
109
109
  "@things-factory/tutorial-ui": "^4.3.563",
110
110
  "@things-factory/warehouse-base": "^4.3.567",
111
- "@things-factory/worksheet-base": "^4.3.576"
111
+ "@things-factory/worksheet-base": "^4.3.577"
112
112
  },
113
113
  "devDependencies": {
114
114
  "@things-factory/builder": "^4.3.534",
@@ -117,5 +117,5 @@
117
117
  "cypress-localstorage-commands": "^1.6.1",
118
118
  "eslint-plugin-cypress": "^2.12.1"
119
119
  },
120
- "gitHead": "3d86963fea8f1f4dd05f30f316250bc493cb10ad"
120
+ "gitHead": "e98c76f52f07989c011d10335d9c4a99485b61a5"
121
121
  }
@@ -511,6 +511,7 @@
511
511
  "field.packing_uom_value": "packing uom value",
512
512
  "field.packing": "packing",
513
513
  "field.paid_amount": "paid amount",
514
+ "field.pallet_id": "pallet id",
514
515
  "field.pallet_qty": "pallet qty",
515
516
  "field.pallet_total": "pallet total",
516
517
  "field.pallet": "pallet",
@@ -1430,6 +1431,8 @@
1430
1431
  "text.driver_is_empty": "driver name is empty",
1431
1432
  "text.driver_is_not_selected": "driver is not selected",
1432
1433
  "text.duplicate_entry_in_vas_details": "duplicate entry in vas details",
1434
+ "text.duplicated_lot_id": "duplicated lot id",
1435
+ "text.duplicated_batch_id": "duplicated batch id",
1433
1436
  "text.duplicated_romoval_on_same_sn": "duplicated removal on same serial no",
1434
1437
  "text.duplicated_value_field": "duplicated value ({field})",
1435
1438
  "text.duplicated_vas_on_same_batch": "duplicated vas on same batch",
@@ -1479,6 +1482,7 @@
1479
1482
  "text.inbound": "inbound",
1480
1483
  "text.incomplete_container_information": "incomplete container information",
1481
1484
  "text.incorrect_product_barcode": "incorrect product barcode",
1485
+ "text.incorrect_lot_id": "incorrect lot id",
1482
1486
  "text.info_delete_successfully": "info delete successfully",
1483
1487
  "text.info_update_successfully": "info update successfully",
1484
1488
  "text.initialise_logistics": "initialise logistics",
@@ -1413,6 +1413,8 @@
1413
1413
  "text.driver_is_empty": "[ko] driver name is empty",
1414
1414
  "text.driver_is_not_selected": "운송기사가 선택되지 않았습니다",
1415
1415
  "text.duplicated_vas_on_same_batch": "같은 배치에 동일한 서비스가 존재합니다",
1416
+ "text.duplicated_lot_id": "[ko] duplicated lot id",
1417
+ "text.duplicated_batch_id": "[ko] duplicated batch id",
1416
1418
  "text.edit_add_order_product": "[ko]edit add order product",
1417
1419
  "text.edited_batch_no_have_been_processed": "수정된 배치 번호가 처리 되었습니다",
1418
1420
  "text.empty_field_in_delivery_information": "[ko] empty field(s) in delivery information",
@@ -1461,6 +1463,7 @@
1461
1463
  "text.inbound": "[ko]inbound",
1462
1464
  "text.incomplete_container_information": "[ko]incomplete container information",
1463
1465
  "text.incomplete_shipment_field": "[ko]incomplete shipment field",
1466
+ "text.incorrect_lot_id": "[ko] incorrect lot id",
1464
1467
  "text.info_created_successfully": "info created successfully",
1465
1468
  "text.info_delete_successfully": "정보가 성공적으로 삭제되었습니다",
1466
1469
  "text.info_update_successfully": "정보가 성공적으로 수정되었습니다",
@@ -1385,6 +1385,8 @@
1385
1385
  "text.driver_is_empty": "[ms] driver name is empty",
1386
1386
  "text.driver_is_not_selected": "pemandu tidak dipilih",
1387
1387
  "text.duplicated_vas_on_same_batch": "salinan value added service pada kumpulan yang sama",
1388
+ "text.duplicated_lot_id": "[ms] duplicated lot id",
1389
+ "text.duplicated_batch_id": "[ms] duplicated batch id",
1388
1390
  "text.edit_add_order_product": "[ms]edit add order product",
1389
1391
  "text.edited_batch_no_have_been_processed": "edited batch no have been processed",
1390
1392
  "text.empty_field_in_delivery_information": "[ms] empty field(s) in delivery information",
@@ -1428,6 +1430,7 @@
1428
1430
  "text.inbound": "[ms]inbound",
1429
1431
  "text.incomplete_container_information": "[ms]incomplete container information",
1430
1432
  "text.incomplete_shipment_field": "[ms]incomplete shipment field",
1433
+ "text.incorrect_lot_id": "[ms] incorrect lot id",
1431
1434
  "text.info_delete_successfully": "info telah dipadam",
1432
1435
  "text.info_update_successfully": "info telah dikemaskinikan",
1433
1436
  "text.initialise_logistics": "initialise logistics",
@@ -474,6 +474,7 @@
474
474
  "field.packing_uom_value": "packing uom value",
475
475
  "field.packing": "packing",
476
476
  "field.paid_amount": "[zh]paid amount",
477
+ "field.pallet_id": "[zh] pallet id",
477
478
  "field.pallet_qty": "pallet qty",
478
479
  "field.pallet_total": "pallet total",
479
480
  "field.pallet": "pallet",
@@ -1352,6 +1353,8 @@
1352
1353
  "text.driver_is_empty": "[zh] driver name is empty",
1353
1354
  "text.driver_is_not_selected": "driver is not selected",
1354
1355
  "text.duplicated_vas_on_same_batch": "duplicated vas on same batch",
1356
+ "text.duplicated_lot_id": "[zh] duplicated lot id",
1357
+ "text.duplicated_batch_id": "[zh] duplicated batch id",
1355
1358
  "text.edit_add_order_product": "[zh]edit add order product",
1356
1359
  "text.edited_batch_no_have_been_processed": "edited batch no have been processed",
1357
1360
  "text.empty_field_in_delivery_information": "[zh] empty field(s) in delivery information",
@@ -1395,6 +1398,7 @@
1395
1398
  "text.inbound": "[zh]inbound",
1396
1399
  "text.incomplete_container_information": "[zh]incomplete container information",
1397
1400
  "text.incomplete_shipment_field": "[zh]incomplete shipment field",
1401
+ "text.incorrect_lot_id": "[zh] incorrect lot id",
1398
1402
  "text.info_delete_successfully": "info delete successfully",
1399
1403
  "text.info_update_successfully": "info update successfully",
1400
1404
  "text.initialise_logistics": "initialise logistics",