Build some extra features for the recurring transaction controller.

This commit is contained in:
James Cole
2014-08-21 15:15:39 +02:00
parent b5a706152d
commit fdba0addb6
7 changed files with 56 additions and 25 deletions

View File

@@ -50,26 +50,6 @@ class RecurringTransaction extends Ardent
'skip' => 'required|between:0,31',
];
/**
* @return array
*/
public static function factory()
{
$date = new Carbon;
return [
'user_id' => 'factory|User',
'name' => 'string',
'match' => 'string',
'amount_max' => 100,
'amount_min' => 50,
'date' => $date,
'active' => 1,
'automatch' => 1,
'repeat_freq' => 'monthly',
'skip' => 0,
];
}
/**
* @return array
@@ -99,7 +79,7 @@ class RecurringTransaction extends Ardent
$start->addMonths($skip);
break;
case 'quarterly':
$start->addMonths($skip);
$start->addMonths($skip * 3);
break;
case 'half-year':
$start->addMonths($skip * 6);