2
0
mirror of https://github.com/frappe/books.git synced 2024-12-23 03:19:01 +00:00

fix: currency field display (PI)

This commit is contained in:
18alantom 2021-12-28 12:01:42 +05:30
parent 1e6113e92f
commit 5c6ac0e161
2 changed files with 10 additions and 3 deletions

View File

@ -54,7 +54,9 @@ export default {
fieldtype: 'Link', fieldtype: 'Link',
target: 'Currency', target: 'Currency',
hidden: 1, hidden: 1,
formula: (doc) => doc.getFrom('Party', doc.supplier, 'currency'), formula: (doc) =>
doc.getFrom('Party', doc.supplier, 'currency') ||
frappe.AccountingSettings.currency,
formulaDependsOn: ['supplier'], formulaDependsOn: ['supplier'],
}, },
{ {

View File

@ -8,7 +8,7 @@
ref="input" ref="input"
:class="inputClasses" :class="inputClasses"
:type="inputType" :type="inputType"
:value="value" :value="value.round()"
:placeholder="inputPlaceholder" :placeholder="inputPlaceholder"
:readonly="isReadOnly" :readonly="isReadOnly"
@blur="onBlur" @blur="onBlur"
@ -49,8 +49,13 @@ export default {
return frappe.pesa(value); return frappe.pesa(value);
}, },
onBlur(e) { onBlur(e) {
let { value } = e.target;
if (value === '') {
value = frappe.pesa(0).round();
}
this.showInput = false; this.showInput = false;
this.triggerChange(e.target.value); this.triggerChange(value);
}, },
activateInput() { activateInput() {
this.showInput = true; this.showInput = true;