@things-factory/operato-wms 4.3.772 → 4.3.774

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.
@@ -1076,6 +1076,7 @@ class PutawayProduct extends connect(store)(localize(i18next)(PageView)) {
1076
1076
  id
1077
1077
  name
1078
1078
  }
1079
+ conditionOfGoods
1079
1080
  completed
1080
1081
  packingTypeSize
1081
1082
  reusablePalletName
@@ -2053,7 +2054,11 @@ class PutawayProduct extends connect(store)(localize(i18next)(PageView)) {
2053
2054
 
2054
2055
  this.data = {
2055
2056
  records: worksheetDetailInfos.map(itm => {
2056
- return { ...itm, location: itm.status === WORKSHEET_STATUS.DONE.value ? itm.location : null }
2057
+ return {
2058
+ ...itm,
2059
+ location: itm.status === WORKSHEET_STATUS.DONE.value ? itm.location : null,
2060
+ displayConditionOfGoods: this._formatConditionOfGoods(itm.conditionOfGoods)
2061
+ }
2057
2062
  })
2058
2063
  }
2059
2064
 
@@ -236,11 +236,11 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
236
236
  }
237
237
 
238
238
  get cartonInput() {
239
- return this.shadowRoot.querySelector('barcode-scanable-input[name=cartonId]').shadowRoot.querySelector('input')
239
+ return this.shadowRoot.querySelector('barcode-scanable-input[name=cartonId]')?.shadowRoot?.querySelector('input')
240
240
  }
241
241
 
242
242
  get serialNumberInput() {
243
- return this.shadowRoot.querySelector('barcode-scanable-input[name=serialNumber]').shadowRoot.querySelector('input')
243
+ return this.shadowRoot.querySelector('barcode-scanable-input[name=serialNumber]')?.shadowRoot?.querySelector('input')
244
244
  }
245
245
 
246
246
  get completable() {
@@ -356,7 +356,7 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
356
356
  }
357
357
 
358
358
  get lotInput() {
359
- return this.shadowRoot.querySelector('barcode-scanable-input[name=lotId]').shadowRoot.querySelector('input')
359
+ return this.shadowRoot.querySelector('barcode-scanable-input[name=lotId]')?.shadowRoot?.querySelector('input')
360
360
  }
361
361
 
362
362
  get orderProductGrist() {
@@ -408,17 +408,17 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
408
408
  }
409
409
 
410
410
  if (this._enableCartonLabel) {
411
- if (this._enableProductScanning) {
411
+ if (this._enableProductScanning && this.productBarcodeInput) {
412
412
  this.productBarcodeInput.readOnly = false
413
413
  this.productBarcodeInput.value = ''
414
414
  }
415
415
  if (unflattenedRecord.product?.isRequireSerialNumberScanningInbound) {
416
- this.serialNumberInput.value = ''
416
+ if (this.serialNumberInput) this.serialNumberInput.value = ''
417
417
  }
418
- this.cartonInput.value = ''
418
+ if (this.cartonInput) this.cartonInput.value = ''
419
419
  this._focusOnCartonInput()
420
420
  } else {
421
- this.lotInput.value = ''
421
+ if (this.lotInput) this.lotInput.value = ''
422
422
  this._focusOnLotInput()
423
423
  }
424
424
  }
@@ -736,17 +736,17 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
736
736
  }
737
737
 
738
738
  if (this._enableCartonLabel) {
739
- if (this._enableProductScanning) {
739
+ if (this._enableProductScanning && this.productBarcodeInput) {
740
740
  this.productBarcodeInput.readOnly = false
741
741
  this.productBarcodeInput.value = ''
742
742
  }
743
743
  if (record.product?.isRequireSerialNumberScanningInbound) {
744
- this.serialNumberInput.value = ''
744
+ if (this.serialNumberInput) this.serialNumberInput.value = ''
745
745
  }
746
- this.cartonInput.value = ''
746
+ if (this.cartonInput) this.cartonInput.value = ''
747
747
  this._focusOnCartonInput()
748
748
  } else {
749
- this.lotInput.value = ''
749
+ if (this.lotInput) this.lotInput.value = ''
750
750
  this._focusOnLotInput()
751
751
  }
752
752
  }
@@ -1191,19 +1191,19 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
1191
1191
  }
1192
1192
 
1193
1193
  if (this._isRequireSerialNumberScanningInbound) {
1194
- this.serialNumberInput.value = ''
1194
+ if (this.serialNumberInput) this.serialNumberInput.value = ''
1195
1195
 
1196
1196
  if (this.expDateInput?.value) {
1197
1197
  this.expDateInput.value = null
1198
1198
  }
1199
1199
 
1200
1200
  if (this._enableCartonLabel) {
1201
- this.cartonInput.value = ''
1202
- this.productBarcodeInput.value = ''
1201
+ if (this.cartonInput) this.cartonInput.value = ''
1202
+ if (this.productBarcodeInput) this.productBarcodeInput.value = ''
1203
1203
  this._packingTypeScanned = ''
1204
1204
  this._focusOnCartonInput()
1205
1205
  } else {
1206
- this.lotInput.value = ''
1206
+ if (this.lotInput) this.lotInput.value = ''
1207
1207
  this._focusOnLotInput()
1208
1208
  }
1209
1209
  }
@@ -1396,44 +1396,44 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
1396
1396
 
1397
1397
  _resetInput() {
1398
1398
  if (this._selectedOrderProduct?.isRequiredCheckExpiry && !this._isRequireSerialNumberScanningInbound)
1399
- this.expDateInput.value = null
1399
+ if (this.expDateInput) this.expDateInput.value = null
1400
1400
 
1401
1401
  if (this._isRequiredCheckExpiry && !this._isRequireSerialNumberScanningInbound) {
1402
- this.expDateInput.value = null
1402
+ if (this.expDateInput) this.expDateInput.value = null
1403
1403
  this._focusOnExpiryDateInput()
1404
1404
  }
1405
1405
 
1406
1406
  if (this._selectedOrderProduct?.isRequiredCheckManufactureDate && !this._isRequireSerialNumberScanningInbound)
1407
- this.manufactureDateInput.value = null
1407
+ if (this.manufactureDateInput) this.manufactureDateInput.value = null
1408
1408
 
1409
1409
  if (this._isRequiredCheckManufactureDate && !this._isRequireSerialNumberScanningInbound) {
1410
- this.manufactureDateInput.value = null
1410
+ if (this.manufactureDateInput) this.manufactureDateInput.value = null
1411
1411
  this._focusOnManufactureDateInput()
1412
1412
  }
1413
1413
 
1414
1414
  if (this._enableCartonLabel) {
1415
1415
  if (this._isRequireSerialNumberScanningInbound) {
1416
- if (this.cartonInput.value == '') {
1416
+ if (!this.cartonInput?.value) {
1417
1417
  this._focusOnCartonInput()
1418
1418
  } else {
1419
- this.serialNumberInput.value = ''
1419
+ if (this.serialNumberInput) this.serialNumberInput.value = ''
1420
1420
  this._focusOnSerialNumberInput()
1421
1421
  }
1422
1422
  } else {
1423
1423
  if (this._enableInputQty >= 0 && this._enableInputQty < 4) {
1424
- this.actualQtyInput.value = ''
1424
+ if (this.actualQtyInput) this.actualQtyInput.value = ''
1425
1425
  }
1426
- this.cartonInput.value = ''
1426
+ if (this.cartonInput) this.cartonInput.value = ''
1427
1427
  this._focusOnCartonInput()
1428
1428
  }
1429
1429
  } else {
1430
- if (this.lotInput.value !== '') {
1430
+ if (this.lotInput?.value !== '') {
1431
1431
  if (this._isRequireSerialNumberScanningInbound) {
1432
- this.serialNumberInput.value = ''
1432
+ if (this.serialNumberInput) this.serialNumberInput.value = ''
1433
1433
  this._focusOnSerialNumberInput()
1434
1434
  } else {
1435
- this.lotInput.value = ''
1436
- if (this._enableInputQty >= 0 && this._enableInputQty < 4) this.actualQtyInput.value = ''
1435
+ if (this.lotInput) this.lotInput.value = ''
1436
+ if (this._enableInputQty >= 0 && this._enableInputQty < 4 && this.actualQtyInput) this.actualQtyInput.value = ''
1437
1437
  this._focusOnLotInput()
1438
1438
  }
1439
1439
  }
@@ -1441,7 +1441,7 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
1441
1441
 
1442
1442
  if (this._enableProductScanning) {
1443
1443
  if (!this._isRequireSerialNumberScanningInbound) {
1444
- this.productBarcodeInput.value = ''
1444
+ if (this.productBarcodeInput) this.productBarcodeInput.value = ''
1445
1445
  if (this.cartonInput?.value) {
1446
1446
  this._focusOnProductBarcodeInput()
1447
1447
  }
@@ -1463,7 +1463,7 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
1463
1463
  e.preventDefault()
1464
1464
  try {
1465
1465
  if (this._enableProductScanning) {
1466
- this._productBarcode = this.productBarcodeInput.value
1466
+ this._productBarcode = this.productBarcodeInput?.value
1467
1467
  }
1468
1468
  if (!this._enableCartonLabel) return this._unloadSelected()
1469
1469
  if (this._pageSettings.enableLotIdInput) {
@@ -1499,7 +1499,7 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
1499
1499
  }
1500
1500
 
1501
1501
  try {
1502
- const response = await client.mutate({
1502
+ await client.mutate({
1503
1503
  mutation: gql`
1504
1504
  mutation scanProductUnload(
1505
1505
  $worksheetDetailName: String!
@@ -1517,25 +1517,23 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
1517
1517
  worksheetDetailName: this._selectedOrderProduct.name,
1518
1518
  productBarcode: this._productBarcodeScanned,
1519
1519
  inventory: {
1520
- palletId: this._enableCartonLabel ? null : this.lotInput.value.trim(),
1521
- cartonId: this._enableCartonLabel ? this.cartonInput.value.trim() : null,
1522
- expirationDate: this._isRequiredCheckExpiry ? this.expDateInput.value : null,
1520
+ palletId: this._enableCartonLabel ? null : this.lotInput?.value?.trim(),
1521
+ cartonId: this._enableCartonLabel ? this.cartonInput?.value?.trim() : null,
1522
+ expirationDate: this._isRequiredCheckExpiry ? this.expDateInput?.value : null,
1523
1523
  manufactureDate: this._getManufactureDateValue(),
1524
1524
  conditionOfGoods: this._conditionOfGoods || CONDITION_OF_GOODS.GOOD.value
1525
1525
  }
1526
1526
  }
1527
1527
  })
1528
1528
 
1529
- if (!response.errors) {
1530
- await this._fetchProducts(this._orderNo)
1531
- }
1532
1529
  } catch (e) {
1533
1530
  // for cartonId + product scanning
1534
1531
  // show custom toast for incorrect product barcodes
1535
1532
  // full errors for everything else
1536
- if (!(e instanceof TypeError)) return this._showToast(e)
1537
- this._showToast({ message: i18next.t('text.incorrect_product_barcode') })
1533
+ if (!(e instanceof TypeError)) this._showToast(e)
1534
+ else this._showToast({ message: i18next.t('text.incorrect_product_barcode') })
1538
1535
  } finally {
1536
+ await this._fetchProducts(this._orderNo)
1539
1537
  this._scanning = false
1540
1538
  }
1541
1539
  }
@@ -1546,7 +1544,7 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
1546
1544
  }
1547
1545
  this._scanning = true
1548
1546
 
1549
- if (this.serialNumberInput.value == '') {
1547
+ if (this.serialNumberInput && !this.serialNumberInput.value) {
1550
1548
  this._scanning = false
1551
1549
  this._focusOnSerialNumberInput()
1552
1550
  return this._showToast({ message: i18next.t('text.enter_serial_number') })
@@ -1558,7 +1556,7 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
1558
1556
  }
1559
1557
 
1560
1558
  try {
1561
- const response = await client.mutate({
1559
+ await client.mutate({
1562
1560
  mutation: gql`
1563
1561
  mutation scanSerialNumberUnload(
1564
1562
  $worksheetDetailName: String!
@@ -1574,33 +1572,30 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
1574
1572
  `,
1575
1573
  variables: {
1576
1574
  worksheetDetailName: this._selectedOrderProduct.name,
1577
- serialNumber: this.serialNumberInput.value.trim(),
1575
+ serialNumber: this.serialNumberInput?.value?.trim(),
1578
1576
  inventory: {
1579
- palletId: this._enableCartonLabel ? null : this.lotInput.value.trim(),
1580
- cartonId: this._enableCartonLabel ? this.cartonInput.value.trim() : null,
1581
- expirationDate: this._isRequiredCheckExpiry ? this.expDateInput.value : null,
1577
+ palletId: this._enableCartonLabel ? null : this.lotInput?.value?.trim(),
1578
+ cartonId: this._enableCartonLabel ? this.cartonInput?.value?.trim() : null,
1579
+ expirationDate: this._isRequiredCheckExpiry ? this.expDateInput?.value : null,
1582
1580
  manufactureDate: this._getManufactureDateValue(),
1583
1581
  conditionOfGoods: this._conditionOfGoods || CONDITION_OF_GOODS.GOOD.value
1584
1582
  }
1585
1583
  }
1586
1584
  })
1587
-
1588
- if (!response.errors) {
1589
- await this._fetchProducts(this._orderNo)
1590
- }
1591
1585
  } catch (e) {
1592
1586
  // for cartonId + product scanning
1593
1587
  // show custom toast for incorrect product barcodes
1594
1588
  // full errors for everything else
1595
- if (!(e instanceof TypeError)) return this._showToast(e)
1596
- this._showToast({ message: i18next.t('text.incorrect_serial_number') })
1589
+ if (!(e instanceof TypeError)) this._showToast(e)
1590
+ else this._showToast({ message: i18next.t('text.incorrect_serial_number') })
1597
1591
  } finally {
1592
+ await this._fetchProducts(this._orderNo)
1598
1593
  this._scanning = false
1599
1594
  }
1600
1595
  }
1601
1596
 
1602
1597
  async _checkExpiryFormat() {
1603
- const inputExpDate = this.expDateInput.value
1598
+ const inputExpDate = this.expDateInput?.value
1604
1599
  let intValueYear = parseInt(inputExpDate)
1605
1600
 
1606
1601
  if (intValueYear > 9999) {
@@ -1612,7 +1607,7 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
1612
1607
  async _checkExpiry() {
1613
1608
  let date = new Date()
1614
1609
  const acceptBefore = new Date(date.setDate(date.getDate() + this.__minInboundShelfLife))
1615
- let expiryDate = new Date(this.expDateInput.value)
1610
+ let expiryDate = new Date(this.expDateInput?.value)
1616
1611
  if (expiryDate < acceptBefore) {
1617
1612
  return await CustomAlert({
1618
1613
  title: i18next.t('title.item_unloading_is_expiring_soon'),
@@ -1624,7 +1619,7 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
1624
1619
 
1625
1620
  async _checkLotInput() {
1626
1621
  if (this._selectedOrderProduct.palletId)
1627
- if (this.lotInput.value !== this._selectedOrderProduct.palletId)
1622
+ if (this.lotInput?.value !== this._selectedOrderProduct.palletId)
1628
1623
  throw new Error(i18next.t('text.incorrect_lot_id'))
1629
1624
  }
1630
1625
 
@@ -1639,12 +1634,12 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
1639
1634
 
1640
1635
  try {
1641
1636
  // Add validation for qty
1642
- const qty = parseFloat(this.actualQtyInput.value)
1637
+ const qty = parseFloat(this.actualQtyInput?.value)
1643
1638
  if (isNaN(qty)) {
1644
1639
  throw new Error(i18next.t('text.invalid_quantity'))
1645
1640
  }
1646
1641
 
1647
- const response = await client.mutate({
1642
+ await client.mutate({
1648
1643
  mutation: gql`
1649
1644
  mutation unload(
1650
1645
  $worksheetDetailName: String!
@@ -1671,10 +1666,10 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
1671
1666
  orderType: this.refOrderType === AVAIL_ORDER_TYPES.ARRIVAL_NOTICE.value ? 'arrivalNotice' : 'returnOrder',
1672
1667
  worksheetDetailName: this._selectedOrderProduct?.name || '',
1673
1668
  inventory: {
1674
- palletId: this._enableCartonLabel ? null : this.lotInput.value.trim(),
1675
- cartonId: this._enableCartonLabel ? this.cartonInput.value.trim() : null,
1669
+ palletId: this._enableCartonLabel ? null : this.lotInput?.value?.trim(),
1670
+ cartonId: this._enableCartonLabel ? this.cartonInput?.value?.trim() : null,
1676
1671
  qty: qty, // Use the validated qty
1677
- expirationDate: this._isRequiredCheckExpiry ? this.expDateInput.value : null,
1672
+ expirationDate: this._isRequiredCheckExpiry ? this.expDateInput?.value : null,
1678
1673
  manufactureDate: this._getManufactureDateValue(),
1679
1674
  reusablePallet: this._usingReusablePallet ? this._reusablePallet : null,
1680
1675
  conditionOfGoods: this._conditionOfGoods || CONDITION_OF_GOODS.GOOD.value
@@ -1686,13 +1681,12 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
1686
1681
  : null
1687
1682
  }
1688
1683
  })
1689
- if (!response.errors) {
1690
- await this._fetchProducts(this._orderNo)
1691
- }
1692
1684
  } catch (e) {
1693
1685
  this._showToast(e)
1686
+ } finally {
1687
+ await this._fetchProducts(this._orderNo)
1688
+ this._scanning = false
1694
1689
  }
1695
- this._scanning = false
1696
1690
  }
1697
1691
 
1698
1692
  async fetchProductDetail(gtin, productId) {
@@ -1776,7 +1770,7 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
1776
1770
  if (!response.errors) {
1777
1771
  let orderProductData = this.orderProductData.records
1778
1772
  let checkedProductDetails = response.data.checkGtin.items
1779
- this.productBarcodeInput.value = `${checkedProductDetails[0].gtin}`
1773
+ if (this.productBarcodeInput) this.productBarcodeInput.value = `${checkedProductDetails[0].gtin}`
1780
1774
  this._packingTypeScanned = checkedProductDetails ? `${checkedProductDetails[0].packingType}` : ''
1781
1775
  this._productBarcodeScanned = checkedProductDetails[0].gtin
1782
1776
  this._previousSelectedOrderProduct = this._selectedOrderProduct
@@ -1795,14 +1789,14 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
1795
1789
 
1796
1790
  if (!foundOrderProducts?.length && !foundParentProducts?.length) {
1797
1791
  if (this._enableInputQty >= 0 && this._enableInputQty < 4 && !this._isRequireSerialNumberScanningInbound) {
1798
- if (this.actualQtyInput?.value) this.actualQtyInput.value = ''
1792
+ if (this.actualQtyInput) this.actualQtyInput.value = ''
1799
1793
  }
1800
1794
 
1801
1795
  if (this._isRequireSerialNumberScanningInbound) {
1802
- if (this.serialNumberInput?.value) this.serialNumberInput.value = ''
1796
+ if (this.serialNumberInput) this.serialNumberInput.value = ''
1803
1797
  }
1804
1798
 
1805
- this.productBarcodeInput.value = ''
1799
+ if (this.productBarcodeInput) this.productBarcodeInput.value = ''
1806
1800
  this._focusOnProductBarcodeInput()
1807
1801
  throw new Error(i18next.t('text.no_matching_product_found'))
1808
1802
  }
@@ -1860,7 +1854,7 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
1860
1854
  this._selectedOrderProduct.product.isRequireSerialNumberScanningInbound
1861
1855
  if (e.detail.product.isRequireSerialNumberScanningInbound) {
1862
1856
  this._isRequireSerialNumberScanningInbound = true
1863
- if (!this.serialNumberInput.value) {
1857
+ if (!this.serialNumberInput?.value) {
1864
1858
  this._focusOnSerialNumberInput()
1865
1859
  this._showToast(Error(i18next.t('text.serial_number_is_empty')))
1866
1860
  }
@@ -1885,47 +1879,47 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
1885
1879
 
1886
1880
  async _validateUnloading() {
1887
1881
  if (!this._enableCartonLabel) {
1888
- if (!this.lotInput.value) {
1882
+ if (!this.lotInput?.value) {
1889
1883
  this._focusOnLotInput()
1890
1884
  throw new Error(i18next.t('text.lot_id_is_empty'))
1891
1885
  }
1892
1886
  } else {
1893
- if (!this.cartonInput.value) {
1887
+ if (!this.cartonInput?.value) {
1894
1888
  this._focusOnCartonInput()
1895
1889
  throw new Error(i18next.t('text.carton_id_is_empty'))
1896
1890
  }
1897
1891
  }
1898
-
1892
+
1899
1893
  if (!this._enableProductScanning) {
1900
1894
  if (!this._selectedOrderProduct) throw new Error(i18next.t('text.target_does_not_selected'))
1901
1895
 
1902
1896
  if (this._isRequireSerialNumberScanningInbound) {
1903
- if (!this.serialNumberInput.value) {
1897
+ if (!this.serialNumberInput?.value) {
1904
1898
  this._focusOnSerialNumberInput()
1905
1899
  throw new Error(i18next.t('text.serial_number_is_empty'))
1906
1900
  }
1907
1901
  } else {
1908
1902
  // 4. qty value existing
1909
- if (!parseFloat(this.actualQtyInput.value)) {
1903
+ if (!parseFloat(this.actualQtyInput?.value)) {
1910
1904
  this._focusOnActualQtyInput()
1911
1905
  throw new Error(i18next.t('text.qty_is_empty'))
1912
1906
  }
1913
1907
 
1914
1908
  // 5. qty value has to be positive
1915
- if (!(parseFloat(this.actualQtyInput.value) > 0)) {
1916
- setTimeout(() => this.actualQtyInput.select(), 100)
1909
+ if (!(parseFloat(this.actualQtyInput?.value) > 0)) {
1910
+ setTimeout(() => this.actualQtyInput?.select(), 100)
1917
1911
  throw new Error(i18next.t('text.qty_should_be_positive'))
1918
1912
  }
1919
1913
 
1920
1914
  // Check if quantity has decimals and validate against product settings
1921
- const qty = parseFloat(this.actualQtyInput.value)
1915
+ const qty = parseFloat(this.actualQtyInput?.value)
1922
1916
  if (qty % 1 !== 0 && !this._selectedOrderProduct.product.isInventoryDecimal) {
1923
1917
  throw new Error(i18next.t('text.decimal_quantities_not_allowed'))
1924
1918
  }
1925
1919
  }
1926
1920
 
1927
1921
  if (this._isRequiredCheckExpiry) {
1928
- if (!this.expDateInput.value) {
1922
+ if (!this.expDateInput?.value) {
1929
1923
  this._focusOnExpiryDateInput()
1930
1924
  throw new Error(i18next.t('text.expiry_date_is_empty'))
1931
1925
  }
@@ -1934,7 +1928,7 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
1934
1928
  }
1935
1929
 
1936
1930
  if (this._isRequiredCheckManufactureDate && this.manufactureDateInput?.value) {
1937
- const value = this.manufactureDateInput.value
1931
+ const value = this.manufactureDateInput?.value
1938
1932
  const today = new Date()
1939
1933
  today.setHours(0, 0, 0, 0)
1940
1934
  const manufactureDate = new Date(value)
@@ -1952,7 +1946,7 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
1952
1946
  }
1953
1947
 
1954
1948
  if (this._enableProductScanning) {
1955
- if (!this.productBarcodeInput.value) {
1949
+ if (!this.productBarcodeInput?.value) {
1956
1950
  this._focusOnProductBarcodeInput()
1957
1951
  throw new Error(i18next.t('text.scan_product_barcode'))
1958
1952
  }
@@ -1960,18 +1954,18 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
1960
1954
  let orderProducts = await this._checkedScannedProduct()
1961
1955
 
1962
1956
  if (this._enableInputQty >= 0 && this._enableInputQty < 4 && !this._isRequireSerialNumberScanningInbound) {
1963
- if (!parseFloat(this.actualQtyInput.value)) {
1957
+ if (!parseFloat(this.actualQtyInput?.value)) {
1964
1958
  this._focusOnActualQtyInput()
1965
1959
  throw new Error(i18next.t('text.enter_qty'))
1966
1960
  }
1967
1961
 
1968
- if (!(parseFloat(this.actualQtyInput.value) > 0)) {
1969
- setTimeout(() => this.actualQtyInput.select(), 100)
1962
+ if (!(parseFloat(this.actualQtyInput?.value) > 0)) {
1963
+ setTimeout(() => this.actualQtyInput?.select(), 100)
1970
1964
  throw new Error(i18next.t('text.qty_should_be_positive'))
1971
1965
  }
1972
1966
 
1973
1967
  // Check if quantity has decimals and validate against product settings
1974
- const qty = parseFloat(this.actualQtyInput.value)
1968
+ const qty = parseFloat(this.actualQtyInput?.value)
1975
1969
  if (qty % 1 !== 0 && !this._selectedOrderProduct.product.isInventoryDecimal) {
1976
1970
  throw new Error(i18next.t('text.decimal_quantities_not_allowed'))
1977
1971
  }
@@ -1983,7 +1977,7 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
1983
1977
  }
1984
1978
 
1985
1979
  if (this._isRequiredCheckExpiry) {
1986
- if (!this.expDateInput.value) {
1980
+ if (!this.expDateInput?.value) {
1987
1981
  this._focusOnExpiryDateInput()
1988
1982
  throw new Error(i18next.t('text.expiry_date_is_empty'))
1989
1983
  }
@@ -1992,7 +1986,7 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
1992
1986
  }
1993
1987
 
1994
1988
  if (this._isRequiredCheckManufactureDate && this.manufactureDateInput?.value) {
1995
- const value = this.manufactureDateInput.value
1989
+ const value = this.manufactureDateInput?.value
1996
1990
  const today = new Date()
1997
1991
  today.setHours(0, 0, 0, 0)
1998
1992
  const manufactureDate = new Date(value)
@@ -2134,8 +2128,8 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
2134
2128
  variables: {
2135
2129
  worksheetDetailName: this._selectedOrderProduct?.name || '',
2136
2130
  inventory: {
2137
- palletId: this._enableCartonLabel ? null : this.lotInput.value.trim(),
2138
- cartonId: this._enableCartonLabel ? this.cartonInput.value.trim() : null,
2131
+ palletId: this._enableCartonLabel ? null : this.lotInput?.value?.trim(),
2132
+ cartonId: this._enableCartonLabel ? this.cartonInput?.value?.trim() : null,
2139
2133
  expirationDate: this.expDateInput?.value ? this.expDateInput.value : null,
2140
2134
  manufactureDate: this.manufactureDateInput?.value ? this.manufactureDateInput.value : null
2141
2135
  }
@@ -2144,7 +2138,7 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
2144
2138
 
2145
2139
  if (!response.errors) {
2146
2140
  this._selectedInventory = null
2147
- this.cartonInput.value = ''
2141
+ if (this.cartonInput) this.cartonInput.value = ''
2148
2142
 
2149
2143
  await this._fetchProducts(this._orderNo)
2150
2144
  }
@@ -2443,39 +2437,41 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
2443
2437
  }
2444
2438
 
2445
2439
  _focusOnLotInput() {
2446
- setTimeout(() => this.lotInput.focus(), 100)
2440
+ setTimeout(() => this.lotInput?.focus(), 100)
2447
2441
  }
2448
2442
 
2449
2443
  _focusOnCartonInput() {
2450
- if (this._enableProductScanning) this.productBarcodeInput.readOnly = false
2451
- setTimeout(() => this.cartonInput.focus(), 100)
2444
+ if (this._enableProductScanning && this.productBarcodeInput) this.productBarcodeInput.readOnly = false
2445
+ setTimeout(() => this.cartonInput?.focus(), 100)
2452
2446
  }
2453
2447
 
2454
2448
  _focusOnActualQtyInput() {
2455
- setTimeout(() => this.actualQtyInput.focus(), 100)
2449
+ setTimeout(() => this.actualQtyInput?.focus(), 100)
2456
2450
  }
2457
2451
 
2458
2452
  _focusOnExpiryDateInput() {
2459
- setTimeout(() => this.expDateInput.focus(), 100)
2453
+ setTimeout(() => this.expDateInput?.focus(), 100)
2460
2454
  }
2461
2455
 
2462
2456
  _focusOnManufactureDateInput() {
2463
- setTimeout(() => this.manufactureDateInput.focus(), 100)
2457
+ setTimeout(() => this.manufactureDateInput?.focus(), 100)
2464
2458
  }
2465
2459
 
2466
2460
  _focusOnProductBarcodeInput() {
2467
- this.productBarcodeInput.readOnly = false
2468
- setTimeout(() => this.productBarcodeInput.focus(), 100)
2461
+ if (this.productBarcodeInput) {
2462
+ this.productBarcodeInput.readOnly = false
2463
+ setTimeout(() => this.productBarcodeInput.focus(), 100)
2464
+ }
2469
2465
  }
2470
2466
 
2471
2467
  _focusOnSerialNumberInput() {
2472
- setTimeout(() => this.serialNumberInput.focus(), 100)
2468
+ setTimeout(() => this.serialNumberInput?.focus(), 100)
2473
2469
  }
2474
2470
 
2475
2471
  orderTypeChangeHandler(e) {
2476
2472
  this.refOrderType = e.currentTarget.value
2477
2473
  this._clearView()
2478
- this.orderNoInput.select()
2474
+ this.orderNoInput?.select()
2479
2475
  }
2480
2476
 
2481
2477
  _getFieldSequence(isMobile = false) {
@@ -2505,7 +2501,7 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
2505
2501
  const sequences = {
2506
2502
  'carton_product': ['cartonId', 'productBarcode', getConditionRow()],
2507
2503
  'carton_product_qty': ['cartonId', 'productBarcode', getConditionRow(), 'qty'],
2508
- 'carton_product_exp_serial': ['cartonId', 'productBarcode', ['expDate', 'serialNumber'], getConditionRow()],
2504
+ 'carton_product_exp_serial': ['cartonId', 'productBarcode', ['expiryDate', 'serialNumber'], getConditionRow()],
2509
2505
  'lot_qty_mfg_exp': [['lotId', 'qty'], ['manufactureDate', 'expiryDate'], getConditionRow()],
2510
2506
  'carton_product_serial': ['cartonId', 'productBarcode', 'serialNumber', getConditionRow()],
2511
2507
  'carton_product_mfg_exp': ['cartonId', 'productBarcode', ['manufactureDate', 'expiryDate'], getConditionRow()],
@@ -4,23 +4,34 @@ module.exports = {
4
4
  useVirtualHostBasedDomain: false,
5
5
  fallbackRoute: '/',
6
6
  subdomainOffset: 2,
7
- port: 4011,
7
+ port: 4000,
8
8
  inspect: '9330',
9
+
10
+ storage: {
11
+ type: 's3',
12
+ accessKeyId: 'AKIAUQEOPWEJHCE4MTH4',
13
+ secretAccessKey: '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',
14
+ bucketName: 'opa-one',
15
+ region: 'ap-southeast-1'
16
+ },
17
+ // arif
9
18
  // ormconfig: {
10
19
  // name: 'default',
11
20
  // type: 'postgres',
12
- // database: 'EMS',
21
+ // database: 'arif',
13
22
  // username: 'postgres',
14
23
  // password: 'hatio',
15
- // host: '192.168.0.161',
24
+ // host: '10.254.29.189',
16
25
  // port: 15432,
17
26
  // synchronize: false,
18
27
  // logging: true
19
28
  // },
29
+
30
+ // STAGING DATABASE
20
31
  ormconfig: {
21
32
  name: 'default',
22
33
  type: 'postgres',
23
- database: 'postgres',
34
+ database: 'staging',
24
35
  username: 'postgres',
25
36
  password: 't62dgT#Ns*GerhuZ9wnzm^',
26
37
  host: 'my-operato-pg.cjcso4qmeuq0.ap-southeast-5.rds.amazonaws.com',
@@ -28,32 +39,37 @@ module.exports = {
28
39
  synchronize: false,
29
40
  logging: true
30
41
  },
42
+
31
43
  // ormconfig: {
32
44
  // name: 'default',
33
45
  // type: 'postgres',
34
- // database: 'operato',
46
+ // host: 'operatov3.cluster-cijhm4n1hbst.ap-southeast-1.rds.amazonaws.com',
47
+ // port: 55432,
48
+ // database: 'postgres',
35
49
  // username: 'postgres',
36
- // password: 'hatio',
37
- // host: '192.168.0.153',
38
- // port: 15432,
50
+ // password: 'abcd1234',
39
51
  // synchronize: false,
40
- // logging: true
52
+ // logging: true,
53
+ // connectTimeoutMS: 30000,
54
+ // extra: { poolSize: 30 }
41
55
  // },
56
+
57
+ //db izzah
42
58
  // ormconfig: {
43
59
  // name: 'default',
44
60
  // type: 'postgres',
45
- // database: 'operato',
46
- // username: 'operato',
47
- // password: 'abcd1234',
48
- // host: 'localhost',
49
- // port: 25432,
50
- // synchronize: false,
61
+ // database: '06072023',
62
+ // username: 'postgres',
63
+ // password: 'hatio',
64
+ // host: '192.168.0.153',
65
+ // port: 15432,f
66
+ // synchronize: true,
51
67
  // logging: true
52
68
  // },
53
69
  // ormconfig: {
54
70
  // name: 'default',
55
71
  // type: 'postgres',
56
- // database: 'operato',
72
+ // database: 'postgres',
57
73
  // username: 'postgres',
58
74
  // password: 'hatio',
59
75
  // host: '192.168.0.151',
@@ -61,29 +77,60 @@ module.exports = {
61
77
  // synchronize: false,
62
78
  // logging: true
63
79
  // },
64
- //arif
80
+
81
+ // //ERIC
65
82
  // ormconfig: {
66
83
  // name: 'default',
67
84
  // type: 'postgres',
68
- // database: 'arif',
85
+ // database: 'eric',
69
86
  // username: 'postgres',
70
87
  // password: 'hatio',
71
- // host: '10.254.29.189',
88
+ // host: '192.168.0.153',
72
89
  // port: 15432,
73
90
  // synchronize: false,
74
91
  // logging: true
75
92
  // },
93
+
94
+ //eric 2
76
95
  // ormconfig: {
77
96
  // name: 'default',
78
97
  // type: 'postgres',
79
- // database: 'operato-eric',
98
+ // database: 'eric2',
80
99
  // username: 'postgres',
81
100
  // password: 'hatio',
82
- // host: '192.168.0.249',
83
- // port: 5432,
101
+ // host: '192.168.0.153',
102
+ // port: 15432,
84
103
  // synchronize: false,
85
104
  // logging: true
86
105
  // },
106
+
107
+ // ormconfig: {
108
+ // name: 'default',
109
+ // type: 'postgres',
110
+ // host: 'operatov3.cluster-cijhm4n1hbst.ap-southeast-1.rds.amazonaws.com',
111
+ // port: 55432,
112
+ // database: 'postgres',
113
+ // username: 'postgres',
114
+ // password: 'abcd1234',
115
+ // synchronize: false,
116
+ // logging: true,
117
+ // connectTimeoutMS: 30000,
118
+ // extra: { poolSize: 30 }
119
+ // },
120
+ //ormconfig: {
121
+ // name: 'default',
122
+ // type: 'postgres',
123
+ // database: 'dev2',
124
+ // username: 'postgres',
125
+ // password: 'hatio',
126
+ // host: 'localhost',
127
+ // port: 15432,
128
+ // synchronize: false,
129
+ // logging: true,
130
+ // connectTimeoutMS: 30000,
131
+ // extra: { poolSize: 30 }
132
+ //},
133
+ SECRET: '0xD58F835B69D207A76CC5F84a70a1D0d4C79dfC95',
87
134
  password: {
88
135
  lowerCase: true,
89
136
  upperCase: false,
@@ -96,22 +143,8 @@ module.exports = {
96
143
  looseCharacterLength: 4,
97
144
  history: 2
98
145
  },
99
- sftpFileStorage: {
100
- type: 's3',
101
- accessKeyId: 'AKIAUQEOPWEJKL43OMZA',
102
- secretAccessKey: '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',
103
- bucketName: 'operato-sftp'
104
- },
105
- // storage: {
106
- // type: 's3',
107
- // accessKeyId: 'AKIAUQEOPWEJCDH6AR5H',
108
- // secretAccessKey: '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',
109
- // bucketName: 'opa-one',
110
- // region: 'ap-southeast-1'
111
- // },
112
146
  uploads: 'uploads',
113
147
  attachmentsPath: 'attachments',
114
- SECRET: '0xD58F835B69D207A76CC5F84a70a1D0d4C79dfC95',
115
148
  logger: {
116
149
  file: {
117
150
  filename: 'logs/application-%DATE%.log',
@@ -127,7 +160,7 @@ module.exports = {
127
160
  port: 587,
128
161
  secure: false, // true for 465, false for other ports
129
162
  auth: {
130
- user: 'noreply@hatiolab.com', // generated ethereal user
163
+ user: 'no-reply@hatiolab.com', // generated ethereal user
131
164
  pass: 'h@ti0LAB1008' // generated ethereal password
132
165
  },
133
166
  secureConnection: false,
@@ -135,7 +168,7 @@ module.exports = {
135
168
  ciphers: 'SSLv3'
136
169
  }
137
170
  },
138
- sender: 'noreply@hatiolab.com',
171
+ sender: 'no-reply@hatiolab.com',
139
172
  notification: {
140
173
  // fcm: {
141
174
  // serviceAccount: {
@@ -159,80 +192,30 @@ module.exports = {
159
192
  // privateKey: '4pmlt3Wk019u7nqU3Q_oGZE6LbUDjjf8DpmAcn9-iss'
160
193
  // }
161
194
  },
162
- fulfillmentIntegrationOperato: {
163
- host: '192.168.0.161:3000',
164
- protocol: 'http',
165
- platform: 'operato',
166
- application: 'Operato MMS',
167
- appKey: 'a9bf751e622bf146662b240d58971051',
168
- appSecret: '1c385935dc131c4b902b9bbf6a4798af',
169
- callback: 'http://192.168.0.161:5000/callback-operato'
170
- },
171
- marketplaceIntegrationShopee: {
172
- platform: 'shopee',
173
- isUAT: false,
174
- application: 'Operato MMS',
175
- partnerId: 846025,
176
- partnerKey: 'd34cfd85a603f196a0d74ebe08043280c1a27788bb36bdffd61e7e0bb1c90b64',
177
- v2: true
178
- },
179
- marketplaceIntegrationLazada: {
180
- platform: 'lazada',
181
- application: 'operato-mms',
182
- appKey: '120961',
183
- appSecret: 'HB3RTNEXHlVSlBr9SmWF8AjbSUT7a825',
184
- callback: 'https://maybank.operato-m.com/lazada-callback'
185
- },
186
-
187
- //testinglazada
188
- // marketplaceIntegrationLazada: {
189
- // platform: 'lazada',
190
- // application: 'powrup_bi',
191
- // appKey: '117890',
192
- // appSecret: 'tQVllnUa7irAHoNxAwXEVxoP1we1bUjE',
193
- // callback: 'https://73c5-175-141-30-142.ngrok-free.app/lazada-callback'
194
- // },
195
-
196
- accountingIntegrationXero: {
197
- platform: 'xero',
198
- application: 'Operato WMS',
199
- apiKey: '6B12D1AAC05347DC92159C2AEC812859',
200
- apiSecret: 'T139_ItMjObC82mmy7iwnNflhd2iV0kUvDBj0P_201EmA7Sj',
201
- callback: 'http://operato-h.com:3000/callback-xero',
202
- hostname: 'http://operato-h.com:3000/'
203
- },
204
- lmdIntegrationNinjavan: {
205
- clientId: 'P8WCEwMo0FHNlPECwTLetwN3diAmt5KF',
206
- secretKey: '1D0yNZGseOjhxnwri29xmuZiiuRp131L',
207
- refreshThreshold: 43200
208
- },
209
-
210
- lmdIntegrationEms: { refreshThreshold: 43200 },
211
-
212
- lmdIntegrationCitylink: { refreshThreshold: 172800000 },
195
+ // reportApiUrl:
196
+ // 'http://k8s-default-operator-8eeba2e246-3e3a5ee7979bcd57.elb.ap-southeast-1.amazonaws.com/rest/report/show_html',
197
+ // reportApiUrl: 'http://192.168.0.153:8888/rest/report/show_html',
198
+ // reportApiUrl: 'http://192.168.0.153:8888/rest/report/show_html',
199
+ // reportApiUrl: 'http://10.100.109.66:8090/rest/report/show_html',
213
200
  awbFileStorage: {
214
201
  type: 's3',
215
- accessKeyId: 'AKIAUQEOPWEJPXIVER74',
216
- secretAccessKey: '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',
202
+ accessKeyId: 'AKIAUQEOPWEJKL43OMZA',
203
+ secretAccessKey: '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',
217
204
  bucketName: 'operato-awb',
218
205
  region: 'ap-southeast-1'
219
206
  },
207
+ invoiceFileStorage: {
208
+ type: 's3',
209
+ accessKeyId: 'AKIAUQEOPWEJKL43OMZA',
210
+ secretAccessKey: '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',
211
+ invoiceBucket: 'operato-invoice',
212
+ region: 'ap-southeast-1'
213
+ },
220
214
  lambda: {
221
215
  region: 'ap-southeast-1',
222
- accessKeyId: 'AKIAUQEOPWEJPXIVER74',
223
- secretAccessKey: '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'
224
- },
225
- lmdIntegrationConfig: {
226
- version: {
227
- v1: 'lmdMiddleware',
228
- v2: 'lmdMiddlewareV2'
229
- }
230
- },
231
- awsSesEmail: {
232
- accessKeyId: 'AKIAUQEOPWEJPXIVER74',
233
- secretAccessKey: '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',
234
- email: 'support@hatio.asia'
216
+ accessKeyId: 'AKIAUQEOPWEJKL43OMZA',
217
+ secretAccessKey: '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'
235
218
  },
236
219
  reportApiUrl:
237
- 'http://k8s-default-operator-2fd6178d98-66c66a0f76c09575.elb.ap-southeast-1.amazonaws.com/rest/report/show_html'
220
+ 'http://k8s-default-operator-8eeba2e246-3e3a5ee7979bcd57.elb.ap-southeast-1.amazonaws.com/rest/report/show_html'
238
221
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/operato-wms",
3
- "version": "4.3.772",
3
+ "version": "4.3.774",
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.767",
92
92
  "@things-factory/product-base": "^4.3.767",
93
93
  "@things-factory/resource-ui": "^4.3.770",
94
- "@things-factory/sales-ui": "^4.3.772",
94
+ "@things-factory/sales-ui": "^4.3.774",
95
95
  "@things-factory/scene-data-transform": "^4.3.767",
96
96
  "@things-factory/scene-excel": "^4.3.767",
97
97
  "@things-factory/scene-firebase": "^4.3.767",
@@ -108,7 +108,7 @@
108
108
  "@things-factory/transport-base": "^4.3.767",
109
109
  "@things-factory/tutorial-ui": "^4.3.767",
110
110
  "@things-factory/warehouse-base": "^4.3.772",
111
- "@things-factory/worksheet-base": "^4.3.772"
111
+ "@things-factory/worksheet-base": "^4.3.774"
112
112
  },
113
113
  "devDependencies": {
114
114
  "@things-factory/builder": "^4.3.767",
@@ -117,5 +117,5 @@
117
117
  "cypress-localstorage-commands": "^1.6.1",
118
118
  "eslint-plugin-cypress": "^2.12.1"
119
119
  },
120
- "gitHead": "6705404e7dbd56da45088fe9247462a56e751691"
120
+ "gitHead": "668e7317901d4e35233475e4e2222ffdbf332cb5"
121
121
  }