mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-12-19 09:41:22 +00:00
Updated code.
This commit is contained in:
@@ -260,7 +260,7 @@ trait ConvertsExchangeRates
|
|||||||
*/
|
*/
|
||||||
private function getPreference(): void
|
private function getPreference(): void
|
||||||
{
|
{
|
||||||
$this->enabled = false;
|
$this->enabled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,6 @@
|
|||||||
-->
|
-->
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<!-- -->
|
|
||||||
<div class="q-mt-sm q-mr-sm">
|
<div class="q-mt-sm q-mr-sm">
|
||||||
<q-card bordered>
|
<q-card bordered>
|
||||||
<q-item>
|
<q-item>
|
||||||
@@ -31,9 +30,7 @@
|
|||||||
<ApexChart ref="chart" height="350" type="line" :options="options" :series="series"></ApexChart>
|
<ApexChart ref="chart" height="350" type="line" :options="options" :series="series"></ApexChart>
|
||||||
</q-card>
|
</q-card>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -110,8 +107,15 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
numberFormatter: function (value, index) {
|
numberFormatter: function (value, index) {
|
||||||
let currencyCode = this.currencies[index] ?? 'EUR';
|
if(index instanceof Object) {
|
||||||
return Intl.NumberFormat(this.locale, {style: 'currency', currency: currencyCode}).format(value);
|
let currencyCode = this.currencies[index.seriesIndex] ?? 'EUR';
|
||||||
|
return Intl.NumberFormat(this.locale, {style: 'currency', currency: currencyCode}).format(value);
|
||||||
|
}
|
||||||
|
if(Number.isInteger(index)) {
|
||||||
|
let currencyCode = this.currencies[index] ?? 'EUR';
|
||||||
|
return Intl.NumberFormat(this.locale, {style: 'currency', currency: currencyCode}).format(value);
|
||||||
|
}
|
||||||
|
return 'x';
|
||||||
},
|
},
|
||||||
buildChart: function () {
|
buildChart: function () {
|
||||||
console.log('buildChart');
|
console.log('buildChart');
|
||||||
@@ -130,6 +134,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
generateSeries: function (data) {
|
generateSeries: function (data) {
|
||||||
|
console.log('generateSeries');
|
||||||
this.series = [];
|
this.series = [];
|
||||||
let series;
|
let series;
|
||||||
for (let i in data) {
|
for (let i in data) {
|
||||||
@@ -137,7 +142,12 @@ export default {
|
|||||||
series = {};
|
series = {};
|
||||||
series.name = data[i].label;
|
series.name = data[i].label;
|
||||||
series.data = [];
|
series.data = [];
|
||||||
this.currencies.push(data[i].currency_code);
|
if(!data[i].converted) {
|
||||||
|
this.currencies.push(data[i].currency_code);
|
||||||
|
}
|
||||||
|
if(data[i].converted) {
|
||||||
|
this.currencies.push(data[i].native_code);
|
||||||
|
}
|
||||||
for (let ii in data[i].entries) {
|
for (let ii in data[i].entries) {
|
||||||
series.data.push(data[i].entries[ii]);
|
series.data.push(data[i].entries[ii]);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -130,19 +130,22 @@ export default {
|
|||||||
for (let i in data) {
|
for (let i in data) {
|
||||||
if (data.hasOwnProperty(i)) {
|
if (data.hasOwnProperty(i)) {
|
||||||
const current = data[i];
|
const current = data[i];
|
||||||
const hasNative = current.native_id !== current.id && current.native_sum !== '0';
|
const hasNative = current.converted && current.native_id !== current.id && parseFloat(current.native_sum) !== 0.0;
|
||||||
this.unpaid.push(
|
this.unpaid.push(
|
||||||
{
|
{
|
||||||
sum: current.sum,
|
sum: current.sum,
|
||||||
code: current.code,
|
code: current.code,
|
||||||
native_sum: current.native_sum,
|
native_sum: current.converted ? current.native_sum : current.sum,
|
||||||
native_code: current.native_code,
|
native_code: current.converted ? current.native_code : current.code,
|
||||||
native: hasNative,
|
native: hasNative,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
if (hasNative || current.native_id === current.id) {
|
if (current.converted && (hasNative || current.native_id === current.id)) {
|
||||||
this.unpaidAmount = this.unpaidAmount + parseFloat(current.native_sum);
|
this.unpaidAmount = this.unpaidAmount + parseFloat(current.native_sum);
|
||||||
}
|
}
|
||||||
|
if (!current.converted) {
|
||||||
|
this.unpaidAmount = this.unpaidAmount + parseFloat(current.sum);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -150,19 +153,22 @@ export default {
|
|||||||
for (let i in data) {
|
for (let i in data) {
|
||||||
if (data.hasOwnProperty(i)) {
|
if (data.hasOwnProperty(i)) {
|
||||||
const current = data[i];
|
const current = data[i];
|
||||||
const hasNative = current.native_id !== current.id && parseFloat(current.native_sum) !== 0.0;
|
const hasNative = current.converted && current.native_id !== current.id && parseFloat(current.native_sum) !== 0.0;
|
||||||
this.paid.push(
|
this.paid.push(
|
||||||
{
|
{
|
||||||
sum: current.sum,
|
sum: current.sum,
|
||||||
code: current.code,
|
code: current.code,
|
||||||
native_sum: current.native_sum,
|
native_sum: current.converted ? current.native_sum : current.sum,
|
||||||
native_code: current.native_code,
|
native_code: current.converted ? current.native_code : current.code,
|
||||||
native: hasNative,
|
native: hasNative,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
if (hasNative || current.native_id === current.id) {
|
if (current.converted && (hasNative || current.native_id === current.id)) {
|
||||||
this.paidAmount = this.paidAmount + (parseFloat(current.native_sum) * -1);
|
this.paidAmount = this.paidAmount + (parseFloat(current.native_sum) * -1);
|
||||||
}
|
}
|
||||||
|
if (!current.converted) {
|
||||||
|
this.paidAmount = this.paidAmount + (parseFloat(current.sum) * -1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -101,17 +101,20 @@ export default {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
const hasNative = current.native_id !== current.id && current.native_sum !== '0';
|
const hasNative = current.converted && current.native_id !== current.id && parseFloat(current.native_sum) !== 0.0;
|
||||||
if (hasNative || current.native_id === current.id) {
|
if (current.converted && (hasNative || current.native_id === current.id)) {
|
||||||
this.primary = this.primary + parseFloat(current.native_sum);
|
this.primary = this.primary + parseFloat(current.native_sum);
|
||||||
}
|
}
|
||||||
|
if (!current.converted) {
|
||||||
|
this.primary = this.primary + parseFloat(current.sum);
|
||||||
|
}
|
||||||
|
|
||||||
this.netWorth.push(
|
this.netWorth.push(
|
||||||
{
|
{
|
||||||
sum: current.sum,
|
sum: current.sum,
|
||||||
code: current.code,
|
code: current.code,
|
||||||
native_sum: current.native_sum,
|
native_sum: current.converted ? current.native_sum : current.sum,
|
||||||
native_code: current.native_code,
|
native_code: current.converted ? current.native_code : current.code,
|
||||||
native: hasNative,
|
native: hasNative,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -131,19 +131,22 @@ export default {
|
|||||||
for (let i in data) {
|
for (let i in data) {
|
||||||
if (data.hasOwnProperty(i)) {
|
if (data.hasOwnProperty(i)) {
|
||||||
const current = data[i];
|
const current = data[i];
|
||||||
const hasNative = current.native_id !== current.id && parseFloat(current.native_sum) !== 0.0;
|
const hasNative = current.converted && current.native_id !== current.id && parseFloat(current.native_sum) !== 0.0;
|
||||||
this.budgeted.push(
|
this.budgeted.push(
|
||||||
{
|
{
|
||||||
sum: current.sum,
|
sum: current.sum,
|
||||||
code: current.code,
|
code: current.code,
|
||||||
native_sum: current.native_sum,
|
native_sum: current.converted ? current.native_sum : current.sum,
|
||||||
native_code: current.native_code,
|
native_code: current.converted ? current.native_code : current.code,
|
||||||
native: hasNative
|
native: hasNative
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
if (hasNative || current.native_id === current.id) {
|
if (current.converted && (hasNative || current.native_id === current.id)) {
|
||||||
this.budgetedAmount = this.budgetedAmount + parseFloat(current.native_sum);
|
this.budgetedAmount = this.budgetedAmount + parseFloat(current.native_sum);
|
||||||
}
|
}
|
||||||
|
if (!current.converted) {
|
||||||
|
this.budgetedAmount = this.budgetedAmount + parseFloat(current.sum);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -151,19 +154,22 @@ export default {
|
|||||||
for (let i in data) {
|
for (let i in data) {
|
||||||
if (data.hasOwnProperty(i)) {
|
if (data.hasOwnProperty(i)) {
|
||||||
const current = data[i];
|
const current = data[i];
|
||||||
const hasNative = current.native_id !== current.id && parseFloat(current.native_sum) !== 0.0;
|
const hasNative = current.converted && current.native_id !== current.id && parseFloat(current.native_sum) !== 0.0;
|
||||||
this.spent.push(
|
this.spent.push(
|
||||||
{
|
{
|
||||||
sum: current.sum,
|
sum: current.sum,
|
||||||
code: current.code,
|
code: current.code,
|
||||||
native_sum: current.native_sum,
|
native_sum: current.converted ? current.native_sum : current.sum,
|
||||||
native_code: current.native_code,
|
native_code: current.converted ? current.native_code : current.code,
|
||||||
native: hasNative
|
native: hasNative
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
if (hasNative || current.native_id === current.id) {
|
if (current.converted && (hasNative || current.native_id === current.id)) {
|
||||||
this.spentAmount = this.spentAmount + (parseFloat(current.native_sum) * -1);
|
this.spentAmount = this.spentAmount + (parseFloat(current.native_sum) * -1);
|
||||||
}
|
}
|
||||||
|
if (!current.converted) {
|
||||||
|
this.spentAmount = this.spentAmount + (parseFloat(current.sum) * -1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ export default {
|
|||||||
name: "Dashboard",
|
name: "Dashboard",
|
||||||
components: {
|
components: {
|
||||||
AccountChart: defineAsyncComponent(() => import('../../components/dashboard/AccountChart.vue')),
|
AccountChart: defineAsyncComponent(() => import('../../components/dashboard/AccountChart.vue')),
|
||||||
NetWorthInsightBox: defineAsyncComponent(() => import('../../components/dashboard/BillInsightBox.vue')),
|
NetWorthInsightBox: defineAsyncComponent(() => import('../../components/dashboard/NetWorthInsightBox.vue')),
|
||||||
BillInsightBox: defineAsyncComponent(() => import('../../components/dashboard/BillInsightBox.vue')),
|
BillInsightBox: defineAsyncComponent(() => import('../../components/dashboard/BillInsightBox.vue')),
|
||||||
SpendInsightBox: defineAsyncComponent(() => import('../../components/dashboard/SpendInsightBox.vue')),
|
SpendInsightBox: defineAsyncComponent(() => import('../../components/dashboard/SpendInsightBox.vue')),
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user