mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-12-18 20:38:57 +00:00
Code cleanup.
This commit is contained in:
@@ -5,6 +5,11 @@ namespace FireflyIII\Collection;
|
||||
|
||||
use Carbon\Carbon;
|
||||
|
||||
/**
|
||||
* Class PiggybankPart
|
||||
*
|
||||
* @package FireflyIII\Collection
|
||||
*/
|
||||
class PiggybankPart
|
||||
{
|
||||
/** @var float */
|
||||
@@ -92,11 +97,17 @@ class PiggybankPart
|
||||
$this->targetdate = $targetdate;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function hasReminder()
|
||||
{
|
||||
return !is_null($this->reminder);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return float|int
|
||||
*/
|
||||
public function percentage()
|
||||
{
|
||||
if ($this->getCurrentamount() < $this->getCumulativeAmount()) {
|
||||
|
||||
@@ -221,7 +221,7 @@ class Account implements CUD, CommonDatabaseCalls, AccountInterface
|
||||
{
|
||||
|
||||
// delete journals:
|
||||
$journals = \TransactionJournal::whereIn(
|
||||
\TransactionJournal::whereIn(
|
||||
'id', function ($query) use ($model) {
|
||||
$query->select('transaction_journal_id')
|
||||
->from('transactions')->whereIn(
|
||||
@@ -454,10 +454,9 @@ class Account implements CUD, CommonDatabaseCalls, AccountInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds an account type using one of the "$what"'s: expense, asset, revenue, opening, etc.
|
||||
*
|
||||
* @param $what
|
||||
*
|
||||
* @throws NotImplementedException
|
||||
* @return \AccountType|null
|
||||
*/
|
||||
public function findByWhat($what)
|
||||
@@ -470,6 +469,7 @@ class Account implements CUD, CommonDatabaseCalls, AccountInterface
|
||||
* Returns all objects.
|
||||
*
|
||||
* @return Collection
|
||||
* @throws NotImplementedException
|
||||
*/
|
||||
public function get()
|
||||
{
|
||||
@@ -487,6 +487,12 @@ class Account implements CUD, CommonDatabaseCalls, AccountInterface
|
||||
return $this->getUser()->accounts()->whereIn('id', $ids)->get();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $name
|
||||
*
|
||||
* @return static
|
||||
* @throws \FireflyIII\Exception\FireflyException
|
||||
*/
|
||||
public function firstExpenseAccountOrCreate($name)
|
||||
{
|
||||
/** @var \FireflyIII\Database\AccountType $accountTypeRepos */
|
||||
@@ -510,6 +516,12 @@ class Account implements CUD, CommonDatabaseCalls, AccountInterface
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $name
|
||||
*
|
||||
* @return static
|
||||
* @throws \FireflyIII\Exception\FireflyException
|
||||
*/
|
||||
public function firstRevenueAccountOrCreate($name)
|
||||
{
|
||||
/** @var \FireflyIII\Database\AccountType $accountTypeRepos */
|
||||
@@ -523,6 +535,12 @@ class Account implements CUD, CommonDatabaseCalls, AccountInterface
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \Account $account
|
||||
* @param int $limit
|
||||
*
|
||||
* @return \Illuminate\Pagination\Paginator
|
||||
*/
|
||||
public function getAllTransactionJournals(\Account $account, $limit = 50)
|
||||
{
|
||||
$offset = intval(\Input::get('page')) > 0 ? intval(\Input::get('page')) * $limit : 0;
|
||||
@@ -568,6 +586,13 @@ class Account implements CUD, CommonDatabaseCalls, AccountInterface
|
||||
return $date;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \Account $account
|
||||
* @param int $limit
|
||||
* @param string $range
|
||||
*
|
||||
* @return \Illuminate\Pagination\Paginator
|
||||
*/
|
||||
public function getTransactionJournals(\Account $account, $limit = 50, $range = 'session')
|
||||
{
|
||||
$offset = intval(\Input::get('page')) > 0 ? intval(\Input::get('page')) * $limit : 0;
|
||||
@@ -580,8 +605,8 @@ class Account implements CUD, CommonDatabaseCalls, AccountInterface
|
||||
->orderBy('date', 'DESC');
|
||||
|
||||
if ($range == 'session') {
|
||||
$query->before(\Session::get('end', \Carbon\Carbon::now()->startOfMonth()));
|
||||
$query->after(\Session::get('start', \Carbon\Carbon::now()->startOfMonth()));
|
||||
$query->before(\Session::get('end', Carbon::now()->startOfMonth()));
|
||||
$query->after(\Session::get('start', Carbon::now()->startOfMonth()));
|
||||
}
|
||||
$count = $query->count();
|
||||
$set = $query->take($limit)->offset($offset)->get(['transaction_journals.*']);
|
||||
|
||||
@@ -21,6 +21,7 @@ class AccountType implements CUD, CommonDatabaseCalls
|
||||
* @param \Eloquent $model
|
||||
*
|
||||
* @return bool
|
||||
* @throws NotImplementedException
|
||||
*/
|
||||
public function destroy(\Eloquent $model)
|
||||
{
|
||||
@@ -32,6 +33,7 @@ class AccountType implements CUD, CommonDatabaseCalls
|
||||
* @param array $data
|
||||
*
|
||||
* @return \Eloquent
|
||||
* @throws NotImplementedException
|
||||
*/
|
||||
public function store(array $data)
|
||||
{
|
||||
@@ -41,9 +43,10 @@ class AccountType implements CUD, CommonDatabaseCalls
|
||||
|
||||
/**
|
||||
* @param \Eloquent $model
|
||||
* @param array $data
|
||||
* @param array $data
|
||||
*
|
||||
* @return bool
|
||||
* @throws NotImplementedException
|
||||
*/
|
||||
public function update(\Eloquent $model, array $data)
|
||||
{
|
||||
@@ -58,6 +61,7 @@ class AccountType implements CUD, CommonDatabaseCalls
|
||||
* @param array $model
|
||||
*
|
||||
* @return array
|
||||
* @throws NotImplementedException
|
||||
*/
|
||||
public function validate(array $model)
|
||||
{
|
||||
@@ -71,6 +75,7 @@ class AccountType implements CUD, CommonDatabaseCalls
|
||||
* @param int $id
|
||||
*
|
||||
* @return \Eloquent
|
||||
* @throws NotImplementedException
|
||||
*/
|
||||
public function find($id)
|
||||
{
|
||||
@@ -115,6 +120,7 @@ class AccountType implements CUD, CommonDatabaseCalls
|
||||
* Returns all objects.
|
||||
*
|
||||
* @return Collection
|
||||
* @throws NotImplementedException
|
||||
*/
|
||||
public function get()
|
||||
{
|
||||
@@ -126,6 +132,7 @@ class AccountType implements CUD, CommonDatabaseCalls
|
||||
* @param array $ids
|
||||
*
|
||||
* @return Collection
|
||||
* @throws NotImplementedException
|
||||
*/
|
||||
public function getByIds(array $ids)
|
||||
{
|
||||
|
||||
@@ -136,6 +136,7 @@ class Budget implements CUD, CommonDatabaseCalls, BudgetInterface
|
||||
* @param $what
|
||||
*
|
||||
* @return \AccountType|null
|
||||
* @throws NotImplementedException
|
||||
*/
|
||||
public function findByWhat($what)
|
||||
{
|
||||
@@ -159,6 +160,7 @@ class Budget implements CUD, CommonDatabaseCalls, BudgetInterface
|
||||
* @param array $ids
|
||||
*
|
||||
* @return Collection
|
||||
* @throws NotImplementedException
|
||||
*/
|
||||
public function getByIds(array $ids)
|
||||
{
|
||||
@@ -200,6 +202,12 @@ class Budget implements CUD, CommonDatabaseCalls, BudgetInterface
|
||||
return \Paginator::make($items, $count, $take);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \Budget $budget
|
||||
* @param int $limit
|
||||
*
|
||||
* @return \Illuminate\Pagination\Paginator
|
||||
*/
|
||||
public function getTransactionJournals(\Budget $budget, $limit = 50)
|
||||
{
|
||||
$offset = intval(\Input::get('page')) > 0 ? intval(\Input::get('page')) * $limit : 0;
|
||||
@@ -214,6 +222,13 @@ class Budget implements CUD, CommonDatabaseCalls, BudgetInterface
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \Budget $budget
|
||||
* @param \LimitRepetition $repetition
|
||||
* @param int $limit
|
||||
*
|
||||
* @return \Illuminate\Pagination\Paginator
|
||||
*/
|
||||
public function getTransactionJournalsInRepetition(\Budget $budget, \LimitRepetition $repetition, $limit = 50)
|
||||
{
|
||||
$start = $repetition->startdate;
|
||||
@@ -241,8 +256,8 @@ class Budget implements CUD, CommonDatabaseCalls, BudgetInterface
|
||||
public function repetitionOnStartingOnDate(\Budget $budget, Carbon $date)
|
||||
{
|
||||
return \LimitRepetition::
|
||||
leftJoin('limits', 'limit_repetitions.limit_id', '=', 'limits.id')->leftJoin(
|
||||
'components', 'limits.component_id', '=', 'components.id'
|
||||
leftJoin('budget_limits', 'limit_repetitions.budget_limit_id', '=', 'budget_limits.id')->leftJoin(
|
||||
'components', 'budget_limits.component_id', '=', 'components.id'
|
||||
)->where('limit_repetitions.startdate', $date->format('Y-m-d'))->where(
|
||||
'components.id', $budget->id
|
||||
)->first(['limit_repetitions.*']);
|
||||
|
||||
@@ -124,6 +124,7 @@ class Category implements CUD, CommonDatabaseCalls
|
||||
* @param int $id
|
||||
*
|
||||
* @return \Eloquent
|
||||
* @throws NotImplementedException
|
||||
*/
|
||||
public function find($id)
|
||||
{
|
||||
@@ -137,6 +138,7 @@ class Category implements CUD, CommonDatabaseCalls
|
||||
* @param $what
|
||||
*
|
||||
* @return \AccountType|null
|
||||
* @throws NotImplementedException
|
||||
*/
|
||||
public function findByWhat($what)
|
||||
{
|
||||
@@ -158,6 +160,7 @@ class Category implements CUD, CommonDatabaseCalls
|
||||
* @param array $ids
|
||||
*
|
||||
* @return Collection
|
||||
* @throws NotImplementedException
|
||||
*/
|
||||
public function getByIds(array $ids)
|
||||
{
|
||||
@@ -165,11 +168,22 @@ class Category implements CUD, CommonDatabaseCalls
|
||||
throw new NotImplementedException;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $name
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public function firstOrCreate($name)
|
||||
{
|
||||
return \Category::firstOrCreate(['user_id' => $this->getUser()->id, 'name' => $name]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \Category $category
|
||||
* @param int $limit
|
||||
*
|
||||
* @return \Illuminate\Pagination\Paginator
|
||||
*/
|
||||
public function getTransactionJournals(\Category $category, $limit = 50)
|
||||
{
|
||||
$offset = intval(\Input::get('page')) > 0 ? intval(\Input::get('page')) * $limit : 0;
|
||||
@@ -185,10 +199,11 @@ class Category implements CUD, CommonDatabaseCalls
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \Category $budget
|
||||
* @param \Category $category
|
||||
* @param Carbon $date
|
||||
*
|
||||
* @return null
|
||||
* @internal param \Category $budget
|
||||
*/
|
||||
public function repetitionOnStartingOnDate(\Category $category, Carbon $date)
|
||||
{
|
||||
|
||||
@@ -13,10 +13,13 @@ interface RecurringInterface
|
||||
{
|
||||
/**
|
||||
* @param \RecurringTransaction $recurring
|
||||
* @param Carbon $current
|
||||
* @param Carbon $currentEnd
|
||||
* @param Carbon $start
|
||||
* @param Carbon $end
|
||||
*
|
||||
* @return null|\TransactionJournal
|
||||
* @internal param Carbon $current
|
||||
* @internal param Carbon $currentEnd
|
||||
*
|
||||
* @return \TransactionJournal|null
|
||||
*/
|
||||
public function getJournalForRecurringInRange(\RecurringTransaction $recurring, Carbon $start, Carbon $end);
|
||||
|
||||
|
||||
@@ -5,6 +5,11 @@ namespace FireflyIII\Database\Ifaces;
|
||||
|
||||
use Carbon\Carbon;
|
||||
|
||||
/**
|
||||
* Interface ReportInterface
|
||||
*
|
||||
* @package FireflyIII\Database\Ifaces
|
||||
*/
|
||||
interface ReportInterface
|
||||
{
|
||||
|
||||
|
||||
@@ -203,6 +203,7 @@ class Piggybank implements CUD, CommonDatabaseCalls, PiggybankInterface
|
||||
* @param $what
|
||||
*
|
||||
* @return \AccountType|null
|
||||
* @throws NotImplementedException
|
||||
*/
|
||||
public function findByWhat($what)
|
||||
{
|
||||
@@ -224,6 +225,7 @@ class Piggybank implements CUD, CommonDatabaseCalls, PiggybankInterface
|
||||
* @param array $ids
|
||||
*
|
||||
* @return Collection
|
||||
* @throws NotImplementedException
|
||||
*/
|
||||
public function getByIds(array $ids)
|
||||
{
|
||||
@@ -231,7 +233,16 @@ class Piggybank implements CUD, CommonDatabaseCalls, PiggybankInterface
|
||||
throw new NotImplementedException;
|
||||
}
|
||||
|
||||
public function findRepetitionByDate(\Piggybank $piggybank, Carbon $date)
|
||||
/**
|
||||
* @param \Piggybank $piggybank
|
||||
* @param Carbon $date
|
||||
*
|
||||
* @return mixed
|
||||
* @throws FireflyException
|
||||
* @throws NotImplementedException
|
||||
*/
|
||||
public function findRepetitionByDate(\Piggybank $piggybank, /** @noinspection PhpUnusedParameterInspection */
|
||||
Carbon $date)
|
||||
{
|
||||
$reps = $piggybank->piggybankrepetitions()->get();
|
||||
if ($reps->count() == 1) {
|
||||
|
||||
@@ -183,6 +183,7 @@ class Recurring implements CUD, CommonDatabaseCalls, RecurringInterface
|
||||
* @param int $id
|
||||
*
|
||||
* @return \Eloquent
|
||||
* @throws NotImplementedException
|
||||
*/
|
||||
public function find($id)
|
||||
{
|
||||
@@ -196,6 +197,7 @@ class Recurring implements CUD, CommonDatabaseCalls, RecurringInterface
|
||||
* @param $what
|
||||
*
|
||||
* @return \AccountType|null
|
||||
* @throws NotImplementedException
|
||||
*/
|
||||
public function findByWhat($what)
|
||||
{
|
||||
@@ -217,6 +219,7 @@ class Recurring implements CUD, CommonDatabaseCalls, RecurringInterface
|
||||
* @param array $ids
|
||||
*
|
||||
* @return Collection
|
||||
* @throws NotImplementedException
|
||||
*/
|
||||
public function getByIds(array $ids)
|
||||
{
|
||||
|
||||
@@ -13,6 +13,11 @@ use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\MessageBag;
|
||||
|
||||
|
||||
/**
|
||||
* Class RepeatedExpense
|
||||
*
|
||||
* @package FireflyIII\Database
|
||||
*/
|
||||
class RepeatedExpense implements CUD, CommonDatabaseCalls, PiggybankInterface
|
||||
{
|
||||
use SwitchUser;
|
||||
@@ -30,6 +35,8 @@ class RepeatedExpense implements CUD, CommonDatabaseCalls, PiggybankInterface
|
||||
* other variables this method tries to divide the piggy bank into equal parts. Each is
|
||||
* accommodated by a reminder (if everything goes to plan).
|
||||
*
|
||||
* @param \PiggybankRepetition $repetition
|
||||
*
|
||||
* @return \PiggybankRepetition
|
||||
*/
|
||||
public function calculateParts(\PiggybankRepetition $repetition)
|
||||
@@ -98,7 +105,7 @@ class RepeatedExpense implements CUD, CommonDatabaseCalls, PiggybankInterface
|
||||
foreach ($bars as $index => $bar) {
|
||||
$bar->setAmountPerBar($amountPerBar);
|
||||
$bar->setCumulativeAmount($cumulative);
|
||||
if($parts -1 == $index) {
|
||||
if ($parts - 1 == $index) {
|
||||
$bar->setCumulativeAmount($piggyBank->targetamount);
|
||||
}
|
||||
|
||||
@@ -275,6 +282,7 @@ class RepeatedExpense implements CUD, CommonDatabaseCalls, PiggybankInterface
|
||||
* @param \Eloquent $model
|
||||
*
|
||||
* @return bool
|
||||
* @throws NotImplementedException
|
||||
*/
|
||||
public function destroy(\Eloquent $model)
|
||||
{
|
||||
@@ -316,9 +324,10 @@ class RepeatedExpense implements CUD, CommonDatabaseCalls, PiggybankInterface
|
||||
|
||||
/**
|
||||
* @param \Eloquent $model
|
||||
* @param array $data
|
||||
* @param array $data
|
||||
*
|
||||
* @return bool
|
||||
* @throws NotImplementedException
|
||||
*/
|
||||
public function update(\Eloquent $model, array $data)
|
||||
{
|
||||
@@ -426,6 +435,7 @@ class RepeatedExpense implements CUD, CommonDatabaseCalls, PiggybankInterface
|
||||
* @param int $id
|
||||
*
|
||||
* @return \Eloquent
|
||||
* @throws NotImplementedException
|
||||
*/
|
||||
public function find($id)
|
||||
{
|
||||
@@ -439,6 +449,7 @@ class RepeatedExpense implements CUD, CommonDatabaseCalls, PiggybankInterface
|
||||
* @param $what
|
||||
*
|
||||
* @return \AccountType|null
|
||||
* @throws NotImplementedException
|
||||
*/
|
||||
public function findByWhat($what)
|
||||
{
|
||||
@@ -460,6 +471,7 @@ class RepeatedExpense implements CUD, CommonDatabaseCalls, PiggybankInterface
|
||||
* @param array $ids
|
||||
*
|
||||
* @return Collection
|
||||
* @throws NotImplementedException
|
||||
*/
|
||||
public function getByIds(array $ids)
|
||||
{
|
||||
@@ -471,6 +483,7 @@ class RepeatedExpense implements CUD, CommonDatabaseCalls, PiggybankInterface
|
||||
* @param \Account $account
|
||||
*
|
||||
* @return float
|
||||
* @throws NotImplementedException
|
||||
*/
|
||||
public function leftOnAccount(\Account $account)
|
||||
{
|
||||
|
||||
@@ -12,6 +12,11 @@ namespace FireflyIII\Database;
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Database\Ifaces\ReportInterface;
|
||||
|
||||
/**
|
||||
* Class Report
|
||||
*
|
||||
* @package FireflyIII\Database
|
||||
*/
|
||||
class Report implements ReportInterface
|
||||
{
|
||||
use SwitchUser;
|
||||
|
||||
@@ -24,6 +24,7 @@ class Transaction implements CUD, CommonDatabaseCalls
|
||||
* @param \Eloquent $model
|
||||
*
|
||||
* @return bool
|
||||
* @throws NotImplementedException
|
||||
*/
|
||||
public function destroy(\Eloquent $model)
|
||||
{
|
||||
@@ -35,6 +36,7 @@ class Transaction implements CUD, CommonDatabaseCalls
|
||||
* @param array $data
|
||||
*
|
||||
* @return \Eloquent
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function store(array $data)
|
||||
{
|
||||
@@ -59,9 +61,10 @@ class Transaction implements CUD, CommonDatabaseCalls
|
||||
|
||||
/**
|
||||
* @param \Eloquent $model
|
||||
* @param array $data
|
||||
* @param array $data
|
||||
*
|
||||
* @return bool
|
||||
* @throws NotImplementedException
|
||||
*/
|
||||
public function update(\Eloquent $model, array $data)
|
||||
{
|
||||
@@ -141,6 +144,7 @@ class Transaction implements CUD, CommonDatabaseCalls
|
||||
* @param int $id
|
||||
*
|
||||
* @return \Eloquent
|
||||
* @throws NotImplementedException
|
||||
*/
|
||||
public function find($id)
|
||||
{
|
||||
@@ -154,6 +158,7 @@ class Transaction implements CUD, CommonDatabaseCalls
|
||||
* @param $what
|
||||
*
|
||||
* @return \AccountType|null
|
||||
* @throws NotImplementedException
|
||||
*/
|
||||
public function findByWhat($what)
|
||||
{
|
||||
@@ -165,6 +170,7 @@ class Transaction implements CUD, CommonDatabaseCalls
|
||||
* Returns all objects.
|
||||
*
|
||||
* @return Collection
|
||||
* @throws NotImplementedException
|
||||
*/
|
||||
public function get()
|
||||
{
|
||||
@@ -176,6 +182,7 @@ class Transaction implements CUD, CommonDatabaseCalls
|
||||
* @param array $ids
|
||||
*
|
||||
* @return Collection
|
||||
* @throws NotImplementedException
|
||||
*/
|
||||
public function getByIds(array $ids)
|
||||
{
|
||||
|
||||
@@ -58,6 +58,7 @@ class TransactionJournal implements TransactionJournalInterface, CUD, CommonData
|
||||
* @param array $data
|
||||
*
|
||||
* @return \Eloquent
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function store(array $data)
|
||||
{
|
||||
@@ -174,6 +175,7 @@ class TransactionJournal implements TransactionJournalInterface, CUD, CommonData
|
||||
* @param array $data
|
||||
*
|
||||
* @return bool
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function update(\Eloquent $model, array $data)
|
||||
{
|
||||
@@ -186,9 +188,6 @@ class TransactionJournal implements TransactionJournalInterface, CUD, CommonData
|
||||
/** @var \FireflyIII\Database\TransactionCurrency $currencyRepository */
|
||||
$currencyRepository = \App::make('FireflyIII\Database\TransactionCurrency');
|
||||
|
||||
/** @var \FireflyIII\Database\Transaction $transactionRepository */
|
||||
$transactionRepository = \App::make('FireflyIII\Database\Transaction');
|
||||
|
||||
$journalType = $typeRepository->findByWhat($data['what']);
|
||||
$currency = $currencyRepository->findByCode($data['currency']);
|
||||
|
||||
@@ -284,6 +283,7 @@ class TransactionJournal implements TransactionJournalInterface, CUD, CommonData
|
||||
* @param array $model
|
||||
*
|
||||
* @return array
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function validate(array $model)
|
||||
{
|
||||
@@ -350,7 +350,6 @@ class TransactionJournal implements TransactionJournalInterface, CUD, CommonData
|
||||
/*
|
||||
* Many checks to catch invalid or not-existing accounts.
|
||||
*/
|
||||
$accountError = false;
|
||||
switch (true) {
|
||||
// this combination is often seen in withdrawals.
|
||||
case (isset($model['account_id']) && isset($model['expense_account'])):
|
||||
@@ -458,6 +457,7 @@ class TransactionJournal implements TransactionJournalInterface, CUD, CommonData
|
||||
* @param $what
|
||||
*
|
||||
* @return \AccountType|null
|
||||
* @throws NotImplementedException
|
||||
*/
|
||||
public function findByWhat($what)
|
||||
{
|
||||
@@ -560,6 +560,11 @@ class TransactionJournal implements TransactionJournalInterface, CUD, CommonData
|
||||
return $sum;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $limit
|
||||
*
|
||||
* @return \Illuminate\Pagination\Paginator
|
||||
*/
|
||||
public function getDepositsPaginated($limit = 50)
|
||||
{
|
||||
$offset = intval(\Input::get('page')) > 0 ? (intval(\Input::get('page')) - 1) * $limit : 0;
|
||||
@@ -599,6 +604,11 @@ class TransactionJournal implements TransactionJournalInterface, CUD, CommonData
|
||||
return $query;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $limit
|
||||
*
|
||||
* @return \Illuminate\Pagination\Paginator
|
||||
*/
|
||||
public function getTransfersPaginated($limit = 50)
|
||||
{
|
||||
$offset = intval(\Input::get('page')) > 0 ? (intval(\Input::get('page')) - 1) * $limit : 0;
|
||||
@@ -615,6 +625,11 @@ class TransactionJournal implements TransactionJournalInterface, CUD, CommonData
|
||||
return \Paginator::make($items, $count, $limit);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $limit
|
||||
*
|
||||
* @return \Illuminate\Pagination\Paginator
|
||||
*/
|
||||
public function getWithdrawalsPaginated($limit = 50)
|
||||
{
|
||||
$offset = intval(\Input::get('page')) > 0 ? (intval(\Input::get('page')) - 1) * $limit : 0;
|
||||
|
||||
@@ -23,6 +23,7 @@ class TransactionType implements CUD, CommonDatabaseCalls
|
||||
* @param \Eloquent $model
|
||||
*
|
||||
* @return bool
|
||||
* @throws NotImplementedException
|
||||
*/
|
||||
public function destroy(\Eloquent $model)
|
||||
{
|
||||
@@ -34,6 +35,7 @@ class TransactionType implements CUD, CommonDatabaseCalls
|
||||
* @param array $data
|
||||
*
|
||||
* @return \Eloquent
|
||||
* @throws NotImplementedException
|
||||
*/
|
||||
public function store(array $data)
|
||||
{
|
||||
@@ -43,9 +45,10 @@ class TransactionType implements CUD, CommonDatabaseCalls
|
||||
|
||||
/**
|
||||
* @param \Eloquent $model
|
||||
* @param array $data
|
||||
* @param array $data
|
||||
*
|
||||
* @return bool
|
||||
* @throws NotImplementedException
|
||||
*/
|
||||
public function update(\Eloquent $model, array $data)
|
||||
{
|
||||
@@ -60,6 +63,7 @@ class TransactionType implements CUD, CommonDatabaseCalls
|
||||
* @param array $model
|
||||
*
|
||||
* @return array
|
||||
* @throws NotImplementedException
|
||||
*/
|
||||
public function validate(array $model)
|
||||
{
|
||||
@@ -73,6 +77,7 @@ class TransactionType implements CUD, CommonDatabaseCalls
|
||||
* @param int $id
|
||||
*
|
||||
* @return \Eloquent
|
||||
* @throws NotImplementedException
|
||||
*/
|
||||
public function find($id)
|
||||
{
|
||||
@@ -86,6 +91,7 @@ class TransactionType implements CUD, CommonDatabaseCalls
|
||||
* @param $what
|
||||
*
|
||||
* @return \AccountType|null
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function findByWhat($what)
|
||||
{
|
||||
@@ -114,6 +120,7 @@ class TransactionType implements CUD, CommonDatabaseCalls
|
||||
* Returns all objects.
|
||||
*
|
||||
* @return Collection
|
||||
* @throws NotImplementedException
|
||||
*/
|
||||
public function get()
|
||||
{
|
||||
@@ -125,6 +132,7 @@ class TransactionType implements CUD, CommonDatabaseCalls
|
||||
* @param array $ids
|
||||
*
|
||||
* @return Collection
|
||||
* @throws NotImplementedException
|
||||
*/
|
||||
public function getByIds(array $ids)
|
||||
{
|
||||
|
||||
@@ -5,14 +5,25 @@ namespace FireflyIII\Event;
|
||||
|
||||
use Illuminate\Events\Dispatcher;
|
||||
|
||||
/**
|
||||
* Class Account
|
||||
*
|
||||
* @package FireflyIII\Event
|
||||
*/
|
||||
class Account
|
||||
{
|
||||
/**
|
||||
* @param \Account $account
|
||||
*/
|
||||
public function destroy(\Account $account)
|
||||
{
|
||||
\Cache::forget('account.' . $account->id . '.latestBalance');
|
||||
\Cache::forget('account.' . $account->id . '.lastActivityDate');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \Account $account
|
||||
*/
|
||||
public function store(\Account $account)
|
||||
{
|
||||
|
||||
@@ -31,6 +42,9 @@ class Account
|
||||
$events->listen('account.destroy', 'FireflyIII\Event\Account@destroy');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \Account $account
|
||||
*/
|
||||
public function update(\Account $account)
|
||||
{
|
||||
\Cache::forget('account.' . $account->id . '.latestBalance');
|
||||
|
||||
@@ -5,35 +5,40 @@ namespace FireflyIII\Event;
|
||||
use Illuminate\Database\QueryException;
|
||||
use Illuminate\Events\Dispatcher;
|
||||
|
||||
/**
|
||||
* Class Budget
|
||||
*
|
||||
* @package FireflyIII\Event
|
||||
*/
|
||||
class Budget
|
||||
{
|
||||
|
||||
/**
|
||||
* @param \Limit $limit
|
||||
* @param \BudgetLimit $budgetLimit
|
||||
*/
|
||||
public function storeOrUpdateLimit(\Limit $limit)
|
||||
public function storeOrUpdateLimit(\BudgetLimit $budgetLimit)
|
||||
{
|
||||
|
||||
|
||||
$end = \DateKit::addPeriod(clone $limit->startdate, $limit->repeat_freq, 0);
|
||||
$end = \DateKit::addPeriod(clone $budgetLimit->startdate, $budgetLimit->repeat_freq, 0);
|
||||
$end->subDay();
|
||||
|
||||
$set = $limit->limitrepetitions()->where('startdate', $limit->startdate->format('Y-m-d'))->where('enddate', $end->format('Y-m-d'))->get();
|
||||
$set = $budgetLimit->limitrepetitions()->where('startdate', $budgetLimit->startdate->format('Y-m-d'))->where('enddate', $end->format('Y-m-d'))->get();
|
||||
/*
|
||||
* Create new LimitRepetition:
|
||||
*/
|
||||
if ($set->count() == 0) {
|
||||
|
||||
$repetition = new \LimitRepetition();
|
||||
$repetition->startdate = $limit->startdate;
|
||||
$repetition->startdate = $budgetLimit->startdate;
|
||||
$repetition->enddate = $end;
|
||||
$repetition->amount = $limit->amount;
|
||||
$repetition->limit()->associate($limit);
|
||||
$repetition->amount = $budgetLimit->amount;
|
||||
$repetition->budgetLimit()->associate($budgetLimit);
|
||||
|
||||
try {
|
||||
$repetition->save();
|
||||
} catch (QueryException $e) {
|
||||
\Log::error('Trying to save new Limitrepetition failed!');
|
||||
\Log::error('Trying to save new LimitRepetition failed!');
|
||||
\Log::error($e->getMessage());
|
||||
}
|
||||
} else {
|
||||
@@ -42,7 +47,7 @@ class Budget
|
||||
* Update existing one.
|
||||
*/
|
||||
$repetition = $set->first();
|
||||
$repetition->amount = $limit->amount;
|
||||
$repetition->amount = $budgetLimit->amount;
|
||||
$repetition->save();
|
||||
|
||||
}
|
||||
|
||||
@@ -4,9 +4,19 @@ namespace FireflyIII\Event;
|
||||
use Illuminate\Events\Dispatcher;
|
||||
|
||||
|
||||
/**
|
||||
* Class Event
|
||||
*
|
||||
* @package FireflyIII\Event
|
||||
*/
|
||||
class Event
|
||||
{
|
||||
|
||||
/**
|
||||
* @param \Account $account
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function deleteAccount(\Account $account)
|
||||
{
|
||||
// get piggy banks
|
||||
|
||||
@@ -6,6 +6,11 @@ namespace FireflyIII\Event;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Events\Dispatcher;
|
||||
|
||||
/**
|
||||
* Class Piggybank
|
||||
*
|
||||
* @package FireflyIII\Event
|
||||
*/
|
||||
class Piggybank
|
||||
{
|
||||
|
||||
@@ -21,13 +26,19 @@ class Piggybank
|
||||
$event->amount = floatval($amount);
|
||||
$event->date = new Carbon;
|
||||
if (!$event->isValid()) {
|
||||
var_dump($event->getErrors());
|
||||
exit();
|
||||
\Log::error($event->getErrors());
|
||||
\App::abort(500);
|
||||
}
|
||||
$event->save();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \TransactionJournal $journal
|
||||
*
|
||||
* @throws \FireflyIII\Exception\FireflyException
|
||||
* @throws \FireflyIII\Exception\NotImplementedException
|
||||
*/
|
||||
public function destroyTransfer(\TransactionJournal $journal)
|
||||
{
|
||||
if ($journal->piggybankevents()->count() > 0) {
|
||||
@@ -88,6 +99,9 @@ class Piggybank
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \Piggybank $piggybank
|
||||
*/
|
||||
public function storePiggybank(\Piggybank $piggybank)
|
||||
{
|
||||
if (intval($piggybank->repeats) == 0) {
|
||||
@@ -250,6 +264,9 @@ class Piggybank
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \Piggybank $piggyBank
|
||||
*/
|
||||
public function updatePiggybank(\Piggybank $piggyBank)
|
||||
{
|
||||
// get the repetition:
|
||||
@@ -259,6 +276,12 @@ class Piggybank
|
||||
$repetition->save();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \TransactionJournal $journal
|
||||
*
|
||||
* @throws \FireflyIII\Exception\FireflyException
|
||||
* @throws \FireflyIII\Exception\NotImplementedException
|
||||
*/
|
||||
public function updateTransfer(\TransactionJournal $journal)
|
||||
{
|
||||
|
||||
|
||||
@@ -5,14 +5,25 @@ namespace FireflyIII\Event;
|
||||
|
||||
use Illuminate\Events\Dispatcher;
|
||||
|
||||
/**
|
||||
* Class Transaction
|
||||
*
|
||||
* @package FireflyIII\Event
|
||||
*/
|
||||
class Transaction
|
||||
{
|
||||
/**
|
||||
* @param \Transaction $transaction
|
||||
*/
|
||||
public function destroy(\Transaction $transaction)
|
||||
{
|
||||
\Cache::forget('account.' . $transaction->account_id . '.latestBalance');
|
||||
\Cache::forget('account.' . $transaction->account_id . '.lastActivityDate');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \Transaction $transaction
|
||||
*/
|
||||
public function store(\Transaction $transaction)
|
||||
{
|
||||
\Cache::forget('account.' . $transaction->account_id . '.latestBalance');
|
||||
@@ -30,6 +41,9 @@ class Transaction
|
||||
$events->listen('transaction.destroy', 'FireflyIII\Event\Transaction@destroy');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \Transaction $transaction
|
||||
*/
|
||||
public function update(\Transaction $transaction)
|
||||
{
|
||||
\Cache::forget('account.' . $transaction->account_id . '.latestBalance');
|
||||
|
||||
@@ -4,10 +4,19 @@ namespace FireflyIII\Event;
|
||||
|
||||
use Illuminate\Events\Dispatcher;
|
||||
|
||||
/**
|
||||
* Class TransactionJournal
|
||||
*
|
||||
* @package FireflyIII\Event
|
||||
*/
|
||||
class TransactionJournal
|
||||
{
|
||||
|
||||
public function store(\TransactionJournal $journal, $id = 0)
|
||||
/**
|
||||
* @param \TransactionJournal $journal
|
||||
* @param int $id
|
||||
*/
|
||||
public function store(\TransactionJournal $journal)
|
||||
{
|
||||
/** @var \FireflyIII\Database\Recurring $repository */
|
||||
$repository = \App::make('FireflyIII\Database\Recurring');
|
||||
@@ -30,6 +39,9 @@ class TransactionJournal
|
||||
$events->listen('transactionJournal.update', 'FireflyIII\Event\TransactionJournal@update');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \TransactionJournal $journal
|
||||
*/
|
||||
public function update(\TransactionJournal $journal)
|
||||
{
|
||||
/** @var \FireflyIII\Database\Recurring $repository */
|
||||
|
||||
@@ -287,18 +287,17 @@ class Form
|
||||
/*
|
||||
* Store.
|
||||
*/
|
||||
$store = '';
|
||||
switch ($type) {
|
||||
case 'create':
|
||||
$store = '<div class="form-group"><label for="default" class="col-sm-4 control-label">Store</label>';
|
||||
$store = '<div class="form-group"><label for="' . $name . '_store" class="col-sm-4 control-label">Store</label>';
|
||||
$store .= '<div class="col-sm-8"><div class="radio"><label>';
|
||||
$store .= \Form::radio('post_submit_action', 'store', $previousValue == 'store');
|
||||
$store .= \Form::radio('post_submit_action', 'store', $previousValue == 'store', ['id' => $name . '_store']);
|
||||
$store .= 'Store ' . $name . '</label></div></div></div>';
|
||||
break;
|
||||
case 'update':
|
||||
$store = '<div class="form-group"><label for="default" class="col-sm-4 control-label">Store</label>';
|
||||
$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 == 'store');
|
||||
$store .= \Form::radio('post_submit_action', 'update', $previousValue == 'update', ['id' => $name . '_update']);
|
||||
$store .= 'Update ' . $name . '</label></div></div></div>';
|
||||
break;
|
||||
default:
|
||||
@@ -309,9 +308,9 @@ class Form
|
||||
/*
|
||||
* validate is always the same:
|
||||
*/
|
||||
$validate = '<div class="form-group"><label for="validate_only" class="col-sm-4 control-label">Validate only';
|
||||
$validate = '<div class="form-group"><label for="' . $name . 'validate_only" class="col-sm-4 control-label">Validate only';
|
||||
$validate .= '</label><div class="col-sm-8"><div class="radio"><label>';
|
||||
$validate .= \Form::radio('post_submit_action', 'validate_only', $previousValue == 'validate_only');
|
||||
$validate .= \Form::radio('post_submit_action', 'validate_only', $previousValue == 'validate_only', ['id' => $name . '_validate_only']);
|
||||
$validate .= 'Only validate, do not save</label></div></div></div>';
|
||||
|
||||
/*
|
||||
@@ -319,15 +318,15 @@ class Form
|
||||
*/
|
||||
switch ($type) {
|
||||
case 'create':
|
||||
$return = '<div class="form-group"><label for="return_to_form" class="col-sm-4 control-label">';
|
||||
$return = '<div class="form-group"><label for="' . $name . 'return_to_form" class="col-sm-4 control-label">';
|
||||
$return .= 'Return here</label><div class="col-sm-8"><div class="radio"><label>';
|
||||
$return .= \Form::radio('post_submit_action', 'create_another', $previousValue == 'create_another');
|
||||
$return .= \Form::radio('post_submit_action', 'create_another', $previousValue == 'create_another', ['id' => $name . '_create_another']);
|
||||
$return .= 'After storing, return here to create another one.</label></div></div></div>';
|
||||
break;
|
||||
case 'update':
|
||||
$return = '<div class="form-group"><label for="return_to_edit" class="col-sm-4 control-label">';
|
||||
$return = '<div class="form-group"><label for="' . $name . 'return_to_edit" class="col-sm-4 control-label">';
|
||||
$return .= 'Return here</label><div class="col-sm-8"><div class="radio"><label>';
|
||||
$return .= \Form::radio('post_submit_action', 'return_to_edit', $previousValue == 'return_to_edit');
|
||||
$return .= \Form::radio('post_submit_action', 'return_to_edit', $previousValue == 'return_to_edit', ['id' => $name . '_return_to_edit']);
|
||||
$return .= 'After updating, return here.</label></div></div></div>';
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -9,6 +9,8 @@ use Illuminate\Support\Collection;
|
||||
/**
|
||||
* Class Report
|
||||
*
|
||||
* @SuppressWarnings("CamelCase")
|
||||
*
|
||||
* @package FireflyIII\Report
|
||||
*/
|
||||
class Report implements ReportInterface
|
||||
|
||||
@@ -5,6 +5,11 @@ namespace FireflyIII\Search;
|
||||
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
/**
|
||||
* Class Search
|
||||
*
|
||||
* @package FireflyIII\Search
|
||||
*/
|
||||
class Search
|
||||
{
|
||||
/**
|
||||
|
||||
@@ -4,10 +4,18 @@ namespace FireflyIII\Shared\Facade;
|
||||
|
||||
use Illuminate\Support\Facades\Facade;
|
||||
|
||||
/**
|
||||
* Class DateKit
|
||||
*
|
||||
* @package FireflyIII\Shared\Facade
|
||||
*/
|
||||
class DateKit extends Facade
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
protected static function getFacadeAccessor()
|
||||
{
|
||||
return 'datekit';
|
||||
|
||||
@@ -4,10 +4,18 @@ namespace FireflyIII\Shared\Facade;
|
||||
|
||||
use Illuminate\Support\Facades\Facade;
|
||||
|
||||
/**
|
||||
* Class FFForm
|
||||
*
|
||||
* @package FireflyIII\Shared\Facade
|
||||
*/
|
||||
class FFForm extends Facade
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
protected static function getFacadeAccessor()
|
||||
{
|
||||
return 'ffform';
|
||||
|
||||
@@ -4,10 +4,18 @@ namespace FireflyIII\Shared\Facade;
|
||||
|
||||
use Illuminate\Support\Facades\Facade;
|
||||
|
||||
/**
|
||||
* Class Filter
|
||||
*
|
||||
* @package FireflyIII\Shared\Facade
|
||||
*/
|
||||
class Filter extends Facade
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
protected static function getFacadeAccessor()
|
||||
{
|
||||
return 'filter';
|
||||
|
||||
@@ -4,10 +4,18 @@ namespace FireflyIII\Shared\Facade;
|
||||
|
||||
use Illuminate\Support\Facades\Facade;
|
||||
|
||||
/**
|
||||
* Class Navigation
|
||||
*
|
||||
* @package FireflyIII\Shared\Facade
|
||||
*/
|
||||
class Navigation extends Facade
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
protected static function getFacadeAccessor()
|
||||
{
|
||||
return 'navigation';
|
||||
|
||||
@@ -4,10 +4,18 @@ namespace FireflyIII\Shared\Facade;
|
||||
|
||||
use Illuminate\Support\Facades\Facade;
|
||||
|
||||
/**
|
||||
* Class Reminders
|
||||
*
|
||||
* @package FireflyIII\Shared\Facade
|
||||
*/
|
||||
class Reminders extends Facade
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
protected static function getFacadeAccessor()
|
||||
{
|
||||
return 'reminders';
|
||||
|
||||
@@ -4,10 +4,18 @@ namespace FireflyIII\Shared\Facade;
|
||||
|
||||
use Illuminate\Support\Facades\Facade;
|
||||
|
||||
/**
|
||||
* Class Steam
|
||||
*
|
||||
* @package FireflyIII\Shared\Facade
|
||||
*/
|
||||
class Steam extends Facade
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
protected static function getFacadeAccessor()
|
||||
{
|
||||
return 'steam';
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
namespace FireflyIII\Shared\Mail;
|
||||
|
||||
use Swift_RfcComplianceException;
|
||||
|
||||
/**
|
||||
@@ -28,10 +29,11 @@ class Registration implements RegistrationInterface
|
||||
try {
|
||||
\Mail::send(
|
||||
['emails.user.register-html', 'emails.user.register-text'], $data, function ($message) use ($email) {
|
||||
$message->to($email, $email)->subject('Welcome to Firefly!');
|
||||
}
|
||||
$message->to($email, $email)->subject('Welcome to Firefly!');
|
||||
}
|
||||
);
|
||||
} catch(Swift_RfcComplianceException $e) {}
|
||||
} catch (Swift_RfcComplianceException $e) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -49,8 +51,8 @@ class Registration implements RegistrationInterface
|
||||
$data = ['reset' => $reset];
|
||||
\Mail::send(
|
||||
['emails.user.remindme-html', 'emails.user.remindme-text'], $data, function ($message) use ($email) {
|
||||
$message->to($email, $email)->subject('Forgot your password?');
|
||||
}
|
||||
$message->to($email, $email)->subject('Forgot your password?');
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
@@ -72,8 +74,8 @@ class Registration implements RegistrationInterface
|
||||
|
||||
\Mail::send(
|
||||
['emails.user.verify-html', 'emails.user.verify-text'], $data, function ($message) use ($email) {
|
||||
$message->to($email, $email)->subject('Verify your e-mail address.');
|
||||
}
|
||||
$message->to($email, $email)->subject('Verify your e-mail address.');
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -13,13 +13,10 @@ abstract class SingleTableInheritanceEntity extends \Eloquent
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $isSubclass = false;
|
||||
/**
|
||||
* The field that stores the subclass
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
// @codingStandardsIgnoreStart
|
||||
protected $isSubclass = false;
|
||||
protected $subclassField = null;
|
||||
// @codingStandardsIgnoreEnd
|
||||
|
||||
/**
|
||||
* @param array $attributes
|
||||
@@ -77,9 +74,8 @@ abstract class SingleTableInheritanceEntity extends \Eloquent
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function save(
|
||||
array $rules = [], array $customMessages = [], array $options = [], \Closure $beforeSave = null, \Closure $afterSave = null
|
||||
) {
|
||||
public function save(array $rules = [], array $customMessages = [], array $options = [], \Closure $beforeSave = null, \Closure $afterSave = null)
|
||||
{
|
||||
if ($this->subclassField) {
|
||||
$this->attributes[$this->subclassField] = get_class($this);
|
||||
}
|
||||
|
||||
@@ -143,6 +143,13 @@ class Date
|
||||
return $currentEnd;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Carbon $date
|
||||
* @param $repeatFrequency
|
||||
*
|
||||
* @return string
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function periodShow(Carbon $date, $repeatFrequency)
|
||||
{
|
||||
switch ($repeatFrequency) {
|
||||
@@ -216,12 +223,13 @@ class Date
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Carbon $date
|
||||
* @param Carbon $theDate
|
||||
* @param $repeatFreq
|
||||
* @param int $subtract
|
||||
*
|
||||
* @return Carbon
|
||||
* @throws FireflyException
|
||||
* @internal param Carbon $date
|
||||
*/
|
||||
public function subtractPeriod(Carbon $theDate, $repeatFreq, $subtract = 1)
|
||||
{
|
||||
|
||||
@@ -10,6 +10,13 @@ use Illuminate\Validation\Validator;
|
||||
*/
|
||||
class FireflyValidator extends Validator
|
||||
{
|
||||
/**
|
||||
* @param $attribute
|
||||
* @param $value
|
||||
* @param $parameters
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function validateAlphabasic($attribute, $value, $parameters)
|
||||
{
|
||||
$pattern = '/[^[:alnum:]_\-\.\& \(\)\'"]/iu';
|
||||
|
||||
Reference in New Issue
Block a user