mirror of
https://github.com/PanJiaChen/vue-element-admin.git
synced 2025-08-10 20:39:48 +08:00
Add function for number formatting in decimals (#1088)
* Add function for number formatting in decimals * minimal changes * rename function Co-authored-by: elsiosanchez <elsiossanches@gmail.com>
This commit is contained in:
parent
37eb7240f9
commit
54a4612e7b
@ -670,6 +670,9 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
precision() {
|
||||||
|
return this.$store.getters.getCurrency.standardPrecision
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
@ -749,13 +752,14 @@ export default {
|
|||||||
containerUuid,
|
containerUuid,
|
||||||
columnName: 'ReferenceNo'
|
columnName: 'ReferenceNo'
|
||||||
})
|
})
|
||||||
|
|
||||||
if (this.sendToServer) {
|
if (this.sendToServer) {
|
||||||
this.$store.dispatch('setPaymentBox', {
|
this.$store.dispatch('setPaymentBox', {
|
||||||
posUuid,
|
posUuid,
|
||||||
orderUuid,
|
orderUuid,
|
||||||
bankUuid,
|
bankUuid,
|
||||||
referenceNo,
|
referenceNo,
|
||||||
amount: this.amontSend,
|
amount: this.round(this.amontSend, this.precision),
|
||||||
convertedAmount: this.amontSend * this.dayRate.divideRate,
|
convertedAmount: this.amontSend * this.dayRate.divideRate,
|
||||||
paymentDate,
|
paymentDate,
|
||||||
tenderTypeCode,
|
tenderTypeCode,
|
||||||
@ -767,7 +771,7 @@ export default {
|
|||||||
orderUuid,
|
orderUuid,
|
||||||
bankUuid,
|
bankUuid,
|
||||||
referenceNo,
|
referenceNo,
|
||||||
amount: this.amontSend,
|
amount: this.round(this.amontSend, this.precision),
|
||||||
convertedAmount: this.amontSend * this.dayRate.divideRate,
|
convertedAmount: this.amontSend * this.dayRate.divideRate,
|
||||||
paymentDate,
|
paymentDate,
|
||||||
tenderTypeCode,
|
tenderTypeCode,
|
||||||
|
@ -97,22 +97,6 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item v-if="displayeCurrency" :label="$t('form.pos.collect.Currency')">
|
|
||||||
<el-select
|
|
||||||
v-model="currentFieldCurrency"
|
|
||||||
style="width: -webkit-fill-available;"
|
|
||||||
@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-col
|
<el-col
|
||||||
v-for="field in hiddenFieldsList"
|
v-for="field in hiddenFieldsList"
|
||||||
:key="field.sequence"
|
:key="field.sequence"
|
||||||
|
@ -24,6 +24,7 @@ export {
|
|||||||
currencyFind,
|
currencyFind,
|
||||||
tenderTypeFind,
|
tenderTypeFind,
|
||||||
formatConversionCurrenty,
|
formatConversionCurrenty,
|
||||||
|
round,
|
||||||
convertValuesToSend,
|
convertValuesToSend,
|
||||||
typeValue
|
typeValue
|
||||||
} from '@/utils/ADempiere/valueUtils.js'
|
} from '@/utils/ADempiere/valueUtils.js'
|
||||||
|
@ -114,6 +114,13 @@ export function extractPagingToken(token) {
|
|||||||
return onlyToken
|
return onlyToken
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {number} number
|
||||||
|
*/
|
||||||
|
export function round(number, standardPrecision) {
|
||||||
|
const amount = number.toFixed(standardPrecision)
|
||||||
|
return Number(amount)
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* zero pad
|
* zero pad
|
||||||
* @author EdwinBetanc0urt <EdwinBetanc0urt@oulook.com>
|
* @author EdwinBetanc0urt <EdwinBetanc0urt@oulook.com>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user