-
+
-
+
-
+
-
+
-
+
@@ -248,8 +240,8 @@
-
-
+
+
-
+
+
+
+
+
+
+
+ {{ $t('form.pos.optionsPoinSales.generalOptions.changeWarehouseList') }}
+
+
+
+ {{ item.name }}
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ $t('form.pos.optionsPoinSales.generalOptions.changePriceList') }}
+
+
+ {{ item.name }}
+
+
+
+
+
@@ -347,9 +383,9 @@ export default {
},
blockOption() {
if (!this.isEmptyValue(this.$route.query.pos)) {
- return 'cursor: pointer; text-align: center !important; color: black'
+ return 'cursor: pointer; text-align: center !important; color: black;min-height: 50px;'
}
- return 'cursor: not-allowed; text-align: center !important; color: gray;'
+ return 'cursor: not-allowed; text-align: center !important; color: gray;min-height: 50px;'
},
size() {
const size = this.$store.getters.getWidthLeft
@@ -475,7 +511,8 @@ export default {
createOrder({
posUuid,
customerUuid: this.currentOrder.businessPartner.uuid,
- salesRepresentativeUuid: this.currentOrder.salesRepresentative.uuid
+ salesRepresentativeUuid: this.currentOrder.salesRepresentative.uuid,
+ warehouseUuid: this.$store.getters.currentWarehouse.uuid
})
.then(order => {
this.$store.dispatch('currentOrder', order)
diff --git a/src/components/ADempiere/Form/VPOS/Order/index.vue b/src/components/ADempiere/Form/VPOS/Order/index.vue
index dc4ef798..b917363f 100644
--- a/src/components/ADempiere/Form/VPOS/Order/index.vue
+++ b/src/components/ADempiere/Form/VPOS/Order/index.vue
@@ -189,17 +189,17 @@
-
+
-
+
{{ $t('form.pos.order.pointSale') }}: {{ currentPointOfSales.name }}
-
+
+
+
+
+
+ {{ $t('route.warehouse') }}: {{ curretnWarehouse.name }}
+
+
+
+ {{ item.name }}
+
+
+
+
+
+
+
+ {{ $t('form.pos.priceList') }}: {{ curretnPriceList.name }}
+
+
+
+ {{ item.name }}
+
+
+
@@ -513,6 +555,31 @@ export default {
currentLineOrder() {
const line = this.$store.state['pointOfSales/orderLine/index'].line
return line
+ },
+ curretnPriceList() {
+ if (!this.isEmptyValue(this.$store.getters.currentPriceList)) {
+ return this.$store.getters.currentPriceList
+ }
+ return {}
+ },
+ pointPriceList() {
+ const list = this.$store.getters.posAttributes.currentPointOfSales.listPrices
+ if (this.isEmptyValue(list)) {
+ return []
+ }
+ return list
+ },
+ curretnWarehouse() {
+ if (!this.isEmptyValue(this.$store.getters['user/getWarehouse'])) {
+ return this.$store.getters['user/getWarehouse']
+ }
+ return {}
+ },
+ listWarehouse() {
+ if (!this.isEmptyValue(this.$store.getters.currentWarehouse)) {
+ return this.$store.getters.currentWarehouse
+ }
+ return []
}
},
mounted() {
@@ -598,6 +665,12 @@ export default {
this.$store.dispatch('setCurrentPOS', posElement)
this.newOrder()
},
+ changeWarehouse(warehouse) {
+ this.$store.commit('currentWarehouse', warehouse)
+ },
+ changePriceList(priceList) {
+ this.$store.commit('currentListPrices', priceList)
+ },
arrowTop() {
if (this.currentTable > 0) {
this.currentTable--
@@ -652,12 +725,16 @@ export default {
.keypad {
float: left;
height: 20%;
- padding-top: 25px;
+ padding-top: 10px;
}
.total {
margin-top: 10px;
margin-bottom: 10px
}
+ .info-pos {
+ padding-top: 10px;
+ color: black;
+ }
.split {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
diff --git a/src/components/ADempiere/Form/VPOS/posMixin.js b/src/components/ADempiere/Form/VPOS/posMixin.js
index 08357a13..e15e67e0 100644
--- a/src/components/ADempiere/Form/VPOS/posMixin.js
+++ b/src/components/ADempiere/Form/VPOS/posMixin.js
@@ -81,12 +81,33 @@ export default {
uuid: '',
iSOCode: '',
curSymbol: '',
- amountConvertion: 1
+ amountConvertion: 1,
+ divideRate: 1
}
},
listPointOfSales() {
return this.$store.getters.posAttributes.listPointOfSales
},
+ curretnPriceList() {
+ if (!this.isEmptyValue(this.$store.getters.currentPriceList)) {
+ return this.$store.getters.currentPriceList
+ }
+ return {}
+ },
+ priceListPointOfSales() {
+ const list = this.$store.getters.posAttributes.currentPointOfSales.listPrices
+ if (this.isEmptyValue(list)) {
+ return []
+ }
+ return list
+ },
+ warehousesListPointOfSales() {
+ const list = this.$store.getters.posAttributes.currentPointOfSales.listWarehouses
+ if (this.isEmptyValue(list)) {
+ return []
+ }
+ return list
+ },
ordersList() {
if (this.isEmptyValue(this.currentPointOfSales)) {
return []
@@ -223,10 +244,12 @@ export default {
}
const searchProduct = (typeof searchValue === 'object') ? searchValue.value : searchValue
-
+ if (this.isEmptyValue(this.curretnPriceList)) {
+ return
+ }
findProduct({
searchValue: searchProduct,
- priceListUuid: this.currentPointOfSales.priceList.uuid
+ priceListUuid: this.curretnPriceList.uuid
})
.then(productPrice => {
this.product = productPrice.product
diff --git a/src/lang/ADempiere/en.js b/src/lang/ADempiere/en.js
index 9c2698e4..61b6bb09 100644
--- a/src/lang/ADempiere/en.js
+++ b/src/lang/ADempiere/en.js
@@ -410,6 +410,7 @@ export default {
form: {
pos: {
title: 'POS',
+ priceList: 'Price List',
optionsPoinSales: {
title: 'Quick Point of Sales Options',
salesOrder: {
@@ -434,7 +435,9 @@ export default {
generalOptions: {
title: 'General Options',
changePos: 'Change Point of Sale',
- listProducts: 'Change Point of Sale'
+ listProducts: 'Change Point of Sale',
+ changeWarehouseList: 'Change Warehouse',
+ changePriceList: 'Change Price List'
}
},
tableProduct: {
@@ -526,7 +529,7 @@ export default {
description: 'Display the Point of Sale Options panel'
},
point: {
- description: 'Displays the current point of sale'
+ description: 'Current point of sale information'
},
buttonPanelRightPos: {
title: 'Show Right Panel',
diff --git a/src/lang/ADempiere/es.js b/src/lang/ADempiere/es.js
index f07c2296..592c50a2 100644
--- a/src/lang/ADempiere/es.js
+++ b/src/lang/ADempiere/es.js
@@ -385,6 +385,7 @@ export default {
form: {
pos: {
title: 'Punto de Venta',
+ priceList: 'Lista de Precio',
optionsPoinSales: {
title: 'Opciones Rápidas del Punto de Ventas',
salesOrder: {
@@ -409,7 +410,9 @@ export default {
generalOptions: {
title: 'Opciones Generales',
changePos: 'Cambiar Punto de Venta',
- listProducts: 'Lista de Productos y Precios'
+ listProducts: 'Lista de Productos y Precios',
+ changeWarehouseList: 'Cambiar de Almacén',
+ changePriceList: 'Cambiar Lista de Precio'
}
},
tableProduct: {
@@ -502,7 +505,7 @@ export default {
description: 'Despliega el panel de Opciones del Punto de Venta'
},
point: {
- description: 'Muestra el punto de venta actual'
+ description: 'Informacion del punto de venta actual'
},
buttonPanelRightPos: {
title: 'Mostrar Panel Derecho',
diff --git a/src/store/modules/ADempiere/pointOfSales/getters/index.js b/src/store/modules/ADempiere/pointOfSales/getters/index.js
index eff94cc2..cdfae8d4 100644
--- a/src/store/modules/ADempiere/pointOfSales/getters/index.js
+++ b/src/store/modules/ADempiere/pointOfSales/getters/index.js
@@ -45,13 +45,17 @@ export default {
* List Order Lines
* List Payment Order
* Lst Order
+ * List Warehouses
+ * List Prices
*/
- posAttributes: (state, getters) => {
+ posAttributes: (state) => {
return {
listPointOfSales: state.listPointOfSales,
currentPointOfSales: {
...state.currentPointOfSales,
listOrder: state.listOrder,
+ listWarehouses: state.listWarehouses,
+ listPrices: state.listPrices,
currentOrder: {
...state.order,
lineOrder: state.listOrderLine,
@@ -106,5 +110,23 @@ export default {
}
}
return state.keyLayout
+ },
+ /**
+ * Current Price List
+ */
+ currentPriceList: (state) => {
+ if (!isEmptyValue(state.currentlistPrices)) {
+ return state.currentlistPrices
+ }
+ return {}
+ },
+ /**
+ * Current Warehouse
+ */
+ currentWarehouse: (state) => {
+ if (!isEmptyValue(state.currentWarehouse)) {
+ return state.currentWarehouse
+ }
+ return {}
}
}
diff --git a/src/store/modules/ADempiere/pointOfSales/order/actions.js b/src/store/modules/ADempiere/pointOfSales/order/actions.js
index 4b005da6..db9a3ed9 100644
--- a/src/store/modules/ADempiere/pointOfSales/order/actions.js
+++ b/src/store/modules/ADempiere/pointOfSales/order/actions.js
@@ -34,7 +34,7 @@ export default {
* @param {string} customerUuid Customer Uuid
* @param {string} salesRepresentativeUuid Sales Representative Uuid
*/
- createOrder({ commit, dispatch }, {
+ createOrder({ commit, dispatch, rootGetters }, {
posUuid,
customerUuid,
salesRepresentativeUuid
@@ -42,7 +42,8 @@ export default {
return createOrder({
posUuid,
customerUuid,
- salesRepresentativeUuid
+ salesRepresentativeUuid,
+ warehouseUuid: rootGetters.currentWarehouse.uuid
})
.then(order => {
commit('setOrder', order)
@@ -66,7 +67,7 @@ export default {
* @param {string} posUuid Order Uuid
* @param {string} customerUuid Customer Uuid
*/
- updateOrder({ commit, dispatch }, {
+ updateOrder({ commit, dispatch, rootGetters }, {
orderUuid,
posUuid,
customerUuid
@@ -74,7 +75,7 @@ export default {
updateOrder({
orderUuid,
posUuid,
- customerUuid
+ warehouseUuid: rootGetters.currentWarehouse.uuid
})
.then(response => {
dispatch('reloadOrder', { orderUuid: response.uuid })
diff --git a/src/store/modules/ADempiere/pointOfSales/payments/actions.js b/src/store/modules/ADempiere/pointOfSales/payments/actions.js
index 5452c821..ffee5c2e 100644
--- a/src/store/modules/ADempiere/pointOfSales/payments/actions.js
+++ b/src/store/modules/ADempiere/pointOfSales/payments/actions.js
@@ -111,6 +111,25 @@ export default {
const payment = state.paymentBox
payment.splice(0)
},
+ searchConversion({ commit }, params) {
+ requestGetConversionRate({
+ conversionTypeUuid: params.conversionTypeUuid,
+ currencyFromUuid: params.currencyFromUuid,
+ currencyToUuid: params.currencyToUuid,
+ conversionDate: params.conversionDate
+ })
+ .then(response => {
+ commit('conversionList', response)
+ })
+ .catch(error => {
+ console.warn(`conversionDivideRate: ${error.message}. Code: ${error.code}.`)
+ showMessage({
+ type: 'error',
+ message: error.message,
+ showClose: true
+ })
+ })
+ },
conversionDivideRate({ commit, dispatch }, params) {
return requestGetConversionRate({
conversionTypeUuid: params.conversionTypeUuid,
diff --git a/src/store/modules/ADempiere/pointOfSales/point/actions.js b/src/store/modules/ADempiere/pointOfSales/point/actions.js
index 7ada5d9b..55b21a97 100644
--- a/src/store/modules/ADempiere/pointOfSales/point/actions.js
+++ b/src/store/modules/ADempiere/pointOfSales/point/actions.js
@@ -16,7 +16,10 @@
import router from '@/router'
import {
- listPointOfSales
+ listPointOfSales,
+ listWarehouse,
+ listPrices,
+ listCurrencies
} from '@/api/ADempiere/form/point-of-sales.js'
import { isEmptyValue } from '@/utils/ADempiere/valueUtils.js'
import { showMessage } from '@/utils/ADempiere/notification.js'
@@ -58,7 +61,55 @@ export default {
})
})
},
- setCurrentPOS({ commit, dispatch }, posToSet) {
+ listWarehouseFromServer({ commit }, posUuid) {
+ listWarehouse({
+ posUuid
+ })
+ .then(response => {
+ commit('listWarehouses', response.records)
+ })
+ .catch(error => {
+ console.warn(`listWarehouseFromServer: ${error.message}. Code: ${error.code}.`)
+ showMessage({
+ type: 'error',
+ message: error.message,
+ showClose: true
+ })
+ })
+ },
+ listPricesFromServer({ commit }, point) {
+ listPrices({
+ posUuid: point.uuid
+ })
+ .then(response => {
+ commit('listPrices', response.records)
+ })
+ .catch(error => {
+ console.warn(`listPricesFromServer: ${error.message}. Code: ${error.code}.`)
+ showMessage({
+ type: 'error',
+ message: error.message,
+ showClose: true
+ })
+ })
+ },
+ listCurrenciesFromServer({ commit }, posUuid) {
+ listCurrencies({
+ posUuid
+ })
+ .then(response => {
+ commit('listCurrencies', response.records)
+ })
+ .catch(error => {
+ console.warn(`listPricesFromServer: ${error.message}. Code: ${error.code}.`)
+ showMessage({
+ type: 'error',
+ message: error.message,
+ showClose: true
+ })
+ })
+ },
+ setCurrentPOS({ commit, dispatch, rootGetters }, posToSet) {
commit('currentPointOfSales', posToSet)
const oldRoute = router.app._route
router.push({
@@ -71,7 +122,11 @@ export default {
pos: posToSet.id
}
}, () => {})
-
+ dispatch('listWarehouseFromServer', posToSet.uuid)
+ dispatch('listCurrenciesFromServer', posToSet.uuid)
+ dispatch('listPricesFromServer', posToSet)
+ commit('currentListPrices', posToSet.priceList)
+ commit('currentWarehouse', rootGetters['user/getWarehouse'])
commit('resetConversionRate', [])
commit('setIsReloadKeyLayout')
commit('setIsReloadProductPrice')
diff --git a/src/store/modules/ADempiere/pointOfSales/point/mutations.js b/src/store/modules/ADempiere/pointOfSales/point/mutations.js
index 997dfbb7..f1236d1c 100644
--- a/src/store/modules/ADempiere/pointOfSales/point/mutations.js
+++ b/src/store/modules/ADempiere/pointOfSales/point/mutations.js
@@ -30,6 +30,24 @@ export default {
listPointOfSales(state, listPointOfSales) {
state.listPointOfSales = listPointOfSales
},
+ listWarehouses(state, listWarehouses) {
+ state.listWarehouses = listWarehouses
+ },
+ currentListPrices(state, listPrices) {
+ state.currentlistPrices = listPrices
+ },
+ currentWarehouse(state, warehouse) {
+ state.currentWarehouse = warehouse
+ },
+ listPrices(state, listPrices) {
+ state.listPrices = listPrices
+ },
+ listCurrencies(state, listCurrency) {
+ state.listCurrency = listCurrency
+ },
+ conversionList(state, conversion) {
+ state.conversionList.push(conversion)
+ },
currentPointOfSales(state, currentPointOfSales) {
state.currentPointOfSales = currentPointOfSales
},
diff --git a/src/store/modules/ADempiere/pointOfSales/point/state.js b/src/store/modules/ADempiere/pointOfSales/point/state.js
index 5dd4c8e3..631d56e5 100644
--- a/src/store/modules/ADempiere/pointOfSales/point/state.js
+++ b/src/store/modules/ADempiere/pointOfSales/point/state.js
@@ -28,6 +28,12 @@ export default {
...withoutResponse
},
listPointOfSales: {},
+ listWarehouses: {},
+ listPrices: {},
+ currentlistPrices: {},
+ currentWarehouse: {},
+ listCurrency: [],
+ conversionList: [],
currentPointOfSales: {},
showPOSOptions: false,
showPOSKeyLayout: false,
diff --git a/src/store/modules/ADempiere/pointOfSales/productPrice/actions.js b/src/store/modules/ADempiere/pointOfSales/productPrice/actions.js
index cebd3c40..ea4c2ca6 100644
--- a/src/store/modules/ADempiere/pointOfSales/productPrice/actions.js
+++ b/src/store/modules/ADempiere/pointOfSales/productPrice/actions.js
@@ -58,9 +58,8 @@ export default {
pageToken = token + '-' + pageNumber
}
}
- const { priceList, templateBusinessPartner } = rootGetters.posAttributes.currentPointOfSales
+ const { templateBusinessPartner } = rootGetters.posAttributes.currentPointOfSales
const { uuid: businessPartnerUuid } = templateBusinessPartner
- const { uuid: priceListUuid } = priceList
const { uuid: warehouseUuid } = rootGetters['user/getWarehouse']
if (isEmptyValue(searchValue)) {
searchValue = rootGetters.getValueOfField({
@@ -71,9 +70,9 @@ export default {
return new Promise(resolve => {
getProductPriceList({
searchValue,
- priceListUuid,
+ priceListUuid: rootGetters.currentPriceList.uuid,
businessPartnerUuid,
- warehouseUuid,
+ warehouseUuid: rootGetters.currentWarehouse.uuid,
pageToken
}).then(responseProductPrice => {
if (isEmptyValue(token) || isEmptyValue(pageToken)) {
@@ -130,9 +129,8 @@ export default {
}
}
- const { priceList, templateBusinessPartner } = rootGetters.posAttributes.currentPointOfSales
+ const { templateBusinessPartner } = rootGetters.posAttributes.currentPointOfSales
const { uuid: businessPartnerUuid } = templateBusinessPartner
- const { uuid: priceListUuid } = priceList
const { uuid: warehouseUuid } = rootGetters['user/getWarehouse']
if (isEmptyValue(searchValue)) {
@@ -144,7 +142,7 @@ export default {
return new Promise(resolve => {
getProductPriceList({
searchValue,
- priceListUuid,
+ priceListUuid: rootGetters.currentPriceList.uuid,
businessPartnerUuid,
warehouseUuid,
pageToken