From 23aaf79007347428770cbfb1de7a87bceaabc110 Mon Sep 17 00:00:00 2001 From: Elsio Sanchez <45974454+elsiosanchez@users.noreply.github.com> Date: Fri, 11 Jun 2021 17:16:08 -0400 Subject: [PATCH] Add option to change warehouse and price list (#913) * Adding the option to change Warehouse and Price List * add service * support service * add Warehouse Co-authored-by: elsiosanchez --- src/api/ADempiere/form/point-of-sales.js | 88 ++++++++++++- .../VPOS/Collection/convertAmount/index.vue | 30 ++--- .../ADempiere/Form/VPOS/Collection/index.vue | 122 +++++++++++++----- .../ADempiere/Form/VPOS/Options/index.vue | 97 +++++++++----- .../ADempiere/Form/VPOS/Order/index.vue | 87 ++++++++++++- .../ADempiere/Form/VPOS/posMixin.js | 29 ++++- src/lang/ADempiere/en.js | 7 +- src/lang/ADempiere/es.js | 7 +- .../ADempiere/pointOfSales/getters/index.js | 24 +++- .../ADempiere/pointOfSales/order/actions.js | 9 +- .../pointOfSales/payments/actions.js | 19 +++ .../ADempiere/pointOfSales/point/actions.js | 61 ++++++++- .../ADempiere/pointOfSales/point/mutations.js | 18 +++ .../ADempiere/pointOfSales/point/state.js | 6 + .../pointOfSales/productPrice/actions.js | 12 +- 15 files changed, 510 insertions(+), 106 deletions(-) diff --git a/src/api/ADempiere/form/point-of-sales.js b/src/api/ADempiere/form/point-of-sales.js index 9e97b869..e06ab0e5 100644 --- a/src/api/ADempiere/form/point-of-sales.js +++ b/src/api/ADempiere/form/point-of-sales.js @@ -77,7 +77,8 @@ export function createOrder({ posUuid, customerUuid, documentTypeUuid, - salesRepresentativeUuid + salesRepresentativeUuid, + warehouseUuid }) { return request({ url: `${config.pointOfSales.endpoint}/create-order`, @@ -86,7 +87,8 @@ export function createOrder({ pos_uuid: posUuid, customer_uuid: customerUuid, document_type_uuid: documentTypeUuid, - sales_representative_uuid: salesRepresentativeUuid + sales_representative_uuid: salesRepresentativeUuid, + warehouse_uuid: warehouseUuid } }) .then(createOrderResponse => { @@ -101,7 +103,8 @@ export function updateOrder({ orderUuid, posUuid, customerUuid, - description + description, + warehouseUuid }) { return request({ url: `${config.pointOfSales.endpoint}/update-order`, @@ -110,7 +113,8 @@ export function updateOrder({ order_uuid: orderUuid, pos_uuid: posUuid, customer_uuid: customerUuid, - description + description, + warehouse_uuid: warehouseUuid } }) .then(updateOrderResponse => { @@ -637,3 +641,79 @@ export function validatePin({ return pinResponse }) } + +/** + * list Warehouse + * @param {string} posUuidd - POS UUID reference + */ +export function listWarehouse({ + posUuid +}) { + return request({ + url: `${config.pointOfSales.endpoint}/available-warehouses`, + method: 'get', + params: { + pos_uuid: posUuid + } + }) + .then(listWarehouseResponse => { + return listWarehouseResponse + }) +} + +/** + * List Prices + * @param {string} posUuidd - POS UUID reference + */ +export function listPrices({ + posUuid +}) { + return request({ + url: `${config.pointOfSales.endpoint}/available-price-list`, + method: 'get', + params: { + pos_uuid: posUuid + } + }) + .then(listPricesResponse => { + return listPricesResponse + }) +} + +/** + * Currencies + * @param {string} posUuidd - POS UUID reference + */ +export function listCurrencies({ + posUuid +}) { + return request({ + url: `${config.pointOfSales.endpoint}/available-currencies`, + method: 'get', + params: { + pos_uuid: posUuid + } + }) + .then(listCurrencies => { + return listCurrencies + }) +} + +/** + * Tender Type + * @param {string} posUuidd - POS UUID reference + */ +export function listTenderType({ + posUuid +}) { + return request({ + url: `${config.pointOfSales.endpoint}/available-tender-types`, + method: 'get', + params: { + pos_uuid: posUuid + } + }) + .then(listTenderType => { + return listTenderType + }) +} diff --git a/src/components/ADempiere/Form/VPOS/Collection/convertAmount/index.vue b/src/components/ADempiere/Form/VPOS/Collection/convertAmount/index.vue index a0e250b0..9e6705d8 100644 --- a/src/components/ADempiere/Form/VPOS/Collection/convertAmount/index.vue +++ b/src/components/ADempiere/Form/VPOS/Collection/convertAmount/index.vue @@ -144,22 +144,22 @@ export default { } else { this.amountConvertionTotal = this.amount } - }, - currencyUuid(value) { - const listCurrency = this.$store.getters.getConvertionRate.find(currency => { - if (currency.uuid === value) { - return currency - } - }) - if (listCurrency === undefined) { - this.$store.dispatch('conversionDivideRate', { - conversionTypeUuid: this.currentPointOfSales.conversionTypeUuid, - currencyFromUuid: this.pointOfSalesCurrency.uuid, - conversionDate: this.formatDate(new Date()), - currencyToUuid: value - }) - } } + // currencyUuid(value) { + // const listCurrency = this.$store.getters.getConvertionRate.find(currency => { + // if (currency.uuid === value) { + // return currency + // } + // }) + // if (listCurrency === undefined) { + // this.$store.dispatch('conversionDivideRate', { + // conversionTypeUuid: this.currentPointOfSales.conversionTypeUuid, + // currencyFromUuid: this.pointOfSalesCurrency.uuid, + // conversionDate: this.formatDate(new Date()), + // currencyToUuid: value + // }) + // } + // } }, created() { this.defaultValueCurrency() diff --git a/src/components/ADempiere/Form/VPOS/Collection/index.vue b/src/components/ADempiere/Form/VPOS/Collection/index.vue index ddca8318..63c52b61 100644 --- a/src/components/ADempiere/Form/VPOS/Collection/index.vue +++ b/src/components/ADempiere/Form/VPOS/Collection/index.vue @@ -63,17 +63,24 @@ {{ $t('form.pos.collect.dayRate') }}: - - {{ - formatPrice(formatConversionCurrenty(dateRate.amountConvertion), dateRate.iSOCode) - }} + + + {{ + formatPrice(formatConversionCurrenty(dateRate.divideRate), dateRate.currencyTo.iSOCode) + }} + + + {{ + dateRate.currencyTo.iSOCode + }} + {{ + formatConversionCurrenty(dateRate.divideRate) + }} + {{ - dateRate.iSOCode - }} - {{ - formatConversionCurrenty(dateRate.amountConvertion) + formatPrice(1, dateRate.iSOCode) }} @@ -93,10 +100,38 @@ + + + + + + + + + + + @@ -272,10 +307,18 @@ export default { defaultLabel: '', fieldsList: fieldsListCollection, sendToServer: false, - amontSend: 0 + value: '', + amontSend: 0, + currentFieldCurrency: '' } }, computed: { + listCurrency() { + return this.$store.state['pointOfSales/point/index'].listCurrency + }, + convertionList() { + return this.$store.state['pointOfSales/point/index'].conversionList + }, validateCompleteCollection() { let collection if (this.pay === this.currentOrder.grandTotal) { @@ -488,11 +531,15 @@ export default { return this.$store.getters.getUpdatePaymentPos }, dateRate() { - return this.$store.getters.getConvertionRate.find(currency => { - if (currency.id === this.typeCurrency) { + const convertion = this.convertionList.find(currency => { + if ((currency.currencyTo.iSOCode === this.currentFieldCurrency) && (this.pointOfSalesCurrency.iSOCode !== currency.currencyTo.iSOCode)) { return currency } }) + if (!this.isEmptyValue(convertion)) { + return convertion + } + return this.pointOfSalesCurrency }, fieldsPaymentType() { return this.fieldsList[2] @@ -503,24 +550,24 @@ export default { this.$store.commit('updateValueOfField', { containerUuid: this.containerUuid, columnName: 'PayAmt', - value + value: value }) }, - currencyUuid(value) { - const listCurrency = this.$store.getters.getConvertionRate.find(currency => { - if (currency.uuid === value) { - return currency - } - }) - if (listCurrency === undefined) { - this.$store.dispatch('conversionDivideRate', { - conversionTypeUuid: this.currentPointOfSales.conversionTypeUuid, - currencyFromUuid: this.pointOfSalesCurrency.uuid, - conversionDate: this.formatDate(new Date()), - currencyToUuid: value - }) - } - }, + // currencyUuid(value) { + // const listCurrency = this.$store.getters.getConvertionRate.find(currency => { + // if (currency.uuid === value) { + // return currency + // } + // }) + // if (listCurrency === undefined) { + // this.$store.dispatch('conversionDivideRate', { + // conversionTypeUuid: this.currentPointOfSales.conversionTypeUuid, + // currencyFromUuid: this.pointOfSalesCurrency.uuid, + // conversionDate: this.formatDate(new Date()), + // currencyToUuid: value + // }) + // } + // }, convertAllPayment(value) { if (!this.isEmptyValue(value)) { this.allPayCurrency = this.pay / value @@ -537,11 +584,11 @@ export default { } }, dateRate(value) { - if (value && !this.isEmptyValue(value.amountConvertion)) { + if (!this.isEmptyValue(value.divideRate)) { this.$store.commit('updateValueOfField', { containerUuid: this.containerUuid, columnName: 'PayAmt', - value: this.pending / value.amountConvertion + value: this.pending / value.divideRate }) } else { this.$store.commit('updateValueOfField', { @@ -565,6 +612,7 @@ export default { } }, created() { + this.currentFieldCurrency = this.pointOfSalesCurrency.iSOCode this.$store.dispatch('addRateConvertion', this.pointOfSalesCurrency) this.unsubscribe = this.subscribeChanges() this.defaultValueCurrency() @@ -724,6 +772,7 @@ export default { this.defaultValueCurrency() this.$store.commit('currencyDivideRateCollection', 1) this.$store.commit('currencyMultiplyRate', 1) + this.currentFieldCurrency = this.pointOfSalesCurrency.iSOCode }, exit() { this.$store.commit('setShowPOSCollection', false) @@ -865,6 +914,19 @@ export default { } } }) + }, + changeCurrency(value) { + this.currentFieldCurrency = value + const currency = this.listCurrency.find(currency => currency.key === value) + const findCoventionList = this.convertionList.find(convertion => convertion.currencyTo.iSOCode === value) + if (!this.isEmptyValue(currency) && this.isEmptyValue(findCoventionList) && (value !== this.pointOfSalesCurrency.iSOCode)) { + this.$store.dispatch('searchConversion', { + conversionTypeUuid: this.currentPointOfSales.conversionTypeUuid, + currencyFromUuid: this.pointOfSalesCurrency.uuid, + conversionDate: this.formatDate(new Date()), + currencyToUuid: currency.uuid + }) + } } } } diff --git a/src/components/ADempiere/Form/VPOS/Options/index.vue b/src/components/ADempiere/Form/VPOS/Options/index.vue index 3e9053c4..e30ba461 100644 --- a/src/components/ADempiere/Form/VPOS/Options/index.vue +++ b/src/components/ADempiere/Form/VPOS/Options/index.vue @@ -30,7 +30,7 @@ - +

- +

-
- +

- +

- +

- +

- +

- +

- +

- +

- +

- +

- +

- + - +


@@ -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