mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-10 14:44:26 +00:00
Fix #9803
This commit is contained in:
@@ -39,6 +39,7 @@ function drawChart() {
|
||||
columnChart(accountExpenseUrl, 'expense-accounts-chart');
|
||||
columnChart(accountRevenueUrl, 'revenue-accounts-chart');
|
||||
getPiggyBanks();
|
||||
console.log('Get all boxes');
|
||||
getAllBoxes();
|
||||
|
||||
function getAllBoxes() {
|
||||
@@ -60,7 +61,7 @@ function drawChart() {
|
||||
|
||||
// net worth
|
||||
var net_worth = [];
|
||||
|
||||
var keepGreen = false;
|
||||
|
||||
for (key in data) {
|
||||
// balance
|
||||
@@ -81,8 +82,8 @@ function drawChart() {
|
||||
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(parseFloat(data[key].monetary_value) < 0) {
|
||||
$('#box-left-to-spend-box').removeClass('bg-green-gradient').addClass('bg-red-gradient');
|
||||
if (parseFloat(data[key].monetary_value) > 0) {
|
||||
keepGreen = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -91,6 +92,9 @@ function drawChart() {
|
||||
net_worth.push(data[key].value_parsed);
|
||||
}
|
||||
}
|
||||
if(!keepGreen) {
|
||||
$('#box-left-to-spend-box').removeClass('bg-green-gradient').addClass('bg-red-gradient')
|
||||
}
|
||||
|
||||
// balance
|
||||
$('#box-balance-sums').html(balance_top.join(', '));
|
||||
|
Reference in New Issue
Block a user