Firefly III: a personal finances manager
PHP accountingbudgetbudgetingbudgetscash-flowcashflowcredit-carddockerexpensesfinancefinancesfinanciallinuxmoneypaycheckpersonal-financephpphp7
Various code cleanup.
James Cole3815f9836f10
diff --git a/app/Console/Commands/CreateImport.php b/app/Console/Commands/CreateImport.phpindex b29d83e291..bfb52735e2 100644--- a/app/Console/Commands/CreateImport.php+++ b/app/Console/Commands/CreateImport.php@@ -150,7 +150,9 @@ class CreateImport extends Command$this->error(sprintf('Error importing line #%d: %s', $index, $error));}$this->line(- sprintf('The import has finished. %d transactions have been imported out of %d records.', $routine->getJournals()->count(), $routine->lines)+ sprintf(+ 'The import has finished. %d transactions have been imported out of %d records.', $routine->getJournals()->count(), $routine->getLines()+ ));}diff --git a/app/Console/Commands/Import.php b/app/Console/Commands/Import.phpindex 5f156c3e1f..65ae256332 100644--- a/app/Console/Commands/Import.php+++ b/app/Console/Commands/Import.php@@ -85,8 +85,8 @@ class Import extends Command$monolog->pushHandler($handler);// actually start job:- $type = 'csv' === $job->file_type ? 'file' : $job->file_type;- $key = sprintf('import.routine.%s', $type);+ $type = 'csv' === $job->file_type ? 'file' : $job->file_type;+ $key = sprintf('import.routine.%s', $type);$className = config($key);if (null === $className || !class_exists($className)) {throw new FireflyException(sprintf('Cannot find import routine class for job of type "%s".', $type)); // @codeCoverageIgnore@@ -98,11 +98,13 @@ class Import extends Command$routine->run();/** @var MessageBag $error */- foreach ($routine->errors as $index => $error) {+ foreach ($routine->getErrors() as $index => $error) {$this->error(sprintf('Error importing line #%d: %s', $index, $error));}- $this->line(sprintf('The import has finished. %d transactions have been imported out of %d records.', $routine->journals->count(), $routine->lines));+ $this->line(+ sprintf('The import has finished. %d transactions have been imported out of %d records.', $routine->getJournals()->count(), $routine->getLines())+ );return;}diff --git a/app/Export/Entry/Entry.php b/app/Export/Entry/Entry.phpindex 8819b726fc..63f0c5ea43 100644--- a/app/Export/Entry/Entry.php+++ b/app/Export/Entry/Entry.php@@ -203,7 +203,7 @@ final class Entry$entry->description = $transaction->transaction_description . '(' . $transaction->description . ')';}$entry->currency_code = $transaction->transactionCurrency->code;- $entry->amount = round($transaction->transaction_amount, $transaction->transactionCurrency->decimal_places);+ $entry->amount = strval(round($transaction->transaction_amount, $transaction->transactionCurrency->decimal_places));$entry->foreign_currency_code = null === $transaction->foreign_currency_id ? null : $transaction->foreignCurrency->code;$entry->foreign_amount = null === $transaction->foreign_currency_id@@ -216,14 +216,14 @@ final class Entry);$entry->transaction_type = $transaction->transaction_type_type;- $entry->asset_account_id = $transaction->account_id;+ $entry->asset_account_id = strval($transaction->account_id);$entry->asset_account_name = app('steam')->tryDecrypt($transaction->account_name);$entry->asset_account_iban = $transaction->account_iban;$entry->asset_account_number = $transaction->account_number;$entry->asset_account_bic = $transaction->account_bic;$entry->asset_currency_code = $transaction->account_currency_code;- $entry->opposing_account_id = $transaction->opposing_account_id;+ $entry->opposing_account_id = strval($transaction->opposing_account_id);$entry->opposing_account_name = app('steam')->tryDecrypt($transaction->opposing_account_name);$entry->opposing_account_iban = $transaction->opposing_account_iban;$entry->opposing_account_number = $transaction->opposing_account_number;@@ -231,7 +231,7 @@ final class Entry$entry->opposing_currency_code = $transaction->opposing_currency_code;// budget- $entry->budget_id = $transaction->transaction_budget_id;+ $entry->budget_id = strval($transaction->transaction_budget_id);$entry->budget_name = app('steam')->tryDecrypt($transaction->transaction_budget_name);if (null === $transaction->transaction_budget_id) {$entry->budget_id = $transaction->transaction_journal_budget_id;@@ -239,7 +239,7 @@ final class Entry}// category- $entry->category_id = $transaction->transaction_category_id;+ $entry->category_id = strval($transaction->transaction_category_id);$entry->category_name = app('steam')->tryDecrypt($transaction->transaction_category_name);if (null === $transaction->transaction_category_id) {$entry->category_id = $transaction->transaction_journal_category_id;@@ -247,7 +247,7 @@ final class Entry}// budget- $entry->bill_id = $transaction->bill_id;+ $entry->bill_id = strval($transaction->bill_id);$entry->bill_name = app('steam')->tryDecrypt($transaction->bill_name);$entry->tags = $transaction->tags;diff --git a/app/Export/Exporter/CsvExporter.php b/app/Export/Exporter/CsvExporter.phpindex e2703b0d20..012e4d6e2b 100644--- a/app/Export/Exporter/CsvExporter.php+++ b/app/Export/Exporter/CsvExporter.php@@ -24,8 +24,6 @@ namespace FireflyIII\Export\Exporter;use FireflyIII\Export\Entry\Entry;use League\Csv\Writer;-use SplFileObject;-use SplTempFileObject;use Storage;/**@@ -66,12 +64,9 @@ class CsvExporter extends BasicExporter implements ExporterInterface$fullPath = storage_path('export') . DIRECTORY_SEPARATOR . $this->fileName;-//we create the CSV into memory- //$writer = Writer::createFromFileObject(new SplTempFileObject());$writer = Writer::createFromPath($fullPath);- //$writer = Writer::createFromPath(new SplFileObject($fullPath, 'a+'), 'w');- $rows = [];+ $rows = [];// get field names for header row:$first = $this->getEntries()->first();@@ -91,8 +86,6 @@ class CsvExporter extends BasicExporter implements ExporterInterface$rows[] = $line;}$writer->insertAll($rows);- //$writer->output($fullPath);- //$writer->return true;}@@ -102,6 +95,6 @@ class CsvExporter extends BasicExporter implements ExporterInterface$this->fileName = $this->job->key . '-records.csv';// touch file in export directory:$disk = Storage::disk('export');- $disk->put($this->fileName,'');+ $disk->put($this->fileName, '');}}diff --git a/app/Generator/Report/Tag/MonthReportGenerator.php b/app/Generator/Report/Tag/MonthReportGenerator.phpindex 43a6899482..e1cdc808fc 100644--- a/app/Generator/Report/Tag/MonthReportGenerator.php+++ b/app/Generator/Report/Tag/MonthReportGenerator.php@@ -65,6 +65,7 @@ class MonthReportGenerator extends Support implements ReportGeneratorInterface/*** @return string+ * @throws \Throwable*/public function generate(): string{diff --git a/app/Handlers/Events/UserEventHandler.php b/app/Handlers/Events/UserEventHandler.phpindex 6fcb3428eb..23f09fbfeb 100644--- a/app/Handlers/Events/UserEventHandler.php+++ b/app/Handlers/Events/UserEventHandler.php@@ -76,6 +76,7 @@ class UserEventHandler{Log::debug('In checkSingleUserIsAdmin');+ /** @var User $user */$user = $event->user;$count = User::count();diff --git a/app/Handlers/Events/VersionCheckEventHandler.php b/app/Handlers/Events/VersionCheckEventHandler.phpindex 612af9f13b..6753f1d9a6 100644--- a/app/Handlers/Events/VersionCheckEventHandler.php+++ b/app/Handlers/Events/VersionCheckEventHandler.php@@ -26,7 +26,6 @@ namespace FireflyIII\Handlers\Events;use FireflyConfig;use FireflyIII\Events\RequestedVersionCheckStatus;use FireflyIII\User;-use Illuminate\Auth\Events\Login;use Log;/**diff --git a/app/Http/Controllers/AccountController.php b/app/Http/Controllers/AccountController.phpindex 8ef77b6326..421425a835 100644--- a/app/Http/Controllers/AccountController.php+++ b/app/Http/Controllers/AccountController.php@@ -101,13 +101,12 @@ class AccountController extends Controller}/**- * @param Request $request* @param AccountRepositoryInterface $repository* @param Account $account** @return View*/- public function delete(Request $request, AccountRepositoryInterface $repository, Account $account)+ public function delete(AccountRepositoryInterface $repository, Account $account){$typeName = config('firefly.shortNamesByFullName.' . $account->accountType->type);$subTitle = trans('firefly.delete_' . $typeName . '_account', ['name' => $account->name]);diff --git a/app/Http/Controllers/Admin/UpdateController.php b/app/Http/Controllers/Admin/UpdateController.phpindex 38b2723ca1..f8208d659f 100644--- a/app/Http/Controllers/Admin/UpdateController.php+++ b/app/Http/Controllers/Admin/UpdateController.php@@ -102,14 +102,15 @@ class UpdateController extends Controller/** @var UpdateRequest $request */$request = app(UpdateRequest::class);$check = -2;+ $first = new Release(['id' => '0', 'title' => '0', 'updated' => '2017-01-01', 'content' => '']);+ $string = '';try {$request->call();$releases = $request->getReleases();// first entry should be the latest entry:/** @var Release $first */- $first = reset($releases);- $string = '';- $check = version_compare($current, $first->getTitle());+ $first = reset($releases);+ $check = version_compare($current, $first->getTitle());FireflyConfig::set('last_update_check', time());} catch (FireflyException $e) {Log::error(sprintf('Could not check for updates: %s', $e->getMessage()));@@ -120,7 +121,12 @@ class UpdateController extends Controllerif ($check === -1) {// there is a new FF version!- $string = strval(trans('firefly.update_new_version_alert', ['your_version' => $current, 'new_version' => $first->getTitle(), 'date' => $first->getUpdated()->formatLocalized($this->monthAndDayFormat)]));+ $string = strval(+ trans(+ 'firefly.update_new_version_alert',+ ['your_version' => $current, 'new_version' => $first->getTitle(), 'date' => $first->getUpdated()->formatLocalized($this->monthAndDayFormat)]+ )+ );}if ($check === 0) {// you are running the current version!diff --git a/app/Http/Controllers/AttachmentController.php b/app/Http/Controllers/AttachmentController.phpindex 6407760e55..8937027dfd 100644--- a/app/Http/Controllers/AttachmentController.php+++ b/app/Http/Controllers/AttachmentController.php@@ -59,12 +59,11 @@ class AttachmentController extends Controller}/**- * @param Request $request* @param Attachment $attachment** @return View*/- public function delete(Request $request, Attachment $attachment)+ public function delete(Attachment $attachment){$subTitle = trans('firefly.delete_attachment', ['name' => $attachment->filename]);diff --git a/app/Http/Controllers/Auth/LoginController.php b/app/Http/Controllers/Auth/LoginController.phpindex 46f24a243f..e6a4bfcc9b 100644--- a/app/Http/Controllers/Auth/LoginController.php+++ b/app/Http/Controllers/Auth/LoginController.php@@ -64,7 +64,7 @@ class LoginController extends Controller** @param Request $request*- * @return \Illuminate\Http\Response|\Symfony\Component\HttpFoundation\Response|void+ * @return \Illuminate\Http\Response|\Symfony\Component\HttpFoundation\Response** @throws \Illuminate\Validation\ValidationException*/@@ -102,7 +102,7 @@ class LoginController extends Controller* @param Request $request* @param CookieJar $cookieJar*- * @return $this+ * @return $this|\Illuminate\Http\RedirectResponse*/public function logout(Request $request, CookieJar $cookieJar){diff --git a/app/Http/Controllers/BillController.php b/app/Http/Controllers/BillController.phpindex e867c87b95..391749489a 100644--- a/app/Http/Controllers/BillController.php+++ b/app/Http/Controllers/BillController.php@@ -91,12 +91,11 @@ class BillController extends Controller}/**- * @param Request $request- * @param Bill $bill+ * @param Bill $bill** @return View*/- public function delete(Request $request, Bill $bill)+ public function delete(Bill $bill){// put previous url in session$this->rememberPreviousUri('bills.delete.uri');@@ -194,7 +193,7 @@ class BillController extends Controller});// paginate bills- $bills= new LengthAwarePaginator($collection, $total, $pageSize, $page);+ $bills = new LengthAwarePaginator($collection, $total, $pageSize, $page);$bills->setPath(route('bills.index'));return view('bills.index', compact('bills'));diff --git a/app/Http/Controllers/BudgetController.php b/app/Http/Controllers/BudgetController.phpindex 50c21f95d3..cf5a41bc6f 100644--- a/app/Http/Controllers/BudgetController.php+++ b/app/Http/Controllers/BudgetController.php@@ -118,12 +118,11 @@ class BudgetController extends Controller}/**- * @param Request $request- * @param Budget $budget+ * @param Budget $budget** @return View*/- public function delete(Request $request, Budget $budget)+ public function delete(Budget $budget){$subTitle = trans('firefly.delete_budget', ['name' => $budget->name]);diff --git a/app/Http/Controllers/CategoryController.php b/app/Http/Controllers/CategoryController.phpindex 61f1c9980f..0e3013f88a 100644--- a/app/Http/Controllers/CategoryController.php+++ b/app/Http/Controllers/CategoryController.php@@ -80,12 +80,11 @@ class CategoryController extends Controller}/**- * @param Request $request* @param Category $category** @return View*/- public function delete(Request $request, Category $category)+ public function delete(Category $category){$subTitle = trans('firefly.delete_category', ['name' => $category->name]);diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.phpindex 59ea09c3c7..32c2c63a24 100644--- a/app/Http/Controllers/HomeController.php+++ b/app/Http/Controllers/HomeController.php@@ -25,6 +25,7 @@ namespace FireflyIII\Http\Controllers;use Artisan;use Carbon\Carbon;use DB;+use Exception;use FireflyIII\Events\RequestedVersionCheckStatus;use FireflyIII\Exceptions\FireflyException;use FireflyIII\Helpers\Collector\JournalCollectorInterface;@@ -39,7 +40,6 @@ use Illuminate\Support\Collection;use Log;use Monolog\Handler\RotatingFileHandler;use Preferences;-use ReflectionException;use Response;use Route as RouteFacade;use View;@@ -186,7 +186,7 @@ class HomeController extends ControllerLog::debug('Call twig:clean...');try {Artisan::call('twig:clean');- } catch (ReflectionException $e) {+ } catch (Exception $e) {// dont care}Log::debug('Call view:clear...');diff --git a/app/Http/Controllers/Import/PrerequisitesController.php b/app/Http/Controllers/Import/PrerequisitesController.phpindex 9d0755fdbc..42a7b3d243 100644--- a/app/Http/Controllers/Import/PrerequisitesController.php+++ b/app/Http/Controllers/Import/PrerequisitesController.php@@ -60,7 +60,7 @@ class PrerequisitesController extends Controller** @param string $bank*- * @return \Illuminate\Http\RedirectResponse|null+ * @return \Illuminate\View\View|\Illuminate\Contracts\View\Factory|\Illuminate\Http\RedirectResponse** @throws FireflyException*/diff --git a/app/Http/Controllers/Import/StatusController.php b/app/Http/Controllers/Import/StatusController.phpindex 267ba7f5e4..fd54229a95 100644--- a/app/Http/Controllers/Import/StatusController.php+++ b/app/Http/Controllers/Import/StatusController.php@@ -108,8 +108,6 @@ class StatusController extends Controller$result['running'] = true;}- // TODO cannot handle 'error'-return Response::json($result);}}diff --git a/app/Http/Controllers/Json/AutoCompleteController.php b/app/Http/Controllers/Json/AutoCompleteController.phpindex 3381500649..6e28443d54 100644--- a/app/Http/Controllers/Json/AutoCompleteController.php+++ b/app/Http/Controllers/Json/AutoCompleteController.php@@ -29,7 +29,6 @@ use FireflyIII\Models\AccountType;use FireflyIII\Models\TransactionJournal;use FireflyIII\Repositories\Account\AccountRepositoryInterface;use FireflyIII\Support\CacheProperties;-use Log;use Response;/**diff --git a/app/Http/Controllers/Json/IntroController.php b/app/Http/Controllers/Json/IntroController.phpindex 986a3b103e..ace783ae57 100644--- a/app/Http/Controllers/Json/IntroController.php+++ b/app/Http/Controllers/Json/IntroController.php@@ -46,6 +46,7 @@ class IntroController$specificSteps = $this->getSpecificSteps($route, $specificPage);if (0 === count($specificSteps)) {Log::debug(sprintf('No specific steps for route "%s" and page "%s"', $route, $specificPage));+return Response::json($steps);}if ($this->hasOutroStep($route)) {diff --git a/app/Http/Controllers/Popup/ReportController.php b/app/Http/Controllers/Popup/ReportController.phpindex 0a27cdb2f2..b7d3fc7654 100644--- a/app/Http/Controllers/Popup/ReportController.php+++ b/app/Http/Controllers/Popup/ReportController.php@@ -238,7 +238,7 @@ class ReportController extends Controllerprivate function parseAttributes(array $attributes): array{$attributes['location'] = $attributes['location'] ?? '';- $attributes['accounts'] = AccountList::routeBinder($attributes['accounts'] ?? '', new Route('get','',[]));+ $attributes['accounts'] = AccountList::routeBinder($attributes['accounts'] ?? '', new Route('get', '', []));try {$attributes['startDate'] = Carbon::createFromFormat('Ymd', $attributes['startDate']);} catch (InvalidArgumentException $e) {diff --git a/app/Http/Controllers/PreferencesController.php b/app/Http/Controllers/PreferencesController.phpindex 608cb1e6c4..75e3a70a50 100644--- a/app/Http/Controllers/PreferencesController.php+++ b/app/Http/Controllers/PreferencesController.php@@ -26,8 +26,8 @@ use FireflyIII\Http\Requests\TokenFormRequest;use FireflyIII\Models\AccountType;use FireflyIII\Repositories\Account\AccountRepositoryInterface;use FireflyIII\Repositories\User\UserRepositoryInterface;-use Illuminate\Http\Request;use Google2FA;+use Illuminate\Http\Request;use Preferences;use Session;use View;diff --git a/app/Http/Controllers/Report/ExpenseController.php b/app/Http/Controllers/Report/ExpenseController.phpindex eea0e638b6..90dc90a2ea 100644--- a/app/Http/Controllers/Report/ExpenseController.php+++ b/app/Http/Controllers/Report/ExpenseController.php@@ -231,7 +231,7 @@ class ExpenseController extends Controller$cache->addProperty($accounts->pluck('id')->toArray());$cache->addProperty($expense->pluck('id')->toArray());if ($cache->has()) {- //return $cache->get(); // @codeCoverageIgnore+ return $cache->get(); // @codeCoverageIgnore}$combined = $this->combineAccounts($expense);$all = new Collection;diff --git a/app/Http/Controllers/Transaction/SplitController.php b/app/Http/Controllers/Transaction/SplitController.phpindex ae111b3827..d93e431df7 100644--- a/app/Http/Controllers/Transaction/SplitController.php+++ b/app/Http/Controllers/Transaction/SplitController.php@@ -59,12 +59,10 @@ class SplitController extends Controller/** @var CurrencyRepositoryInterface */private $currencies;-- /** @var JournalTaskerInterface */- private $tasker;-/** @var JournalRepositoryInterface */private $repository;+ /** @var JournalTaskerInterface */+ private $tasker;/***@@ -81,7 +79,7 @@ class SplitController extends Controller$this->tasker = app(JournalTaskerInterface::class);$this->attachments = app(AttachmentHelperInterface::class);$this->currencies = app(CurrencyRepositoryInterface::class);- $this->repository = app(JournalRepositoryInterface::class);+ $this->repository = app(JournalRepositoryInterface::class);app('view')->share('mainTitleIcon', 'fa-share-alt');app('view')->share('title', trans('firefly.split-transactions'));@@ -145,8 +143,8 @@ class SplitController extends Controller}/**- * @param SplitJournalFormRequest $request- * @param TransactionJournal $journal+ * @param SplitJournalFormRequest $request+ * @param TransactionJournal $journal** @return $this|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector*/diff --git a/app/Import/FileProcessor/CsvProcessor.php b/app/Import/FileProcessor/CsvProcessor.phpindex 1608c4e7bf..1ad9d6b973 100644--- a/app/Import/FileProcessor/CsvProcessor.php+++ b/app/Import/FileProcessor/CsvProcessor.php@@ -72,6 +72,7 @@ class CsvProcessor implements FileProcessorInterface* @return bool** @throws \League\Csv\Exception+ * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException*/public function run(): bool{diff --git a/app/Import/Object/ImportJournal.php b/app/Import/Object/ImportJournal.phpindex b7f8e3ca89..a903ffe7e1 100644--- a/app/Import/Object/ImportJournal.php+++ b/app/Import/Object/ImportJournal.php@@ -330,6 +330,7 @@ class ImportJournal*/private function selectAmountInput(){+ $info = [];$converterClass = '';if (!is_null($this->amount)) {Log::debug('Amount value is not NULL, assume this is the correct value.');diff --git a/app/Import/Storage/ImportStorage.php b/app/Import/Storage/ImportStorage.phpindex 4b0823fbba..f548ae0068 100644--- a/app/Import/Storage/ImportStorage.php+++ b/app/Import/Storage/ImportStorage.php@@ -236,7 +236,6 @@ class ImportStorage// match bills if config calls for it.if (true === $this->matchBills) {- //$this->/applyRules($journal);Log::info('Cannot match bills (yet).');$this->matchBills($journal);}diff --git a/app/Models/Account.php b/app/Models/Account.phpindex c4e523a886..11a1061320 100644--- a/app/Models/Account.php+++ b/app/Models/Account.php@@ -189,6 +189,7 @@ class Account extends Model/*** @codeCoverageIgnore+ ** @param string $fieldName** @return string@@ -206,6 +207,7 @@ class Account extends Model/*** @codeCoverageIgnore+ ** @param $value** @return string@@ -299,6 +301,7 @@ class Account extends Model/*** @codeCoverageIgnore+ ** @param EloquentBuilder $query* @param array $types*/@@ -313,6 +316,7 @@ class Account extends Model/*** @codeCoverageIgnore+ ** @param EloquentBuilder $query* @param string $name* @param string $value@@ -331,7 +335,9 @@ class Account extends Model/*** @codeCoverageIgnore+ ** @param $value+ ** @codeCoverageIgnore*/public function setIbanAttribute($value)@@ -341,6 +347,7 @@ class Account extends Model/*** @codeCoverageIgnore+ ** @param $value*/public function setNameAttribute($value)@@ -352,7 +359,9 @@ class Account extends Model/*** @codeCoverageIgnore+ ** @param $value+ ** @codeCoverageIgnore*/public function setVirtualBalanceAttribute($value)diff --git a/app/Models/AccountMeta.php b/app/Models/AccountMeta.phpindex f70953f3be..c98e4780da 100644--- a/app/Models/AccountMeta.php+++ b/app/Models/AccountMeta.php@@ -69,6 +69,7 @@ class AccountMeta extends Model/*** @param $value+ ** @codeCoverageIgnore*/public function setDataAttribute($value)diff --git a/app/Models/Attachment.php b/app/Models/Attachment.phpindex 957996968e..f78478dde8 100644--- a/app/Models/Attachment.php+++ b/app/Models/Attachment.php@@ -70,6 +70,7 @@ class Attachment extends Model/*** Get all of the owning attachable models.+ ** @codeCoverageIgnore** @return MorphTo@@ -81,7 +82,8 @@ class Attachment extends Model/*** Returns the expected filename for this attachment.- *@codeCoverageIgnore+ *+ * @codeCoverageIgnore* @return string*/public function fileName(): string@@ -91,7 +93,8 @@ class Attachment extends Model/*** @param $value- *@codeCoverageIgnore+ *+ * @codeCoverageIgnore* @return null|string*/public function getDescriptionAttribute($value)@@ -105,7 +108,8 @@ class Attachment extends Model/*** @param $value- *@codeCoverageIgnore+ *+ * @codeCoverageIgnore* @return null|string*/public function getFilenameAttribute($value)@@ -119,7 +123,8 @@ class Attachment extends Model/*** @param $value- *@codeCoverageIgnore+ *+ * @codeCoverageIgnore* @return null|string*/public function getMimeAttribute($value)@@ -133,7 +138,8 @@ class Attachment extends Model/*** @param $value- *@codeCoverageIgnore+ *+ * @codeCoverageIgnore* @return null|string*/public function getNotesAttribute($value)@@ -147,7 +153,8 @@ class Attachment extends Model/*** @param $value- *@codeCoverageIgnore+ *+ * @codeCoverageIgnore* @return null|string*/public function getTitleAttribute($value)@@ -161,6 +168,7 @@ class Attachment extends Model/*** @codeCoverageIgnore+ ** @param string $value*/public function setDescriptionAttribute(string $value)@@ -170,6 +178,7 @@ class Attachment extends Model/*** @codeCoverageIgnore+ ** @param string $value*/public function setFilenameAttribute(string $value)@@ -179,6 +188,7 @@ class Attachment extends Model/*** @codeCoverageIgnore+ ** @param string $value*/public function setMimeAttribute(string $value)@@ -188,6 +198,7 @@ class Attachment extends Model/*** @codeCoverageIgnore+ ** @param string $value*/public function setNotesAttribute(string $value)@@ -197,6 +208,7 @@ class Attachment extends Model/*** @codeCoverageIgnore+ ** @param string $value*/public function setTitleAttribute(string $value)diff --git a/app/Models/Bill.php b/app/Models/Bill.phpindex 68121c947c..b7dcb125cd 100644--- a/app/Models/Bill.php+++ b/app/Models/Bill.php@@ -96,6 +96,7 @@ class Bill extends Model/*** @codeCoverageIgnore+ ** @param $value** @return string@@ -111,6 +112,7 @@ class Bill extends Model/*** @codeCoverageIgnore+ ** @param $value** @return string@@ -135,6 +137,7 @@ class Bill extends Model/*** @codeCoverageIgnore+ ** @param $value*/public function setAmountMaxAttribute($value)@@ -144,6 +147,7 @@ class Bill extends Model/*** @param $value+ ** @codeCoverageIgnore*/public function setAmountMinAttribute($value)@@ -153,6 +157,7 @@ class Bill extends Model/*** @param $value+ ** @codeCoverageIgnore*/public function setMatchAttribute($value)@@ -164,6 +169,7 @@ class Bill extends Model/*** @param $value+ ** @codeCoverageIgnore*/public function setNameAttribute($value)diff --git a/app/Models/Budget.php b/app/Models/Budget.phpindex a47b9e9176..ba013701ea 100644--- a/app/Models/Budget.php+++ b/app/Models/Budget.php@@ -84,7 +84,7 @@ class Budget extends Model}/**- * @param Budget $value+ * @param string $value** @return Budget*/@@ -111,6 +111,7 @@ class Budget extends Model/*** @codeCoverageIgnore+ ** @param $value** @return string@@ -126,6 +127,7 @@ class Budget extends Model/*** @codeCoverageIgnore+ ** @param $value*/public function setNameAttribute($value)diff --git a/app/Models/BudgetLimit.php b/app/Models/BudgetLimit.phpindex 6d5ebad901..ddab3dfab0 100644--- a/app/Models/BudgetLimit.php+++ b/app/Models/BudgetLimit.php@@ -77,6 +77,7 @@ class BudgetLimit extends Model/*** @codeCoverageIgnore+ ** @param $value*/public function setAmountAttribute($value)diff --git a/app/Models/Category.php b/app/Models/Category.phpindex c5b3b741ae..38f6e3712d 100644--- a/app/Models/Category.php+++ b/app/Models/Category.php@@ -83,7 +83,7 @@ class Category extends Model}/**- * @param Category $value+ * @param string $value** @return Category*/@@ -101,6 +101,7 @@ class Category extends Model/*** @codeCoverageIgnore+ ** @param $value** @return string@@ -116,6 +117,7 @@ class Category extends Model/*** @codeCoverageIgnore+ ** @param $value*/public function setNameAttribute($value)diff --git a/app/Models/Configuration.php b/app/Models/Configuration.phpindex bf36775c52..6a2b97c9bf 100644--- a/app/Models/Configuration.php+++ b/app/Models/Configuration.php@@ -49,6 +49,7 @@ class Configuration extends Model/*** @codeCoverageIgnore+ ** @param $value** @return mixed@@ -60,6 +61,7 @@ class Configuration extends Model/*** @codeCoverageIgnore+ ** @param $value*/public function setDataAttribute($value)diff --git a/app/Models/ExportJob.php b/app/Models/ExportJob.phpindex 65bcd1820b..1c019919e6 100644--- a/app/Models/ExportJob.php+++ b/app/Models/ExportJob.php@@ -61,6 +61,7 @@ class ExportJob extends Model/*** @codeCoverageIgnore+ ** @param $status*/public function change($status)diff --git a/app/Models/PiggyBank.php b/app/Models/PiggyBank.phpindex c4bf040c6c..51904e9f9d 100644--- a/app/Models/PiggyBank.php+++ b/app/Models/PiggyBank.php@@ -69,9 +69,9 @@ class PiggyBank extends Model{if (auth()->check()) {$piggyBankId = intval($value);- $piggyBank = PiggyBank::where('piggy_banks.id', $piggyBankId)- ->leftJoin('accounts', 'accounts.id', '=', 'piggy_banks.account_id')- ->where('accounts.user_id', auth()->user()->id)->first(['piggy_banks.*']);+ $piggyBank = self::where('piggy_banks.id', $piggyBankId)+ ->leftJoin('accounts', 'accounts.id', '=', 'piggy_banks.account_id')+ ->where('accounts.user_id', auth()->user()->id)->first(['piggy_banks.*']);if (!is_null($piggyBank)) {return $piggyBank;}@@ -111,6 +111,7 @@ class PiggyBank extends Model/*** @codeCoverageIgnore+ ** @param $value** @return string@@ -196,6 +197,7 @@ class PiggyBank extends Model/*** @codeCoverageIgnore+ ** @param $value*/public function setNameAttribute($value)@@ -207,6 +209,7 @@ class PiggyBank extends Model/*** @codeCoverageIgnore+ ** @param $value*/public function setTargetamountAttribute($value)diff --git a/app/Models/PiggyBankEvent.php b/app/Models/PiggyBankEvent.phpindex 683f2b7b9e..4bd7753aa9 100644--- a/app/Models/PiggyBankEvent.php+++ b/app/Models/PiggyBankEvent.php@@ -62,6 +62,7 @@ class PiggyBankEvent extends Model/*** @codeCoverageIgnore+ ** @param $value*/public function setAmountAttribute($value)diff --git a/app/Models/PiggyBankRepetition.php b/app/Models/PiggyBankRepetition.phpindex 77e09eadbc..af65867865 100644--- a/app/Models/PiggyBankRepetition.php+++ b/app/Models/PiggyBankRepetition.php@@ -60,6 +60,7 @@ class PiggyBankRepetition extends Model/*** @codeCoverageIgnore+ ** @param EloquentBuilder $query* @param Carbon $start* @param Carbon $target@@ -73,6 +74,7 @@ class PiggyBankRepetition extends Model/*** @codeCoverageIgnore+ ** @param EloquentBuilder $query* @param Carbon $date*@@ -96,6 +98,7 @@ class PiggyBankRepetition extends Model/*** @codeCoverageIgnore+ ** @param $value*/public function setCurrentamountAttribute($value)diff --git a/app/Models/Preference.php b/app/Models/Preference.phpindex d85c3323ba..e59f68148d 100644--- a/app/Models/Preference.php+++ b/app/Models/Preference.php@@ -80,6 +80,7 @@ class Preference extends Model/*** @codeCoverageIgnore+ ** @param $value*/public function setDataAttribute($value)diff --git a/app/Models/Tag.php b/app/Models/Tag.phpindex f7d6351642..5f70bee39e 100644--- a/app/Models/Tag.php+++ b/app/Models/Tag.php@@ -123,6 +123,7 @@ class Tag extends Model/*** @codeCoverageIgnore+ ** @param $value** @return string@@ -138,6 +139,7 @@ class Tag extends Model/*** @codeCoverageIgnore+ ** @param $value** @return string@@ -171,6 +173,7 @@ class Tag extends Model/*** @codeCoverageIgnore+ ** @param $value*/public function setDescriptionAttribute($value)@@ -180,6 +183,7 @@ class Tag extends Model/*** @codeCoverageIgnore+ ** @param $value*/public function setTagAttribute($value)diff --git a/app/Models/Transaction.php b/app/Models/Transaction.phpindex 0378477c4b..35d388ad99 100644--- a/app/Models/Transaction.php+++ b/app/Models/Transaction.php@@ -108,6 +108,7 @@ class Transaction extends Model/*** @codeCoverageIgnore+ ** @param Builder $query* @param string $table*@@ -168,6 +169,7 @@ class Transaction extends Model/*** @codeCoverageIgnore+ ** @param $value** @return float|int@@ -179,6 +181,7 @@ class Transaction extends Model/*** @codeCoverageIgnore+ ** @param Builder $query* @param Carbon $date*/@@ -192,6 +195,7 @@ class Transaction extends Model/*** @codeCoverageIgnore+ ** @param Builder $query* @param Carbon $date*/@@ -205,6 +209,7 @@ class Transaction extends Model/*** @codeCoverageIgnore+ ** @param Builder $query* @param array $types*/@@ -222,6 +227,7 @@ class Transaction extends Model/*** @codeCoverageIgnore+ ** @param $value*/public function setAmountAttribute($value)diff --git a/app/Models/TransactionCurrency.php b/app/Models/TransactionCurrency.phpindex beacb01102..708fc36217 100644--- a/app/Models/TransactionCurrency.php+++ b/app/Models/TransactionCurrency.php@@ -59,7 +59,7 @@ class TransactionCurrency extends Model{if (auth()->check()) {$currencyId = intval($value);- $currency = TransactionCurrency::find($currencyId);+ $currency = self::find($currencyId);if (!is_null($currency)) {return $currency;}diff --git a/app/Models/TransactionJournal.php b/app/Models/TransactionJournal.phpindex 4ba5ae9283..74fc1fd07a 100644--- a/app/Models/TransactionJournal.php+++ b/app/Models/TransactionJournal.php@@ -141,6 +141,7 @@ class TransactionJournal extends Model/*** @codeCoverageIgnore+ ** @param string $name** @return bool@@ -163,6 +164,7 @@ class TransactionJournal extends Model/*** @codeCoverageIgnore+ ** @param $value** @return string@@ -214,6 +216,7 @@ class TransactionJournal extends Model/*** @codeCoverageIgnore+ ** @param string $name** @return bool@@ -311,6 +314,7 @@ class TransactionJournal extends Model/*** @codeCoverageIgnore+ ** @param EloquentBuilder $query* @param Carbon $date*@@ -323,6 +327,7 @@ class TransactionJournal extends Model/*** @codeCoverageIgnore+ ** @param EloquentBuilder $query* @param Carbon $date*@@ -335,6 +340,7 @@ class TransactionJournal extends Model/*** @codeCoverageIgnore+ ** @param EloquentBuilder $query*/public function scopeSortCorrectly(EloquentBuilder $query)@@ -346,6 +352,7 @@ class TransactionJournal extends Model/*** @codeCoverageIgnore+ ** @param EloquentBuilder $query* @param array $types*/@@ -361,6 +368,7 @@ class TransactionJournal extends Model/*** @codeCoverageIgnore+ ** @param $value*/public function setDescriptionAttribute($value)diff --git a/app/Models/TransactionJournalLink.php b/app/Models/TransactionJournalLink.phpindex f8f625d645..36ec286341 100644--- a/app/Models/TransactionJournalLink.php+++ b/app/Models/TransactionJournalLink.php@@ -72,6 +72,7 @@ class TransactionJournalLink extends Model/*** @codeCoverageIgnore+ ** @param $value** @return null|string@@ -96,6 +97,7 @@ class TransactionJournalLink extends Model/*** @codeCoverageIgnore+ ** @param $value*/public function setCommentAttribute($value): voiddiff --git a/app/Models/TransactionJournalMeta.php b/app/Models/TransactionJournalMeta.phpindex 827d3f7301..3e87d48d0b 100644--- a/app/Models/TransactionJournalMeta.php+++ b/app/Models/TransactionJournalMeta.php@@ -50,6 +50,7 @@ class TransactionJournalMeta extends Model/*** @codeCoverageIgnore+ ** @param $value** @return mixed@@ -61,6 +62,7 @@ class TransactionJournalMeta extends Model/*** @codeCoverageIgnore+ ** @param $value*/public function setDataAttribute($value)diff --git a/app/Repositories/Account/AccountRepository.php b/app/Repositories/Account/AccountRepository.phpindex 849ce97aac..3c404fdf88 100644--- a/app/Repositories/Account/AccountRepository.php+++ b/app/Repositories/Account/AccountRepository.php@@ -190,7 +190,7 @@ class AccountRepository implements AccountRepositoryInterface// update the account:$account->name = $data['name'];$account->active = $data['active'];- $account->virtual_balance = trim($data['virtualBalance']) === '' ? '0': $data['virtualBalance'];+ $account->virtual_balance = trim($data['virtualBalance']) === '' ? '0' : $data['virtualBalance'];$account->iban = $data['iban'];$account->save();diff --git a/app/Repositories/Journal/JournalRepositoryInterface.php b/app/Repositories/Journal/JournalRepositoryInterface.phpindex a136ed1784..782b38cca3 100644--- a/app/Repositories/Journal/JournalRepositoryInterface.php+++ b/app/Repositories/Journal/JournalRepositoryInterface.php@@ -26,7 +26,6 @@ use FireflyIII\Models\Account;use FireflyIII\Models\Note;use FireflyIII\Models\Transaction;use FireflyIII\Models\TransactionJournal;-use FireflyIII\Models\TransactionJournalLink;use FireflyIII\Models\TransactionType;use FireflyIII\User;use Illuminate\Support\Collection;@@ -54,13 +53,6 @@ interface JournalRepositoryInterface*/public function countTransactions(TransactionJournal $journal): int;- /**- * @param TransactionJournal $journal- *- * @return Note|null- */- public function getNote(TransactionJournal $journal): ?Note;-/*** Deletes a journal.*@@ -107,6 +99,13 @@ interface JournalRepositoryInterface*/public function getAssetTransaction(TransactionJournal $journal): ?Transaction;+ /**+ * @param TransactionJournal $journal+ *+ * @return Note|null+ */+ public function getNote(TransactionJournal $journal): ?Note;+/*** @return Collection*/diff --git a/app/Repositories/LinkType/LinkTypeRepositoryInterface.php b/app/Repositories/LinkType/LinkTypeRepositoryInterface.phpindex a94ed251b2..19ae1c8846 100644--- a/app/Repositories/LinkType/LinkTypeRepositoryInterface.php+++ b/app/Repositories/LinkType/LinkTypeRepositoryInterface.php@@ -95,7 +95,7 @@ interface LinkTypeRepositoryInterface/*** Store link between two journals.*- * @param array $information+ * @param array $information* @param TransactionJournal $left* @param TransactionJournal $right*diff --git a/app/Repositories/User/UserRepositoryInterface.php b/app/Repositories/User/UserRepositoryInterface.phpindex 1588696677..f3a76efcd4 100644--- a/app/Repositories/User/UserRepositoryInterface.php+++ b/app/Repositories/User/UserRepositoryInterface.php@@ -37,20 +37,6 @@ interface UserRepositoryInterface*/public function all(): Collection;- /**- * Returns the first user in the DB. Generally only works when there is just one.- *- * @return null|User- */- public function first(): ?User;-- /**- * @param array $data- *- * @return User- */- public function store(array $data): User;-/*** Gives a user a role.*@@ -119,6 +105,13 @@ interface UserRepositoryInterface*/public function findByEmail(string $email): ?User;+ /**+ * Returns the first user in the DB. Generally only works when there is just one.+ *+ * @return null|User+ */+ public function first(): ?User;+/*** Return basic user information.*@@ -136,6 +129,13 @@ interface UserRepositoryInterface*/public function hasRole(User $user, string $role): bool;+ /**+ * @param array $data+ *+ * @return User+ */+ public function store(array $data): User;+/*** @param User $user*/diff --git a/app/Services/Spectre/Request/SpectreRequest.php b/app/Services/Spectre/Request/SpectreRequest.phpindex 8d87297829..8db025b6ba 100644--- a/app/Services/Spectre/Request/SpectreRequest.php+++ b/app/Services/Spectre/Request/SpectreRequest.php@@ -40,8 +40,6 @@ abstract class SpectreRequest* @var int*/protected $expiresAt = 0;- /** @var ServerPublicKey */- protected $serverPublicKey;/** @var string */protected $serviceSecret = '';/** @var string */@@ -104,22 +102,6 @@ abstract class SpectreRequestreturn $this->server;}- /**- * @return ServerPublicKey- */- public function getServerPublicKey(): ServerPublicKey- {- return $this->serverPublicKey;- }-- /**- * @param ServerPublicKey $serverPublicKey- */- public function setServerPublicKey(ServerPublicKey $serverPublicKey)- {- $this->serverPublicKey = $serverPublicKey;- }-/*** @return string*/@@ -144,14 +126,6 @@ abstract class SpectreRequest$this->privateKey = $privateKey;}- /**- * @param string $secret- */- public function setSecret(string $secret)- {- $this->secret = $secret;- }-/*** @param string $method* @param string $uri@@ -169,8 +143,6 @@ abstract class SpectreRequestif ('get' === strtolower($method) || 'delete' === strtolower($method)) {$data = '';}- // base64(sha1_signature(private_key, "Expires-at|request_method|original_url|post_body|md5_of_uploaded_file|")))- // Prepare the signature$toSign = $this->expiresAt . '|' . strtoupper($method) . '|' . $uri . '|' . $data . ''; // no file so no content there.Log::debug(sprintf('String to sign: "%s"', $toSign));$signature = '';diff --git a/app/Support/Amount.php b/app/Support/Amount.phpindex 8d79402963..a9d066e557 100644--- a/app/Support/Amount.php+++ b/app/Support/Amount.php@@ -202,7 +202,7 @@ class Amount/*** @return \FireflyIII\Models\TransactionCurrency*- * @throws FireflyException+ * @throws \FireflyIII\Exceptions\FireflyException*/public function getDefaultCurrency(): TransactionCurrency{@@ -216,7 +216,7 @@ class Amount** @return \FireflyIII\Models\TransactionCurrency*- * @throws FireflyException+ * @throws \FireflyIII\Exceptions\FireflyException*/public function getDefaultCurrencyByUser(User $user): TransactionCurrency{diff --git a/app/Support/Binder/Date.php b/app/Support/Binder/Date.phpindex 7622b5d8b0..5b04cfbd54 100644--- a/app/Support/Binder/Date.php+++ b/app/Support/Binder/Date.php@@ -24,7 +24,6 @@ namespace FireflyIII\Support\Binder;use Carbon\Carbon;use Exception;-use FireflyIII\Helpers\FiscalHelper;use FireflyIII\Helpers\FiscalHelperInterface;use Illuminate\Routing\Route;use Log;diff --git a/app/Support/ExpandedForm.php b/app/Support/ExpandedForm.phpindex 02e3775377..04ce257ebb 100644--- a/app/Support/ExpandedForm.php+++ b/app/Support/ExpandedForm.php@@ -25,6 +25,7 @@ namespace FireflyIII\Support;use Amount as Amt;use Carbon\Carbon;use Eloquent;+use FireflyIII\Exceptions\FireflyException;use Illuminate\Support\Collection;use Illuminate\Support\MessageBag;use RuntimeException;@@ -36,11 +37,12 @@ use Session;class ExpandedForm{/**- * @param $name- * @param null $value- * @param array $options+ * @param string $name+ * @param null $value+ * @param array $options** @return string+ * @throws \FireflyIII\Exceptions\FireflyException*/public function amount(string $name, $value = null, array $options = []): string{@@ -53,6 +55,7 @@ class ExpandedForm* @param array $options** @return string+ * @throws \FireflyIII\Exceptions\FireflyException*/public function amountSmall(string $name, $value = null, array $options = []): string{@@ -65,6 +68,8 @@ class ExpandedForm* @param array $options** @return string+ * @throws \FireflyIII\Exceptions\FireflyException+ **/public function balance(string $name, $value = null, array $options = []): string{@@ -594,8 +599,7 @@ class ExpandedForm** @return string*- * @throws \Throwable- * @throws Facades\FireflyException+ * @throws \FireflyIII\Exceptions\FireflyException*/private function currencyField(string $name, string $view, $value = null, array $options = []): string{diff --git a/app/Support/Import/Information/BunqInformation.php b/app/Support/Import/Information/BunqInformation.phpindex 851cafb2af..ab12faf500 100644--- a/app/Support/Import/Information/BunqInformation.php+++ b/app/Support/Import/Information/BunqInformation.php@@ -63,6 +63,7 @@ class BunqInformation implements InformationInterface* @return array** @throws FireflyException+ * @throws \Exception*/public function getAccounts(): array{diff --git a/app/Support/Navigation.php b/app/Support/Navigation.phpindex ebc33e78bc..59de0f956d 100644--- a/app/Support/Navigation.php+++ b/app/Support/Navigation.php@@ -473,6 +473,7 @@ class Navigation$date->subMonths($subtract);Log::debug(sprintf('%s is in modifier map with value %d, execute subMonths with argument %d', $repeatFreq, $modifierMap[$repeatFreq], $subtract));Log::debug(sprintf('subtractPeriod: resulting date is %s', $date->format('Y-m-d')));+return $date;}// a custom range requires the session startdiff --git a/app/TransactionRules/Triggers/AbstractTrigger.php b/app/TransactionRules/Triggers/AbstractTrigger.phpindex 201bcbad57..0177db9860 100644--- a/app/TransactionRules/Triggers/AbstractTrigger.php+++ b/app/TransactionRules/Triggers/AbstractTrigger.php@@ -29,6 +29,7 @@ use FireflyIII\Models\TransactionJournal;* This class will be magical!** Class AbstractTrigger+ * @method triggered*/class AbstractTrigger{@@ -43,15 +44,6 @@ class AbstractTrigger/** @var string Trigger value */protected $triggerValue;- /**- * AbstractTrigger constructor.- *- * @codeCoverageIgnore- */- private function __construct()- {- }-/*** Make a new trigger from the value given in the string.*diff --git a/app/Validation/FireflyValidator.php b/app/Validation/FireflyValidator.phpindex a7f73f4b9e..b50b3b4659 100644--- a/app/Validation/FireflyValidator.php+++ b/app/Validation/FireflyValidator.php@@ -340,7 +340,7 @@ class FireflyValidator extends Validator** @return bool*/- public function validateUniqueAccountNumberForUser($attribute, $value, $parameters): bool+ public function validateUniqueAccountNumberForUser($attribute, $value): bool{$accountId = $this->data['id'] ?? 0;diff --git a/public/js/ff/accounts/reconcile.js b/public/js/ff/accounts/reconcile.jsindex 98ddc523e0..4f1b46666d 100644--- a/public/js/ff/accounts/reconcile.js+++ b/public/js/ff/accounts/reconcile.js@@ -92,7 +92,6 @@ function storeReconcile() {transactions: ids,cleared: cleared,};- console.logvar uri = overviewUri.replace('%start%', $('input[name="start_date"]').val()).replace('%end%', $('input[name="end_date"]').val());diff --git a/public/js/ff/accounts/show.js b/public/js/ff/accounts/show.jsindex 3b1ca6ce87..ba77ebff95 100644--- a/public/js/ff/accounts/show.js+++ b/public/js/ff/accounts/show.js@@ -18,7 +18,7 @@* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-/** global: chartUri, incomeCategoryUri, expenseCategoryUri, expenseBudgetUri */+/** global: chartUri, incomeCategoryUri, expenseCategoryUri, expenseBudgetUri, token */var fixHelper = function (e, tr) {"use strict";diff --git a/public/js/ff/admin/update/index.js b/public/js/ff/admin/update/index.jsindex 39a427e77e..d02d0ad23f 100644--- a/public/js/ff/admin/update/index.js+++ b/public/js/ff/admin/update/index.js@@ -18,6 +18,8 @@* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/+/** global: updateCheckUri */+$(function () {"use strict";@@ -31,7 +33,7 @@ function checkUpdate() {// do post update check:$.post(updateCheckUri).done(function (data) {alert(data.result);- }).fail(function() {+ }).fail(function () {alert('Error while checking.');});diff --git a/public/js/ff/budgets/index.js b/public/js/ff/budgets/index.jsindex db07e9088d..6a36dae5a0 100644--- a/public/js/ff/budgets/index.js+++ b/public/js/ff/budgets/index.js@@ -18,7 +18,7 @@* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-/** global: infoIncomeUri, spent, budgeted, available, currencySymbol, budgetIndexUri, updateIncomeUri, periodStart, periodEnd, budgetAmountUri, accounting */+/** global: infoIncomeUri, token, spent, budgeted, available, currencySymbol, budgetIndexUri, updateIncomeUri, periodStart, periodEnd, budgetAmountUri, accounting *//****/@@ -104,7 +104,7 @@ function updateBudgetedAmounts(e) {var target = $(e.target);var id = target.data('id');var leftCell = $('td[class$="left"][data-id="' + id + '"]');- var link = $('a[data-id="'+id+'"][class="budget-link"]');+ var link = $('a[data-id="' + id + '"][class="budget-link"]');var value = target.val();var original = target.data('original');@@ -112,7 +112,7 @@ function updateBudgetedAmounts(e) {target.prop('disabled', true);// replace link (for now)- link.attr('href','#');+ link.attr('href', '#');// replace "left" with spinner.leftCell.empty().html('<i class="fa fa-fw fa-spin fa-spinner"></i>');diff --git a/public/js/ff/charts.defaults.js b/public/js/ff/charts.defaults.jsindex 21c5852877..e2764d5567 100644--- a/public/js/ff/charts.defaults.js+++ b/public/js/ff/charts.defaults.js@@ -29,40 +29,37 @@* @param maxwidth* @returns {Array}*/-function formatLabel(str, maxwidth){+function formatLabel(str, maxwidth) {var sections = [];var words = str.split(" ");var temp = "";- words.forEach(function(item, index){- if(temp.length > 0)- {+ words.forEach(function (item, index) {+ if (temp.length > 0) {var concat = temp + ' ' + item;- if(concat.length > maxwidth){+ if (concat.length > maxwidth) {sections.push(temp);temp = "";}- else{- if(index === (words.length-1))- {+ else {+ if (index === (words.length - 1)) {sections.push(concat);return;}- else{+ else {temp = concat;return;}}}- if(index === (words.length-1))- {+ if (index === (words.length - 1)) {sections.push(item);return;}- if(item.length < maxwidth) {+ if (item.length < maxwidth) {temp = item;}else {diff --git a/public/js/ff/help.js b/public/js/ff/help.jsindex 9894563e66..9e7280b1c0 100644--- a/public/js/ff/help.js+++ b/public/js/ff/help.js@@ -17,7 +17,7 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-+/** global: token */$(function () {"use strict";$('#help').click(showHelp);diff --git a/public/js/ff/import/status.js b/public/js/ff/import/status.jsindex 9fa0198516..c05560cafd 100644--- a/public/js/ff/import/status.js+++ b/public/js/ff/import/status.js@@ -18,7 +18,7 @@* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-/** global: langImportSingleError, langImportMultiError, jobStartUrl, langImportTimeOutError, langImportFinished, langImportFatalError */+/** global: job, langImportSingleError, langImportMultiError, jobStartUrl, langImportTimeOutError, langImportFinished, langImportFatalError */var timeOutId;var startInterval = 1000;diff --git a/public/js/ff/piggy-banks/index.js b/public/js/ff/piggy-banks/index.jsindex 72f128a2a0..292d7f7f7d 100644--- a/public/js/ff/piggy-banks/index.js+++ b/public/js/ff/piggy-banks/index.js@@ -17,7 +17,7 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-+/** global: token */var fixHelper = function (e, tr) {"use strict";var $originals = tr.children();diff --git a/public/js/ff/reports/account/month.js b/public/js/ff/reports/account/month.jsindex a8d2129875..6aba68d1b0 100644--- a/public/js/ff/reports/account/month.js+++ b/public/js/ff/reports/account/month.js@@ -1,4 +1,3 @@-/** month.js* Copyright (c) 2017 [email protected]@@ -18,10 +17,10 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-+/** global: spentUri, categoryUri, budgetUri, expenseUri, incomeUri, mainUri */$(function () {"use strict";- drawChart();+ doubleYChart(mainUri, 'in-out-chart');loadAjaxPartial('inOutAccounts', spentUri);loadAjaxPartial('inOutCategory', categoryUri);@@ -31,9 +30,3 @@ $(function () {});-function drawChart() {- "use strict";-- // month view:- doubleYChart(mainUri, 'in-out-chart');-}\ No newline at end of filediff --git a/public/js/ff/reports/all.js b/public/js/ff/reports/all.jsindex 3c34cb9a35..912539796c 100644--- a/public/js/ff/reports/all.js+++ b/public/js/ff/reports/all.js@@ -17,7 +17,7 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-+/** global: startDate, endDate, accountIds */function loadAjaxPartial(holder, uri) {"use strict";$.get(uri).done(function (data) {diff --git a/public/js/ff/reports/index.js b/public/js/ff/reports/index.jsindex dfea1c9fc0..9e9562e947 100644--- a/public/js/ff/reports/index.js+++ b/public/js/ff/reports/index.js@@ -139,7 +139,6 @@ function setOptionalFromCookies() {$('#inputExpRevAccounts').multiselect(defaultMultiSelect);-}function catchSubmit() {@@ -161,7 +160,7 @@ function catchSubmit() {createCookie('report-categories', categories, 365);createCookie('report-budgets', budgets, 365);createCookie('report-tags', tags, 365);- createCookie('report-exp-rev', expRev , 365);+ createCookie('report-exp-rev', expRev, 365);createCookie('report-start', moment(picker.startDate).format("YYYYMMDD"), 365);createCookie('report-end', moment(picker.endDate).format("YYYYMMDD"), 365);diff --git a/public/js/ff/rules/index.js b/public/js/ff/rules/index.jsindex 5c58468fa1..27ef2fb053 100644--- a/public/js/ff/rules/index.js+++ b/public/js/ff/rules/index.js@@ -17,7 +17,7 @@* You should have received a copy of the GNU General Public License* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-+/** global: token */var fixHelper = function (e, tr) {"use strict";var $originals = tr.children();diff --git a/public/js/ff/search/index.js b/public/js/ff/search/index.jsindex 8b8cea4304..70615ae476 100644--- a/public/js/ff/search/index.js+++ b/public/js/ff/search/index.js@@ -18,7 +18,7 @@* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-/** global: searchQuery,searchUri */+/** global: searchQuery,searchUri,token */diff --git a/public/js/ff/tags/show.js b/public/js/ff/tags/show.jsindex e2b5f75922..b199393bbe 100644--- a/public/js/ff/tags/show.js+++ b/public/js/ff/tags/show.js@@ -48,7 +48,7 @@ $(function () {}).addTo(mymap);if (doPlaceMarker) {- var marker = L.marker([latitude, longitude]).addTo(mymap);+ L.marker([latitude, longitude]).addTo(mymap);}}});diff --git a/public/js/ff/transactions/list.js b/public/js/ff/transactions/list.jsindex 1a9b5d1230..70694d0598 100644--- a/public/js/ff/transactions/list.js+++ b/public/js/ff/transactions/list.js@@ -18,7 +18,7 @@* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.*/-/** global: edit_selected_txt, delete_selected_txt */+/** global: edit_selected_txt, delete_selected_txt, token *//***diff --git a/resources/stubs/demo-configuration.json b/resources/stubs/demo-configuration.jsonindex c69c8bfe71..ed3e7a60b1 100644--- a/resources/stubs/demo-configuration.json+++ b/resources/stubs/demo-configuration.json@@ -1,37 +1,37 @@{- "has-headers": true,- "date-format": "Y-m-d",- "delimiter": ",",- "import-account": 1,- "specifics": [],- "column-count": 7,- "column-roles": [- "account-iban",- "opposing-name",- "amount",- "date-transaction",- "description",- "category-name",- "budget-name"- ],- "column-do-mapping": [- true,- true,- false,- false,- false,- false,- false- ],- "column-roles-complete": false,- "column-mapping-config": {- "0": {- "NL11XOLA6707795988": 1,- "NL81RCQZ7160379858": 3- },- "1": [],- "5": [],- "6": []+ "has-headers": true,+ "date-format": "Y-m-d",+ "delimiter": ",",+ "import-account": 1,+ "specifics": [],+ "column-count": 7,+ "column-roles": [+ "account-iban",+ "opposing-name",+ "amount",+ "date-transaction",+ "description",+ "category-name",+ "budget-name"+ ],+ "column-do-mapping": [+ true,+ true,+ false,+ false,+ false,+ false,+ false+ ],+ "column-roles-complete": false,+ "column-mapping-config": {+ "0": {+ "NL11XOLA6707795988": 1,+ "NL81RCQZ7160379858": 3},- "column-mapping-complete": false+ "1": [],+ "5": [],+ "6": []+ },+ "column-mapping-complete": false}\ No newline at end of filediff --git a/resources/views/accounts/reconcile/overview.twig b/resources/views/accounts/reconcile/overview.twigindex abc2fe9af3..78502d20af 100644--- a/resources/views/accounts/reconcile/overview.twig+++ b/resources/views/accounts/reconcile/overview.twig@@ -15,7 +15,7 @@<input type="hidden" name="startBalance" value="{{ startBalance }}"/><input type="hidden" name="endBalance" value="{{ endBalance }}"/>{% for id in transactionIds %}- <input type="hidden" name="transactions[]" value="{{ id }}" />+ <input type="hidden" name="transactions[]" value="{{ id }}"/>{% endfor %}<table class="table table-striped table-bordered">@@ -33,14 +33,14 @@</tr><tr><td>{{ 'submitted_end_balance'|_ }} (date)</td>- <td>{{ formatAmountByAccount(account, endBalance)}}</td>+ <td>{{ formatAmountByAccount(account, endBalance) }}</td></tr><tr><td>{{ 'difference'|_ }}</td><td>{{ formatAmountByAccount(account, difference) }}- <input type="hidden" name="difference" value="{{ difference }}" />+ <input type="hidden" name="difference" value="{{ difference }}"/></td></tr>@@ -60,36 +60,36 @@<input type="hidden" name="reconcile" value="nothing">{% endif %}{% if diffCompare != 0 %}- <div class="form-group">- <div class="col-lg-12">- <div class="radio">- <label>+ <div class="form-group">+ <div class="col-lg-12">+ <div class="radio">+ <label>- <input type="radio" name="reconcile" value="create">- {% if diffCompare > 0 %}- {{ trans('firefly.create_neg_reconcile_transaction', {amount: formatAmountByAccount(account, (difference*-1))})|raw }}- {% endif %}- {% if diffCompare < 0 %}- {{ trans('firefly.create_pos_reconcile_transaction', {amount: formatAmountByAccount(account, (difference*-1))})|raw }}- {% endif %}- </label>+ <input type="radio" name="reconcile" value="create">+ {% if diffCompare > 0 %}+ {{ trans('firefly.create_neg_reconcile_transaction', {amount: formatAmountByAccount(account, (difference*-1))})|raw }}+ {% endif %}+ {% if diffCompare < 0 %}+ {{ trans('firefly.create_pos_reconcile_transaction', {amount: formatAmountByAccount(account, (difference*-1))})|raw }}+ {% endif %}+ </label>+ </div></div></div>- </div>- <div class="form-group">- <div class="col-lg-12">- <div class="radio">- <label>- <input type="radio" checked name="reconcile" value="nothing"> {{ 'reconcile_do_nothing'|_ }}- </label>+ <div class="form-group">+ <div class="col-lg-12">+ <div class="radio">+ <label>+ <input type="radio" checked name="reconcile" value="nothing"> {{ 'reconcile_do_nothing'|_ }}+ </label>+ </div></div></div>- </div>- <p>- {{ 'reconcile_go_back'|_ }}- </p>+ <p>+ {{ 'reconcile_go_back'|_ }}+ </p>{% endif %}</div><div class="modal-footer">diff --git a/resources/views/admin/link/edit.twig b/resources/views/admin/link/edit.twigindex c72e131b1c..80b7833500 100644--- a/resources/views/admin/link/edit.twig+++ b/resources/views/admin/link/edit.twig@@ -7,41 +7,41 @@{% block content %}{{ Form.model(linkType, {'class' : 'form-horizontal','id' : 'update','url' : route('admin.links.update', linkType.id) } ) }}- <input type="hidden" name="id" value="{{ linkType.id }}"/>- <input name="_token" type="hidden" value="{{ csrf_token() }}">- <div class="row">- <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">- <div class="box box-primary">- <div class="box-header with-border">- <h3 class="box-title">{{ 'mandatoryFields'|_ }}</h3>- </div>- <div class="box-body">- {{ ExpandedForm.text('name', null, {helpText: trans('firefly.link_type_help_name')}) }}- {{ ExpandedForm.text('inward', null, {helpText: trans('firefly.link_type_help_inward')}) }}- {{ ExpandedForm.text('outward', null, {helpText: trans('firefly.link_type_help_outward')}) }}- </div>+ <input type="hidden" name="id" value="{{ linkType.id }}"/>+ <input name="_token" type="hidden" value="{{ csrf_token() }}">+ <div class="row">+ <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">+ <div class="box box-primary">+ <div class="box-header with-border">+ <h3 class="box-title">{{ 'mandatoryFields'|_ }}</h3></div>- </div>- <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">-- <!-- panel for options -->- <div class="box">- <div class="box-header with-border">- <h3 class="box-title">{{ 'options'|_ }}</h3>- </div>- <div class="box-body">- {{ ExpandedForm.optionsList('update','link_type') }}- </div>- <div class="box-footer">- <button type="submit" class="btn pull-right btn-success">- {{ ('update_link_type')|_ }}- </button>- </div>+ <div class="box-body">+ {{ ExpandedForm.text('name', null, {helpText: trans('firefly.link_type_help_name')}) }}+ {{ ExpandedForm.text('inward', null, {helpText: trans('firefly.link_type_help_inward')}) }}+ {{ ExpandedForm.text('outward', null, {helpText: trans('firefly.link_type_help_outward')}) }}</div>+ </div>+ </div>+ <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">+ <!-- panel for options -->+ <div class="box">+ <div class="box-header with-border">+ <h3 class="box-title">{{ 'options'|_ }}</h3>+ </div>+ <div class="box-body">+ {{ ExpandedForm.optionsList('update','link_type') }}+ </div>+ <div class="box-footer">+ <button type="submit" class="btn pull-right btn-success">+ {{ ('update_link_type')|_ }}+ </button>+ </div></div></div>++ </div></form>diff --git a/resources/views/admin/link/index.twig b/resources/views/admin/link/index.twigindex 059c67b2d8..f49df83759 100644--- a/resources/views/admin/link/index.twig+++ b/resources/views/admin/link/index.twig@@ -27,8 +27,10 @@<td>{% if linkType.editable %}<div class="btn-group btn-group-xs">- <a class="btn btn-default btn-xs" href="{{ route('admin.links.edit',linkType.id) }}"><i class="fa fa-fw fa-pencil"></i></a>- <a class="btn btn-danger btn-xs" href="{{ route('admin.links.delete',linkType.id) }}"><i class="fa fa-fw fa-trash-o"></i></a>+ <a class="btn btn-default btn-xs" href="{{ route('admin.links.edit',linkType.id) }}"><i+ class="fa fa-fw fa-pencil"></i></a>+ <a class="btn btn-danger btn-xs" href="{{ route('admin.links.delete',linkType.id) }}"><i+ class="fa fa-fw fa-trash-o"></i></a></div>{% endif %}</td>diff --git a/resources/views/admin/link/show.twig b/resources/views/admin/link/show.twigindex 3a1dab5af5..3d452df573 100644--- a/resources/views/admin/link/show.twig+++ b/resources/views/admin/link/show.twig@@ -28,7 +28,8 @@<td><div class="btn-group btn-group-xs"><a href="{{ route('transactions.link.delete', [link.id]) }}" class="btn btn-danger"><i class="fa fa-trash"></i></a>- <a href="{{ route('transactions.link.switch', [link.id]) }}" class="btn btn-default"><i class="fa fa-fw fa-arrows-h"></i></a>+ <a href="{{ route('transactions.link.switch', [link.id]) }}" class="btn btn-default"><i+ class="fa fa-fw fa-arrows-h"></i></a></div></td><td data-value="{{ link.source.description }}">diff --git a/resources/views/admin/users/delete.twig b/resources/views/admin/users/delete.twigindex 80c194816d..64ad1ec1ae 100644--- a/resources/views/admin/users/delete.twig+++ b/resources/views/admin/users/delete.twig@@ -25,7 +25,8 @@</p></div><div class="box-footer">- <input type="submit" onclick="return confirm('{{ trans('firefly.are_you_sure')|escape('js') }}');" name="submit" value="{{ trans('form.deletePermanently') }}" class="btn btn-danger pull-right"/>+ <input type="submit" onclick="return confirm('{{ trans('firefly.are_you_sure')|escape('js') }}');" name="submit"+ value="{{ trans('form.deletePermanently') }}" class="btn btn-danger pull-right"/><a href="{{ URL.previous() }}" class="btn-default btn">{{ trans('form.cancel') }}</a></div>diff --git a/resources/views/bills/index.twig b/resources/views/bills/index.twigindex b262cd604a..5635099605 100644--- a/resources/views/bills/index.twig+++ b/resources/views/bills/index.twig@@ -8,29 +8,29 @@{% if bills.count == 0 %}{% include 'partials.empty' with {what: 'default', type: 'bills',route: route('bills.create')} %}{% else %}- <div class="row">- <div class="col-lg-12 col-sm-12 col-md-12">- <div class="box">- <div class="box-header with-border">- <h3 class="box-title">{{ title }}</h3>+<div class="row">+ <div class="col-lg-12 col-sm-12 col-md-12">+ <div class="box">+ <div class="box-header with-border">+ <h3 class="box-title">{{ title }}</h3>- <div class="box-tools pull-right">- <div class="btn-group">- <button class="btn btn-box-tool dropdown-toggle" data-toggle="dropdown"><i class="fa fa-ellipsis-v"></i></button>- <ul class="dropdown-menu" role="menu">- <li><a href="{{ route('bills.create') }}"><i class="fa fa-plus fa-fw"></i> {{ 'new_bill'|_ }}</a></li>- </ul>- </div>- </div>- </div>- <div class="box-body table-responsive no-padding">- {% include 'list/bills' %}+ <div class="box-tools pull-right">+ <div class="btn-group">+ <button class="btn btn-box-tool dropdown-toggle" data-toggle="dropdown"><i class="fa fa-ellipsis-v"></i></button>+ <ul class="dropdown-menu" role="menu">+ <li><a href="{{ route('bills.create') }}"><i class="fa fa-plus fa-fw"></i> {{ 'new_bill'|_ }}</a></li>+ </ul></div></div></div>+ <div class="box-body table-responsive no-padding">+ {% include 'list/bills' %}+ </div></div>- {% endif %}+ </div>+</div>+{% endif %}{% endblock %}{% block styles %}diff --git a/resources/views/bills/show.twig b/resources/views/bills/show.twigindex 4a2542f91b..afde0b88fe 100644--- a/resources/views/bills/show.twig+++ b/resources/views/bills/show.twig@@ -86,12 +86,12 @@</div><div class="box-body no-padding">{% if bill.notes.count == 1 %}- <table class="table">+ <table class="table"><tr><td>{{ trans('list.notes') }}</td><td>{{ bill.notes.first.text|markdown }}</td></tr>- </table>+ </table>{% endif %}</div>diff --git a/resources/views/budgets/income.twig b/resources/views/budgets/income.twigindex 50c80832f3..201e2f2a3c 100644--- a/resources/views/budgets/income.twig+++ b/resources/views/budgets/income.twig@@ -5,7 +5,7 @@</button><h4 class="modal-title">{{ trans('firefly.update_budget_amount_range',- {start: start.formatLocalized(monthAndDayFormat), end: end.formatLocalized(monthAndDayFormat)}) }}+ {start: start.formatLocalized(monthAndDayFormat), end: end.formatLocalized(monthAndDayFormat)}) }}</h4></div>diff --git a/resources/views/budgets/index.twig b/resources/views/budgets/index.twigindex f0b12e1493..b340a9ef02 100644--- a/resources/views/budgets/index.twig+++ b/resources/views/budgets/index.twig@@ -17,10 +17,10 @@<small>{{ 'budgeted'|_ }}: <span id="budgetedAmount" class="text-success">{{ budgeted|formatAmountPlain }}</span></small></div><div class="col-lg-9 col-md-9 col-sm-9 col-xs-9" style="text-align:right;margin-bottom:3px;">- <small id="availableBar">{{ trans('firefly.available_between',{start : periodStart, end: periodEnd }) }}:- <span id="available" data-value="{{ available }}">{{ available|formatAmountPlain }}</span>- <a href="#" class="updateIncome btn btn-default btn-xs"><i class="fa fa-pencil"></i></a>- <a href="#" class="infoIncome btn btn-info btn-xs"><i class="fa fa-info-circle"></i></a>+ <small id="availableBar">{{ trans('firefly.available_between',{start : periodStart, end: periodEnd }) }}:+ <span id="available" data-value="{{ available }}">{{ available|formatAmountPlain }}</span>+ <a href="#" class="updateIncome btn btn-default btn-xs"><i class="fa fa-pencil"></i></a>+ <a href="#" class="infoIncome btn btn-info btn-xs"><i class="fa fa-info-circle"></i></a></small></div></div>diff --git a/resources/views/budgets/info.twig b/resources/views/budgets/info.twigindex 25a8104b47..6bc6ff6582 100644--- a/resources/views/budgets/info.twig+++ b/resources/views/budgets/info.twig@@ -5,50 +5,50 @@</button><h4 class="modal-title">{{ trans('firefly.info_on_available_amount',- {start: start.formatLocalized(monthAndDayFormat), end: end.formatLocalized(monthAndDayFormat)}) }}+ {start: start.formatLocalized(monthAndDayFormat), end: end.formatLocalized(monthAndDayFormat)}) }}</h4></div>- <div class="modal-body">- <p>- {{ 'available_amount_indication'|_ }}- </p>- <table class="table table-bordered table-striped">- <tr>- <td>- {{ 'budgeted'|_ }}- <small><br />- {{ trans('firefly.average_between', {start:begin.formatLocalized(monthAndDayFormat), end:currentEnd.formatLocalized(monthAndDayFormat)}) }}- </td>- <td>- <span class="pull-right">{{ result.available|formatAmount }}</span>- </td>- </tr>- <tr>- <td>{{ 'earned'|_ }}- <small><br />- {{ trans('firefly.average_between', {start:begin.formatLocalized(monthAndDayFormat), end:currentEnd.formatLocalized(monthAndDayFormat)}) }}- </small>- </td>- <td><span class="pull-right">{{ result.earned|formatAmount }}</span></td>- </tr>- <tr>- <td>{{ 'spent'|_ }}- <small><br />- {{ trans('firefly.average_between', {start:begin.formatLocalized(monthAndDayFormat), end:currentEnd.formatLocalized(monthAndDayFormat)}) }}- </small>- </td>- <td><span class="pull-right">{{ result.spent|formatAmount }}</span></td>- </tr>- <tr>- <td><strong>{{ 'suggested'|_ }}</strong></td>- <td><span class="pull-right">{{ result.suggested|formatAmount }}</span></td>- </tr>- </table>- </div>- <div class="modal-footer">- <button type="button" class="btn btn-default" data-dismiss="modal">{{ 'close'|_ }}</button>- </div>+ <div class="modal-body">+ <p>+ {{ 'available_amount_indication'|_ }}+ </p>+ <table class="table table-bordered table-striped">+ <tr>+ <td>+ {{ 'budgeted'|_ }}+ <small><br/>+ {{ trans('firefly.average_between', {start:begin.formatLocalized(monthAndDayFormat), end:currentEnd.formatLocalized(monthAndDayFormat)}) }}+ </td>+ <td>+ <span class="pull-right">{{ result.available|formatAmount }}</span>+ </td>+ </tr>+ <tr>+ <td>{{ 'earned'|_ }}+ <small><br/>+ {{ trans('firefly.average_between', {start:begin.formatLocalized(monthAndDayFormat), end:currentEnd.formatLocalized(monthAndDayFormat)}) }}+ </small>+ </td>+ <td><span class="pull-right">{{ result.earned|formatAmount }}</span></td>+ </tr>+ <tr>+ <td>{{ 'spent'|_ }}+ <small><br/>+ {{ trans('firefly.average_between', {start:begin.formatLocalized(monthAndDayFormat), end:currentEnd.formatLocalized(monthAndDayFormat)}) }}+ </small>+ </td>+ <td><span class="pull-right">{{ result.spent|formatAmount }}</span></td>+ </tr>+ <tr>+ <td><strong>{{ 'suggested'|_ }}</strong></td>+ <td><span class="pull-right">{{ result.suggested|formatAmount }}</span></td>+ </tr>+ </table>+ </div>+ <div class="modal-footer">+ <button type="button" class="btn btn-default" data-dismiss="modal">{{ 'close'|_ }}</button>+ </div></div></div>diff --git a/resources/views/budgets/show.twig b/resources/views/budgets/show.twigindex f2a1c9e945..4a697a3c6e 100644--- a/resources/views/budgets/show.twig+++ b/resources/views/budgets/show.twig@@ -122,27 +122,29 @@<td>{{ limit.spent|formatAmount }}</td></tr>{% if limit.spent > 0 %}- <tr>- <td colspan="2">- {% set overspent = limit.amount + limit.spent < 0 %}+ <tr>+ <td colspan="2">+ {% set overspent = limit.amount + limit.spent < 0 %}- {% if overspent %}- {% set pct = (limit.spent != 0 ? (limit.amount / (limit.spent*-1))*100 : 0) %} <!-- must have -1 here -->- <div class="progress progress-striped">- <div class="progress-bar progress-bar-warning" role="progressbar" aria-valuenow="{{ pct|round }}" aria-valuemin="0"- aria-valuemax="100" style="width: {{ pct|round }}%;"></div>- <div class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="{{ (100-pct)|round }}"- aria-valuemin="0" aria-valuemax="100" style="width: {{ (100-pct)|round }}%;"></div>- </div>- {% else %}- {% set pct = (limit.amount != 0 ? (((limit.spent*-1) / limit.amount)*100) : 0) %} <!-- must have -1 here -->- <div class="progress progress-striped">- <div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="{{ pct|round }}" aria-valuemin="0"- aria-valuemax="100" style="width: {{ pct|round }}%;"></div>- </div>- {% endif %}- </td>- </tr>+ {% if overspent %}+ {% set pct = (limit.spent != 0 ? (limit.amount / (limit.spent*-1))*100 : 0) %} <!-- must have -1 here -->+ <div class="progress progress-striped">+ <div class="progress-bar progress-bar-warning" role="progressbar" aria-valuenow="{{ pct|round }}"+ aria-valuemin="0"+ aria-valuemax="100" style="width: {{ pct|round }}%;"></div>+ <div class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="{{ (100-pct)|round }}"+ aria-valuemin="0" aria-valuemax="100" style="width: {{ (100-pct)|round }}%;"></div>+ </div>+ {% else %}+ {% set pct = (limit.amount != 0 ? (((limit.spent*-1) / limit.amount)*100) : 0) %} <!-- must have -1 here -->+ <div class="progress progress-striped">+ <div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="{{ pct|round }}"+ aria-valuemin="0"+ aria-valuemax="100" style="width: {{ pct|round }}%;"></div>+ </div>+ {% endif %}+ </td>+ </tr>{% endif %}</table></div>diff --git a/resources/views/categories/index.twig b/resources/views/categories/index.twigindex 8f73c9b307..743d72eede 100644--- a/resources/views/categories/index.twig+++ b/resources/views/categories/index.twig@@ -6,30 +6,30 @@{% block content %}{% if categories.count > 0 %}- <div class="row">- <div class="col-lg-12 col-md-12 col-sm-12">- <div class="box">- <div class="box-header with-border">- <h3 class="box-title">{{ 'categories'|_ }}</h3>+<div class="row">+ <div class="col-lg-12 col-md-12 col-sm-12">+ <div class="box">+ <div class="box-header with-border">+ <h3 class="box-title">{{ 'categories'|_ }}</h3>- <div class="box-tools pull-right">- <div class="btn-group">- <button class="btn btn-box-tool dropdown-toggle" data-toggle="dropdown"><i class="fa fa-ellipsis-v"></i></button>- <ul class="dropdown-menu" role="menu">- <li><a href="{{ route('categories.create') }}"><i class="fa fa-plus fa-fw"></i> {{ 'new_category'|_ }}</a></li>- </ul>- </div>- </div>-- </div>- <div class="box-body no-padding">- {% include 'list/categories' %}+ <div class="box-tools pull-right">+ <div class="btn-group">+ <button class="btn btn-box-tool dropdown-toggle" data-toggle="dropdown"><i class="fa fa-ellipsis-v"></i></button>+ <ul class="dropdown-menu" role="menu">+ <li><a href="{{ route('categories.create') }}"><i class="fa fa-plus fa-fw"></i> {{ 'new_category'|_ }}</a></li>+ </ul></div></div>++ </div>+ <div class="box-body no-padding">+ {% include 'list/categories' %}</div></div>- {% else %}+ </div>+</div>+{% else %}{% include 'partials.empty' with {what: 'default', type: 'categories',route: route('categories.create')} %}{% endif %}{% endblock %}diff --git a/resources/views/form/location.twig b/resources/views/form/location.twigindex c8201e641f..939bef8ff3 100644--- a/resources/views/form/location.twig+++ b/resources/views/form/location.twig@@ -2,118 +2,120 @@<label for="{{ options.id }}" class="col-sm-4 control-label">{{ label }}</label><div class="col-sm-8">{% if env('MAPBOX_API_KEY','') == '' %}- <p class="text-danger">- {{ trans('firefly.mapbox_api_key')|raw }}- </p>+ <p class="text-danger">+ {{ trans('firefly.mapbox_api_key')|raw }}+ </p>{% else %}<div id="{{ name }}_map" style="width:100%;height:300px;"></div>- <div id="map-canvas" ></div>+ <div id="map-canvas"></div><p class="help-block">{{ 'press_tag_location'|_ }}<a href="#" id="{{ name }}_clear_location">{{ 'clear_location'|_ }}</a></p>- {# latitude #}- {% if old(name~'_latitude') %}- <input type="hidden" name="{{ name }}_latitude" value="{{ old('tag_position_latitude') }}"/>- {% else %}- <input type="hidden" name="{{ name }}_latitude" value="{{ tag.latitude }}"/>- {% endif %}+ {# latitude #}+ {% if old(name~'_latitude') %}+ <input type="hidden" name="{{ name }}_latitude" value="{{ old('tag_position_latitude') }}"/>+ {% else %}+ <input type="hidden" name="{{ name }}_latitude" value="{{ tag.latitude }}"/>+ {% endif %}- {# longitude #}- {% if old('tag_position_longitude') %}- <input type="hidden" name="{{ name }}_longitude" value="{{ old('tag_position_longitude') }}"/>- {% else %}- <input type="hidden" name="{{ name }}_longitude" value="{{ tag.longitude }}"/>- {% endif %}+ {# longitude #}+ {% if old('tag_position_longitude') %}+ <input type="hidden" name="{{ name }}_longitude" value="{{ old('tag_position_longitude') }}"/>+ {% else %}+ <input type="hidden" name="{{ name }}_longitude" value="{{ tag.longitude }}"/>+ {% endif %}- {# zoomlevel #}- {% if old('tag_position_zoomlevel') %}- <input type="hidden" name="{{ name }}_zoomlevel" value="{{ old('tag_position_zoomlevel') }}"/>- {% else %}- <input type="hidden" name="{{ name }}_zoomlevel" value="{{ tag.zoomLevel }}"/>- {% endif %}- {% if tag.zoomLevel and tag.longitude and tag.latitude %}- <input type="hidden" name="{{ name }}_has_tag" value="true"/>- {% else %}- <input type="hidden" name="{{ name }}_has_tag" value="false"/>- {% endif %}+ {# zoomlevel #}+ {% if old('tag_position_zoomlevel') %}+ <input type="hidden" name="{{ name }}_zoomlevel" value="{{ old('tag_position_zoomlevel') }}"/>+ {% else %}+ <input type="hidden" name="{{ name }}_zoomlevel" value="{{ tag.zoomLevel }}"/>+ {% endif %}+ {% if tag.zoomLevel and tag.longitude and tag.latitude %}+ <input type="hidden" name="{{ name }}_has_tag" value="true"/>+ {% else %}+ <input type="hidden" name="{{ name }}_has_tag" value="false"/>+ {% endif %}{% include 'form/feedback' %}{% endif %}</div></div>{% if env('MAPBOX_API_KEY','') != '' %}-{% set latitudevar = name~'_latitude' %}-{% set longitudevar = name~'_longitude' %}-{% set zoomlevelvar = name~'_zoomlevel' %}-{% set hastagvar = name~'_has_tag' %}-{% set settagvar = name~'_set_tag' %}-{% set clearvar = name~'_clear_location' %}--<script type="text/javascript">- var mymap;- var marker;- if(typeof {{ latitudevar }} === "undefined") {- var {{ latitudevar }} = "52.3167";- }- if(typeof {{ longitudevar }} === "undefined") {- var {{ longitudevar }} = "5.5500";- }- if(typeof {{ zoomlevelvar }} === "undefined") {- var {{ zoomlevelvar }} = "6";- }-- if(typeof mapboxToken === 'undefined') {- var mapboxToken = 'invalid';- }- //- document.getElementById('{{ clearvar }}').addEventListener('click', function() {- if (typeof marker !== 'undefined') {- marker.remove();- $('input[name="{{ hastagvar }}"]').val('false');+ {% set latitudevar = name~'_latitude' %}+ {% set longitudevar = name~'_longitude' %}+ {% set zoomlevelvar = name~'_zoomlevel' %}+ {% set hastagvar = name~'_has_tag' %}+ {% set settagvar = name~'_set_tag' %}+ {% set clearvar = name~'_clear_location' %}++ <script type="text/javascript">+ var mymap;+ var marker;+ if (typeof {{ latitudevar }} === "undefined") {+ var {{ latitudevar }} =+ "52.3167";}- return false;- });-- // set location thing:- function setTagLocation(e) {- $('input[name="{{ latitudevar }}"]').val(e.latlng.lat);- $('input[name="{{ longitudevar }}"]').val(e.latlng.lng);- $('input[name="{{ zoomlevelvar }}"]').val(mymap.getZoom());- $('input[name="{{ hastagvar }}"]').val('true');-- // remove existing marker:- if(typeof marker !== 'undefined') {- marker.remove();+ if (typeof {{ longitudevar }} === "undefined") {+ var {{ longitudevar }} =+ "5.5500";+ }+ if (typeof {{ zoomlevelvar }} === "undefined") {+ var {{ zoomlevelvar }} =+ "6";}- // new marker- marker = L.marker([e.latlng.lat, e.latlng.lng]).addTo(mymap);- }+ if (typeof mapboxToken === 'undefined') {+ var mapboxToken = 'invalid';+ }+ //+ document.getElementById('{{ clearvar }}').addEventListener('click', function () {+ if (typeof marker !== 'undefined') {+ marker.remove();+ $('input[name="{{ hastagvar }}"]').val('false');+ }+ return false;+ });++ // set location thing:+ function setTagLocation(e) {+ $('input[name="{{ latitudevar }}"]').val(e.latlng.lat);+ $('input[name="{{ longitudevar }}"]').val(e.latlng.lng);+ $('input[name="{{ zoomlevelvar }}"]').val(mymap.getZoom());+ $('input[name="{{ hastagvar }}"]').val('true');++ // remove existing marker:+ if (typeof marker !== 'undefined') {+ marker.remove();+ }+ // new marker+ marker = L.marker([e.latlng.lat, e.latlng.lng]).addTo(mymap);+ }- console.log({{ longitudevar }});+ console.log({{ longitudevar }});- document.addEventListener("DOMContentLoaded", function() {- "use strict";+ document.addEventListener("DOMContentLoaded", function () {+ "use strict";- // make map:- mymap = L.map('{{ name }}_map').setView([{{ latitudevar }}, {{ longitudevar }}], {{ zoomlevelvar }});+ // make map:+ mymap = L.map('{{ name }}_map').setView([{{ latitudevar }}, {{ longitudevar }}], {{ zoomlevelvar }});- L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}', {- attribution: 'Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="http://mapbox.com">Mapbox</a>',- maxZoom: 18,- id: 'mapbox.streets',- accessToken: mapboxToken- }).addTo(mymap);+ L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}', {+ attribution: 'Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="http://mapbox.com">Mapbox</a>',+ maxZoom: 18,+ id: 'mapbox.streets',+ accessToken: mapboxToken+ }).addTo(mymap);- mymap.on('contextmenu', setTagLocation);+ mymap.on('contextmenu', setTagLocation);- // add marker- if(typeof {{ settagvar }} !== 'undefined' && {{ settagvar }} === true) {- marker = L.marker([{{ latitudevar }}, {{ longitudevar }}]).addTo(mymap);- }+ // add marker+ if (typeof {{ settagvar }} !== 'undefined' && {{ settagvar }} === true) {+ marker = L.marker([{{ latitudevar }}, {{ longitudevar }}]).addTo(mymap);+ }- });-</script>+ });+ </script>{% endif %}diff --git a/resources/views/form/number.twig b/resources/views/form/number.twigindex efffb5b8a0..6951b19328 100644--- a/resources/views/form/number.twig+++ b/resources/views/form/number.twig@@ -2,7 +2,7 @@<label for="{{ options.id }}" class="col-sm-4 control-label">{{ label }}</label><div class="col-sm-8">- {{ Form.input('number', name, value, options) }}+ {{ Form.input('number', name, value, options) }}{% include 'form/feedback' %}</div></div>diff --git a/resources/views/import/bank/form.twig b/resources/views/import/bank/form.twigindex 70f99a6790..a7c6507a01 100644--- a/resources/views/import/bank/form.twig+++ b/resources/views/import/bank/form.twig@@ -34,13 +34,13 @@{% for remoteAccount in remoteAccounts %}<tr><td>- <input type="checkbox" name="do_import[{{ remoteAccount.id }}]" checked id="do_import_{{ remoteAccount.id }}" />+ <input type="checkbox" name="do_import[{{ remoteAccount.id }}]" checked id="do_import_{{ remoteAccount.id }}"/></td><td><strong {% if remoteAccount.color !='' %} style="color:{{ remoteAccount.color }}"{% endif %}>{{ remoteAccount.name }}</strong>- <br />{{ remoteAccount.number }}+ <br/>{{ remoteAccount.number }}</td><td>{{ remoteAccount.currency }}diff --git a/resources/views/import/file/initial.twig b/resources/views/import/file/initial.twigindex fa2e6121ec..cff85df421 100644--- a/resources/views/import/file/initial.twig+++ b/resources/views/import/file/initial.twig@@ -79,7 +79,7 @@<div class="col-sm-8"><div class="radio"><label>{{ Form.checkbox('specifics['~type~']', '1',- job.configuration.specifics[type] == '1', {'id': type ~ '_label'}) }}+ job.configuration.specifics[type] == '1', {'id': type ~ '_label'}) }}{{ specific.description }}</label></div>diff --git a/resources/views/import/file/map.twig b/resources/views/import/file/map.twigindex a2ad9d0010..3a347f8905 100644--- a/resources/views/import/file/map.twig+++ b/resources/views/import/file/map.twig@@ -48,8 +48,8 @@</td><td>{{ Form.select('mapping['~field.index~']['~option~']',- field.options,- job.configuration['column-mapping-config'][field.index][option], {class: 'form-control'}) }}+ field.options,+ job.configuration['column-mapping-config'][field.index][option], {class: 'form-control'}) }}</td></tr>{% endfor %}diff --git a/resources/views/import/status.twig b/resources/views/import/status.twigindex 650c224fac..ac042e5dd6 100644--- a/resources/views/import/status.twig+++ b/resources/views/import/status.twig@@ -63,22 +63,22 @@</p><div class="row">{% if job.configuration['has-config-file'] != false %}- <div class="col-lg-4">- <a href="{{ route('import.download', [job.key]) }}" class="btn btn-default"><i- class="fa fa-fw fa-download"></i> {{ trans('import.status_ready_config') }}</a>- </div>+ <div class="col-lg-4">+ <a href="{{ route('import.download', [job.key]) }}" class="btn btn-default"><i+ class="fa fa-fw fa-download"></i> {{ trans('import.status_ready_config') }}</a>+ </div>{% endif %}<div class="col-lg-4"><button class="btn btn-success start-job"><i class="fa fa-fw fa-gears"></i> {{ trans('import.status_ready_start') }}</button></div></div>{% if job.configuration['has-config-file'] != false %}- <p>- - </p>- <p class="text-info">- {{ trans('import.status_ready_share')|raw }}- </p>+ <p>+ + </p>+ <p class="text-info">+ {{ trans('import.status_ready_share')|raw }}+ </p>{% endif %}</div></div>diff --git a/resources/views/index.twig b/resources/views/index.twigindex bab812d8b9..c763197739 100644--- a/resources/views/index.twig+++ b/resources/views/index.twig@@ -112,7 +112,8 @@{# EXPENSE ACCOUNTS #}<div class="box"><div class="box-header with-border">- <h3 class="box-title"><a href="{{ route('accounts.index',['expense']) }}" title="{{ 'expense_accounts'|_ }}">{{ 'expense_accounts'|_ }}</a></h3>+ <h3 class="box-title"><a href="{{ route('accounts.index',['expense']) }}" title="{{ 'expense_accounts'|_ }}">{{ 'expense_accounts'|_ }}</a>+ </h3></div><div class="box-body">@@ -123,7 +124,8 @@{% if showDeps %}<div class="box"><div class="box-header with-border">- <h3 class="box-title"><a href="{{ route('accounts.index',['revenue']) }}" title="{{ 'revenue_accounts'|_ }}">{{ 'revenue_accounts'|_ }}</a></h3>+ <h3 class="box-title"><a href="{{ route('accounts.index',['revenue']) }}"+ title="{{ 'revenue_accounts'|_ }}">{{ 'revenue_accounts'|_ }}</a></h3></div><div class="box-body">@@ -146,9 +148,9 @@<!-- render vertical line with text "today" -->{% if start.lte(today) and end.gte(today) %}- var today = {{ today.diffInDays(start) + 1 }};+ var today = {{ today.diffInDays(start) + 1 }};{% else %}- var today = -1;+ var today = -1;{% endif %}</script>diff --git a/resources/views/javascript/variables.twig b/resources/views/javascript/variables.twigindex 0da9d3eadf..1bd44157cc 100644--- a/resources/views/javascript/variables.twig+++ b/resources/views/javascript/variables.twig@@ -1,4 +1,3 @@-// date rangesvar ranges = {}{% for title, range in dateRangeConfig.ranges %}@@ -7,22 +6,22 @@ var ranges = {}// date range meta configurationvar dateRangeMeta = {- title: "{{ dateRangeTitle }}",- uri: "{{ route('daterange') }}",- labels: {- apply: "{{ 'apply'|_ }}",- cancel: "{{ 'cancel'|_ }}",- from: "{{ 'from'|_ }}",- to: "{{ 'to'|_ }}",- customRange: "{{ 'customRange'|_ }}"- }+title: "{{ dateRangeTitle }}",+uri: "{{ route('daterange') }}",+labels: {+apply: "{{ 'apply'|_ }}",+cancel: "{{ 'cancel'|_ }}",+from: "{{ 'from'|_ }}",+to: "{{ 'to'|_ }}",+customRange: "{{ 'customRange'|_ }}"+}};// date range actual configuration:var dateRangeConfig = {- startDate: moment("{{ dateRangeConfig.start }}"),- endDate: moment("{{ dateRangeConfig.end }}"),- ranges: ranges+startDate: moment("{{ dateRangeConfig.start }}"),+endDate: moment("{{ dateRangeConfig.end }}"),+ranges: ranges};diff --git a/resources/views/json/piggy-banks.twig b/resources/views/json/piggy-banks.twigindex d8cc226c5e..478ba1d95b 100644--- a/resources/views/json/piggy-banks.twig+++ b/resources/views/json/piggy-banks.twig@@ -5,9 +5,10 @@</div><div class="box-body">{% for entry in info %}- <strong>{{ entry.name }}</strong><br />+ <strong>{{ entry.name }}</strong><br/><div class="progress">- <div class="progress-bar" role="progressbar" aria-valuenow="{{ entry.percentage }}" aria-valuemin="0" aria-valuemax="100" style="width: {{ entry.percentage }}%;">+ <div class="progress-bar" role="progressbar" aria-valuenow="{{ entry.percentage }}" aria-valuemin="0" aria-valuemax="100"+ style="width: {{ entry.percentage }}%;">{% if entry.percentage >=20 %}{{ entry.amount|formatAmountPlain }}{% endif %}</div>{% if entry.percentage < 20 %} {{ entry.amount|formatAmountPlain }}{% endif %}diff --git a/resources/views/layout/default.twig b/resources/views/layout/default.twigindex d01ab308c0..f39e95761a 100644--- a/resources/views/layout/default.twig+++ b/resources/views/layout/default.twig@@ -185,7 +185,8 @@<script src="js/lib/daterangepicker.js?v={{ FF_VERSION }}" type="text/javascript"></script><script src="lib/adminlte/js/app.min.js?v={{ FF_VERSION }}" type="text/javascript"></script><script type="text/javascript" src="js/lib/accounting.min.js?v={{ FF_VERSION }}"></script>-<script src="{{ route('javascript.variables') }}?ext=.js&v={{ FF_VERSION }}{% if account %}&account={{ account.id }}{% endif %}" type="text/javascript"></script>+<script src="{{ route('javascript.variables') }}?ext=.js&v={{ FF_VERSION }}{% if account %}&account={{ account.id }}{% endif %}"+ type="text/javascript"></script><script type="text/javascript" src="js/ff/firefly.js?v={{ FF_VERSION }}"></script><script type="text/javascript" src="js/ff/help.js?v={{ FF_VERSION }}"></script>{% if not shownDemo %}diff --git a/resources/views/list/accounts.twig b/resources/views/list/accounts.twigindex 90a031efbb..90c69be280 100644--- a/resources/views/list/accounts.twig+++ b/resources/views/list/accounts.twig@@ -21,7 +21,14 @@{% for account in accounts %}<tr><td class="hidden-sm hidden-xs">- <div class="btn-group btn-group-xs edit_tr_buttons"><a class="btn btn-default btn-xs" title="{{ 'edit'|_ }}" href="{{ route('accounts.edit',account.id) }}"><i class="fa fa-fw fa-pencil"></i></a>{% if what == 'asset' %}<a class="btn btn-default btn-xs" title="{{ 'reconcile_this_account'|_ }}" href="{{ route('accounts.reconcile',account.id) }}"><i class="fa fa-fw fa-check"></i></a>{% endif %}<a class="btn btn-danger btn-xs" title="{{ 'delete'|_ }}" href="{{ route('accounts.delete',account.id) }}"><i class="fa fa-fw fa-trash-o"></i></a></div>+ <div class="btn-group btn-group-xs edit_tr_buttons"><a class="btn btn-default btn-xs" title="{{ 'edit'|_ }}"+ href="{{ route('accounts.edit',account.id) }}"><i+ class="fa fa-fw fa-pencil"></i></a>{% if what == 'asset' %}<a class="btn btn-default btn-xs"+ title="{{ 'reconcile_this_account'|_ }}"+ href="{{ route('accounts.reconcile',account.id) }}"><i+ class="fa fa-fw fa-check"></i></a>{% endif %}<a class="btn btn-danger btn-xs" title="{{ 'delete'|_ }}"+ href="{{ route('accounts.delete',account.id) }}"><i+ class="fa fa-fw fa-trash-o"></i></a></div></td><td data-value="{{ account.name }}"><a href="{{ route('accounts.show',account.id) }}">{{ account.name }}</a></td>{% if what == "asset" %}diff --git a/resources/views/list/bills.twig b/resources/views/list/bills.twigindex e7bb11c980..e4e8f6afc8 100644--- a/resources/views/list/bills.twig+++ b/resources/views/list/bills.twig@@ -19,7 +19,9 @@{% for entry in bills %}<tr><td class="hidden-sm hidden-xs">- <div class="btn-group btn-group-xs edit_tr_buttons"><a href="{{ route('bills.edit',entry.id) }}" class="btn btn-default btn-xs"><i class="fa fa-fw fa-pencil"></i></a><a href="{{ route('bills.delete',entry.id) }}" class="btn btn-danger btn-xs"><i class="fa fa-fw fa-trash-o"></i></a></div>+ <div class="btn-group btn-group-xs edit_tr_buttons"><a href="{{ route('bills.edit',entry.id) }}" class="btn btn-default btn-xs"><i+ class="fa fa-fw fa-pencil"></i></a><a href="{{ route('bills.delete',entry.id) }}" class="btn btn-danger btn-xs"><i+ class="fa fa-fw fa-trash-o"></i></a></div></td><td data-value="{{ entry.name }}"><a href="{{ route('bills.show',entry.id) }}" title="{{ entry.name }}">{{ entry.name }}</a>diff --git a/resources/views/list/journals.twig b/resources/views/list/journals.twigindex 0e3f4ff036..e0e25e9383 100644--- a/resources/views/list/journals.twig+++ b/resources/views/list/journals.twig@@ -46,12 +46,14 @@<div class="mass_buttons btn-group btn-group pull-right"><a href="#" class="btn btn-default mass_select"><i class="fa fa-fw fa-check-square-o"></i> {{ 'select_transactions'|_ }}</a><a href="#" class="btn btn-default mass_stop_select" style="display:none;"><i class="fa faw-fw fa-square-o"- ></i> {{ 'stop_selection'|_ }}</a>+ ></i> {{ 'stop_selection'|_ }}</a>{% if showReconcile == true %}{% if moment == 'all' %}- <a href="{{ route('accounts.reconcile', [account.id, start.format('Ymd')]) }}" class="btn btn-info mass_reconcile"><i class="fa fa-fw fa-check"></i> {{ 'reconcile_this_account'|_ }}</a>+ <a href="{{ route('accounts.reconcile', [account.id, start.format('Ymd')]) }}" class="btn btn-info mass_reconcile"><i+ class="fa fa-fw fa-check"></i> {{ 'reconcile_this_account'|_ }}</a>{% else %}- <a href="{{ route('accounts.reconcile', [account.id, start.format('Ymd'), end.format('Ymd')]) }}" class="btn btn-info mass_reconcile"><i class="fa fa-fw fa-check"></i> {{ 'reconcile_this_account'|_ }}</a>+ <a href="{{ route('accounts.reconcile', [account.id, start.format('Ymd'), end.format('Ymd')]) }}" class="btn btn-info mass_reconcile"><i+ class="fa fa-fw fa-check"></i> {{ 'reconcile_this_account'|_ }}</a>{% endif %}{% endif %}</div>diff --git a/resources/views/list/piggy-bank-events.twig b/resources/views/list/piggy-bank-events.twigindex 89b20f1710..43c815b54a 100644--- a/resources/views/list/piggy-bank-events.twig+++ b/resources/views/list/piggy-bank-events.twig@@ -1,7 +1,7 @@<table class="table table-hover"><tr>{% if showPiggyBank %}- <th>{{ trans('list.piggy_bank') }}</th>+ <th>{{ trans('list.piggy_bank') }}</th>{% endif %}<th>{{ trans('list.date') }}</th><th>{{ trans('list.amount') }}</th>diff --git a/resources/views/partials/menu-sidebar.twig b/resources/views/partials/menu-sidebar.twigindex b73ae95836..205a887c99 100644--- a/resources/views/partials/menu-sidebar.twig+++ b/resources/views/partials/menu-sidebar.twig@@ -159,7 +159,8 @@class="fa fa-gear fa-fw"></i> {{ 'preferences'|_ }}</a></li><li class="{{ activeRoutePartial('currencies') }}">- <a class="{{ activeRoutePartial('currencies') }}" href="{{ route('currencies.index') }}"><i class="fa fa-usd fa-fw"></i> {{ 'currencies'|_ }}</a>+ <a class="{{ activeRoutePartial('currencies') }}" href="{{ route('currencies.index') }}"><i class="fa fa-usd fa-fw"></i> {{ 'currencies'|_ }}+ </a></li><!-- admin (if user admin) -->{% if Auth.user.hasRole('owner') %}diff --git a/resources/views/partials/transaction-row.twig b/resources/views/partials/transaction-row.twigindex e969a07888..2b54a0bad0 100644--- a/resources/views/partials/transaction-row.twig+++ b/resources/views/partials/transaction-row.twig@@ -1,11 +1,11 @@-<tr class="drag" data-date="{{ transaction.date.format('Y-m-d') }}" data-id="{{ transaction.journal_id }}"data-transaction-id="{{ transaction.id }}">{# input buttons #}<td class="hidden-xs"><div class="select_single" style="display:none;">- <input name="select_all_single[]" class="select_all_single" data-transaction="{{ transaction.id }}" value="{{ transaction.journal_id }}" type="checkbox"/>+ <input name="select_all_single[]" class="select_all_single" data-transaction="{{ transaction.id }}" value="{{ transaction.journal_id }}"+ type="checkbox"/></div><div class="btn-group btn-group-xs edit_buttons edit_tr_buttons">{% if sorting %}<a href="#" class="handle btn btn-default btn-xs"><iclass="fa fa-fw fa-arrows-v"></i></a>{% endif %}<a href="{{ route('transactions.edit',transaction.journal_id) }}"diff --git a/resources/views/piggy-banks/index.twig b/resources/views/piggy-banks/index.twigindex 4c13d950a6..38b853e9d0 100644--- a/resources/views/piggy-banks/index.twig+++ b/resources/views/piggy-banks/index.twig@@ -8,55 +8,55 @@{% if piggyBanks.count == 0 %}{% include 'partials.empty' with {what: 'default', type: 'piggies',route: route('piggy-banks.create')} %}{% else %}- <div class="row">- <div class="col-lg-12 col-md-12 col-sm-12">- <div class="box">- <div class="box-header with-border">- <h3 class="box-title">{{ 'piggyBanks'|_ }}</h3>- </div>- <div class="box-body no-padding">- {% include 'list/piggy-banks' %}- </div>- </div>+<div class="row">+ <div class="col-lg-12 col-md-12 col-sm-12">+ <div class="box">+ <div class="box-header with-border">+ <h3 class="box-title">{{ 'piggyBanks'|_ }}</h3>+ </div>+ <div class="box-body no-padding">+ {% include 'list/piggy-banks' %}</div></div>+ </div>+</div>- <div class="row">- <div class="col-lg-12 col-md-12 col-sm-12">- <div class="box">- <div class="box-header with-border">- <h3 class="box-title">{{ 'account_status'|_ }}</h3>- </div>- <div class="box-body table-responsive no-padding">- <table class="table table-hover" id="accountStatus">- <thead>- <tr>- <th>{{ 'account'|_ }}</th>- <th style="text-align:right;" class="hidden-sm hidden-xs">{{ 'balance'|_ }}</th>- <th style="text-align:right;">{{ 'left_for_piggy_banks'|_ }}</th>- <th style="text-align:right;" class="hidden-sm hidden-xs">{{ 'sum_of_piggy_banks'|_ }}</th>- <th style="text-align:right;" class="hidden-sm hidden-xs">{{ 'saved_so_far'|_ }}</th>- <th style="text-align:right;" class="hidden-sm hidden-xs">{{ 'left_to_save'|_ }}</th>- </tr>- </thead>- <tbody>- {% for id,info in accounts %}- <tr>- <td><a href="{{ route('accounts.show',id) }}" title="{{ info.name }}">{{ info.name }}</a></td>- <td style="text-align:right;" class="hidden-sm hidden-xs">{{ info.balance|formatAmount }}</td>- <td style="text-align:right;">{{ info.leftForPiggyBanks|formatAmount }}</td>- <td style="text-align:right;" class="hidden-sm hidden-xs">{{ info.sumOfTargets|formatAmount }}</td>- <td style="text-align:right;" class="hidden-sm hidden-xs">{{ info.sumOfSaved|formatAmount }}</td>- <td style="text-align:right;" class="hidden-sm hidden-xs">{{ info.leftToSave|formatAmount }}</td>- </tr>- {% endfor %}- </tbody>- </table>- </div>- </div>+<div class="row">+ <div class="col-lg-12 col-md-12 col-sm-12">+ <div class="box">+ <div class="box-header with-border">+ <h3 class="box-title">{{ 'account_status'|_ }}</h3>+ </div>+ <div class="box-body table-responsive no-padding">+ <table class="table table-hover" id="accountStatus">+ <thead>+ <tr>+ <th>{{ 'account'|_ }}</th>+ <th style="text-align:right;" class="hidden-sm hidden-xs">{{ 'balance'|_ }}</th>+ <th style="text-align:right;">{{ 'left_for_piggy_banks'|_ }}</th>+ <th style="text-align:right;" class="hidden-sm hidden-xs">{{ 'sum_of_piggy_banks'|_ }}</th>+ <th style="text-align:right;" class="hidden-sm hidden-xs">{{ 'saved_so_far'|_ }}</th>+ <th style="text-align:right;" class="hidden-sm hidden-xs">{{ 'left_to_save'|_ }}</th>+ </tr>+ </thead>+ <tbody>+ {% for id,info in accounts %}+ <tr>+ <td><a href="{{ route('accounts.show',id) }}" title="{{ info.name }}">{{ info.name }}</a></td>+ <td style="text-align:right;" class="hidden-sm hidden-xs">{{ info.balance|formatAmount }}</td>+ <td style="text-align:right;">{{ info.leftForPiggyBanks|formatAmount }}</td>+ <td style="text-align:right;" class="hidden-sm hidden-xs">{{ info.sumOfTargets|formatAmount }}</td>+ <td style="text-align:right;" class="hidden-sm hidden-xs">{{ info.sumOfSaved|formatAmount }}</td>+ <td style="text-align:right;" class="hidden-sm hidden-xs">{{ info.leftToSave|formatAmount }}</td>+ </tr>+ {% endfor %}+ </tbody>+ </table></div></div>- {% endif %}+ </div>+</div>+{% endif %}{% endblock %}{% block scripts %}<script src="js/lib/jquery-ui.min.js?v={{ FF_VERSION }}" type="text/javascript"></script>diff --git a/resources/views/popup/report/balance-amount.twig b/resources/views/popup/report/balance-amount.twigindex d6fce9f97b..fcd9b9ec00 100644--- a/resources/views/popup/report/balance-amount.twig+++ b/resources/views/popup/report/balance-amount.twig@@ -4,7 +4,7 @@<div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-label="{{ 'close'|_ }}"><span>×</span></button><h4 class="modal-title" id="balanceAmountTitle">{{ trans('firefly.balance_amount',- {budget: budget.name, account: account.name, start: start.formatLocalized(monthAndDayFormat), end: end.formatLocalized(monthAndDayFormat)}+ {budget: budget.name, account: account.name, start: start.formatLocalized(monthAndDayFormat), end: end.formatLocalized(monthAndDayFormat)}) }}</h4></div><div class="modal-body">diff --git a/resources/views/profile/index.twig b/resources/views/profile/index.twigindex 2ab0094d12..6b744b2101 100644--- a/resources/views/profile/index.twig+++ b/resources/views/profile/index.twig@@ -35,13 +35,13 @@{{ 'explain_access_token'|_ }}</p><p>- <input id="token" type="text" class="form-control" name="token" value="{{ accessToken.data }}" size="32" maxlength="32" readonly />+ <input id="token" type="text" class="form-control" name="token" value="{{ accessToken.data }}" size="32" maxlength="32" readonly/></p><p>- <form action="{{ route('profile.regenerate') }}" method="post">+ <form action="{{ route('profile.regenerate') }}" method="post"><input type="hidden" name="_token" value="{{ csrf_token() }}"/>- <button type="submit" class="btn btn-danger btn-xs"><i class="fa fa-refresh"></i> {{ 'regenerate_access_token'|_ }}</button>+ <button type="submit" class="btn btn-danger btn-xs"><i class="fa fa-refresh"></i> {{ 'regenerate_access_token'|_ }}</button></form></p></div>diff --git a/resources/views/reports/audit/report.twig b/resources/views/reports/audit/report.twigindex 7c16f0462a..585df0ab10 100644--- a/resources/views/reports/audit/report.twig+++ b/resources/views/reports/audit/report.twig@@ -6,78 +6,78 @@{% block content %}- <!-- options block -->- <div class="row no-print">- <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">- <div class="box" id="optionsBox">- <div class="box-header with-border">- <h3 class="box-title">{{ 'options'|_ }}</h3>- </div>- <div class="box-body">- <ul class="list-inline">- {% for hide in hideable %}- <li><input- {% if hide in defaultShow %}checked{% endif %}- type="checkbox" class="audit-option-checkbox" name="option[]" value="{{ hide }}" id="option_{{ hide }}"/> <label- for="option_{{ hide }}" style="font-weight:normal;">{{ trans('list.'~hide) }}</label></li>- {% endfor %}+<!-- options block -->+<div class="row no-print">+ <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">+ <div class="box" id="optionsBox">+ <div class="box-header with-border">+ <h3 class="box-title">{{ 'options'|_ }}</h3>+ </div>+ <div class="box-body">+ <ul class="list-inline">+ {% for hide in hideable %}+ <li><input+ {% if hide in defaultShow %}checked{% endif %}+ type="checkbox" class="audit-option-checkbox" name="option[]" value="{{ hide }}" id="option_{{ hide }}"/> <label+ for="option_{{ hide }}" style="font-weight:normal;">{{ trans('list.'~hide) }}</label></li>+ {% endfor %}- </ul>- </div>+ </ul></div></div></div>+</div>- {% for account in accounts %}- <div class="row">- <div class="col-lg-12 col-md-12 col-sm-12">- <div class="box">- <div class="box-header with-border">- <h3 class="box-title">{{ account.name }}</h3>- </div>- {% set url = route('accounts.show',account.id) %}- {% if not auditData[account.id].exists %}- <div class="box-body">+{% for account in accounts %}+<div class="row">+ <div class="col-lg-12 col-md-12 col-sm-12">+ <div class="box">+ <div class="box-header with-border">+ <h3 class="box-title">{{ account.name }}</h3>+ </div>+ {% set url = route('accounts.show',account.id) %}+ {% if not auditData[account.id].exists %}+ <div class="box-body">- <em>- {{ trans('firefly.no_audit_activity',- {- account_name: account.name,- url: url,- start: start.formatLocalized(monthAndDayFormat),- end: end.formatLocalized(monthAndDayFormat),- })|raw }}- </em>- </div>- {% else %}- <div class="box-body table-responsive no-padding">- <p style="padding:10px;">+ <em>+ {{ trans('firefly.no_audit_activity',+ {+ account_name: account.name,+ url: url,+ start: start.formatLocalized(monthAndDayFormat),+ end: end.formatLocalized(monthAndDayFormat),+ })|raw }}+ </em>+ </div>+ {% else %}+ <div class="box-body table-responsive no-padding">+ <p style="padding:10px;">- {{ trans('firefly.audit_end_balance',- {- account_name: account.name,- url: url,- end: auditData[account.id].end,- balance: formatAmountByAccount(account,auditData[account.id].endBalance)- })|raw }}- </p>- {% include 'reports.partials.journals-audit' with {'journals': auditData[account.id].journals,'account':account} %}- <p style="padding:10px;">- {{ trans('firefly.audit_end_balance',- {- account_name: account.name,- url: url,- end: auditData[account.id].dayBefore,- balance: formatAmountByAccount(account, auditData[account.id].dayBeforeBalance)- })|raw }}- </p>- </div>- {% endif %}- </div>+ {{ trans('firefly.audit_end_balance',+ {+ account_name: account.name,+ url: url,+ end: auditData[account.id].end,+ balance: formatAmountByAccount(account,auditData[account.id].endBalance)+ })|raw }}+ </p>+ {% include 'reports.partials.journals-audit' with {'journals': auditData[account.id].journals,'account':account} %}+ <p style="padding:10px;">+ {{ trans('firefly.audit_end_balance',+ {+ account_name: account.name,+ url: url,+ end: auditData[account.id].dayBefore,+ balance: formatAmountByAccount(account, auditData[account.id].dayBeforeBalance)+ })|raw }}+ </p></div>+ {% endif %}</div>- {% endfor %}+ </div>+</div>+{% endfor %}{% endblock %}{% block styles %}diff --git a/resources/views/reports/partials/bills.twig b/resources/views/reports/partials/bills.twigindex 39eda91cf4..86f826036b 100644--- a/resources/views/reports/partials/bills.twig+++ b/resources/views/reports/partials/bills.twig@@ -18,7 +18,7 @@<tr><td data-value="{{ line.getBill.name }}"><a href="{{ route('bills.show',line.getBill.id) }}">{{ line.getBill.name }}</a>- <small class="text-muted"><br />+ <small class="text-muted"><br/>{{ trans('firefly.bill_expected_between', {start: line.getPayDate.formatLocalized(monthAndDayFormat), end: line.getEndOfPayDate.formatLocalized(monthAndDayFormat) }) }}</small></td>diff --git a/resources/views/reports/partials/exp-budgets.twig b/resources/views/reports/partials/exp-budgets.twigindex 992570d1dc..d1cc577e1d 100644--- a/resources/views/reports/partials/exp-budgets.twig+++ b/resources/views/reports/partials/exp-budgets.twig@@ -1,7 +1,7 @@<table class="table table-hover sortable"><thead><tr>- <th style="width:66%;" data-defaultsign="az" data-defaultsort="asc">{{ 'category'|_ }}</th>+ <th style="width:66%;" data-defaultsign="az" data-defaultsort="asc">{{ 'category'|_ }}</th><th style="width:34%;" data-defaultsign="_19">{{ 'spent'|_ }}</th></tr></thead>@@ -20,7 +20,7 @@{{ '0'|formatAmount }}{% else %}{% for expense in entry.spent.per_currency %}- {{ formatAmountBySymbol(expense.sum, expense.currency.symbol, expense.currency.dp) }}<br />+ {{ formatAmountBySymbol(expense.sum, expense.currency.symbol, expense.currency.dp) }}<br/>{% endfor %}{% endif %}</td>diff --git a/resources/views/reports/partials/exp-categories.twig b/resources/views/reports/partials/exp-categories.twigindex e700cf4268..1ff99b927d 100644--- a/resources/views/reports/partials/exp-categories.twig+++ b/resources/views/reports/partials/exp-categories.twig@@ -1,7 +1,7 @@<table class="table table-hover sortable"><thead><tr>- <th style="width:50%;" data-defaultsign="az" data-defaultsort="asc">{{ 'category'|_ }}</th>+ <th style="width:50%;" data-defaultsign="az" data-defaultsort="asc">{{ 'category'|_ }}</th><th style="width:25%;" data-defaultsign="_19">{{ 'spent'|_ }}</th><th style="width:25%;" data-defaultsign="_19">{{ 'earned'|_ }}</th></tr>@@ -22,7 +22,7 @@{{ '0'|formatAmount }}{% else %}{% for expense in entry.spent.per_currency %}- {{ formatAmountBySymbol(expense.sum, expense.currency.symbol, expense.currency.dp) }}<br />+ {{ formatAmountBySymbol(expense.sum, expense.currency.symbol, expense.currency.dp) }}<br/>{% endfor %}{% endif %}</td>@@ -31,7 +31,7 @@{{ '0'|formatAmount }}{% else %}{% for income in entry.earned.per_currency %}- {{ formatAmountBySymbol(income.sum, income.currency.symbol, income.currency.dp) }}<br />+ {{ formatAmountBySymbol(income.sum, income.currency.symbol, income.currency.dp) }}<br/>{% endfor %}{% endif %}</td>diff --git a/resources/views/reports/partials/exp-not-grouped.twig b/resources/views/reports/partials/exp-not-grouped.twigindex 85a5a667c8..ab4250937c 100644--- a/resources/views/reports/partials/exp-not-grouped.twig+++ b/resources/views/reports/partials/exp-not-grouped.twig@@ -1,4 +1,3 @@-<table class="table table-hover sortable"><thead><tr>@@ -12,19 +11,19 @@<tr><td data-value="{{ name }}">{{ name }}</td><td data-value="{{ amounts.spent.grand_sum }}">- {% if amounts.spent.per_currency|length == 0%}+ {% if amounts.spent.per_currency|length == 0 %}{{ '0'|formatAmount }}{% endif %}{% for expense in amounts.spent.per_currency %}- {{ formatAmountBySymbol(expense.sum, expense.currency.symbol, expense.currency.dp) }}<br />+ {{ formatAmountBySymbol(expense.sum, expense.currency.symbol, expense.currency.dp) }}<br/>{% endfor %}</td><td data-value="{{ amounts.earned.grand_sum }}">- {% if amounts.earned.per_currency|length == 0%}+ {% if amounts.earned.per_currency|length == 0 %}{{ '0'|formatAmount }}{% endif %}{% for income in amounts.earned.per_currency %}- {{ formatAmountBySymbol(income.sum, income.currency.symbol, income.currency.dp) }}<br />+ {{ formatAmountBySymbol(income.sum, income.currency.symbol, income.currency.dp) }}<br/>{% endfor %}</td></tr>diff --git a/resources/views/reports/partials/top-transactions.twig b/resources/views/reports/partials/top-transactions.twigindex e068286fd1..67e9c080a2 100644--- a/resources/views/reports/partials/top-transactions.twig+++ b/resources/views/reports/partials/top-transactions.twig@@ -17,7 +17,8 @@<td data-value="{{ transaction.date.format('Y-m-d') }}">{{ transaction.date.formatLocalized(monthAndDayFormat) }}</td>- <td style="text-align: right;" data-value="{{ transaction.transaction_amount }}"><span style="margin-right:5px;">{{ transaction|transactionAmount }}</span></td>+ <td style="text-align: right;" data-value="{{ transaction.transaction_amount }}"><span+ style="margin-right:5px;">{{ transaction|transactionAmount }}</span></td></tr>{% endfor %}</tbody>diff --git a/resources/views/rules/index.twig b/resources/views/rules/index.twigindex 3a8f16d1ce..58a749477f 100644--- a/resources/views/rules/index.twig+++ b/resources/views/rules/index.twig@@ -107,7 +107,9 @@<td><div class="btn-group btn-group-xs test_buttons">{# show which transactions would match #}- <a href="#" class="btn btn-default test_rule_triggers" data-id="{{ rule.id }}" title="{{ 'test_rule_triggers'|_ }}"><i data-id="{{ rule.id }}" class="test_rule_triggers fa fa-fw fa-flask"></i></a>+ <a href="#" class="btn btn-default test_rule_triggers" data-id="{{ rule.id }}"+ title="{{ 'test_rule_triggers'|_ }}"><i data-id="{{ rule.id }}"+ class="test_rule_triggers fa fa-fw fa-flask"></i></a>{# actually execute rule #}<a href="{{ route('rules.select-transactions',rule.id) }}" class="btn btn-default"diff --git a/resources/views/tags/create.twig b/resources/views/tags/create.twigindex d5f0fea178..a4fbc11476 100644--- a/resources/views/tags/create.twig+++ b/resources/views/tags/create.twig@@ -91,7 +91,7 @@<script src="js/ff/tags/create-edit.js?v={{ FF_VERSION }}"></script>{% endblock %}{% block styles %}- <link rel="stylesheet" href="lib/leaflet/leaflet.css?v={{ FF_VERSION }}" />+ <link rel="stylesheet" href="lib/leaflet/leaflet.css?v={{ FF_VERSION }}"/><link href="css/jquery-ui/jquery-ui.structure.min.css?v={{ FF_VERSION }}" type="text/css" rel="stylesheet" media="all"><link href="css/jquery-ui/jquery-ui.theme.min.css?v={{ FF_VERSION }}" type="text/css" rel="stylesheet" media="all">{% endblock %}diff --git a/resources/views/tags/edit.twig b/resources/views/tags/edit.twigindex 5eed6ff416..41d032f2d6 100644--- a/resources/views/tags/edit.twig+++ b/resources/views/tags/edit.twig@@ -95,7 +95,7 @@<script src="js/ff/tags/create-edit.js?v={{ FF_VERSION }}"></script>{% endblock %}{% block styles %}- <link rel="stylesheet" href="lib/leaflet/leaflet.css?v={{ FF_VERSION }}" />+ <link rel="stylesheet" href="lib/leaflet/leaflet.css?v={{ FF_VERSION }}"/><link href="css/jquery-ui/jquery-ui.structure.min.css?v={{ FF_VERSION }}" type="text/css" rel="stylesheet" media="all"><link href="css/jquery-ui/jquery-ui.theme.min.css?v={{ FF_VERSION }}" type="text/css" rel="stylesheet" media="all">{% endblock %}diff --git a/resources/views/tags/index.twig b/resources/views/tags/index.twigindex 08d8c4156e..e611b43801 100644--- a/resources/views/tags/index.twig+++ b/resources/views/tags/index.twig@@ -10,25 +10,26 @@{% else %}{% for period,entries in clouds %}{% if entries|length > 0 %}- <div class="row">- <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">- <div class="box">- <div class="box-header with-border">- <h3 class="box-title">- {% if period == 'no-date' %}{{ 'without_date'|_ }}{% else %}{{ period }}{% endif %}- </h3>- </div>- <div class="box-body">- <p class="tagcloud">- {% for tagInfo in entries %}- <a style="font-size:{{ tagInfo.scale }}px;" class="label label-success" href="{{ route('tags.show',tagInfo.tag.id) }}"><i class="fa fa-fw fa-tag"></i> {{ tagInfo.tag.tag }}</a>- {% endfor %}- </p>+ <div class="row">+ <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">+ <div class="box">+ <div class="box-header with-border">+ <h3 class="box-title">+ {% if period == 'no-date' %}{{ 'without_date'|_ }}{% else %}{{ period }}{% endif %}+ </h3>+ </div>+ <div class="box-body">+ <p class="tagcloud">+ {% for tagInfo in entries %}+ <a style="font-size:{{ tagInfo.scale }}px;" class="label label-success"+ href="{{ route('tags.show',tagInfo.tag.id) }}"><i class="fa fa-fw fa-tag"></i> {{ tagInfo.tag.tag }}</a>+ {% endfor %}+ </p>+ </div></div></div></div>- </div>- {% endif %}+ {% endif %}{% endfor %}{#diff --git a/resources/views/tags/show.twig b/resources/views/tags/show.twigindex 3f5a81478d..c7820c6beb 100644--- a/resources/views/tags/show.twig+++ b/resources/views/tags/show.twig@@ -29,22 +29,22 @@<div class="box-body no-padding"><table class="table table-bordered">{% if tag.description %}- <tr>- <td>- {{ trans('list.description') }}- </td>- <td>{{ tag.description }}</td>- </tr>+ <tr>+ <td>+ {{ trans('list.description') }}+ </td>+ <td>{{ tag.description }}</td>+ </tr>{% endif %}{% if tag.date %}- <tr>- <td>- {{ trans('list.date') }}- </td>- <td>- {{ tag.date.formatLocalized(monthAndDayFormat) }}- </td>- </tr>+ <tr>+ <td>+ {{ trans('list.date') }}+ </td>+ <td>+ {{ tag.date.formatLocalized(monthAndDayFormat) }}+ </td>+ </tr>{% endif %}<tr><td>{{ trans('list.sum') }}</td>@@ -196,7 +196,7 @@{% endblock %}{% block styles %}- <link rel="stylesheet" href="lib/leaflet/leaflet.css?v={{ FF_VERSION }}" />+ <link rel="stylesheet" href="lib/leaflet/leaflet.css?v={{ FF_VERSION }}"/>{% endblock %}{% block scripts %}<script type="text/javascript">diff --git a/resources/views/transactions/convert.twig b/resources/views/transactions/convert.twigindex 14da1981f9..f51af285fe 100644--- a/resources/views/transactions/convert.twig+++ b/resources/views/transactions/convert.twig@@ -53,13 +53,13 @@{% if sourceType.type == 'Withdrawal' and destinationType.type == 'Deposit' %}<p><em>{{ trans('firefly.convert_explanation_withdrawal_deposit',- {- amount: positiveAmount|formatAmount,- sourceRoute: route('accounts.show', [sourceAccount.id]),- sourceName: sourceAccount.name,- destinationRoute: route('accounts.show', [destinationAccount.id]),- destinationName: destinationAccount.name,- })|raw }}+ {+ amount: positiveAmount|formatAmount,+ sourceRoute: route('accounts.show', [sourceAccount.id]),+ sourceName: sourceAccount.name,+ destinationRoute: route('accounts.show', [destinationAccount.id]),+ destinationName: destinationAccount.name,+ })|raw }}</em></p><p><em>@@ -77,13 +77,13 @@{% if sourceType.type == 'Withdrawal' and destinationType.type == 'Transfer' %}<p><em>{{ trans('firefly.convert_explanation_withdrawal_transfer',- {- amount: positiveAmount|formatAmount,- sourceRoute: route('accounts.show', [sourceAccount.id]),- sourceName: sourceAccount.name,- destinationRoute: route('accounts.show', [destinationAccount.id]),- destinationName: destinationAccount.name,- })|raw }}+ {+ amount: positiveAmount|formatAmount,+ sourceRoute: route('accounts.show', [sourceAccount.id]),+ sourceName: sourceAccount.name,+ destinationRoute: route('accounts.show', [destinationAccount.id]),+ destinationName: destinationAccount.name,+ })|raw }}</em></p><p>@@ -102,13 +102,13 @@<p><em>{{ trans('firefly.convert_explanation_deposit_withdrawal',- {- amount: positiveAmount|formatAmount,- sourceRoute: route('accounts.show', [sourceAccount.id]),- sourceName: sourceAccount.name,- destinationRoute: route('accounts.show', [destinationAccount.id]),- destinationName: destinationAccount.name,- })|raw }}+ {+ amount: positiveAmount|formatAmount,+ sourceRoute: route('accounts.show', [sourceAccount.id]),+ sourceName: sourceAccount.name,+ destinationRoute: route('accounts.show', [destinationAccount.id]),+ destinationName: destinationAccount.name,+ })|raw }}</em></p><p>@@ -131,13 +131,13 @@<p><em>{{ trans('firefly.convert_explanation_deposit_transfer',- {- amount: positiveAmount|formatAmount,- sourceRoute: route('accounts.show', [sourceAccount.id]),- sourceName: sourceAccount.name,- destinationRoute: route('accounts.show', [destinationAccount.id]),- destinationName: destinationAccount.name,- })|raw }}+ {+ amount: positiveAmount|formatAmount,+ sourceRoute: route('accounts.show', [sourceAccount.id]),+ sourceName: sourceAccount.name,+ destinationRoute: route('accounts.show', [destinationAccount.id]),+ destinationName: destinationAccount.name,+ })|raw }}</em></p><p>@@ -156,13 +156,13 @@<p><em>{{ trans('firefly.convert_explanation_transfer_withdrawal',- {- amount: positiveAmount|formatAmount,- sourceRoute: route('accounts.show', [sourceAccount.id]),- sourceName: sourceAccount.name,- destinationRoute: route('accounts.show', [destinationAccount.id]),- destinationName: destinationAccount.name,- })|raw }}+ {+ amount: positiveAmount|formatAmount,+ sourceRoute: route('accounts.show', [sourceAccount.id]),+ sourceName: sourceAccount.name,+ destinationRoute: route('accounts.show', [destinationAccount.id]),+ destinationName: destinationAccount.name,+ })|raw }}</em></p>@@ -183,13 +183,13 @@<p><em>{{ trans('firefly.convert_explanation_transfer_deposit',- {- amount: positiveAmount|formatAmount,- sourceRoute: route('accounts.show', [sourceAccount.id]),- sourceName: sourceAccount.name,- destinationRoute: route('accounts.show', [destinationAccount.id]),- destinationName: destinationAccount.name,- })|raw }}+ {+ amount: positiveAmount|formatAmount,+ sourceRoute: route('accounts.show', [sourceAccount.id]),+ sourceName: sourceAccount.name,+ destinationRoute: route('accounts.show', [destinationAccount.id]),+ destinationName: destinationAccount.name,+ })|raw }}</em></p>diff --git a/resources/views/transactions/single/create.twig b/resources/views/transactions/single/create.twigindex f9e074dfe8..91fa5a7b1a 100644--- a/resources/views/transactions/single/create.twig+++ b/resources/views/transactions/single/create.twig@@ -93,24 +93,24 @@{# explain if necessary #}{% if- not optionalFields.interest_date or- not optionalFields.book_date or- not optionalFields.process_date or- not optionalFields.due_date or- not optionalFields.payment_date or- not optionalFields.invoice_date or- not optionalFields.internal_reference or- not optionalFields.notes or- not optionalFields.attachments %}+ not optionalFields.interest_date or+ not optionalFields.book_date or+ not optionalFields.process_date or+ not optionalFields.due_date or+ not optionalFields.payment_date or+ not optionalFields.invoice_date or+ not optionalFields.internal_reference or+ not optionalFields.notes or+ not optionalFields.attachments %}<p class="text-center text-success"><i class="fa fa-info-circle"></i><em>{{ trans('firefly.hidden_fields_preferences', {link: route('preferences.index')})|raw }}</em></p>{% endif %}{# box for dates #}{% if- optionalFields.interest_date or optionalFields.book_date or optionalFields.process_date- or optionalFields.due_date or optionalFields.payment_date- or optionalFields.invoice_date %}+ optionalFields.interest_date or optionalFields.book_date or optionalFields.process_date+ or optionalFields.due_date or optionalFields.payment_date+ or optionalFields.invoice_date %}<div class="box"><div class="box-header with-border"><h3 class="box-title">{{ 'optional_field_meta_dates'|_ }}</h3>diff --git a/resources/views/transactions/single/edit.twig b/resources/views/transactions/single/edit.twigindex 2ead7d9a94..7f36389329 100644--- a/resources/views/transactions/single/edit.twig+++ b/resources/views/transactions/single/edit.twig@@ -98,15 +98,15 @@<!-- explain if necessary -->{% if- not optionalFields.interest_date or- not optionalFields.book_date or- not optionalFields.process_date or- not optionalFields.due_date or- not optionalFields.payment_date or- not optionalFields.invoice_date or- not optionalFields.internal_reference or- not optionalFields.notes or- not optionalFields.attachments %}+ not optionalFields.interest_date or+ not optionalFields.book_date or+ not optionalFields.process_date or+ not optionalFields.due_date or+ not optionalFields.payment_date or+ not optionalFields.invoice_date or+ not optionalFields.internal_reference or+ not optionalFields.notes or+ not optionalFields.attachments %}<p class="text-center text-success"><i class="fa fa-info-circle"></i><em>{{ trans('firefly.hidden_fields_preferences', {link: route('preferences.index')})|raw }}</em></p>{% endif %}@@ -114,17 +114,17 @@<!-- box for dates -->{% if- optionalFields.interest_date or- optionalFields.book_date or- optionalFields.process_date or- optionalFields.due_date or- optionalFields.payment_date or- optionalFields.invoice_date or- data.interest_date or- data.book_date or- data.process_date or- data.due_date or- data.payment_date %}+ optionalFields.interest_date or+ optionalFields.book_date or+ optionalFields.process_date or+ optionalFields.due_date or+ optionalFields.payment_date or+ optionalFields.invoice_date or+ data.interest_date or+ data.book_date or+ data.process_date or+ data.due_date or+ data.payment_date %}<div class="box"><div class="box-header with-border"><h3 class="box-title">{{ 'optional_field_meta_dates'|_ }}</h3>@@ -168,10 +168,10 @@<!-- box for business fields -->{% if- optionalFields.internal_reference or- optionalFields.notes or- data['interal_reference'] or- data['notes'] %}+ optionalFields.internal_reference or+ optionalFields.notes or+ data['interal_reference'] or+ data['notes'] %}<div class="box"><div class="box-header with-border"><h3 class="box-title">{{ 'optional_field_meta_business'|_ }}</h3>diff --git a/resources/views/transactions/split/edit.twig b/resources/views/transactions/split/edit.twigindex afd8fd371b..6573de4cec 100644--- a/resources/views/transactions/split/edit.twig+++ b/resources/views/transactions/split/edit.twig@@ -91,24 +91,24 @@{# EXPLANATION IF NECESSARY: #}{% if- not optionalFields.interest_date or- not optionalFields.book_date or- not optionalFields.process_date or- not optionalFields.due_date or- not optionalFields.payment_date or- not optionalFields.invoice_date or- not optionalFields.internal_reference or- not optionalFields.notes or- not optionalFields.attachments %}+ not optionalFields.interest_date or+ not optionalFields.book_date or+ not optionalFields.process_date or+ not optionalFields.due_date or+ not optionalFields.payment_date or+ not optionalFields.invoice_date or+ not optionalFields.internal_reference or+ not optionalFields.notes or+ not optionalFields.attachments %}<p class="text-center text-success"><i class="fa fa-info-circle"></i><em>{{ trans('firefly.hidden_fields_preferences', {link: route('preferences.index')})|raw }}</em></p>{% endif %}{# BOX FOR DATES #}{% if- optionalFields.interest_date or optionalFields.book_date or optionalFields.process_date- or optionalFields.due_date or optionalFields.payment_date- or optionalFields.invoice_date %}+ optionalFields.interest_date or optionalFields.book_date or optionalFields.process_date+ or optionalFields.due_date or optionalFields.payment_date+ or optionalFields.invoice_date %}<div class="box"><div class="box-header with-border"><h3 class="box-title">{{ 'optional_field_meta_dates'|_ }}</h3>@@ -218,44 +218,44 @@</div>{% for index, transaction in preFilled.transactions %}- <div class="row {% if loop.index0 % 2 == 1 %}bg-gray-light{% endif %} split_row" data-split="{{ loop.index0 }}">- {# button #}- <div class="col-lg-1 col-md-1 col-sm-6 col-xs-6">- <a href="#" class="btn btn-xs btn-danger remove-current-split" data-split="{{ loop.index0 }}">- <i class="fa fa-trash" data-split="{{ loop.index0 }}"></i></a>- </div>+ <div class="row {% if loop.index0 % 2 == 1 %}bg-gray-light{% endif %} split_row" data-split="{{ loop.index0 }}">+ {# button #}+ <div class="col-lg-1 col-md-1 col-sm-6 col-xs-6">+ <a href="#" class="btn btn-xs btn-danger remove-current-split" data-split="{{ loop.index0 }}">+ <i class="fa fa-trash" data-split="{{ loop.index0 }}"></i></a>+ </div>- {# index #}- <div class="col-lg-1 col-md-1 col-sm-6 col-xs-6 count">#{{ loop.index }}</div>+ {# index #}+ <div class="col-lg-1 col-md-1 col-sm-6 col-xs-6 count">#{{ loop.index }}</div>- {# description #}- <div class="col-lg-3 col-md-5 col-sm-12 col-xs-12">- <input type="text" name="transactions[{{ loop.index0 }}][description]" value="{{ transaction.description }}"- class="form-control"/>- </div>+ {# description #}+ <div class="col-lg-3 col-md-5 col-sm-12 col-xs-12">+ <input type="text" name="transactions[{{ loop.index0 }}][description]" value="{{ transaction.description }}"+ class="form-control"/>+ </div>- {# destination for withdrawals: #}- {% if preFilled.what == 'withdrawal' %}- <div class="col-lg-2 col-md-5 col-sm-12 col-xs-12">- <input type="text" name="transactions[{{ loop.index0 }}][destination_account_name]"- value="{{ transaction.destination_account_name }}" class="form-control"/>- </div>- {% endif %}+ {# destination for withdrawals: #}+ {% if preFilled.what == 'withdrawal' %}+ <div class="col-lg-2 col-md-5 col-sm-12 col-xs-12">+ <input type="text" name="transactions[{{ loop.index0 }}][destination_account_name]"+ value="{{ transaction.destination_account_name }}" class="form-control"/>+ </div>+ {% endif %}- {# source for deposits #}- {% if preFilled.what == 'deposit' %}- <div class="col-lg-2 col-md-5 col-sm-12 col-xs-12">- <input type="text" name="transactions[{{ loop.index0 }}][source_account_name]"- value="{{ transaction.source_account_name }}" class="form-control"/>- </div>- {% endif %}+ {# source for deposits #}+ {% if preFilled.what == 'deposit' %}+ <div class="col-lg-2 col-md-5 col-sm-12 col-xs-12">+ <input type="text" name="transactions[{{ loop.index0 }}][source_account_name]"+ value="{{ transaction.source_account_name }}" class="form-control"/>+ </div>+ {% endif %}- {# amount#}- {% if transaction.foreign_amount != null %}- <div class="col-lg-1 col-md-5 col-sm-12 col-xs-12">+ {# amount#}+ {% if transaction.foreign_amount != null %}+ <div class="col-lg-1 col-md-5 col-sm-12 col-xs-12">{% else %}<div class="col-lg-2 col-md-5 col-sm-12 col-xs-12">- {% endif %}+ {% endif %}<div class="input-group"><div class="input-group-addon">{{ transaction.transaction_currency_symbol }}</div><input type="number" name="transactions[{{ loop.index0 }}][amount]" value="{{ transaction.amount }}"@@ -267,18 +267,18 @@{# foreign amount #}{% if transaction.foreign_amount != null %}- <div class="col-lg-1 col-md-7 col-sm-12 col-xs-12">- <div class="input-group">- <div class="input-group-addon">{{ transaction.foreign_currency_symbol }}</div>- <input type="number" name="transactions[{{ loop.index0 }}][foreign_amount]"- value="{{ transaction.foreign_amount }}"- class="form-control" autocomplete="off" step="any">- </div>- <input type="hidden"- name="transactions[{{ loop.index0 }}][foreign_currency_id]"- value="{{ transaction.foreign_currency_id }}">+ <div class="col-lg-1 col-md-7 col-sm-12 col-xs-12">+ <div class="input-group">+ <div class="input-group-addon">{{ transaction.foreign_currency_symbol }}</div>+ <input type="number" name="transactions[{{ loop.index0 }}][foreign_amount]"+ value="{{ transaction.foreign_amount }}"+ class="form-control" autocomplete="off" step="any">+ </div>+ <input type="hidden"+ name="transactions[{{ loop.index0 }}][foreign_currency_id]"+ value="{{ transaction.foreign_currency_id }}">- </div>+ </div>{% endif %}{# budget #}@@ -299,32 +299,32 @@class="form-control"/></div></div>- {% endfor %}+ {% endfor %}+ </div>+ <p>+ <br/>+ <a href="#" class="btn btn-default btn-do-split"><i class="fa fa-plus-circle"></i> {{ 'add_another_split'|_ }}</a>+ </p></div>- <p>- <br/>- <a href="#" class="btn btn-default btn-do-split"><i class="fa fa-plus-circle"></i> {{ 'add_another_split'|_ }}</a>- </p></div></div></div>- </div>- <div class="row">- <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">- <!-- panel for options -->- <div class="box">- <div class="box-header with-border">- <h3 class="box-title">{{ 'options'|_ }}</h3>- </div>- <div class="box-body">- {{ ExpandedForm.optionsList('update','split-transaction') }}- </div>- <div class="box-footer">- <button type="submit" class="pull-right btn btn-success">{{ ('update_' ~ preFilled.what)|_ }}</button>+ <div class="row">+ <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">+ <!-- panel for options -->+ <div class="box">+ <div class="box-header with-border">+ <h3 class="box-title">{{ 'options'|_ }}</h3>+ </div>+ <div class="box-body">+ {{ ExpandedForm.optionsList('update','split-transaction') }}+ </div>+ <div class="box-footer">+ <button type="submit" class="pull-right btn btn-success">{{ ('update_' ~ preFilled.what)|_ }}</button>+ </div></div></div></div>- </div></form>{% endblock %}@@ -338,10 +338,10 @@<script type="text/javascript">var currencySymbol = 'x';{% if preFilled.what == 'withdrawal' or preFilled.what == 'transfer' %}- currencySymbol = currencyInfo[{{ accountArray[preFilled.journal_source_account_id].currency_id }}].symbol;+ currencySymbol = currencyInfo[{{ accountArray[preFilled.journal_source_account_id].currency_id }}].symbol;{% endif %}{% if preFilled.what == 'deposit' %}- currencySymbol = currencyInfo[{{ accountArray[preFilled.journal_destination_account_id].currency_id }}].symbol;+ currencySymbol = currencyInfo[{{ accountArray[preFilled.journal_destination_account_id].currency_id }}].symbol;{% endif %}var originalSum = {{ preFilled.journal_amount }};var what = "{{ preFilled.what }}";diff --git a/routes/api.php b/routes/api.phpindex 2b3144a60e..61d0d30274 100644--- a/routes/api.php+++ b/routes/api.php@@ -32,6 +32,8 @@ use Illuminate\Http\Request;|*/-Route::middleware('auth:api')->get('/user', function (Request $request) {+Route::middleware('auth:api')->get(+ '/user', function (Request $request) {return $request->user();-});+}+);diff --git a/routes/breadcrumbs.php b/routes/breadcrumbs.phpindex a027851e90..e8237cd6e0 100644--- a/routes/breadcrumbs.php+++ b/routes/breadcrumbs.php@@ -22,7 +22,6 @@ declare(strict_types=1);use Carbon\Carbon;use DaveJamesMiller\Breadcrumbs\BreadcrumbsGenerator;-//use DaveJamesMiller\Breadcrumbs\Generator as BreadCrumbsGenerator;use FireflyIII\Exceptions\FireflyException;use FireflyIII\Models\Account;use FireflyIII\Models\Attachment;@@ -43,6 +42,8 @@ use FireflyIII\Models\TransactionType;use FireflyIII\User;use Illuminate\Support\Collection;+//use DaveJamesMiller\Breadcrumbs\Generator as BreadCrumbsGenerator;+// HOMEBreadcrumbs::register('home',@@ -599,7 +600,6 @@ Breadcrumbs::register();-// PREFERENCESBreadcrumbs::register('preferences.index',diff --git a/routes/channels.php b/routes/channels.phpindex 170859eb50..039d8376a3 100644--- a/routes/channels.php+++ b/routes/channels.php@@ -30,6 +30,8 @@|*/-Broadcast::channel('App.User.{id}', function ($user, $id) {- return (int) $user->id === (int) $id;-});+Broadcast::channel(+ 'App.User.{id}', function ($user, $id) {+ return (int)$user->id === (int)$id;+}+);diff --git a/routes/console.php b/routes/console.phpindex 44aba90be4..74c4090df1 100644--- a/routes/console.php+++ b/routes/console.php@@ -32,6 +32,8 @@ use Illuminate\Foundation\Inspiring;|*/-Artisan::command('inspire', function () {+Artisan::command(+ 'inspire', function () {$this->comment(Inspiring::quote());-})->describe('Display an inspiring quote');+}+)->describe('Display an inspiring quote');diff --git a/tests/Feature/Controllers/Admin/UpdateControllerTest.php b/tests/Feature/Controllers/Admin/UpdateControllerTest.phpindex 8a0c56771f..d10263ef26 100644--- a/tests/Feature/Controllers/Admin/UpdateControllerTest.php+++ b/tests/Feature/Controllers/Admin/UpdateControllerTest.php@@ -139,50 +139,50 @@ class UpdateControllerTest extends TestCase/*** @covers \FireflyIII\Http\Controllers\Admin\UpdateController::updateCheck*/- public function testUpdateCheckNewer()+ public function testUpdateCheckError(){$falseConfig = new Configuration;$falseConfig->data = false;FireflyConfig::shouldReceive('get')->withArgs(['is_demo_site', false])->once()->andReturn($falseConfig);- FireflyConfig::shouldReceive('set')->withArgs(['last_update_check', Mockery::any()])->once()->andReturn(new Configuration);$version = config('firefly.version') . '-alpha';$releases = [new Release(['id' => 'x', 'title' => $version, 'content' => '', 'updated' => new Carbon]),];$updater = $this->mock(UpdateRequest::class);- $updater->shouldReceive('call')->andReturnNull();+ $updater->shouldReceive('call')->andThrow(FireflyException::class, 'Something broke.');$updater->shouldReceive('getReleases')->andReturn($releases);// expect a new release (because of .1)$this->be($this->user());$response = $this->post(route('admin.update-check.manual'));$response->assertStatus(200);- $response->assertSee($version);- $response->assertSee('which is newer than the');+ $response->assertSee('An error occurred while checking');}/*** @covers \FireflyIII\Http\Controllers\Admin\UpdateController::updateCheck*/- public function testUpdateCheckError()+ public function testUpdateCheckNewer(){$falseConfig = new Configuration;$falseConfig->data = false;FireflyConfig::shouldReceive('get')->withArgs(['is_demo_site', false])->once()->andReturn($falseConfig);+ FireflyConfig::shouldReceive('set')->withArgs(['last_update_check', Mockery::any()])->once()->andReturn(new Configuration);$version = config('firefly.version') . '-alpha';$releases = [new Release(['id' => 'x', 'title' => $version, 'content' => '', 'updated' => new Carbon]),];$updater = $this->mock(UpdateRequest::class);- $updater->shouldReceive('call')->andThrow(FireflyException::class, 'Something broke.');+ $updater->shouldReceive('call')->andReturnNull();$updater->shouldReceive('getReleases')->andReturn($releases);// expect a new release (because of .1)$this->be($this->user());$response = $this->post(route('admin.update-check.manual'));$response->assertStatus(200);- $response->assertSee('An error occurred while checking');+ $response->assertSee($version);+ $response->assertSee('which is newer than the');}}diff --git a/tests/Feature/Controllers/Auth/TwoFactorControllerTest.php b/tests/Feature/Controllers/Auth/TwoFactorControllerTest.phpindex 6a1d994bde..16d83bddd8 100644--- a/tests/Feature/Controllers/Auth/TwoFactorControllerTest.php+++ b/tests/Feature/Controllers/Auth/TwoFactorControllerTest.php@@ -118,7 +118,7 @@ class TwoFactorControllerTest extends TestCase*/public function testPostIndex(){- $data = ['code' => '123456'];+ $data = ['code' => '123456'];Google2FA::shouldReceive('verifyKey')->andReturn(true)->once();$this->session(['remember_login' => true]);diff --git a/tests/Feature/Controllers/Import/StatusControllerTest.php b/tests/Feature/Controllers/Import/StatusControllerTest.phpindex 203f5e6cdc..45f5112e1d 100644--- a/tests/Feature/Controllers/Import/StatusControllerTest.php+++ b/tests/Feature/Controllers/Import/StatusControllerTest.php@@ -64,7 +64,7 @@ class StatusControllerTest extends TestCase*/public function testStatusFinished(){- $tag = $this->user()->tags()->first();+ $tag = $this->user()->tags()->first();$repository = $this->mock(TagRepositoryInterface::class);$repository->shouldReceive('find')->andReturn($tag);$this->be($this->user());diff --git a/tests/Feature/Controllers/PreferencesControllerTest.php b/tests/Feature/Controllers/PreferencesControllerTest.phpindex 45b9b94b23..749b162a4a 100644--- a/tests/Feature/Controllers/PreferencesControllerTest.php+++ b/tests/Feature/Controllers/PreferencesControllerTest.php@@ -27,10 +27,10 @@ use FireflyIII\Models\TransactionJournal;use FireflyIII\Repositories\Account\AccountRepositoryInterface;use FireflyIII\Repositories\Journal\JournalRepositoryInterface;use FireflyIII\Repositories\User\UserRepositoryInterface;+use Google2FA;use Illuminate\Support\Collection;use Preferences;use Tests\TestCase;-use Google2FA;/*** Class PreferencesControllerTestdiff --git a/tests/Feature/Controllers/Transaction/LinkControllerTest.php b/tests/Feature/Controllers/Transaction/LinkControllerTest.phpindex 310dbbe001..435da89040 100644--- a/tests/Feature/Controllers/Transaction/LinkControllerTest.php+++ b/tests/Feature/Controllers/Transaction/LinkControllerTest.php@@ -23,7 +23,6 @@ declare(strict_types=1);namespace Tests\Feature\Controllers\Transaction;-use FireflyIII\Models\LinkType;use FireflyIII\Models\TransactionJournal;use FireflyIII\Models\TransactionJournalLink;use FireflyIII\Repositories\Journal\JournalRepositoryInterface;@@ -67,7 +66,7 @@ class LinkControllerTest extends TestCase/*** @covers \FireflyIII\Http\Controllers\Transaction\LinkController::store*/- public function testStoreAlreadyLinked()+ public function testStore(){$repository = $this->mock(LinkTypeRepositoryInterface::class);$journalRepos = $this->mock(JournalRepositoryInterface::class);@@ -78,20 +77,21 @@ class LinkControllerTest extends TestCase$journalRepos->shouldReceive('first')->andReturn(new TransactionJournal);$journalRepos->shouldReceive('find')->andReturn(new TransactionJournal);- $repository->shouldReceive('findLink')->andReturn(true);+ $repository->shouldReceive('findLink')->andReturn(false);+ $repository->shouldReceive('storeLink')->andReturn(new TransactionJournalLink);$this->be($this->user());$response = $this->post(route('transactions.link.store', [1]), $data);$response->assertStatus(302);- $response->assertSessionHas('error');+ $response->assertSessionHas('success');$response->assertRedirect(route('transactions.show', [1]));}/*** @covers \FireflyIII\Http\Controllers\Transaction\LinkController::store*/- public function testStore()+ public function testStoreAlreadyLinked(){$repository = $this->mock(LinkTypeRepositoryInterface::class);$journalRepos = $this->mock(JournalRepositoryInterface::class);@@ -102,18 +102,16 @@ class LinkControllerTest extends TestCase$journalRepos->shouldReceive('first')->andReturn(new TransactionJournal);$journalRepos->shouldReceive('find')->andReturn(new TransactionJournal);- $repository->shouldReceive('findLink')->andReturn(false);- $repository->shouldReceive('storeLink')->andReturn(new TransactionJournalLink);+ $repository->shouldReceive('findLink')->andReturn(true);$this->be($this->user());$response = $this->post(route('transactions.link.store', [1]), $data);$response->assertStatus(302);- $response->assertSessionHas('success');+ $response->assertSessionHas('error');$response->assertRedirect(route('transactions.show', [1]));}-/*** @covers \FireflyIII\Http\Controllers\Transaction\LinkController::store*/@@ -136,7 +134,7 @@ class LinkControllerTest extends TestCase*/public function testSwitchLink(){- $repository = $this->mock(LinkTypeRepositoryInterface::class);+ $repository = $this->mock(LinkTypeRepositoryInterface::class);$repository->shouldReceive('switchLink')->andReturn(false);$this->be($this->user());$response = $this->get(route('transactions.link.switch', [1]));diff --git a/tests/Feature/Controllers/Transaction/SingleControllerTest.php b/tests/Feature/Controllers/Transaction/SingleControllerTest.phpindex 781c965ef3..4e04d6a0f8 100644--- a/tests/Feature/Controllers/Transaction/SingleControllerTest.php+++ b/tests/Feature/Controllers/Transaction/SingleControllerTest.php@@ -75,7 +75,7 @@ class SingleControllerTest extends TestCase*/public function testCreate(){- $accounts = $this->user()->accounts()->where('account_type_id',3)->get();+ $accounts = $this->user()->accounts()->where('account_type_id', 3)->get();Steam::shouldReceive('phpBytes')->andReturn(2048);$repository = $this->mock(AccountRepositoryInterface::class);$repository->shouldReceive('getActiveAccountsByType')->once()->withArgs([[AccountType::DEFAULT, AccountType::ASSET]])->andReturn($accounts);@@ -207,10 +207,10 @@ class SingleControllerTest extends TestCase* @covers \FireflyIII\Http\Controllers\Transaction\SingleController::edit* @covers \FireflyIII\Http\Controllers\Transaction\SingleController::groupedAccountList*/- public function testEditRedirect()+ public function testEditReconcile(){$this->be($this->user());- $withdrawal = TransactionJournal::where('transaction_type_id', 1)+ $withdrawal = TransactionJournal::where('transaction_type_id', 5)->whereNull('transaction_journals.deleted_at')->leftJoin('transactions', 'transactions.transaction_journal_id', '=', 'transaction_journals.id')->groupBy('transaction_journals.id')@@ -224,10 +224,10 @@ class SingleControllerTest extends TestCase* @covers \FireflyIII\Http\Controllers\Transaction\SingleController::edit* @covers \FireflyIII\Http\Controllers\Transaction\SingleController::groupedAccountList*/- public function testEditReconcile()+ public function testEditRedirect(){$this->be($this->user());- $withdrawal = TransactionJournal::where('transaction_type_id', 5)+ $withdrawal = TransactionJournal::where('transaction_type_id', 1)->whereNull('transaction_journals.deleted_at')->leftJoin('transactions', 'transactions.transaction_journal_id', '=', 'transaction_journals.id')->groupBy('transaction_journals.id')diff --git a/tests/Unit/Import/Converter/INGDebitCreditTest.php b/tests/Unit/Import/Converter/INGDebitCreditTest.phpindex d24e1da395..ba1b2e981b 100644--- a/tests/Unit/Import/Converter/INGDebitCreditTest.php+++ b/tests/Unit/Import/Converter/INGDebitCreditTest.php@@ -44,20 +44,20 @@ class INGDebitCreditTest extends TestCase/*** @covers \FireflyIII\Import\Converter\INGDebitCredit::convert()*/- public function testConvertBij()+ public function testConvertAnything(){$converter = new INGDebitCredit;- $result = $converter->convert('Bij');+ $result = $converter->convert('9083jkdkj');$this->assertEquals(1, $result);}/*** @covers \FireflyIII\Import\Converter\INGDebitCredit::convert()*/- public function testConvertAnything()+ public function testConvertBij(){$converter = new INGDebitCredit;- $result = $converter->convert('9083jkdkj');+ $result = $converter->convert('Bij');$this->assertEquals(1, $result);}}\ No newline at end of filediff --git a/tests/Unit/Middleware/AuthenticateTwoFactorTest.php b/tests/Unit/Middleware/AuthenticateTwoFactorTest.phpindex b93970bea8..d863fcb14c 100644--- a/tests/Unit/Middleware/AuthenticateTwoFactorTest.php+++ b/tests/Unit/Middleware/AuthenticateTwoFactorTest.php@@ -104,16 +104,16 @@ class AuthenticateTwoFactorTest extends TestCase}/**- * tests for user with 2FA but no secret. 2FA is not fired.+ * tests for user with 2FA and secret and cookie. Continue to page.** 2FA enabled: true- * 2FA secret : false+ * 2FA secret : 'abcde'* cookie : false*** @covers \FireflyIII\Http\Middleware\AuthenticateTwoFactor::handle*/- public function testMiddlewareTwoFANoSecret()+ public function testMiddlewareTwoFAAuthed(){$this->withoutExceptionHandling();$user = $this->user();@@ -125,26 +125,28 @@ class AuthenticateTwoFactorTest extends TestCase$preference->data = true;Preferences::shouldReceive('get')->withArgs(['twoFactorAuthEnabled', false])->once()->andReturn($preference);- // pref for no twoFactorAuthSecret- Preferences::shouldReceive('get')->withArgs(['twoFactorAuthSecret'])->once()->andReturn(null);+ // pref for twoFactorAuthSecret+ $secret = new Preference;+ $secret->data = 'SomeSecret';+ Preferences::shouldReceive('get')->withArgs(['twoFactorAuthSecret'])->once()->andReturn($secret);// no cookie- $cookie = [];+ $cookie = ['twoFactorAuthenticated' => 'true'];$response = $this->call('GET', '/_test/authenticate', [], $cookie);$this->assertEquals(Response::HTTP_OK, $response->getStatusCode());}/**- * tests for user with 2FA and secret. 2FA is checked+ * tests for user with 2FA but no secret. 2FA is not fired.** 2FA enabled: true- * 2FA secret : 'abcde'+ * 2FA secret : false* cookie : false*** @covers \FireflyIII\Http\Middleware\AuthenticateTwoFactor::handle*/- public function testMiddlewareTwoFASecret()+ public function testMiddlewareTwoFANoSecret(){$this->withoutExceptionHandling();$user = $this->user();@@ -156,20 +158,17 @@ class AuthenticateTwoFactorTest extends TestCase$preference->data = true;Preferences::shouldReceive('get')->withArgs(['twoFactorAuthEnabled', false])->once()->andReturn($preference);- // pref for twoFactorAuthSecret- $secret = new Preference;- $secret->data = 'SomeSecret';- Preferences::shouldReceive('get')->withArgs(['twoFactorAuthSecret'])->once()->andReturn($secret);+ // pref for no twoFactorAuthSecret+ Preferences::shouldReceive('get')->withArgs(['twoFactorAuthSecret'])->once()->andReturn(null);// no cookie$cookie = [];$response = $this->call('GET', '/_test/authenticate', [], $cookie);- $this->assertEquals(Response::HTTP_FOUND, $response->getStatusCode());- $response->assertRedirect(route('two-factor.index'));+ $this->assertEquals(Response::HTTP_OK, $response->getStatusCode());}/**- * tests for user with 2FA and secret and cookie. Continue to page.+ * tests for user with 2FA and secret. 2FA is checked** 2FA enabled: true* 2FA secret : 'abcde'@@ -178,7 +177,7 @@ class AuthenticateTwoFactorTest extends TestCase** @covers \FireflyIII\Http\Middleware\AuthenticateTwoFactor::handle*/- public function testMiddlewareTwoFAAuthed()+ public function testMiddlewareTwoFASecret(){$this->withoutExceptionHandling();$user = $this->user();@@ -196,12 +195,12 @@ class AuthenticateTwoFactorTest extends TestCasePreferences::shouldReceive('get')->withArgs(['twoFactorAuthSecret'])->once()->andReturn($secret);// no cookie- $cookie = ['twoFactorAuthenticated' => 'true'];+ $cookie = [];$response = $this->call('GET', '/_test/authenticate', [], $cookie);- $this->assertEquals(Response::HTTP_OK, $response->getStatusCode());+ $this->assertEquals(Response::HTTP_FOUND, $response->getStatusCode());+ $response->assertRedirect(route('two-factor.index'));}-/*** Set up test*/diff --git a/tests/Unit/Middleware/IsAdminTest.php b/tests/Unit/Middleware/IsAdminTest.phpindex 3d65c0481a..890ad935d8 100644--- a/tests/Unit/Middleware/IsAdminTest.php+++ b/tests/Unit/Middleware/IsAdminTest.php@@ -58,24 +58,24 @@ class IsAdminTest extends TestCase/*** @covers \FireflyIII\Http\Middleware\IsAdmin::handle*/- public function testMiddlewareOwner()+ public function testMiddlewareNotOwner(){- $this->be($this->user());$this->withoutExceptionHandling();+ $this->be($this->emptyUser());$response = $this->get('/_test/is-admin');- $this->assertEquals(Response::HTTP_OK, $response->getStatusCode());+ $this->assertEquals(Response::HTTP_FOUND, $response->getStatusCode());+ $response->assertRedirect(route('home'));}/*** @covers \FireflyIII\Http\Middleware\IsAdmin::handle*/- public function testMiddlewareNotOwner()+ public function testMiddlewareOwner(){+ $this->be($this->user());$this->withoutExceptionHandling();- $this->be($this->emptyUser());$response = $this->get('/_test/is-admin');- $this->assertEquals(Response::HTTP_FOUND, $response->getStatusCode());- $response->assertRedirect(route('home'));+ $this->assertEquals(Response::HTTP_OK, $response->getStatusCode());}/**diff --git a/tests/Unit/Middleware/IsDemoUserTest.php b/tests/Unit/Middleware/IsDemoUserTest.phpindex 839904ff23..5c563c9fbc 100644--- a/tests/Unit/Middleware/IsDemoUserTest.php+++ b/tests/Unit/Middleware/IsDemoUserTest.php@@ -33,16 +33,6 @@ use Tests\TestCase;*/class IsDemoUserTest extends TestCase{- /**- * @covers \FireflyIII\Http\Middleware\IsDemoUser::handle- */- public function testMiddlewareNotAuthenticated()- {- $this->withoutExceptionHandling();- $response = $this->get('/_test/is-demo');- $this->assertEquals(Response::HTTP_OK, $response->getStatusCode());- }-/*** @covers \FireflyIII\Http\Middleware\IsDemoUser::handle*/@@ -68,6 +58,16 @@ class IsDemoUserTest extends TestCase$response->assertRedirect(route('index'));}+ /**+ * @covers \FireflyIII\Http\Middleware\IsDemoUser::handle+ */+ public function testMiddlewareNotAuthenticated()+ {+ $this->withoutExceptionHandling();+ $response = $this->get('/_test/is-demo');+ $this->assertEquals(Response::HTTP_OK, $response->getStatusCode());+ }+/*** Set up test*/diff --git a/tests/Unit/Middleware/IsSandstormUserTest.php b/tests/Unit/Middleware/IsSandstormUserTest.phpindex c22bf2795b..4d13129d8b 100644--- a/tests/Unit/Middleware/IsSandstormUserTest.php+++ b/tests/Unit/Middleware/IsSandstormUserTest.php@@ -23,7 +23,6 @@ declare(strict_types=1);namespace Tests\Unit\Helpers;-use FireflyIII\Http\Middleware\IsDemoUser;use FireflyIII\Http\Middleware\IsSandStormUser;use Route;use Symfony\Component\HttpFoundation\Response;diff --git a/tests/Unit/Middleware/SandstormTest.php b/tests/Unit/Middleware/SandstormTest.phpindex 878aaca991..08ad7363ce 100644--- a/tests/Unit/Middleware/SandstormTest.php+++ b/tests/Unit/Middleware/SandstormTest.php@@ -54,13 +54,11 @@ class SandstormTest extends TestCase/*** @covers \FireflyIII\Http\Middleware\Sandstorm::handle*/- public function testMiddlewareAnonUser()+ public function testMiddlewareAnonLoggedIn(){putenv('SANDSTORM=1');- $repository = $this->mock(UserRepositoryInterface::class);- $repository->shouldReceive('count')->once()->andReturn(1);-+ $this->be($this->user());$response = $this->get('/_test/sandstorm');$this->assertEquals(Response::HTTP_OK, $response->getStatusCode());$response->assertSee('sandstorm-anon: true');@@ -71,14 +69,16 @@ class SandstormTest extends TestCase/*** @covers \FireflyIII\Http\Middleware\Sandstorm::handle*/- public function testMiddlewareLoggedIn()+ public function testMiddlewareAnonUser(){putenv('SANDSTORM=1');- $this->be($this->user());- $response = $this->get('/_test/sandstorm', ['X-Sandstorm-User-Id' => 'abcd']);+ $repository = $this->mock(UserRepositoryInterface::class);+ $repository->shouldReceive('count')->once()->andReturn(1);++ $response = $this->get('/_test/sandstorm');$this->assertEquals(Response::HTTP_OK, $response->getStatusCode());- $response->assertSee('sandstorm-anon: false');+ $response->assertSee('sandstorm-anon: true');putenv('SANDSTORM=0');}@@ -86,14 +86,14 @@ class SandstormTest extends TestCase/*** @covers \FireflyIII\Http\Middleware\Sandstorm::handle*/- public function testMiddlewareAnonLoggedIn()+ public function testMiddlewareLoggedIn(){putenv('SANDSTORM=1');$this->be($this->user());- $response = $this->get('/_test/sandstorm');+ $response = $this->get('/_test/sandstorm', ['X-Sandstorm-User-Id' => 'abcd']);$this->assertEquals(Response::HTTP_OK, $response->getStatusCode());- $response->assertSee('sandstorm-anon: true');+ $response->assertSee('sandstorm-anon: false');putenv('SANDSTORM=0');}