+
+
+
+ {{ $t('form.priceChecking.messageError') }}
@@ -87,11 +98,14 @@ export default {
],
data() {
return {
+ messageError: true,
fieldsList,
productPrice: {},
organizationBackground: '',
currentImageOfProduct: '',
search: 'sad',
+ resul: '',
+ load: '',
unsubscribe: () => {}
}
},
@@ -154,41 +168,43 @@ export default {
formatPrice,
subscribeChanges() {
return this.$store.subscribe((mutation, state) => {
- // console.log(mutation.type.length)
if ((mutation.type === 'updateValueOfField' || mutation.type === 'addActionKeyPerformed') && mutation.payload.columnName === 'ProductValue') {
// cleans all values except column name 'ProductValue'
this.search = mutation.payload.value
- if (this.search.length >= 6) {
+ if (!this.isEmptyValue(this.search) && this.search.length >= 4) {
requestGetProductPrice({
searchValue: mutation.payload.value
})
.then(productPrice => {
+ this.messageError = true
const { product, taxRate, priceStandard: priceBase } = productPrice
const { rate } = taxRate
const { imageURL: image } = product
this.productPrice = {
+ currency: productPrice.currency,
+ image,
+ grandTotal: this.getGrandTotal(priceBase, rate),
productName: product.name,
productDescription: product.description,
priceBase,
priceStandard: productPrice.priceStandard,
priceList: productPrice.priceList,
priceLimit: productPrice.priceLimit,
+ schemaCurrency: productPrice.schemaCurrency,
+ schemaGrandTotal: this.getGrandTotal(productPrice.schemaPriceStandard, rate),
+ schemaPriceStandard: productPrice.schemaPriceStandard,
+ schemaPriceList: productPrice.schemaPriceList,
+ schemaPriceLimit: productPrice.schemaPriceLimit,
taxRate: rate,
- image,
taxName: taxRate.name,
taxIndicator: taxRate.taxIndicator,
- taxAmt: this.getTaxAmount(priceBase, rate),
- grandTotal: this.getGrandTotal(priceBase, rate),
- currency: productPrice.currency
+ taxAmt: this.getTaxAmount(priceBase, rate)
}
})
- .catch(error => {
- this.$message({
- type: 'info',
- message: error.message,
- showClose: true
- })
+ .catch(() => {
+ this.messageError = false
+ this.timeMessage()
this.productPrice = {}
})
.finally(() => {
@@ -207,6 +223,11 @@ export default {
}
})
},
+ timeMessage() {
+ setTimeout(() => {
+ this.messageError = true
+ }, 2000)
+ },
getTaxAmount(basePrice, taxRate) {
if (this.isEmptyValue(basePrice) || this.isEmptyValue(taxRate)) {
return 0
diff --git a/src/lang/ADempiere/en.js b/src/lang/ADempiere/en.js
index 3734b3a0..9419fa28 100644
--- a/src/lang/ADempiere/en.js
+++ b/src/lang/ADempiere/en.js
@@ -396,6 +396,10 @@ export default {
keyLayout: {
noProducto: 'No product available. Back to top'
}
+ },
+ priceChecking: {
+ messageError: 'This Product Not Available',
+ basePrice: 'Base price'
}
}
}
diff --git a/src/lang/ADempiere/es.js b/src/lang/ADempiere/es.js
index e0f8fcba..46c60741 100644
--- a/src/lang/ADempiere/es.js
+++ b/src/lang/ADempiere/es.js
@@ -371,6 +371,10 @@ export default {
keyLayout: {
noProducto: 'No hay producto disponible Regresar al Principio'
}
+ },
+ priceChecking: {
+ messageError: 'Este Producto No Disponible',
+ basePrice: 'Precio Base'
}
}
}
diff --git a/src/router/modules/ADempiere/staticRoutes.js b/src/router/modules/ADempiere/staticRoutes.js
index 4bd958a6..1e13a197 100644
--- a/src/router/modules/ADempiere/staticRoutes.js
+++ b/src/router/modules/ADempiere/staticRoutes.js
@@ -92,6 +92,7 @@ const staticRoutes = [
component: () => import('@/views/ADempiere/Form'),
name: 'BarcodeReader',
meta: {
+ icon: 'search',
title: 'BarcodeReader',
isIndex: true
}
diff --git a/src/store/modules/user.js b/src/store/modules/user.js
index 109a39d1..821a0fd4 100644
--- a/src/store/modules/user.js
+++ b/src/store/modules/user.js
@@ -103,14 +103,16 @@ const actions = {
userName,
password,
roleUuid,
- organizationUuid
+ organizationUuid,
+ token
}) {
return new Promise((resolve, reject) => {
login({
userName,
password,
roleUuid,
- organizationUuid
+ organizationUuid,
+ token
})
.then(logInResponse => {
if ([13, 500].includes(logInResponse.code)) {
diff --git a/src/utils/ADempiere/apiConverts/core.js b/src/utils/ADempiere/apiConverts/core.js
index 9ba3b746..fc5af54a 100644
--- a/src/utils/ADempiere/apiConverts/core.js
+++ b/src/utils/ADempiere/apiConverts/core.js
@@ -265,6 +265,12 @@ export function convertProductPrice(productPriceToConvert) {
product: convertProduct(
productPriceToConvert.product
),
+ schemaCurrency: convertCurrency(
+ productPriceToConvert.schema_currency
+ ),
+ schemaPriceLimit: productPriceToConvert.schema_price_limit,
+ schemaPriceList: productPriceToConvert.schema_price_list,
+ schemaPriceStandard: productPriceToConvert.schema_price_standard,
priceList: productPriceToConvert.price_list,
priceStandard: productPriceToConvert.price_standard,
priceLimit: productPriceToConvert.price_limit,
diff --git a/src/views/ADempiere/Form/index.vue b/src/views/ADempiere/Form/index.vue
index 78aed375..80e321f7 100644
--- a/src/views/ADempiere/Form/index.vue
+++ b/src/views/ADempiere/Form/index.vue
@@ -15,7 +15,7 @@
:panel-type="panelType"
/>
-
+