mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-18 18:44:16 +00:00
This commit is contained in:
@@ -31,8 +31,6 @@
|
||||
<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)}) }}
|
||||
</span>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div :aria-valuenow="budgetLimit.pctOrange" :style="'width: '+ budgetLimit.pctOrange + '%;'"
|
||||
|
@@ -214,26 +214,31 @@ export default {
|
||||
let pctGreen = 0;
|
||||
let pctOrange = 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);
|
||||
|
||||
// remove budget info from rawBudgets if it's there:
|
||||
this.filterBudgets(budgetId, currencyId);
|
||||
|
||||
let name = this.budgets[current.attributes.budget_id].name;
|
||||
// spent within budget:
|
||||
if (0.0 !== spentFloat && spentFloatPos < amount) {
|
||||
console.log('Spent ' + name + ' in budget');
|
||||
pctGreen = (spentFloatPos / amount) * 100;
|
||||
console.log('pctGreen is ' + pctGreen);
|
||||
}
|
||||
|
||||
// spent over budget
|
||||
if (0.0 !== spentFloatPos && spentFloatPos > amount) {
|
||||
pctOrange = (spentFloatPos / amount) * 100;
|
||||
//console.log('Spent ' + name + ' OVER budget');
|
||||
pctOrange = (amount / spentFloatPos) * 100;
|
||||
pctRed = 100 - pctOrange;
|
||||
//console.log('orange is ' + pctOrange);
|
||||
//console.log('red is ' + pctRed);
|
||||
}
|
||||
// spent exactly on budget
|
||||
if (0.0 !== spentFloatPos && spentFloatPos === amount) {
|
||||
pctOrange = 0;
|
||||
pctRed = 100;
|
||||
pctOrange = 100;
|
||||
pctRed = 0;
|
||||
}
|
||||
|
||||
let obj = {
|
||||
|
Reference in New Issue
Block a user