mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 23:45:10 +00:00
@@ -46,8 +46,6 @@ class EncryptFile extends Command
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
@@ -64,6 +62,5 @@ class EncryptFile extends Command
|
||||
$path = storage_path('upload') . '/' . $newName;
|
||||
file_put_contents($path, $content);
|
||||
$this->line(sprintf('Encrypted "%s" and put it in "%s"', $file, $path));
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -44,8 +44,6 @@ class UpgradeFireflyInstructions extends Command
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
|
@@ -55,8 +55,6 @@ class VerifyDatabase extends Command
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
|
@@ -39,7 +39,7 @@ class ConnectJournalToPiggyBank
|
||||
$piggyBankId = $event->piggyBankId;
|
||||
|
||||
/** @var PiggyBank $piggyBank */
|
||||
$piggyBank = Auth::user()->piggybanks()->where('piggy_banks.id', $piggyBankId)->first(['piggy_banks.*']);
|
||||
$piggyBank = Auth::user()->piggyBanks()->where('piggy_banks.id', $piggyBankId)->first(['piggy_banks.*']);
|
||||
|
||||
if (is_null($piggyBank)) {
|
||||
return true;
|
||||
|
@@ -250,6 +250,8 @@ class AttachmentHelper implements AttachmentHelperInterface
|
||||
/**
|
||||
* @param array $files
|
||||
*
|
||||
* @param Model $model
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
private function processFiles(array $files, Model $model): bool
|
||||
|
@@ -1,385 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Importer.php
|
||||
* Copyright (C) 2016 thegrumpydictator@gmail.com
|
||||
*
|
||||
* This software may be modified and distributed under the terms
|
||||
* of the MIT license. See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
declare(strict_types = 1);
|
||||
namespace FireflyIII\Helpers\Csv;
|
||||
|
||||
use Auth;
|
||||
use FireflyIII\Events\TransactionJournalStored;
|
||||
use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Helpers\Csv\Converter\ConverterInterface;
|
||||
use FireflyIII\Helpers\Csv\PostProcessing\PostProcessorInterface;
|
||||
use FireflyIII\Helpers\Csv\Specifix\SpecifixInterface;
|
||||
use FireflyIII\Models\Account;
|
||||
use FireflyIII\Models\Transaction;
|
||||
use FireflyIII\Models\TransactionJournal;
|
||||
use FireflyIII\Models\TransactionType;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\MessageBag;
|
||||
use Log;
|
||||
|
||||
/**
|
||||
* Class Importer
|
||||
*
|
||||
* @package FireflyIII\Helpers\Csv
|
||||
*/
|
||||
class Importer
|
||||
{
|
||||
|
||||
/** @var Data */
|
||||
protected $data;
|
||||
/** @var array */
|
||||
protected $errors = [];
|
||||
/** @var array */
|
||||
protected $importData;
|
||||
/** @var array */
|
||||
protected $importRow;
|
||||
/** @var int */
|
||||
protected $imported = 0;
|
||||
/** @var Collection */
|
||||
protected $journals;
|
||||
/** @var array */
|
||||
protected $map;
|
||||
/** @var array */
|
||||
protected $mapped;
|
||||
/** @var array */
|
||||
protected $roles;
|
||||
/** @var int */
|
||||
protected $rows = 0;
|
||||
/** @var array */
|
||||
protected $specifix = [];
|
||||
|
||||
/**
|
||||
* Used by CsvController.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getErrors(): array
|
||||
{
|
||||
return $this->errors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Used by CsvController
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getImported(): int
|
||||
{
|
||||
return $this->imported;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection
|
||||
*/
|
||||
public function getJournals(): Collection
|
||||
{
|
||||
return $this->journals;
|
||||
}
|
||||
|
||||
/**
|
||||
* Used by CsvController
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getRows(): int
|
||||
{
|
||||
return $this->rows;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getSpecifix(): array
|
||||
{
|
||||
return is_array($this->specifix) ? $this->specifix : [];
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
set_time_limit(0);
|
||||
|
||||
$this->journals = new Collection;
|
||||
$this->map = $this->data->getMap();
|
||||
$this->roles = $this->data->getRoles();
|
||||
$this->mapped = $this->data->getMapped();
|
||||
$this->specifix = $this->data->getSpecifix();
|
||||
|
||||
foreach ($this->data->getReader() as $index => $row) {
|
||||
if ($this->parseRow($index)) {
|
||||
$this->rows++;
|
||||
$result = $this->importRow($row);
|
||||
if (!($result instanceof TransactionJournal)) {
|
||||
Log::error('Caught error at row #' . $index . ': ' . $result);
|
||||
$this->errors[$index] = $result;
|
||||
} else {
|
||||
$this->imported++;
|
||||
$this->journals->push($result);
|
||||
event(new TransactionJournalStored($result, 0));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Data $data
|
||||
*/
|
||||
public function setData(Data $data)
|
||||
{
|
||||
$this->data = $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return TransactionJournal|string
|
||||
*/
|
||||
protected function createTransactionJournal()
|
||||
{
|
||||
$date = $this->importData['date'];
|
||||
if (is_null($this->importData['date'])) {
|
||||
$date = $this->importData['date-rent'];
|
||||
}
|
||||
|
||||
|
||||
$transactionType = $this->getTransactionType(); // defaults to deposit
|
||||
$errors = new MessageBag;
|
||||
|
||||
$journal = TransactionJournal::create(
|
||||
[
|
||||
'user_id' => Auth::user()->id,
|
||||
'transaction_type_id' => $transactionType->id,
|
||||
'transaction_currency_id' => $this->importData['currency']->id,
|
||||
'description' => $this->importData['description'],
|
||||
'completed' => 0,
|
||||
'date' => $date,
|
||||
'bill_id' => $this->importData['bill-id'],
|
||||
]
|
||||
);
|
||||
if ($journal->getErrors()->count() == 0) {
|
||||
// first transaction
|
||||
$accountId = $this->importData['asset-account-object']->id; // create first transaction:
|
||||
$amount = $this->importData['amount'];
|
||||
$transaction = Transaction::create(['transaction_journal_id' => $journal->id, 'account_id' => $accountId, 'amount' => $amount]);
|
||||
$errors = $transaction->getErrors();
|
||||
|
||||
// second transaction
|
||||
$accountId = $this->importData['opposing-account-object']->id; // create second transaction:
|
||||
$amount = bcmul($this->importData['amount'], '-1');
|
||||
$transaction = Transaction::create(['transaction_journal_id' => $journal->id, 'account_id' => $accountId, 'amount' => $amount]);
|
||||
$errors = $transaction->getErrors()->merge($errors);
|
||||
}
|
||||
if ($errors->count() == 0) {
|
||||
$journal->completed = 1;
|
||||
$journal->save();
|
||||
} else {
|
||||
$text = join(',', $errors->all());
|
||||
|
||||
return $text;
|
||||
}
|
||||
$this->saveBudget($journal);
|
||||
$this->saveCategory($journal);
|
||||
$this->saveTags($journal);
|
||||
|
||||
// some debug info:
|
||||
$journalId = $journal->id;
|
||||
$type = $journal->transaction_type_type ?? $journal->transactionType->type;
|
||||
/** @var Account $asset */
|
||||
$asset = $this->importData['asset-account-object'];
|
||||
/** @var Account $opposing */
|
||||
$opposing = $this->importData['opposing-account-object'];
|
||||
|
||||
Log::info('Created journal #' . $journalId . ' of type ' . $type . '!');
|
||||
Log::info('Asset account #' . $asset->id . ' lost/gained: ' . $this->importData['amount']);
|
||||
Log::info($opposing->accountType->type . ' #' . $opposing->id . ' lost/gained: ' . bcmul($this->importData['amount'], '-1'));
|
||||
|
||||
return $journal;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return TransactionType
|
||||
*/
|
||||
protected function getTransactionType()
|
||||
{
|
||||
$transactionType = TransactionType::where('type', TransactionType::DEPOSIT)->first();
|
||||
if ($this->importData['amount'] < 0) {
|
||||
$transactionType = TransactionType::where('type', TransactionType::WITHDRAWAL)->first();
|
||||
}
|
||||
|
||||
if (in_array($this->importData['opposing-account-object']->accountType->type, ['Asset account', 'Default account'])) {
|
||||
$transactionType = TransactionType::where('type', TransactionType::TRANSFER)->first();
|
||||
}
|
||||
|
||||
return $transactionType;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $row
|
||||
*
|
||||
* @throws FireflyException
|
||||
* @return string|bool
|
||||
*/
|
||||
protected function importRow(array $row)
|
||||
{
|
||||
|
||||
$data = $this->getFiller(); // These fields are necessary to create a new transaction journal. Some are optional
|
||||
foreach ($row as $index => $value) {
|
||||
$role = $this->roles[$index] ?? '_ignore';
|
||||
$class = config('csv.roles.' . $role . '.converter');
|
||||
$field = config('csv.roles.' . $role . '.field');
|
||||
|
||||
|
||||
// here would be the place where preprocessors would fire.
|
||||
|
||||
/** @var ConverterInterface $converter */
|
||||
$converter = app('FireflyIII\Helpers\Csv\Converter\\' . $class);
|
||||
$converter->setData($data); // the complete array so far.
|
||||
$converter->setField($field);
|
||||
$converter->setIndex($index);
|
||||
$converter->setMapped($this->mapped);
|
||||
$converter->setValue($value);
|
||||
$data[$field] = $converter->convert();
|
||||
}
|
||||
// move to class vars.
|
||||
$this->importData = $data;
|
||||
$this->importRow = $row;
|
||||
unset($data, $row);
|
||||
// post processing and validating.
|
||||
$this->postProcess();
|
||||
$result = $this->validateData();
|
||||
|
||||
if (!($result === true)) {
|
||||
return $result; // return error.
|
||||
}
|
||||
$journal = $this->createTransactionJournal();
|
||||
|
||||
return $journal;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $index
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function parseRow(int $index)
|
||||
{
|
||||
return (($this->data->hasHeaders() && $index >= 1) || !$this->data->hasHeaders());
|
||||
}
|
||||
|
||||
/**
|
||||
* Row denotes the original data.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function postProcess()
|
||||
{
|
||||
// do bank specific fixes (must be enabled but now all of them.
|
||||
|
||||
foreach ($this->getSpecifix() as $className) {
|
||||
/** @var SpecifixInterface $specifix */
|
||||
$specifix = app('FireflyIII\Helpers\Csv\Specifix\\' . $className);
|
||||
if ($specifix->getProcessorType() == SpecifixInterface::POST_PROCESSOR) {
|
||||
$specifix->setData($this->importData);
|
||||
$specifix->setRow($this->importRow);
|
||||
$this->importData = $specifix->fix();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$set = config('csv.post_processors');
|
||||
foreach ($set as $className) {
|
||||
/** @var PostProcessorInterface $postProcessor */
|
||||
$postProcessor = app('FireflyIII\Helpers\Csv\PostProcessing\\' . $className);
|
||||
$array = $this->importData ?? [];
|
||||
$postProcessor->setData($array);
|
||||
$this->importData = $postProcessor->process();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param TransactionJournal $journal
|
||||
*/
|
||||
protected function saveBudget(TransactionJournal $journal)
|
||||
{
|
||||
// add budget:
|
||||
if (!is_null($this->importData['budget'])) {
|
||||
$journal->budgets()->save($this->importData['budget']);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param TransactionJournal $journal
|
||||
*/
|
||||
protected function saveCategory(TransactionJournal $journal)
|
||||
{
|
||||
// add category:
|
||||
if (!is_null($this->importData['category'])) {
|
||||
$journal->categories()->save($this->importData['category']);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param TransactionJournal $journal
|
||||
*/
|
||||
protected function saveTags(TransactionJournal $journal)
|
||||
{
|
||||
if (!is_null($this->importData['tags'])) {
|
||||
foreach ($this->importData['tags'] as $tag) {
|
||||
$journal->tags()->save($tag);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return bool|string
|
||||
*/
|
||||
protected function validateData()
|
||||
{
|
||||
$date = $this->importData['date'] ?? null;
|
||||
$rentDate = $this->importData['date-rent'] ?? null;
|
||||
if (is_null($date) && is_null($rentDate)) {
|
||||
return 'No date value for this row.';
|
||||
}
|
||||
if (is_null($this->importData['opposing-account-object'])) {
|
||||
return 'Opposing account is null';
|
||||
}
|
||||
|
||||
if (!($this->importData['asset-account-object'] instanceof Account)) {
|
||||
return 'No asset account to import into.';
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
private function getFiller()
|
||||
{
|
||||
$filler = [];
|
||||
foreach (config('csv.roles') as $role) {
|
||||
if (isset($role['field'])) {
|
||||
$fieldName = $role['field'];
|
||||
$filler[$fieldName] = null;
|
||||
}
|
||||
}
|
||||
// some extra's:
|
||||
$filler['bill-id'] = null;
|
||||
$filler['opposing-account-object'] = null;
|
||||
$filler['asset-account-object'] = null;
|
||||
$filler['amount-modifier'] = '1';
|
||||
|
||||
return $filler;
|
||||
|
||||
}
|
||||
|
||||
}
|
@@ -82,8 +82,8 @@ class ReportHelper implements ReportHelperInterface
|
||||
$billLine = new BillLine;
|
||||
$billLine->setBill($bill);
|
||||
$billLine->setActive(intval($bill->active) === 1);
|
||||
$billLine->setMin($bill->amount_min);
|
||||
$billLine->setMax($bill->amount_max);
|
||||
$billLine->setMin(strval($bill->amount_min));
|
||||
$billLine->setMax(strval($bill->amount_max));
|
||||
$billLine->setHit(false);
|
||||
// is hit in period?
|
||||
|
||||
|
@@ -50,7 +50,7 @@ class AccountController extends Controller
|
||||
/**
|
||||
* @param string $what
|
||||
*
|
||||
* @return \Illuminate\View\View
|
||||
* @return View
|
||||
*/
|
||||
public function create(string $what = 'asset')
|
||||
{
|
||||
@@ -116,7 +116,7 @@ class AccountController extends Controller
|
||||
* @param ARI $repository
|
||||
* @param Account $account
|
||||
*
|
||||
* @return \Illuminate\View\View
|
||||
* @return View
|
||||
*/
|
||||
public function edit(ARI $repository, Account $account)
|
||||
{
|
||||
@@ -172,7 +172,9 @@ class AccountController extends Controller
|
||||
$subTitleIcon = config('firefly.subIconsByIdentifier.' . $what);
|
||||
$types = config('firefly.accountTypesByIdentifier.' . $what);
|
||||
$accounts = $crud->getAccountsByType($types);
|
||||
/** @var Carbon $start */
|
||||
$start = clone session('start', Carbon::now()->startOfMonth());
|
||||
/** @var Carbon $end */
|
||||
$end = clone session('end', Carbon::now()->endOfMonth());
|
||||
$start->subDay();
|
||||
|
||||
@@ -196,7 +198,7 @@ class AccountController extends Controller
|
||||
* @param ARI $repository
|
||||
* @param Account $account
|
||||
*
|
||||
* @return \Illuminate\View\View
|
||||
* @return View
|
||||
*/
|
||||
public function show(ARI $repository, Account $account)
|
||||
{
|
||||
@@ -204,7 +206,9 @@ class AccountController extends Controller
|
||||
$subTitleIcon = config('firefly.subIconsByIdentifier.' . $account->accountType->type);
|
||||
$subTitle = $account->name;
|
||||
$range = Preferences::get('viewRange', '1M')->data;
|
||||
/** @var Carbon $start */
|
||||
$start = session('start', Navigation::startOfPeriod(new Carbon, $range));
|
||||
/** @var Carbon $end */
|
||||
$end = session('end', Navigation::endOfPeriod(new Carbon, $range));
|
||||
$page = intval(Input::get('page'));
|
||||
$pageSize = Preferences::get('transactionPageSize', 50)->data;
|
||||
@@ -287,7 +291,7 @@ class AccountController extends Controller
|
||||
* @param AccountFormRequest $request
|
||||
* @param AccountCrudInterface $crud
|
||||
*
|
||||
* @return $this|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
|
||||
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
|
||||
*/
|
||||
public function store(AccountFormRequest $request, AccountCrudInterface $crud)
|
||||
{
|
||||
@@ -335,7 +339,7 @@ class AccountController extends Controller
|
||||
* @param AccountCrudInterface $crud
|
||||
* @param Account $account
|
||||
*
|
||||
* @return $this|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
|
||||
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
|
||||
*/
|
||||
public function update(AccountFormRequest $request, AccountCrudInterface $crud, Account $account)
|
||||
{
|
||||
|
@@ -47,7 +47,7 @@ class AttachmentController extends Controller
|
||||
/**
|
||||
* @param Attachment $attachment
|
||||
*
|
||||
* @return \Illuminate\View\View
|
||||
* @return View
|
||||
*/
|
||||
public function delete(Attachment $attachment)
|
||||
{
|
||||
@@ -116,7 +116,7 @@ class AttachmentController extends Controller
|
||||
/**
|
||||
* @param Attachment $attachment
|
||||
*
|
||||
* @return \Illuminate\View\View
|
||||
* @return View
|
||||
*/
|
||||
public function edit(Attachment $attachment)
|
||||
{
|
||||
|
@@ -223,7 +223,7 @@ class AuthController extends Controller
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param string $message
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
* @return \Illuminate\Http\RedirectResponse
|
||||
*/
|
||||
protected function sendFailedLoginResponse(Request $request, string $message)
|
||||
{
|
||||
|
@@ -68,6 +68,8 @@ class ConfirmationController extends Controller
|
||||
|
||||
/**
|
||||
* @param Request $request
|
||||
*
|
||||
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
|
||||
*/
|
||||
public function resendConfirmation(Request $request)
|
||||
{
|
||||
|
@@ -55,7 +55,7 @@ class PasswordController extends Controller
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
* @return \Symfony\Component\HttpFoundation\Response
|
||||
*/
|
||||
public function sendResetLinkEmail(Request $request)
|
||||
{
|
||||
|
@@ -41,7 +41,7 @@ class BillController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\View\View
|
||||
* @return View
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
@@ -66,7 +66,7 @@ class BillController extends Controller
|
||||
/**
|
||||
* @param Bill $bill
|
||||
*
|
||||
* @return \Illuminate\View\View
|
||||
* @return View
|
||||
*/
|
||||
public function delete(Bill $bill)
|
||||
{
|
||||
@@ -99,7 +99,7 @@ class BillController extends Controller
|
||||
/**
|
||||
* @param Bill $bill
|
||||
*
|
||||
* @return \Illuminate\View\View
|
||||
* @return View
|
||||
*/
|
||||
public function edit(Bill $bill)
|
||||
{
|
||||
@@ -123,11 +123,13 @@ class BillController extends Controller
|
||||
/**
|
||||
* @param BillRepositoryInterface $repository
|
||||
*
|
||||
* @return \Illuminate\View\View
|
||||
* @return View
|
||||
*/
|
||||
public function index(BillRepositoryInterface $repository)
|
||||
{
|
||||
/** @var Carbon $start */
|
||||
$start = session('start');
|
||||
/** @var Carbon $end */
|
||||
$end = session('end');
|
||||
|
||||
$bills = $repository->getBills();
|
||||
@@ -187,7 +189,7 @@ class BillController extends Controller
|
||||
* @param BillRepositoryInterface $repository
|
||||
* @param Bill $bill
|
||||
*
|
||||
* @return \Illuminate\View\View
|
||||
* @return View
|
||||
*/
|
||||
public function show(BillRepositoryInterface $repository, Bill $bill)
|
||||
{
|
||||
@@ -195,7 +197,7 @@ class BillController extends Controller
|
||||
$date = session('start');
|
||||
$year = $date->year;
|
||||
$page = intval(Input::get('page')) == 0 ? 1 : intval(Input::get('page'));
|
||||
$pageSize = Preferences::get('transactionPageSize', 50)->data;
|
||||
$pageSize = intval(Preferences::get('transactionPageSize', 50)->data);
|
||||
$journals = $repository->getJournals($bill, $page, $pageSize);
|
||||
$yearAverage = $repository->getYearAverage($bill, $date);
|
||||
$overallAverage = $repository->getOverallAverage($bill);
|
||||
|
@@ -82,7 +82,7 @@ class BudgetController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\View\View
|
||||
* @return View
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
@@ -101,7 +101,7 @@ class BudgetController extends Controller
|
||||
/**
|
||||
* @param Budget $budget
|
||||
*
|
||||
* @return \Illuminate\View\View
|
||||
* @return View
|
||||
*/
|
||||
public function delete(Budget $budget)
|
||||
{
|
||||
@@ -138,7 +138,7 @@ class BudgetController extends Controller
|
||||
/**
|
||||
* @param Budget $budget
|
||||
*
|
||||
* @return \Illuminate\View\View
|
||||
* @return View
|
||||
*/
|
||||
public function edit(Budget $budget)
|
||||
{
|
||||
@@ -237,7 +237,7 @@ class BudgetController extends Controller
|
||||
/**
|
||||
* @param BudgetRepositoryInterface $repository
|
||||
*
|
||||
* @return \Illuminate\View\View
|
||||
* @return View
|
||||
*/
|
||||
public function noBudget(BudgetRepositoryInterface $repository)
|
||||
{
|
||||
@@ -411,7 +411,7 @@ class BudgetController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\View\View
|
||||
* @return View
|
||||
*/
|
||||
public function updateIncome()
|
||||
{
|
||||
|
@@ -47,7 +47,7 @@ class CategoryController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\View\View
|
||||
* @return View
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
@@ -66,7 +66,7 @@ class CategoryController extends Controller
|
||||
/**
|
||||
* @param Category $category
|
||||
*
|
||||
* @return \Illuminate\View\View
|
||||
* @return View
|
||||
*/
|
||||
public function delete(Category $category)
|
||||
{
|
||||
@@ -101,7 +101,7 @@ class CategoryController extends Controller
|
||||
/**
|
||||
* @param Category $category
|
||||
*
|
||||
* @return \Illuminate\View\View
|
||||
* @return View
|
||||
*/
|
||||
public function edit(Category $category)
|
||||
{
|
||||
@@ -122,7 +122,7 @@ class CategoryController extends Controller
|
||||
/**
|
||||
* @param CRI $repository
|
||||
*
|
||||
* @return \Illuminate\View\View
|
||||
* @return View
|
||||
*/
|
||||
public function index(CRI $repository)
|
||||
{
|
||||
@@ -140,7 +140,7 @@ class CategoryController extends Controller
|
||||
/**
|
||||
* @param CRI $repository
|
||||
*
|
||||
* @return \Illuminate\View\View
|
||||
* @return View
|
||||
*/
|
||||
public function noCategory(CRI $repository)
|
||||
{
|
||||
@@ -166,9 +166,10 @@ class CategoryController extends Controller
|
||||
*/
|
||||
public function show(CRI $repository, AccountCrudInterface $crud, Category $category)
|
||||
{
|
||||
/** @var Carbon $carbon */
|
||||
$range = Preferences::get('viewRange', '1M')->data;
|
||||
/** @var Carbon $start */
|
||||
$start = session('start', Navigation::startOfPeriod(new Carbon, $range));
|
||||
/** @var Carbon $end */
|
||||
$end = session('end', Navigation::endOfPeriod(new Carbon, $range));
|
||||
$hideCategory = true; // used in list.
|
||||
$page = intval(Input::get('page'));
|
||||
@@ -232,7 +233,7 @@ class CategoryController extends Controller
|
||||
*
|
||||
* @param $date
|
||||
*
|
||||
* @return \Illuminate\View\View
|
||||
* @return View
|
||||
*/
|
||||
public function showWithDate(CRI $repository, Category $category, string $date)
|
||||
{
|
||||
|
@@ -214,8 +214,9 @@ class BudgetController extends Controller
|
||||
$repetitions = $repetitions->filter(
|
||||
function (LimitRepetition $repetition) use ($budgetIds) {
|
||||
if (in_array(strval($repetition->budget_id), $budgetIds)) {
|
||||
return $repetition;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
);
|
||||
/** @var LimitRepetition $repetition */
|
||||
@@ -289,8 +290,9 @@ class BudgetController extends Controller
|
||||
$reps = $repetitions->filter(
|
||||
function (LimitRepetition $repetition) use ($budget, $currentStart) {
|
||||
if ($repetition->budget_id === $budget->id && $repetition->startdate == $currentStart) {
|
||||
return $repetition;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
);
|
||||
$budgeted = $reps->sum('amount');
|
||||
@@ -325,8 +327,9 @@ class BudgetController extends Controller
|
||||
return $repetitions->filter(
|
||||
function (LimitRepetition $repetition) use ($budget, $start, $end) {
|
||||
if ($repetition->startdate < $end && $repetition->enddate > $start && $repetition->budget_id === $budget->id) {
|
||||
return $repetition;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
@@ -43,7 +43,7 @@ class CurrencyController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\View\View
|
||||
* @return View
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
@@ -131,7 +131,7 @@ class CurrencyController extends Controller
|
||||
/**
|
||||
* @param TransactionCurrency $currency
|
||||
*
|
||||
* @return \Illuminate\View\View
|
||||
* @return View
|
||||
*/
|
||||
public function edit(TransactionCurrency $currency)
|
||||
{
|
||||
@@ -154,7 +154,7 @@ class CurrencyController extends Controller
|
||||
/**
|
||||
* @param CurrencyRepositoryInterface $repository
|
||||
*
|
||||
* @return \Illuminate\View\View
|
||||
* @return View
|
||||
*/
|
||||
public function index(CurrencyRepositoryInterface $repository)
|
||||
{
|
||||
@@ -175,7 +175,7 @@ class CurrencyController extends Controller
|
||||
* @param CurrencyFormRequest $request
|
||||
* @param CurrencyRepositoryInterface $repository
|
||||
*
|
||||
* @return $this|\Illuminate\Http\RedirectResponse
|
||||
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
|
||||
*/
|
||||
public function store(CurrencyFormRequest $request, CurrencyRepositoryInterface $repository)
|
||||
{
|
||||
|
@@ -92,7 +92,7 @@ class ExportController extends Controller
|
||||
* @param AccountCrudInterface $crud
|
||||
* @param EJRI $jobs
|
||||
*
|
||||
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
|
||||
* @return View
|
||||
*/
|
||||
public function index(AccountCrudInterface $crud, EJRI $jobs)
|
||||
{
|
||||
|
@@ -97,7 +97,7 @@ class HomeController extends Controller
|
||||
|
||||
/** @var Tag $tag */
|
||||
foreach ($tags as $tag) {
|
||||
foreach ($tag->transactionjournals()->get() as $journal) {
|
||||
foreach ($tag->transactionJournals()->get() as $journal) {
|
||||
$count = $journal->tags()->count();
|
||||
$journal->tag_count = $count;
|
||||
$journal->save();
|
||||
|
@@ -263,7 +263,7 @@ class ImportController extends Controller
|
||||
*
|
||||
* @param ImportJob $job
|
||||
*
|
||||
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
|
||||
* @return View
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function settings(ImportJob $job)
|
||||
|
@@ -38,7 +38,7 @@ class NewUserController extends Controller
|
||||
/**
|
||||
* @param ARI $repository
|
||||
*
|
||||
* @@return \Illuminate\Http\RedirectResponse|\Illuminate\View\View
|
||||
* @@return View
|
||||
*/
|
||||
public function index(ARI $repository)
|
||||
{
|
||||
|
@@ -54,7 +54,7 @@ class PiggyBankController extends Controller
|
||||
* @param ARI $repository
|
||||
* @param PiggyBank $piggyBank
|
||||
*
|
||||
* @return $this
|
||||
* @return View
|
||||
*/
|
||||
public function add(ARI $repository, PiggyBank $piggyBank)
|
||||
{
|
||||
@@ -74,7 +74,7 @@ class PiggyBankController extends Controller
|
||||
* @param ARI $repository
|
||||
* @param PiggyBank $piggyBank
|
||||
*
|
||||
* @return $this
|
||||
* @return View
|
||||
*/
|
||||
public function addMobile(ARI $repository, PiggyBank $piggyBank)
|
||||
{
|
||||
@@ -113,7 +113,7 @@ class PiggyBankController extends Controller
|
||||
/**
|
||||
* @param PiggyBank $piggyBank
|
||||
*
|
||||
* @return $this
|
||||
* @return View
|
||||
*/
|
||||
public function delete(PiggyBank $piggyBank)
|
||||
{
|
||||
@@ -254,6 +254,7 @@ class PiggyBankController extends Controller
|
||||
public function postAdd(PiggyBankRepositoryInterface $repository, ARI $accounts, PiggyBank $piggyBank)
|
||||
{
|
||||
$amount = strval(round(Input::get('amount'), 2));
|
||||
/** @var Carbon $date */
|
||||
$date = session('end', Carbon::now()->endOfMonth());
|
||||
$leftOnAccount = $accounts->leftOnAccount($piggyBank->account, $date);
|
||||
$savedSoFar = strval($piggyBank->currentRelevantRep()->currentamount);
|
||||
@@ -320,7 +321,7 @@ class PiggyBankController extends Controller
|
||||
* @param PiggyBank $piggyBank
|
||||
*
|
||||
*
|
||||
* @return \Illuminate\View\View
|
||||
* @return View
|
||||
*/
|
||||
public function remove(PiggyBank $piggyBank)
|
||||
{
|
||||
@@ -332,7 +333,7 @@ class PiggyBankController extends Controller
|
||||
*
|
||||
* @param PiggyBank $piggyBank
|
||||
*
|
||||
* @return $this
|
||||
* @return View
|
||||
*/
|
||||
public function removeMobile(PiggyBank $piggyBank)
|
||||
{
|
||||
@@ -358,7 +359,7 @@ class PiggyBankController extends Controller
|
||||
* @param PiggyBankFormRequest $request
|
||||
* @param PiggyBankRepositoryInterface $repository
|
||||
*
|
||||
* @return $this|\Illuminate\Http\RedirectResponse
|
||||
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
|
||||
*/
|
||||
public function store(PiggyBankFormRequest $request, PiggyBankRepositoryInterface $repository)
|
||||
{
|
||||
|
@@ -110,8 +110,9 @@ class ReportController extends Controller
|
||||
function (TransactionJournal $journal) {
|
||||
$tags = $journal->tags()->where('tagMode', 'balancingAct')->count();
|
||||
if ($tags === 0) {
|
||||
return $journal;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
);
|
||||
break;
|
||||
@@ -191,8 +192,9 @@ class ReportController extends Controller
|
||||
$journals = $journals->filter(
|
||||
function (TransactionJournal $journal) use ($account) {
|
||||
if ($journal->destination_account_id === $account->id) {
|
||||
return $journal;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
);
|
||||
|
||||
@@ -225,8 +227,9 @@ class ReportController extends Controller
|
||||
$journal->source_account_id === $account->id
|
||||
&& in_array($journal->destination_account_id, $destinations)
|
||||
) {
|
||||
return $journal;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
);
|
||||
|
||||
|
@@ -46,6 +46,7 @@ class PreferencesController extends Controller
|
||||
public function code(Google2FA $google2fa)
|
||||
{
|
||||
$domain = $this->getDomain();
|
||||
/** @noinspection PhpMethodParametersCountMismatchInspection */
|
||||
$secret = $google2fa->generateSecretKey(16, Auth::user()->id);
|
||||
Session::flash('two-factor-secret', $secret);
|
||||
$image = $google2fa->getQRCodeInline('Firefly III at ' . $domain, null, $secret, 150);
|
||||
|
@@ -19,6 +19,7 @@ use FireflyIII\User;
|
||||
use Hash;
|
||||
use Preferences;
|
||||
use Session;
|
||||
use View;
|
||||
|
||||
/**
|
||||
* Class ProfileController
|
||||
@@ -36,7 +37,7 @@ class ProfileController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\View\View
|
||||
* @return View
|
||||
*/
|
||||
public function changePassword()
|
||||
{
|
||||
@@ -46,7 +47,7 @@ class ProfileController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\View\View
|
||||
* @return View
|
||||
*/
|
||||
public function deleteAccount()
|
||||
{
|
||||
@@ -56,7 +57,7 @@ class ProfileController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\View\View
|
||||
* @return View
|
||||
*
|
||||
*/
|
||||
public function index()
|
||||
|
@@ -233,7 +233,7 @@ class RuleController extends Controller
|
||||
* @param RuleRepositoryInterface $repository
|
||||
* @param RuleGroup $ruleGroup
|
||||
*
|
||||
* @return $this|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
|
||||
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
|
||||
*/
|
||||
public function store(RuleFormRequest $request, RuleRepositoryInterface $repository, RuleGroup $ruleGroup)
|
||||
{
|
||||
@@ -281,7 +281,7 @@ class RuleController extends Controller
|
||||
*
|
||||
* @param TestRuleFormRequest $request
|
||||
*
|
||||
* @return \Illuminate\View\View
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
*/
|
||||
public function testTriggers(TestRuleFormRequest $request)
|
||||
{
|
||||
@@ -336,7 +336,7 @@ class RuleController extends Controller
|
||||
* @param RuleFormRequest $request
|
||||
* @param Rule $rule
|
||||
*
|
||||
* @return $this|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
|
||||
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
|
||||
*/
|
||||
public function update(RuleRepositoryInterface $repository, RuleFormRequest $request, Rule $rule)
|
||||
{
|
||||
|
@@ -200,7 +200,7 @@ class RuleGroupController extends Controller
|
||||
* @param RuleGroupFormRequest $request
|
||||
* @param RuleGroupRepositoryInterface $repository
|
||||
*
|
||||
* @return $this|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
|
||||
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
|
||||
*/
|
||||
public function store(RuleGroupFormRequest $request, RuleGroupRepositoryInterface $repository)
|
||||
{
|
||||
@@ -245,7 +245,7 @@ class RuleGroupController extends Controller
|
||||
* @param RuleGroupRepositoryInterface $repository
|
||||
* @param RuleGroup $ruleGroup
|
||||
*
|
||||
* @return $this|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
|
||||
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
|
||||
*/
|
||||
public function update(RuleGroupFormRequest $request, RuleGroupRepositoryInterface $repository, RuleGroup $ruleGroup)
|
||||
{
|
||||
|
@@ -61,7 +61,7 @@ class TagController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\View\View
|
||||
* @return View
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
@@ -88,7 +88,7 @@ class TagController extends Controller
|
||||
/**
|
||||
* @param Tag $tag
|
||||
*
|
||||
* @return \Illuminate\View\View
|
||||
* @return View
|
||||
*/
|
||||
public function delete(Tag $tag)
|
||||
{
|
||||
@@ -123,7 +123,7 @@ class TagController extends Controller
|
||||
/**
|
||||
* @param Tag $tag
|
||||
*
|
||||
* @return \Illuminate\View\View
|
||||
* @return View
|
||||
*/
|
||||
public function edit(Tag $tag)
|
||||
{
|
||||
@@ -220,14 +220,14 @@ class TagController extends Controller
|
||||
/**
|
||||
* @param Tag $tag
|
||||
*
|
||||
* @return \Illuminate\View\View
|
||||
* @return View
|
||||
*/
|
||||
public function show(Tag $tag)
|
||||
{
|
||||
$subTitle = $tag->tag;
|
||||
$subTitleIcon = 'fa-tag';
|
||||
/** @var Collection $journals */
|
||||
$journals = $tag->transactionjournals()->sortCorrectly()->expanded()->get(TransactionJournal::queryFields());
|
||||
$journals = $tag->transactionJournals()->sortCorrectly()->expanded()->get(TransactionJournal::queryFields());
|
||||
|
||||
$sum = $journals->sum(
|
||||
function (TransactionJournal $journal) {
|
||||
|
@@ -160,7 +160,7 @@ class SplitController extends Controller
|
||||
* @param JournalInterface $repository
|
||||
* @param AttachmentHelperInterface $att
|
||||
*
|
||||
* @return $this|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
|
||||
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
|
||||
*/
|
||||
public function update(TransactionJournal $journal, SplitJournalFormRequest $request, JournalInterface $repository, AttachmentHelperInterface $att)
|
||||
{
|
||||
|
@@ -49,7 +49,7 @@ class TransactionController extends Controller
|
||||
/**
|
||||
* @param string $what
|
||||
*
|
||||
* @return \Illuminate\View\View
|
||||
* @return View
|
||||
*/
|
||||
public function create(string $what = TransactionType::DEPOSIT)
|
||||
{
|
||||
@@ -88,7 +88,7 @@ class TransactionController extends Controller
|
||||
*
|
||||
* @param TransactionJournal $journal
|
||||
*
|
||||
* @return \Illuminate\View\View
|
||||
* @return View
|
||||
*/
|
||||
public function delete(TransactionJournal $journal)
|
||||
{
|
||||
@@ -336,7 +336,7 @@ class TransactionController extends Controller
|
||||
* @param AttachmentHelperInterface $att
|
||||
* @param TransactionJournal $journal
|
||||
*
|
||||
* @return $this|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
|
||||
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
|
||||
*/
|
||||
public function update(JournalFormRequest $request, JournalRepositoryInterface $repository, AttachmentHelperInterface $att, TransactionJournal $journal)
|
||||
{
|
||||
|
@@ -27,6 +27,7 @@ class BillName extends BasicConverter implements ConverterInterface
|
||||
/**
|
||||
* @param $value
|
||||
*
|
||||
* @return Bill
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function convert($value)
|
||||
|
@@ -313,7 +313,7 @@ class ImportStorage
|
||||
$meta = new TransactionJournalMeta;
|
||||
$meta->name = 'originalImportHash';
|
||||
$meta->data = $entry->hash;
|
||||
$meta->transactionjournal()->associate($journal);
|
||||
$meta->transactionJournal()->associate($journal);
|
||||
$meta->save();
|
||||
|
||||
return $journal;
|
||||
|
@@ -1,18 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Map.php
|
||||
* Copyright (C) 2016 thegrumpydictator@gmail.com
|
||||
*
|
||||
* This software may be modified and distributed under the terms
|
||||
* of the MIT license. See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
declare(strict_types = 1);
|
||||
|
||||
namespace FireflyIII\Import\Role;
|
||||
|
||||
|
||||
class Map
|
||||
{
|
||||
|
||||
}
|
@@ -1,18 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Role.php
|
||||
* Copyright (C) 2016 thegrumpydictator@gmail.com
|
||||
*
|
||||
* This software may be modified and distributed under the terms
|
||||
* of the MIT license. See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
declare(strict_types = 1);
|
||||
|
||||
namespace FireflyIII\Import\Role;
|
||||
|
||||
|
||||
class Role
|
||||
{
|
||||
|
||||
}
|
@@ -184,7 +184,9 @@ class CsvSetup implements SetupInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $data
|
||||
* @param array $data
|
||||
*
|
||||
* @param FileBag $files
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
|
@@ -62,7 +62,9 @@ interface SetupInterface
|
||||
public function requireUserSettings(): bool;
|
||||
|
||||
/**
|
||||
* @param array $data
|
||||
* @param array $data
|
||||
*
|
||||
* @param FileBag $files
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
|
@@ -183,6 +183,7 @@ class Account extends Model
|
||||
* @param $value
|
||||
*
|
||||
* @return string
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function getIbanAttribute($value): string
|
||||
{
|
||||
|
@@ -156,7 +156,7 @@ class Bill extends Model
|
||||
/**
|
||||
* @return HasMany
|
||||
*/
|
||||
public function transactionjournals(): HasMany
|
||||
public function transactionJournals(): HasMany
|
||||
{
|
||||
return $this->hasMany('FireflyIII\Models\TransactionJournal');
|
||||
}
|
||||
|
@@ -146,7 +146,7 @@ class Budget extends Model
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
*/
|
||||
public function transactionjournals()
|
||||
public function transactionJournals()
|
||||
{
|
||||
return $this->belongsToMany('FireflyIII\Models\TransactionJournal', 'budget_transaction_journal', 'budget_id');
|
||||
}
|
||||
|
@@ -126,7 +126,7 @@ class Category extends Model
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
*/
|
||||
public function transactionjournals()
|
||||
public function transactionJournals()
|
||||
{
|
||||
return $this->belongsToMany('FireflyIII\Models\TransactionJournal', 'category_transaction_journal', 'category_id');
|
||||
}
|
||||
|
@@ -56,7 +56,7 @@ class LimitRepetition extends Model
|
||||
{
|
||||
if (Auth::check()) {
|
||||
$object = LimitRepetition::where('limit_repetitions.id', $value)
|
||||
->leftjoin('budget_limits', 'budget_limits.id', '=', 'limit_repetitions.budget_limit_id')
|
||||
->leftJoin('budget_limits', 'budget_limits.id', '=', 'limit_repetitions.budget_limit_id')
|
||||
->leftJoin('budgets', 'budgets.id', '=', 'budget_limits.budget_id')
|
||||
->where('budgets.user_id', Auth::user()->id)
|
||||
->first(['limit_repetitions.*']);
|
||||
|
@@ -57,7 +57,7 @@ class PiggyBankRepetition extends Model
|
||||
* @param Carbon $start
|
||||
* @param Carbon $target
|
||||
*
|
||||
* @return $this
|
||||
* @return EloquentBuilder
|
||||
*/
|
||||
public function scopeOnDates(EloquentBuilder $query, Carbon $start, Carbon $target)
|
||||
{
|
||||
|
@@ -51,7 +51,7 @@ class RuleGroup extends Model
|
||||
/**
|
||||
* @param RuleGroup $value
|
||||
*
|
||||
* @return Rule
|
||||
* @return RuleGroup
|
||||
*/
|
||||
public static function routeBinder(RuleGroup $value)
|
||||
{
|
||||
|
@@ -155,7 +155,7 @@ class Tag extends TagSupport
|
||||
*/
|
||||
public function save(array $options = [])
|
||||
{
|
||||
foreach ($this->transactionjournals()->get() as $journal) {
|
||||
foreach ($this->transactionJournals()->get() as $journal) {
|
||||
$count = $journal->tags()->count();
|
||||
$journal->tag_count = $count;
|
||||
$journal->save();
|
||||
@@ -185,7 +185,7 @@ class Tag extends TagSupport
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
*/
|
||||
public function transactionjournals()
|
||||
public function transactionJournals()
|
||||
{
|
||||
return $this->belongsToMany('FireflyIII\Models\TransactionJournal');
|
||||
}
|
||||
|
@@ -42,7 +42,7 @@ class TransactionGroup extends Model
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
*/
|
||||
public function transactionjournals()
|
||||
public function transactionJournals()
|
||||
{
|
||||
return $this->belongsToMany('FireflyIII\Models\TransactionJournal');
|
||||
}
|
||||
|
@@ -37,8 +37,6 @@ class AccountRepository implements AccountRepositoryInterface
|
||||
|
||||
/** @var User */
|
||||
private $user;
|
||||
/** @var array */
|
||||
private $validFields = ['accountRole', 'ccMonthlyPaymentDate', 'ccType', 'accountNumber'];
|
||||
|
||||
/**
|
||||
* AttachmentRepository constructor.
|
||||
@@ -76,7 +74,7 @@ class AccountRepository implements AccountRepositoryInterface
|
||||
*/
|
||||
public function earnedFromInPeriod(Collection $accounts, Carbon $start, Carbon $end): string
|
||||
{
|
||||
$query = $this->user->transactionjournals()->expanded()->sortCorrectly()
|
||||
$query = $this->user->transactionJournals()->expanded()->sortCorrectly()
|
||||
->transactionTypes([TransactionType::DEPOSIT]);
|
||||
|
||||
if ($end >= $start) {
|
||||
@@ -113,7 +111,7 @@ class AccountRepository implements AccountRepositoryInterface
|
||||
*/
|
||||
public function earnedInPeriod(Collection $accounts, Carbon $start, Carbon $end): string
|
||||
{
|
||||
$query = $this->user->transactionjournals()->expanded()->sortCorrectly()
|
||||
$query = $this->user->transactionJournals()->expanded()->sortCorrectly()
|
||||
->transactionTypes([TransactionType::DEPOSIT, TransactionType::TRANSFER]);
|
||||
|
||||
if ($end >= $start) {
|
||||
@@ -178,15 +176,16 @@ class AccountRepository implements AccountRepositoryInterface
|
||||
$journals = $journals->filter(
|
||||
function (TransactionJournal $journal) use ($accountIds) {
|
||||
if ($journal->transaction_type_type == TransactionType::WITHDRAWAL) {
|
||||
return $journal;
|
||||
return true;
|
||||
}
|
||||
/*
|
||||
* The source of a transfer must be one of the $accounts in order to
|
||||
* be included. Otherwise, it would not be an expense.
|
||||
*/
|
||||
if (in_array($journal->source_account_id, $accountIds)) {
|
||||
return $journal;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
);
|
||||
|
||||
@@ -362,15 +361,16 @@ class AccountRepository implements AccountRepositoryInterface
|
||||
$journals = $journals->filter(
|
||||
function (TransactionJournal $journal) use ($accountIds) {
|
||||
if ($journal->transaction_type_type == TransactionType::DEPOSIT) {
|
||||
return $journal;
|
||||
return true;
|
||||
}
|
||||
/*
|
||||
* The destination of a transfer must be one of the $accounts in order to
|
||||
* be included. Otherwise, it would not be income.
|
||||
*/
|
||||
if (in_array($journal->destination_account_id, $accountIds)) {
|
||||
return $journal;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
);
|
||||
|
||||
@@ -388,7 +388,7 @@ class AccountRepository implements AccountRepositoryInterface
|
||||
public function journalsInPeriod(Collection $accounts, array $types, Carbon $start, Carbon $end): Collection
|
||||
{
|
||||
// first collect actual transaction journals (fairly easy)
|
||||
$query = $this->user->transactionjournals()->expanded()->sortCorrectly();
|
||||
$query = $this->user->transactionJournals()->expanded()->sortCorrectly();
|
||||
|
||||
if ($end >= $start) {
|
||||
$query->before($end)->after($start);
|
||||
@@ -436,7 +436,7 @@ class AccountRepository implements AccountRepositoryInterface
|
||||
|
||||
$balance = Steam::balanceIgnoreVirtual($account, $date);
|
||||
/** @var PiggyBank $p */
|
||||
foreach ($account->piggybanks()->get() as $p) {
|
||||
foreach ($account->piggyBanks()->get() as $p) {
|
||||
$currentAmount = $p->currentRelevantRep()->currentamount ?? '0';
|
||||
|
||||
$balance = bcsub($balance, $currentAmount);
|
||||
@@ -527,7 +527,7 @@ class AccountRepository implements AccountRepositoryInterface
|
||||
public function spentAtInPeriod(Collection $accounts, Carbon $start, Carbon $end): string
|
||||
{
|
||||
/** @var HasMany $query */
|
||||
$query = $this->user->transactionjournals()->expanded()->sortCorrectly()
|
||||
$query = $this->user->transactionJournals()->expanded()->sortCorrectly()
|
||||
->transactionTypes([TransactionType::WITHDRAWAL]);
|
||||
if ($end >= $start) {
|
||||
$query->before($end)->after($start);
|
||||
@@ -563,7 +563,7 @@ class AccountRepository implements AccountRepositoryInterface
|
||||
public function spentInPeriod(Collection $accounts, Carbon $start, Carbon $end): string
|
||||
{
|
||||
/** @var HasMany $query */
|
||||
$query = $this->user->transactionjournals()->expanded()->sortCorrectly()
|
||||
$query = $this->user->transactionJournals()->expanded()->sortCorrectly()
|
||||
->transactionTypes([TransactionType::WITHDRAWAL, TransactionType::TRANSFER]);
|
||||
if ($end >= $start) {
|
||||
$query->before($end)->after($start);
|
||||
|
@@ -125,7 +125,7 @@ class BillRepository implements BillRepositoryInterface
|
||||
{
|
||||
$ids = $bills->pluck('id')->toArray();
|
||||
|
||||
$set = $this->user->transactionjournals()
|
||||
$set = $this->user->transactionJournals()
|
||||
->leftJoin(
|
||||
'transactions', function (JoinClause $join) {
|
||||
$join->on('transactions.transaction_journal_id', '=', 'transaction_journals.id')->where('transactions.amount', '<', 0);
|
||||
@@ -221,7 +221,7 @@ class BillRepository implements BillRepositoryInterface
|
||||
$ranges = $this->getRanges($bill, $start, $end);
|
||||
|
||||
foreach ($ranges as $range) {
|
||||
$paid = $bill->transactionjournals()
|
||||
$paid = $bill->transactionJournals()
|
||||
->before($range['end'])
|
||||
->after($range['start'])
|
||||
->leftJoin(
|
||||
@@ -256,7 +256,7 @@ class BillRepository implements BillRepositoryInterface
|
||||
$ranges = $this->getRanges($bill, $start, $end);
|
||||
$paidBill = '0';
|
||||
foreach ($ranges as $range) {
|
||||
$paid = $bill->transactionjournals()
|
||||
$paid = $bill->transactionJournals()
|
||||
->before($range['end'])
|
||||
->after($range['start'])
|
||||
->leftJoin(
|
||||
@@ -290,7 +290,7 @@ class BillRepository implements BillRepositoryInterface
|
||||
public function getJournals(Bill $bill, int $page, int $pageSize = 50): LengthAwarePaginator
|
||||
{
|
||||
$offset = ($page - 1) * $pageSize;
|
||||
$query = $bill->transactionjournals()
|
||||
$query = $bill->transactionJournals()
|
||||
->expanded()
|
||||
->sortCorrectly();
|
||||
$count = $query->count();
|
||||
@@ -311,7 +311,7 @@ class BillRepository implements BillRepositoryInterface
|
||||
*/
|
||||
public function getJournalsInRange(Bill $bill, Carbon $start, Carbon $end): Collection
|
||||
{
|
||||
return $bill->transactionjournals()->before($end)->after($start)->get();
|
||||
return $bill->transactionJournals()->before($end)->after($start)->get();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -321,7 +321,7 @@ class BillRepository implements BillRepositoryInterface
|
||||
*/
|
||||
public function getOverallAverage($bill): string
|
||||
{
|
||||
$journals = $bill->transactionjournals()->get();
|
||||
$journals = $bill->transactionJournals()->get();
|
||||
$sum = '0';
|
||||
$count = strval($journals->count());
|
||||
/** @var TransactionJournal $journal */
|
||||
@@ -351,7 +351,7 @@ class BillRepository implements BillRepositoryInterface
|
||||
|
||||
$journals = new Collection;
|
||||
if (count($ids) > 0) {
|
||||
$journals = $this->user->transactionjournals()->transactionTypes([TransactionType::WITHDRAWAL])->whereIn('transaction_journals.id', $ids)->get(
|
||||
$journals = $this->user->transactionJournals()->transactionTypes([TransactionType::WITHDRAWAL])->whereIn('transaction_journals.id', $ids)->get(
|
||||
['transaction_journals.*']
|
||||
);
|
||||
}
|
||||
@@ -409,7 +409,7 @@ class BillRepository implements BillRepositoryInterface
|
||||
*/
|
||||
public function getYearAverage(Bill $bill, Carbon $date): string
|
||||
{
|
||||
$journals = $bill->transactionjournals()
|
||||
$journals = $bill->transactionJournals()
|
||||
->where('date', '>=', $date->year . '-01-01')
|
||||
->where('date', '<=', $date->year . '-12-31')
|
||||
->get();
|
||||
@@ -434,7 +434,7 @@ class BillRepository implements BillRepositoryInterface
|
||||
*/
|
||||
public function lastFoundMatch(Bill $bill): Carbon
|
||||
{
|
||||
$last = $bill->transactionjournals()->orderBy('date', 'DESC')->first();
|
||||
$last = $bill->transactionJournals()->orderBy('date', 'DESC')->first();
|
||||
if ($last) {
|
||||
return $last->date;
|
||||
}
|
||||
@@ -476,7 +476,7 @@ class BillRepository implements BillRepositoryInterface
|
||||
if (($counter % $skip) == 0) {
|
||||
// do something.
|
||||
$end = Navigation::endOfPeriod(clone $start, $bill->repeat_freq);
|
||||
$journalCount = $bill->transactionjournals()->before($end)->after($start)->count();
|
||||
$journalCount = $bill->transactionJournals()->before($end)->after($start)->count();
|
||||
if ($journalCount == 0) {
|
||||
$finalDate = new Carbon($start->format('Y-m-d'));
|
||||
break;
|
||||
|
@@ -116,7 +116,7 @@ class BudgetRepository implements BudgetRepositoryInterface
|
||||
public function firstUseDate(Budget $budget): Carbon
|
||||
{
|
||||
$oldest = Carbon::create()->startOfYear();
|
||||
$journal = $budget->transactionjournals()->orderBy('date', 'ASC')->first();
|
||||
$journal = $budget->transactionJournals()->orderBy('date', 'ASC')->first();
|
||||
if (!is_null($journal)) {
|
||||
$oldest = $journal->date < $oldest ? $journal->date : $oldest;
|
||||
}
|
||||
@@ -225,7 +225,7 @@ class BudgetRepository implements BudgetRepositoryInterface
|
||||
}
|
||||
|
||||
// first get all journals for all budget(s):
|
||||
$journalQuery = $this->user->transactionjournals()
|
||||
$journalQuery = $this->user->transactionJournals()
|
||||
->expanded()
|
||||
->sortCorrectly()
|
||||
->before($end)
|
||||
@@ -246,7 +246,7 @@ class BudgetRepository implements BudgetRepositoryInterface
|
||||
$journals = $journalQuery->get(TransactionJournal::queryFields());
|
||||
|
||||
// then get transactions themselves.
|
||||
$transactionQuery = $this->user->transactionjournals()
|
||||
$transactionQuery = $this->user->transactionJournals()
|
||||
->expanded()
|
||||
->before($end)
|
||||
->sortCorrectly()
|
||||
@@ -290,7 +290,7 @@ class BudgetRepository implements BudgetRepositoryInterface
|
||||
|
||||
/** @var Collection $set */
|
||||
$query = $this->user
|
||||
->transactionjournals()
|
||||
->transactionJournals()
|
||||
->expanded()
|
||||
->sortCorrectly()
|
||||
->transactionTypes([TransactionType::WITHDRAWAL])
|
||||
@@ -322,9 +322,10 @@ class BudgetRepository implements BudgetRepositoryInterface
|
||||
function (TransactionJournal $journal) {
|
||||
foreach ($journal->transactions as $t) {
|
||||
if ($t->budgets->count() === 0) {
|
||||
return $journal;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
);
|
||||
|
||||
@@ -343,7 +344,7 @@ class BudgetRepository implements BudgetRepositoryInterface
|
||||
{
|
||||
// first collect actual transaction journals (fairly easy)
|
||||
$query = $this->user
|
||||
->transactionjournals()
|
||||
->transactionJournals()
|
||||
->leftJoin(
|
||||
'transactions as source', function (JoinClause $join) {
|
||||
$join->on('source.transaction_journal_id', '=', 'transaction_journals.id')->where('source.amount', '<', 0);
|
||||
@@ -415,7 +416,7 @@ class BudgetRepository implements BudgetRepositoryInterface
|
||||
public function spentInPeriodWithoutBudget(Collection $accounts, Carbon $start, Carbon $end): string
|
||||
{
|
||||
$types = [TransactionType::WITHDRAWAL];
|
||||
$query = $this->user->transactionjournals()
|
||||
$query = $this->user->transactionJournals()
|
||||
->distinct()
|
||||
->transactionTypes($types)
|
||||
->leftJoin('budget_transaction_journal', 'budget_transaction_journal.transaction_journal_id', '=', 'transaction_journals.id')
|
||||
|
@@ -131,7 +131,7 @@ class CategoryRepository implements CategoryRepositoryInterface
|
||||
$first = null;
|
||||
|
||||
/** @var TransactionJournal $first */
|
||||
$firstJournalQuery = $category->transactionjournals()->orderBy('date', 'ASC');
|
||||
$firstJournalQuery = $category->transactionJournals()->orderBy('date', 'ASC');
|
||||
|
||||
if ($accounts->count() > 0) {
|
||||
// filter journals:
|
||||
@@ -198,13 +198,13 @@ class CategoryRepository implements CategoryRepositoryInterface
|
||||
{
|
||||
$complete = new Collection;
|
||||
// first collect actual transaction journals (fairly easy)
|
||||
$query = $this->user->transactionjournals()->expanded()->sortCorrectly();
|
||||
$query = $this->user->transactionJournals()->expanded()->sortCorrectly();
|
||||
$query->leftJoin('category_transaction_journal', 'category_transaction_journal.transaction_journal_id', '=', 'transaction_journals.id');
|
||||
$query->where('category_transaction_journal.category_id', $category->id);
|
||||
$first = $query->get(TransactionJournal::queryFields());
|
||||
|
||||
// then collection transactions (harder)
|
||||
$query = $this->user->transactionjournals()->distinct()
|
||||
$query = $this->user->transactionJournals()->distinct()
|
||||
->leftJoin('transactions', 'transaction_journals.id', '=', 'transactions.transaction_journal_id')
|
||||
->leftJoin('category_transaction', 'category_transaction.transaction_id', '=', 'transactions.id')
|
||||
->where('category_transaction.category_id', $category->id);
|
||||
@@ -245,7 +245,7 @@ class CategoryRepository implements CategoryRepositoryInterface
|
||||
{
|
||||
$complete = new Collection;
|
||||
// first collect actual transaction journals (fairly easy)
|
||||
$query = $this->user->transactionjournals()->expanded()->sortCorrectly();
|
||||
$query = $this->user->transactionJournals()->expanded()->sortCorrectly();
|
||||
|
||||
if ($end >= $start) {
|
||||
$query->before($end)->after($start);
|
||||
@@ -270,7 +270,7 @@ class CategoryRepository implements CategoryRepositoryInterface
|
||||
|
||||
|
||||
// then collection transactions (harder)
|
||||
$query = $this->user->transactionjournals()->distinct()
|
||||
$query = $this->user->transactionJournals()->distinct()
|
||||
->leftJoin('transactions', 'transaction_journals.id', '=', 'transactions.transaction_journal_id')
|
||||
->leftJoin('category_transaction', 'category_transaction.transaction_id', '=', 'transactions.id');
|
||||
|
||||
@@ -308,7 +308,7 @@ class CategoryRepository implements CategoryRepositoryInterface
|
||||
{
|
||||
/** @var Collection $set */
|
||||
$query = $this->user
|
||||
->transactionjournals();
|
||||
->transactionJournals();
|
||||
if (count($types) > 0) {
|
||||
$query->transactionTypes($types);
|
||||
}
|
||||
@@ -348,7 +348,7 @@ class CategoryRepository implements CategoryRepositoryInterface
|
||||
// this second set REALLY doesn't have any categories.
|
||||
$secondSet = $secondQuery->get(['transactions.transaction_journal_id']);
|
||||
$allIds = $secondSet->pluck('transaction_journal_id')->toArray();
|
||||
$return = $this->user->transactionjournals()->sortCorrectly()->expanded()->whereIn('transaction_journals.id', $allIds)->get(
|
||||
$return = $this->user->transactionJournals()->sortCorrectly()->expanded()->whereIn('transaction_journals.id', $allIds)->get(
|
||||
TransactionJournal::queryFields()
|
||||
);
|
||||
|
||||
@@ -368,7 +368,7 @@ class CategoryRepository implements CategoryRepositoryInterface
|
||||
$last = null;
|
||||
|
||||
/** @var TransactionJournal $first */
|
||||
$lastJournalQuery = $category->transactionjournals()->orderBy('date', 'DESC');
|
||||
$lastJournalQuery = $category->transactionJournals()->orderBy('date', 'DESC');
|
||||
|
||||
if ($accounts->count() > 0) {
|
||||
// filter journals:
|
||||
@@ -483,7 +483,7 @@ class CategoryRepository implements CategoryRepositoryInterface
|
||||
{
|
||||
// first collect actual transaction journals (fairly easy)
|
||||
$query = $this->user
|
||||
->transactionjournals()
|
||||
->transactionJournals()
|
||||
->transactionTypes($types)
|
||||
->leftJoin(
|
||||
'transactions as source', function (JoinClause $join) {
|
||||
@@ -548,7 +548,7 @@ class CategoryRepository implements CategoryRepositoryInterface
|
||||
*/
|
||||
private function sumInPeriodWithoutCategory(Collection $accounts, array $types, Carbon $start, Carbon $end): string
|
||||
{
|
||||
$query = $this->user->transactionjournals()
|
||||
$query = $this->user->transactionJournals()
|
||||
->distinct()
|
||||
->transactionTypes($types)
|
||||
->leftJoin('category_transaction_journal', 'category_transaction_journal.transaction_journal_id', '=', 'transaction_journals.id')
|
||||
|
@@ -108,7 +108,7 @@ class JournalRepository implements JournalRepositoryInterface
|
||||
*/
|
||||
public function find(int $journalId) : TransactionJournal
|
||||
{
|
||||
$journal = $this->user->transactionjournals()->where('id', $journalId)->first();
|
||||
$journal = $this->user->transactionJournals()->where('id', $journalId)->first();
|
||||
if (is_null($journal)) {
|
||||
return new TransactionJournal;
|
||||
}
|
||||
@@ -123,7 +123,7 @@ class JournalRepository implements JournalRepositoryInterface
|
||||
*/
|
||||
public function first(): TransactionJournal
|
||||
{
|
||||
$entry = $this->user->transactionjournals()->orderBy('date', 'ASC')->first(['transaction_journals.*']);
|
||||
$entry = $this->user->transactionJournals()->orderBy('date', 'ASC')->first(['transaction_journals.*']);
|
||||
|
||||
if (is_null($entry)) {
|
||||
|
||||
|
@@ -189,8 +189,8 @@ class TagRepository implements TagRepositoryInterface
|
||||
/** @var TransactionType $deposit */
|
||||
$deposit = TransactionType::whereType(TransactionType::DEPOSIT)->first();
|
||||
|
||||
$withdrawals = $tag->transactionjournals()->where('transaction_type_id', $withdrawal->id)->count();
|
||||
$deposits = $tag->transactionjournals()->where('transaction_type_id', $deposit->id)->count();
|
||||
$withdrawals = $tag->transactionJournals()->where('transaction_type_id', $withdrawal->id)->count();
|
||||
$deposits = $tag->transactionJournals()->where('transaction_type_id', $deposit->id)->count();
|
||||
|
||||
if ($journal->transaction_type_id == $transfer->id) { // advance payments cannot accept transfers:
|
||||
return false;
|
||||
@@ -229,10 +229,10 @@ class TagRepository implements TagRepositoryInterface
|
||||
{
|
||||
/** @var TransactionType $withdrawal */
|
||||
$withdrawal = TransactionType::whereType(TransactionType::WITHDRAWAL)->first();
|
||||
$withdrawals = $tag->transactionjournals()->where('transaction_type_id', $withdrawal->id)->count();
|
||||
$withdrawals = $tag->transactionJournals()->where('transaction_type_id', $withdrawal->id)->count();
|
||||
/** @var TransactionType $transfer */
|
||||
$transfer = TransactionType::whereType(TransactionType::TRANSFER)->first();
|
||||
$transfers = $tag->transactionjournals()->where('transaction_type_id', $transfer->id)->count();
|
||||
$transfers = $tag->transactionJournals()->where('transaction_type_id', $transfer->id)->count();
|
||||
|
||||
|
||||
// only if this is the only withdrawal.
|
||||
|
@@ -85,6 +85,7 @@ class TransactionMatcher
|
||||
);
|
||||
|
||||
// merge:
|
||||
/** @var Collection $result */
|
||||
$result = $result->merge($filtered);
|
||||
|
||||
// Update counters
|
||||
|
@@ -114,7 +114,7 @@ class Amount
|
||||
{
|
||||
$currency = $transaction->transactionJournal->transactionCurrency;
|
||||
|
||||
return $this->formatAnything($currency, $transaction->amount, $coloured);
|
||||
return $this->formatAnything($currency, strval($transaction->amount), $coloured);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -98,8 +98,7 @@ class TestData
|
||||
*/
|
||||
private function createAttachments()
|
||||
{
|
||||
$insert = [];
|
||||
$disk = Storage::disk('upload');
|
||||
$disk = Storage::disk('upload');
|
||||
foreach ($this->data['attachments'] as $attachment) {
|
||||
$data = Crypt::encrypt($attachment['content']);
|
||||
$attachmentId = DB::table('attachments')->insertGetId(
|
||||
|
@@ -57,10 +57,11 @@ class Preferences
|
||||
}
|
||||
|
||||
/**
|
||||
* @param User $user
|
||||
* @param string $name
|
||||
* @param string $default
|
||||
*
|
||||
* @return null|\FireflyIII\Models\Preference
|
||||
* @return Preference|null
|
||||
*/
|
||||
public function getForUser(User $user, $name, $default = null)
|
||||
{
|
||||
|
@@ -111,7 +111,7 @@ class Search implements SearchInterface
|
||||
public function searchTransactions(array $words): Collection
|
||||
{
|
||||
// decrypted transaction journals:
|
||||
$decrypted = Auth::user()->transactionjournals()->expanded()->where('transaction_journals.encrypted', 0)->where(
|
||||
$decrypted = Auth::user()->transactionJournals()->expanded()->where('transaction_journals.encrypted', 0)->where(
|
||||
function (EloquentBuilder $q) use ($words) {
|
||||
foreach ($words as $word) {
|
||||
$q->orWhere('transaction_journals.description', 'LIKE', '%' . e($word) . '%');
|
||||
@@ -120,7 +120,7 @@ class Search implements SearchInterface
|
||||
)->get(TransactionJournal::queryFields());
|
||||
|
||||
// encrypted
|
||||
$all = Auth::user()->transactionjournals()->expanded()->where('transaction_journals.encrypted', 1)->get(TransactionJournal::queryFields());
|
||||
$all = Auth::user()->transactionJournals()->expanded()->where('transaction_journals.encrypted', 1)->get(TransactionJournal::queryFields());
|
||||
$set = $all->filter(
|
||||
function (TransactionJournal $journal) use ($words) {
|
||||
foreach ($words as $word) {
|
||||
|
@@ -39,7 +39,7 @@ class Budget extends Twig_Extension
|
||||
return $cache->get();
|
||||
}
|
||||
$sum
|
||||
= Auth::user()->transactionjournals()
|
||||
= Auth::user()->transactionJournals()
|
||||
->leftJoin('budget_transaction_journal', 'budget_transaction_journal.transaction_journal_id', '=', 'transaction_journals.id')
|
||||
->leftJoin('budget_limits', 'budget_limits.budget_id', '=', 'budget_transaction_journal.budget_id')
|
||||
->leftJoin('limit_repetitions', 'limit_repetitions.budget_limit_id', '=', 'budget_limits.id')
|
||||
|
@@ -143,7 +143,7 @@ class User extends Authenticatable
|
||||
/**
|
||||
* @return HasMany
|
||||
*/
|
||||
public function exportjobs(): HasMany
|
||||
public function exportJobs(): HasMany
|
||||
{
|
||||
return $this->hasMany('FireflyIII\Models\ExportJob');
|
||||
}
|
||||
@@ -172,7 +172,7 @@ class User extends Authenticatable
|
||||
/**
|
||||
* @return HasMany
|
||||
*/
|
||||
public function importjobs(): HasMany
|
||||
public function importJobs(): HasMany
|
||||
{
|
||||
return $this->hasMany('FireflyIII\Models\ImportJob');
|
||||
}
|
||||
@@ -228,7 +228,7 @@ class User extends Authenticatable
|
||||
/**
|
||||
* @return HasMany
|
||||
*/
|
||||
public function transactionjournals(): HasMany
|
||||
public function transactionJournals(): HasMany
|
||||
{
|
||||
return $this->hasMany('FireflyIII\Models\TransactionJournal');
|
||||
}
|
||||
|
@@ -54,10 +54,11 @@ class FireflyValidator extends Validator
|
||||
/**
|
||||
* @param $attribute
|
||||
* @param $value
|
||||
* @param $parameters
|
||||
*
|
||||
*
|
||||
* @return bool
|
||||
* @internal param $parameters
|
||||
*
|
||||
*
|
||||
*/
|
||||
public function validate2faCode($attribute, $value): bool
|
||||
{
|
||||
|
@@ -2,10 +2,6 @@
|
||||
declare(strict_types = 1);
|
||||
|
||||
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Models\Preference;
|
||||
use FireflyIII\User;
|
||||
|
||||
/**
|
||||
* Class TestCase
|
||||
*/
|
||||
|
Reference in New Issue
Block a user