Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Co-authored-by: elsiosanchez <elsiossanches@gmail.com>
  • Loading branch information
elsiosanchez and elsiosanchez authored Feb 7, 2022
1 parent f525894 commit 338eb9f
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/components/ADempiere/Form/PriceChecking/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ export default {
formatPrice,
formatQuantity,
focusProductValue() {
if (!this.isEmptyValue(this.$refs.ProductValue[0])) {
if (!this.isEmptyValue(this.$refs.ProductValue[0]) && !this.isEmptyValue(this.$refs.ProductValue[0].$children[0]) && !this.isEmptyValue(this.$refs.ProductValue[0].$children[0].$children[0]) && !this.isEmptyValue(this.$refs.ProductValue[0].$children[0].$children[0].$children[1])) {
this.$refs.ProductValue[0].$children[0].$children[0].$children[1].$children[0].focus()
}
},
Expand Down
3 changes: 2 additions & 1 deletion src/lang/ADempiere/en/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ export default {
recordLocked: 'This record has been locked',
recordUnlocked: 'This record has been unlocked',
noRoleAccess: 'With your current role and settings, you cannot view this information.',
errorPointOfSale: 'No point of sale selected'
errorPointOfSale: 'No point of sale selected',
emptyPos: 'This User has no Assigned POS Terminal'
},
navbar: {
badge: {
Expand Down
3 changes: 2 additions & 1 deletion src/lang/ADempiere/es/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ export default {
recordLocked: 'Este registro ha sido bloqueado',
recordUnlocked: 'Este registro ha sido desbloqueado',
noRoleAccess: 'Con su rol y configuración actuales, no puede ver esta información.',
errorPointOfSale: 'Sin punto de venta seleccionado'
errorPointOfSale: 'Sin punto de venta seleccionado',
emptyPos: 'Este Usuario no tiene Ningún Terminal de PDV Asignado'
},
navbar: {
badge: {
Expand Down
19 changes: 14 additions & 5 deletions src/store/modules/ADempiere/pointOfSales/point/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import {
} from '@/api/ADempiere/form/point-of-sales.js'
import { isEmptyValue } from '@/utils/ADempiere/valueUtils.js'
import { showMessage } from '@/utils/ADempiere/notification.js'
import language from '@/lang'

/**
* Pos Actions
Expand Down Expand Up @@ -74,17 +75,25 @@ export default {
})
.then(response => {
pointOfSalesList = response.sellingPointsList
if (isEmptyValue(pos) && isEmptyValue(posToSet)) {
if (isEmptyValue(pos) && isEmptyValue(posToSet) && !isEmptyValue(pointOfSalesList)) {
pos = pointOfSalesList.find(itemPOS => itemPOS.salesRepresentative.uuid === userUuid)
}
if (isEmptyValue(pos)) {
if (isEmptyValue(pos) && !isEmptyValue(pointOfSalesList)) {
pos = pointOfSalesList[0]
}
if (!isEmptyValue(router.app._route.query.pos)) {
pos = response.sellingPointsList.find(point => point.id === parseInt(router.app._route.query.pos))
if (!isEmptyValue(router.app._route.query.pos) && !isEmptyValue(pointOfSalesList)) {
pos = pointOfSalesList.find(point => point.id === parseInt(router.app._route.query.pos))
}
commit('setPointOfSalesList', pointOfSalesList)
dispatch('setCurrentPOS', pos)
if (pos) {
dispatch('setCurrentPOS', pos)
} else {
showMessage({
type: 'error',
message: language.t('notifications.emptyPos'),
showClose: true
})
}
})
.catch(error => {
console.warn(`listPointOfSalesFromServer: ${error.message}. Code: ${error.code}.`)
Expand Down

0 comments on commit 338eb9f

Please sign in to comment.