mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-20 03:08:11 +00:00
This commit is contained in:
@@ -31,8 +31,6 @@
|
|||||||
<span v-if="budgetLimit.pctGreen > 35">
|
<span v-if="budgetLimit.pctGreen > 35">
|
||||||
{{ $t('firefly.spent_x_of_y', {amount: Intl.NumberFormat(locale, {style: 'currency', currency: budgetLimit.currency_code}).format(budgetLimit.spent), total: Intl.NumberFormat(locale, {style: 'currency', currency: budgetLimit.currency_code}).format(budgetLimit.amount)}) }}
|
{{ $t('firefly.spent_x_of_y', {amount: Intl.NumberFormat(locale, {style: 'currency', currency: budgetLimit.currency_code}).format(budgetLimit.spent), total: Intl.NumberFormat(locale, {style: 'currency', currency: budgetLimit.currency_code}).format(budgetLimit.amount)}) }}
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div :aria-valuenow="budgetLimit.pctOrange" :style="'width: '+ budgetLimit.pctOrange + '%;'"
|
<div :aria-valuenow="budgetLimit.pctOrange" :style="'width: '+ budgetLimit.pctOrange + '%;'"
|
||||||
|
@@ -214,26 +214,31 @@ export default {
|
|||||||
let pctGreen = 0;
|
let pctGreen = 0;
|
||||||
let pctOrange = 0;
|
let pctOrange = 0;
|
||||||
let pctRed = 0;
|
let pctRed = 0;
|
||||||
console.log('Collected "' + period + '" budget limit #' + currentId + ' (part of budget #' + budgetId + ')');
|
//console.log('Collected "' + period + '" budget limit #' + currentId + ' (part of budget #' + budgetId + ')');
|
||||||
console.log('Spent ' + spentFloatPos + ' of ' + amount);
|
console.log('Spent ' + spentFloatPos + ' of ' + amount);
|
||||||
|
|
||||||
// remove budget info from rawBudgets if it's there:
|
// remove budget info from rawBudgets if it's there:
|
||||||
this.filterBudgets(budgetId, currencyId);
|
this.filterBudgets(budgetId, currencyId);
|
||||||
|
let name = this.budgets[current.attributes.budget_id].name;
|
||||||
// spent within budget:
|
// spent within budget:
|
||||||
if (0.0 !== spentFloat && spentFloatPos < amount) {
|
if (0.0 !== spentFloat && spentFloatPos < amount) {
|
||||||
|
console.log('Spent ' + name + ' in budget');
|
||||||
pctGreen = (spentFloatPos / amount) * 100;
|
pctGreen = (spentFloatPos / amount) * 100;
|
||||||
|
console.log('pctGreen is ' + pctGreen);
|
||||||
}
|
}
|
||||||
|
|
||||||
// spent over budget
|
// spent over budget
|
||||||
if (0.0 !== spentFloatPos && spentFloatPos > amount) {
|
if (0.0 !== spentFloatPos && spentFloatPos > amount) {
|
||||||
pctOrange = (spentFloatPos / amount) * 100;
|
//console.log('Spent ' + name + ' OVER budget');
|
||||||
|
pctOrange = (amount / spentFloatPos) * 100;
|
||||||
pctRed = 100 - pctOrange;
|
pctRed = 100 - pctOrange;
|
||||||
|
//console.log('orange is ' + pctOrange);
|
||||||
|
//console.log('red is ' + pctRed);
|
||||||
}
|
}
|
||||||
// spent exactly on budget
|
// spent exactly on budget
|
||||||
if (0.0 !== spentFloatPos && spentFloatPos === amount) {
|
if (0.0 !== spentFloatPos && spentFloatPos === amount) {
|
||||||
pctOrange = 0;
|
pctOrange = 100;
|
||||||
pctRed = 100;
|
pctRed = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
let obj = {
|
let obj = {
|
||||||
|
Reference in New Issue
Block a user