summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2015-03-28 15:44:24 -0400
committerFrederic Guillot <fred@kanboard.net>2015-03-28 15:44:24 -0400
commiteb6853c163e9059bbbc89a1a741d4a25c8e04153 (patch)
treea6ae9c253064cfe1ba5abae27cc2c2d866508af8 /app
parent346309cfcffbaf5e0f4d78a18870420d03ed6bf1 (diff)
Display only relevant data in the budget graph
Diffstat (limited to 'app')
-rw-r--r--app/Model/Budget.php22
1 files changed, 13 insertions, 9 deletions
diff --git a/app/Model/Budget.php b/app/Model/Budget.php
index 84cadf6e..fe8457bd 100644
--- a/app/Model/Budget.php
+++ b/app/Model/Budget.php
@@ -111,15 +111,19 @@ class Budget extends Base
$date = $today->format('Y-m-d');
$today_in = isset($in[$date]) ? (int) $in[$date] : 0;
$today_out = isset($out[$date]) ? (int) $out[$date] : 0;
- $left += $today_in;
- $left -= $today_out;
-
- $serie[] = array(
- 'date' => $date,
- 'in' => $today_in,
- 'out' => -$today_out,
- 'left' => $left,
- );
+
+ if ($today_in > 0 || $today_out > 0) {
+
+ $left += $today_in;
+ $left -= $today_out;
+
+ $serie[] = array(
+ 'date' => $date,
+ 'in' => $today_in,
+ 'out' => -$today_out,
+ 'left' => $left,
+ );
+ }
}
return $serie;