mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Fix for #185
This commit is contained in:
parent
919aa70251
commit
a0fd4b505a
@ -107,8 +107,8 @@ class NewUserController extends Controller
|
|||||||
$creditCard = $repository->store($creditAccount);
|
$creditCard = $repository->store($creditAccount);
|
||||||
|
|
||||||
// store meta for CC:
|
// store meta for CC:
|
||||||
AccountMeta::create(['name' => 'ccType', 'data' => 'monthlyFull', 'account_id' => $creditCard->id,]);
|
$repository->storeMeta($creditCard, 'ccType', 'monthlyFull');
|
||||||
AccountMeta::create(['name' => 'ccMonthlyPaymentDate', 'data' => Carbon::now()->year . '-01-01', 'account_id' => $creditCard->id,]);
|
$repository->storeMeta($creditCard, 'ccMonthlyPaymentDate', Carbon::now()->year . '-01-01');
|
||||||
|
|
||||||
}
|
}
|
||||||
Session::flash('success', 'New account(s) created!');
|
Session::flash('success', 'New account(s) created!');
|
||||||
|
@ -413,6 +413,18 @@ class AccountRepository implements AccountRepositoryInterface
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param $account
|
||||||
|
* @param $name
|
||||||
|
* @param $value
|
||||||
|
*
|
||||||
|
* @return AccountMeta
|
||||||
|
*/
|
||||||
|
public function storeMeta($account, $name, $value): AccountMeta
|
||||||
|
{
|
||||||
|
return AccountMeta::create(['name' => $name, 'data' => $value, 'account_id' => $account->id,]);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
|
@ -5,6 +5,7 @@ namespace FireflyIII\Repositories\Account;
|
|||||||
|
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
use FireflyIII\Models\Account;
|
use FireflyIII\Models\Account;
|
||||||
|
use FireflyIII\Models\AccountMeta;
|
||||||
use FireflyIII\Models\Preference;
|
use FireflyIII\Models\Preference;
|
||||||
use FireflyIII\Models\Transaction;
|
use FireflyIII\Models\Transaction;
|
||||||
use FireflyIII\Models\TransactionJournal;
|
use FireflyIII\Models\TransactionJournal;
|
||||||
@ -138,6 +139,15 @@ interface AccountRepositoryInterface
|
|||||||
*/
|
*/
|
||||||
public function store(array $data) : Account;
|
public function store(array $data) : Account;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param $account
|
||||||
|
* @param $name
|
||||||
|
* @param $value
|
||||||
|
*
|
||||||
|
* @return AccountMeta
|
||||||
|
*/
|
||||||
|
public function storeMeta($account, $name, $value): AccountMeta;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user