mirror of
https://github.com/PanJiaChen/vue-element-admin.git
synced 2025-06-05 04:29:19 +08:00
fixe errors at the point of sale (#902)
Co-authored-by: elsiosanchez <elsiossanches@gmail.com>
This commit is contained in:
parent
c6cc1df91f
commit
6436b33479
@ -19,6 +19,7 @@
|
||||
<el-container style="background: white; height: 100% !important;">
|
||||
<el-main style="background: white; padding: 0px; height: 100% !important; overflow: hidden">
|
||||
<el-container style="background: white; padding: 0px; height: 100% !important;">
|
||||
<!-- Collection container top panel -->
|
||||
<el-header style="height: auto; padding-bottom: 10px; padding-right: 0px; padding-left: 0px">
|
||||
<el-card class="box-card" style="padding-left: 0px; padding-right: 0px">
|
||||
<div slot="header" class="clearfix">
|
||||
@ -59,14 +60,22 @@
|
||||
</b>
|
||||
</p>
|
||||
<p class="total">
|
||||
<b>Tasa del Día: </b>
|
||||
<b>{{ $t('form.pos.collect.dayRate') }}:</b>
|
||||
<!-- Conversion rate to date -->
|
||||
<b v-if="!isEmptyValue(dateRate)" style="float: right;">
|
||||
{{
|
||||
dateRate.iSOCode
|
||||
}}
|
||||
{{
|
||||
formatConversionCurrenty(dateRate.amountConvertion)
|
||||
}}
|
||||
<span v-if="formatConversionCurrenty(dateRate.amountConvertion) > 100">
|
||||
{{
|
||||
formatPrice(formatConversionCurrenty(dateRate.amountConvertion), dateRate.iSOCode)
|
||||
}}
|
||||
</span>
|
||||
<span v-else>
|
||||
{{
|
||||
dateRate.iSOCode
|
||||
}}
|
||||
{{
|
||||
formatConversionCurrenty(dateRate.amountConvertion)
|
||||
}}
|
||||
</span>
|
||||
</b>
|
||||
</p>
|
||||
</div>
|
||||
@ -82,11 +91,12 @@
|
||||
>
|
||||
<el-row>
|
||||
<el-col v-for="(field, index) in fieldsList" :key="index" :span="8">
|
||||
<!-- Add selected currency symbol -->
|
||||
<field-definition
|
||||
:key="field.columnName"
|
||||
:metadata-field="field.columnName === 'PayAmt' ? {
|
||||
...field,
|
||||
labelCurrency: isEmptyValue($store.getters.getFieldCuerrency) ? pointOfSalesCurrency : $store.getters.getFieldCuerrency
|
||||
labelCurrency: dateRate
|
||||
} : field"
|
||||
/>
|
||||
</el-col>
|
||||
@ -101,6 +111,7 @@
|
||||
<el-button type="success" :disabled="validateCompleteCollection || isDisabled" icon="el-icon-shopping-cart-full" @click="completePreparedOrder(listPayments)" />
|
||||
</samp>
|
||||
</el-header>
|
||||
<!-- Panel where they show the payments registered from the collection container -->
|
||||
<el-main style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px;">
|
||||
<type-collection
|
||||
v-if="!updateOrderPaymentPos"
|
||||
@ -120,7 +131,7 @@
|
||||
class="view-loading"
|
||||
/>
|
||||
</el-main>
|
||||
|
||||
<!-- Collection container bottom panel -->
|
||||
<el-footer height="auto" style="padding-left: 0px; padding-right: 0px;">
|
||||
<el-row :gutter="24" style="background-color: rgb(245, 247, 250);">
|
||||
<el-col :span="24">
|
||||
@ -571,7 +582,11 @@ export default {
|
||||
let sum = 0
|
||||
if (cash) {
|
||||
cash.forEach((pay) => {
|
||||
sum += pay.amount
|
||||
if (!this.isEmptyValue(pay.divideRate)) {
|
||||
sum += pay.amountConvertion / pay.divideRate
|
||||
} else {
|
||||
sum += pay.amount
|
||||
}
|
||||
})
|
||||
}
|
||||
return sum
|
||||
|
@ -68,7 +68,10 @@
|
||||
style="padding-bottom: 20px;"
|
||||
>
|
||||
<p class="total">
|
||||
<b style="float: right;">
|
||||
<b v-if="!isEmptyValue(value.multiplyRate)" style="float: right;">
|
||||
{{ formatPrice(value.multiplyRate, currency.iSOCode) }}
|
||||
</b>
|
||||
<b v-else style="float: right;">
|
||||
{{ formatPrice(value.amount, currency.iSOCode) }}
|
||||
</b>
|
||||
</p>
|
||||
@ -148,6 +151,10 @@ export default {
|
||||
},
|
||||
conevertionAmount() {
|
||||
return this.$store.getters.getConvertionPayment
|
||||
},
|
||||
// Validate if there is a payment in a different type of currency to the point
|
||||
paymentCurrency() {
|
||||
return this.$store.getters.posAttributes.currentPointOfSales.currentOrder.listPayments.payments.find(pay => pay.currencyUuid !== this.currency.uuid)
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@ -172,23 +179,21 @@ export default {
|
||||
methods: {
|
||||
formatDate,
|
||||
formatPrice,
|
||||
// If there are payments in another currency, search for conversion
|
||||
convertingPaymentMethods() {
|
||||
const currencyUuid = this.isAddTypePay.find(pay => pay.currencyUuid !== this.currency.uuid)
|
||||
if (!this.isEmptyValue(currencyUuid)) {
|
||||
if (!this.isEmptyValue(this.paymentCurrency)) {
|
||||
requestGetConversionRate({
|
||||
conversionTypeUuid: this.currentPointOfSales.conversionTypeUuid,
|
||||
currencyFromUuid: this.currency.uuid,
|
||||
currencyToUuid: currencyUuid.currencyUuid
|
||||
currencyToUuid: this.paymentCurrency.currencyUuid
|
||||
})
|
||||
.then(response => {
|
||||
this.isAddTypePay.forEach(element => {
|
||||
console.log({ element })
|
||||
this.$store.getters.posAttributes.currentPointOfSales.currentOrder.listPayments.payments.forEach(element => {
|
||||
if (element.currencyUuid !== this.pointOfSalesCurrency.uuid) {
|
||||
element.amount = element.amount / response.multiplyRate
|
||||
element.amountConvertion = element.amount / response.divideRate
|
||||
element.multiplyRate = element.amount / response.multiplyRate
|
||||
element.amountConvertion = element.multiplyRate / response.divideRate
|
||||
element.divideRate = response.multiplyRate
|
||||
element.currencyConvertion = response.currencyTo
|
||||
} else {
|
||||
element.currencyConvertion = {}
|
||||
}
|
||||
})
|
||||
this.$store.commit('setListPayments', {
|
||||
@ -251,6 +256,7 @@ export default {
|
||||
paymentUuid
|
||||
})
|
||||
},
|
||||
// Payment card label
|
||||
tenderTypeDisplaye({
|
||||
tableName,
|
||||
query
|
||||
|
@ -389,8 +389,8 @@ export default {
|
||||
processOrder({
|
||||
posUuid,
|
||||
orderUuid: this.$route.query.action,
|
||||
createPayments: !this.isEmptyValue(this.currentOrder.listPayments),
|
||||
payments: this.currentOrder.listPayments
|
||||
createPayments: false,
|
||||
payments: []
|
||||
})
|
||||
.then(response => {
|
||||
this.$store.dispatch('reloadOrder', response.uuid)
|
||||
|
@ -371,18 +371,18 @@ export default {
|
||||
return 12
|
||||
}
|
||||
if (this.isEmptyValue(this.currentOrder)) {
|
||||
return 14
|
||||
return 9
|
||||
}
|
||||
return 11
|
||||
return 7
|
||||
},
|
||||
colFieldProductCode() {
|
||||
if (this.isMobile) {
|
||||
return 12
|
||||
}
|
||||
if (this.isEmptyValue(this.currentOrder)) {
|
||||
return 9
|
||||
return 14
|
||||
}
|
||||
return 7
|
||||
return 11
|
||||
},
|
||||
shortsKey() {
|
||||
return {
|
||||
|
@ -472,6 +472,7 @@ export default {
|
||||
change: 'Change',
|
||||
convertAmount: 'Convert Quantity',
|
||||
fullPayment: 'Full Payment',
|
||||
dayRate: 'Day Rate',
|
||||
TenderType: {
|
||||
directDeposit: 'Direct Deposit',
|
||||
creditCard: 'Credit Card',
|
||||
|
@ -447,6 +447,7 @@ export default {
|
||||
change: 'Cambio',
|
||||
convertAmount: 'Convertir Cantidad',
|
||||
fullPayment: 'Cobro Completo',
|
||||
dayRate: 'Tasa del Día',
|
||||
TenderType: {
|
||||
directDeposit: 'Depósito Directo',
|
||||
creditCard: 'Tarjeta de Crédito',
|
||||
|
@ -732,7 +732,6 @@ const actions = {
|
||||
sqlStatement
|
||||
}) {
|
||||
// const contextInforField = getters.getContextInfoField(contextInfoUuid, sqlStatement)
|
||||
// console.log({ contextInforField })
|
||||
// if (contextInforField) {
|
||||
// return contextInforField
|
||||
// }
|
||||
@ -742,7 +741,6 @@ const actions = {
|
||||
query: sqlStatement
|
||||
})
|
||||
.then(contextInfoResponse => {
|
||||
console.log({ contextInfoResponse })
|
||||
commit('setContextInfoField', {
|
||||
contextInfoUuid,
|
||||
sqlStatement,
|
||||
|
@ -123,7 +123,8 @@ export default {
|
||||
if (!isEmptyValue(response.currencyTo)) {
|
||||
const currency = {
|
||||
...response.currencyTo,
|
||||
amountConvertion: response.divideRate
|
||||
amountConvertion: response.divideRate,
|
||||
multiplyRate: response.multiplyRate
|
||||
}
|
||||
dispatch('addRateConvertion', currency)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user