diff --git a/src/api/ADempiere/form/point-of-sales.js b/src/api/ADempiere/form/point-of-sales.js index e06ab0e5..cabaa634 100644 --- a/src/api/ADempiere/form/point-of-sales.js +++ b/src/api/ADempiere/form/point-of-sales.js @@ -376,10 +376,9 @@ export function getKeyLayout({ keyLayoutUuid }) { // ListProductPrice export function getProductPriceList({ searchValue, - priceListUuid, businessPartnerUuid, - warehouseUuid, validFrom, + posUuid, // Query // criteria, pageSize, @@ -389,11 +388,10 @@ export function getProductPriceList({ url: `${config.pointOfSales.endpoint}/product-prices`, method: 'get', params: { - price_list_uuid: priceListUuid, + pos_uuid: posUuid, search_value: searchValue, valid_from: validFrom, business_partner_uuid: businessPartnerUuid, - warehouse_uuid: warehouseUuid, page_size: pageSize, page_token: pageToken } diff --git a/src/api/ADempiere/form/price-checking.js b/src/api/ADempiere/form/price-checking.js index 0b85296d..bc74aace 100644 --- a/src/api/ADempiere/form/price-checking.js +++ b/src/api/ADempiere/form/price-checking.js @@ -25,9 +25,8 @@ export function getProductPrice({ upc, value, name, - priceListUuid, + posUuid, businessPartnerUuid, - warehouseUuid, validFrom }) { return request({ @@ -38,9 +37,8 @@ export function getProductPrice({ upc, value, name, - price_list_uuid: priceListUuid, + pos_uuid: posUuid, business_partner_uuid: businessPartnerUuid, - warehouse_uuid: warehouseUuid, valid_from: validFrom } }) diff --git a/src/components/ADempiere/Form/VPOS/Order/index.vue b/src/components/ADempiere/Form/VPOS/Order/index.vue index b31f5d94..bc3862e7 100644 --- a/src/components/ADempiere/Form/VPOS/Order/index.vue +++ b/src/components/ADempiere/Form/VPOS/Order/index.vue @@ -675,7 +675,7 @@ export default { this.$store.commit('currentWarehouse', warehouse) }, changePriceList(priceList) { - this.$store.commit('currentListPrices', priceList) + this.$store.commit('currentPriceList', priceList) }, arrowTop() { if (this.currentTable > 0) { diff --git a/src/components/ADempiere/Form/VPOS/Order/orderLineMixin.js b/src/components/ADempiere/Form/VPOS/Order/orderLineMixin.js index 00880909..849696ea 100644 --- a/src/components/ADempiere/Form/VPOS/Order/orderLineMixin.js +++ b/src/components/ADempiere/Form/VPOS/Order/orderLineMixin.js @@ -83,9 +83,9 @@ export default { }, created() { - const currentCurrency = this.$store.getters.posAttributes.listPointOfSales.find(pos => - pos.priceList.currency.uuid !== this.$store.getters.posAttributes.currentPointOfSales.priceList.currency.uuid) - this.convertedAmountAsTotal(currentCurrency.priceList.currency) + if (!this.isEmptyValue(this.$store.getters.posAttributes.currentPointOfSales.displayCurrency)) { + this.convertedAmountAsTotal(this.$store.getters.posAttributes.currentPointOfSales.displayCurrency) + } }, methods: { formatPercent, diff --git a/src/lang/ADempiere/en.js b/src/lang/ADempiere/en.js index 61b6bb09..fabb2613 100644 --- a/src/lang/ADempiere/en.js +++ b/src/lang/ADempiere/en.js @@ -474,6 +474,7 @@ export default { payment: 'Payment', change: 'Change', convertAmount: 'Convert Quantity', + convertedAmount: 'Converted Amount', fullPayment: 'Full Payment', dayRate: 'Day Rate', TenderType: { diff --git a/src/store/modules/ADempiere/pointOfSales/getters/index.js b/src/store/modules/ADempiere/pointOfSales/getters/index.js index cdfae8d4..7cb4911b 100644 --- a/src/store/modules/ADempiere/pointOfSales/getters/index.js +++ b/src/store/modules/ADempiere/pointOfSales/getters/index.js @@ -115,8 +115,8 @@ export default { * Current Price List */ currentPriceList: (state) => { - if (!isEmptyValue(state.currentlistPrices)) { - return state.currentlistPrices + if (!isEmptyValue(state.currentPriceList)) { + return state.currentPriceList } return {} }, @@ -129,4 +129,5 @@ export default { } return {} } + // Current POS, it can be s } diff --git a/src/store/modules/ADempiere/pointOfSales/point/actions.js b/src/store/modules/ADempiere/pointOfSales/point/actions.js index 55b21a97..c2f58dd0 100644 --- a/src/store/modules/ADempiere/pointOfSales/point/actions.js +++ b/src/store/modules/ADempiere/pointOfSales/point/actions.js @@ -125,7 +125,7 @@ export default { dispatch('listWarehouseFromServer', posToSet.uuid) dispatch('listCurrenciesFromServer', posToSet.uuid) dispatch('listPricesFromServer', posToSet) - commit('currentListPrices', posToSet.priceList) + commit('currentPriceList', posToSet.priceList) commit('currentWarehouse', rootGetters['user/getWarehouse']) commit('resetConversionRate', []) commit('setIsReloadKeyLayout') diff --git a/src/store/modules/ADempiere/pointOfSales/point/mutations.js b/src/store/modules/ADempiere/pointOfSales/point/mutations.js index f1236d1c..552b4a6e 100644 --- a/src/store/modules/ADempiere/pointOfSales/point/mutations.js +++ b/src/store/modules/ADempiere/pointOfSales/point/mutations.js @@ -14,27 +14,19 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -import Vue from 'vue' - /** * Pos Mutations * @author Elsio Sanchez */ export default { - setPontOfSales(state, pos) { - state.pointOfSales = pos - }, - setCurrentPOS(state, pos) { - Vue.set(state.pointOfSales, 'currentPOS', pos) - }, listPointOfSales(state, listPointOfSales) { state.listPointOfSales = listPointOfSales }, listWarehouses(state, listWarehouses) { state.listWarehouses = listWarehouses }, - currentListPrices(state, listPrices) { - state.currentlistPrices = listPrices + currentPriceList(state, priceList) { + state.currentPriceList = priceList }, currentWarehouse(state, warehouse) { state.currentWarehouse = warehouse diff --git a/src/store/modules/ADempiere/pointOfSales/point/state.js b/src/store/modules/ADempiere/pointOfSales/point/state.js index 631d56e5..99ea8ff3 100644 --- a/src/store/modules/ADempiere/pointOfSales/point/state.js +++ b/src/store/modules/ADempiere/pointOfSales/point/state.js @@ -30,7 +30,7 @@ export default { listPointOfSales: {}, listWarehouses: {}, listPrices: {}, - currentlistPrices: {}, + currentPriceList: {}, currentWarehouse: {}, listCurrency: [], conversionList: [], diff --git a/src/store/modules/ADempiere/pointOfSales/productPrice/actions.js b/src/store/modules/ADempiere/pointOfSales/productPrice/actions.js index ea4c2ca6..55dee86b 100644 --- a/src/store/modules/ADempiere/pointOfSales/productPrice/actions.js +++ b/src/store/modules/ADempiere/pointOfSales/productPrice/actions.js @@ -58,7 +58,8 @@ export default { pageToken = token + '-' + pageNumber } } - const { templateBusinessPartner } = rootGetters.posAttributes.currentPointOfSales + const currentPointOfSales = rootGetters.posAttributes.currentPointOfSales + const { templateBusinessPartner } = currentPointOfSales const { uuid: businessPartnerUuid } = templateBusinessPartner const { uuid: warehouseUuid } = rootGetters['user/getWarehouse'] if (isEmptyValue(searchValue)) { @@ -70,9 +71,8 @@ export default { return new Promise(resolve => { getProductPriceList({ searchValue, - priceListUuid: rootGetters.currentPriceList.uuid, + posUuid: currentPointOfSales.uuid, businessPartnerUuid, - warehouseUuid: rootGetters.currentWarehouse.uuid, pageToken }).then(responseProductPrice => { if (isEmptyValue(token) || isEmptyValue(pageToken)) { @@ -91,7 +91,7 @@ export default { resolve(responseProductPrice) }).catch(error => { - console.warn(`getKeyLayoutFromServer: ${error.message}. Code: ${error.code}.`) + console.warn(`getProductPriceList: ${error.message}. Code: ${error.code}.`) showMessage({ type: 'error', message: error.message, @@ -142,9 +142,8 @@ export default { return new Promise(resolve => { getProductPriceList({ searchValue, - priceListUuid: rootGetters.currentPriceList.uuid, + posUuid: rootGetters.currentPointOfSales.uuid, businessPartnerUuid, - warehouseUuid, pageToken }).then(responseProductPrice => { if (isEmptyValue(token) || isEmptyValue(pageToken)) {