error correction with default point of sale with sales representative (#582)
* error correction with default point of sale with sales representative * minimal changepull/3759/head
parent
19d4bb123d
commit
e2bbc598a7
|
|
@ -130,9 +130,7 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
if (this.isEmptyValue(this.currentPoint)) {
|
|
||||||
this.$store.dispatch('listPointOfSalesFromServer')
|
this.$store.dispatch('listPointOfSalesFromServer')
|
||||||
}
|
|
||||||
this.unsubscribe = this.subscribeChanges()
|
this.unsubscribe = this.subscribeChanges()
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
|
|
||||||
|
|
@ -136,7 +136,12 @@ const pointOfSales = {
|
||||||
return currentPOS.uuid
|
return currentPOS.uuid
|
||||||
},
|
},
|
||||||
// current pos info
|
// 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)) {
|
if (isEmptyValue(state.pointOfSales)) {
|
||||||
return undefined
|
return undefined
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue