Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search by price list and current warehouse #1201

Merged
merged 2 commits into from
Sep 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/components/ADempiere/Form/PriceChecking/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,8 @@ export default {
getProductPrice({
searchValue: mutation.payload.value,
posUuid: this.currentPointOfSales.uuid,
priceListUuid: this.currentPointOfSales.priceList.uuid,
warehouseUuid: this.currentPointOfSales.warehouse.uuid
priceListUuid: this.currentPointOfSales.currentPriceList.uuid,
warehouseUuid: this.currentPointOfSales.currentWarehouse.uuid
})
.then(productPrice => {
this.messageError = true
Expand Down Expand Up @@ -294,8 +294,8 @@ export default {
getProductPrice({
searchValue: mutation.payload.value,
posUuid: this.currentPointOfSales.uuid,
priceListUuid: this.currentPointOfSales.priceList.uuid,
warehouseUuid: this.currentPointOfSales.warehouse.uuid
priceListUuid: this.currentPointOfSales.currentPriceList.uuid,
warehouseUuid: this.currentPointOfSales.currentWarehouse.uuid
})
.then(productPrice => {
this.messageError = true
Expand Down
4 changes: 2 additions & 2 deletions src/components/ADempiere/Form/VPOS/Options/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -710,8 +710,8 @@ export default {
createOrder({
posUuid,
customerUuid: this.currentOrder.businessPartner.uuid,
priceListUuid: this.currentPointOfSales.priceList.uuid,
warehouseUuid: this.currentPointOfSales.warehouse.uuid
priceListUuid: this.currentPointOfSales.currentPriceList.uuid,
warehouseUuid: this.currentPointOfSales.currentWarehouse.uuid
})
.then(order => {
this.$store.dispatch('currentOrder', order)
Expand Down
8 changes: 4 additions & 4 deletions src/components/ADempiere/Form/VPOS/Order/orderLineMixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ export default {
createOrderLine({
orderUuid,
productUuid,
priceListUuid: this.currentPointOfSales.priceList.uuid,
warehouseUuid: this.currentPointOfSales.warehouse.uuid
priceListUuid: this.currentPointOfSales.currentPriceList.uuid,
warehouseUuid: this.currentPointOfSales.currentWarehouse.uuid
})
.then(orderLine => {
this.fillOrderLine(orderLine)
Expand Down Expand Up @@ -191,8 +191,8 @@ export default {
quantity,
price,
discountRate,
priceListUuid: this.currentPointOfSales.priceList.uuid,
warehouseUuid: this.currentPointOfSales.warehouse.uuid
priceListUuid: this.currentPointOfSales.currentPriceList.uuid,
warehouseUuid: this.currentPointOfSales.currentWarehouse.uuid
})
.then(response => {
this.fillOrderLineQuantities({
Expand Down
4 changes: 2 additions & 2 deletions src/components/ADempiere/Form/VPOS/posMixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -490,8 +490,8 @@ export default {
findProduct({
searchValue: searchProduct,
posUuid: this.currentPointOfSales.uuid,
priceListUuid: this.currentPointOfSales.priceList.uuid,
warehouseUuid: this.currentPointOfSales.warehouse.uuid
priceListUuid: this.currentPointOfSales.currentPriceList.uuid,
warehouseUuid: this.currentPointOfSales.currentWarehouse.uuid
})
.then(productPrice => {
this.product = productPrice.product
Expand Down
1 change: 1 addition & 0 deletions src/store/modules/ADempiere/pointOfSales/getters/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export default {
...state.currentPointOfSales,
listOrder: state.listOrder,
warehousesList: state.warehousesList,
currentWarehouse: state.currentWarehousePos,
documentTypesList: state.documentTypesList,
pricesList: state.pricesList,
currentPriceList: state.currentPriceList,
Expand Down
27 changes: 12 additions & 15 deletions src/store/modules/ADempiere/pointOfSales/order/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,15 @@ export default {
createOrder({ commit, dispatch, rootGetters }, {
posUuid,
customerUuid,
documentTypeUuid,
priceListUuid,
warehouseUuid
documentTypeUuid
}) {
const { currentPriceList, currentWarehouse } = rootGetters.posAttributes.currentPointOfSales
return createOrder({
posUuid,
customerUuid,
documentTypeUuid,
priceListUuid,
warehouseUuid
priceListUuid: currentPriceList.uuid,
warehouseUuid: currentWarehouse.uuid
})
.then(order => {
commit('setOrder', order)
Expand Down Expand Up @@ -75,17 +74,16 @@ export default {
orderUuid,
posUuid,
customerUuid,
documentTypeUuid,
priceListUuid,
warehouseUuid
documentTypeUuid
}) {
const { currentPriceList, currentWarehouse } = rootGetters.posAttributes.currentPointOfSales
updateOrder({
orderUuid,
posUuid,
documentTypeUuid,
customerUuid,
priceListUuid,
warehouseUuid
priceListUuid: currentPriceList.uuid,
warehouseUuid: currentWarehouse.uuid
})
.then(response => {
dispatch('reloadOrder', { orderUuid: response.uuid })
Expand All @@ -110,21 +108,20 @@ export default {
* @param {number} price Price Producto
* @param {number} discountRate DiscountRate Producto
*/
createOrderLine({ commit, dispatch }, {
createOrderLine({ commit, dispatch, rootGetters }, {
orderUuid,
priceListUuid,
warehouseUuid,
productUuid,
chargeUuid,
description,
quantity,
price,
discountRate
}) {
const { currentPriceList, currentWarehouse } = rootGetters.posAttributes.currentPointOfSales
createOrderLine({
orderUuid,
priceListUuid,
warehouseUuid,
priceListUuid: currentPriceList.uuid,
warehouseUuid: currentWarehouse.uuid,
productUuid,
chargeUuid,
description,
Expand Down
19 changes: 8 additions & 11 deletions src/store/modules/ADempiere/pointOfSales/productPrice/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,8 @@ export default {
}
}
const currentPointOfSales = rootGetters.posAttributes.currentPointOfSales
const { templateBusinessPartner, priceList, warehouse } = currentPointOfSales
const { templateBusinessPartner, currentPriceList, currentWarehouse } = currentPointOfSales
const { uuid: businessPartnerUuid } = templateBusinessPartner
const { uuid: warehouseUuid } = rootGetters['user/getWarehouse']
if (isEmptyValue(searchValue)) {
searchValue = rootGetters.getValueOfField({
containerUuid,
Expand All @@ -73,8 +72,8 @@ export default {
searchValue,
posUuid,
businessPartnerUuid,
priceListUuid: priceList.uuid,
warehouseUuid: warehouse.uuid,
priceListUuid: currentPriceList.uuid,
warehouseUuid: currentWarehouse.uuid,
pageToken
}).then(responseProductPrice => {
if (isEmptyValue(token) || isEmptyValue(pageToken)) {
Expand All @@ -86,7 +85,7 @@ export default {
isLoaded: true,
isReload: false,
businessPartnerUuid,
warehouseUuid,
warehouseUuid: currentWarehouse.uuid,
token,
pageNumber
})
Expand Down Expand Up @@ -131,11 +130,9 @@ export default {
pageToken = token + '-' + pageNumber
}
}

const currentPointOfSales = rootGetters.posAttributes.currentPointOfSales
const { templateBusinessPartner, priceList, warehouse } = currentPointOfSales
const { templateBusinessPartner, currentPriceList, currentWarehouse } = currentPointOfSales
const { uuid: businessPartnerUuid } = templateBusinessPartner
const { uuid: warehouseUuid } = rootGetters['user/getWarehouse']

if (isEmptyValue(searchValue)) {
searchValue = rootGetters.getValueOfField({
Expand All @@ -148,8 +145,8 @@ export default {
searchValue,
posUuid: posUuid,
businessPartnerUuid,
priceListUuid: priceList.uuid,
warehouseUuid: warehouse.uuid,
priceListUuid: currentPriceList.uuid,
warehouseUuid: currentWarehouse.uuid,
pageToken
}).then(responseProductPrice => {
if (isEmptyValue(token) || isEmptyValue(pageToken)) {
Expand All @@ -161,7 +158,7 @@ export default {
isLoaded: true,
isReload: false,
businessPartnerUuid,
warehouseUuid,
warehouseUuid: currentWarehouse.uuid,
token,
pageNumber
})
Expand Down