1
0
mirror of https://github.com/PanJiaChen/vue-element-admin.git synced 2025-08-07 18:25:45 +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">
<el-row :gutter="24">
<el-col v-for="(payment, index) in paymentTypeList" :key="index" :span="6">
<div @click="selectionTypeRefund = payment">
<div @click="selectPayment(payment)">
<el-card shadow="hover">
<div slot="header" class="clearfix" style="text-align: center;">
<span>
@ -363,12 +363,37 @@ export default {
}
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() {
const values = this.$store.getters.getValuesView({
containerUuid: this.renderComponentContainer,
format: 'object'
})
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.selectionTypeRefund = {}
},
@ -411,20 +436,11 @@ export default {
optionSelected({ posUuid, orderUuid, customerDetails, payments }) {
switch (this.option) {
case 2:
if (this.isEmptyValue(this.emptyFieldGiftCard)) {
this.completePreparedOrder(posUuid, orderUuid, payments)
this.$store.commit('dialogoInvoce', { show: false, success: true })
} else {
this.$message({
type: 'warn',
message: this.$t('notifications.mandatoryFieldMissing') + this.emptyFieldGiftCard,
duration: 1500,
showClose: true
})
}
this.completePreparedOrder(posUuid, orderUuid, payments)
this.$store.commit('dialogoInvoce', { show: false, success: true })
break
case 3:
if (this.isEmptyValue(this.emptyMandatoryFields)) {
if (!this.isEmptyValue(this.refundLoaded)) {
this.completePreparedOrder(posUuid, orderUuid, payments)
overdrawnInvoice({
posUuid,
@ -452,11 +468,11 @@ export default {
this.$store.commit('dialogoInvoce', { show: false, success: true })
} else {
this.$message({
type: 'warn',
message: this.$t('notifications.mandatoryFieldMissing') + this.emptyMandatoryFields,
duration: 1500,
type: 'warning',
message: this.$t('form.pos.collect.overdrawnInvoice.addPayment'),
showClose: true
})
return
}
break
default:

View File

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

View File

@ -32,6 +32,21 @@
:metadata-field="field"
/>
</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-form>
</div>
@ -100,7 +115,6 @@ export default {
return this.$store.getters.posAttributes.currentPointOfSales.displayCurrency.iso_code
},
maximumDailyRefundAllowed() {
console.log(this.$store.getters.posAttributes.currentPointOfSales.displayCurrency.iso_code)
return this.$store.getters.posAttributes.currentPointOfSales.maximumDailyRefundAllowed
},
maximumRefundAllowed() {
@ -145,13 +159,6 @@ export default {
return this.$store.getters.getPaymentTypeList
}
},
created() {
this.$store.commit('updateValueOfField', {
containerUuid: 'ACH',
columnName: 'PayAmt',
value: this.change
})
},
methods: {
formatPrice,
close() {

View File

@ -29,7 +29,8 @@ export default [
size: 24,
isNumericField: 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
},
maximumDailyRefundAllowed() {
console.log(this.$store.getters.posAttributes.currentPointOfSales.displayCurrency.iso_code)
return this.$store.getters.posAttributes.currentPointOfSales.maximumDailyRefundAllowed
},
maximumRefundAllowed() {
@ -196,13 +195,6 @@ export default {
}
}
},
created() {
this.$store.commit('updateValueOfField', {
containerUuid: 'Cash',
columnName: 'PayAmt',
value: this.change
})
},
methods: {
formatPrice,
close() {

View File

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

View File

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

View File

@ -32,6 +32,21 @@
:metadata-field="field"
/>
</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-form>
</div>

View File

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

View File

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

View File

@ -149,27 +149,6 @@ export default {
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: {
formatDate,
formatPrice,

View File

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

View File

@ -480,7 +480,8 @@ export default {
dailyLimit: 'Limite Diario',
customerLimit: 'Limite Order',
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: {