2
0
mirror of https://github.com/frappe/books.git synced 2024-11-09 23:30:56 +00:00

fix: validate to true if no validation, parse into pesa on input

This commit is contained in:
18alantom 2021-12-24 16:02:04 +05:30
parent facf5dbfb6
commit 4385a93a77
2 changed files with 9 additions and 6 deletions

View File

@ -107,7 +107,7 @@ export default {
},
validate(value) {
if (!(typeof this.df.validate === 'function')) {
return;
return true;
}
try {

View File

@ -13,7 +13,7 @@
:readonly="isReadOnly"
@blur="onBlur"
@focus="onFocus"
@input="e => $emit('input', e)"
@input="(e) => $emit('input', e)"
/>
<div
v-show="!showInput"
@ -37,7 +37,7 @@ export default {
data() {
return {
showInput: false,
currencySymbol: ''
currencySymbol: '',
};
},
methods: {
@ -45,6 +45,9 @@ export default {
this.showInput = true;
this.$emit('focus', e);
},
parse(value) {
return frappe.pesa(value);
},
onBlur(e) {
this.showInput = false;
this.triggerChange(e.target.value);
@ -54,12 +57,12 @@ export default {
this.$nextTick(() => {
this.focus();
});
}
},
},
computed: {
formattedValue() {
return frappe.format(this.value, this.df, this.doc);
}
}
},
},
};
</script>