mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-18 10:16:49 +00:00
Code cleanup [skip ci]
This commit is contained in:
@@ -96,7 +96,7 @@ class BudgetController extends Controller
|
||||
// if today is between start and end, use the diff in days between end and today (days left)
|
||||
// otherwise, use diff between start and end.
|
||||
$today = new Carbon;
|
||||
Log::debug(sprintf('Start is %s, end is %s, today is %s', $start->format('Y-m-d'), $end->format('Y-m-d'),$today->format('Y-m-d')));
|
||||
Log::debug(sprintf('Start is %s, end is %s, today is %s', $start->format('Y-m-d'), $end->format('Y-m-d'), $today->format('Y-m-d')));
|
||||
if ($today->gte($start) && $today->lte($end)) {
|
||||
$days = $end->diffInDays($today);
|
||||
$daysInMonth = $start->diffInDays($today);
|
||||
|
@@ -111,10 +111,12 @@ class DebugController extends Controller
|
||||
|
||||
return view(
|
||||
'debug', compact(
|
||||
'phpVersion', 'extensions', 'localeAttempts', 'appEnv', 'appDebug', 'appLog', 'appLogLevel', 'now', 'packages', 'drivers', 'currentDriver',
|
||||
'userAgent', 'displayErrors', 'errorReporting', 'phpOs', 'interface', 'logContent', 'cacheDriver', 'isDocker', 'isSandstorm', 'trustedProxies',
|
||||
'toSandbox'
|
||||
)
|
||||
'phpVersion', 'extensions', 'localeAttempts', 'appEnv', 'appDebug', 'appLog', 'appLogLevel', 'now', 'packages', 'drivers',
|
||||
'currentDriver',
|
||||
'userAgent', 'displayErrors', 'errorReporting', 'phpOs', 'interface', 'logContent', 'cacheDriver', 'isDocker', 'isSandstorm',
|
||||
'trustedProxies',
|
||||
'toSandbox'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
@@ -23,13 +23,11 @@ declare(strict_types=1);
|
||||
namespace FireflyIII\Http\Controllers;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use ExpandedForm;
|
||||
use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Http\Requests\RuleFormRequest;
|
||||
use FireflyIII\Http\Requests\SelectTransactionsRequest;
|
||||
use FireflyIII\Http\Requests\TestRuleFormRequest;
|
||||
use FireflyIII\Jobs\ExecuteRuleOnExistingTransactions;
|
||||
use FireflyIII\Models\AccountType;
|
||||
use FireflyIII\Models\Bill;
|
||||
use FireflyIII\Models\Rule;
|
||||
use FireflyIII\Models\RuleAction;
|
||||
@@ -331,11 +329,11 @@ class RuleController extends Controller
|
||||
public function selectTransactions(Rule $rule)
|
||||
{
|
||||
// does the user have shared accounts?
|
||||
$first = session('first')->format('Y-m-d');
|
||||
$today = Carbon::create()->format('Y-m-d');
|
||||
$subTitle = (string)trans('firefly.apply_rule_selection', ['title' => $rule->title]);
|
||||
$first = session('first')->format('Y-m-d');
|
||||
$today = Carbon::create()->format('Y-m-d');
|
||||
$subTitle = (string)trans('firefly.apply_rule_selection', ['title' => $rule->title]);
|
||||
|
||||
return view('rules.rule.select-transactions', compact( 'first', 'today', 'rule', 'subTitle'));
|
||||
return view('rules.rule.select-transactions', compact('first', 'today', 'rule', 'subTitle'));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -429,6 +427,7 @@ class RuleController extends Controller
|
||||
Log::error(sprintf('Could not render view in testTriggers(): %s', $exception->getMessage()));
|
||||
Log::error($exception->getTraceAsString());
|
||||
}
|
||||
|
||||
// @codeCoverageIgnoreEnd
|
||||
|
||||
return response()->json(['html' => $view, 'warning' => $warning]);
|
||||
@@ -490,6 +489,7 @@ class RuleController extends Controller
|
||||
Log::error(sprintf('Could not render view in testTriggersByRule(): %s', $exception->getMessage()));
|
||||
Log::error($exception->getTraceAsString());
|
||||
}
|
||||
|
||||
// @codeCoverageIgnoreEnd
|
||||
|
||||
return response()->json(['html' => $view, 'warning' => $warning]);
|
||||
@@ -600,6 +600,7 @@ class RuleController extends Controller
|
||||
Log::error(sprintf('Throwable was thrown in getActionsForBill(): %s', $e->getMessage()));
|
||||
Log::error($e->getTraceAsString());
|
||||
}
|
||||
|
||||
// @codeCoverageIgnoreEnd
|
||||
|
||||
return $actions;
|
||||
@@ -809,6 +810,7 @@ class RuleController extends Controller
|
||||
Log::debug(sprintf('Throwable was thrown in getTriggersForBill(): %s', $e->getMessage()));
|
||||
Log::debug($e->getTraceAsString());
|
||||
}
|
||||
|
||||
// @codeCoverageIgnoreEnd
|
||||
|
||||
return $triggers;
|
||||
|
@@ -87,7 +87,7 @@ class BulkController extends Controller
|
||||
|
||||
|
||||
/**
|
||||
* @param BulkEditJournalRequest $request
|
||||
* @param BulkEditJournalRequest $request
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
|
@@ -98,8 +98,9 @@ class ConvertController extends Controller
|
||||
|
||||
return view(
|
||||
'transactions.convert', compact(
|
||||
'sourceType', 'destinationType', 'journal', 'positiveAmount', 'sourceAccount', 'destinationAccount', 'sourceType', 'subTitle', 'subTitleIcon'
|
||||
)
|
||||
'sourceType', 'destinationType', 'journal', 'positiveAmount', 'sourceAccount', 'destinationAccount', 'sourceType',
|
||||
'subTitle', 'subTitleIcon'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
@@ -24,7 +24,6 @@ namespace FireflyIII\Http\Controllers\Transaction;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Helpers\Collector\JournalCollectorInterface;
|
||||
use FireflyIII\Helpers\Filter\NegativeAmountFilter;
|
||||
use FireflyIII\Helpers\Filter\TransactionViewFilter;
|
||||
use FireflyIII\Http\Controllers\Controller;
|
||||
use FireflyIII\Http\Requests\MassDeleteJournalRequest;
|
||||
@@ -37,10 +36,9 @@ use FireflyIII\Repositories\Budget\BudgetRepositoryInterface;
|
||||
use FireflyIII\Repositories\Journal\JournalRepositoryInterface;
|
||||
use FireflyIII\Transformers\TransactionTransformer;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\View\View as IlluminateView;
|
||||
use Preferences;
|
||||
use Symfony\Component\HttpFoundation\ParameterBag;
|
||||
use View;
|
||||
use Illuminate\View\View as IlluminateView;
|
||||
|
||||
/**
|
||||
* Class MassController.
|
||||
@@ -155,10 +153,11 @@ class MassController extends Controller
|
||||
// transform to array
|
||||
$transactions = $collection->map(
|
||||
function (Transaction $transaction) use ($transformer) {
|
||||
$transaction= $transformer->transform($transaction);
|
||||
$transaction = $transformer->transform($transaction);
|
||||
// make sure amount is positive:
|
||||
$transaction['amount'] = app('steam')->positive((string)$transaction['amount']);
|
||||
$transaction['amount'] = app('steam')->positive((string)$transaction['amount']);
|
||||
$transaction['foreign_amount'] = app('steam')->positive((string)$transaction['foreign_amount']);
|
||||
|
||||
return $transaction;
|
||||
}
|
||||
);
|
||||
|
Reference in New Issue
Block a user