mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-12-18 20:38:57 +00:00
Some cleaning up. About to release 3.2.1
This commit is contained in:
@@ -14,13 +14,10 @@ class PiggybankPart
|
||||
{
|
||||
/** @var float */
|
||||
public $amountPerBar;
|
||||
|
||||
/** @var float */
|
||||
public $currentamount;
|
||||
|
||||
/** @var float */
|
||||
public $cumulativeAmount;
|
||||
|
||||
/** @var float */
|
||||
public $currentamount;
|
||||
/** @var \Reminder */
|
||||
public $reminder;
|
||||
|
||||
@@ -38,11 +35,12 @@ class PiggybankPart
|
||||
*/
|
||||
public function getReminder()
|
||||
{
|
||||
if(is_null($this->reminder)) {
|
||||
if (is_null($this->reminder)) {
|
||||
$this->reminder = $this->repetition->piggybank->reminders()->where('startdate', $bar->getStartdate()->format('Y-m-d'))->where(
|
||||
'enddate', $bar->getTargetdate()->format('Y-m-d')
|
||||
)->first();
|
||||
}
|
||||
|
||||
return $this->reminder;
|
||||
}
|
||||
|
||||
@@ -145,22 +143,6 @@ class PiggybankPart
|
||||
$this->currentamount = $currentamount;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return float
|
||||
*/
|
||||
public function getAmountPerBar()
|
||||
{
|
||||
return $this->amountPerBar;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param float $amountPerBar
|
||||
*/
|
||||
public function setAmountPerBar($amountPerBar)
|
||||
{
|
||||
$this->amountPerBar = $amountPerBar;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return float
|
||||
*/
|
||||
@@ -177,7 +159,21 @@ class PiggybankPart
|
||||
$this->cumulativeAmount = $cumulativeAmount;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return float
|
||||
*/
|
||||
public function getAmountPerBar()
|
||||
{
|
||||
return $this->amountPerBar;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param float $amountPerBar
|
||||
*/
|
||||
public function setAmountPerBar($amountPerBar)
|
||||
{
|
||||
$this->amountPerBar = $amountPerBar;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -223,28 +223,28 @@ class Account implements CUD, CommonDatabaseCalls, AccountInterface
|
||||
// delete journals:
|
||||
\TransactionJournal::whereIn(
|
||||
'id', function ($query) use ($model) {
|
||||
$query->select('transaction_journal_id')
|
||||
->from('transactions')->whereIn(
|
||||
'account_id', function ($query) use ($model) {
|
||||
$query
|
||||
->select('id')
|
||||
->from('accounts')
|
||||
->where(
|
||||
$query->select('transaction_journal_id')
|
||||
->from('transactions')->whereIn(
|
||||
'account_id', function ($query) use ($model) {
|
||||
$query
|
||||
->select('id')
|
||||
->from('accounts')
|
||||
->where(
|
||||
function ($q) use ($model) {
|
||||
$q->where('id', $model->id);
|
||||
$q->orWhere(
|
||||
function ($q) use ($model) {
|
||||
$q->where('id', $model->id);
|
||||
$q->orWhere(
|
||||
function ($q) use ($model) {
|
||||
$q->where('accounts.name', 'LIKE', '%' . $model->name . '%');
|
||||
// TODO magic number!
|
||||
$q->where('accounts.account_type_id', 3);
|
||||
$q->where('accounts.active', 0);
|
||||
}
|
||||
);
|
||||
$q->where('accounts.name', 'LIKE', '%' . $model->name . '%');
|
||||
// TODO magic number!
|
||||
$q->where('accounts.account_type_id', 3);
|
||||
$q->where('accounts.active', 0);
|
||||
}
|
||||
)->where('accounts.user_id', $this->getUser()->id);
|
||||
}
|
||||
)->get();
|
||||
}
|
||||
);
|
||||
}
|
||||
)->where('accounts.user_id', $this->getUser()->id);
|
||||
}
|
||||
)->get();
|
||||
}
|
||||
)->delete();
|
||||
|
||||
/*
|
||||
|
||||
@@ -87,6 +87,12 @@ class PiggyBank implements CUD, CommonDatabaseCalls, PiggyBankInterface
|
||||
* Validates an array. Returns an array containing MessageBags
|
||||
* errors/warnings/successes.
|
||||
*
|
||||
* Ignore PHPMD rules because Laravel 5.0 will make this method superfluous anyway.
|
||||
*
|
||||
* @SuppressWarnings("Cyclomatic")
|
||||
* @SuppressWarnings("NPath")
|
||||
* @SuppressWarnings("MethodLength")
|
||||
*
|
||||
* @param array $model
|
||||
*
|
||||
* @return array
|
||||
|
||||
@@ -158,6 +158,12 @@ class RepeatedExpense implements CUD, CommonDatabaseCalls, PiggyBankInterface
|
||||
* Validates an array. Returns an array containing MessageBags
|
||||
* errors/warnings/successes.
|
||||
*
|
||||
*
|
||||
* ignored because this method will be gone soon.
|
||||
* @SuppressWarnings("Cyclomatic")
|
||||
* @SuppressWarnings("NPath")
|
||||
* @SuppressWarnings("MethodLength")
|
||||
*
|
||||
* @param array $model
|
||||
*
|
||||
* @return array
|
||||
|
||||
@@ -102,6 +102,11 @@ class RecurringTransaction implements CUD, CommonDatabaseCalls, RecurringTransac
|
||||
* Validates an array. Returns an array containing MessageBags
|
||||
* errors/warnings/successes.
|
||||
*
|
||||
* ignored because this method will be gone soon.
|
||||
* @SuppressWarnings("Cyclomatic")
|
||||
* @SuppressWarnings("NPath")
|
||||
* @SuppressWarnings("MethodLength")
|
||||
*
|
||||
* @param array $model
|
||||
*
|
||||
* @return array
|
||||
|
||||
@@ -194,6 +194,11 @@ class TransactionJournal implements TransactionJournalInterface, CUD, CommonData
|
||||
* Validates an array. Returns an array containing MessageBags
|
||||
* errors/warnings/successes.
|
||||
*
|
||||
* ignored because this method will be gone soon.
|
||||
* @SuppressWarnings("Cyclomatic")
|
||||
* @SuppressWarnings("NPath")
|
||||
* @SuppressWarnings("MethodLength")
|
||||
*
|
||||
* @param array $model
|
||||
*
|
||||
* @return array
|
||||
@@ -614,13 +619,13 @@ class TransactionJournal implements TransactionJournalInterface, CUD, CommonData
|
||||
|
||||
/**
|
||||
* @param \Account $account
|
||||
* @param int $count
|
||||
* @param Carbon $start
|
||||
* @param Carbon $end
|
||||
* @param int $count
|
||||
*
|
||||
* @return Collection
|
||||
*/
|
||||
public function getInDateRangeAccount(\Account $account, $count = 20, Carbon $start, Carbon $end)
|
||||
public function getInDateRangeAccount(\Account $account, Carbon $start, Carbon $end, $count = 20)
|
||||
{
|
||||
|
||||
$accountID = $account->id;
|
||||
|
||||
@@ -15,7 +15,6 @@ class Form
|
||||
* Takes any collection and tries to make a sensible select list compatible array of it.
|
||||
*
|
||||
* @param Collection $set
|
||||
* @param null $titleField
|
||||
* @param bool $addEmpty
|
||||
* @SuppressWarnings("CyclomaticComplexity")
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user