@things-factory/operato-wms 4.3.429 → 4.3.433

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.
@@ -970,6 +970,11 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
970
970
  _resetInput() {
971
971
  if (this._selectedOrderProduct?.isRequiredCheckExpiry) this.expDateInput.value = null
972
972
 
973
+ if (this._isRequiredCheckExpiry) {
974
+ this.expDateInput.value = null
975
+ this._focusOnExpiryDateInput()
976
+ }
977
+
973
978
  if (this._enableCartonLabel) {
974
979
  if (this._isRequireSerialNumberScanningInbound) {
975
980
  if (this.cartonInput.value == '') {
@@ -7,28 +7,14 @@ import '../inventory/serial-number-list-popup'
7
7
  import '../components/select-product-popup'
8
8
 
9
9
  import gql from 'graphql-tag'
10
- import {
11
- css,
12
- html
13
- } from 'lit-element'
10
+ import { css, html } from 'lit-element'
14
11
  import { connect } from 'pwa-helpers/connect-mixin'
15
12
 
16
13
  import { DirectPrinter } from '@things-factory/barcode-base'
17
- import {
18
- i18next,
19
- localize
20
- } from '@things-factory/i18n-base'
14
+ import { i18next, localize } from '@things-factory/i18n-base'
21
15
  import { openPopup } from '@things-factory/layout-base'
22
- import {
23
- client,
24
- CustomAlert,
25
- PageView,
26
- store
27
- } from '@things-factory/shell'
28
- import {
29
- CommonButtonStyles,
30
- ScrollbarStyles
31
- } from '@things-factory/styles'
16
+ import { client, CustomAlert, PageView, store } from '@things-factory/shell'
17
+ import { CommonButtonStyles, ScrollbarStyles } from '@things-factory/styles'
32
18
  import { isMobileDevice } from '@things-factory/utils'
33
19
 
34
20
  import { fetchSettingRule } from '../../fetch-setting-value'
@@ -1354,11 +1340,11 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
1354
1340
 
1355
1341
  data = data.map(item => {
1356
1342
  if (item?.expirationDate !== null && item?.expirationDate !== '') {
1357
- item.expirationDate = new Date(item.expirationDate).getTime()
1343
+ item.expirationDate = this.toUtcTimestamp(item.expirationDate)
1358
1344
  }
1359
1345
 
1360
1346
  if (item?.manufactureDate !== null && item?.manufactureDate !== '') {
1361
- item.manufactureDate = new Date(item.manufactureDate).getTime()
1347
+ item.manufactureDate = this.toUtcTimestamp(item.manufactureDate)
1362
1348
  }
1363
1349
 
1364
1350
  return {
@@ -1740,6 +1726,12 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
1740
1726
  throw new Error(i18next.t('text.adjustment_note_is_required_kindly_fill_in_the_adjustment_note_to_continue'))
1741
1727
  }
1742
1728
  }
1729
+
1730
+ toUtcTimestamp(dateInput) {
1731
+ const date = new Date(dateInput)
1732
+ const utcDate = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0))
1733
+ return utcDate.getTime()
1734
+ }
1743
1735
  }
1744
1736
 
1745
1737
  window.customElements.define('inventory-adjustment', InventoryAdjustment)
@@ -1229,10 +1229,10 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
1229
1229
  width: 150
1230
1230
  },
1231
1231
  {
1232
- type: 'integer',
1232
+ type: 'float',
1233
1233
  name: 'newUomValue',
1234
1234
  header: i18next.t('field.uom_value_sku', { sku: 'NEW SKU' }),
1235
- record: { editable: true },
1235
+ record: { editable: !this._strictProductSelection },
1236
1236
  width: 150
1237
1237
  },
1238
1238
  {
@@ -1518,7 +1518,7 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
1518
1518
  name: 'releaseUomValue',
1519
1519
  header: i18next.t('field.release_uom_value'),
1520
1520
  imex: { header: i18next.t('field.release_uom_value'), key: 'releaseUomValue', width: 25, type: 'float' },
1521
- record: { editable: true, options: { min: 0 } },
1521
+ record: { editable: !this._strictProductSelection, options: { min: 0 } },
1522
1522
  width: 140
1523
1523
  }
1524
1524
  ]
@@ -1682,7 +1682,7 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
1682
1682
  type: 'float',
1683
1683
  name: 'releaseUomValue',
1684
1684
  header: i18next.t('field.release_uom_value'),
1685
- record: { editable: true, options: { min: 0 } },
1685
+ record: { editable: !this._strictProductSelection, options: { min: 0 } },
1686
1686
  width: 100
1687
1687
  }
1688
1688
  ]
@@ -2056,23 +2056,28 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
2056
2056
  // changeRecord.vasQty = changeRecord.qty
2057
2057
  changeRecord.outputQty = initialRecord.outputQty ? initialRecord.outputQty : null
2058
2058
  //
2059
- } else if (changedColumn === 'outputQty' && !this._strictProductSelection) {
2059
+ } else if (changedColumn === 'outputQty') {
2060
2060
  if (changeRecord.outputQty <= 0 || isNaN(changeRecord.outputQty)) {
2061
2061
  throw new Error(i18next.t('text.invalid_quantity_input'))
2062
- } else if (initialRecord.outputQty == null) {
2063
- const totalUomValue = changeRecord.outputQty * (changeRecord.newUomValue / changeRecord.qty)
2064
- changeRecord.newUomValue = totalUomValue
2065
2062
  } else {
2066
- const totalUomValue = changeRecord.outputQty * (initialRecord.newUomValue / initialRecord.outputQty)
2067
- changeRecord.newUomValue = totalUomValue
2063
+ const totalUomValue = changeRecord.outputQty * (initialRecord.newUomValue / changeRecord.qty)
2064
+ changeRecord.newUomValue = totalUomValue.toFixed(2)
2068
2065
  }
2069
2066
  if (isNaN(changeRecord.newUomValue)) {
2070
2067
  changeRecord.newUomValue = null
2071
2068
  }
2072
- } else if (changedColumn === 'newUomValue') {
2069
+ } else if (changedColumn === 'newUomValue' && !this._strictProductSelection) {
2073
2070
  if (changeRecord.newUomValue <= 0 || isNaN(changeRecord.newUomValue)) {
2074
2071
  throw new Error(i18next.t('text.invalid_quantity_input'))
2075
2072
  }
2073
+ const decimalPlaces = (changeRecord.newUomValue.toString().split('.')[1] || '').length
2074
+
2075
+ if (decimalPlaces > 2) {
2076
+ throw new Error(i18next.t('text.cannot_add_more_than_2_decimal_places'))
2077
+ }
2078
+
2079
+ const totalOutputQty = changeRecord.newUomValue / initialRecord.newOrgUomValue
2080
+ changeRecord.outputQty = Math.trunc(totalOutputQty) //return only the whole number
2076
2081
  } else if (changedColumn === 'vasQty') {
2077
2082
  if (changeRecord.vasQty <= 0 || isNaN(changeRecord.vasQty)) {
2078
2083
  throw new Error(i18next.t('text.invalid_quantity_input'))
@@ -2419,7 +2424,7 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
2419
2424
  newProductDetail: ov.newProductDetailId,
2420
2425
  newPackingType: ov.newPackingType,
2421
2426
  newUom: ov.newUom,
2422
- newUomValue: ov.newUomValue,
2427
+ newUomValue: parseFloat(ov.newUomValue),
2423
2428
  outputQty: ov.outputQty ? ov.outputQty : ov.qty,
2424
2429
  remark: ov.remark,
2425
2430
  orderVasItemsPatch: this.vasGrist.dirtyData.records.reduce((acc, cur) => {
@@ -2563,9 +2568,9 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
2563
2568
  if ((record.newPackingType || record.newUomValue || record.newUom) && !record.newSKU)
2564
2569
  throw new Error(i18next.t('text.empty_field_field', { field: i18next.t('field.new_sku') }))
2565
2570
  if (!record.vasQty) throw new Error(i18next.t('text.empty_field_field', { field: i18next.t('field.vas_qty') }))
2566
- // enable empty outputQty
2567
- // if (!record.outputQty && record.sku)
2568
- // throw new Error(i18next.t('text.empty_field_field', { field: i18next.t('field.output_qty') }))
2571
+
2572
+ if (record.outputQty === 0) throw new Error(i18next.t('text.output_qty_must_be_more_than_0'))
2573
+
2569
2574
  if (!record.vas) throw new Error(i18next.t('text.empty_field_field', { field: i18next.t('field.vas') }))
2570
2575
  // allowing repacking to same SKU
2571
2576
  // if (record.productSKU == record.newSKU)
@@ -2720,9 +2725,9 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
2720
2725
 
2721
2726
  this.vasGrist.dirtyData.records.map((record, index) => {
2722
2727
  if (index === rowIndex && record.newSKU) {
2723
- if (record.outputQty) {
2724
- record.newUomValue = record.outputQty * record.newUomValue
2725
- } else if (record.qty) {
2728
+ if (record.qty) {
2729
+ record.outputQty = null //clear outputQty if selecting new Sku
2730
+ record.newOrgUomValue = record.newUomValue
2726
2731
  record.newUomValue = record.qty * record.newUomValue
2727
2732
  } else {
2728
2733
  record.newUomValue = null
@@ -268,6 +268,15 @@ class CreateDeliveryOrder extends localize(i18next)(PageView) {
268
268
  @click="${this._openDriverSelector.bind(this)}"
269
269
  />
270
270
 
271
+ <label ?hidden="${!this._checkTransport}">${i18next.t('label.driver_code')}</label>
272
+ <input name="ownDriverCode" value="" ?hidden="${!this._showOwnCollectionField}" />
273
+ <input
274
+ name="warehouseDriverCode"
275
+ ?hidden="${!this._showWarehouseTransportField}"
276
+ readonly
277
+ @click="${this._openDriverSelector.bind(this)}"
278
+ />
279
+
271
280
  <label ?hidden="${!this._checkTransport}">${i18next.t('label.truck_no')}</label>
272
281
  <input name="ownTruck" ?hidden="${!this._showOwnCollectionField}" />
273
282
  <input
@@ -410,6 +419,10 @@ class CreateDeliveryOrder extends localize(i18next)(PageView) {
410
419
  return this.shadowRoot.querySelector('input[name=warehouseDriver]')
411
420
  }
412
421
 
422
+ get _truckDriverCodeInput() {
423
+ return this.shadowRoot.querySelector('input[name=warehouseDriverCode]')
424
+ }
425
+
413
426
  get productGrist() {
414
427
  return this.shadowRoot.querySelector('data-grist#product-grist')
415
428
  }
@@ -685,6 +698,7 @@ class CreateDeliveryOrder extends localize(i18next)(PageView) {
685
698
  <transport-driver-popup
686
699
  @selected="${e => {
687
700
  this._truckDriverInput.value = e.detail.name
701
+ this._truckDriverCodeInput.value = e.detail.driverCode
688
702
  this._transportDriver = e.detail.id
689
703
  }}"
690
704
  ></transport-driver-popup>
@@ -917,16 +931,19 @@ class CreateDeliveryOrder extends localize(i18next)(PageView) {
917
931
 
918
932
  delete formData.warehouseTruck
919
933
  delete formData.warehouseDriver
934
+ delete formData.warehouseDriverCode
920
935
  } else {
921
936
  formData = {
922
937
  ...formData,
923
938
  truckNo: formData.ownTruck,
924
939
  otherDriver: formData.ownDriver,
940
+ otherDriverCode: formData.ownDriverCode,
925
941
  transportDriver: null,
926
942
  transportVehicle: null
927
943
  }
928
944
 
929
945
  delete formData.ownTruck
946
+ delete formData.ownDriverCode
930
947
  delete formData.ownDriver
931
948
  }
932
949
 
@@ -356,6 +356,16 @@ class DeliveryNotePopup extends localize(i18next)(LitElement) {
356
356
  readonly
357
357
  />
358
358
 
359
+ <label>${i18next.t('label.driver_code')}</label>
360
+ <input name="otherDriverCode" value="${this.orderInfo.otherDriverCode}" ?hidden="${!this._ownCollection}" />
361
+ <input
362
+ name="ownDriverCode"
363
+ ?hidden="${this._ownCollection}"
364
+ value="${this.orderInfo.driverCode}"
365
+ @click="${this._openDriverSelector.bind(this)}"
366
+ readonly
367
+ />
368
+
359
369
  <label>${i18next.t('label.vehicle_no')}</label>
360
370
  <input name="otherTruck" ?hidden="${!this._ownCollection}" value="${this._truckNo}" />
361
371
  <input
@@ -725,6 +735,10 @@ class DeliveryNotePopup extends localize(i18next)(LitElement) {
725
735
  return this.shadowRoot.querySelector('input[name=ownDriver]')
726
736
  }
727
737
 
738
+ get _truckDriverCodeInput() {
739
+ return this.shadowRoot.querySelector('input[name=ownDriverCode]')
740
+ }
741
+
728
742
  get doGrist() {
729
743
  return this.shadowRoot.querySelector('data-grist#do-grist')
730
744
  }
@@ -775,6 +789,7 @@ class DeliveryNotePopup extends localize(i18next)(LitElement) {
775
789
  this._determineOwnCollection = 'Warehouse Transport'
776
790
  this._truckNoInput.value = ''
777
791
  this._truckDriverInput.value = ''
792
+ this._truckDriverCodeInput.value = ''
778
793
  }
779
794
  }
780
795
 
@@ -837,6 +852,7 @@ class DeliveryNotePopup extends localize(i18next)(LitElement) {
837
852
  <transport-driver-popup
838
853
  @selected="${e => {
839
854
  this._truckDriverInput.value = e.detail.name
855
+ this._truckDriverCodeInput.value = e.detail.driverCode
840
856
  }}"
841
857
  ></transport-driver-popup>
842
858
  `,
@@ -135,8 +135,10 @@ class PrintDeliveryOrder extends localize(i18next)(PageView) {
135
135
  deliveryDate
136
136
  doStatus
137
137
  driverName
138
+ driverCode
138
139
  otherDestination
139
140
  otherDriver
141
+ otherDriverCode
140
142
  ownCollection
141
143
  isManualDo
142
144
  remark
@@ -123,8 +123,10 @@ class ViewDeliveryOrder extends localize(i18next)(PageView) {
123
123
  deliveryDate
124
124
  doStatus
125
125
  driverName
126
+ driverCode
126
127
  otherDestination
127
128
  otherDriver
129
+ otherDriverCode
128
130
  ownCollection
129
131
  isManualDo
130
132
  remark
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/operato-wms",
3
- "version": "4.3.429",
3
+ "version": "4.3.433",
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.381",
92
92
  "@things-factory/product-base": "^4.3.425",
93
93
  "@things-factory/resource-ui": "^4.3.425",
94
- "@things-factory/sales-ui": "^4.3.429",
94
+ "@things-factory/sales-ui": "^4.3.433",
95
95
  "@things-factory/scene-data-transform": "^4.3.381",
96
96
  "@things-factory/scene-excel": "^4.3.381",
97
97
  "@things-factory/scene-firebase": "^4.3.381",
@@ -107,8 +107,8 @@
107
107
  "@things-factory/system-ui": "^4.3.381",
108
108
  "@things-factory/transport-base": "^4.3.425",
109
109
  "@things-factory/tutorial-ui": "^4.3.425",
110
- "@things-factory/warehouse-base": "^4.3.425",
111
- "@things-factory/worksheet-base": "^4.3.429"
110
+ "@things-factory/warehouse-base": "^4.3.430",
111
+ "@things-factory/worksheet-base": "^4.3.433"
112
112
  },
113
113
  "devDependencies": {
114
114
  "@things-factory/builder": "^4.3.381",
@@ -117,5 +117,5 @@
117
117
  "cypress-localstorage-commands": "^1.6.1",
118
118
  "eslint-plugin-cypress": "^2.12.1"
119
119
  },
120
- "gitHead": "7ef71dcf92100a2e6ac9e472850b6d0a80aab268"
120
+ "gitHead": "acdf23ae03729328ea7785023c25fb3d9bdc6c43"
121
121
  }