@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | $accounts = new Collection; |
178 | 178 | $accountList = $this->option('accounts'); |
179 | 179 | $types = [AccountType::ASSET, AccountType::LOAN, AccountType::DEBT, AccountType::MORTGAGE]; |
180 | - if (null !== $accountList && '' !== (string) $accountList) { |
|
180 | + if (null !== $accountList && '' !== (string)$accountList) { |
|
181 | 181 | $accountIds = explode(',', $accountList); |
182 | 182 | $accounts = $this->accountRepository->getAccountsById($accountIds); |
183 | 183 | } |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | */ |
244 | 244 | private function getExportDirectory(): string |
245 | 245 | { |
246 | - $directory = (string) $this->option('export_directory'); |
|
246 | + $directory = (string)$this->option('export_directory'); |
|
247 | 247 | if (null === $directory) { |
248 | 248 | $directory = './'; |
249 | 249 | } |
@@ -95,13 +95,13 @@ discard block |
||
95 | 95 | // try to json_decrypt the value. |
96 | 96 | try { |
97 | 97 | $value = json_decode($value, true, 512, JSON_THROW_ON_ERROR) ?? $value; |
98 | - } catch(JsonException $e) { |
|
98 | + } catch (JsonException $e) { |
|
99 | 99 | Log::error($e->getMessage()); |
100 | 100 | } |
101 | 101 | Log::debug(sprintf('Decrypted field "%s" "%s" to "%s" in table "%s" (row #%d)', $field, $original, print_r($value, true), $table, $id)); |
102 | 102 | |
103 | 103 | /** @var Preference $object */ |
104 | - $object = Preference::find((int) $id); |
|
104 | + $object = Preference::find((int)$id); |
|
105 | 105 | if (null !== $object) { |
106 | 106 | $object->data = $value; |
107 | 107 | $object->save(); |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | $configName = sprintf('is_decrypted_%s', $table); |
138 | 138 | $configVar = app('fireflyconfig')->get($configName, false); |
139 | 139 | if (null !== $configVar) { |
140 | - return (bool) $configVar->data; |
|
140 | + return (bool)$configVar->data; |
|
141 | 141 | } |
142 | 142 | |
143 | 143 | return false; |
@@ -81,11 +81,11 @@ discard block |
||
81 | 81 | case 'VZ': // Verzamelbetaling |
82 | 82 | case 'IC': // Incasso |
83 | 83 | case 'DV': // Divers |
84 | - $this->removeIBANIngDescription(); // Remove "IBAN:", because it is already at "Tegenrekening" |
|
85 | - $this->removeNameIngDescription(); // Remove "Naam:", because it is already at "Naam/ Omschrijving" |
|
86 | - $this->removeIngDescription(); // Remove "Omschrijving", but not the value from description |
|
84 | + $this->removeIBANIngDescription(); // Remove "IBAN:", because it is already at "Tegenrekening" |
|
85 | + $this->removeNameIngDescription(); // Remove "Naam:", because it is already at "Naam/ Omschrijving" |
|
86 | + $this->removeIngDescription(); // Remove "Omschrijving", but not the value from description |
|
87 | 87 | $this->moveValutadatumDescription(); // Move "Valutadatum" from description to new column |
88 | - $this->MoveSavingsAccount(); // Move savings account number and name |
|
88 | + $this->MoveSavingsAccount(); // Move savings account number and name |
|
89 | 89 | break; |
90 | 90 | case 'BA': // Betaalautomaat |
91 | 91 | $this->moveValutadatumDescription(); // Move "Valutadatum" from description to new column |
@@ -153,19 +153,19 @@ discard block |
||
153 | 153 | |
154 | 154 | if (preg_match('/(Naar|Van) (.*rekening) ([A-Za-z0-9]+)/', $this->row[8], $matches)) { // Search for saving acount at 'Mededelingen' column |
155 | 155 | $this->row[1] = $this->row[1] . ' ' . $matches[2] . ' ' . $matches[3]; // Current name + Saving acount name + Acount number |
156 | - if ('' === (string) $this->row[3]) { // if Saving account number does not yet exists |
|
156 | + if ('' === (string)$this->row[3]) { // if Saving account number does not yet exists |
|
157 | 157 | $this->row[3] = $matches[3]; // Copy savings account number |
158 | 158 | } |
159 | 159 | $this->row[8] = preg_replace('/(Naar|Van) (.*rekening) ([A-Za-z0-9]+)/', '', $this->row[8]); // Remove the savings account content from description |
160 | 160 | } elseif (preg_match('/(Naar|Van) (.*rekening) ([A-Za-z0-9]+)/', $this->row[1], $matches)) { // Search for saving acount at 'Naam / Omschrijving' column |
161 | - $this->row[1] = $matches[2] . ' ' . $matches[3]; // Saving acount name + Acount number |
|
162 | - if ('' === (string) $this->row[3]) { // if Saving account number does not yet exists |
|
161 | + $this->row[1] = $matches[2] . ' ' . $matches[3]; // Saving acount name + Acount number |
|
162 | + if ('' === (string)$this->row[3]) { // if Saving account number does not yet exists |
|
163 | 163 | $this->row[3] = $matches[3]; // Copy savings account number |
164 | 164 | } |
165 | 165 | } |
166 | 166 | |
167 | 167 | if ('' !== (string)$this->row[3]) { // if Saving account number exists |
168 | - if (! preg_match('/[A-Za-z]/', $this->row[3])) { // if Saving account number has no characters |
|
168 | + if (!preg_match('/[A-Za-z]/', $this->row[3])) { // if Saving account number has no characters |
|
169 | 169 | $this->row[3] = sprintf("%010d", $this->row[3]); // Make the number 10 digits |
170 | 170 | } |
171 | 171 | } |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | |
284 | 284 | // at this point the currency preference could be encrypted, if coming from an old version. |
285 | 285 | Log::debug('Going to try to decrypt users currency preference.'); |
286 | - $currencyCode = $this->tryDecrypt((string) $currencyPrefStr); |
|
286 | + $currencyCode = $this->tryDecrypt((string)$currencyPrefStr); |
|
287 | 287 | |
288 | 288 | // could still be json encoded: |
289 | 289 | if (strlen($currencyCode) > 3) { |
@@ -325,7 +325,7 @@ discard block |
||
325 | 325 | */ |
326 | 326 | public function getLocaleInfo(): array |
327 | 327 | { |
328 | - $locale = explode(',', (string) trans('config.locale')); |
|
328 | + $locale = explode(',', (string)trans('config.locale')); |
|
329 | 329 | $locale = array_map('trim', $locale); |
330 | 330 | setlocale(LC_MONETARY, $locale); |
331 | 331 | $info = localeconv(); |
@@ -68,10 +68,10 @@ discard block |
||
68 | 68 | |
69 | 69 | // some useful repositories: |
70 | 70 | $this->middleware( |
71 | - function ($request, $next) { |
|
71 | + function($request, $next) { |
|
72 | 72 | $this->repository = app(JournalRepositoryInterface::class); |
73 | 73 | |
74 | - app('view')->share('title', (string) trans('firefly.transactions')); |
|
74 | + app('view')->share('title', (string)trans('firefly.transactions')); |
|
75 | 75 | app('view')->share('mainTitleIcon', 'fa-exchange'); |
76 | 76 | |
77 | 77 | return $next($request); |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | |
106 | 106 | $groupTitle = $group->title ?? $first->description; |
107 | 107 | $groupArray = $transformer->transformObject($group); |
108 | - $subTitle = (string) trans('firefly.convert_to_' . $destinationType->type, ['description' => $groupTitle]); |
|
108 | + $subTitle = (string)trans('firefly.convert_to_' . $destinationType->type, ['description' => $groupTitle]); |
|
109 | 109 | $subTitleIcon = 'fa-exchange'; |
110 | 110 | |
111 | 111 | // get a list of asset accounts and liabilities and stuff, in various combinations: |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | |
122 | 122 | if ($sourceType->type === $destinationType->type) { // cannot convert to its own type. |
123 | 123 | Log::debug('This is already a transaction of the expected type..'); |
124 | - session()->flash('info', (string) trans('firefly.convert_is_already_type_' . $destinationType->type)); |
|
124 | + session()->flash('info', (string)trans('firefly.convert_is_already_type_' . $destinationType->type)); |
|
125 | 125 | |
126 | 126 | return redirect(route('transactions.show', [$group->id])); |
127 | 127 | } |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | $group->refresh(); |
179 | 179 | $this->correctTransfer($group); |
180 | 180 | |
181 | - session()->flash('success', (string) trans('firefly.converted_to_' . $destinationType->type)); |
|
181 | + session()->flash('success', (string)trans('firefly.converted_to_' . $destinationType->type)); |
|
182 | 182 | event(new UpdatedTransactionGroup($group)); |
183 | 183 | |
184 | 184 | return redirect(route('transactions.show', [$group->id])); |
@@ -205,9 +205,9 @@ discard block |
||
205 | 205 | $destinationName = $data['destination_name'][$journal->id] ?? null; |
206 | 206 | |
207 | 207 | // double check its not an empty string. |
208 | - $sourceId = '' === $sourceId || null === $sourceId ? null : (int) $sourceId; |
|
208 | + $sourceId = '' === $sourceId || null === $sourceId ? null : (int)$sourceId; |
|
209 | 209 | $sourceName = '' === $sourceName ? null : $sourceName; |
210 | - $destinationId = '' === $destinationId || null === $destinationId ? null : (int) $destinationId; |
|
210 | + $destinationId = '' === $destinationId || null === $destinationId ? null : (int)$destinationId; |
|
211 | 211 | $destinationName = (string)('' === $destinationName ? null : $destinationName); |
212 | 212 | $validSource = $validator->validateSource($sourceId, $sourceName, null); |
213 | 213 | $validDestination = $validator->validateDestination($destinationId, $destinationName, null); |
@@ -262,12 +262,12 @@ discard block |
||
262 | 262 | foreach ($accountList as $account) { |
263 | 263 | $balance = app('steam')->balance($account, new Carbon); |
264 | 264 | $currency = $repository->getAccountCurrency($account) ?? $defaultCurrency; |
265 | - $role = (string) $repository->getMetaValue($account, 'account_role'); |
|
265 | + $role = (string)$repository->getMetaValue($account, 'account_role'); |
|
266 | 266 | if ('' === $role) { |
267 | 267 | $role = 'no_account_type'; // @codeCoverageIgnore |
268 | 268 | } |
269 | 269 | |
270 | - $key = (string) trans('firefly.opt_group_' . $role); |
|
270 | + $key = (string)trans('firefly.opt_group_' . $role); |
|
271 | 271 | $grouped[$key][$account->id] = $account->name . ' (' . app('amount')->formatAnything($currency, $balance, false) . ')'; |
272 | 272 | } |
273 | 273 | |
@@ -292,7 +292,7 @@ discard block |
||
292 | 292 | $balance = app('steam')->balance($account, new Carbon); |
293 | 293 | $currency = $repository->getAccountCurrency($account) ?? $defaultCurrency; |
294 | 294 | $role = 'l_' . $account->accountType->type; |
295 | - $key = (string) trans('firefly.opt_group_' . $role); |
|
295 | + $key = (string)trans('firefly.opt_group_' . $role); |
|
296 | 296 | $grouped[$key][$account->id] = $account->name . ' (' . app('amount')->formatAnything($currency, $balance, false) . ')'; |
297 | 297 | } |
298 | 298 | |
@@ -314,7 +314,7 @@ discard block |
||
314 | 314 | // group accounts: |
315 | 315 | /** @var Account $account */ |
316 | 316 | foreach ($accountList as $account) { |
317 | - $role = (string) $repository->getMetaValue($account, 'account_role'); |
|
317 | + $role = (string)$repository->getMetaValue($account, 'account_role'); |
|
318 | 318 | $name = $account->name; |
319 | 319 | if ('' === $role) { |
320 | 320 | $role = 'no_account_type'; // @codeCoverageIgnore |
@@ -334,7 +334,7 @@ discard block |
||
334 | 334 | $role = 'revenue_account'; // @codeCoverageIgnore |
335 | 335 | } |
336 | 336 | |
337 | - $key = (string) trans('firefly.opt_group_' . $role); |
|
337 | + $key = (string)trans('firefly.opt_group_' . $role); |
|
338 | 338 | $grouped[$key][$account->id] = $name; |
339 | 339 | } |
340 | 340 | |
@@ -356,7 +356,7 @@ discard block |
||
356 | 356 | // group accounts: |
357 | 357 | /** @var Account $account */ |
358 | 358 | foreach ($accountList as $account) { |
359 | - $role = (string) $repository->getMetaValue($account, 'account_role'); |
|
359 | + $role = (string)$repository->getMetaValue($account, 'account_role'); |
|
360 | 360 | $name = $account->name; |
361 | 361 | if ('' === $role) { |
362 | 362 | $role = 'no_account_type'; // @codeCoverageIgnore |
@@ -376,7 +376,7 @@ discard block |
||
376 | 376 | $role = 'expense_account'; // @codeCoverageIgnore |
377 | 377 | } |
378 | 378 | |
379 | - $key = (string) trans('firefly.opt_group_' . $role); |
|
379 | + $key = (string)trans('firefly.opt_group_' . $role); |
|
380 | 380 | $grouped[$key][$account->id] = $name; |
381 | 381 | } |
382 | 382 |
@@ -252,16 +252,16 @@ discard block |
||
252 | 252 | default: |
253 | 253 | throw new FireflyException(sprintf('Cannot handle transaction type "%s"', $this->string('transaction_type'))); // @codeCoverageIgnore |
254 | 254 | case 'withdrawal': |
255 | - $sourceId = (int) $data['source_id']; |
|
256 | - $destinationId = (int) $data['withdrawal_destination_id']; |
|
255 | + $sourceId = (int)$data['source_id']; |
|
256 | + $destinationId = (int)$data['withdrawal_destination_id']; |
|
257 | 257 | break; |
258 | 258 | case 'deposit': |
259 | - $sourceId = (int) $data['deposit_source_id']; |
|
260 | - $destinationId = (int) $data['destination_id']; |
|
259 | + $sourceId = (int)$data['deposit_source_id']; |
|
260 | + $destinationId = (int)$data['destination_id']; |
|
261 | 261 | break; |
262 | 262 | case 'transfer': |
263 | - $sourceId = (int) $data['source_id']; |
|
264 | - $destinationId = (int) $data['destination_id']; |
|
263 | + $sourceId = (int)$data['source_id']; |
|
264 | + $destinationId = (int)$data['destination_id']; |
|
265 | 265 | break; |
266 | 266 | } |
267 | 267 | |
@@ -271,7 +271,7 @@ discard block |
||
271 | 271 | |
272 | 272 | // do something with result: |
273 | 273 | if (false === $validSource) { |
274 | - $message = (string) trans('validation.generic_invalid_source'); |
|
274 | + $message = (string)trans('validation.generic_invalid_source'); |
|
275 | 275 | $validator->errors()->add('source_id', $message); |
276 | 276 | $validator->errors()->add('deposit_source_id', $message); |
277 | 277 | |
@@ -282,7 +282,7 @@ discard block |
||
282 | 282 | $validDestination = $accountValidator->validateDestination($destinationId, null, null); |
283 | 283 | // do something with result: |
284 | 284 | if (false === $validDestination) { |
285 | - $message = (string) trans('validation.generic_invalid_destination'); |
|
285 | + $message = (string)trans('validation.generic_invalid_destination'); |
|
286 | 286 | $validator->errors()->add('destination_id', $message); |
287 | 287 | $validator->errors()->add('withdrawal_destination_id', $message); |
288 | 288 | |
@@ -300,7 +300,7 @@ discard block |
||
300 | 300 | public function withValidator(Validator $validator): void |
301 | 301 | { |
302 | 302 | $validator->after( |
303 | - function (Validator $validator) { |
|
303 | + function(Validator $validator) { |
|
304 | 304 | // validate all account info |
305 | 305 | $this->validateAccountInformation($validator); |
306 | 306 | } |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | $accountValidator->setTransactionType($transactionType); |
73 | 73 | |
74 | 74 | // validate source account. |
75 | - $sourceId = isset($transaction['source_id']) ? (int) $transaction['source_id'] : null; |
|
75 | + $sourceId = isset($transaction['source_id']) ? (int)$transaction['source_id'] : null; |
|
76 | 76 | $sourceName = $transaction['source_name'] ?? null; |
77 | 77 | $sourceIban = $transaction['source_iban'] ?? null; |
78 | 78 | $validSource = $accountValidator->validateSource($sourceId, $sourceName, $sourceIban); |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | return; |
86 | 86 | } |
87 | 87 | // validate destination account |
88 | - $destinationId = isset($transaction['destination_id']) ? (int) $transaction['destination_id'] : null; |
|
88 | + $destinationId = isset($transaction['destination_id']) ? (int)$transaction['destination_id'] : null; |
|
89 | 89 | $destinationName = $transaction['destination_name'] ?? null; |
90 | 90 | $destinationIban = $transaction['destination_iban'] ?? null; |
91 | 91 | $validDestination = $accountValidator->validateDestination($destinationId, $destinationName, $destinationIban); |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | $set = [ |
211 | 211 | 'journal' => $journal, |
212 | 212 | 'name' => $field, |
213 | - 'data' => (string) ($data[$field] ?? ''), |
|
213 | + 'data' => (string)($data[$field] ?? ''), |
|
214 | 214 | ]; |
215 | 215 | |
216 | 216 | Log::debug(sprintf('Going to store meta-field "%s", with value "%s".', $set['name'], $set['data'])); |
@@ -257,11 +257,11 @@ discard block |
||
257 | 257 | $type = $this->typeRepository->findTransactionType(null, $row['type']); |
258 | 258 | $carbon = $row['date'] ?? new Carbon; |
259 | 259 | $order = $row['order'] ?? 0; |
260 | - $currency = $this->currencyRepository->findCurrency((int) $row['currency_id'], $row['currency_code']); |
|
260 | + $currency = $this->currencyRepository->findCurrency((int)$row['currency_id'], $row['currency_code']); |
|
261 | 261 | $foreignCurrency = $this->currencyRepository->findCurrencyNull($row['foreign_currency_id'], $row['foreign_currency_code']); |
262 | - $bill = $this->billRepository->findBill((int) $row['bill_id'], $row['bill_name']); |
|
262 | + $bill = $this->billRepository->findBill((int)$row['bill_id'], $row['bill_name']); |
|
263 | 263 | $billId = TransactionType::WITHDRAWAL === $type->type && null !== $bill ? $bill->id : null; |
264 | - $description = app('steam')->cleanString((string) $row['description']); |
|
264 | + $description = app('steam')->cleanString((string)$row['description']); |
|
265 | 265 | |
266 | 266 | /** Manipulate basic fields */ |
267 | 267 | $carbon->setTimezone(config('app.timezone')); |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | |
281 | 281 | /** create or get source and destination accounts */ |
282 | 282 | $sourceInfo = [ |
283 | - 'id' => (int) $row['source_id'], |
|
283 | + 'id' => (int)$row['source_id'], |
|
284 | 284 | 'name' => $row['source_name'], |
285 | 285 | 'iban' => $row['source_iban'], |
286 | 286 | 'number' => $row['source_number'], |
@@ -288,7 +288,7 @@ discard block |
||
288 | 288 | ]; |
289 | 289 | |
290 | 290 | $destInfo = [ |
291 | - 'id' => (int) $row['destination_id'], |
|
291 | + 'id' => (int)$row['destination_id'], |
|
292 | 292 | 'name' => $row['destination_name'], |
293 | 293 | 'iban' => $row['destination_iban'], |
294 | 294 | 'number' => $row['destination_number'], |
@@ -330,7 +330,7 @@ discard block |
||
330 | 330 | $transactionFactory->setForeignCurrency($foreignCurrency); |
331 | 331 | $transactionFactory->setReconciled($row['reconciled'] ?? false); |
332 | 332 | try { |
333 | - $negative = $transactionFactory->createNegative((string) $row['amount'], (string) $row['foreign_amount']); |
|
333 | + $negative = $transactionFactory->createNegative((string)$row['amount'], (string)$row['foreign_amount']); |
|
334 | 334 | } catch (FireflyException $e) { |
335 | 335 | Log::error('Exception creating negative transaction.'); |
336 | 336 | Log::error($e->getMessage()); |
@@ -349,7 +349,7 @@ discard block |
||
349 | 349 | $transactionFactory->setForeignCurrency($foreignCurrency); |
350 | 350 | $transactionFactory->setReconciled($row['reconciled'] ?? false); |
351 | 351 | try { |
352 | - $transactionFactory->createPositive((string) $row['amount'], (string) $row['foreign_amount']); |
|
352 | + $transactionFactory->createPositive((string)$row['amount'], (string)$row['foreign_amount']); |
|
353 | 353 | } catch (FireflyException $e) { |
354 | 354 | Log::error('Exception creating positive transaction.'); |
355 | 355 | Log::error($e->getMessage()); |
@@ -541,7 +541,7 @@ discard block |
||
541 | 541 | $json = json_encode($dataRow); |
542 | 542 | if (false === $json) { |
543 | 543 | // @codeCoverageIgnoreStart |
544 | - $json = json_encode((string) microtime()); |
|
544 | + $json = json_encode((string)microtime()); |
|
545 | 545 | Log::error(sprintf('Could not hash the original row! %s', json_last_error_msg()), $dataRow); |
546 | 546 | // @codeCoverageIgnoreEnd |
547 | 547 | } |
@@ -577,7 +577,7 @@ discard block |
||
577 | 577 | return; |
578 | 578 | } |
579 | 579 | |
580 | - $piggyBank = $this->piggyRepository->findPiggyBank((int) $data['piggy_bank_id'], $data['piggy_bank_name']); |
|
580 | + $piggyBank = $this->piggyRepository->findPiggyBank((int)$data['piggy_bank_id'], $data['piggy_bank_name']); |
|
581 | 581 | |
582 | 582 | if (null !== $piggyBank) { |
583 | 583 | $this->piggyEventFactory->create($journal, $piggyBank); |
@@ -600,7 +600,7 @@ discard block |
||
600 | 600 | $this->accountValidator->setTransactionType($transactionType); |
601 | 601 | |
602 | 602 | // validate source account. |
603 | - $sourceId = isset($data['source_id']) ? (int) $data['source_id'] : null; |
|
603 | + $sourceId = isset($data['source_id']) ? (int)$data['source_id'] : null; |
|
604 | 604 | $sourceName = $data['source_name'] ?? null; |
605 | 605 | $validSource = $this->accountValidator->validateSource($sourceId, $sourceName, null); |
606 | 606 | |
@@ -610,7 +610,7 @@ discard block |
||
610 | 610 | } |
611 | 611 | Log::debug('Source seems valid.'); |
612 | 612 | // validate destination account |
613 | - $destinationId = isset($data['destination_id']) ? (int) $data['destination_id'] : null; |
|
613 | + $destinationId = isset($data['destination_id']) ? (int)$data['destination_id'] : null; |
|
614 | 614 | $destinationName = (string)($data['destination_name'] ?? null); |
615 | 615 | $validDestination = $this->accountValidator->validateDestination($destinationId, $destinationName, null); |
616 | 616 | // do something with result: |
@@ -189,9 +189,9 @@ discard block |
||
189 | 189 | { |
190 | 190 | /** @var Collection $set */ |
191 | 191 | $set = $this->user->budgets()->where('active', 1) |
192 | - ->orderBy('order', 'DESC') |
|
193 | - ->orderBy('name', 'ASC') |
|
194 | - ->get(); |
|
192 | + ->orderBy('order', 'DESC') |
|
193 | + ->orderBy('name', 'ASC') |
|
194 | + ->get(); |
|
195 | 195 | |
196 | 196 | return $set; |
197 | 197 | } |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | { |
204 | 204 | /** @var Collection $set */ |
205 | 205 | $set = $this->user->budgets()->orderBy('order', 'DESC') |
206 | - ->orderBy('name', 'ASC')->get(); |
|
206 | + ->orderBy('name', 'ASC')->get(); |
|
207 | 207 | |
208 | 208 | return $set; |
209 | 209 | } |
@@ -227,8 +227,8 @@ discard block |
||
227 | 227 | { |
228 | 228 | /** @var Collection $set */ |
229 | 229 | $set = $this->user->budgets() |
230 | - ->orderBy('order', 'DESC') |
|
231 | - ->orderBy('name', 'ASC')->where('active', 0)->get(); |
|
230 | + ->orderBy('order', 'DESC') |
|
231 | + ->orderBy('name', 'ASC')->where('active', 0)->get(); |
|
232 | 232 | |
233 | 233 | return $set; |
234 | 234 | } |
@@ -411,10 +411,10 @@ discard block |
||
411 | 411 | { |
412 | 412 | $types = ['set_budget',]; |
413 | 413 | $actions = RuleAction::leftJoin('rules', 'rules.id', '=', 'rule_actions.rule_id') |
414 | - ->where('rules.user_id', $this->user->id) |
|
415 | - ->whereIn('rule_actions.action_type', $types) |
|
416 | - ->where('rule_actions.action_value', $oldName) |
|
417 | - ->get(['rule_actions.*']); |
|
414 | + ->where('rules.user_id', $this->user->id) |
|
415 | + ->whereIn('rule_actions.action_type', $types) |
|
416 | + ->where('rule_actions.action_value', $oldName) |
|
417 | + ->get(['rule_actions.*']); |
|
418 | 418 | Log::debug(sprintf('Found %d actions to update.', $actions->count())); |
419 | 419 | /** @var RuleAction $action */ |
420 | 420 | foreach ($actions as $action) { |
@@ -432,10 +432,10 @@ discard block |
||
432 | 432 | { |
433 | 433 | $types = ['budget_is',]; |
434 | 434 | $triggers = RuleTrigger::leftJoin('rules', 'rules.id', '=', 'rule_triggers.rule_id') |
435 | - ->where('rules.user_id', $this->user->id) |
|
436 | - ->whereIn('rule_triggers.trigger_type', $types) |
|
437 | - ->where('rule_triggers.trigger_value', $oldName) |
|
438 | - ->get(['rule_triggers.*']); |
|
435 | + ->where('rules.user_id', $this->user->id) |
|
436 | + ->whereIn('rule_triggers.trigger_type', $types) |
|
437 | + ->where('rule_triggers.trigger_value', $oldName) |
|
438 | + ->get(['rule_triggers.*']); |
|
439 | 439 | Log::debug(sprintf('Found %d triggers to update.', $triggers->count())); |
440 | 440 | /** @var RuleTrigger $trigger */ |
441 | 441 | foreach ($triggers as $trigger) { |