1
0
mirror of https://github.com/PanJiaChen/vue-element-admin.git synced 2025-08-07 18:25:45 +08:00

search for the conversion date by the current date (#866)

* search for the conversion date by the current date

* search product

* remove console.log

Co-authored-by: elsiosanchez <elsiossanches@gmail.com>
This commit is contained in:
Elsio Sanchez 2021-05-25 16:20:10 -04:00 committed by GitHub
parent 3476523568
commit 70022f0f61
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 16 additions and 19 deletions

View File

@ -53,7 +53,6 @@ export default [
columnName: 'TenderType',
isFromDictionary: true,
overwriteDefinition: {
defaultValue: 'X',
handleActionKeyPerformed: true,
handleContentSelection: true,
handleActionPerformed: true,

View File

@ -215,7 +215,7 @@ import posMixin from '@/components/ADempiere/Form/VPOS/posMixin.js'
import fieldsListCollection from './fieldsListCollection.js'
import typeCollection from '@/components/ADempiere/Form/VPOS/Collection/typeCollection'
import convertAmount from '@/components/ADempiere/Form/VPOS/Collection/convertAmount/index'
import { formatDate, formatPrice } from '@/utils/ADempiere/valueFormat.js'
import { formatPrice } from '@/utils/ADempiere/valueFormat.js'
import { processOrder } from '@/api/ADempiere/form/point-of-sales.js'
import { FIELDS_DECIMALS } from '@/utils/ADempiere/references'
@ -500,6 +500,7 @@ export default {
this.$store.dispatch('conversionDivideRate', {
conversionTypeUuid: this.currentPointOfSales.conversionTypeUuid,
currencyFromUuid: this.pointOfSalesCurrency.uuid,
conversionDate: this.formatDate(new Date()),
currencyToUuid: value
})
}
@ -541,7 +542,6 @@ export default {
this.defaultValueCurrency()
},
methods: {
formatDate,
formatNumber({ displayType, number }) {
let fixed = 0
// Amount, Costs+Prices, Number
@ -813,6 +813,18 @@ export default {
this.$store.dispatch('updatePaymentPos', false)
})
},
formatDate(date) {
let month = '' + (date.getMonth() + 1)
let day = '' + date.getDate()
const year = date.getFullYear()
if (month.length < 2) {
month = '0' + month
}
if (day.length < 2) {
day = '0' + day
}
return [year, month, day].join('-')
},
subscribeChanges() {
return this.$store.subscribe((mutation, state) => {
if (mutation.type === 'updateValueOfField') {

View File

@ -173,15 +173,13 @@ export default {
}
let results = this.listWithPrice
if (stringToMatch) {
if (!this.isEmptyValue(stringToMatch)) {
const parsedValue = stringToMatch.toLowerCase().trim()
results = results.filter(rowProduct => {
const productAttributes = rowProduct.product
for (const columnProductPrice in productAttributes) {
const valueToCompare = String(productAttributes[columnProductPrice]).toLowerCase()
if (valueToCompare.includes(parsedValue)) {
return true
}

View File

@ -147,18 +147,6 @@ export default {
return (!isLoaded || isReload) // && this.isShowProductsPriceList
}
},
watch: {
isReadyFromGetData(isToLoad) {
if (isToLoad) {
this.loadProductsPricesList()
}
}
// currentPointOfSales(value) {
// if (!this.isEmptyValue(value)) {
// this.loadProductsPricesList()
// }
// }
},
created() {
this.unsubscribe = this.subscribeChanges()
this.$store.commit('setListProductPrice', {

View File

@ -67,7 +67,7 @@ export default {
* Search Product
*/
getProductPrice: (state) => {
if (isEmptyValue(state.productPrice) || !state.productPrice.isLoaded) {
if (isEmptyValue(state.productPrice)) {
return {
...withoutResponse,
productPricesList: []