-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add report to get annual revaluation (#380)
* npm update. cypress_console ok * Created report annual revaluation * Improving UI * Now annual revaluation filter by zero_risk investments
- Loading branch information
Showing
8 changed files
with
610 additions
and
913 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { login_test_User, add_investmentoperation_from_Home } from "./commons" | ||
|
||
describe('e2e Annual revaluation Catalog', () => { | ||
it('Annual revaluation', () => { | ||
login_test_User(cy) | ||
|
||
// Create investment operation | ||
add_investmentoperation_from_Home(cy) | ||
cy.getDataTest("InvestmentsView_ButtonClose").click() | ||
|
||
//Open lateral menu | ||
cy.getDataTest('LateralIcon').click() | ||
cy.getDataTest('LateralReports').click() | ||
cy.getDataTest('LateralReportsAnnualRevaluation').click() | ||
|
||
}) | ||
}) |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
<template> | ||
<div class="pa-4"> | ||
<h1 class="mb-3">{{ $t("Investments operations annual revaluation report") }}</h1> | ||
<v-checkbox v-model="only_zero" :label="$t('Show only investments operations from zero risk investments')" /> | ||
<v-data-table density="compact" :headers="headers" :items="list_io" class="elevation-1" :sort-by="[{key:'datetime',order:'asc'}]" fixed-header height="800" :loading="$attrs.loading" :items-per-page="10000" hide-default-footer :key="key"> | ||
<template #item.datetime="{item}"> | ||
<div>{{ localtime(item.datetime)}}</div> | ||
</template> | ||
<template #item.operationstypes="{item}"> | ||
<div>{{ getMapObjectById("operationstypes",item.operationstypes_id).localname }}</div> | ||
</template> | ||
<template #item.price_user="{item}"> | ||
<div class="text-right" v-html="localcurrency_html(item.price_user)"></div> | ||
</template> | ||
<template #item.balance_last_year_or_invested="{item}"> | ||
<div class="text-right" v-html="localcurrency_html(item.balance_last_year_or_invested)"></div> | ||
</template> | ||
<template #item.current_year_gains_user="{item}"> | ||
<div class="text-right" v-html="localcurrency_html(item.current_year_gains_user)"></div> | ||
</template> | ||
<template #item.percentage="{item}"> | ||
<div class="text-right" v-html="percentage_html(item.current_year_gains_user/item.invested_user)"></div> | ||
</template> | ||
<template #tbody> | ||
<tr class="totalrow" v-if="list_io.length>0"> | ||
<td>{{ f($t("Total ([0] registers)"), [list_io.length])}}</td> | ||
<td></td> | ||
<td></td> | ||
<td></td> | ||
<td></td> | ||
<td class="text-right" v-html="localcurrency_html(listobjects_sum(list_io,'balance_last_year_or_invested'))"></td> | ||
<td class="text-right" v-html="localcurrency_html(listobjects_sum(list_io,'current_year_gains_user'))"></td> | ||
<td class="text-right" v-html="percentage_html(listobjects_sum(list_io,'current_year_gains_user')/listobjects_sum(list_io,'balance_last_year_or_invested'))"></td> | ||
</tr> | ||
</template> | ||
</v-data-table> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import axios from 'axios' | ||
import { useStore } from "@/store" | ||
import { localtime,f } from 'vuetify_rules' | ||
export default { | ||
components:{ | ||
}, | ||
data(){ | ||
return{ | ||
list_io: [], | ||
key: 0, | ||
only_zero:false, | ||
loading:false, | ||
headers: [ | ||
{ title: this.$t('Date and time'), key: 'datetime',sortable: true }, | ||
{ title: this.$t('Investments'), key: 'name',sortable: true }, | ||
{ title: this.$t('Operation'), key: 'operationstypes',sortable: true }, | ||
{ title: this.$t('Shares'), key: 'shares',sortable: false, align:'end'}, | ||
{ title: this.$t('Price'), key: 'price_user',sortable: false, align:'end'}, | ||
{ title: this.$t('Balance last year or invested'), key: 'balance_last_year_or_invested',sortable: false, align:'end'}, | ||
{ title: this.$t('Annual gains'), key: 'current_year_gains_user',sortable: false, align:'end'}, | ||
{ title: this.$t('% Annual'), key: 'percentage',sortable: false, align:'end'}, | ||
], | ||
} | ||
}, | ||
watch:{ | ||
only_zero(){ | ||
this.refreshTable() | ||
console.log("AHORA") | ||
} | ||
}, | ||
methods:{ | ||
useStore, | ||
f, | ||
localtime, | ||
refreshTable(){ | ||
this.loading=true | ||
var onlyzerostring=(this.only_zero)? "?only_zero=true": "" | ||
return axios.get(`${this.useStore().apiroot}/reports/annual/revaluation/${onlyzerostring}`, this.myheaders()) | ||
.then((response) => { | ||
this.list_io=response.data | ||
this.loading=false | ||
this.key+=1 | ||
}, (error) => { | ||
this.parseResponseError(error) | ||
}); | ||
} | ||
}, | ||
mounted(){ | ||
this.refreshTable() | ||
} | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters