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

Merge pull request #234 from ankitsinghaniyaz/master

Fix profit and loss graph not reflecting changes correctly
This commit is contained in:
Alan 2021-11-05 12:02:52 +05:30 committed by GitHub
commit b77f5536ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 12 deletions

View File

@ -1,17 +1,16 @@
<template> <template>
<div> <div class="flex flex-col h-full">
<SectionHeader> <SectionHeader>
<template slot="title" class="font-medium">{{ <template slot="title" class="font-medium">{{
_('Top Expenses') _('Top Expenses')
}}</template> }}</template>
<PeriodSelector <PeriodSelector
v-if="hasData"
slot="action" slot="action"
:value="period" :value="period"
@change="value => (period = value)" @change="value => (period = value)"
/> />
</SectionHeader> </SectionHeader>
<div class="flex relative"> <div class="flex relative" v-show="hasData">
<div class="w-1/2"> <div class="w-1/2">
<div <div
class="mt-5 flex justify-between items-center text-sm" class="mt-5 flex justify-between items-center text-sm"
@ -28,7 +27,6 @@
<div class="w-1/2"> <div class="w-1/2">
<div class="chart-wrapper" ref="top-expenses"></div> <div class="chart-wrapper" ref="top-expenses"></div>
<div <div
v-if="hasData"
class="absolute text-base text-center font-semibold" class="absolute text-base text-center font-semibold"
style="right: 6rem; top: 32%;" style="right: 6rem; top: 32%;"
> >
@ -40,13 +38,13 @@
</div> </div>
</div> </div>
</div> </div>
<div v-if="totalExpense === 0" class="absolute inset-0 flex-center"> </div>
<div v-if="totalExpense === 0" class="flex-1 w-full h-full flex-center">
<span class="text-base text-gray-600"> <span class="text-base text-gray-600">
{{ _('No transactions yet') }} {{ _('No transactions yet') }}
</span> </span>
</div> </div>
</div> </div>
</div>
</template> </template>
<script> <script>

View File

@ -3,14 +3,13 @@
<SectionHeader> <SectionHeader>
<template slot="title">{{ _('Profit and Loss') }}</template> <template slot="title">{{ _('Profit and Loss') }}</template>
<PeriodSelector <PeriodSelector
v-if="hasData"
slot="action" slot="action"
:value="period" :value="period"
@change="value => (period = value)" @change="value => (period = value)"
/> />
</SectionHeader> </SectionHeader>
<div v-if="hasData" class="chart-wrapper" ref="profit-and-loss"></div> <div v-show="hasData" class="chart-wrapper" ref="profit-and-loss"></div>
<div class="flex-1 w-full h-full flex-center" v-else> <div class="flex-1 w-full h-full flex-center my-20" v-if="!hasData">
<span class="text-base text-gray-600"> <span class="text-base text-gray-600">
{{ _('No transactions yet') }} {{ _('No transactions yet') }}
</span> </span>