Can now create recurring transactions. #1469

This commit is contained in:
James Cole
2018-06-17 15:14:34 +02:00
parent 54e3e3f051
commit d73cd4b515
25 changed files with 852 additions and 74 deletions

View File

@@ -27,10 +27,12 @@ use Carbon\Carbon;
use Eloquent;
use FireflyIII\Models\Account;
use FireflyIII\Models\AccountType;
use FireflyIII\Models\PiggyBank;
use FireflyIII\Models\RuleGroup;
use FireflyIII\Models\TransactionCurrency;
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface;
use FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface;
use FireflyIII\Repositories\RuleGroup\RuleGroupRepositoryInterface;
use Form;
use Illuminate\Support\Collection;
@@ -183,6 +185,7 @@ class ExpandedForm
*
* @return string
* @throws \FireflyIII\Exceptions\FireflyException
* @throws \Throwable
*/
public function balance(string $name, $value = null, array $options = []): string
{
@@ -506,8 +509,9 @@ class ExpandedForm
* @return string
* @throws \Throwable
*/
public function password(string $name, array $options = []): string
public function password(string $name, array $options = null): string
{
$options = $options ?? [];
$label = $this->label($name, $options);
$options = $this->expandOptionArray($name, $label, $options);
$classes = $this->getHolderClasses($name);
@@ -516,6 +520,30 @@ class ExpandedForm
return $html;
}
/**
* @param string $name
* @param null $value
* @param array $options
*
* @return string
* @throws \Throwable
*/
public function piggyBankList(string $name, $value = null, array $options = null): string
{
$options = $options ?? [];
// make repositories
/** @var PiggyBankRepositoryInterface $repository */
$repository = app(PiggyBankRepositoryInterface::class);
$piggyBanks = $repository->getPiggyBanksWithAmount();
$array = [];
/** @var PiggyBank $piggy */
foreach ($piggyBanks as $piggy) {
$array[$piggy->id] = $piggy->name;
}
return $this->select($name, $array, $value, $options);
}
/**
* @param string $name
* @param null $value