2
0
mirror of https://github.com/frappe/books.git synced 2024-11-10 07:40:55 +00:00

Chart of Accounts show debit and credit

This commit is contained in:
thefalconx33 2019-07-22 17:19:48 +05:30
parent ebf6800d65
commit 03b2180cdc

View File

@ -4,10 +4,11 @@
<div class="d-flex align-items-center" @click="toggleChildren">
<feather-icon class="mr-1" :name="iconName" v-show="iconName" />
<span>{{ label }}</span>
<div class="ml-auto d-flex align-items-center">
<div class="ml-auto d-flex align-items-center" v-if="rootType != null">
<span>
{{ currency }}
<span style="font-weight: 800">{{ computedBalance }}</span>
<span style="font-weight: 800">{{ Math.abs(computedBalance) }}</span>
{{ creditOrDebit }}
</span>
</div>
</div>
@ -44,6 +45,12 @@ const Branch = {
},
computedBalance() {
return this.nodeBalance;
},
creditOrDebit() {
if (['Asset', 'Expense'].includes(this.rootType))
return this.nodeBalance > 0 ? 'Dr' : 'Cr';
return this.nodeBalance > 0 ? 'Cr' : 'Dr';
}
},
components: {