mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-13 16:00:13 +00:00
More spelling checks and small clean ups.
This commit is contained in:
@@ -514,14 +514,14 @@ class Account implements CUD, CommonDatabaseCalls, AccountInterface
|
||||
*/
|
||||
public function firstExpenseAccountOrCreate($name)
|
||||
{
|
||||
/** @var \FireflyIII\Database\AccountType\AccountType $accountTypeRepos */
|
||||
$accountTypeRepos = \App::make('FireflyIII\Database\AccountType\AccountType');
|
||||
/** @var \FireflyIII\Database\AccountType\AccountType $accountTypeRepository */
|
||||
$accountTypeRepository = \App::make('FireflyIII\Database\AccountType\AccountType');
|
||||
|
||||
$accountType = $accountTypeRepos->findByWhat('expense');
|
||||
$accountType = $accountTypeRepository->findByWhat('expense');
|
||||
|
||||
// if name is "", find cash account:
|
||||
if (strlen($name) == 0) {
|
||||
$cashAccountType = $accountTypeRepos->findByWhat('cash');
|
||||
$cashAccountType = $accountTypeRepository->findByWhat('cash');
|
||||
|
||||
// find or create cash account:
|
||||
return \Account::firstOrCreate(
|
||||
@@ -543,10 +543,10 @@ class Account implements CUD, CommonDatabaseCalls, AccountInterface
|
||||
*/
|
||||
public function firstRevenueAccountOrCreate($name)
|
||||
{
|
||||
/** @var \FireflyIII\Database\AccountType\AccountType $accountTypeRepos */
|
||||
$accountTypeRepos = \App::make('FireflyIII\Database\AccountType\AccountType');
|
||||
/** @var \FireflyIII\Database\AccountType\AccountType $accountTypeRepository */
|
||||
$accountTypeRepository = \App::make('FireflyIII\Database\AccountType\AccountType');
|
||||
|
||||
$accountType = $accountTypeRepos->findByWhat('revenue');
|
||||
$accountType = $accountTypeRepository->findByWhat('revenue');
|
||||
|
||||
$data = ['user_id' => $this->getUser()->id, 'account_type_id' => $accountType->id, 'name' => $name, 'active' => 1];
|
||||
|
||||
|
@@ -237,7 +237,7 @@ class Budget implements CUD, CommonDatabaseCalls, BudgetInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* This method includes the time because otherwise, SQLite doesn't understand it.
|
||||
* This method includes the time because otherwise, SQLite does not understand it.
|
||||
*
|
||||
* @param \Budget $budget
|
||||
* @param Carbon $date
|
||||
|
@@ -94,6 +94,7 @@ class TransactionCurrency implements TransactionCurrencyInterface, CommonDatabas
|
||||
* Returns an object with id $id.
|
||||
*
|
||||
* @param int $objectId
|
||||
* @throws NotImplementedException
|
||||
*
|
||||
* @return \Eloquent
|
||||
*/
|
||||
@@ -107,6 +108,7 @@ class TransactionCurrency implements TransactionCurrencyInterface, CommonDatabas
|
||||
* Finds an account type using one of the "$what"'s: expense, asset, revenue, opening, etc.
|
||||
*
|
||||
* @param $what
|
||||
* @throws NotImplementedException
|
||||
*
|
||||
* @return \AccountType|null
|
||||
*/
|
||||
@@ -128,6 +130,7 @@ class TransactionCurrency implements TransactionCurrencyInterface, CommonDatabas
|
||||
|
||||
/**
|
||||
* @param array $objectIds
|
||||
* @throws NotImplementedException
|
||||
*
|
||||
* @return Collection
|
||||
*/
|
||||
|
@@ -590,8 +590,8 @@ class TransactionJournal implements TransactionJournalInterface, CUD, CommonData
|
||||
// get already related transactions:
|
||||
$exclude = [$journal->id];
|
||||
foreach ($journal->transactiongroups()->get() as $group) {
|
||||
foreach ($group->transactionjournals() as $jrnl) {
|
||||
$exclude[] = $jrnl->id;
|
||||
foreach ($group->transactionjournals() as $current) {
|
||||
$exclude[] = $current->id;
|
||||
}
|
||||
}
|
||||
$exclude = array_unique($exclude);
|
||||
|
@@ -203,7 +203,7 @@ class PiggyBank
|
||||
$repetition->currentamount = 0;
|
||||
$repetition->save();
|
||||
}
|
||||
// then continue and do something in the current relevant timeframe.
|
||||
// then continue and do something in the current relevant time frame.
|
||||
|
||||
$currentTarget = clone $target;
|
||||
$currentStart = null;
|
||||
|
@@ -34,6 +34,7 @@ class Report implements ReportInterface
|
||||
|
||||
/**
|
||||
* @param AccountRepository $accounts
|
||||
* @param JournalRepository $journals
|
||||
*/
|
||||
public function __construct(AccountRepository $accounts, JournalRepository $journals)
|
||||
{
|
||||
|
@@ -45,7 +45,7 @@ class ReportHelper implements ReportHelperInterface
|
||||
|
||||
/**
|
||||
* Turns a collection into an array. Needs the field 'id' for the key,
|
||||
* and saves only 'name' and 'amount' as a subarray.
|
||||
* and saves only 'name' and 'amount' as a sub array.
|
||||
*
|
||||
* @param Collection $collection
|
||||
*
|
||||
|
@@ -25,7 +25,7 @@ interface ReportHelperInterface
|
||||
|
||||
/**
|
||||
* Turns a collection into an array. Needs the field 'id' for the key,
|
||||
* and saves 'name', 'amount','spent' (if present) as a subarray.
|
||||
* and saves 'name', 'amount','spent' (if present) as a sub array.
|
||||
*
|
||||
* @param Collection $collection
|
||||
*
|
||||
|
@@ -55,7 +55,7 @@ class Navigation
|
||||
$start = \Session::get('start', Carbon::now()->startOfMonth());
|
||||
|
||||
/*
|
||||
* Substract some period to $start.
|
||||
* Subtract some period to $start.
|
||||
*/
|
||||
$prev = $filter->previous($range, clone $start);
|
||||
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Model as Eloquent;
|
||||
use Illuminate\Database\Eloquent\SoftDeletingTrait;
|
||||
use Watson\Validating\ValidatingTrait;
|
||||
|
||||
/**
|
||||
@@ -8,7 +9,7 @@ use Watson\Validating\ValidatingTrait;
|
||||
*/
|
||||
class PiggyBank extends Eloquent
|
||||
{
|
||||
use ValidatingTrait;
|
||||
use ValidatingTrait, SoftDeletingTrait;
|
||||
public $fillable
|
||||
= ['account_id', 'name', 'targetamount', 'startdate', 'targetdate', 'repeats', 'rep_length', 'rep_every', 'rep_times', 'reminder', 'reminder_skip',
|
||||
'remind_me', 'order'];
|
||||
|
Reference in New Issue
Block a user