Some visual updates to repeated expenses.

This commit is contained in:
James Cole
2014-11-24 23:02:08 +01:00
parent fd6e7fc1ab
commit e9b7e82aea
4 changed files with 37 additions and 53 deletions

View File

@@ -1,6 +1,7 @@
<?php
namespace FireflyIII\Shared\Toolkit;
use Carbon\Carbon;
/**
@@ -31,4 +32,20 @@ class Steam
);
}
/**
* @param \Piggybank $piggyBank
* @param \PiggybankRepetition $repetition
*
* @return int
*/
public function percentage(\Piggybank $piggyBank, \PiggybankRepetition $repetition)
{
$pct = $repetition->currentamount / $piggyBank->targetamount * 100;
if ($pct > 100) {
return 100;
} else {
return floor($pct);
}
}
}