2
0
mirror of https://github.com/frappe/books.git synced 2024-12-22 19:09: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',
target: 'Currency',
hidden: 1,
formula: (doc) => doc.getFrom('Party', doc.supplier, 'currency'),
formula: (doc) =>
doc.getFrom('Party', doc.supplier, 'currency') ||
frappe.AccountingSettings.currency,
formulaDependsOn: ['supplier'],
},
{

View File

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