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:
parent
facf5dbfb6
commit
4385a93a77
@ -107,7 +107,7 @@ export default {
|
||||
},
|
||||
validate(value) {
|
||||
if (!(typeof this.df.validate === 'function')) {
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
|
||||
try {
|
||||
|
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user