@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | $subTitle = trans( |
227 | 227 | 'firefly.journals_in_period_for_tag', |
228 | 228 | ['tag' => $tag->tag, |
229 | - 'start' => $start->formatLocalized($this->monthAndDayFormat), 'end' => $end->formatLocalized($this->monthAndDayFormat),] |
|
229 | + 'start' => $start->formatLocalized($this->monthAndDayFormat), 'end' => $end->formatLocalized($this->monthAndDayFormat),] |
|
230 | 230 | ); |
231 | 231 | $periods = $this->getPeriodOverview($tag); |
232 | 232 | $path = route('tags.show', [$tag->id, $moment]); |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | /** @var JournalCollectorInterface $collector */ |
249 | 249 | $collector = app(JournalCollectorInterface::class); |
250 | 250 | $collector->setAllAssetAccounts()->setRange($start, $end)->setLimit($pageSize)->setPage($page)->withOpposingAccount() |
251 | - ->setTag($tag)->withBudgetInformation()->withCategoryInformation()->removeFilter(InternalTransferFilter::class); |
|
251 | + ->setTag($tag)->withBudgetInformation()->withCategoryInformation()->removeFilter(InternalTransferFilter::class); |
|
252 | 252 | $transactions = $collector->getPaginatedJournals(); |
253 | 253 | $transactions->setPath($path); |
254 | 254 |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | * You should have received a copy of the GNU General Public License |
19 | 19 | * along with Firefly III. If not, see <http://www.gnu.org/licenses/>. |
20 | 20 | */ |
21 | -declare(strict_types=1); |
|
21 | +declare(strict_types = 1); |
|
22 | 22 | |
23 | 23 | namespace FireflyIII\Http\Controllers; |
24 | 24 | |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | $this->redirectUri = route('tags.index'); |
62 | 62 | |
63 | 63 | $this->middleware( |
64 | - function ($request, $next) { |
|
64 | + function($request, $next) { |
|
65 | 65 | $this->repository = app(TagRepositoryInterface::class); |
66 | 66 | app('view')->share('title', (string)trans('firefly.tags')); |
67 | 67 | app('view')->share('mainTitleIcon', 'fa-tags'); |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | $subTitle = trans( |
220 | 220 | 'firefly.journals_in_period_for_tag', |
221 | 221 | ['tag' => $tag->tag, |
222 | - 'start' => $start->formatLocalized($this->monthAndDayFormat), 'end' => $end->formatLocalized($this->monthAndDayFormat),] |
|
222 | + 'start' => $start->formatLocalized($this->monthAndDayFormat), 'end' => $end->formatLocalized($this->monthAndDayFormat), ] |
|
223 | 223 | ); |
224 | 224 | $periods = $this->getPeriodOverview($tag); |
225 | 225 | $path = route('tags.show', [$tag->id, $moment]); |
@@ -379,7 +379,7 @@ discard block |
||
379 | 379 | /** @var JournalCollectorInterface $collector */ |
380 | 380 | $collector = app(JournalCollectorInterface::class); |
381 | 381 | $collector->setAllAssetAccounts()->setRange($start, $end)->setTypes([TransactionType::WITHDRAWAL])->setLimit($pageSize)->setPage($page) |
382 | - ->withoutBudget()->withOpposingAccount(); |
|
382 | + ->withoutBudget()->withOpposingAccount(); |
|
383 | 383 | $transactions = $collector->getPaginatedJournals(); |
384 | 384 | $transactions->setPath(route('budgets.no-budget')); |
385 | 385 | |
@@ -461,7 +461,7 @@ discard block |
||
461 | 461 | /** @var JournalCollectorInterface $collector */ |
462 | 462 | $collector = app(JournalCollectorInterface::class); |
463 | 463 | $collector->setAllAssetAccounts()->setRange($budgetLimit->start_date, $budgetLimit->end_date) |
464 | - ->setBudget($budget)->setLimit($pageSize)->setPage($page)->withBudgetInformation(); |
|
464 | + ->setBudget($budget)->setLimit($pageSize)->setPage($page)->withBudgetInformation(); |
|
465 | 465 | $transactions = $collector->getPaginatedJournals(); |
466 | 466 | $transactions->setPath(route('budgets.show', [$budget->id, $budgetLimit->id])); |
467 | 467 | $start = session('first', Carbon::create()->startOfYear()); |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | * You should have received a copy of the GNU General Public License |
19 | 19 | * along with Firefly III. If not, see <http://www.gnu.org/licenses/>. |
20 | 20 | */ |
21 | -declare(strict_types=1); |
|
21 | +declare(strict_types = 1); |
|
22 | 22 | |
23 | 23 | namespace FireflyIII\Http\Controllers; |
24 | 24 | |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | View::share('hideBudgets', true); |
63 | 63 | |
64 | 64 | $this->middleware( |
65 | - function ($request, $next) { |
|
65 | + function($request, $next) { |
|
66 | 66 | app('view')->share('title', trans('firefly.budgets')); |
67 | 67 | app('view')->share('mainTitleIcon', 'fa-tasks'); |
68 | 68 | $this->repository = app(BudgetRepositoryInterface::class); |
@@ -338,7 +338,7 @@ discard block |
||
338 | 338 | return view('budgets.info', compact('result')); |
339 | 339 | // @codeCoverageIgnoreEnd |
340 | 340 | } |
341 | - $result = [ |
|
341 | + $result = [ |
|
342 | 342 | 'available' => '0', |
343 | 343 | 'earned' => '0', |
344 | 344 | 'suggested' => '0', |
@@ -425,7 +425,7 @@ discard block |
||
425 | 425 | 'firefly.without_budget_between', |
426 | 426 | ['start' => $start->formatLocalized($this->monthAndDayFormat), 'end' => $end->formatLocalized($this->monthAndDayFormat)] |
427 | 427 | ); |
428 | - $periods = $this->getPeriodOverview(); |
|
428 | + $periods = $this->getPeriodOverview(); |
|
429 | 429 | } |
430 | 430 | |
431 | 431 | // prep for current period |
@@ -179,8 +179,8 @@ discard block |
||
179 | 179 | /** @var JournalCollectorInterface $collector */ |
180 | 180 | $collector = app(JournalCollectorInterface::class); |
181 | 181 | $collector->setAccounts($this->accounts)->setRange($this->start, $this->end) |
182 | - ->setTypes([TransactionType::WITHDRAWAL, TransactionType::TRANSFER]) |
|
183 | - ->setTags($this->tags)->withOpposingAccount(); |
|
182 | + ->setTypes([TransactionType::WITHDRAWAL, TransactionType::TRANSFER]) |
|
183 | + ->setTags($this->tags)->withOpposingAccount(); |
|
184 | 184 | $collector->removeFilter(TransferFilter::class); |
185 | 185 | |
186 | 186 | $collector->addFilter(OpposingAccountFilter::class); |
@@ -205,8 +205,8 @@ discard block |
||
205 | 205 | /** @var JournalCollectorInterface $collector */ |
206 | 206 | $collector = app(JournalCollectorInterface::class); |
207 | 207 | $collector->setAccounts($this->accounts)->setRange($this->start, $this->end) |
208 | - ->setTypes([TransactionType::DEPOSIT, TransactionType::TRANSFER]) |
|
209 | - ->setTags($this->tags)->withOpposingAccount(); |
|
208 | + ->setTypes([TransactionType::DEPOSIT, TransactionType::TRANSFER]) |
|
209 | + ->setTags($this->tags)->withOpposingAccount(); |
|
210 | 210 | |
211 | 211 | $collector->addFilter(OpposingAccountFilter::class); |
212 | 212 | $collector->addFilter(NegativeAmountFilter::class); |
@@ -18,7 +18,7 @@ |
||
18 | 18 | * You should have received a copy of the GNU General Public License |
19 | 19 | * along with Firefly III. If not, see <http://www.gnu.org/licenses/>. |
20 | 20 | */ |
21 | -declare(strict_types=1); |
|
21 | +declare(strict_types = 1); |
|
22 | 22 | |
23 | 23 | namespace FireflyIII\Generator\Report\Tag; |
24 | 24 |
@@ -201,11 +201,11 @@ |
||
201 | 201 | } |
202 | 202 | if (0 === count($categories)) { |
203 | 203 | $set = Category::distinct()->leftJoin('category_transaction', 'categories.id', '=', 'category_transaction.category_id') |
204 | - ->leftJoin('transactions', 'category_transaction.transaction_id', '=', 'transactions.id') |
|
205 | - ->leftJoin('transaction_journals', 'transactions.transaction_journal_id', '=', 'transaction_journals.id') |
|
206 | - ->where('categories.user_id', $journal->user_id) |
|
207 | - ->where('transaction_journals.id', $journal->id) |
|
208 | - ->get(['categories.*']); |
|
204 | + ->leftJoin('transactions', 'category_transaction.transaction_id', '=', 'transactions.id') |
|
205 | + ->leftJoin('transaction_journals', 'transactions.transaction_journal_id', '=', 'transaction_journals.id') |
|
206 | + ->where('categories.user_id', $journal->user_id) |
|
207 | + ->where('transaction_journals.id', $journal->id) |
|
208 | + ->get(['categories.*']); |
|
209 | 209 | /** @var Category $category */ |
210 | 210 | foreach ($set as $category) { |
211 | 211 | $categories[] = sprintf('<a title="%1$s" href="%2$s">%1$s</a>', e($category->name), route('categories.show', $category->id)); |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | * You should have received a copy of the GNU General Public License |
19 | 19 | * along with Firefly III. If not, see <http://www.gnu.org/licenses/>. |
20 | 20 | */ |
21 | -declare(strict_types=1); |
|
21 | +declare(strict_types = 1); |
|
22 | 22 | |
23 | 23 | namespace FireflyIII\Support\Twig; |
24 | 24 | |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | { |
45 | 45 | return new Twig_SimpleFunction( |
46 | 46 | 'destinationAccount', |
47 | - function (TransactionJournal $journal) { |
|
47 | + function(TransactionJournal $journal) { |
|
48 | 48 | $cache = new CacheProperties; |
49 | 49 | $cache->addProperty($journal->id); |
50 | 50 | $cache->addProperty('transaction-journal'); |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | { |
117 | 117 | return new Twig_SimpleFunction( |
118 | 118 | 'sourceAccount', |
119 | - function (TransactionJournal $journal): string { |
|
119 | + function(TransactionJournal $journal): string { |
|
120 | 120 | $cache = new CacheProperties; |
121 | 121 | $cache->addProperty($journal->id); |
122 | 122 | $cache->addProperty('transaction-journal'); |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | { |
152 | 152 | return new Twig_SimpleFunction( |
153 | 153 | 'journalBudgets', |
154 | - function (TransactionJournal $journal): string { |
|
154 | + function(TransactionJournal $journal): string { |
|
155 | 155 | $cache = new CacheProperties; |
156 | 156 | $cache->addProperty($journal->id); |
157 | 157 | $cache->addProperty('transaction-journal'); |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | { |
187 | 187 | return new Twig_SimpleFunction( |
188 | 188 | 'journalCategories', |
189 | - function (TransactionJournal $journal): string { |
|
189 | + function(TransactionJournal $journal): string { |
|
190 | 190 | $cache = new CacheProperties; |
191 | 191 | $cache->addProperty($journal->id); |
192 | 192 | $cache->addProperty('transaction-journal'); |
@@ -388,7 +388,7 @@ discard block |
||
388 | 388 | |
389 | 389 | // get entries from table |
390 | 390 | $set = DB::table($table)->where('user_id', auth()->user()->id)->whereNull('deleted_at') |
391 | - ->where('id', '!=', $exclude)->get([$field]); |
|
391 | + ->where('id', '!=', $exclude)->get([$field]); |
|
392 | 392 | |
393 | 393 | foreach ($set as $entry) { |
394 | 394 | $fieldValue = $this->tryDecrypt($entry->$field); |
@@ -414,7 +414,7 @@ discard block |
||
414 | 414 | { |
415 | 415 | $exclude = $parameters[0] ?? null; |
416 | 416 | $query = DB::table('piggy_banks')->whereNull('piggy_banks.deleted_at') |
417 | - ->leftJoin('accounts', 'accounts.id', '=', 'piggy_banks.account_id')->where('accounts.user_id', auth()->user()->id); |
|
417 | + ->leftJoin('accounts', 'accounts.id', '=', 'piggy_banks.account_id')->where('accounts.user_id', auth()->user()->id); |
|
418 | 418 | if (null !== $exclude) { |
419 | 419 | $query->where('piggy_banks.id', '!=', $exclude); |
420 | 420 | } |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | * You should have received a copy of the GNU General Public License |
19 | 19 | * along with Firefly III. If not, see <http://www.gnu.org/licenses/>. |
20 | 20 | */ |
21 | -declare(strict_types=1); |
|
21 | +declare(strict_types = 1); |
|
22 | 22 | |
23 | 23 | namespace FireflyIII\Validation; |
24 | 24 | |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | return false; |
137 | 137 | } |
138 | 138 | // strip spaces |
139 | - $search = [ |
|
139 | + $search = [ |
|
140 | 140 | "\x20", // normal space |
141 | 141 | "\u{0001}", // start of heading |
142 | 142 | "\u{0002}", // start of text |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | |
191 | 191 | $search = [' ', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']; |
192 | 192 | $replace = ['', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31', |
193 | - '32', '33', '34', '35',]; |
|
193 | + '32', '33', '34', '35', ]; |
|
194 | 194 | |
195 | 195 | // take |
196 | 196 | $first = substr($value, 0, 4); |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | $budgets = $repository->getBudgets(); |
268 | 268 | // count budgets, should have at least one |
269 | 269 | $count = $budgets->filter( |
270 | - function (Budget $budget) use ($value) { |
|
270 | + function(Budget $budget) use ($value) { |
|
271 | 271 | return $budget->name === $value; |
272 | 272 | } |
273 | 273 | )->count(); |
@@ -83,12 +83,12 @@ |
||
83 | 83 | $q->orWhereNull('startdate'); |
84 | 84 | } |
85 | 85 | ) |
86 | - ->where( |
|
87 | - function (EloquentBuilder $q) use ($date) { |
|
88 | - $q->where('targetdate', '>=', $date->format('Y-m-d 00:00:00')); |
|
89 | - $q->orWhereNull('targetdate'); |
|
90 | - } |
|
91 | - ); |
|
86 | + ->where( |
|
87 | + function (EloquentBuilder $q) use ($date) { |
|
88 | + $q->where('targetdate', '>=', $date->format('Y-m-d 00:00:00')); |
|
89 | + $q->orWhereNull('targetdate'); |
|
90 | + } |
|
91 | + ); |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | /** |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | * You should have received a copy of the GNU General Public License |
19 | 19 | * along with Firefly III. If not, see <http://www.gnu.org/licenses/>. |
20 | 20 | */ |
21 | -declare(strict_types=1); |
|
21 | +declare(strict_types = 1); |
|
22 | 22 | |
23 | 23 | namespace FireflyIII\Models; |
24 | 24 | |
@@ -78,13 +78,13 @@ discard block |
||
78 | 78 | public function scopeRelevantOnDate(EloquentBuilder $query, Carbon $date) |
79 | 79 | { |
80 | 80 | return $query->where( |
81 | - function (EloquentBuilder $q) use ($date) { |
|
81 | + function(EloquentBuilder $q) use ($date) { |
|
82 | 82 | $q->where('startdate', '<=', $date->format('Y-m-d 00:00:00')); |
83 | 83 | $q->orWhereNull('startdate'); |
84 | 84 | } |
85 | 85 | ) |
86 | 86 | ->where( |
87 | - function (EloquentBuilder $q) use ($date) { |
|
87 | + function(EloquentBuilder $q) use ($date) { |
|
88 | 88 | $q->where('targetdate', '>=', $date->format('Y-m-d 00:00:00')); |
89 | 89 | $q->orWhereNull('targetdate'); |
90 | 90 | } |
@@ -214,9 +214,9 @@ |
||
214 | 214 | } |
215 | 215 | |
216 | 216 | $rate = $this->user->currencyExchangeRates() |
217 | - ->where('from_currency_id', $fromCurrency->id) |
|
218 | - ->where('to_currency_id', $toCurrency->id) |
|
219 | - ->where('date', $date->format('Y-m-d'))->first(); |
|
217 | + ->where('from_currency_id', $fromCurrency->id) |
|
218 | + ->where('to_currency_id', $toCurrency->id) |
|
219 | + ->where('date', $date->format('Y-m-d'))->first(); |
|
220 | 220 | if (null !== $rate) { |
221 | 221 | Log::debug(sprintf('Found cached exchange rate in database for %s to %s on %s', $fromCurrency->code, $toCurrency->code, $date->format('Y-m-d'))); |
222 | 222 |
@@ -18,7 +18,7 @@ |
||
18 | 18 | * You should have received a copy of the GNU General Public License |
19 | 19 | * along with Firefly III. If not, see <http://www.gnu.org/licenses/>. |
20 | 20 | */ |
21 | -declare(strict_types=1); |
|
21 | +declare(strict_types = 1); |
|
22 | 22 | |
23 | 23 | namespace FireflyIII\Repositories\Currency; |
24 | 24 |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | public function updateAccountCurrencies(): void |
156 | 156 | { |
157 | 157 | $accounts = Account::leftJoin('account_types', 'account_types.id', '=', 'accounts.account_type_id') |
158 | - ->whereIn('account_types.type', [AccountType::DEFAULT, AccountType::ASSET])->get(['accounts.*']); |
|
158 | + ->whereIn('account_types.type', [AccountType::DEFAULT, AccountType::ASSET])->get(['accounts.*']); |
|
159 | 159 | |
160 | 160 | $accounts->each( |
161 | 161 | function (Account $account) { |
@@ -222,9 +222,9 @@ discard block |
||
222 | 222 | // get the transaction with the asset account in it: |
223 | 223 | /** @var Transaction $transaction */ |
224 | 224 | $transaction = $journal->transactions() |
225 | - ->leftJoin('accounts', 'accounts.id', '=', 'transactions.account_id') |
|
226 | - ->leftJoin('account_types', 'account_types.id', '=', 'accounts.account_type_id') |
|
227 | - ->whereIn('account_types.type', [AccountType::DEFAULT, AccountType::ASSET])->first(['transactions.*']); |
|
225 | + ->leftJoin('accounts', 'accounts.id', '=', 'transactions.account_id') |
|
226 | + ->leftJoin('account_types', 'account_types.id', '=', 'accounts.account_type_id') |
|
227 | + ->whereIn('account_types.type', [AccountType::DEFAULT, AccountType::ASSET])->first(['transactions.*']); |
|
228 | 228 | if (null === $transaction) { |
229 | 229 | return; |
230 | 230 | } |
@@ -359,9 +359,9 @@ discard block |
||
359 | 359 | try { |
360 | 360 | /** @var Transaction $opposing */ |
361 | 361 | $opposing = Transaction::where('transaction_journal_id', $journalId) |
362 | - ->where('amount', $amount)->where('identifier', '=', 0) |
|
363 | - ->whereNotIn('id', $processed) |
|
364 | - ->first(); |
|
362 | + ->where('amount', $amount)->where('identifier', '=', 0) |
|
363 | + ->whereNotIn('id', $processed) |
|
364 | + ->first(); |
|
365 | 365 | } catch (QueryException $e) { |
366 | 366 | Log::error($e->getMessage()); |
367 | 367 | $this->error('Firefly III could not find the "identifier" field in the "transactions" table.'); |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -declare(strict_types=1); |
|
2 | +declare(strict_types = 1); |
|
3 | 3 | /** |
4 | 4 | * UpgradeDatabase.php |
5 | 5 | * Copyright (c) 2017 [email protected] |
@@ -99,12 +99,12 @@ discard block |
||
99 | 99 | if (!Schema::hasTable('transaction_journals')) { |
100 | 100 | return; |
101 | 101 | } |
102 | - $subQuery = TransactionJournal::leftJoin('transactions', 'transactions.transaction_journal_id', '=', 'transaction_journals.id') |
|
102 | + $subQuery = TransactionJournal::leftJoin('transactions', 'transactions.transaction_journal_id', '=', 'transaction_journals.id') |
|
103 | 103 | ->whereNull('transaction_journals.deleted_at') |
104 | 104 | ->whereNull('transactions.deleted_at') |
105 | 105 | ->groupBy(['transaction_journals.id']) |
106 | 106 | ->select(['transaction_journals.id', DB::raw('COUNT(transactions.id) AS t_count')]); |
107 | - $result = DB::table(DB::raw('(' . $subQuery->toSql() . ') AS derived')) |
|
107 | + $result = DB::table(DB::raw('(' . $subQuery->toSql() . ') AS derived')) |
|
108 | 108 | ->mergeBindings($subQuery->getQuery()) |
109 | 109 | ->where('t_count', '>', 2) |
110 | 110 | ->select(['id', 't_count']); |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | ->whereIn('account_types.type', [AccountType::DEFAULT, AccountType::ASSET])->get(['accounts.*']); |
130 | 130 | |
131 | 131 | $accounts->each( |
132 | - function (Account $account) { |
|
132 | + function(Account $account) { |
|
133 | 133 | // get users preference, fall back to system pref. |
134 | 134 | $defaultCurrencyCode = Preferences::getForUser($account->user, 'currencyPreference', config('firefly.default_currency', 'EUR'))->data; |
135 | 135 | $defaultCurrency = TransactionCurrency::where('code', $defaultCurrencyCode)->first(); |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | ->get(['transaction_journals.*']); |
191 | 191 | |
192 | 192 | $set->each( |
193 | - function (TransactionJournal $journal) use ($repository) { |
|
193 | + function(TransactionJournal $journal) use ($repository) { |
|
194 | 194 | // get the transaction with the asset account in it: |
195 | 195 | /** @var Transaction $transaction */ |
196 | 196 | $transaction = $journal->transactions() |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | $currency = $repository->find((int)$account->getMeta('currency_id')); |
206 | 206 | $transactions = $journal->transactions()->get(); |
207 | 207 | $transactions->each( |
208 | - function (Transaction $transaction) use ($currency) { |
|
208 | + function(Transaction $transaction) use ($currency) { |
|
209 | 209 | if (null === $transaction->transaction_currency_id) { |
210 | 210 | $transaction->transaction_currency_id = $currency->id; |
211 | 211 | $transaction->save(); |
@@ -247,12 +247,12 @@ discard block |
||
247 | 247 | ->get(['transaction_journals.*']); |
248 | 248 | |
249 | 249 | $set->each( |
250 | - function (TransactionJournal $transfer) { |
|
250 | + function(TransactionJournal $transfer) { |
|
251 | 251 | // select all "source" transactions: |
252 | 252 | /** @var Collection $transactions */ |
253 | 253 | $transactions = $transfer->transactions()->where('amount', '<', 0)->get(); |
254 | 254 | $transactions->each( |
255 | - function (Transaction $transaction) { |
|
255 | + function(Transaction $transaction) { |
|
256 | 256 | $this->updateTransactionCurrency($transaction); |
257 | 257 | $this->updateJournalCurrency($transaction); |
258 | 258 | } |
@@ -172,12 +172,12 @@ discard block |
||
172 | 172 | $q2->where('transactions.amount', '<', 0)->where('transactions.amount', '>', $invertedAmount); |
173 | 173 | } |
174 | 174 | ) |
175 | - ->orWhere( |
|
176 | - function (EloquentBuilder $q3) use ($amount) { |
|
177 | - // amount > 0 and .amount < $amount |
|
178 | - $q3->where('transactions.amount', '>', 0)->where('transactions.amount', '<', $amount); |
|
179 | - } |
|
180 | - ); |
|
175 | + ->orWhere( |
|
176 | + function (EloquentBuilder $q3) use ($amount) { |
|
177 | + // amount > 0 and .amount < $amount |
|
178 | + $q3->where('transactions.amount', '>', 0)->where('transactions.amount', '<', $amount); |
|
179 | + } |
|
180 | + ); |
|
181 | 181 | } |
182 | 182 | ); |
183 | 183 | |
@@ -200,12 +200,12 @@ discard block |
||
200 | 200 | $q2->where('transactions.amount', '<', 0)->where('transactions.amount', '<', $invertedAmount); |
201 | 201 | } |
202 | 202 | ) |
203 | - ->orWhere( |
|
204 | - function (EloquentBuilder $q3) use ($amount) { |
|
205 | - // amount > 0 and .amount > $amount |
|
206 | - $q3->where('transactions.amount', '>', 0)->where('transactions.amount', '>', $amount); |
|
207 | - } |
|
208 | - ); |
|
203 | + ->orWhere( |
|
204 | + function (EloquentBuilder $q3) use ($amount) { |
|
205 | + // amount > 0 and .amount > $amount |
|
206 | + $q3->where('transactions.amount', '>', 0)->where('transactions.amount', '>', $amount); |
|
207 | + } |
|
208 | + ); |
|
209 | 209 | } |
210 | 210 | ); |
211 | 211 | |
@@ -782,8 +782,8 @@ discard block |
||
782 | 782 | 'transactions as opposing', |
783 | 783 | function (JoinClause $join) { |
784 | 784 | $join->on('opposing.transaction_journal_id', '=', 'transactions.transaction_journal_id') |
785 | - ->where('opposing.identifier', '=', DB::raw('transactions.identifier')) |
|
786 | - ->where('opposing.amount', '=', DB::raw('transactions.amount * -1')); |
|
785 | + ->where('opposing.identifier', '=', DB::raw('transactions.identifier')) |
|
786 | + ->where('opposing.amount', '=', DB::raw('transactions.amount * -1')); |
|
787 | 787 | } |
788 | 788 | ); |
789 | 789 | $this->query->leftJoin('accounts as opposing_accounts', 'opposing.account_id', '=', 'opposing_accounts.id'); |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | * You should have received a copy of the GNU General Public License |
19 | 19 | * along with Firefly III. If not, see <http://www.gnu.org/licenses/>. |
20 | 20 | */ |
21 | -declare(strict_types=1); |
|
21 | +declare(strict_types = 1); |
|
22 | 22 | |
23 | 23 | namespace FireflyIII\Helpers\Collector; |
24 | 24 | |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | public function amountIs(string $amount): JournalCollectorInterface |
153 | 153 | { |
154 | 154 | $this->query->where( |
155 | - function (EloquentBuilder $q) use ($amount) { |
|
155 | + function(EloquentBuilder $q) use ($amount) { |
|
156 | 156 | $q->where('transactions.amount', $amount); |
157 | 157 | $q->orWhere('transactions.amount', bcmul($amount, '-1')); |
158 | 158 | } |
@@ -169,16 +169,16 @@ discard block |
||
169 | 169 | public function amountLess(string $amount): JournalCollectorInterface |
170 | 170 | { |
171 | 171 | $this->query->where( |
172 | - function (EloquentBuilder $q1) use ($amount) { |
|
172 | + function(EloquentBuilder $q1) use ($amount) { |
|
173 | 173 | $q1->where( |
174 | - function (EloquentBuilder $q2) use ($amount) { |
|
174 | + function(EloquentBuilder $q2) use ($amount) { |
|
175 | 175 | // amount < 0 and .amount > -$amount |
176 | 176 | $invertedAmount = bcmul($amount, '-1'); |
177 | 177 | $q2->where('transactions.amount', '<', 0)->where('transactions.amount', '>', $invertedAmount); |
178 | 178 | } |
179 | 179 | ) |
180 | 180 | ->orWhere( |
181 | - function (EloquentBuilder $q3) use ($amount) { |
|
181 | + function(EloquentBuilder $q3) use ($amount) { |
|
182 | 182 | // amount > 0 and .amount < $amount |
183 | 183 | $q3->where('transactions.amount', '>', 0)->where('transactions.amount', '<', $amount); |
184 | 184 | } |
@@ -197,16 +197,16 @@ discard block |
||
197 | 197 | public function amountMore(string $amount): JournalCollectorInterface |
198 | 198 | { |
199 | 199 | $this->query->where( |
200 | - function (EloquentBuilder $q1) use ($amount) { |
|
200 | + function(EloquentBuilder $q1) use ($amount) { |
|
201 | 201 | $q1->where( |
202 | - function (EloquentBuilder $q2) use ($amount) { |
|
202 | + function(EloquentBuilder $q2) use ($amount) { |
|
203 | 203 | // amount < 0 and .amount < -$amount |
204 | 204 | $invertedAmount = bcmul($amount, '-1'); |
205 | 205 | $q2->where('transactions.amount', '<', 0)->where('transactions.amount', '<', $invertedAmount); |
206 | 206 | } |
207 | 207 | ) |
208 | 208 | ->orWhere( |
209 | - function (EloquentBuilder $q3) use ($amount) { |
|
209 | + function(EloquentBuilder $q3) use ($amount) { |
|
210 | 210 | // amount > 0 and .amount > $amount |
211 | 211 | $q3->where('transactions.amount', '>', 0)->where('transactions.amount', '>', $amount); |
212 | 212 | } |
@@ -268,7 +268,7 @@ discard block |
||
268 | 268 | |
269 | 269 | // loop for decryption. |
270 | 270 | $set->each( |
271 | - function (Transaction $transaction) { |
|
271 | + function(Transaction $transaction) { |
|
272 | 272 | $transaction->date = new Carbon($transaction->date); |
273 | 273 | $transaction->description = Steam::decrypt((int)$transaction->encrypted, $transaction->description); |
274 | 274 | |
@@ -424,7 +424,7 @@ discard block |
||
424 | 424 | $this->joinBudgetTables(); |
425 | 425 | |
426 | 426 | $this->query->where( |
427 | - function (EloquentBuilder $q) use ($budget) { |
|
427 | + function(EloquentBuilder $q) use ($budget) { |
|
428 | 428 | $q->where('budget_transaction.budget_id', $budget->id); |
429 | 429 | $q->orWhere('budget_transaction_journal.budget_id', $budget->id); |
430 | 430 | } |
@@ -448,7 +448,7 @@ discard block |
||
448 | 448 | Log::debug('Journal collector will filter for budgets', $budgetIds); |
449 | 449 | |
450 | 450 | $this->query->where( |
451 | - function (EloquentBuilder $q) use ($budgetIds) { |
|
451 | + function(EloquentBuilder $q) use ($budgetIds) { |
|
452 | 452 | $q->whereIn('budget_transaction.budget_id', $budgetIds); |
453 | 453 | $q->orWhereIn('budget_transaction_journal.budget_id', $budgetIds); |
454 | 454 | } |
@@ -471,7 +471,7 @@ discard block |
||
471 | 471 | $this->joinCategoryTables(); |
472 | 472 | |
473 | 473 | $this->query->where( |
474 | - function (EloquentBuilder $q) use ($categoryIds) { |
|
474 | + function(EloquentBuilder $q) use ($categoryIds) { |
|
475 | 475 | $q->whereIn('category_transaction.category_id', $categoryIds); |
476 | 476 | $q->orWhereIn('category_transaction_journal.category_id', $categoryIds); |
477 | 477 | } |
@@ -490,7 +490,7 @@ discard block |
||
490 | 490 | $this->joinCategoryTables(); |
491 | 491 | |
492 | 492 | $this->query->where( |
493 | - function (EloquentBuilder $q) use ($category) { |
|
493 | + function(EloquentBuilder $q) use ($category) { |
|
494 | 494 | $q->where('category_transaction.category_id', $category->id); |
495 | 495 | $q->orWhere('category_transaction_journal.category_id', $category->id); |
496 | 496 | } |
@@ -508,7 +508,7 @@ discard block |
||
508 | 508 | { |
509 | 509 | $ids = $journals->pluck('id')->toArray(); |
510 | 510 | $this->query->where( |
511 | - function (EloquentBuilder $q) use ($ids) { |
|
511 | + function(EloquentBuilder $q) use ($ids) { |
|
512 | 512 | $q->whereIn('transaction_journals.id', $ids); |
513 | 513 | } |
514 | 514 | ); |
@@ -722,7 +722,7 @@ discard block |
||
722 | 722 | $this->joinBudgetTables(); |
723 | 723 | |
724 | 724 | $this->query->where( |
725 | - function (EloquentBuilder $q) { |
|
725 | + function(EloquentBuilder $q) { |
|
726 | 726 | $q->whereNull('budget_transaction.budget_id'); |
727 | 727 | $q->whereNull('budget_transaction_journal.budget_id'); |
728 | 728 | } |
@@ -739,7 +739,7 @@ discard block |
||
739 | 739 | $this->joinCategoryTables(); |
740 | 740 | |
741 | 741 | $this->query->where( |
742 | - function (EloquentBuilder $q) { |
|
742 | + function(EloquentBuilder $q) { |
|
743 | 743 | $q->whereNull('category_transaction.category_id'); |
744 | 744 | $q->whereNull('category_transaction_journal.category_id'); |
745 | 745 | } |
@@ -842,7 +842,7 @@ discard block |
||
842 | 842 | // join opposing transaction (hard): |
843 | 843 | $this->query->leftJoin( |
844 | 844 | 'transactions as opposing', |
845 | - function (JoinClause $join) { |
|
845 | + function(JoinClause $join) { |
|
846 | 846 | $join->on('opposing.transaction_journal_id', '=', 'transactions.transaction_journal_id') |
847 | 847 | ->where('opposing.identifier', '=', DB::raw('transactions.identifier')) |
848 | 848 | ->where('opposing.amount', '=', DB::raw('transactions.amount * -1')); |