diff --git a/src/components/ADempiere/Form/PriceChecking/index.vue b/src/components/ADempiere/Form/PriceChecking/index.vue index a7f8d21f..54947a54 100644 --- a/src/components/ADempiere/Form/PriceChecking/index.vue +++ b/src/components/ADempiere/Form/PriceChecking/index.vue @@ -130,9 +130,7 @@ export default { } }, created() { - if (this.isEmptyValue(this.currentPoint)) { - this.$store.dispatch('listPointOfSalesFromServer') - } + this.$store.dispatch('listPointOfSalesFromServer') this.unsubscribe = this.subscribeChanges() }, mounted() { diff --git a/src/store/modules/ADempiere/pointOfSales/index.js b/src/store/modules/ADempiere/pointOfSales/index.js index 853e05d4..ad045526 100644 --- a/src/store/modules/ADempiere/pointOfSales/index.js +++ b/src/store/modules/ADempiere/pointOfSales/index.js @@ -136,7 +136,12 @@ const pointOfSales = { return currentPOS.uuid }, // current pos info - getCurrentPOS: (state) => { + getCurrentPOS: (state, getters) => { + const userUuid = getters['user/getUserUuid'] + const sellingPointsList = state.pointOfSales.sellingPointsList.length + if (sellingPointsList > 1) { + return state.pointOfSales.sellingPointsList.find(elem => elem.salesRepresentative.uuid === userUuid) + } if (isEmptyValue(state.pointOfSales)) { return undefined }