mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-06 01:45:22 +00:00
Moved all references.
This commit is contained in:
@@ -495,8 +495,8 @@ class Account implements CUD, CommonDatabaseCalls, AccountInterface
|
||||
*/
|
||||
public function firstExpenseAccountOrCreate($name)
|
||||
{
|
||||
/** @var \FireflyIII\Database\AccountType $accountTypeRepos */
|
||||
$accountTypeRepos = \App::make('FireflyIII\Database\AccountType');
|
||||
/** @var \FireflyIII\Database\AccountType\AccountType $accountTypeRepos */
|
||||
$accountTypeRepos = \App::make('FireflyIII\Database\AccountType\AccountType');
|
||||
|
||||
$accountType = $accountTypeRepos->findByWhat('expense');
|
||||
|
||||
@@ -524,8 +524,8 @@ class Account implements CUD, CommonDatabaseCalls, AccountInterface
|
||||
*/
|
||||
public function firstRevenueAccountOrCreate($name)
|
||||
{
|
||||
/** @var \FireflyIII\Database\AccountType $accountTypeRepos */
|
||||
$accountTypeRepos = \App::make('FireflyIII\Database\AccountType');
|
||||
/** @var \FireflyIII\Database\AccountType\AccountType $accountTypeRepos */
|
||||
$accountTypeRepos = \App::make('FireflyIII\Database\AccountType\AccountType');
|
||||
|
||||
$accountType = $accountTypeRepos->findByWhat('revenue');
|
||||
|
||||
|
||||
@@ -330,7 +330,7 @@ class Budget implements CUD, CommonDatabaseCalls, BudgetInterface
|
||||
$limit = $this->limitOnStartingOnDate($budget, $date);
|
||||
if (!$limit) {
|
||||
// create one!
|
||||
$limit = new \Limit;
|
||||
$limit = new \BudgetLimit;
|
||||
$limit->budget()->associate($budget);
|
||||
$limit->startdate = $date;
|
||||
$limit->amount = $amount;
|
||||
@@ -367,6 +367,6 @@ class Budget implements CUD, CommonDatabaseCalls, BudgetInterface
|
||||
*/
|
||||
public function limitOnStartingOnDate(\Budget $budget, Carbon $date)
|
||||
{
|
||||
return $budget->limits()->where('startdate', $date->format('Y-m-d'))->first();
|
||||
return $budget->budgetLimits()->where('startdate', $date->format('Y-m-d'))->first();
|
||||
}
|
||||
}
|
||||
@@ -321,8 +321,8 @@ class RecurringTransaction implements CUD, CommonDatabaseCalls, RecurringTransac
|
||||
// get all journals that (may) be relevant.
|
||||
// this is usually almost all of them.
|
||||
|
||||
/** @var \FireflyIII\Database\TransactionJournal $journalRepository */
|
||||
$journalRepository = \App::make('FireflyIII\Database\TransactionJournal');
|
||||
/** @var \FireflyIII\Database\TransactionJournal\TransactionJournal $journalRepository */
|
||||
$journalRepository = \App::make('FireflyIII\Database\TransactionJournal\TransactionJournal');
|
||||
|
||||
$set = \DB::table('transactions')->where('amount', '>', 0)->where('amount', '>=', $recurring->amount_min)->where('amount', '<=', $recurring->amount_max)
|
||||
->get(['transaction_journal_id']);
|
||||
|
||||
@@ -62,17 +62,17 @@ class TransactionJournal implements TransactionJournalInterface, CUD, CommonData
|
||||
*/
|
||||
public function store(array $data)
|
||||
{
|
||||
/** @var \FireflyIII\Database\TransactionType $typeRepository */
|
||||
$typeRepository = \App::make('FireflyIII\Database\TransactionType');
|
||||
/** @var \FireflyIII\Database\TransactionType\TransactionType $typeRepository */
|
||||
$typeRepository = \App::make('FireflyIII\Database\TransactionType\TransactionType');
|
||||
|
||||
/** @var \FireflyIII\Database\Account $accountRepository */
|
||||
$accountRepository = \App::make('FireflyIII\Database\Account');
|
||||
/** @var \FireflyIII\Database\Account\Account $accountRepository */
|
||||
$accountRepository = \App::make('FireflyIII\Database\Account\Account');
|
||||
|
||||
/** @var \FireflyIII\Database\TransactionCurrency $currencyRepository */
|
||||
$currencyRepository = \App::make('FireflyIII\Database\TransactionCurrency');
|
||||
/** @var \FireflyIII\Database\TransactionCurrency\TransactionCurrency $currencyRepository */
|
||||
$currencyRepository = \App::make('FireflyIII\Database\TransactionCurrency\TransactionCurrency');
|
||||
|
||||
/** @var \FireflyIII\Database\Transaction $transactionRepository */
|
||||
$transactionRepository = \App::make('FireflyIII\Database\Transaction');
|
||||
/** @var \FireflyIII\Database\Transaction\Transaction $transactionRepository */
|
||||
$transactionRepository = \App::make('FireflyIII\Database\Transaction\Transaction');
|
||||
|
||||
$journalType = $typeRepository->findByWhat($data['what']);
|
||||
$currency = $currencyRepository->findByCode($data['currency']);
|
||||
@@ -143,16 +143,16 @@ class TransactionJournal implements TransactionJournalInterface, CUD, CommonData
|
||||
* Store the budget.
|
||||
*/
|
||||
if (isset($data['budget_id']) && intval($data['budget_id']) > 0) {
|
||||
/** @var \FireflyIII\Database\Budget $budgetRepository */
|
||||
$budgetRepository = \App::make('FireflyIII\Database\Budget');
|
||||
/** @var \FireflyIII\Database\Budget\Budget $budgetRepository */
|
||||
$budgetRepository = \App::make('FireflyIII\Database\Budget\Budget');
|
||||
$budget = $budgetRepository->find(intval($data['budget_id']));
|
||||
if ($budget) {
|
||||
$journal->budgets()->save($budget);
|
||||
}
|
||||
}
|
||||
if (isset($data['category']) && strlen($data['category']) > 0) {
|
||||
/** @var \FireflyIII\Database\Category $categoryRepository */
|
||||
$categoryRepository = \App::make('FireflyIII\Database\Category');
|
||||
/** @var \FireflyIII\Database\Category\Category $categoryRepository */
|
||||
$categoryRepository = \App::make('FireflyIII\Database\Category\Category');
|
||||
$category = $categoryRepository->firstOrCreate($data['category']);
|
||||
if ($category) {
|
||||
$journal->categories()->save($category);
|
||||
@@ -179,14 +179,14 @@ class TransactionJournal implements TransactionJournalInterface, CUD, CommonData
|
||||
*/
|
||||
public function update(\Eloquent $model, array $data)
|
||||
{
|
||||
/** @var \FireflyIII\Database\TransactionType $typeRepository */
|
||||
$typeRepository = \App::make('FireflyIII\Database\TransactionType');
|
||||
/** @var \FireflyIII\Database\TransactionType\TransactionType $typeRepository */
|
||||
$typeRepository = \App::make('FireflyIII\Database\TransactionType\TransactionType');
|
||||
|
||||
/** @var \FireflyIII\Database\Account $accountRepository */
|
||||
$accountRepository = \App::make('FireflyIII\Database\Account');
|
||||
/** @var \FireflyIII\Database\Account\Account $accountRepository */
|
||||
$accountRepository = \App::make('FireflyIII\Database\Account\Account');
|
||||
|
||||
/** @var \FireflyIII\Database\TransactionCurrency $currencyRepository */
|
||||
$currencyRepository = \App::make('FireflyIII\Database\TransactionCurrency');
|
||||
/** @var \FireflyIII\Database\TransactionCurrency\TransactionCurrency $currencyRepository */
|
||||
$currencyRepository = \App::make('FireflyIII\Database\TransactionCurrency\TransactionCurrency');
|
||||
|
||||
$journalType = $typeRepository->findByWhat($data['what']);
|
||||
$currency = $currencyRepository->findByCode($data['currency']);
|
||||
@@ -236,16 +236,16 @@ class TransactionJournal implements TransactionJournalInterface, CUD, CommonData
|
||||
*/
|
||||
$components = [];
|
||||
if (isset($data['budget_id']) && intval($data['budget_id']) > 0) {
|
||||
/** @var \FireflyIII\Database\Budget $budgetRepository */
|
||||
$budgetRepository = \App::make('FireflyIII\Database\Budget');
|
||||
/** @var \FireflyIII\Database\Budget\Budget $budgetRepository */
|
||||
$budgetRepository = \App::make('FireflyIII\Database\Budget\Budget');
|
||||
$budget = $budgetRepository->find(intval($data['budget_id']));
|
||||
if ($budget) {
|
||||
$components[] = $budget->id;
|
||||
}
|
||||
}
|
||||
if (strlen($data['category']) > 0) {
|
||||
/** @var \FireflyIII\Database\Category $categoryRepository */
|
||||
$categoryRepository = \App::make('FireflyIII\Database\Category');
|
||||
/** @var \FireflyIII\Database\Category\Category $categoryRepository */
|
||||
$categoryRepository = \App::make('FireflyIII\Database\Category\Category');
|
||||
$category = $categoryRepository->firstOrCreate($data['category']);
|
||||
if ($category) {
|
||||
$components[] = $category->id;
|
||||
|
||||
@@ -43,8 +43,8 @@ class Piggybank
|
||||
{
|
||||
if ($journal->piggybankevents()->count() > 0) {
|
||||
|
||||
/** @var \FireflyIII\Database\Piggybank $repository */
|
||||
$repository = \App::make('FireflyIII\Database\Piggybank');
|
||||
/** @var \FireflyIII\Database\PiggyBank\PiggyBank $repository */
|
||||
$repository = \App::make('FireflyIII\Database\PiggyBank\PiggyBank');
|
||||
|
||||
/** @var \Piggybank $piggyBank */
|
||||
$piggyBank = $journal->piggybankevents()->first()->piggybank()->first();
|
||||
@@ -127,8 +127,8 @@ class Piggybank
|
||||
if ($piggybankId == 0 || is_null($piggybankId)) {
|
||||
return;
|
||||
}
|
||||
/** @var \FireflyIII\Database\Piggybank $repository */
|
||||
$repository = \App::make('FireflyIII\Database\Piggybank');
|
||||
/** @var \FireflyIII\Database\PiggyBank\PiggyBank $repository */
|
||||
$repository = \App::make('FireflyIII\Database\PiggyBank\PiggyBank');
|
||||
|
||||
/** @var \Piggybank $piggyBank */
|
||||
$piggyBank = $repository->find($piggybankId);
|
||||
@@ -222,8 +222,8 @@ class Piggybank
|
||||
if(!\Auth::check()) {
|
||||
return;
|
||||
}
|
||||
/** @var \FireflyIII\Database\RepeatedExpense $repository */
|
||||
$repository = \App::make('FireflyIII\Database\RepeatedExpense');
|
||||
/** @var \FireflyIII\Database\PiggyBank\RepeatedExpense $repository */
|
||||
$repository = \App::make('FireflyIII\Database\PiggyBank\RepeatedExpense');
|
||||
|
||||
$list = $repository->get();
|
||||
$today = Carbon::now();
|
||||
@@ -290,8 +290,8 @@ class Piggybank
|
||||
$event = $journal->piggybankevents()->orderBy('date', 'DESC')->orderBy('id', 'DESC')->first();
|
||||
$eventSum = floatval($journal->piggybankevents()->orderBy('date', 'DESC')->orderBy('id', 'DESC')->sum('amount'));
|
||||
|
||||
/** @var \FireflyIII\Database\Piggybank $repository */
|
||||
$repository = \App::make('FireflyIII\Database\Piggybank');
|
||||
/** @var \FireflyIII\Database\PiggyBank\PiggyBank $repository */
|
||||
$repository = \App::make('FireflyIII\Database\PiggyBank\PiggyBank');
|
||||
|
||||
/** @var \Piggybank $piggyBank */
|
||||
$piggyBank = $journal->piggybankevents()->first()->piggybank()->first();
|
||||
|
||||
@@ -18,8 +18,8 @@ class TransactionJournal
|
||||
*/
|
||||
public function store(\TransactionJournal $journal)
|
||||
{
|
||||
/** @var \FireflyIII\Database\Recurring $repository */
|
||||
$repository = \App::make('FireflyIII\Database\Recurring');
|
||||
/** @var \FireflyIII\Database\RecurringTransaction\RecurringTransaction $repository */
|
||||
$repository = \App::make('FireflyIII\Database\RecurringTransaction\RecurringTransaction');
|
||||
$set = $repository->get();
|
||||
|
||||
|
||||
@@ -44,8 +44,8 @@ class TransactionJournal
|
||||
*/
|
||||
public function update(\TransactionJournal $journal)
|
||||
{
|
||||
/** @var \FireflyIII\Database\Recurring $repository */
|
||||
$repository = \App::make('FireflyIII\Database\Recurring');
|
||||
/** @var \FireflyIII\Database\RecurringTransaction\RecurringTransaction $repository */
|
||||
$repository = \App::make('FireflyIII\Database\RecurringTransaction\RecurringTransaction');
|
||||
$set = $repository->get();
|
||||
$journal->recurring_transaction_id = null;
|
||||
$journal->save();
|
||||
|
||||
@@ -297,7 +297,7 @@ class Form
|
||||
case 'update':
|
||||
$store = '<div class="form-group"><label for="' . $name . 'update" class="col-sm-4 control-label">Store</label>';
|
||||
$store .= '<div class="col-sm-8"><div class="radio"><label>';
|
||||
$store .= \Form::radio('post_submit_action', 'update', $previousValue == 'update', ['id' => $name . '_update']);
|
||||
$store .= \Form::radio('post_submit_action', 'update', $previousValue == 'update' || $previousValue == 'store', ['id' => $name . '_update']);
|
||||
$store .= 'Update ' . $name . '</label></div></div></div>';
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace FireflyIII\Report;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Database\Account\Account as AccountRepository;
|
||||
use FireflyIII\Database\SwitchUser;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
// todo add methods to itnerface
|
||||
@@ -17,6 +18,9 @@ use Illuminate\Support\Collection;
|
||||
*/
|
||||
class Report implements ReportInterface
|
||||
{
|
||||
|
||||
use SwitchUser;
|
||||
|
||||
/** @var AccountRepository */
|
||||
protected $_accounts;
|
||||
|
||||
@@ -198,7 +202,6 @@ class Report implements ReportInterface
|
||||
return $report;
|
||||
}
|
||||
|
||||
use SwitchUser;
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -68,11 +68,11 @@ class Reminders
|
||||
/*
|
||||
* Reminder capable objects are (so far) only piggy banks.
|
||||
*/
|
||||
/** @var \FireflyIII\Database\Piggybank $repository */
|
||||
$repository = \App::make('FireflyIII\Database\Piggybank');
|
||||
/** @var \FireflyIII\Database\PiggyBank\PiggyBank $repository */
|
||||
$repository = \App::make('FireflyIII\Database\PiggyBank\PiggyBank');
|
||||
|
||||
/** @var \FireflyIII\Database\Piggybank $repeatedRepository */
|
||||
$repeatedRepository = \App::make('FireflyIII\Database\RepeatedExpense');
|
||||
/** @var \FireflyIII\Database\PiggyBank\RepeatedExpense $repeatedRepository */
|
||||
$repeatedRepository = \App::make('FireflyIII\Database\PiggyBank\RepeatedExpense');
|
||||
|
||||
/** @var Collection $piggybanks */
|
||||
$piggybanks = $repository->get()->merge($repeatedRepository->get());
|
||||
|
||||
Reference in New Issue
Block a user