@things-factory/operato-wms 4.0.33 → 4.0.37

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.
package/Dockerfile CHANGED
@@ -1,49 +1,5 @@
1
1
  # Use an official ubuntu image
2
- FROM ubuntu:18.04
3
-
4
- # Use an official node image
5
- FROM node:14.18
6
-
7
- ARG DEBIAN_FRONTEND=noninteractive
8
-
9
- # Install the required packages
10
- RUN apt-get update -o Acquire::CompressionTypes::Order::=gz
11
- RUN apt-get upgrade -y
12
-
13
- RUN echo "deb http://ftp.de.debian.org/debian stable main" > /etc/apt/sources.list
14
-
15
- RUN apt-get update
16
-
17
- RUN apt-get install -y --no-install-recommends apt-utils
18
- RUN apt-get install -y chromium
19
- RUN apt-get install -y libcups2-dev
20
- RUN apt-get install -y libavahi-compat-libdnssd-dev
21
- RUN apt-get install -y gconf-service libasound2 libatk1.0-0 libcairo2 libcups2 libfontconfig1 libgdk-pixbuf2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libxss1 fonts-liberation libnss3 lsb-release xdg-utils libaio1
22
-
23
- RUN apt update
24
- RUN apt-get install -y ghostscript
25
- RUN apt-get install -y curl
26
- RUN apt-get install -y git
27
-
28
- # install chrome
29
- RUN wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
30
- RUN dpkg -i google-chrome-stable_current_amd64.deb; apt-get -fy install
31
- RUN rm google-chrome-stable_current_amd64.deb
32
-
33
-
34
-
35
- # make oracle path
36
- RUN mkdir -p /opt/oracle
37
- WORKDIR /opt/oracle
38
-
39
- # download newest oracle cilent for connect to Oracle Database
40
- RUN wget https://download.oracle.com/otn_software/linux/instantclient/instantclient-basiclite-linuxx64.zip && \
41
- unzip instantclient-basiclite-linuxx64.zip && \
42
- rm -f instantclient-basiclite-linuxx64.zip && \
43
- cd /opt/oracle/instantclient* && \
44
- rm -f *jdbc* *occi* *mysql* *mql1* *ipc1* *jar uidrvci genezi adrci && \
45
- echo /opt/oracle/instantclient* > /etc/ld.so.conf.d/oracle-instantclient.conf &&\
46
- ldconfig
2
+ FROM hatiolab/operato-env:latest
47
3
 
48
4
  # Set the working directory to /app
49
5
  WORKDIR /app
@@ -84,6 +84,14 @@ class PopupReusablePallet extends localize(i18next)(LitElement) {
84
84
  @click="${async () => await this._verifyInput()}"
85
85
  label="${i18next.t('button.confirm')}"
86
86
  ></mwc-button>
87
+ <mwc-button
88
+ raised
89
+ @click="${async () => {
90
+ this.dispatchEvent(new CustomEvent('normalPallet'))
91
+ history.back()
92
+ }}"
93
+ label="${i18next.t('button.disable')}"
94
+ ></mwc-button>
87
95
  </div>
88
96
  }
89
97
  `
@@ -67,7 +67,7 @@ class WorksheetInformationPopup extends connect(store)(localize(i18next)(LitElem
67
67
  <label>${i18next.t('label.started_at')}</label>
68
68
  <input name="startedAt" type="datetime-local" readonly />
69
69
 
70
- <label>${i18next.t('label.plastic_pallet')}</label>
70
+ <label>${i18next.t('label.reusable_pallet_id')}</label>
71
71
  <input name="plasticPallet" readonly />
72
72
  </fieldset>
73
73
  </form>
@@ -109,19 +109,11 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
109
109
  get context() {
110
110
  var actions = []
111
111
  if (this._worksheetLoaded && !this._enableCartonLabel) {
112
- if (this._usingReusablePallet) {
113
- actions.push({
114
- title: i18next.t('button.wooden_pallet'),
115
- action: this._woodenPalletMode.bind(this),
116
- ...CommonButtonStyles.activate
117
- })
118
- } else {
119
- actions.push({
120
- title: i18next.t('button.plastic_pallet'),
121
- action: this._reusablePalletMode.bind(this),
122
- ...CommonButtonStyles.activate
123
- })
124
- }
112
+ actions.push({
113
+ title: i18next.t('button.plastic_pallet'),
114
+ action: this._reusablePalletMode.bind(this),
115
+ ...CommonButtonStyles.activate
116
+ })
125
117
  }
126
118
 
127
119
  if (this._isLooseItem) {
@@ -667,6 +659,7 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
667
659
  if (!response.errors) {
668
660
  this._orderNo = orderNo
669
661
  const worksheetInfo = response.data.unloadingReturnWorksheet.worksheetInfo
662
+ this._worksheetInfo = worksheetInfo
670
663
 
671
664
  this.orderProductData = {
672
665
  records: orderBy(
@@ -797,45 +790,46 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
797
790
  }
798
791
 
799
792
  async _scanProductUnload() {
800
- if (this._scanning === false) {
801
- this._scanning = true
802
- try {
803
- const response = await client.mutate({
804
- mutation: gql`
805
- mutation scanProductUnload(
806
- $worksheetDetailName: String!
807
- $productBarcode: String!
808
- $inventory: InventoryPatch!
809
- ) {
810
- scanProductUnload(
811
- worksheetDetailName: $worksheetDetailName
812
- productBarcode: $productBarcode
813
- inventory: $inventory
814
- )
815
- }
816
- `,
817
- variables: {
818
- worksheetDetailName: this._selectedOrderProduct.name,
819
- productBarcode: this.productBarcodeInput.value.trim(),
820
- inventory: {
821
- palletId: this._enableCartonLabel ? null : this.lotInput.value.trim(),
822
- cartonId: this._enableCartonLabel ? this.cartonInput.value.trim() : null,
823
- expirationDate: this.expDateInput?.value ? this.expDateInput.value : null
824
- }
793
+ if (this._scanning) return this._showToast({ message: i18next.t('text.previous_scan_is_executing') })
794
+ this._scanning = true
795
+ try {
796
+ const response = await client.mutate({
797
+ mutation: gql`
798
+ mutation scanProductUnload(
799
+ $worksheetDetailName: String!
800
+ $productBarcode: String!
801
+ $inventory: InventoryPatch!
802
+ ) {
803
+ scanProductUnload(
804
+ worksheetDetailName: $worksheetDetailName
805
+ productBarcode: $productBarcode
806
+ inventory: $inventory
807
+ )
808
+ }
809
+ `,
810
+ variables: {
811
+ worksheetDetailName: this._selectedOrderProduct.name,
812
+ productBarcode: this.productBarcodeInput.value.trim(),
813
+ inventory: {
814
+ palletId: this._enableCartonLabel ? null : this.lotInput.value.trim(),
815
+ cartonId: this._enableCartonLabel ? this.cartonInput.value.trim() : null,
816
+ expirationDate: this.expDateInput?.value ? this.expDateInput.value : null
825
817
  }
826
- })
827
-
828
- if (!response.errors) {
829
- await this._checkExpiry()
830
- await this._fetchProducts(this._orderNo)
831
818
  }
832
- } catch (e) {
833
- this._showToast(e)
834
- }
819
+ })
835
820
 
821
+ if (!response.errors) {
822
+ await this._checkExpiry()
823
+ await this._fetchProducts(this._orderNo)
824
+ }
825
+ } catch (e) {
826
+ // for cartonId + product scanning
827
+ // show custom toast for incorrect product barcodes
828
+ // full errors for everything else
829
+ if (!(e instanceof TypeError)) return this._showToast(e)
830
+ this._showToast({ message: i18next.t('text.incorrect_product_barcode') })
831
+ } finally {
836
832
  this._scanning = false
837
- } else {
838
- this._showToast({ message: i18next.t('text.previous_scan_is_executing') })
839
833
  }
840
834
  }
841
835
 
@@ -1112,25 +1106,25 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
1112
1106
  if (this.refOrderType === AVAIL_ORDER_TYPES.ARRIVAL_NOTICE.value) {
1113
1107
  response = await client.mutate({
1114
1108
  mutation: gql`
1115
- mutation completeUnloadingPartially($arrivalNoticeNo: String!, $worksheetDetail: WorksheetDetailPatch!) {
1109
+ mutation completeUnloadingPartially($arrivalNoticeNo: String!, $worksheetDetail: [WorksheetDetailPatch!]) {
1116
1110
  completeUnloadingPartially(arrivalNoticeNo: $arrivalNoticeNo, worksheetDetail: $worksheetDetail)
1117
1111
  }
1118
1112
  `,
1119
1113
  variables: {
1120
1114
  arrivalNoticeNo: this._orderNo,
1121
- worksheetDetail: this._getWorksheetDetails().find(wsd => wsd.name === this._selectedOrderProduct.name)
1115
+ worksheetDetail: this._getWorksheetDetails('partial').filter(wsd => wsd.actualPackQty > 0)
1122
1116
  }
1123
1117
  })
1124
1118
  } else {
1125
1119
  response = await client.mutate({
1126
1120
  mutation: gql`
1127
- mutation completeUnloadReturnPartially($returnOrderNo: String!, $worksheetDetail: WorksheetDetailPatch!) {
1121
+ mutation completeUnloadReturnPartially($returnOrderNo: String!, $worksheetDetail: [WorksheetDetailPatch!]) {
1128
1122
  completeUnloadReturnPartially(returnOrderNo: $returnOrderNo, worksheetDetail: $worksheetDetail)
1129
1123
  }
1130
1124
  `,
1131
1125
  variables: {
1132
1126
  returnOrderNo: this._orderNo,
1133
- worksheetDetail: this._getWorksheetDetails().find(wsd => wsd.name === this._selectedOrderProduct.name)
1127
+ worksheetDetail: this._getWorksheetDetails('partial').filter(wsd => wsd.actualPackQty > 0)
1134
1128
  }
1135
1129
  })
1136
1130
  }
@@ -1307,6 +1301,7 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
1307
1301
  this._worksheetInfo.plasticPallet = this._reusablePallet.name
1308
1302
  this.updateContext()
1309
1303
  }}
1304
+ @normalPallet=${async () => this._normalPalletMode()}
1310
1305
  ></popup-reusable-pallet>
1311
1306
  `,
1312
1307
  {
@@ -1318,10 +1313,10 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
1318
1313
  )
1319
1314
  }
1320
1315
 
1321
- async _woodenPalletMode() {
1316
+ async _normalPalletMode() {
1322
1317
  const result = await CustomAlert({
1323
1318
  title: i18next.t('title.are_you_sure'),
1324
- text: i18next.t('text.use_wooden_pallet'),
1319
+ text: i18next.t('text.use_normal_pallet'),
1325
1320
  confirmButton: { text: i18next.t('button.confirm') },
1326
1321
  cancelButton: { text: i18next.t('button.cancel') }
1327
1322
  })
@@ -1329,7 +1324,7 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
1329
1324
  if (!result.value) return
1330
1325
  this._usingReusablePallet = false
1331
1326
  this._reusablePalletName = this._worksheetInfo.plasticPallet = ''
1332
- this._showToast({ message: i18next.t('text.now_using_wooden_pallet') })
1327
+ this._showToast({ message: i18next.t('text.now_using_normal_pallet') })
1333
1328
  this.updateContext()
1334
1329
  }
1335
1330
 
@@ -1355,9 +1350,11 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
1355
1350
  }
1356
1351
  }
1357
1352
 
1358
- _getWorksheetDetails() {
1353
+ _getWorksheetDetails(completeType) {
1359
1354
  return this.orderProductData.records.map(task => {
1360
- return { name: task.name, issue: task.issue ? task.issue : null }
1355
+ return (completeType = 'partial'
1356
+ ? { name: task.name, issue: task.issue ? task.issue : null, actualPackQty: task.actualPackQty }
1357
+ : { name: task.name, issue: task.issue ? task.issue : null })
1361
1358
  })
1362
1359
  }
1363
1360
 
@@ -347,7 +347,7 @@ class CreateArrivalNotice extends localize(i18next)(PageView) {
347
347
  <div class="button-div">
348
348
  <mwc-button
349
349
  id="button-add-products"
350
- label=${i18next.t('button.add_products')}
350
+ label=${i18next.t('button.bulk_select_products')}
351
351
  raised
352
352
  @click=${e => this._openBulkProductSelection()}
353
353
  ?disabled=${!this._showAddProducts}
@@ -140,7 +140,6 @@ class ReverseKittingOrderDetail extends connect(store)(localize(i18next)(PageVie
140
140
  .config=${this.inventoryGristConfig}
141
141
  .data=${this.inventoryData}
142
142
  @record-change="${this._onProductChangeHandler.bind(this)}"
143
- @field-change="${this._onInventoryFieldChanged.bind(this)}"
144
143
  ></data-grist>
145
144
  </div>
146
145
  </div>
@@ -223,7 +222,7 @@ class ReverseKittingOrderDetail extends connect(store)(localize(i18next)(PageVie
223
222
  if (this.active) {
224
223
  if (changes.resourceId) {
225
224
  this._reverseKittingNo = changes.resourceId
226
- } else {
225
+ } else if (!this._reverseKittingNo) {
227
226
  this._reverseKittingNo = 'new'
228
227
  }
229
228
 
@@ -379,8 +378,9 @@ class ReverseKittingOrderDetail extends connect(store)(localize(i18next)(PageVie
379
378
 
380
379
  try {
381
380
  if (changedColumn === 'qty') {
382
- this._validateQty(changeRecord.qty)
381
+ this._validateQty(changeRecord.qty, changeRecord.remainQty)
383
382
  }
383
+ this._updateQtyAndUomValue(event.detail.row, changedColumn, event.detail.before, changeRecord)
384
384
  } catch (e) {
385
385
  const beforeValue = event.detail.before && event.detail.before[event.detail.column.name]
386
386
  if (beforeValue) {
@@ -392,42 +392,18 @@ class ReverseKittingOrderDetail extends connect(store)(localize(i18next)(PageVie
392
392
  }
393
393
  }
394
394
 
395
- _onInventoryFieldChanged(e) {
396
- let columnName = e.detail.column.name
395
+ _updateQtyAndUomValue(rowIndex, columnName, initialRecord, newRecord) {
397
396
  let roundedUomValue = 0
398
397
  let qty = 0
399
398
 
400
- if (columnName == 'uomValue' || columnName == 'qty' || columnName == 'inventory') {
401
- if (columnName == 'inventory') {
402
- if (
403
- e.detail.after.remainUomValue &&
404
- e.detail.after.remainQty &&
405
- e.detail.after.remainUomValue > 0 &&
406
- e.detail.after.remainQty > 0
407
- ) {
408
- qty = e.detail.record.qty || 0
409
-
410
- roundedUomValue = qty * (e.detail.after.remainUomValue / e.detail.after.remainQty)
399
+ if (columnName == 'qty' || columnName == 'uomValue') {
400
+ if (initialRecord?.remainQty && initialRecord?.remainUomValue) {
401
+ let packageUomValue = initialRecord.remainUomValue / initialRecord.remainQty
411
402
 
412
- roundedUomValue = parseFloat(roundedUomValue.toFixed(2))
413
- }
414
- } else {
415
- let packageUomValue = e.detail.record.remainUomValue / e.detail.record.remainQty
416
- if (
417
- e.detail.record.remainUomValue &&
418
- e.detail.record.remainQty &&
419
- e.detail.record.remainUomValue > 0 &&
420
- e.detail.record.remainQty > 0
421
- ) {
422
- if (columnName === 'qty') {
423
- qty = e.detail.after || 0
424
- } else {
425
- qty = Math.round(e.detail.after / packageUomValue)
426
- }
403
+ if (columnName == 'qty') qty = newRecord.qty || 0
404
+ else qty = Math.round(newRecord.uomValue / packageUomValue)
427
405
 
428
- roundedUomValue = qty * packageUomValue
429
- roundedUomValue = parseFloat(roundedUomValue.toFixed(2))
430
- }
406
+ roundedUomValue = Math.round(qty * packageUomValue * 100) / 100
431
407
  }
432
408
  }
433
409
 
@@ -435,20 +411,16 @@ class ReverseKittingOrderDetail extends connect(store)(localize(i18next)(PageVie
435
411
  ...this.inventoryData,
436
412
  ...this.inventoryGrist.dirtyData,
437
413
  records: this.inventoryGrist.dirtyData.records.map((record, idx) => {
438
- // const factor = this._pickingStd === PICKING_STANDARD.SELECT_BY_PRODUCT.value ? e.detail.row : e.detail.record.id
439
-
440
- if ((columnName == 'uomValue' || columnName == 'qty' || columnName == 'inventory') && idx === e.detail.row) {
414
+ if (idx == rowIndex && (columnName == 'qty' || columnName == 'uomValue')) {
441
415
  if (columnName == 'uomValue') record.qty = qty
442
416
  record.uomValue = roundedUomValue
443
417
  }
444
418
 
445
- let returnObj = {
419
+ return {
446
420
  ...record,
447
421
  ...record.inventory,
448
422
  name: record.name ? record.name : idx
449
423
  }
450
-
451
- return returnObj
452
424
  })
453
425
  }
454
426
 
@@ -783,21 +755,25 @@ class ReverseKittingOrderDetail extends connect(store)(localize(i18next)(PageVie
783
755
  }
784
756
 
785
757
  checkInventoryValidity() {
786
- if (!this.inventoryGrist.dirtyData.records || !this.inventoryGrist.dirtyData.records.length) {
758
+ let records = this.inventoryGrist.dirtyData?.records
759
+
760
+ if (!records || !records.length) {
787
761
  throw new Error(i18next.t('text.there_is_no_inventory'))
788
762
  }
789
763
 
790
- if (this.inventoryGrist.dirtyData.records.some(record => !record.inventory && !record.inventory.id))
764
+ if (records.some(record => !record.inventory && !record.inventory.id))
791
765
  throw new Error(i18next.t('text.invalid_inventory'))
792
766
 
793
- if (this.inventoryGrist.dirtyData.records.some(record => !record.productCombination))
767
+ if (records.some(record => !record.productCombination))
794
768
  throw new Error(i18next.t('text.invalid_product_combination'))
795
769
 
770
+ records.forEach(record => this._validateQty(record.qty, record.remainQty))
771
+
796
772
  return true
797
773
  }
798
774
 
799
- _validateQty(qty) {
800
- if (qty <= 0) {
775
+ _validateQty(qty, remainQty) {
776
+ if (!qty || qty <= 0 || qty > remainQty) {
801
777
  throw new Error(i18next.t('text.invalid_quantity_input'))
802
778
  }
803
779
  }