mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 23:45:10 +00:00
Fix #10180
This commit is contained in:
@@ -62,6 +62,7 @@ function drawChart() {
|
||||
// net worth
|
||||
var net_worth = [];
|
||||
var keepGreen = false;
|
||||
var makeBlue = false;
|
||||
|
||||
for (key in data) {
|
||||
// balance
|
||||
@@ -80,17 +81,14 @@ function drawChart() {
|
||||
|
||||
// left to spend
|
||||
if (key.substring(0, 17) === 'left-to-spend-in-') {
|
||||
left_to_spend_top.push(data[key].value_parsed);
|
||||
left_to_spend_bottom.push(data[key].sub_title);
|
||||
if(true === data[key].no_available_budgets) {
|
||||
left_to_spend_top.push('---');
|
||||
left_to_spend_bottom.push('---');
|
||||
keepGreen = true;
|
||||
makeBlue = true;
|
||||
$('#box-left-to-spend-text').text(data[key].title);
|
||||
}
|
||||
if(false === data[key].no_available_budgets) {
|
||||
left_to_spend_top.push(data[key].value_parsed);
|
||||
left_to_spend_bottom.push(data[key].sub_title);
|
||||
if (parseFloat(data[key].monetary_value) > 0) {
|
||||
keepGreen = true;
|
||||
}
|
||||
if(false === data[key].no_available_budgets && parseFloat(data[key].monetary_value) > 0) {
|
||||
keepGreen = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -102,6 +100,9 @@ function drawChart() {
|
||||
if(!keepGreen) {
|
||||
$('#box-left-to-spend-box').removeClass('bg-green-gradient').addClass('bg-red-gradient')
|
||||
}
|
||||
if(makeBlue) {
|
||||
$('#box-left-to-spend-box').removeClass('bg-red-gradient').removeClass('bg-green-gradient').addClass('bg-blue-gradient')
|
||||
}
|
||||
|
||||
// balance
|
||||
$('#box-balance-sums').html(balance_top.join(', '));
|
||||
|
Reference in New Issue
Block a user