diff --git a/src/components/ADempiere/Dialog/index.vue b/src/components/ADempiere/Dialog/index.vue
index 3840496b..442791e8 100644
--- a/src/components/ADempiere/Dialog/index.vue
+++ b/src/components/ADempiere/Dialog/index.vue
@@ -180,7 +180,7 @@ export default {
this.$store.dispatch('processPos', {
action: action, // process metadata
parentUuid: this.parentUuid,
- idProcess: this.$store.getters.getFindOrder.id,
+ idProcess: this.$store.getters.posAttributes.currentOrder.id,
containerUuid: this.containerUuid,
panelType: this.panelType, // determinate if get table name and record id (window) or selection (browser)
parametersList: this.$store.getters.getPosParameters
diff --git a/src/components/ADempiere/Form/PriceChecking/index.vue b/src/components/ADempiere/Form/PriceChecking/index.vue
index 8e78aed5..879fa283 100644
--- a/src/components/ADempiere/Form/PriceChecking/index.vue
+++ b/src/components/ADempiere/Form/PriceChecking/index.vue
@@ -143,7 +143,7 @@ export default {
return this.currentImageOfProduct
},
currentPoint() {
- return this.$store.getters.getCurrentPOS
+ return this.$store.getters.posAttributes.currentPointOfSales
}
},
created() {
diff --git a/src/components/ADempiere/Form/ProductInfo/index.vue b/src/components/ADempiere/Form/ProductInfo/index.vue
index 063a2427..2d6d7843 100644
--- a/src/components/ADempiere/Form/ProductInfo/index.vue
+++ b/src/components/ADempiere/Form/ProductInfo/index.vue
@@ -71,7 +71,7 @@ export default {
return []
},
currentPos() {
- return this.$store.getters.getCurrentPOS
+ return this.$store.getters.posAttributes.currentPointOfSales
},
keyShortcuts() {
return {
diff --git a/src/components/ADempiere/Form/ProductInfo/productList.vue b/src/components/ADempiere/Form/ProductInfo/productList.vue
index 84f5cacc..192f39e7 100644
--- a/src/components/ADempiere/Form/ProductInfo/productList.vue
+++ b/src/components/ADempiere/Form/ProductInfo/productList.vue
@@ -199,7 +199,7 @@ export default {
return this.$store.state['pointOfSales/listProductPrice'].productPrice[this.attribute]
},
currentPoint() {
- return this.$store.getters.getCurrentPOS
+ return this.$store.getters.posAttributes.currentPointOfSales
},
productPrice() {
return this.$store.getters.getProductPrice
@@ -223,7 +223,7 @@ export default {
return (!isLoaded || isReload) // && this.isShowProductsPriceList
},
listPrice() {
- const pos = this.$store.getters.getCurrentPOS
+ const pos = this.currentPoint
if (!this.isEmptyValue(pos)) {
return pos.priceList.id
}
@@ -403,7 +403,6 @@ export default {
* @param {object} PointOfSales
*/
validatePos(PointOfSales) {
- console.log(this.isEmptyValue(PointOfSales), this.isReadyFromGetData)
if (this.isEmptyValue(PointOfSales)) {
const message = this.$t('notifications.errorPointOfSale')
this.$store.commit('setListProductPrice', {
diff --git a/src/components/ADempiere/Form/VPOS/BusinessPartner/mixinBusinessPartner.js b/src/components/ADempiere/Form/VPOS/BusinessPartner/mixinBusinessPartner.js
index 2ebd0bd7..5f6be212 100644
--- a/src/components/ADempiere/Form/VPOS/BusinessPartner/mixinBusinessPartner.js
+++ b/src/components/ADempiere/Form/VPOS/BusinessPartner/mixinBusinessPartner.js
@@ -119,7 +119,7 @@ export default {
}
})
- valuesToSend['posUuid'] = this.$store.getters.getPointOfSalesUuid
+ valuesToSend['posUuid'] = this.$store.getters.posAttributes.currentPointOfSales.uuid
return valuesToSend
},
setBusinessPartner({ id, name, uuid }, isCloseForm = true) {
diff --git a/src/components/ADempiere/Form/VPOS/Collection/index.vue b/src/components/ADempiere/Form/VPOS/Collection/index.vue
index a11d1c02..1b756054 100644
--- a/src/components/ADempiere/Form/VPOS/Collection/index.vue
+++ b/src/components/ADempiere/Form/VPOS/Collection/index.vue
@@ -32,10 +32,10 @@
- {{ $t('form.pos.order.pointSale') }}: {{ namePointOfSales.name }}
+ {{ $t('form.pos.order.pointSale') }}: {{ currentPointOfSales.name }}
{{ $t('form.pos.order.seller') }}: - {{ getOrder.salesRepresentative.name }} + {{ currentOrder.salesRepresentative.name }}
-{{ $t('form.pos.order.subTotal') }}:{{ formatPrice(getOrder.totalLines, currencyPoint.iSOCode) }}
-{{ $t('form.pos.order.discount') }}:{{ formatPrice(0, currencyPoint.iSOCode) }}
-{{ $t('form.pos.order.tax') }}:{{ getOrderTax(currencyPoint.iSOCode) }}
+{{ $t('form.pos.order.subTotal') }}:{{ formatPrice(currentOrder.totalLines, pointOfSalesCurrency.iSOCode) }}
+{{ $t('form.pos.order.discount') }}:{{ formatPrice(0, pointOfSalesCurrency.iSOCode) }}
+{{ $t('form.pos.order.tax') }}:{{ getOrderTax(pointOfSalesCurrency.iSOCode) }}
{{ $t('form.pos.order.total') }}:
@@ -242,25 +243,25 @@
{{ $t('form.pos.order.order') }}: {{ getOrder.documentNo }}
+{{ $t('form.pos.order.order') }}: {{ currentOrder.documentNo }}
{{ $t('form.pos.order.date') }}: {{ orderDate }}
-{{ $t('form.pos.order.type') }}:{{ getOrder.documentType.name }}
+{{ $t('form.pos.order.type') }}:{{ currentOrder.documentType.name }}
{{ $t('form.pos.order.itemQuantity') }}
@@ -348,30 +349,17 @@ export default {
}
return 'padding-left: 0px; padding-right: 0px; padding-top: 2.2%;margin-right: 1%;float: right;'
},
- namePointOfSales() {
- const currentPOS = this.$store.getters.getCurrentPOS
- if (currentPOS && !this.isEmptyValue(currentPOS.name)) {
- return currentPOS
- }
- return {
- name: '',
- uuid: ''
- }
- },
- sellingPointsList() {
- return this.$store.getters.getSellingPointsList
- },
orderDate() {
- if (this.isEmptyValue(this.getOrder) || this.isEmptyValue(this.getOrder.dateOrdered)) {
+ if (this.isEmptyValue(this.currentOrder) || this.isEmptyValue(this.currentOrder.dateOrdered)) {
return this.formatDate(new Date())
}
- return this.formatDate(this.getOrder.dateOrdered)
+ return this.formatDate(this.currentOrder.dateOrdered)
},
getItemQuantity() {
- if (this.isEmptyValue(this.getOrder)) {
+ if (this.isEmptyValue(this.currentOrder)) {
return 0
}
- const result = this.allOrderLines.map(order => {
+ const result = this.listOrderLine.map(order => {
return order.quantityOrdered
})
@@ -383,21 +371,10 @@ export default {
return 0
},
numberOfLines() {
- if (this.isEmptyValue(this.getOrder)) {
+ if (this.isEmptyValue(this.currentOrder)) {
return
}
- return this.allOrderLines.length
- },
- currencyPoint() {
- const currency = this.currentPoint
- if (!this.isEmptyValue(currency)) {
- return currency.priceList.currency
- }
- return {
- uuid: '',
- iSOCode: '',
- curSymbol: ''
- }
+ return this.listOrderLine.length
},
multiplyRate() {
return this.$store.getters.getMultiplyRate
@@ -414,28 +391,31 @@ export default {
columnName: 'C_Currency_ID_UUID'
})
},
- displayeTypeCurrency() {
- return this.$store.getters.getValueOfField({
- containerUuid: this.containerUuid,
- columnName: 'DisplayColumn_C_Currency_ID'
- })
- },
- isDisabled() {
- return this.$store.getters.getIsProcessed
- },
labelButtonCollections() {
return this.isDisabled ? this.$t('form.pos.order.collections') : this.$t('form.pos.order.collect')
}
},
watch: {
- namePo1intOfSales(value) {
- if (!this.isEmptyValue(value)) {
- this.$router.push({
- query: {
- pos: value.id
- }
+ currencyUuid(value) {
+ if (!this.isEmptyValue(value) && !this.isEmptyValue(this.currentPointOfSales)) {
+ this.$store.dispatch('conversionDivideRate', {
+ conversionTypeUuid: this.currentPointOfSales.conversionTypeUuid,
+ currencyFromUuid: this.pointOfSalesCurrency.uuid,
+ currencyToUuid: value
})
}
+ },
+ converCurrency(value) {
+ if (!this.isEmptyValue(value) && !this.isEmptyValue(this.currentPointOfSales)) {
+ this.$store.dispatch('conversionMultiplyRate', {
+ containerUuid: 'Order',
+ conversionTypeUuid: this.currentPointOfSales.conversionTypeUuid,
+ currencyFromUuid: this.pointOfSalesCurrency.uuid,
+ currencyToUuid: value
+ })
+ } else {
+ this.$store.commit('currencyMultiplyRate', 1)
+ }
}
},
mounted() {
@@ -444,10 +424,6 @@ export default {
}
},
methods: {
- changePos(posElement) {
- this.$store.dispatch('setCurrentPOS', posElement)
- this.newOrder()
- },
openCollectionPanel() {
this.isShowedPOSKeyLayout = !this.isShowedPOSKeyLayout
this.$store.commit('setShowPOSCollection', true)
@@ -456,59 +432,6 @@ export default {
this.isShowedPOSKeyLaout = !this.isShowedPOSKeyLaout
this.$store.commit('setShowPOSOptions', false)
},
- newOrder() {
- this.$router.push({
- params: {
- ...this.$route.params
- },
- query: {
- pos: this.currentPoint.id
- }
- }).catch(() => {
- }).finally(() => {
- this.$store.commit('setListPayments', {
- payments: []
- })
- const { templateBusinessPartner } = this.currentPoint
- this.$store.commit('updateValuesOfContainer', {
- containerUuid: this.metadata.containerUuid,
- attributes: [{
- columnName: 'UUID',
- value: undefined
- },
- {
- columnName: 'ProductValue',
- value: undefined
- },
- {
- columnName: 'C_BPartner_ID',
- value: templateBusinessPartner.id
- },
- {
- columnName: 'DisplayColumn_C_BPartner_ID',
- value: templateBusinessPartner.name
- },
- {
- columnName: ' C_BPartner_ID_UUID',
- value: templateBusinessPartner.uuid
- }]
- })
- this.$store.dispatch('setOrder', {
- documentType: {},
- documentStatus: {
- value: ''
- },
- totalLines: 0,
- grandTotal: 0,
- salesRepresentative: {},
- businessPartner: {
- value: '',
- uuid: ''
- }
- })
- this.$store.dispatch('listOrderLine', [])
- })
- },
open() {
if (!this.seeConversion) {
this.seeConversion = true
diff --git a/src/components/ADempiere/Form/VPOS/Order/orderLineMixin.js b/src/components/ADempiere/Form/VPOS/Order/orderLineMixin.js
index 8d4e3a91..7dfbec84 100644
--- a/src/components/ADempiere/Form/VPOS/Order/orderLineMixin.js
+++ b/src/components/ADempiere/Form/VPOS/Order/orderLineMixin.js
@@ -99,7 +99,6 @@ export default {
},
listOrderLines({ uuid: orderUuid }) {
if (!this.isEmptyValue(orderUuid)) {
- this.$store.dispatch('listOrderLinesFromServer', orderUuid)
this.orderLines = this.listOrderLine
this.handleCurrentLineChange(this.currentOrderLine)
}
@@ -168,8 +167,7 @@ export default {
if (columnName === 'LineDescription') {
return row.lineDescription
}
-
- const currency = this.currencyPoint.iSOCode
+ const currency = this.pointOfSalesCurrency.iSOCode
if (columnName === 'CurrentPrice') {
return this.formatPrice(row.priceActual, currency)
} else if (columnName === 'QtyOrdered') {
diff --git a/src/components/ADempiere/Form/VPOS/OrderList/index.vue b/src/components/ADempiere/Form/VPOS/OrderList/index.vue
index 62aa8bca..1625578f 100644
--- a/src/components/ADempiere/Form/VPOS/OrderList/index.vue
+++ b/src/components/ADempiere/Form/VPOS/OrderList/index.vue
@@ -55,8 +55,8 @@