@things-factory/operato-wms 4.3.468 → 4.3.470

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.
@@ -10,25 +10,14 @@ import './proceed-edit-product-popup'
10
10
  import './view-product-changes-popup'
11
11
 
12
12
  import gql from 'graphql-tag'
13
- import {
14
- css,
15
- html
16
- } from 'lit-element'
13
+ import { css, html } from 'lit-element'
17
14
 
18
15
  import { getCodeByName } from '@things-factory/code-base'
19
16
  import { MultiColumnFormStyles } from '@things-factory/form-ui'
20
17
  import { getRenderer } from '@things-factory/grist-ui'
21
- import {
22
- i18next,
23
- localize
24
- } from '@things-factory/i18n-base'
18
+ import { i18next, localize } from '@things-factory/i18n-base'
25
19
  import { openPopup } from '@things-factory/layout-base'
26
- import {
27
- client,
28
- CustomAlert,
29
- navigate,
30
- PageView
31
- } from '@things-factory/shell'
20
+ import { client, CustomAlert, navigate, PageView } from '@things-factory/shell'
32
21
  import { CommonButtonStyles } from '@things-factory/styles'
33
22
  import { isMobileDevice } from '@things-factory/utils'
34
23
 
@@ -78,7 +67,8 @@ class ArrivalNoticeDetail extends localize(i18next)(PageView) {
78
67
  productData: Object,
79
68
  vasData: Object,
80
69
  arrivalNoticeId: String,
81
- _disableTransport: Boolean
70
+ _disableTransport: Boolean,
71
+ userRole: Array
82
72
  }
83
73
  }
84
74
 
@@ -202,12 +192,26 @@ class ArrivalNoticeDetail extends localize(i18next)(PageView) {
202
192
  }
203
193
  ]
204
194
 
205
- if (this._status === ORDER_STATUS.PENDING.value) {
195
+
196
+ if (
197
+ this._status === ORDER_STATUS.PENDING.value &&
198
+ this.userRoles?.find(itm => itm.name.toLowerCase().includes('admin'))
199
+ ){
206
200
  actions.push({
207
- title: i18next.t('button.update_order_details'),
208
- action: this._updateArrivalNotice.bind(this),
201
+ title: i18next.t('button.edit_product'),
202
+ action: this.openEditProductPopup.bind(this),
209
203
  ...CommonButtonStyles.add
210
204
  })
205
+ }
206
+
207
+ if (this._status === ORDER_STATUS.PENDING.value) {
208
+ actions.push(
209
+ {
210
+ title: i18next.t('button.update_order_details'),
211
+ action: this._updateArrivalNotice.bind(this),
212
+ ...CommonButtonStyles.add
213
+ }
214
+ )
211
215
 
212
216
  actions.push({
213
217
  title: i18next.t('button.delete'),
@@ -307,7 +311,8 @@ class ArrivalNoticeDetail extends localize(i18next)(PageView) {
307
311
  title: i18next.t('button.cancel'),
308
312
  action: this._cancelArrivalNotice.bind(this),
309
313
  ...CommonButtonStyles.cancel
310
- },{
314
+ },
315
+ {
311
316
  title: i18next.t('button.assign_warehouse'),
312
317
  action: this._assignBufferLocation.bind(this),
313
318
  ...CommonButtonStyles.warehouse
@@ -388,7 +393,11 @@ class ArrivalNoticeDetail extends localize(i18next)(PageView) {
388
393
  })
389
394
  }
390
395
 
391
- if (this._status === ORDER_STATUS.INTRANSIT.value || this._status === ORDER_STATUS.ARRIVED.value || this._status === ORDER_STATUS.READY_TO_UNLOAD.value) {
396
+ if (
397
+ this._status === ORDER_STATUS.INTRANSIT.value ||
398
+ this._status === ORDER_STATUS.ARRIVED.value ||
399
+ this._status === ORDER_STATUS.READY_TO_UNLOAD.value
400
+ ) {
392
401
  actions.push({
393
402
  title: i18next.t('button.cancel'),
394
403
  action: this._cancelArrivalNotice.bind(this),
@@ -664,6 +673,7 @@ class ArrivalNoticeDetail extends localize(i18next)(PageView) {
664
673
  this.containerSizes = await getCodeByName('CONTAINER_SIZES')
665
674
  this._enableTransportationServiceSetting = await fetchSettingRule('enable-transportation-service')
666
675
  this.isUserBelongsDomain = await this._checkUserBelongsDomain()
676
+ this.userRoles = await this.fetchUserRoleHandler()
667
677
  this.vasGristConfig = {
668
678
  list: { fields: ['set', 'targetType', 'target', 'packingType', 'qty', 'vas', 'status', 'remark'] },
669
679
  pagination: { infinite: true },
@@ -1060,13 +1070,14 @@ class ArrivalNoticeDetail extends localize(i18next)(PageView) {
1060
1070
  this.setProductGristConfig()
1061
1071
  this.productData = {
1062
1072
  records: orderProducts
1063
- .map(record => {
1064
- return {
1065
- ...record,
1066
- productSku: record.product.sku,
1067
- productBrand: record.product.brand
1068
- }
1069
- }).sort((a, b) => a.product.sku.localeCompare(b.product.sku))
1073
+ .map(record => {
1074
+ return {
1075
+ ...record,
1076
+ productSku: record.product.sku,
1077
+ productBrand: record.product.brand
1078
+ }
1079
+ })
1080
+ .sort((a, b) => a.product.sku.localeCompare(b.product.sku))
1070
1081
  }
1071
1082
  this.vasData = {
1072
1083
  records: orderVass
@@ -1518,7 +1529,7 @@ class ArrivalNoticeDetail extends localize(i18next)(PageView) {
1518
1529
  })
1519
1530
 
1520
1531
  if (!result.value) return
1521
-
1532
+
1522
1533
  const response = await client.mutate({
1523
1534
  mutation: gql`
1524
1535
  mutation cancelArrivalNotice($name: String!) {
@@ -1641,11 +1652,14 @@ class ArrivalNoticeDetail extends localize(i18next)(PageView) {
1641
1652
  }
1642
1653
 
1643
1654
  _openCartonLabelPrintPopup() {
1644
- openPopup(html` <carton-label-popup .bizplaceName="${this._bizplaceName}"></carton-label-popup> `, {
1645
- backdrop: true,
1646
- size: 'small',
1647
- title: i18next.t('title.carton_label')
1648
- })
1655
+ openPopup(
1656
+ html` <carton-label-popup .fixedType="${'default'}" .bizplaceName="${this._bizplaceName}"></carton-label-popup> `,
1657
+ {
1658
+ backdrop: true,
1659
+ size: 'small',
1660
+ title: i18next.t('title.carton_label')
1661
+ }
1662
+ )
1649
1663
  }
1650
1664
 
1651
1665
  openEditProductPopup() {
@@ -1657,6 +1671,7 @@ class ArrivalNoticeDetail extends localize(i18next)(PageView) {
1657
1671
  html`
1658
1672
  <edit-product-popup
1659
1673
  .ganNo="${this._ganNo}"
1674
+ .status="${this._status}"
1660
1675
  .productData="${this.productData}"
1661
1676
  .bizplace="${this.orderBizplace}"
1662
1677
  .strictEditable="${this._strictProductSelection}"
@@ -1717,6 +1732,26 @@ class ArrivalNoticeDetail extends localize(i18next)(PageView) {
1717
1732
  })
1718
1733
  }
1719
1734
 
1735
+ async fetchUserRoleHandler() {
1736
+ const response = await client.query({
1737
+ query: gql`
1738
+ query myRoles {
1739
+ myRoles {
1740
+ id
1741
+ name
1742
+ description
1743
+ }
1744
+ }
1745
+ `
1746
+ })
1747
+
1748
+ if (!response.errors?.length) {
1749
+ return response.data.myRoles
1750
+ }
1751
+
1752
+ return []
1753
+ }
1754
+
1720
1755
  _showToast({ type, message }) {
1721
1756
  document.dispatchEvent(
1722
1757
  new CustomEvent('notify', {
@@ -1727,7 +1762,6 @@ class ArrivalNoticeDetail extends localize(i18next)(PageView) {
1727
1762
  })
1728
1763
  )
1729
1764
  }
1730
-
1731
1765
  }
1732
1766
 
1733
1767
  window.customElements.define('arrival-notice-detail', ArrivalNoticeDetail)
@@ -60,6 +60,10 @@ export class EditProductPopup extends localize(i18next)(LitElement) {
60
60
  background-color: var(--button-container-background);
61
61
  height: var(--button-container-height);
62
62
  }
63
+
64
+ .hidden {
65
+ display: none;
66
+ }
63
67
  [danger] {
64
68
  --mdc-theme-primary: var(--mdc-danger-button-primary-color);
65
69
  }
@@ -70,12 +74,14 @@ export class EditProductPopup extends localize(i18next)(LitElement) {
70
74
  static get properties() {
71
75
  return {
72
76
  ganNo: String,
77
+ status: String,
73
78
  bizplace: Object,
74
79
  editProductConfig: Object,
75
80
  addProductConfig: Object,
76
81
  productData: Object,
77
82
  newProductData: Object,
78
- strictEditable: Boolean
83
+ strictEditable: Boolean,
84
+ userRole: Array
79
85
  }
80
86
  }
81
87
 
@@ -116,8 +122,18 @@ export class EditProductPopup extends localize(i18next)(LitElement) {
116
122
  ></mwc-button>
117
123
  <mwc-button
118
124
  raised
119
- @click="${this._addEditProducts.bind(this)}"
125
+ @click="${this._addEditProducts.bind(this, false)}"
120
126
  label="${i18next.t('button.submit_for_approval')}"
127
+ class="${this.status === 'PENDING' ? 'hidden' : ''}"
128
+ ></mwc-button>
129
+ <mwc-button
130
+ type="button"
131
+ raised
132
+ @click="${this._addEditProducts.bind(this, true)}"
133
+ label="${i18next.t('button.submit')}"
134
+ class="${this.status !== 'PENDING' && this.userRole?.find(itm => !itm.name.toLowerCase().includes('admin'))
135
+ ? 'hidden'
136
+ : ''}"
121
137
  ></mwc-button>
122
138
  </div>
123
139
  `
@@ -396,6 +412,8 @@ export class EditProductPopup extends localize(i18next)(LitElement) {
396
412
  }
397
413
  ]
398
414
  }
415
+
416
+ this.userRole = await this.fetchUserRoleHandler()
399
417
  }
400
418
 
401
419
  get editProductGrist() {
@@ -590,7 +608,7 @@ export class EditProductPopup extends localize(i18next)(LitElement) {
590
608
  }
591
609
  }
592
610
 
593
- async _addEditProducts() {
611
+ async _addEditProducts(approveAdminAddEditProducts) {
594
612
  try {
595
613
  this._validateProducts()
596
614
 
@@ -612,11 +630,13 @@ export class EditProductPopup extends localize(i18next)(LitElement) {
612
630
  const response = await client.mutate({
613
631
  mutation: gql`
614
632
  mutation addEditArrivalNoticeProducts(
633
+ $approvedAddEditProducts: Boolean
615
634
  $ganNo: String!
616
635
  $newOrderProducts: [NewOrderProduct!]
617
636
  $existingOrderProducts: [OrderProductPatch!]
618
637
  ) {
619
638
  addEditArrivalNoticeProducts(
639
+ approvedAddEditProducts: $approvedAddEditProducts
620
640
  ganNo: $ganNo
621
641
  newOrderProducts: $newOrderProducts
622
642
  existingOrderProducts: $existingOrderProducts
@@ -624,6 +644,7 @@ export class EditProductPopup extends localize(i18next)(LitElement) {
624
644
  }
625
645
  `,
626
646
  variables: {
647
+ approvedAddEditProducts: approveAdminAddEditProducts ? true : false,
627
648
  ganNo: this.ganNo,
628
649
  newOrderProducts,
629
650
  existingOrderProducts
@@ -631,7 +652,11 @@ export class EditProductPopup extends localize(i18next)(LitElement) {
631
652
  })
632
653
 
633
654
  if (!response.errors) {
634
- this._showToast({ message: i18next.t('text.add_edit_products_has_been_submitted_for_approval') })
655
+ if (approveAdminAddEditProducts) {
656
+ this._showToast({ message: i18next.t('text.add_edit_products_has_been_updated') })
657
+ } else {
658
+ this._showToast({ message: i18next.t('text.add_edit_products_has_been_submitted_for_approval') })
659
+ }
635
660
  this.dispatchEvent(new CustomEvent('completed'))
636
661
  history.back()
637
662
  }
@@ -644,31 +669,32 @@ export class EditProductPopup extends localize(i18next)(LitElement) {
644
669
  }
645
670
 
646
671
  _getNewOrderProducts() {
672
+ const isStatusPending = this.status === 'PENDING' ? true : false
647
673
  return this.addProductGrist.dirtyData.records.map(record => {
648
674
  record.unitPrice = parseFloat(record.unitPrice)
649
675
  return {
650
- batchId: `N/A`,
651
- adjustedBatchId: record.batchId,
652
- palletQty: 0,
653
- adjustedPalletQty: record?.palletQty ? record.palletQty : null,
676
+ batchId: isStatusPending ? record.batchId : `N/A`,
677
+ adjustedBatchId: !(isStatusPending) ? record.batchId : null,
678
+ palletQty: isStatusPending ? (record.palletQty ? record.palletQty : 0 ): 0,
679
+ adjustedPalletQty: !(isStatusPending) ? (record?.palletQty ? record.palletQty : null) : null,
654
680
  product: { id: record.product.id },
655
681
  productDetail: { id: record.productDetailId },
656
- packingType: 'N/A',
657
- adjustedPackingType: record.packingType,
658
- uomValue: 0,
682
+ packingType: isStatusPending ? record.packingType : 'N/A',
683
+ adjustedPackingType: !(isStatusPending) ? record.packingType : null,
684
+ uomValue: isStatusPending ? record.uomValue : 0,
659
685
  status: ORDER_PRODUCT_STATUS.ADDED.value,
660
- adjustedUomValue: record?.uomValue ? record.uomValue : 0,
661
- uom: 'N/A',
662
- adjustedUom: record.uom,
663
- packQty: 0,
664
- adjustedPackQty: record.packQty,
665
- totalUomValue: 'N/A',
666
- adjustedTotalUomValue: record?.totalUomValue ? record.totalUomValue : 'N/A',
686
+ adjustedUomValue: !(isStatusPending) ? (record?.uomValue ? record.uomValue : 0) : null,
687
+ uom: isStatusPending ? record.uom : 'N/A',
688
+ adjustedUom: !(isStatusPending) ? record.uom : null,
689
+ packQty: isStatusPending ? (record.packQty ? record.packQty : 0 ): 0,
690
+ adjustedPackQty: !(isStatusPending) ? record.packQty : null,
691
+ totalUomValue: isStatusPending ? record.totalUomValue : 'N/A',
692
+ adjustedTotalUomValue: record?.totalUomValue && !(isStatusPending) ? record.totalUomValue : 'N/A',
667
693
  manufactureDate: record?.manufactureDate ? record.manufactureDate : null,
668
- batchIdRef: 'N/A',
669
- adjustedBatchIdRef: record?.batchIdRef ? record.batchIdRef : null,
670
- unitPrice: 0,
671
- adjustedUnitPrice: record?.unitPrice ? record.unitPrice : null,
694
+ batchIdRef: isStatusPending ? record?.batchIdRef : 'N/A',
695
+ adjustedBatchIdRef: record?.batchIdRef && !(isStatusPending) ? record.batchIdRef : null,
696
+ unitPrice: isStatusPending ? record.unitPrice : 0,
697
+ adjustedUnitPrice: record?.unitPrice && !(isStatusPending) ? record.unitPrice : null,
672
698
  remark: record?.remark ? record.remark : null,
673
699
  packingSize: record.packingSize || record.product.packingSize
674
700
  }
@@ -677,24 +703,37 @@ export class EditProductPopup extends localize(i18next)(LitElement) {
677
703
 
678
704
  _getExistingOrderProducts() {
679
705
  let editedOrderProducts = []
706
+ const isStatusPending = this.status === 'PENDING' ? true : false
680
707
  if (this.editProductGrist.dirtyData.records.some(record => record.__dirty__)) {
681
708
  this.editProductGrist.dirtyData.records.map(record => {
682
709
  record.unitPrice = parseFloat(record.unitPrice)
683
710
  editedOrderProducts.push({
684
711
  id: record.id,
685
- adjustedBatchId: record.batchId === record.__origin__.batchId ? null : record.batchId,
686
- adjustedBatchIdRef: record.batchIdRef === record.__origin__.batchIdRef ? null : record.batchIdRef,
687
- adjustedPalletQty: record.palletQty == record.__origin__.palletQty ? null : record.palletQty,
712
+ adjustedBatchId: !(isStatusPending) ? (record.batchId === record.__origin__.batchId ? null : record.batchId) : null,
713
+ adjustedBatchIdRef: !(isStatusPending) ? (record.batchIdRef === record.__origin__.batchIdRef ? null : record.batchIdRef) : null,
714
+ adjustedPalletQty: !(isStatusPending) ? (record.palletQty === record.__origin__.palletQty ? null : record.palletQty) : null,
688
715
  product: { id: record.product.id },
689
716
  productDetail: { id: record.productDetail.id },
690
- adjustedPackingType: record.packingType === record.__origin__.packingType ? null : record.packingType,
691
- adjustedUomValue: record.uomValue == record.__origin__.uomValue ? null : record.uomValue,
692
- adjustedUom: record.uom === record.__origin__.uom ? null : record.uom,
693
- adjustedPackQty: record.packQty == record.__origin__.packQty ? null : record.packQty,
694
- adjustedTotalUomValue: record.totalUomValue == record.__origin__.totalUomValue ? null : record.totalUomValue,
717
+ adjustedPackingType: !(isStatusPending) ? (record.packingType === record.__origin__.packingType ? null : record.packingType) : null,
718
+ adjustedUomValue: !(isStatusPending) ? (record.uomValue == record.__origin__.uomValue ? null : record.uomValue) : null,
719
+ adjustedUom: !(isStatusPending) ? (record.uom === record.__origin__.uom ? null : record.uom) : null,
720
+ adjustedPackQty: !(isStatusPending) ? (record.packQty == record.__origin__.packQty ? null : record.packQty) : null,
721
+ adjustedTotalUomValue: !(isStatusPending) ? (record.totalUomValue == record.__origin__.totalUomValue ? null : record.totalUomValue) : null,
695
722
  manufactureDate: record?.manufactureDate ? record.manufactureDate : null,
696
- adjustedUnitPrice: record?.unitPrice ? record.unitPrice : null,
697
- remark: record?.remark ? record.remark : null
723
+ adjustedUnitPrice: record?.unitPrice && !(isStatusPending) ? record.unitPrice : null,
724
+ remark: record?.remark ? record.remark : null,
725
+ ...(isStatusPending && {
726
+ unitPrice: record.unitPrice,
727
+ batchIdRef: record?.batchIdRef,
728
+ packingType: record.packingType,
729
+ packQty: record.packQty,
730
+ palletQty: record.palletQty,
731
+ uomValue: record.uomValue,
732
+ uom: record.uom,
733
+ batchId: record.batchId,
734
+ totalUomValue: record.totalUomValue
735
+ })
736
+
698
737
  })
699
738
  })
700
739
  }
@@ -717,6 +756,26 @@ export class EditProductPopup extends localize(i18next)(LitElement) {
717
756
  throw new Error(i18next.t('text.empty_value_in_add_product_list'))
718
757
  }
719
758
 
759
+ async fetchUserRoleHandler() {
760
+ const response = await client.query({
761
+ query: gql`
762
+ query myRoles {
763
+ myRoles {
764
+ id
765
+ name
766
+ description
767
+ }
768
+ }
769
+ `
770
+ })
771
+
772
+ if (!response.errors?.length) {
773
+ return response.data.myRoles
774
+ }
775
+
776
+ return []
777
+ }
778
+
720
779
  _showToast({ type, message }) {
721
780
  document.dispatchEvent(
722
781
  new CustomEvent('notify', {
@@ -1,21 +1,11 @@
1
1
  import '@things-factory/grist-ui'
2
2
 
3
3
  import gql from 'graphql-tag'
4
- import {
5
- css,
6
- html,
7
- LitElement
8
- } from 'lit-element'
4
+ import { css, html, LitElement } from 'lit-element'
9
5
 
10
6
  import { MultiColumnFormStyles } from '@things-factory/form-ui'
11
- import {
12
- i18next,
13
- localize
14
- } from '@things-factory/i18n-base'
15
- import {
16
- client,
17
- CustomAlert
18
- } from '@things-factory/shell'
7
+ import { i18next, localize } from '@things-factory/i18n-base'
8
+ import { client, CustomAlert } from '@things-factory/shell'
19
9
  import { ScrollbarStyles } from '@things-factory/styles'
20
10
  import { isMobileDevice } from '@things-factory/utils'
21
11
 
@@ -354,7 +344,8 @@ export class ReleaseExtraProductPopup extends localize(i18next)(LitElement) {
354
344
  filters: [
355
345
  { name: 'status', operator: 'eq', value: INVENTORY_STATUS.STORED.value },
356
346
  { name: 'bizplace_id', value: this.bizplace, operator: 'eq' },
357
- { name: 'recall', value: this.recall ? this.recall : false, operator: '' }
347
+ { name: 'recall', value: this.recall ? this.recall : false, operator: '' },
348
+ { name: 'invFilter', value: this.existingInventoryGrist.dirtyData.records.map(itm => itm.inventory.id), operator: 'eq' }
358
349
  ],
359
350
  locationSortingRules
360
351
  },
@@ -12,26 +12,14 @@ import '../../order/vas-order/popup/vas-target-product-popup'
12
12
  import '../../order/vas-order/popup/select-vas-popup'
13
13
 
14
14
  import gql from 'graphql-tag'
15
- import {
16
- css,
17
- html
18
- } from 'lit-element'
15
+ import { css, html } from 'lit-element'
19
16
  import { connect } from 'pwa-helpers/connect-mixin'
20
17
 
21
18
  import { getCodeByName } from '@things-factory/code-base'
22
19
  import { MultiColumnFormStyles } from '@things-factory/form-ui'
23
- import {
24
- i18next,
25
- localize
26
- } from '@things-factory/i18n-base'
20
+ import { i18next, localize } from '@things-factory/i18n-base'
27
21
  import { openPopup } from '@things-factory/layout-base'
28
- import {
29
- client,
30
- CustomAlert,
31
- navigate,
32
- PageView,
33
- store
34
- } from '@things-factory/shell'
22
+ import { client, CustomAlert, navigate, PageView, store } from '@things-factory/shell'
35
23
  import { CommonButtonStyles } from '@things-factory/styles'
36
24
  import { isMobileDevice } from '@things-factory/utils'
37
25
 
@@ -464,7 +452,7 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
464
452
  <input name="refNo3" ?readonly="${!this?._editable}" />
465
453
 
466
454
  <label>${i18next.t('label.release_date')}</label>
467
- <input name="releaseDate" type="date" ?readonly="${!this?._editable}"/>
455
+ <input name="releaseDate" type="date" ?readonly="${!this?._editable}" />
468
456
 
469
457
  <label ?hidden="${!this._ownTransport}">${i18next.t('label.co_no')}</label>
470
458
  <input name="collectionOrderNo" ?hidden="${!this._ownTransport}" ?readonly="${!this?._editable}" />
@@ -909,6 +897,17 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
909
897
  })
910
898
  }
911
899
 
900
+ if (
901
+ this._status === ORDER_STATUS.PENDING.value &&
902
+ this._userRoles?.find(itm => itm.name.toLowerCase().includes('admin'))
903
+ ) {
904
+ actions.push({
905
+ title: i18next.t('button.edit_product'),
906
+ action: this._openExtraProductPopup.bind(this),
907
+ ...CommonButtonStyles.add
908
+ })
909
+ }
910
+
912
911
  let addProductStatus = [ORDER_STATUS.PICKING.value, ORDER_STATUS.LOADING.value]
913
912
  if (addProductStatus.indexOf(this._status) >= 0 && this._allowROAddProductSetting && !this._isInBatchPicking) {
914
913
  actions.push({
@@ -1626,7 +1625,8 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
1626
1625
  remainQty: inventoryInfo.qty,
1627
1626
  remainUomValue: inventoryInfo.uomValue,
1628
1627
  releaseUomValue: inventoryInfo.releaseUomValue,
1629
- releaseUomValueWithUom: inventoryInfo.releaseUomValue + ' ' + inventoryInfo.uom
1628
+ releaseUomValueWithUom: inventoryInfo.releaseUomValue + ' ' + inventoryInfo.uom,
1629
+ uom: inventoryInfo.uom
1630
1630
  },
1631
1631
  qty: inventoryInfo.qty,
1632
1632
  remainQty: inventoryInfo.qty - inventoryInfo.lockedQty,
@@ -1654,6 +1654,7 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
1654
1654
 
1655
1655
  this._releaseOrderId = releaseOrder.id
1656
1656
  this.partnerBizplaceId = releaseOrder.bizplace.id
1657
+ this.partnerBizplace = releaseOrder.bizplace
1657
1658
  this._exportOption = releaseOrder.exportOption
1658
1659
  this._recallOption = releaseOrder.recall
1659
1660
 
@@ -3443,6 +3444,7 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
3443
3444
  return this.vasFormattedData
3444
3445
  }
3445
3446
 
3447
+
3446
3448
  sortByNameField(items, nameField, nameField2) {
3447
3449
  if (nameField2) {
3448
3450
  items?.sort((a, b) => {
@@ -1,2 +1,3 @@
1
1
  export * from './page-settings'
2
2
  export * from './toast'
3
+ export * from './send-to-printer'
@@ -0,0 +1,28 @@
1
+ export const sendToPrinter = async function (labelId, printData, printer) {
2
+ if (!printer) {
3
+ throw 'Printer is not defined'
4
+ }
5
+
6
+ let searchParams = new URLSearchParams()
7
+ Object.entries(printData).forEach(obj => {
8
+ if (typeof obj[1] != 'object') {
9
+ searchParams.append(obj[0], obj[1])
10
+ }
11
+ })
12
+
13
+ try {
14
+ const response = await fetch(`label-command/${labelId}?${searchParams.toString()}`, {
15
+ method: 'GET'
16
+ })
17
+
18
+ if (response.status !== 200) {
19
+ throw `Error : Can't get label command from server (response: ${response.status})`
20
+ }
21
+
22
+ let command = await response.text()
23
+
24
+ await printer.print(command)
25
+ } catch (ex) {
26
+ throw ex
27
+ }
28
+ }
@@ -32,6 +32,7 @@ exports.boardSettingsResolver = {
32
32
  opa_app_setting_constants_1.REUSABLE_PALLET_LABEL_SETTING_KEY,
33
33
  HOME_BOARD,
34
34
  opa_app_setting_constants_1.CARTON_LABEL_SETTING_KEY,
35
+ opa_app_setting_constants_1.CARTON_LABEL_BY_SKU_SETTING_KEY,
35
36
  opa_app_setting_constants_1.INTENALIZED_AWB_SETTING_KEY,
36
37
  opa_app_setting_constants_1.ROUTE_LABEL_SETTING_KEY,
37
38
  opa_app_setting_constants_1.TOTE_LABEL_SETTING_KEY
@@ -1 +1 @@
1
- {"version":3,"file":"board-settings.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/board-setting/board-settings.ts"],"names":[],"mappings":";;;AAAA,qCAAuC;AAEvC,yDAAgD;AAChD,iEAAqD;AACrD,+DAAsD;AAGtD,kFAW2C;AAE9B,QAAA,qBAAqB,GAAG;IACnC,KAAK,CAAC,aAAa,CAAC,CAAM,EAAE,MAAW,EAAE,OAAY;QACnD,MAAM,EAAE,MAAM,EAAE,GAAuB,OAAO,CAAC,KAAK,CAAA;QAEpD;;6FAEqF;QACrF,MAAM,IAAI,GAAS,MAAM,IAAA,uBAAa,EAAC,gBAAI,CAAC;aACzC,kBAAkB,CAAC,MAAM,CAAC;aAC1B,iBAAiB,CAAC,YAAY,EAAE,OAAO,CAAC;aACxC,iBAAiB,CAAC,cAAc,EAAE,cAAc,CAAC;aACjD,KAAK,CAAC,mBAAmB,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC;aAC7D,QAAQ,CAAC,6BAA6B,EAAE,EAAE,QAAQ,EAAE,MAAM,CAAC,EAAE,EAAE,CAAC;aAChE,MAAM,EAAE,CAAA;QAEX,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,CAAA;QAC3E,oFAAoF;QAEpF,MAAM,UAAU,GAAG,GAAG,iDAAqB,IAAI,QAAQ,EAAE,CA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S,CAAC,CAAA;iBAC7C;qBAAM;oBACL,OAAO,CAAC,GAAG,CAAC,GAAG,YAAY,CAAC,GAAG,CAAC,CAAA;iBACjC;aACF;YAED,IAAI,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,iDAAqB,CAAC,IAAI,CAAC,EAAE;gBACpD,OAAO,CAAC,IAAI,GAAG,iDAAqB,CAAA;aACrC;YAED,OAAO,OAAO,CAAA;QAChB,CAAC,CAAC,CAAA;IACJ,CAAC;CACF,CAAA"}
1
+ {"version":3,"file":"board-settings.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/board-setting/board-settings.ts"],"names":[],"mappings":";;;AAAA,qCAAuC;AAEvC,yDAAgD;AAChD,iEAAqD;AACrD,+DAAsD;AAGtD,kFAY2C;AAE9B,QAAA,qBAAqB,GAAG;IACnC,KAAK,CAAC,aAAa,CAAC,CAAM,EAAE,MAAW,EAAE,OAAY;QACnD,MAAM,EAAE,MAAM,EAAE,GAAuB,OAAO,CAAC,KAAK,CAAA;QAEpD;;6FAEqF;QACrF,MAAM,IAAI,GAAS,MAAM,IAAA,uBAAa,EAAC,gBAAI,CAAC;aACzC,kBAAkB,CAAC,MAAM,CAAC;aAC1B,iBAAiB,CAAC,YAAY,EAAE,OAAO,CAAC;aACxC,iBAAiB,CAAC,cAAc,EAAE,cAAc,CAAC;aACjD,KAAK,CAAC,mBAAmB,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC;aAC7D,QAAQ,CAAC,6BAA6B,EAAE,EAAE,QAAQ,EAAE,MAAM,CAAC,EAAE,EAAE,CAAC;aAChE,MAAM,EAAE,CAAA;QAEX,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,CAAA;QAC3E,oFAAoF;QAEpF,MAAM,UAAU,GAAG,GAA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