mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-15 08:35:00 +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)
|
public function firstExpenseAccountOrCreate($name)
|
||||||
{
|
{
|
||||||
/** @var \FireflyIII\Database\AccountType\AccountType $accountTypeRepos */
|
/** @var \FireflyIII\Database\AccountType\AccountType $accountTypeRepository */
|
||||||
$accountTypeRepos = \App::make('FireflyIII\Database\AccountType\AccountType');
|
$accountTypeRepository = \App::make('FireflyIII\Database\AccountType\AccountType');
|
||||||
|
|
||||||
$accountType = $accountTypeRepos->findByWhat('expense');
|
$accountType = $accountTypeRepository->findByWhat('expense');
|
||||||
|
|
||||||
// if name is "", find cash account:
|
// if name is "", find cash account:
|
||||||
if (strlen($name) == 0) {
|
if (strlen($name) == 0) {
|
||||||
$cashAccountType = $accountTypeRepos->findByWhat('cash');
|
$cashAccountType = $accountTypeRepository->findByWhat('cash');
|
||||||
|
|
||||||
// find or create cash account:
|
// find or create cash account:
|
||||||
return \Account::firstOrCreate(
|
return \Account::firstOrCreate(
|
||||||
@@ -543,10 +543,10 @@ class Account implements CUD, CommonDatabaseCalls, AccountInterface
|
|||||||
*/
|
*/
|
||||||
public function firstRevenueAccountOrCreate($name)
|
public function firstRevenueAccountOrCreate($name)
|
||||||
{
|
{
|
||||||
/** @var \FireflyIII\Database\AccountType\AccountType $accountTypeRepos */
|
/** @var \FireflyIII\Database\AccountType\AccountType $accountTypeRepository */
|
||||||
$accountTypeRepos = \App::make('FireflyIII\Database\AccountType\AccountType');
|
$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];
|
$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 \Budget $budget
|
||||||
* @param Carbon $date
|
* @param Carbon $date
|
||||||
|
@@ -94,6 +94,7 @@ class TransactionCurrency implements TransactionCurrencyInterface, CommonDatabas
|
|||||||
* Returns an object with id $id.
|
* Returns an object with id $id.
|
||||||
*
|
*
|
||||||
* @param int $objectId
|
* @param int $objectId
|
||||||
|
* @throws NotImplementedException
|
||||||
*
|
*
|
||||||
* @return \Eloquent
|
* @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.
|
* Finds an account type using one of the "$what"'s: expense, asset, revenue, opening, etc.
|
||||||
*
|
*
|
||||||
* @param $what
|
* @param $what
|
||||||
|
* @throws NotImplementedException
|
||||||
*
|
*
|
||||||
* @return \AccountType|null
|
* @return \AccountType|null
|
||||||
*/
|
*/
|
||||||
@@ -128,6 +130,7 @@ class TransactionCurrency implements TransactionCurrencyInterface, CommonDatabas
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param array $objectIds
|
* @param array $objectIds
|
||||||
|
* @throws NotImplementedException
|
||||||
*
|
*
|
||||||
* @return Collection
|
* @return Collection
|
||||||
*/
|
*/
|
||||||
|
@@ -590,8 +590,8 @@ class TransactionJournal implements TransactionJournalInterface, CUD, CommonData
|
|||||||
// get already related transactions:
|
// get already related transactions:
|
||||||
$exclude = [$journal->id];
|
$exclude = [$journal->id];
|
||||||
foreach ($journal->transactiongroups()->get() as $group) {
|
foreach ($journal->transactiongroups()->get() as $group) {
|
||||||
foreach ($group->transactionjournals() as $jrnl) {
|
foreach ($group->transactionjournals() as $current) {
|
||||||
$exclude[] = $jrnl->id;
|
$exclude[] = $current->id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$exclude = array_unique($exclude);
|
$exclude = array_unique($exclude);
|
||||||
|
@@ -203,7 +203,7 @@ class PiggyBank
|
|||||||
$repetition->currentamount = 0;
|
$repetition->currentamount = 0;
|
||||||
$repetition->save();
|
$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;
|
$currentTarget = clone $target;
|
||||||
$currentStart = null;
|
$currentStart = null;
|
||||||
|
@@ -34,6 +34,7 @@ class Report implements ReportInterface
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param AccountRepository $accounts
|
* @param AccountRepository $accounts
|
||||||
|
* @param JournalRepository $journals
|
||||||
*/
|
*/
|
||||||
public function __construct(AccountRepository $accounts, 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,
|
* 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
|
* @param Collection $collection
|
||||||
*
|
*
|
||||||
|
@@ -25,7 +25,7 @@ interface ReportHelperInterface
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Turns a collection into an array. Needs the field 'id' for the key,
|
* 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
|
* @param Collection $collection
|
||||||
*
|
*
|
||||||
|
@@ -55,7 +55,7 @@ class Navigation
|
|||||||
$start = \Session::get('start', Carbon::now()->startOfMonth());
|
$start = \Session::get('start', Carbon::now()->startOfMonth());
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Substract some period to $start.
|
* Subtract some period to $start.
|
||||||
*/
|
*/
|
||||||
$prev = $filter->previous($range, clone $start);
|
$prev = $filter->previous($range, clone $start);
|
||||||
|
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
use Illuminate\Database\Eloquent\Model as Eloquent;
|
use Illuminate\Database\Eloquent\Model as Eloquent;
|
||||||
|
use Illuminate\Database\Eloquent\SoftDeletingTrait;
|
||||||
use Watson\Validating\ValidatingTrait;
|
use Watson\Validating\ValidatingTrait;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -8,7 +9,7 @@ use Watson\Validating\ValidatingTrait;
|
|||||||
*/
|
*/
|
||||||
class PiggyBank extends Eloquent
|
class PiggyBank extends Eloquent
|
||||||
{
|
{
|
||||||
use ValidatingTrait;
|
use ValidatingTrait, SoftDeletingTrait;
|
||||||
public $fillable
|
public $fillable
|
||||||
= ['account_id', 'name', 'targetamount', 'startdate', 'targetdate', 'repeats', 'rep_length', 'rep_every', 'rep_times', 'reminder', 'reminder_skip',
|
= ['account_id', 'name', 'targetamount', 'startdate', 'targetdate', 'repeats', 'rep_length', 'rep_every', 'rep_times', 'reminder', 'reminder_skip',
|
||||||
'remind_me', 'order'];
|
'remind_me', 'order'];
|
||||||
|
Reference in New Issue
Block a user