1
0
mirror of https://github.com/PanJiaChen/vue-element-admin.git synced 2025-08-10 20:39:48 +08:00

validate refund (#1109)

* validate refund

* minimal changes

Co-authored-by: elsiosanchez <elsiossanches@gmail.com>
This commit is contained in:
Elsio Sanchez 2021-08-24 00:33:48 -04:00 committed by GitHub
parent 8e36fb006c
commit 0464f619b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 76 additions and 77 deletions

View File

@ -75,7 +75,7 @@
<div v-if="isEmptyValue(selectionTypeRefund)" class="text item"> <div v-if="isEmptyValue(selectionTypeRefund)" class="text item">
<el-row :gutter="24"> <el-row :gutter="24">
<el-col v-for="(payment, index) in paymentTypeList" :key="index" :span="6"> <el-col v-for="(payment, index) in paymentTypeList" :key="index" :span="6">
<div @click="selectionTypeRefund = payment"> <div @click="selectPayment(payment)">
<el-card shadow="hover"> <el-card shadow="hover">
<div slot="header" class="clearfix" style="text-align: center;"> <div slot="header" class="clearfix" style="text-align: center;">
<span> <span>
@ -363,12 +363,37 @@ export default {
} }
return require('@/image/ADempiere/pos/typePayment/' + image) return require('@/image/ADempiere/pos/typePayment/' + image)
}, },
selectPayment(payment) {
this.selectionTypeRefund = payment
this.$store.commit('updateValueOfField', {
containerUuid: this.renderComponentContainer,
columnName: 'PayAmt',
value: this.change
})
},
addRefund() { addRefund() {
const values = this.$store.getters.getValuesView({ const values = this.$store.getters.getValuesView({
containerUuid: this.renderComponentContainer, containerUuid: this.renderComponentContainer,
format: 'object' format: 'object'
}) })
values.tenderType = this.selectionTypeRefund.name values.tenderType = this.selectionTypeRefund.name
const emptyMandatoryFields = this.$store.getters.getFieldsListEmptyMandatory({ containerUuid: this.renderComponentContainer, formatReturn: 'name' })
if (!this.isEmptyValue(emptyMandatoryFields)) {
this.$message({
type: 'warning',
message: this.$t('notifications.mandatoryFieldMissing') + emptyMandatoryFields,
duration: 1500,
showClose: true
})
return
}
Object.keys(values).forEach(element => {
this.$store.commit('updateValueOfField', {
containerUuid: this.renderComponentContainer,
columnName: element,
value: undefined
})
})
this.$store.dispatch('addRefundLoaded', values) this.$store.dispatch('addRefundLoaded', values)
this.selectionTypeRefund = {} this.selectionTypeRefund = {}
}, },
@ -411,20 +436,11 @@ export default {
optionSelected({ posUuid, orderUuid, customerDetails, payments }) { optionSelected({ posUuid, orderUuid, customerDetails, payments }) {
switch (this.option) { switch (this.option) {
case 2: case 2:
if (this.isEmptyValue(this.emptyFieldGiftCard)) { this.completePreparedOrder(posUuid, orderUuid, payments)
this.completePreparedOrder(posUuid, orderUuid, payments) this.$store.commit('dialogoInvoce', { show: false, success: true })
this.$store.commit('dialogoInvoce', { show: false, success: true })
} else {
this.$message({
type: 'warn',
message: this.$t('notifications.mandatoryFieldMissing') + this.emptyFieldGiftCard,
duration: 1500,
showClose: true
})
}
break break
case 3: case 3:
if (this.isEmptyValue(this.emptyMandatoryFields)) { if (!this.isEmptyValue(this.refundLoaded)) {
this.completePreparedOrder(posUuid, orderUuid, payments) this.completePreparedOrder(posUuid, orderUuid, payments)
overdrawnInvoice({ overdrawnInvoice({
posUuid, posUuid,
@ -452,11 +468,11 @@ export default {
this.$store.commit('dialogoInvoce', { show: false, success: true }) this.$store.commit('dialogoInvoce', { show: false, success: true })
} else { } else {
this.$message({ this.$message({
type: 'warn', type: 'warning',
message: this.$t('notifications.mandatoryFieldMissing') + this.emptyMandatoryFields, message: this.$t('form.pos.collect.overdrawnInvoice.addPayment'),
duration: 1500,
showClose: true showClose: true
}) })
return
} }
break break
default: default:

View File

@ -102,7 +102,8 @@ export default [
size: 24, size: 24,
isNumericField: true, isNumericField: true,
isActiveLogics: true, isActiveLogics: true,
isMandatory: true isMandatory: true,
isReadOnly: true
} }
} }
] ]

View File

@ -32,6 +32,21 @@
:metadata-field="field" :metadata-field="field"
/> />
</el-col> </el-col>
<el-col :span="8">
<el-form-item :label="$t('form.pos.collect.Currency')">
<el-select
v-model="currentFieldCurrency"
@change="changeCurrency"
>
<el-option
v-for="item in listCurrency"
:key="item.id"
:label="item.name"
:value="item.key"
/>
</el-select>
</el-form-item>
</el-col>
</el-row> </el-row>
</el-form> </el-form>
</div> </div>
@ -100,7 +115,6 @@ export default {
return this.$store.getters.posAttributes.currentPointOfSales.displayCurrency.iso_code return this.$store.getters.posAttributes.currentPointOfSales.displayCurrency.iso_code
}, },
maximumDailyRefundAllowed() { maximumDailyRefundAllowed() {
console.log(this.$store.getters.posAttributes.currentPointOfSales.displayCurrency.iso_code)
return this.$store.getters.posAttributes.currentPointOfSales.maximumDailyRefundAllowed return this.$store.getters.posAttributes.currentPointOfSales.maximumDailyRefundAllowed
}, },
maximumRefundAllowed() { maximumRefundAllowed() {
@ -145,13 +159,6 @@ export default {
return this.$store.getters.getPaymentTypeList return this.$store.getters.getPaymentTypeList
} }
}, },
created() {
this.$store.commit('updateValueOfField', {
containerUuid: 'ACH',
columnName: 'PayAmt',
value: this.change
})
},
methods: { methods: {
formatPrice, formatPrice,
close() { close() {

View File

@ -29,7 +29,8 @@ export default [
size: 24, size: 24,
isNumericField: true, isNumericField: true,
isActiveLogics: true, isActiveLogics: true,
isMandatory: true isMandatory: true,
isReadOnly: true
} }
} }
] ]

View File

@ -118,7 +118,6 @@ export default {
return this.$store.getters.posAttributes.currentPointOfSales.displayCurrency.iso_code return this.$store.getters.posAttributes.currentPointOfSales.displayCurrency.iso_code
}, },
maximumDailyRefundAllowed() { maximumDailyRefundAllowed() {
console.log(this.$store.getters.posAttributes.currentPointOfSales.displayCurrency.iso_code)
return this.$store.getters.posAttributes.currentPointOfSales.maximumDailyRefundAllowed return this.$store.getters.posAttributes.currentPointOfSales.maximumDailyRefundAllowed
}, },
maximumRefundAllowed() { maximumRefundAllowed() {
@ -196,13 +195,6 @@ export default {
} }
} }
}, },
created() {
this.$store.commit('updateValueOfField', {
containerUuid: 'Cash',
columnName: 'PayAmt',
value: this.change
})
},
methods: { methods: {
formatPrice, formatPrice,
close() { close() {

View File

@ -103,7 +103,6 @@ export default {
return this.$store.getters.posAttributes.currentPointOfSales.displayCurrency.iso_code return this.$store.getters.posAttributes.currentPointOfSales.displayCurrency.iso_code
}, },
maximumDailyRefundAllowed() { maximumDailyRefundAllowed() {
console.log(this.$store.getters.posAttributes.currentPointOfSales.displayCurrency.iso_code)
return this.$store.getters.posAttributes.currentPointOfSales.maximumDailyRefundAllowed return this.$store.getters.posAttributes.currentPointOfSales.maximumDailyRefundAllowed
}, },
maximumRefundAllowed() { maximumRefundAllowed() {
@ -181,13 +180,6 @@ export default {
} }
} }
}, },
created() {
this.$store.commit('updateValueOfField', {
containerUuid: 'Cash',
columnName: 'PayAmt',
value: this.change
})
},
methods: { methods: {
formatPrice, formatPrice,
close() { close() {

View File

@ -86,7 +86,8 @@ export default [
size: 24, size: 24,
isNumericField: true, isNumericField: true,
isActiveLogics: true, isActiveLogics: true,
isMandatory: true isMandatory: true,
isReadOnly: true
} }
} }
] ]

View File

@ -32,6 +32,21 @@
:metadata-field="field" :metadata-field="field"
/> />
</el-col> </el-col>
<el-col :span="8">
<el-form-item :label="$t('form.pos.collect.Currency')">
<el-select
v-model="currentFieldCurrency"
@change="changeCurrency"
>
<el-option
v-for="item in listCurrency"
:key="item.id"
:label="item.name"
:value="item.key"
/>
</el-select>
</el-form-item>
</el-col>
</el-row> </el-row>
</el-form> </el-form>
</div> </div>

View File

@ -58,7 +58,8 @@ export default [
size: 24, size: 24,
isNumericField: true, isNumericField: true,
isActiveLogics: true, isActiveLogics: true,
isMandatory: true isMandatory: true,
isReadOnly: true
} }
} }
] ]

View File

@ -74,8 +74,8 @@ export default {
type: Object, type: Object,
default: () => { default: () => {
return { return {
uuid: 'zelle', uuid: 'Zelle',
containerUuid: 'zelle' containerUuid: 'Zelle'
} }
} }
} }
@ -100,7 +100,6 @@ export default {
return this.$store.getters.posAttributes.currentPointOfSales.displayCurrency.iso_code return this.$store.getters.posAttributes.currentPointOfSales.displayCurrency.iso_code
}, },
maximumDailyRefundAllowed() { maximumDailyRefundAllowed() {
console.log(this.$store.getters.posAttributes.currentPointOfSales.displayCurrency.iso_code)
return this.$store.getters.posAttributes.currentPointOfSales.maximumDailyRefundAllowed return this.$store.getters.posAttributes.currentPointOfSales.maximumDailyRefundAllowed
}, },
maximumRefundAllowed() { maximumRefundAllowed() {
@ -145,13 +144,6 @@ export default {
return this.$store.getters.getPaymentTypeList return this.$store.getters.getPaymentTypeList
} }
}, },
created() {
this.$store.commit('updateValueOfField', {
containerUuid: 'zelle',
columnName: 'PayAmt',
value: this.change
})
},
methods: { methods: {
formatPrice, formatPrice,
close() { close() {

View File

@ -149,27 +149,6 @@ export default {
return this.$store.state['pointOfSales/point/index'].conversionsList return this.$store.state['pointOfSales/point/index'].conversionsList
} }
}, },
// watch: {
// listPaymentType(value) {
// if (!this.isEmptyValue(value.reference)) {
// this.tenderTypeDisplaye({
// tableName: value.reference.tableName,
// query: value.reference.query
// })
// }
// }
// },
// created() {
// if (!this.isEmptyValue(this.isAddTypePay)) {
// this.convertingPaymentMethods()
// }
// if (!this.isEmptyValue(this.listPaymentType.reference)) {
// this.tenderTypeDisplaye({
// tableName: this.listPaymentType.reference.tableName,
// query: this.listPaymentType.reference.query
// })
// }
// },
methods: { methods: {
formatDate, formatDate,
formatPrice, formatPrice,

View File

@ -504,7 +504,8 @@ export default {
dailyLimit: 'Daily Limit', dailyLimit: 'Daily Limit',
customerLimit: 'Order Limit', customerLimit: 'Order Limit',
available: 'Available', available: 'Available',
emptyPayment: 'Payment method not supported' emptyPayment: 'Unsupported payment method',
addPayment: 'You must add a change type to complete the operation'
} }
}, },
keyLayout: { keyLayout: {

View File

@ -480,7 +480,8 @@ export default {
dailyLimit: 'Limite Diario', dailyLimit: 'Limite Diario',
customerLimit: 'Limite Order', customerLimit: 'Limite Order',
available: 'Disponible', available: 'Disponible',
emptyPayment: 'Método de pago no soportado' emptyPayment: 'Método de pago no soportado',
addPayment: 'Debe agregar un tipo de vuelto para completar la operación'
} }
}, },
keyLayout: { keyLayout: {