Fixed some bugs in the recurring transaction match.

This commit is contained in:
Sander Dorigo
2014-10-12 08:03:35 +02:00
parent 6a6d889983
commit b4ea1839a5
2 changed files with 23 additions and 9 deletions

View File

@@ -175,6 +175,9 @@ class Toolkit implements ToolkitInterface
{
$end = clone $start;
switch ($range) {
default:
throw new FireflyException('_updateEndDate cannot handle $range ' . $range);
break;
case '1D':
$end->endOfDay();
break;
@@ -197,9 +200,7 @@ class Toolkit implements ToolkitInterface
case '1Y':
$end->endOfYear();
break;
default:
throw new FireflyException('_updateEndDate cannot handle $range ' . $range);
break;
}
return $end;
@@ -241,6 +242,9 @@ class Toolkit implements ToolkitInterface
protected function _previous($range, Carbon $date)
{
switch ($range) {
default:
throw new FireflyException('Cannot do _previous() on ' . $range);
break;
case '1D':
$date->startOfDay()->subDay();
break;
@@ -264,9 +268,7 @@ class Toolkit implements ToolkitInterface
case '1Y':
$date->startOfYear()->subYear();
break;
default:
throw new FireflyException('Cannot do _previous() on ' . $range);
break;
}
return $date;
}