diff --git a/.env.example b/.env.example index 337ec714db..20f71dc696 100755 --- a/.env.example +++ b/.env.example @@ -1,7 +1,7 @@ APP_ENV=production APP_DEBUG=false APP_KEY=SomeRandomStringOf32CharsExactly - +LOG_LEVEL=warning DB_CONNECTION=mysql DB_HOST=localhost diff --git a/.env.testing b/.env.testing index a7c8505a17..852745ab42 100755 --- a/.env.testing +++ b/.env.testing @@ -1,7 +1,7 @@ APP_ENV=testing APP_DEBUG=true APP_KEY=SomeRandomStringOf32CharsExactly - +LOG_LEVEL=debug DB_CONNECTION=sqlite DB_HOST=localhost diff --git a/.travis.yml b/.travis.yml index 61763a7648..f48b4f9dd9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,6 +4,7 @@ php: - 7 install: + - cp _development/phpunit.xml ./phpunit.xml - phpenv config-rm xdebug.ini - composer selfupdate - rm composer.lock diff --git a/CHANGELOG.md b/CHANGELOG.md index 90d89feb66..a54b72e062 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,20 @@ This project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] - No unreleased changes yet. +## [3.8.3] - 2016-04-17 +### Added +- New audit report to see what happened. + +### Changed +- New Chart JS release used. +- Help function is more reliable. + +### Fixed +- Expected bill amount is now correct. +- Upgrade will now invalidate cache. +- Search was broken. +- Queries run better + ## [3.8.2] - 2016-04-03 ### Added - Small user administration at /admin. diff --git a/.coveralls.yml b/_development/.coveralls.yml similarity index 100% rename from .coveralls.yml rename to _development/.coveralls.yml diff --git a/.csslintrc b/_development/.csslintrc similarity index 100% rename from .csslintrc rename to _development/.csslintrc diff --git a/.eslintignore b/_development/.eslintignore similarity index 100% rename from .eslintignore rename to _development/.eslintignore diff --git a/.eslintrc b/_development/.eslintrc similarity index 100% rename from .eslintrc rename to _development/.eslintrc diff --git a/.jshintrc b/_development/.jshintrc similarity index 100% rename from .jshintrc rename to _development/.jshintrc diff --git a/cover.sh b/_development/cover.sh similarity index 100% rename from cover.sh rename to _development/cover.sh diff --git a/favicon.pxm b/_development/favicon.pxm similarity index 100% rename from favicon.pxm rename to _development/favicon.pxm diff --git a/gulpfile.js b/_development/gulpfile.js similarity index 100% rename from gulpfile.js rename to _development/gulpfile.js diff --git a/phpspec.yml b/_development/phpspec.yml similarity index 100% rename from phpspec.yml rename to _development/phpspec.yml diff --git a/phpunit.cover.xml b/_development/phpunit.cover.xml similarity index 100% rename from phpunit.cover.xml rename to _development/phpunit.cover.xml diff --git a/phpunit.default.xml b/_development/phpunit.default.xml similarity index 100% rename from phpunit.default.xml rename to _development/phpunit.default.xml diff --git a/phpunit.xml b/_development/phpunit.xml similarity index 100% rename from phpunit.xml rename to _development/phpunit.xml diff --git a/pu.sh b/_development/pu.sh similarity index 100% rename from pu.sh rename to _development/pu.sh diff --git a/app/Bootstrap/ConfigureLogging.php b/app/Bootstrap/ConfigureLogging.php new file mode 100644 index 0000000000..23dc0980b8 --- /dev/null +++ b/app/Bootstrap/ConfigureLogging.php @@ -0,0 +1,43 @@ +useFiles($app->storagePath().'/logs/firefly-iii.log'); + } + + /** + * @param Application $app + * @param Writer $log + */ + protected function configureDailyHandler(Application $app, Writer $log) + { + $log->useDailyFiles( + $app->storagePath().'/logs/firefly-iii.log', + $app->make('config')->get('app.log_max_files', 5) + ); + } +} diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index d077819913..4540fcc9d8 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -22,6 +22,25 @@ use Illuminate\Foundation\Console\Kernel as ConsoleKernel; */ class Kernel extends ConsoleKernel { + + /** + * The bootstrap classes for the application. + * + * This needs to be for with the next upgrade. + * + * @var array + */ + protected $bootstrappers = [ + 'Illuminate\Foundation\Bootstrap\DetectEnvironment', + 'Illuminate\Foundation\Bootstrap\LoadConfiguration', + 'FireflyIII\Bootstrap\ConfigureLogging', + 'Illuminate\Foundation\Bootstrap\HandleExceptions', + 'Illuminate\Foundation\Bootstrap\RegisterFacades', + 'Illuminate\Foundation\Bootstrap\SetRequestForConsole', + 'Illuminate\Foundation\Bootstrap\RegisterProviders', + 'Illuminate\Foundation\Bootstrap\BootProviders', + ]; + /** * The Artisan commands provided by your application. * diff --git a/app/Events/TransactionJournalStored.php b/app/Events/TransactionJournalStored.php index a9b40ee71d..82653056a9 100644 --- a/app/Events/TransactionJournalStored.php +++ b/app/Events/TransactionJournalStored.php @@ -12,11 +12,11 @@ namespace FireflyIII\Events; use FireflyIII\Models\TransactionJournal; use Illuminate\Queue\SerializesModels; +use Log; /** * Class TransactionJournalStored * - * @codeCoverageIgnore * @package FireflyIII\Events */ class TransactionJournalStored extends Event @@ -35,6 +35,7 @@ class TransactionJournalStored extends Event */ public function __construct(TransactionJournal $journal, int $piggyBankId) { + Log::debug('Created new TransactionJournalStored.'); // $this->journal = $journal; $this->piggyBankId = $piggyBankId; diff --git a/app/Events/TransactionJournalUpdated.php b/app/Events/TransactionJournalUpdated.php index edb9a82a12..e6c11d44c1 100644 --- a/app/Events/TransactionJournalUpdated.php +++ b/app/Events/TransactionJournalUpdated.php @@ -5,11 +5,11 @@ namespace FireflyIII\Events; use FireflyIII\Models\TransactionJournal; use Illuminate\Queue\SerializesModels; +use Log; /** * Class TransactionJournalUpdated * - * @codeCoverageIgnore * @package FireflyIII\Events */ class TransactionJournalUpdated extends Event @@ -26,6 +26,7 @@ class TransactionJournalUpdated extends Event */ public function __construct(TransactionJournal $journal) { + Log::debug('Created new TransactionJournalUpdated'); // $this->journal = $journal; } diff --git a/app/Exceptions/FireflyException.php b/app/Exceptions/FireflyException.php index 88714ef34e..c931fa7e3a 100644 --- a/app/Exceptions/FireflyException.php +++ b/app/Exceptions/FireflyException.php @@ -6,7 +6,6 @@ namespace FireflyIII\Exceptions; /** * Class FireflyException * - * @codeCoverageIgnore * @package FireflyIII\Exceptions */ class FireflyException extends \Exception diff --git a/app/Exceptions/NotImplementedException.php b/app/Exceptions/NotImplementedException.php index 47c43b9e68..f5960285b8 100644 --- a/app/Exceptions/NotImplementedException.php +++ b/app/Exceptions/NotImplementedException.php @@ -6,7 +6,6 @@ namespace FireflyIII\Exceptions; /** * Class NotImplementedException * - * @codeCoverageIgnore * @package FireflyIII\Exceptions */ class NotImplementedException extends \Exception diff --git a/app/Exceptions/ValidationException.php b/app/Exceptions/ValidationException.php index 5da65aab66..a1b2ce127c 100644 --- a/app/Exceptions/ValidationException.php +++ b/app/Exceptions/ValidationException.php @@ -5,7 +5,6 @@ namespace FireflyIII\Exceptions; /** * Class ValidationExceptions * - * @codeCoverageIgnore * @package FireflyIII\Exception */ class ValidationException extends \Exception diff --git a/app/Export/Collector/AttachmentCollector.php b/app/Export/Collector/AttachmentCollector.php index 9eae15dc6e..ee361b604a 100644 --- a/app/Export/Collector/AttachmentCollector.php +++ b/app/Export/Collector/AttachmentCollector.php @@ -53,9 +53,9 @@ class AttachmentCollector extends BasicCollector implements CollectorInterface } /** - * + * @return bool */ - public function run() + public function run(): bool { // grab all the users attachments: $attachments = $this->getAttachments(); @@ -70,6 +70,7 @@ class AttachmentCollector extends BasicCollector implements CollectorInterface $this->exportDisk->put($file, $this->explanationString); Log::debug('Also put explanation file "' . $file . '" in the zip.'); $this->getFiles()->push($file); + return true; } /** diff --git a/app/Export/Collector/BasicCollector.php b/app/Export/Collector/BasicCollector.php index ba597ebe40..fb894e0deb 100644 --- a/app/Export/Collector/BasicCollector.php +++ b/app/Export/Collector/BasicCollector.php @@ -40,7 +40,7 @@ class BasicCollector /** * @return Collection */ - public function getFiles() + public function getFiles(): Collection { return $this->files; } diff --git a/app/Export/Collector/CollectorInterface.php b/app/Export/Collector/CollectorInterface.php index e55d316733..303ffadfab 100644 --- a/app/Export/Collector/CollectorInterface.php +++ b/app/Export/Collector/CollectorInterface.php @@ -22,12 +22,12 @@ interface CollectorInterface /** * @return Collection */ - public function getFiles(); + public function getFiles(): Collection; /** * @return bool */ - public function run(); + public function run(): bool; /** * @param Collection $files diff --git a/app/Export/Collector/UploadCollector.php b/app/Export/Collector/UploadCollector.php index 25bfdf89b0..dc3a741fed 100644 --- a/app/Export/Collector/UploadCollector.php +++ b/app/Export/Collector/UploadCollector.php @@ -47,9 +47,9 @@ class UploadCollector extends BasicCollector implements CollectorInterface } /** - * + * @return bool */ - public function run() + public function run(): bool { // grab upload directory. $files = $this->uploadDisk->files(); @@ -58,6 +58,7 @@ class UploadCollector extends BasicCollector implements CollectorInterface foreach ($files as $entry) { $this->processOldUpload($entry); } + return true; } /** diff --git a/app/Export/ConfigurationFile.php b/app/Export/ConfigurationFile.php index f11fa68912..706b2550d7 100644 --- a/app/Export/ConfigurationFile.php +++ b/app/Export/ConfigurationFile.php @@ -38,9 +38,9 @@ class ConfigurationFile } /** - * @return bool + * @return string */ - public function make() + public function make(): string { $fields = array_keys(get_class_vars(Entry::class)); $types = Entry::getTypes(); diff --git a/app/Export/Entry.php b/app/Export/Entry.php index 59117e9bdb..4d6ea90311 100644 --- a/app/Export/Entry.php +++ b/app/Export/Entry.php @@ -171,7 +171,7 @@ class Entry /** * @return int */ - public function getBillId() + public function getBillId(): int { return $this->billId; } @@ -179,7 +179,7 @@ class Entry /** * @param int $billId */ - public function setBillId($billId) + public function setBillId(int $billId) { $this->billId = $billId; } @@ -187,7 +187,7 @@ class Entry /** * @return string */ - public function getBillName() + public function getBillName(): string { return $this->billName; } @@ -195,7 +195,7 @@ class Entry /** * @param string $billName */ - public function setBillName($billName) + public function setBillName(string $billName) { $this->billName = $billName; } @@ -203,7 +203,7 @@ class Entry /** * @return int */ - public function getBudgetId() + public function getBudgetId(): int { return $this->budgetId; } @@ -211,7 +211,7 @@ class Entry /** * @param int $budgetId */ - public function setBudgetId($budgetId) + public function setBudgetId(int $budgetId) { $this->budgetId = $budgetId; } @@ -219,7 +219,7 @@ class Entry /** * @return string */ - public function getBudgetName() + public function getBudgetName(): string { return $this->budgetName; } @@ -227,7 +227,7 @@ class Entry /** * @param string $budgetName */ - public function setBudgetName($budgetName) + public function setBudgetName(string $budgetName) { $this->budgetName = $budgetName; } @@ -235,7 +235,7 @@ class Entry /** * @return int */ - public function getCategoryId() + public function getCategoryId(): int { return $this->categoryId; } @@ -243,7 +243,7 @@ class Entry /** * @param int $categoryId */ - public function setCategoryId($categoryId) + public function setCategoryId(int $categoryId) { $this->categoryId = $categoryId; } @@ -251,7 +251,7 @@ class Entry /** * @return string */ - public function getCategoryName() + public function getCategoryName(): string { return $this->categoryName; } @@ -259,7 +259,7 @@ class Entry /** * @param string $categoryName */ - public function setCategoryName($categoryName) + public function setCategoryName(string $categoryName) { $this->categoryName = $categoryName; } @@ -267,7 +267,7 @@ class Entry /** * @return string */ - public function getDate() + public function getDate(): string { return $this->date; } @@ -283,7 +283,7 @@ class Entry /** * @return string */ - public function getDescription() + public function getDescription(): string { return $this->description; } @@ -299,7 +299,7 @@ class Entry /** * @return string */ - public function getFromAccountIban() + public function getFromAccountIban(): string { return $this->fromAccountIban; } @@ -307,7 +307,7 @@ class Entry /** * @param string $fromAccountIban */ - public function setFromAccountIban($fromAccountIban) + public function setFromAccountIban(string $fromAccountIban) { $this->fromAccountIban = $fromAccountIban; } @@ -315,7 +315,7 @@ class Entry /** * @return int */ - public function getFromAccountId() + public function getFromAccountId():int { return $this->fromAccountId; } @@ -323,7 +323,7 @@ class Entry /** * @param int $fromAccountId */ - public function setFromAccountId($fromAccountId) + public function setFromAccountId(int $fromAccountId) { $this->fromAccountId = $fromAccountId; } @@ -331,7 +331,7 @@ class Entry /** * @return string */ - public function getFromAccountName() + public function getFromAccountName(): string { return $this->fromAccountName; } @@ -339,23 +339,23 @@ class Entry /** * @param string $fromAccountName */ - public function setFromAccountName($fromAccountName) + public function setFromAccountName(string $fromAccountName) { $this->fromAccountName = $fromAccountName; } /** - * @return mixed + * @return string */ - public function getFromAccountNumber() + public function getFromAccountNumber(): string { return $this->fromAccountNumber; } /** - * @param mixed $fromAccountNumber + * @param string $fromAccountNumber */ - public function setFromAccountNumber($fromAccountNumber) + public function setFromAccountNumber(string $fromAccountNumber) { $this->fromAccountNumber = $fromAccountNumber; } @@ -363,7 +363,7 @@ class Entry /** * @return string */ - public function getFromAccountType() + public function getFromAccountType(): string { return $this->fromAccountType; } @@ -371,7 +371,7 @@ class Entry /** * @param string $fromAccountType */ - public function setFromAccountType($fromAccountType) + public function setFromAccountType(string $fromAccountType) { $this->fromAccountType = $fromAccountType; } @@ -379,7 +379,7 @@ class Entry /** * @return string */ - public function getToAccountIban() + public function getToAccountIban(): string { return $this->toAccountIban; } @@ -387,7 +387,7 @@ class Entry /** * @param string $toAccountIban */ - public function setToAccountIban($toAccountIban) + public function setToAccountIban(string $toAccountIban) { $this->toAccountIban = $toAccountIban; } @@ -395,7 +395,7 @@ class Entry /** * @return int */ - public function getToAccountId() + public function getToAccountId(): int { return $this->toAccountId; } @@ -403,7 +403,7 @@ class Entry /** * @param int $toAccountId */ - public function setToAccountId($toAccountId) + public function setToAccountId(int $toAccountId) { $this->toAccountId = $toAccountId; } @@ -411,7 +411,7 @@ class Entry /** * @return string */ - public function getToAccountName() + public function getToAccountName(): string { return $this->toAccountName; } @@ -419,23 +419,23 @@ class Entry /** * @param string $toAccountName */ - public function setToAccountName($toAccountName) + public function setToAccountName(string $toAccountName) { $this->toAccountName = $toAccountName; } /** - * @return mixed + * @return string */ - public function getToAccountNumber() + public function getToAccountNumber(): string { return $this->toAccountNumber; } /** - * @param mixed $toAccountNumber + * @param string $toAccountNumber */ - public function setToAccountNumber($toAccountNumber) + public function setToAccountNumber(string $toAccountNumber) { $this->toAccountNumber = $toAccountNumber; } @@ -443,7 +443,7 @@ class Entry /** * @return string */ - public function getToAccountType() + public function getToAccountType(): string { return $this->toAccountType; } @@ -451,7 +451,7 @@ class Entry /** * @param string $toAccountType */ - public function setToAccountType($toAccountType) + public function setToAccountType(string $toAccountType) { $this->toAccountType = $toAccountType; } diff --git a/app/Export/Exporter/BasicExporter.php b/app/Export/Exporter/BasicExporter.php index db686ea383..1c847a5ebe 100644 --- a/app/Export/Exporter/BasicExporter.php +++ b/app/Export/Exporter/BasicExporter.php @@ -39,7 +39,7 @@ class BasicExporter /** * @return Collection */ - public function getEntries() + public function getEntries(): Collection { return $this->entries; } diff --git a/app/Export/Exporter/CsvExporter.php b/app/Export/Exporter/CsvExporter.php index d646a36df9..6457b8609b 100644 --- a/app/Export/Exporter/CsvExporter.php +++ b/app/Export/Exporter/CsvExporter.php @@ -39,15 +39,15 @@ class CsvExporter extends BasicExporter implements ExporterInterface /** * @return string */ - public function getFileName() + public function getFileName(): string { return $this->fileName; } /** - * + * @return bool */ - public function run() + public function run(): bool { // create temporary file: $this->tempFile(); @@ -72,6 +72,7 @@ class CsvExporter extends BasicExporter implements ExporterInterface } $writer->insertAll($rows); + return true; } private function tempFile() diff --git a/app/Export/Exporter/ExporterInterface.php b/app/Export/Exporter/ExporterInterface.php index 67097c36df..57d1a174ad 100644 --- a/app/Export/Exporter/ExporterInterface.php +++ b/app/Export/Exporter/ExporterInterface.php @@ -22,17 +22,17 @@ interface ExporterInterface /** * @return Collection */ - public function getEntries(); + public function getEntries(): Collection; /** * @return string */ - public function getFileName(); + public function getFileName(): string; /** - * + * @return bool */ - public function run(); + public function run(): bool; /** * @param Collection $entries diff --git a/app/Export/Processor.php b/app/Export/Processor.php index 6eea9d1910..a5e8b1549b 100644 --- a/app/Export/Processor.php +++ b/app/Export/Processor.php @@ -73,19 +73,20 @@ class Processor } /** - * + * @return bool */ - public function collectAttachments() + public function collectAttachments(): bool { $attachmentCollector = app('FireflyIII\Export\Collector\AttachmentCollector', [$this->job]); $attachmentCollector->run(); $this->files = $this->files->merge($attachmentCollector->getFiles()); + return true; } /** - * + * @return bool */ - public function collectJournals() + public function collectJournals(): bool { $args = [$this->accounts, Auth::user(), $this->settings['startDate'], $this->settings['endDate']]; $journalCollector = app('FireflyIII\Repositories\Journal\JournalCollector', $args); @@ -97,20 +98,25 @@ class Processor $this->settings['endDate']->format('Y-m-d') . ').' ); + return true; } - public function collectOldUploads() + /** + * @return bool + */ + public function collectOldUploads(): bool { $uploadCollector = app('FireflyIII\Export\Collector\UploadCollector', [$this->job]); $uploadCollector->run(); $this->files = $this->files->merge($uploadCollector->getFiles()); + return true; } /** - * + * @return bool */ - public function convertJournals() + public function convertJournals(): bool { $count = 0; /** @var TransactionJournal $journal */ @@ -119,15 +125,24 @@ class Processor $count++; } Log::debug('Converted ' . $count . ' journals to "Entry" objects.'); + return true; } - public function createConfigFile() + /** + * @return bool + */ + public function createConfigFile(): bool { $this->configurationMaker = app('FireflyIII\Export\ConfigurationFile', [$this->job]); $this->files->push($this->configurationMaker->make()); + return true; } - public function createZipFile() + /** + * @return bool + * @throws FireflyException + */ + public function createZipFile(): bool { $zip = new ZipArchive; $file = $this->job->key . '.zip'; @@ -156,12 +171,13 @@ class Processor $disk->delete($file); } Log::debug('Done!'); + return true; } /** - * + * @return bool */ - public function exportJournals() + public function exportJournals(): bool { $exporterClass = Config::get('firefly.export_formats.' . $this->exportFormat); $exporter = app($exporterClass, [$this->job]); @@ -170,12 +186,13 @@ class Processor $exporter->run(); $this->files->push($exporter->getFileName()); Log::debug('Added "' . $exporter->getFileName() . '" to the list of files to include in the zip.'); + return true; } /** * @return Collection */ - public function getFiles() + public function getFiles(): Collection { return $this->files; } diff --git a/app/Generator/Chart/Bill/ChartJsBillChartGenerator.php b/app/Generator/Chart/Bill/ChartJsBillChartGenerator.php index b3ee4fed05..30af6845e1 100644 --- a/app/Generator/Chart/Bill/ChartJsBillChartGenerator.php +++ b/app/Generator/Chart/Bill/ChartJsBillChartGenerator.php @@ -31,18 +31,15 @@ class ChartJsBillChartGenerator implements BillChartGeneratorInterface public function frontpage(string $paid, string $unpaid): array { $data = [ - [ - 'value' => round($unpaid, 2), - 'color' => 'rgba(53, 124, 165,0.7)', - 'highlight' => 'rgba(53, 124, 165,0.9)', - 'label' => trans('firefly.unpaid'), - ], - [ - 'value' => round(bcmul($paid, '-1'), 2), // paid is negative, must be positive. - 'color' => 'rgba(0, 141, 76, 0.7)', - 'highlight' => 'rgba(0, 141, 76, 0.9)', - 'label' => trans('firefly.paid'), + 'datasets' => [ + [ + 'data' => [round($unpaid, 2), round(bcmul($paid, '-1'), 2)], + 'backgroundColor' => ['rgba(53, 124, 165,0.7)', 'rgba(0, 141, 76, 0.7)',], + ], + ], + 'labels' => [strval(trans('firefly.unpaid')), strval(trans('firefly.paid'))], + ]; return $data; @@ -77,14 +74,17 @@ class ChartJsBillChartGenerator implements BillChartGeneratorInterface } $data['datasets'][] = [ + 'type' => 'bar', 'label' => trans('firefly.minAmount'), 'data' => $minAmount, ]; $data['datasets'][] = [ + 'type' => 'line', 'label' => trans('firefly.billEntry'), 'data' => $actualAmount, ]; $data['datasets'][] = [ + 'type' => 'bar', 'label' => trans('firefly.maxAmount'), 'data' => $maxAmount, ]; diff --git a/app/Generator/Chart/Budget/ChartJsBudgetChartGenerator.php b/app/Generator/Chart/Budget/ChartJsBudgetChartGenerator.php index f0f3cce9a5..3cdd335b31 100644 --- a/app/Generator/Chart/Budget/ChartJsBudgetChartGenerator.php +++ b/app/Generator/Chart/Budget/ChartJsBudgetChartGenerator.php @@ -50,7 +50,6 @@ class ChartJsBudgetChartGenerator implements BudgetChartGeneratorInterface } /** - * @codeCoverageIgnore * * @param Collection $entries * diff --git a/app/Generator/Chart/Category/CategoryChartGeneratorInterface.php b/app/Generator/Chart/Category/CategoryChartGeneratorInterface.php index ce02b93031..3533eefec3 100644 --- a/app/Generator/Chart/Category/CategoryChartGeneratorInterface.php +++ b/app/Generator/Chart/Category/CategoryChartGeneratorInterface.php @@ -25,7 +25,7 @@ interface CategoryChartGeneratorInterface * * @return array */ - public function all(Collection $entries); + public function all(Collection $entries): array; /** * @param Collection $categories diff --git a/app/Generator/Chart/Category/ChartJsCategoryChartGenerator.php b/app/Generator/Chart/Category/ChartJsCategoryChartGenerator.php index f2a2893cf7..e87a4543be 100644 --- a/app/Generator/Chart/Category/ChartJsCategoryChartGenerator.php +++ b/app/Generator/Chart/Category/ChartJsCategoryChartGenerator.php @@ -148,7 +148,6 @@ class ChartJsCategoryChartGenerator implements CategoryChartGeneratorInterface } /** - * @codeCoverageIgnore * * @param Collection $entries * diff --git a/app/Generator/Chart/Report/ChartJsReportChartGenerator.php b/app/Generator/Chart/Report/ChartJsReportChartGenerator.php index 43a2a73b51..df87ad0196 100644 --- a/app/Generator/Chart/Report/ChartJsReportChartGenerator.php +++ b/app/Generator/Chart/Report/ChartJsReportChartGenerator.php @@ -89,7 +89,7 @@ class ChartJsReportChartGenerator implements ReportChartGeneratorInterface 'labels' => [], 'datasets' => [ [ - 'label' => trans('firefly.net-worth'), + 'label' => trans('firefly.net_worth'), 'data' => [], ], ], diff --git a/app/Handlers/Events/FireRulesForStore.php b/app/Handlers/Events/FireRulesForStore.php index 1d33736afc..05ab7006d8 100644 --- a/app/Handlers/Events/FireRulesForStore.php +++ b/app/Handlers/Events/FireRulesForStore.php @@ -36,6 +36,7 @@ class FireRulesForStore */ public function handle(TransactionJournalStored $event): bool { + Log::debug('Now running FireRulesForStore because TransactionJournalStored fired.'); // get all the user's rule groups, with the rules, order by 'order'. /** @var User $user */ $user = Auth::user(); diff --git a/app/Handlers/Events/FireRulesForUpdate.php b/app/Handlers/Events/FireRulesForUpdate.php index 27aa80c39f..ae1e187d67 100644 --- a/app/Handlers/Events/FireRulesForUpdate.php +++ b/app/Handlers/Events/FireRulesForUpdate.php @@ -34,6 +34,7 @@ class FireRulesForUpdate */ public function handle(TransactionJournalUpdated $event): bool { + Log::debug('Now running FireRulesForUpdate because TransactionJournalUpdated fired.'); // get all the user's rule groups, with the rules, order by 'order'. /** @var User $user */ $user = Auth::user(); diff --git a/app/Handlers/Events/ScanForBillsAfterStore.php b/app/Handlers/Events/ScanForBillsAfterStore.php index ae477ed638..584e85160b 100644 --- a/app/Handlers/Events/ScanForBillsAfterStore.php +++ b/app/Handlers/Events/ScanForBillsAfterStore.php @@ -16,7 +16,6 @@ use FireflyIII\Support\Events\BillScanner; /** * Class RescanJournal * - * @codeCoverageIgnore * @package FireflyIII\Handlers\Events */ class ScanForBillsAfterStore diff --git a/app/Handlers/Events/ScanForBillsAfterUpdate.php b/app/Handlers/Events/ScanForBillsAfterUpdate.php index 2664cebeee..2f867e832b 100644 --- a/app/Handlers/Events/ScanForBillsAfterUpdate.php +++ b/app/Handlers/Events/ScanForBillsAfterUpdate.php @@ -16,7 +16,6 @@ use FireflyIII\Support\Events\BillScanner; /** * Class RescanJournal * - * @codeCoverageIgnore * @package FireflyIII\Handlers\Events */ class ScanForBillsAfterUpdate diff --git a/app/Handlers/Events/SendRegistrationMail.php b/app/Handlers/Events/SendRegistrationMail.php index 92b600acf6..04069d8cf6 100644 --- a/app/Handlers/Events/SendRegistrationMail.php +++ b/app/Handlers/Events/SendRegistrationMail.php @@ -38,13 +38,13 @@ class SendRegistrationMail * * @param UserRegistration $event * - * @return void + * @return bool */ - public function handle(UserRegistration $event) + public function handle(UserRegistration $event): bool { $sendMail = env('SEND_REGISTRATION_MAIL', true); if (!$sendMail) { - return; + return true; } // get the email address $email = $event->user->email; @@ -60,5 +60,6 @@ class SendRegistrationMail } catch (Swift_TransportException $e) { Log::error($e->getMessage()); } + return true; } } diff --git a/app/Handlers/Events/UpdateJournalConnection.php b/app/Handlers/Events/UpdateJournalConnection.php index 0a5e5f2804..bf385a6d50 100644 --- a/app/Handlers/Events/UpdateJournalConnection.php +++ b/app/Handlers/Events/UpdateJournalConnection.php @@ -10,7 +10,6 @@ use FireflyIII\Models\TransactionJournal; /** * Class UpdateJournalConnection * - * @codeCoverageIgnore * @package FireflyIII\Handlers\Events */ class UpdateJournalConnection diff --git a/app/Handlers/Events/UserConfirmation.php b/app/Handlers/Events/UserConfirmation.php index b90a10e27b..0c68908ca8 100644 --- a/app/Handlers/Events/UserConfirmation.php +++ b/app/Handlers/Events/UserConfirmation.php @@ -39,24 +39,30 @@ class UserConfirmation /** * @param ResendConfirmation $event + * + * @return bool */ - public function resendConfirmation(ResendConfirmation $event) + public function resendConfirmation(ResendConfirmation $event): bool { $user = $event->user; $ipAddress = $event->ipAddress; $this->doConfirm($user, $ipAddress); + return true; } /** * Handle the event. * * @param UserRegistration $event + * + * @return bool */ - public function sendConfirmation(UserRegistration $event) + public function sendConfirmation(UserRegistration $event): bool { $user = $event->user; $ipAddress = $event->ipAddress; $this->doConfirm($user, $ipAddress); + return true; } /** diff --git a/app/Handlers/Events/UserEventListener.php b/app/Handlers/Events/UserEventListener.php index 381edb7196..5f4e9b3029 100644 --- a/app/Handlers/Events/UserEventListener.php +++ b/app/Handlers/Events/UserEventListener.php @@ -21,8 +21,10 @@ class UserEventListener { /** * Handle user logout events. + * + * @return bool */ - public function onUserLogout() + public function onUserLogout(): bool { // dump stuff from the session: Session::forget('twofactor-authenticated'); diff --git a/app/Helpers/Collection/Account.php b/app/Helpers/Collection/Account.php index 24ef263642..a2bb85a899 100644 --- a/app/Helpers/Collection/Account.php +++ b/app/Helpers/Collection/Account.php @@ -5,7 +5,6 @@ namespace FireflyIII\Helpers\Collection; use Illuminate\Support\Collection; /** - * @codeCoverageIgnore * Class Account * * @package FireflyIII\Helpers\Collection diff --git a/app/Helpers/Collection/Balance.php b/app/Helpers/Collection/Balance.php index 41db832ef7..cb3b4fa3c8 100644 --- a/app/Helpers/Collection/Balance.php +++ b/app/Helpers/Collection/Balance.php @@ -5,7 +5,6 @@ namespace FireflyIII\Helpers\Collection; use Illuminate\Support\Collection; /** - * @codeCoverageIgnore * * Class Balance * diff --git a/app/Helpers/Collection/BalanceEntry.php b/app/Helpers/Collection/BalanceEntry.php index baa2f3d17c..3e798189d4 100644 --- a/app/Helpers/Collection/BalanceEntry.php +++ b/app/Helpers/Collection/BalanceEntry.php @@ -5,7 +5,6 @@ namespace FireflyIII\Helpers\Collection; use FireflyIII\Models\Account as AccountModel; /** - * @codeCoverageIgnore * * Class BalanceEntry * diff --git a/app/Helpers/Collection/BalanceHeader.php b/app/Helpers/Collection/BalanceHeader.php index 60ed221f7b..f49c37a2c5 100644 --- a/app/Helpers/Collection/BalanceHeader.php +++ b/app/Helpers/Collection/BalanceHeader.php @@ -6,7 +6,6 @@ use FireflyIII\Models\Account as AccountModel; use Illuminate\Support\Collection; /** - * @codeCoverageIgnore * * Class BalanceHeader * diff --git a/app/Helpers/Collection/BalanceLine.php b/app/Helpers/Collection/BalanceLine.php index a57a7b403b..c1544e1578 100644 --- a/app/Helpers/Collection/BalanceLine.php +++ b/app/Helpers/Collection/BalanceLine.php @@ -6,7 +6,6 @@ use FireflyIII\Models\Budget as BudgetModel; use Illuminate\Support\Collection; /** - * @codeCoverageIgnore * * Class BalanceLine * diff --git a/app/Helpers/Collection/Bill.php b/app/Helpers/Collection/Bill.php index f5b58b36ec..f535385013 100644 --- a/app/Helpers/Collection/Bill.php +++ b/app/Helpers/Collection/Bill.php @@ -6,7 +6,6 @@ namespace FireflyIII\Helpers\Collection; use Illuminate\Support\Collection; /** - * @codeCoverageIgnore * Class Bill * * @package FireflyIII\Helpers\Collection diff --git a/app/Helpers/Collection/BillLine.php b/app/Helpers/Collection/BillLine.php index 8c3141170e..ef55ef833e 100644 --- a/app/Helpers/Collection/BillLine.php +++ b/app/Helpers/Collection/BillLine.php @@ -5,7 +5,6 @@ namespace FireflyIII\Helpers\Collection; use FireflyIII\Models\Bill as BillModel; /** - * @codeCoverageIgnore * * Class BillLine * @@ -111,7 +110,7 @@ class BillLine } /** - * @return boolean + * @return bool */ public function isActive(): bool { @@ -127,7 +126,7 @@ class BillLine } /** - * @return boolean + * @return bool */ public function isHit(): bool { diff --git a/app/Helpers/Collection/Budget.php b/app/Helpers/Collection/Budget.php index 92d864eb06..eeaec0e782 100644 --- a/app/Helpers/Collection/Budget.php +++ b/app/Helpers/Collection/Budget.php @@ -5,7 +5,6 @@ namespace FireflyIII\Helpers\Collection; use Illuminate\Support\Collection; /** - * @codeCoverageIgnore * * Class Budget * diff --git a/app/Helpers/Collection/BudgetLine.php b/app/Helpers/Collection/BudgetLine.php index ecda6ac7ca..73ff155b3c 100644 --- a/app/Helpers/Collection/BudgetLine.php +++ b/app/Helpers/Collection/BudgetLine.php @@ -6,7 +6,6 @@ use FireflyIII\Models\Budget as BudgetModel; use FireflyIII\Models\LimitRepetition; /** - * @codeCoverageIgnore * * Class BudgetLine * diff --git a/app/Helpers/Collection/Category.php b/app/Helpers/Collection/Category.php index b8196fe05a..c44d4d1560 100644 --- a/app/Helpers/Collection/Category.php +++ b/app/Helpers/Collection/Category.php @@ -7,7 +7,6 @@ use Illuminate\Support\Collection; /** - * @codeCoverageIgnore * * Class Category * diff --git a/app/Helpers/Collection/Expense.php b/app/Helpers/Collection/Expense.php index b241f04f9f..f69a2db8ae 100644 --- a/app/Helpers/Collection/Expense.php +++ b/app/Helpers/Collection/Expense.php @@ -8,7 +8,6 @@ use Illuminate\Support\Collection; use stdClass; /** - * @codeCoverageIgnore * * Class Expense * diff --git a/app/Helpers/Collection/Income.php b/app/Helpers/Collection/Income.php index 17017e5129..c5cf254b3d 100644 --- a/app/Helpers/Collection/Income.php +++ b/app/Helpers/Collection/Income.php @@ -8,7 +8,6 @@ use Illuminate\Support\Collection; use stdClass; /** - * @codeCoverageIgnore * * Class Income * diff --git a/app/Helpers/Csv/Converter/AmountComma.php b/app/Helpers/Csv/Converter/AmountComma.php index 37b4d95841..1c9c585432 100644 --- a/app/Helpers/Csv/Converter/AmountComma.php +++ b/app/Helpers/Csv/Converter/AmountComma.php @@ -15,7 +15,7 @@ class AmountComma extends BasicConverter implements ConverterInterface /** * @return float|int */ - public function convert() + public function convert(): string { $value = str_replace(',', '.', strval($this->value)); diff --git a/app/Helpers/Csv/Converter/AssetAccountIban.php b/app/Helpers/Csv/Converter/AssetAccountIban.php index 327d6e882e..19e0a8aec0 100644 --- a/app/Helpers/Csv/Converter/AssetAccountIban.php +++ b/app/Helpers/Csv/Converter/AssetAccountIban.php @@ -6,6 +6,7 @@ use Auth; use Carbon\Carbon; use FireflyIII\Models\Account; use FireflyIII\Repositories\Account\AccountRepositoryInterface; +use Log; /** * Class AssetAccountIban @@ -26,6 +27,7 @@ class AssetAccountIban extends BasicConverter implements ConverterInterface // is mapped? Then it's easy! if (isset($this->mapped[$this->index][$this->value])) { $account = $repository->find($this->mapped[$this->index][$this->value]); + Log::debug('Found mapped account for value "' . $this->value . '". It is account #' . $account->id); return $account; } @@ -36,10 +38,14 @@ class AssetAccountIban extends BasicConverter implements ConverterInterface /** @var Account $entry */ foreach ($set as $entry) { if ($entry->iban == $this->value) { + Log::debug('Found an account with the same IBAN ("' . $this->value . '"). It is account #' . $entry->id); return $entry; } } + + Log::debug('Found no account with the same IBAN ("' . $this->value . '"), so will create a new one.'); + // create it if doesn't exist. $accountData = [ 'name' => $this->value, @@ -48,13 +54,12 @@ class AssetAccountIban extends BasicConverter implements ConverterInterface 'virtualBalanceCurrency' => 1, // hard coded. 'active' => true, 'user' => Auth::user()->id, - 'iban' => null, + 'iban' => $this->value, 'accountNumber' => $this->value, 'accountRole' => null, 'openingBalance' => 0, 'openingBalanceDate' => new Carbon, 'openingBalanceCurrency' => 1, // hard coded. - ]; $account = $repository->store($accountData); diff --git a/app/Helpers/Csv/Converter/AssetAccountName.php b/app/Helpers/Csv/Converter/AssetAccountName.php index 681e168021..72f4653605 100644 --- a/app/Helpers/Csv/Converter/AssetAccountName.php +++ b/app/Helpers/Csv/Converter/AssetAccountName.php @@ -18,7 +18,7 @@ class AssetAccountName extends BasicConverter implements ConverterInterface /** * @return Account|null */ - public function convert() + public function convert(): Account { /** @var AccountRepositoryInterface $repository */ $repository = app('FireflyIII\Repositories\Account\AccountRepositoryInterface'); diff --git a/app/Helpers/Csv/Converter/AssetAccountNumber.php b/app/Helpers/Csv/Converter/AssetAccountNumber.php index 9aadeaa4d0..b61e35fb70 100644 --- a/app/Helpers/Csv/Converter/AssetAccountNumber.php +++ b/app/Helpers/Csv/Converter/AssetAccountNumber.php @@ -27,7 +27,7 @@ class AssetAccountNumber extends BasicConverter implements ConverterInterface /** * @return Account|null */ - public function convert() + public function convert(): Account { /** @var AccountRepositoryInterface $repository */ $repository = app('FireflyIII\Repositories\Account\AccountRepositoryInterface'); diff --git a/app/Helpers/Csv/Converter/BasicConverter.php b/app/Helpers/Csv/Converter/BasicConverter.php index b1a262cae8..660202358a 100644 --- a/app/Helpers/Csv/Converter/BasicConverter.php +++ b/app/Helpers/Csv/Converter/BasicConverter.php @@ -23,7 +23,7 @@ class BasicConverter /** * @return array */ - public function getData() + public function getData(): array { return $this->data; } @@ -39,7 +39,7 @@ class BasicConverter /** * @return string */ - public function getField() + public function getField(): string { return $this->field; } @@ -47,7 +47,7 @@ class BasicConverter /** * @param string $field */ - public function setField($field) + public function setField(string $field) { $this->field = $field; } @@ -55,7 +55,7 @@ class BasicConverter /** * @return int */ - public function getIndex() + public function getIndex(): int { return $this->index; } @@ -63,7 +63,7 @@ class BasicConverter /** * @param int $index */ - public function setIndex($index) + public function setIndex(int $index) { $this->index = $index; } @@ -71,7 +71,7 @@ class BasicConverter /** * @return array */ - public function getMapped() + public function getMapped(): array { return $this->mapped; } @@ -79,7 +79,7 @@ class BasicConverter /** * @param array $mapped */ - public function setMapped($mapped) + public function setMapped(array $mapped) { $this->mapped = $mapped; } @@ -87,7 +87,7 @@ class BasicConverter /** * @return string */ - public function getValue() + public function getValue(): string { return $this->value; } @@ -95,7 +95,7 @@ class BasicConverter /** * @param string $value */ - public function setValue($value) + public function setValue(string $value) { $this->value = $value; } diff --git a/app/Helpers/Csv/Converter/BillId.php b/app/Helpers/Csv/Converter/BillId.php index 77e9efa000..b71f7b7fc4 100644 --- a/app/Helpers/Csv/Converter/BillId.php +++ b/app/Helpers/Csv/Converter/BillId.php @@ -16,7 +16,7 @@ class BillId extends BasicConverter implements ConverterInterface /** * @return Bill */ - public function convert() + public function convert(): Bill { /** @var BillRepositoryInterface $repository */ $repository = app('FireflyIII\Repositories\Bill\BillRepositoryInterface'); diff --git a/app/Helpers/Csv/Converter/BillName.php b/app/Helpers/Csv/Converter/BillName.php index 5f6c008f25..043bf770f7 100644 --- a/app/Helpers/Csv/Converter/BillName.php +++ b/app/Helpers/Csv/Converter/BillName.php @@ -16,7 +16,7 @@ class BillName extends BasicConverter implements ConverterInterface /** * @return Bill */ - public function convert() + public function convert(): Bill { /** @var BillRepositoryInterface $repository */ $repository = app('FireflyIII\Repositories\Bill\BillRepositoryInterface'); diff --git a/app/Helpers/Csv/Converter/BudgetId.php b/app/Helpers/Csv/Converter/BudgetId.php index 896178e822..f318464ff6 100644 --- a/app/Helpers/Csv/Converter/BudgetId.php +++ b/app/Helpers/Csv/Converter/BudgetId.php @@ -16,7 +16,7 @@ class BudgetId extends BasicConverter implements ConverterInterface /** * @return Budget */ - public function convert() + public function convert(): Budget { /** @var BudgetRepositoryInterface $repository */ $repository = app('FireflyIII\Repositories\Budget\BudgetRepositoryInterface'); diff --git a/app/Helpers/Csv/Converter/BudgetName.php b/app/Helpers/Csv/Converter/BudgetName.php index dcf8844d3d..375442d08b 100644 --- a/app/Helpers/Csv/Converter/BudgetName.php +++ b/app/Helpers/Csv/Converter/BudgetName.php @@ -17,7 +17,7 @@ class BudgetName extends BasicConverter implements ConverterInterface /** * @return Budget */ - public function convert() + public function convert(): Budget { /** @var BudgetRepositoryInterface $repository */ $repository = app('FireflyIII\Repositories\Budget\BudgetRepositoryInterface'); diff --git a/app/Helpers/Csv/Converter/CategoryId.php b/app/Helpers/Csv/Converter/CategoryId.php index 67c91fdb2b..b702f91a92 100644 --- a/app/Helpers/Csv/Converter/CategoryId.php +++ b/app/Helpers/Csv/Converter/CategoryId.php @@ -16,7 +16,7 @@ class CategoryId extends BasicConverter implements ConverterInterface /** * @return Category */ - public function convert() + public function convert(): Budget { /** @var SingleCategoryRepositoryInterface $repository */ $repository = app('FireflyIII\Repositories\Category\SingleCategoryRepositoryInterface'); diff --git a/app/Helpers/Csv/Converter/CategoryName.php b/app/Helpers/Csv/Converter/CategoryName.php index 8ce036eddc..4ec0dc0ecd 100644 --- a/app/Helpers/Csv/Converter/CategoryName.php +++ b/app/Helpers/Csv/Converter/CategoryName.php @@ -17,7 +17,7 @@ class CategoryName extends BasicConverter implements ConverterInterface /** * @return Category */ - public function convert() + public function convert(): Budget { /** @var SingleCategoryRepositoryInterface $repository */ $repository = app('FireflyIII\Repositories\Category\SingleCategoryRepositoryInterface'); diff --git a/app/Helpers/Csv/Converter/ConverterInterface.php b/app/Helpers/Csv/Converter/ConverterInterface.php index 643d17b6c1..b1b6f2922b 100644 --- a/app/Helpers/Csv/Converter/ConverterInterface.php +++ b/app/Helpers/Csv/Converter/ConverterInterface.php @@ -24,21 +24,21 @@ interface ConverterInterface * @param string $field * */ - public function setField($field); + public function setField(string $field); /** * @param int $index */ - public function setIndex($index); + public function setIndex(int $index); /** * @param array $mapped */ - public function setMapped($mapped); + public function setMapped(array $mapped); /** * @param string $value */ - public function setValue($value); + public function setValue(string $value); } diff --git a/app/Helpers/Csv/Converter/CurrencyCode.php b/app/Helpers/Csv/Converter/CurrencyCode.php index 7054b1f5d5..07e7c170fb 100644 --- a/app/Helpers/Csv/Converter/CurrencyCode.php +++ b/app/Helpers/Csv/Converter/CurrencyCode.php @@ -16,7 +16,7 @@ class CurrencyCode extends BasicConverter implements ConverterInterface /** * @return TransactionCurrency */ - public function convert() + public function convert(): TransactionCurrency { /** @var CurrencyRepositoryInterface $repository */ $repository = app('FireflyIII\Repositories\Currency\CurrencyRepositoryInterface'); diff --git a/app/Helpers/Csv/Converter/CurrencyId.php b/app/Helpers/Csv/Converter/CurrencyId.php index ce21771f12..4ee65e950b 100644 --- a/app/Helpers/Csv/Converter/CurrencyId.php +++ b/app/Helpers/Csv/Converter/CurrencyId.php @@ -16,7 +16,7 @@ class CurrencyId extends BasicConverter implements ConverterInterface /** * @return TransactionCurrency */ - public function convert() + public function convert(): TransactionCurrency { /** @var CurrencyRepositoryInterface $repository */ $repository = app('FireflyIII\Repositories\Currency\CurrencyRepositoryInterface'); diff --git a/app/Helpers/Csv/Converter/CurrencyName.php b/app/Helpers/Csv/Converter/CurrencyName.php index 336c533e6b..29fa7828c3 100644 --- a/app/Helpers/Csv/Converter/CurrencyName.php +++ b/app/Helpers/Csv/Converter/CurrencyName.php @@ -16,7 +16,7 @@ class CurrencyName extends BasicConverter implements ConverterInterface /** * @return TransactionCurrency */ - public function convert() + public function convert(): TransactionCurrency { /** @var CurrencyRepositoryInterface $repository */ $repository = app('FireflyIII\Repositories\Currency\CurrencyRepositoryInterface'); diff --git a/app/Helpers/Csv/Converter/CurrencySymbol.php b/app/Helpers/Csv/Converter/CurrencySymbol.php index b27c122db3..4d0de8d70c 100644 --- a/app/Helpers/Csv/Converter/CurrencySymbol.php +++ b/app/Helpers/Csv/Converter/CurrencySymbol.php @@ -16,7 +16,7 @@ class CurrencySymbol extends BasicConverter implements ConverterInterface /** * @return TransactionCurrency */ - public function convert() + public function convert(): TransactionCurrency { /** @var CurrencyRepositoryInterface $repository */ $repository = app('FireflyIII\Repositories\Currency\CurrencyRepositoryInterface'); diff --git a/app/Helpers/Csv/Converter/Date.php b/app/Helpers/Csv/Converter/Date.php index ca532738ba..e11338246f 100644 --- a/app/Helpers/Csv/Converter/Date.php +++ b/app/Helpers/Csv/Converter/Date.php @@ -19,7 +19,7 @@ class Date extends BasicConverter implements ConverterInterface * @return Carbon * @throws FireflyException */ - public function convert() + public function convert(): Carbon { $format = session('csv-date-format'); try { diff --git a/app/Helpers/Csv/Converter/Description.php b/app/Helpers/Csv/Converter/Description.php index 98cfd1b4bf..ac12542a46 100644 --- a/app/Helpers/Csv/Converter/Description.php +++ b/app/Helpers/Csv/Converter/Description.php @@ -14,7 +14,7 @@ class Description extends BasicConverter implements ConverterInterface /** * @return string */ - public function convert() + public function convert(): string { $description = $this->data['description'] ?? ''; diff --git a/app/Helpers/Csv/Converter/INGDebetCredit.php b/app/Helpers/Csv/Converter/INGDebetCredit.php index ac36539e22..1b01998232 100644 --- a/app/Helpers/Csv/Converter/INGDebetCredit.php +++ b/app/Helpers/Csv/Converter/INGDebetCredit.php @@ -24,7 +24,7 @@ class INGDebetCredit extends BasicConverter implements ConverterInterface /** * @return int */ - public function convert() + public function convert(): int { if ($this->value === 'Af') { return -1; diff --git a/app/Helpers/Csv/Converter/OpposingAccountId.php b/app/Helpers/Csv/Converter/OpposingAccountId.php index 3c11791fb8..6b6ec84f60 100644 --- a/app/Helpers/Csv/Converter/OpposingAccountId.php +++ b/app/Helpers/Csv/Converter/OpposingAccountId.php @@ -17,7 +17,7 @@ class OpposingAccountId extends BasicConverter implements ConverterInterface /** * @return Account */ - public function convert() + public function convert(): Account { /** @var AccountRepositoryInterface $repository */ $repository = app('FireflyIII\Repositories\Account\AccountRepositoryInterface'); diff --git a/app/Helpers/Csv/Converter/RabobankDebetCredit.php b/app/Helpers/Csv/Converter/RabobankDebetCredit.php index a0945fcf5e..ac73d9e206 100644 --- a/app/Helpers/Csv/Converter/RabobankDebetCredit.php +++ b/app/Helpers/Csv/Converter/RabobankDebetCredit.php @@ -15,7 +15,7 @@ class RabobankDebetCredit extends BasicConverter implements ConverterInterface /** * @return int */ - public function convert() + public function convert(): int { if ($this->value == 'D') { return -1; diff --git a/app/Helpers/Csv/Converter/TagsComma.php b/app/Helpers/Csv/Converter/TagsComma.php index 6c8715b01c..a38d64cce8 100644 --- a/app/Helpers/Csv/Converter/TagsComma.php +++ b/app/Helpers/Csv/Converter/TagsComma.php @@ -16,7 +16,7 @@ class TagsComma extends BasicConverter implements ConverterInterface /** * @return Collection */ - public function convert() + public function convert(): Collection { /** @var TagRepositoryInterface $repository */ $repository = app('FireflyIII\Repositories\Tag\TagRepositoryInterface'); diff --git a/app/Helpers/Csv/Converter/TagsSpace.php b/app/Helpers/Csv/Converter/TagsSpace.php index 72f41503dc..60eeba8b7d 100644 --- a/app/Helpers/Csv/Converter/TagsSpace.php +++ b/app/Helpers/Csv/Converter/TagsSpace.php @@ -16,7 +16,7 @@ class TagsSpace extends BasicConverter implements ConverterInterface /** * @return Collection */ - public function convert() + public function convert(): Collection { /** @var TagRepositoryInterface $repository */ $repository = app('FireflyIII\Repositories\Tag\TagRepositoryInterface'); diff --git a/app/Helpers/Csv/Data.php b/app/Helpers/Csv/Data.php index b45edd5211..606ae42bbe 100644 --- a/app/Helpers/Csv/Data.php +++ b/app/Helpers/Csv/Data.php @@ -57,7 +57,7 @@ class Data * * @return string */ - public function getCsvFileContent() + public function getCsvFileContent(): string { return $this->csvFileContent ?? ''; } @@ -72,10 +72,10 @@ class Data } /** - * + * FIXME may return null * @return string */ - public function getCsvFileLocation() + public function getCsvFileLocation(): string { return $this->csvFileLocation; } @@ -91,10 +91,10 @@ class Data } /** - * + * FIXME may return null * @return string */ - public function getDateFormat() + public function getDateFormat(): string { return $this->dateFormat; } @@ -110,10 +110,10 @@ class Data } /** - * + * FIXME may return null * @return string */ - public function getDelimiter() + public function getDelimiter(): string { return $this->delimiter; } @@ -132,7 +132,7 @@ class Data * * @return array */ - public function getMap() + public function getMap(): array { return $this->map; } @@ -151,7 +151,7 @@ class Data * * @return array */ - public function getMapped() + public function getMapped(): array { return $this->mapped; } @@ -170,7 +170,7 @@ class Data * * @return Reader */ - public function getReader() + public function getReader(): Reader { if (!is_null($this->csvFileContent) && strlen($this->csvFileContent) === 0) { $this->loadCsvFile(); @@ -188,7 +188,7 @@ class Data * * @return array */ - public function getRoles() + public function getRoles(): array { return $this->roles; } @@ -207,7 +207,7 @@ class Data * * @return array */ - public function getSpecifix() + public function getSpecifix(): array { return is_array($this->specifix) ? $this->specifix : []; } @@ -226,7 +226,7 @@ class Data * * @return bool */ - public function hasHeaders() + public function hasHeaders(): bool { return $this->hasHeaders; } diff --git a/app/Helpers/Csv/Importer.php b/app/Helpers/Csv/Importer.php index 77553dab89..90aadc3a0e 100644 --- a/app/Helpers/Csv/Importer.php +++ b/app/Helpers/Csv/Importer.php @@ -4,19 +4,15 @@ namespace FireflyIII\Helpers\Csv; use Auth; use Config; +use FireflyIII\Events\TransactionJournalStored; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Helpers\Csv\Converter\ConverterInterface; use FireflyIII\Helpers\Csv\PostProcessing\PostProcessorInterface; use FireflyIII\Helpers\Csv\Specifix\SpecifixInterface; use FireflyIII\Models\Account; -use FireflyIII\Models\Rule; -use FireflyIII\Models\RuleGroup; use FireflyIII\Models\Transaction; use FireflyIII\Models\TransactionJournal; use FireflyIII\Models\TransactionType; -use FireflyIII\Rules\Processor; -use FireflyIII\User; -use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Support\Collection; use Illuminate\Support\MessageBag; use Log; @@ -57,7 +53,7 @@ class Importer * * @return array */ - public function getErrors() + public function getErrors(): array { return $this->errors; } @@ -67,7 +63,7 @@ class Importer * * @return int */ - public function getImported() + public function getImported(): int { return $this->imported; } @@ -75,7 +71,7 @@ class Importer /** * @return Collection */ - public function getJournals() + public function getJournals(): Collection { return $this->journals; } @@ -85,7 +81,7 @@ class Importer * * @return int */ - public function getRows() + public function getRows(): int { return $this->rows; } @@ -93,7 +89,7 @@ class Importer /** * @return array */ - public function getSpecifix() + public function getSpecifix(): array { return is_array($this->specifix) ? $this->specifix : []; } @@ -120,19 +116,13 @@ class Importer Log::error('Caught error at row #' . $index . ': ' . $result); $this->errors[$index] = $result; } else { - - $this->imported++; $this->journals->push($result); + event(new TransactionJournalStored($result, 0)); } Log::debug('---'); } } - - // once all journals have been imported (or not) - // fire the rules. - $this->fireRules(); - } /** @@ -144,7 +134,6 @@ class Importer } /** - * * @return TransactionJournal|string */ protected function createTransactionJournal() @@ -361,55 +350,6 @@ class Importer return true; } - /** - * @param Collection $groups - * @param TransactionJournal $journal - */ - private function fireRule(Collection $groups, TransactionJournal $journal) - { - /** @var RuleGroup $group */ - foreach ($groups as $group) { - - /** @var Rule $rule */ - foreach ($group->rules as $rule) { - $processor = Processor::make($rule); - $processor->handleTransactionJournal($journal); - if ($rule->stop_processing) { - break; - } - } - } - } - - private function fireRules() - { - // get all users rules. - /** @var User $user */ - $user = Auth::user(); - $groups = $user - ->ruleGroups() - ->where('rule_groups.active', 1) - ->orderBy('order', 'ASC') - ->with( - [ - 'rules' => function (HasMany $q) { - $q->leftJoin('rule_triggers', 'rules.id', '=', 'rule_triggers.rule_id') - ->where('rule_triggers.trigger_type', 'user_action') - ->where('rule_triggers.trigger_value', 'store-journal') - ->where('rules.active', 1) - ->orderBy('rules.order', 'ASC'); - }, - ] - ) - ->get(); - - /** @var TransactionJournal $journal */ - foreach ($this->journals as $journal) { - $this->fireRule($groups, $journal); - } - - } - /** * @return array */ diff --git a/app/Helpers/Csv/Mapper/AnyAccount.php b/app/Helpers/Csv/Mapper/AnyAccount.php index 573e025f04..f4486d8e8b 100644 --- a/app/Helpers/Csv/Mapper/AnyAccount.php +++ b/app/Helpers/Csv/Mapper/AnyAccount.php @@ -16,7 +16,7 @@ class AnyAccount implements MapperInterface /** * @return array */ - public function getMap() + public function getMap(): array { $result = Auth::user()->accounts()->with('accountType')->orderBy('accounts.name', 'ASC')->get(['accounts.*']); diff --git a/app/Helpers/Csv/Mapper/AssetAccount.php b/app/Helpers/Csv/Mapper/AssetAccount.php index 4060bc0055..c2dd12bac7 100644 --- a/app/Helpers/Csv/Mapper/AssetAccount.php +++ b/app/Helpers/Csv/Mapper/AssetAccount.php @@ -17,7 +17,7 @@ class AssetAccount implements MapperInterface /** * @return array */ - public function getMap() + public function getMap(): array { $result = Auth::user()->accounts()->with( ['accountmeta' => function (HasMany $query) { diff --git a/app/Helpers/Csv/Mapper/Bill.php b/app/Helpers/Csv/Mapper/Bill.php index d0f9cb8c3d..5c56324df6 100644 --- a/app/Helpers/Csv/Mapper/Bill.php +++ b/app/Helpers/Csv/Mapper/Bill.php @@ -16,7 +16,7 @@ class Bill implements MapperInterface /** * @return array */ - public function getMap() + public function getMap(): array { $result = Auth::user()->bills()->get(['bills.*']); $list = []; diff --git a/app/Helpers/Csv/Mapper/Budget.php b/app/Helpers/Csv/Mapper/Budget.php index f5de27f0ff..972a75f5a1 100644 --- a/app/Helpers/Csv/Mapper/Budget.php +++ b/app/Helpers/Csv/Mapper/Budget.php @@ -16,7 +16,7 @@ class Budget implements MapperInterface /** * @return array */ - public function getMap() + public function getMap(): array { $result = Auth::user()->budgets()->get(['budgets.*']); $list = []; diff --git a/app/Helpers/Csv/Mapper/Category.php b/app/Helpers/Csv/Mapper/Category.php index cd9af4aba9..48d53135eb 100644 --- a/app/Helpers/Csv/Mapper/Category.php +++ b/app/Helpers/Csv/Mapper/Category.php @@ -16,7 +16,7 @@ class Category implements MapperInterface /** * @return array */ - public function getMap() + public function getMap(): array { $result = Auth::user()->categories()->get(['categories.*']); $list = []; diff --git a/app/Helpers/Csv/Mapper/MapperInterface.php b/app/Helpers/Csv/Mapper/MapperInterface.php index a8822163b4..78fd647a99 100644 --- a/app/Helpers/Csv/Mapper/MapperInterface.php +++ b/app/Helpers/Csv/Mapper/MapperInterface.php @@ -12,5 +12,5 @@ interface MapperInterface /** * @return array */ - public function getMap(); + public function getMap(): array; } diff --git a/app/Helpers/Csv/Mapper/Tag.php b/app/Helpers/Csv/Mapper/Tag.php index d0a7feba36..9fff15873e 100644 --- a/app/Helpers/Csv/Mapper/Tag.php +++ b/app/Helpers/Csv/Mapper/Tag.php @@ -16,7 +16,7 @@ class Tag implements MapperInterface /** * @return array */ - public function getMap() + public function getMap(): array { $result = Auth::user()->budgets()->get(['tags.*']); $list = []; diff --git a/app/Helpers/Csv/Mapper/TransactionCurrency.php b/app/Helpers/Csv/Mapper/TransactionCurrency.php index 636b19520d..3712b98f5e 100644 --- a/app/Helpers/Csv/Mapper/TransactionCurrency.php +++ b/app/Helpers/Csv/Mapper/TransactionCurrency.php @@ -15,7 +15,7 @@ class TransactionCurrency implements MapperInterface /** * @return array */ - public function getMap() + public function getMap(): array { $currencies = TC::get(); $list = []; diff --git a/app/Helpers/Csv/PostProcessing/Amount.php b/app/Helpers/Csv/PostProcessing/Amount.php index fc5f9b9fc7..b955fca50d 100644 --- a/app/Helpers/Csv/PostProcessing/Amount.php +++ b/app/Helpers/Csv/PostProcessing/Amount.php @@ -17,7 +17,7 @@ class Amount implements PostProcessorInterface /** * @return array */ - public function process() + public function process(): array { $amount = $this->data['amount'] ?? '0'; $modifier = strval($this->data['amount-modifier']); diff --git a/app/Helpers/Csv/PostProcessing/AssetAccount.php b/app/Helpers/Csv/PostProcessing/AssetAccount.php index 7ee7986b76..542c72e0be 100644 --- a/app/Helpers/Csv/PostProcessing/AssetAccount.php +++ b/app/Helpers/Csv/PostProcessing/AssetAccount.php @@ -23,7 +23,7 @@ class AssetAccount implements PostProcessorInterface /** * @return array */ - public function process() + public function process(): array { $result = $this->checkIdNameObject(); // has object in ID or Name? if (!is_null($result)) { diff --git a/app/Helpers/Csv/PostProcessing/Bill.php b/app/Helpers/Csv/PostProcessing/Bill.php index de81b8b3c4..9369fc26ad 100644 --- a/app/Helpers/Csv/PostProcessing/Bill.php +++ b/app/Helpers/Csv/PostProcessing/Bill.php @@ -16,7 +16,7 @@ class Bill implements PostProcessorInterface /** * @return array */ - public function process() + public function process(): array { // get bill id. diff --git a/app/Helpers/Csv/PostProcessing/Currency.php b/app/Helpers/Csv/PostProcessing/Currency.php index 91d34f8677..62b14fb430 100644 --- a/app/Helpers/Csv/PostProcessing/Currency.php +++ b/app/Helpers/Csv/PostProcessing/Currency.php @@ -19,7 +19,7 @@ class Currency implements PostProcessorInterface /** * @return array */ - public function process() + public function process(): array { // fix currency diff --git a/app/Helpers/Csv/PostProcessing/Description.php b/app/Helpers/Csv/PostProcessing/Description.php index 64c0e8ed8b..51ddca637b 100644 --- a/app/Helpers/Csv/PostProcessing/Description.php +++ b/app/Helpers/Csv/PostProcessing/Description.php @@ -16,7 +16,7 @@ class Description implements PostProcessorInterface /** * @return array */ - public function process() + public function process(): array { $description = $this->data['description'] ?? ''; $this->data['description'] = trim($description); diff --git a/app/Helpers/Csv/PostProcessing/OpposingAccount.php b/app/Helpers/Csv/PostProcessing/OpposingAccount.php index 0bc038bba3..dece4bea05 100644 --- a/app/Helpers/Csv/PostProcessing/OpposingAccount.php +++ b/app/Helpers/Csv/PostProcessing/OpposingAccount.php @@ -22,7 +22,7 @@ class OpposingAccount implements PostProcessorInterface /** * @return array */ - public function process() + public function process(): array { // three values: // opposing-account-id, opposing-account-iban, opposing-account-name diff --git a/app/Helpers/Csv/PostProcessing/PostProcessorInterface.php b/app/Helpers/Csv/PostProcessing/PostProcessorInterface.php index a6a793c3d5..bc67b7d9cf 100644 --- a/app/Helpers/Csv/PostProcessing/PostProcessorInterface.php +++ b/app/Helpers/Csv/PostProcessing/PostProcessorInterface.php @@ -14,7 +14,7 @@ interface PostProcessorInterface /** * @return array */ - public function process(); + public function process(): array; /** * @param array $data diff --git a/app/Helpers/Csv/Specifix/AbnAmroDescription.php b/app/Helpers/Csv/Specifix/AbnAmroDescription.php index c5f0cb1245..4c3cfce346 100644 --- a/app/Helpers/Csv/Specifix/AbnAmroDescription.php +++ b/app/Helpers/Csv/Specifix/AbnAmroDescription.php @@ -32,7 +32,7 @@ class AbnAmroDescription extends Specifix implements SpecifixInterface /** * @return array */ - public function fix() + public function fix(): array { // Try to parse the description in known formats. $parsed = $this->parseSepaDescription() || $this->parseTRTPDescription() || $this->parseGEABEADescription() || $this->parseABNAMRODescription(); @@ -65,7 +65,7 @@ class AbnAmroDescription extends Specifix implements SpecifixInterface /** * Parses the current description with costs from ABN AMRO itself * - * @return boolean true if the description is GEA/BEA-format, false otherwise + * @return bool true if the description is GEA/BEA-format, false otherwise */ protected function parseABNAMRODescription() { @@ -85,7 +85,7 @@ class AbnAmroDescription extends Specifix implements SpecifixInterface /** * Parses the current description in GEA/BEA format * - * @return boolean true if the description is GEA/BEAformat, false otherwise + * @return bool true if the description is GEA/BEAformat, false otherwise */ protected function parseGEABEADescription() { @@ -111,7 +111,7 @@ class AbnAmroDescription extends Specifix implements SpecifixInterface /** * Parses the current description in SEPA format * - * @return boolean true if the description is SEPA format, false otherwise + * @return bool true if the description is SEPA format, false otherwise */ protected function parseSepaDescription() { @@ -168,7 +168,7 @@ class AbnAmroDescription extends Specifix implements SpecifixInterface /** * Parses the current description in TRTP format * - * @return boolean true if the description is TRTP format, false otherwise + * @return bool true if the description is TRTP format, false otherwise */ protected function parseTRTPDescription() { diff --git a/app/Helpers/Csv/Specifix/Dummy.php b/app/Helpers/Csv/Specifix/Dummy.php index 2e4263a4d5..5d84545619 100644 --- a/app/Helpers/Csv/Specifix/Dummy.php +++ b/app/Helpers/Csv/Specifix/Dummy.php @@ -26,7 +26,7 @@ class Dummy extends Specifix implements SpecifixInterface /** * @return array */ - public function fix() + public function fix(): array { return $this->data; diff --git a/app/Helpers/Csv/Specifix/RabobankDescription.php b/app/Helpers/Csv/Specifix/RabobankDescription.php index 249fc00cfe..19e018b5ec 100644 --- a/app/Helpers/Csv/Specifix/RabobankDescription.php +++ b/app/Helpers/Csv/Specifix/RabobankDescription.php @@ -29,7 +29,7 @@ class RabobankDescription extends Specifix implements SpecifixInterface /** * @return array */ - public function fix() + public function fix(): array { $this->rabobankFixEmptyOpposing(); diff --git a/app/Helpers/Csv/Specifix/Specifix.php b/app/Helpers/Csv/Specifix/Specifix.php index 37c40ccc27..fcceeb3652 100644 --- a/app/Helpers/Csv/Specifix/Specifix.php +++ b/app/Helpers/Csv/Specifix/Specifix.php @@ -24,7 +24,7 @@ class Specifix /** * @return int */ - public function getProcessorType() + public function getProcessorType(): int { return $this->processorType; } diff --git a/app/Helpers/Csv/Specifix/SpecifixInterface.php b/app/Helpers/Csv/Specifix/SpecifixInterface.php index b6534fbe51..79e701d8fc 100644 --- a/app/Helpers/Csv/Specifix/SpecifixInterface.php +++ b/app/Helpers/Csv/Specifix/SpecifixInterface.php @@ -20,7 +20,7 @@ interface SpecifixInterface /** * @return int */ - public function getProcessorType(); + public function getProcessorType(): int; /** * @param array $data diff --git a/app/Helpers/Csv/Wizard.php b/app/Helpers/Csv/Wizard.php index dcb8424dc3..33d76f0499 100644 --- a/app/Helpers/Csv/Wizard.php +++ b/app/Helpers/Csv/Wizard.php @@ -29,7 +29,7 @@ class Wizard implements WizardInterface * * @return array */ - public function getMappableValues(Reader $reader, array $map, bool $hasHeaders) + public function getMappableValues(Reader $reader, array $map, bool $hasHeaders): array { $values = []; /* @@ -59,7 +59,7 @@ class Wizard implements WizardInterface * * @return array */ - public function processSelectedMapping(array $roles, array $map) + public function processSelectedMapping(array $roles, array $map): array { $configRoles = Config::get('csv.roles'); $maps = []; @@ -86,7 +86,7 @@ class Wizard implements WizardInterface * * @return array */ - public function processSelectedRoles(array $input) + public function processSelectedRoles(array $input): array { $roles = []; @@ -110,7 +110,7 @@ class Wizard implements WizardInterface * * @return bool */ - public function sessionHasValues(array $fields) + public function sessionHasValues(array $fields): bool { foreach ($fields as $field) { if (!Session::has($field)) { @@ -129,7 +129,7 @@ class Wizard implements WizardInterface * @return array * @throws FireflyException */ - public function showOptions(array $map) + public function showOptions(array $map): array { $options = []; foreach ($map as $index => $columnRole) { @@ -157,7 +157,7 @@ class Wizard implements WizardInterface * * @return string */ - public function storeCsvFile(string $path) + public function storeCsvFile(string $path): string { $time = str_replace(' ', '-', microtime()); $fileName = 'csv-upload-' . Auth::user()->id . '-' . $time . '.csv.encrypted'; diff --git a/app/Helpers/Csv/WizardInterface.php b/app/Helpers/Csv/WizardInterface.php index 815a432a43..815a800c27 100644 --- a/app/Helpers/Csv/WizardInterface.php +++ b/app/Helpers/Csv/WizardInterface.php @@ -19,7 +19,7 @@ interface WizardInterface * * @return array */ - public function getMappableValues(Reader $reader, array $map, bool $hasHeaders); + public function getMappableValues(Reader $reader, array $map, bool $hasHeaders): array; /** * @param array $roles @@ -27,34 +27,34 @@ interface WizardInterface * * @return array */ - public function processSelectedMapping(array $roles, array $map); + public function processSelectedMapping(array $roles, array $map): array; /** * @param array $input * * @return array */ - public function processSelectedRoles(array $input); + public function processSelectedRoles(array $input): array; /** * @param array $fields * * @return bool */ - public function sessionHasValues(array $fields); + public function sessionHasValues(array $fields): bool; /** * @param array $map * * @return array */ - public function showOptions(array $map); + public function showOptions(array $map): array; /** * @param string $path * * @return string */ - public function storeCsvFile(string $path); + public function storeCsvFile(string $path): string; } diff --git a/app/Helpers/FiscalHelper.php b/app/Helpers/FiscalHelper.php index 224fc5a025..3f5c9eebc9 100644 --- a/app/Helpers/FiscalHelper.php +++ b/app/Helpers/FiscalHelper.php @@ -20,7 +20,6 @@ class FiscalHelper implements FiscalHelperInterface /** * FiscalHelper constructor. * - * @codeCoverageIgnore * */ public function __construct() @@ -37,7 +36,7 @@ class FiscalHelper implements FiscalHelperInterface * * @return Carbon date object */ - public function endOfFiscalYear(Carbon $date) + public function endOfFiscalYear(Carbon $date): Carbon { // get start of fiscal year for passed date $endDate = $this->startOfFiscalYear($date); @@ -58,7 +57,7 @@ class FiscalHelper implements FiscalHelperInterface * * @return Carbon date object */ - public function startOfFiscalYear(Carbon $date) + public function startOfFiscalYear(Carbon $date): Carbon { // get start mm-dd. Then create a start date in the year passed. $startDate = clone $date; diff --git a/app/Helpers/FiscalHelperInterface.php b/app/Helpers/FiscalHelperInterface.php index b812fb9324..1d31ad0e18 100644 --- a/app/Helpers/FiscalHelperInterface.php +++ b/app/Helpers/FiscalHelperInterface.php @@ -21,7 +21,7 @@ interface FiscalHelperInterface * * @return Carbon date object */ - public function endOfFiscalYear(Carbon $date); + public function endOfFiscalYear(Carbon $date): Carbon; /** * This method produces a clone of the Carbon date object passed, checks preferences @@ -31,6 +31,6 @@ interface FiscalHelperInterface * * @return Carbon date object */ - public function startOfFiscalYear(Carbon $date); + public function startOfFiscalYear(Carbon $date): Carbon; } diff --git a/app/Helpers/Help/Help.php b/app/Helpers/Help/Help.php index 881006afe0..25fa36fe99 100644 --- a/app/Helpers/Help/Help.php +++ b/app/Helpers/Help/Help.php @@ -17,7 +17,6 @@ class Help implements HelpInterface { /** - * @codeCoverageIgnore * * @param string $key * @@ -68,7 +67,6 @@ class Help implements HelpInterface } /** - * @codeCoverageIgnore * * @param string $route * @@ -80,7 +78,6 @@ class Help implements HelpInterface } /** - * @codeCoverageIgnore * * @param string $route * @@ -92,16 +89,16 @@ class Help implements HelpInterface } /** - * @codeCoverageIgnore * * @param string $route + * @param string $language * @param array $content * * @internal param $title */ - public function putInCache(string $route, array $content) + public function putInCache(string $route, string $language, array $content) { - Cache::put('help.' . $route . '.text', $content['text'], 10080); // a week. - Cache::put('help.' . $route . '.title', $content['title'], 10080); + Cache::put('help.' . $route . '.text.' . $language, $content['text'], 10080); // a week. + Cache::put('help.' . $route . '.title.' . $language, $content['title'], 10080); } } diff --git a/app/Helpers/Help/HelpInterface.php b/app/Helpers/Help/HelpInterface.php index 5f2c07b215..28c30e11ea 100644 --- a/app/Helpers/Help/HelpInterface.php +++ b/app/Helpers/Help/HelpInterface.php @@ -41,7 +41,8 @@ interface HelpInterface /** * @param string $route + * @param string $language * @param array $content */ - public function putInCache(string $route, array $content); + public function putInCache(string $route, string $language, array $content); } diff --git a/app/Helpers/Report/AccountReportHelper.php b/app/Helpers/Report/AccountReportHelper.php index 1a1157d0ec..43d58a136d 100644 --- a/app/Helpers/Report/AccountReportHelper.php +++ b/app/Helpers/Report/AccountReportHelper.php @@ -34,7 +34,7 @@ class AccountReportHelper implements AccountReportHelperInterface * * @return AccountCollection */ - public function getAccountReport(Carbon $start, Carbon $end, Collection $accounts) + public function getAccountReport(Carbon $start, Carbon $end, Collection $accounts): AccountCollection { $startAmount = '0'; $endAmount = '0'; diff --git a/app/Helpers/Report/AccountReportHelperInterface.php b/app/Helpers/Report/AccountReportHelperInterface.php index 02e56274f3..673168b18a 100644 --- a/app/Helpers/Report/AccountReportHelperInterface.php +++ b/app/Helpers/Report/AccountReportHelperInterface.php @@ -32,6 +32,6 @@ interface AccountReportHelperInterface * * @return AccountCollection */ - public function getAccountReport(Carbon $start, Carbon $end, Collection $accounts); + public function getAccountReport(Carbon $start, Carbon $end, Collection $accounts): AccountCollection; } diff --git a/app/Helpers/Report/BalanceReportHelper.php b/app/Helpers/Report/BalanceReportHelper.php index 290f6896ba..a529ac104a 100644 --- a/app/Helpers/Report/BalanceReportHelper.php +++ b/app/Helpers/Report/BalanceReportHelper.php @@ -40,7 +40,6 @@ class BalanceReportHelper implements BalanceReportHelperInterface /** * ReportHelper constructor. * - * @codeCoverageIgnore * * @param BudgetRepositoryInterface $budgetRepository * @param TagRepositoryInterface $tagRepository @@ -59,7 +58,7 @@ class BalanceReportHelper implements BalanceReportHelperInterface * * @return Balance */ - public function getBalanceReport(Carbon $start, Carbon $end, Collection $accounts) + public function getBalanceReport(Carbon $start, Carbon $end, Collection $accounts): Balance { $balance = new Balance; @@ -92,7 +91,7 @@ class BalanceReportHelper implements BalanceReportHelperInterface * * @return BalanceLine */ - private function createBalanceLine(BudgetModel $budget, Collection $accounts, Collection $spentData) + private function createBalanceLine(BudgetModel $budget, Collection $accounts, Collection $spentData): BalanceLine { $line = new BalanceLine; $line->setBudget($budget); @@ -129,7 +128,7 @@ class BalanceReportHelper implements BalanceReportHelperInterface * * @return BalanceLine */ - private function createDifferenceBalanceLine(Collection $accounts, Collection $spentData, Carbon $start, Carbon $end) + private function createDifferenceBalanceLine(Collection $accounts, Collection $spentData, Carbon $start, Carbon $end): BalanceLine { $diff = new BalanceLine; $tagsLeft = $this->tagRepository->allCoveredByBalancingActs($accounts, $start, $end); @@ -174,7 +173,7 @@ class BalanceReportHelper implements BalanceReportHelperInterface * * @return BalanceLine */ - private function createEmptyBalanceLine(Collection $accounts, Collection $spentData) + private function createEmptyBalanceLine(Collection $accounts, Collection $spentData): BalanceLine { $empty = new BalanceLine; @@ -207,7 +206,7 @@ class BalanceReportHelper implements BalanceReportHelperInterface * * @return BalanceLine */ - private function createTagsBalanceLine(Collection $accounts, Carbon $start, Carbon $end) + private function createTagsBalanceLine(Collection $accounts, Carbon $start, Carbon $end): BalanceLine { $tags = new BalanceLine; $tagsLeft = $this->tagRepository->allCoveredByBalancingActs($accounts, $start, $end); diff --git a/app/Helpers/Report/BalanceReportHelperInterface.php b/app/Helpers/Report/BalanceReportHelperInterface.php index d225e94781..9cdcdb19b7 100644 --- a/app/Helpers/Report/BalanceReportHelperInterface.php +++ b/app/Helpers/Report/BalanceReportHelperInterface.php @@ -29,5 +29,5 @@ interface BalanceReportHelperInterface * * @return Balance */ - public function getBalanceReport(Carbon $start, Carbon $end, Collection $accounts); + public function getBalanceReport(Carbon $start, Carbon $end, Collection $accounts): Balance; } diff --git a/app/Helpers/Report/BudgetReportHelperInterface.php b/app/Helpers/Report/BudgetReportHelperInterface.php index 1096a1b027..b1cd8fb955 100644 --- a/app/Helpers/Report/BudgetReportHelperInterface.php +++ b/app/Helpers/Report/BudgetReportHelperInterface.php @@ -29,5 +29,5 @@ interface BudgetReportHelperInterface * * @return BudgetCollection */ - public function getBudgetReport(Carbon $start, Carbon $end, Collection $accounts); + public function getBudgetReport(Carbon $start, Carbon $end, Collection $accounts): BudgetCollection; } diff --git a/app/Helpers/Report/ReportHelper.php b/app/Helpers/Report/ReportHelper.php index 93b7a12e07..d1f70d7826 100644 --- a/app/Helpers/Report/ReportHelper.php +++ b/app/Helpers/Report/ReportHelper.php @@ -37,7 +37,6 @@ class ReportHelper implements ReportHelperInterface /** * ReportHelper constructor. * - * @codeCoverageIgnore * * @param ReportQueryInterface $query * @param BudgetRepositoryInterface $budgetRepository @@ -62,7 +61,7 @@ class ReportHelper implements ReportHelperInterface * * @return BillCollection */ - public function getBillReport(Carbon $start, Carbon $end, Collection $accounts) + public function getBillReport(Carbon $start, Carbon $end, Collection $accounts): BillCollection { /** @var \FireflyIII\Repositories\Bill\BillRepositoryInterface $repository */ $repository = app('FireflyIII\Repositories\Bill\BillRepositoryInterface'); @@ -109,7 +108,7 @@ class ReportHelper implements ReportHelperInterface * * @return CategoryCollection */ - public function getCategoryReport(Carbon $start, Carbon $end, Collection $accounts) + public function getCategoryReport(Carbon $start, Carbon $end, Collection $accounts): CategoryCollection { $object = new CategoryCollection; @@ -136,7 +135,7 @@ class ReportHelper implements ReportHelperInterface * * @return Expense */ - public function getExpenseReport(Carbon $start, Carbon $end, Collection $accounts) + public function getExpenseReport(Carbon $start, Carbon $end, Collection $accounts): Expense { $object = new Expense; $set = $this->query->expense($accounts, $start, $end); @@ -158,7 +157,7 @@ class ReportHelper implements ReportHelperInterface * * @return Income */ - public function getIncomeReport(Carbon $start, Carbon $end, Collection $accounts) + public function getIncomeReport(Carbon $start, Carbon $end, Collection $accounts): Income { $object = new Income; $set = $this->query->income($accounts, $start, $end); @@ -176,7 +175,7 @@ class ReportHelper implements ReportHelperInterface * * @return array */ - public function listOfMonths(Carbon $date) + public function listOfMonths(Carbon $date): array { /** @var FiscalHelperInterface $fiscalHelper */ $fiscalHelper = app('FireflyIII\Helpers\FiscalHelperInterface'); diff --git a/app/Helpers/Report/ReportHelperInterface.php b/app/Helpers/Report/ReportHelperInterface.php index e45fd3b56f..33be9fe4e8 100644 --- a/app/Helpers/Report/ReportHelperInterface.php +++ b/app/Helpers/Report/ReportHelperInterface.php @@ -30,7 +30,7 @@ interface ReportHelperInterface * * @return BillCollection */ - public function getBillReport(Carbon $start, Carbon $end, Collection $accounts); + public function getBillReport(Carbon $start, Carbon $end, Collection $accounts): BillCollection; /** * @param Carbon $start @@ -39,7 +39,7 @@ interface ReportHelperInterface * * @return CategoryCollection */ - public function getCategoryReport(Carbon $start, Carbon $end, Collection $accounts); + public function getCategoryReport(Carbon $start, Carbon $end, Collection $accounts): CategoryCollection; /** * Get a full report on the users expenses during the period for a list of accounts. @@ -50,7 +50,7 @@ interface ReportHelperInterface * * @return Expense */ - public function getExpenseReport(Carbon $start, Carbon $end, Collection $accounts); + public function getExpenseReport(Carbon $start, Carbon $end, Collection $accounts): Expense; /** * Get a full report on the users incomes during the period for the given accounts. @@ -61,14 +61,14 @@ interface ReportHelperInterface * * @return Income */ - public function getIncomeReport(Carbon $start, Carbon $end, Collection $accounts); + public function getIncomeReport(Carbon $start, Carbon $end, Collection $accounts): Income; /** * @param Carbon $date * * @return array */ - public function listOfMonths(Carbon $date); + public function listOfMonths(Carbon $date): array; /** * Returns an array of tags and their comparitive size with amounts bla bla. diff --git a/app/Helpers/Report/ReportQuery.php b/app/Helpers/Report/ReportQuery.php index da7269002f..dd451834b9 100644 --- a/app/Helpers/Report/ReportQuery.php +++ b/app/Helpers/Report/ReportQuery.php @@ -28,7 +28,7 @@ class ReportQuery implements ReportQueryInterface * * @return array */ - public function earnedPerMonth(Collection $accounts, Carbon $start, Carbon $end) + public function earnedPerMonth(Collection $accounts, Carbon $start, Carbon $end): array { $ids = $accounts->pluck('id')->toArray(); $query = Auth::user()->transactionjournals() @@ -72,7 +72,7 @@ class ReportQuery implements ReportQueryInterface * * @return Collection */ - public function expense(Collection $accounts, Carbon $start, Carbon $end) + public function expense(Collection $accounts, Carbon $start, Carbon $end): Collection { $ids = $accounts->pluck('id')->toArray(); $set = Auth::user()->transactionjournals() @@ -107,7 +107,7 @@ class ReportQuery implements ReportQueryInterface * * @return Collection */ - public function income(Collection $accounts, Carbon $start, Carbon $end) + public function income(Collection $accounts, Carbon $start, Carbon $end): Collection { $ids = $accounts->pluck('id')->toArray(); $set = Auth::user()->transactionjournals() @@ -142,7 +142,7 @@ class ReportQuery implements ReportQueryInterface * * @return array */ - public function spentPerMonth(Collection $accounts, Carbon $start, Carbon $end) + public function spentPerMonth(Collection $accounts, Carbon $start, Carbon $end): array { $ids = $accounts->pluck('id')->toArray(); $query = Auth::user()->transactionjournals() diff --git a/app/Helpers/Report/ReportQueryInterface.php b/app/Helpers/Report/ReportQueryInterface.php index db1efc6d5a..f746710ffb 100644 --- a/app/Helpers/Report/ReportQueryInterface.php +++ b/app/Helpers/Report/ReportQueryInterface.php @@ -24,7 +24,7 @@ interface ReportQueryInterface * * @return array */ - public function earnedPerMonth(Collection $accounts, Carbon $start, Carbon $end); + public function earnedPerMonth(Collection $accounts, Carbon $start, Carbon $end): array; /** * This method returns all the "out" transaction journals for the given account and given period. The amount @@ -36,7 +36,7 @@ interface ReportQueryInterface * * @return Collection */ - public function expense(Collection $accounts, Carbon $start, Carbon $end); + public function expense(Collection $accounts, Carbon $start, Carbon $end): Collection; /** * This method returns all the "in" transaction journals for the given account and given period. The amount @@ -48,7 +48,7 @@ interface ReportQueryInterface * * @return Collection */ - public function income(Collection $accounts, Carbon $start, Carbon $end); + public function income(Collection $accounts, Carbon $start, Carbon $end): Collection; /** * Returns an array of the amount of money spent in the given accounts (on withdrawals, opening balances and transfers) @@ -60,7 +60,7 @@ interface ReportQueryInterface * * @return array */ - public function spentPerMonth(Collection $accounts, Carbon $start, Carbon $end); + public function spentPerMonth(Collection $accounts, Carbon $start, Carbon $end): array; } diff --git a/app/Http/Controllers/Admin/HomeController.php b/app/Http/Controllers/Admin/HomeController.php index 81a75f086b..47dc4eee08 100644 --- a/app/Http/Controllers/Admin/HomeController.php +++ b/app/Http/Controllers/Admin/HomeController.php @@ -30,4 +30,4 @@ class HomeController extends Controller return view('admin.index', compact('title', 'mainTitleIcon')); } -} \ No newline at end of file +} diff --git a/app/Http/Controllers/Admin/UserController.php b/app/Http/Controllers/Admin/UserController.php index ad404e3e9f..9dbc765d07 100644 --- a/app/Http/Controllers/Admin/UserController.php +++ b/app/Http/Controllers/Admin/UserController.php @@ -67,4 +67,4 @@ class UserController extends Controller } -} \ No newline at end of file +} diff --git a/app/Http/Controllers/BudgetController.php b/app/Http/Controllers/BudgetController.php index 4305b02a8b..6223216e17 100644 --- a/app/Http/Controllers/BudgetController.php +++ b/app/Http/Controllers/BudgetController.php @@ -166,7 +166,7 @@ class BudgetController extends Controller foreach ($budgets as $budget) { $budget->spent = $repository->balanceInPeriod($budget, $start, $end, $accounts); $budget->currentRep = $repository->getCurrentRepetition($budget, $start, $end); - if ($budget->currentRep) { + if (!is_null($budget->currentRep->id)) { $budgeted = bcadd($budgeted, $budget->currentRep->amount); } $spent = bcadd($spent, $budget->spent); diff --git a/app/Http/Controllers/CategoryController.php b/app/Http/Controllers/CategoryController.php index ebc39a5f15..8bac8029d2 100644 --- a/app/Http/Controllers/CategoryController.php +++ b/app/Http/Controllers/CategoryController.php @@ -115,7 +115,7 @@ class CategoryController extends Controller */ public function index(CRI $repository, SCRI $singleRepository) { - $categories = $repository->listCategories(); + $categories = $repository->getCategories(); $categories->each( function (Category $category) use ($singleRepository) { diff --git a/app/Http/Controllers/Chart/AccountController.php b/app/Http/Controllers/Chart/AccountController.php index 4f0c5d365a..951e9bda4f 100644 --- a/app/Http/Controllers/Chart/AccountController.php +++ b/app/Http/Controllers/Chart/AccountController.php @@ -56,7 +56,7 @@ class AccountController extends Controller $cache->addProperty($reportType); $cache->addProperty($accounts); if ($cache->has()) { - return Response::json($cache->get()); // @codeCoverageIgnore + return Response::json($cache->get()); } // make chart: @@ -86,7 +86,7 @@ class AccountController extends Controller $cache->addProperty('expenseAccounts'); $cache->addProperty('accounts'); if ($cache->has()) { - return Response::json($cache->get()); // @codeCoverageIgnore + return Response::json($cache->get()); } $data = $this->generator->expenseAccounts($accounts, $start, $end); @@ -117,7 +117,7 @@ class AccountController extends Controller $cache->addProperty('frontpage'); $cache->addProperty('accounts'); if ($cache->has()) { - return Response::json($cache->get()); // @codeCoverageIgnore + return Response::json($cache->get()); } $data = $this->generator->frontpage($accounts, $start, $end); @@ -149,7 +149,7 @@ class AccountController extends Controller $cache->addProperty('single'); $cache->addProperty($account->id); if ($cache->has()) { - return Response::json($cache->get()); // @codeCoverageIgnore + return Response::json($cache->get()); } $data = $this->generator->single($account, $start, $end); diff --git a/app/Http/Controllers/Chart/BillController.php b/app/Http/Controllers/Chart/BillController.php index aba1965f05..88c617a621 100644 --- a/app/Http/Controllers/Chart/BillController.php +++ b/app/Http/Controllers/Chart/BillController.php @@ -78,7 +78,7 @@ class BillController extends Controller $cache->addProperty('bill'); $cache->addProperty($bill->id); if ($cache->has()) { - return Response::json($cache->get()); // @codeCoverageIgnore + return Response::json($cache->get()); } // get first transaction or today for start: diff --git a/app/Http/Controllers/Chart/BudgetController.php b/app/Http/Controllers/Chart/BudgetController.php index 7452997d4c..b7025dd279 100644 --- a/app/Http/Controllers/Chart/BudgetController.php +++ b/app/Http/Controllers/Chart/BudgetController.php @@ -57,7 +57,7 @@ class BudgetController extends Controller $cache->addProperty('budget'); if ($cache->has()) { - return Response::json($cache->get()); // @codeCoverageIgnore + return Response::json($cache->get()); } $final = clone $last; @@ -108,7 +108,7 @@ class BudgetController extends Controller $cache->addProperty($budget->id); $cache->addProperty($repetition->id); if ($cache->has()) { - return Response::json($cache->get()); // @codeCoverageIgnore + return Response::json($cache->get()); } $set = $repository->getExpensesPerDay($budget, $start, $end); @@ -161,7 +161,7 @@ class BudgetController extends Controller $cache->addProperty('budget'); $cache->addProperty('all'); if ($cache->has()) { - return Response::json($cache->get()); // @codeCoverageIgnore + return Response::json($cache->get()); } $budgets = $repository->getBudgetsAndLimitsInRange($start, $end); @@ -230,7 +230,7 @@ class BudgetController extends Controller $cache->addProperty('multiYearBudget'); if ($cache->has()) { - return Response::json($cache->get()); // @codeCoverageIgnore + return Response::json($cache->get()); } /* @@ -310,7 +310,7 @@ class BudgetController extends Controller $cache->addProperty('budget'); $cache->addProperty('year'); if ($cache->has()) { - return Response::json($cache->get()); // @codeCoverageIgnore + return Response::json($cache->get()); } $budgetInformation = $repository->getBudgetsAndExpensesPerMonth($accounts, $start, $end); diff --git a/app/Http/Controllers/Chart/CategoryController.php b/app/Http/Controllers/Chart/CategoryController.php index b0e5eaf873..3eb80cf958 100644 --- a/app/Http/Controllers/Chart/CategoryController.php +++ b/app/Http/Controllers/Chart/CategoryController.php @@ -67,7 +67,7 @@ class CategoryController extends Controller $cache->addProperty('all'); $cache->addProperty('categories'); if ($cache->has()) { - return Response::json($cache->get()); // @codeCoverageIgnore + return Response::json($cache->get()); } $spentArray = $repository->spentPerDay($category, $start, $end); $earnedArray = $repository->earnedPerDay($category, $start, $end); @@ -130,7 +130,7 @@ class CategoryController extends Controller $cache->addProperty('category'); $cache->addProperty('earned-in-period'); if ($cache->has()) { - return Response::json($cache->get()); // @codeCoverageIgnore + return Response::json($cache->get()); } $set = $repository->earnedForAccountsPerMonth($accounts, $start, $end); @@ -169,7 +169,7 @@ class CategoryController extends Controller $cache->addProperty('category'); $cache->addProperty('frontpage'); if ($cache->has()) { - return Response::json($cache->get()); // @codeCoverageIgnore + return Response::json($cache->get()); } // get data for categories (and "no category"): @@ -215,7 +215,7 @@ class CategoryController extends Controller $cache->addProperty('multiYearCategory'); if ($cache->has()) { - return Response::json($cache->get()); // @codeCoverageIgnore + return Response::json($cache->get()); } $entries = new Collection; @@ -321,7 +321,7 @@ class CategoryController extends Controller $cache->addProperty('category'); $cache->addProperty('spent-in-period'); if ($cache->has()) { - return Response::json($cache->get()); // @codeCoverageIgnore + return Response::json($cache->get()); } diff --git a/app/Http/Controllers/Chart/PiggyBankController.php b/app/Http/Controllers/Chart/PiggyBankController.php index bf2d91a445..1eab1366f0 100644 --- a/app/Http/Controllers/Chart/PiggyBankController.php +++ b/app/Http/Controllers/Chart/PiggyBankController.php @@ -47,11 +47,10 @@ class PiggyBankController extends Controller $cache->addProperty('piggy-history'); $cache->addProperty($piggyBank->id); if ($cache->has()) { - return Response::json($cache->get()); // @codeCoverageIgnore + return Response::json($cache->get()); } - /** @var Collection $set */ - $set = new Collection($repository->getEventSummarySet($piggyBank)); + $set = $repository->getEventSummarySet($piggyBank); $data = $this->generator->history($set); $cache->store($data); diff --git a/app/Http/Controllers/Chart/ReportController.php b/app/Http/Controllers/Chart/ReportController.php index 7362ae68a8..8bcff1ec36 100644 --- a/app/Http/Controllers/Chart/ReportController.php +++ b/app/Http/Controllers/Chart/ReportController.php @@ -54,7 +54,7 @@ class ReportController extends Controller $cache->addProperty($accounts); $cache->addProperty($end); if ($cache->has()) { - return Response::json($cache->get()); // @codeCoverageIgnore + return Response::json($cache->get()); } $ids = $accounts->pluck('id')->toArray(); $current = clone $start; @@ -102,7 +102,7 @@ class ReportController extends Controller $cache->addProperty($accounts); $cache->addProperty($end); if ($cache->has()) { - return Response::json($cache->get()); // @codeCoverageIgnore + return Response::json($cache->get()); } // spent per month, and earned per month. For a specific set of accounts @@ -146,7 +146,7 @@ class ReportController extends Controller $cache->addProperty($reportType); $cache->addProperty($accounts); if ($cache->has()) { - return Response::json($cache->get()); // @codeCoverageIgnore + return Response::json($cache->get()); } // spent per month, and earned per month. For a specific set of accounts // grouped by month diff --git a/app/Http/Controllers/HelpController.php b/app/Http/Controllers/HelpController.php index 67e177a53d..9f7b58ff78 100644 --- a/app/Http/Controllers/HelpController.php +++ b/app/Http/Controllers/HelpController.php @@ -28,8 +28,9 @@ class HelpController extends Controller */ public function show(HelpInterface $help, string $route) { - $content = [ - 'text' => '
There is no help for this route!
', + $language = Preferences::get('language', env('DEFAULT_LANGUAGE', 'en_US'))->data; + $content = [ + 'text' => '' . strval(trans('firefly.route_has_no_help')) . '
', 'title' => 'Help', ]; @@ -41,16 +42,17 @@ class HelpController extends Controller if ($help->inCache($route)) { $content = [ - 'text' => $help->getFromCache('help.' . $route . '.text'), - 'title' => $help->getFromCache('help.' . $route . '.title'), + 'text' => $help->getFromCache('help.' . $route . '.text.' . $language), + 'title' => $help->getFromCache('help.' . $route . '.title.' . $language), ]; return Response::json($content); } - $language = Preferences::get('language', env('DEFAULT_LANGUAGE', 'en_US'))->data; - $content = $help->getFromGithub($language, $route); - $help->putInCache($route, $content); + Log::debug('Will get help from Github for language "' . $language . '" and route "' . $route . '".'); + $content = $help->getFromGithub($language, $route); + + $help->putInCache($route, $language, $content); return Response::json($content); diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index 5b76367ded..ee5a8a9147 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -1,5 +1,6 @@ sumOfEverything(); if (bccomp($sum, '0') !== 0) { - Session::flash( - 'error', 'Your transactions are unbalanced. This means a' - . ' withdrawal, deposit or transfer was not stored properly. ' - . 'Please check your accounts and transactions for errors (' . $sum . ').' - ); + Session::flash('error', strval(trans('firefly.unbalanced_error', ['amount' => Amount::format($sum,false)]))); } foreach ($accounts as $account) { diff --git a/app/Http/Controllers/JsonController.php b/app/Http/Controllers/JsonController.php index 229879cf1a..1df37061df 100644 --- a/app/Http/Controllers/JsonController.php +++ b/app/Http/Controllers/JsonController.php @@ -114,7 +114,7 @@ class JsonController extends Controller $cache->addProperty($end); $cache->addProperty('box-in'); if ($cache->has()) { - return Response::json($cache->get()); // @codeCoverageIgnore + return Response::json($cache->get()); } $accounts = $accountRepository->getAccounts(['Default account', 'Asset account', 'Cash account']); $amount = $reportQuery->income($accounts, $start, $end)->sum('journalAmount'); @@ -145,7 +145,7 @@ class JsonController extends Controller $cache->addProperty($end); $cache->addProperty('box-out'); if ($cache->has()) { - return Response::json($cache->get()); // @codeCoverageIgnore + return Response::json($cache->get()); } $amount = $reportQuery->expense($accounts, $start, $end)->sum('journalAmount'); @@ -165,7 +165,7 @@ class JsonController extends Controller */ public function categories(CRI $repository) { - $list = $repository->listCategories(); + $list = $repository->getCategories(); $return = []; foreach ($list as $entry) { $return[] = $entry->name; diff --git a/app/Http/Controllers/Popup/ReportController.php b/app/Http/Controllers/Popup/ReportController.php index 47c76aed89..a0a0055b0d 100644 --- a/app/Http/Controllers/Popup/ReportController.php +++ b/app/Http/Controllers/Popup/ReportController.php @@ -231,4 +231,4 @@ class ReportController extends Controller return $attributes; } -} \ No newline at end of file +} diff --git a/app/Http/Controllers/ReportController.php b/app/Http/Controllers/ReportController.php index b416c7fa63..0873d45846 100644 --- a/app/Http/Controllers/ReportController.php +++ b/app/Http/Controllers/ReportController.php @@ -7,11 +7,15 @@ use FireflyIII\Helpers\Report\BalanceReportHelperInterface; use FireflyIII\Helpers\Report\BudgetReportHelperInterface; use FireflyIII\Helpers\Report\ReportHelperInterface; use FireflyIII\Models\Account; +use FireflyIII\Models\TransactionJournal; use FireflyIII\Repositories\Account\AccountRepositoryInterface as ARI; +use FireflyIII\Repositories\Budget\BudgetRepositoryInterface; +use FireflyIII\Repositories\Category\CategoryRepositoryInterface; use Illuminate\Support\Collection; use Log; use Preferences; use Session; +use Steam; use View; /** @@ -100,22 +104,22 @@ class ReportController extends Controller $start = session('first'); } + View::share( + 'subTitle', trans( + 'firefly.report_' . $reportType, + [ + 'start' => $start->formatLocalized($this->monthFormat), + 'end' => $end->formatLocalized($this->monthFormat), + ] + ) + ); + View::share('subTitleIcon', 'fa-calendar'); + switch ($reportType) { default: throw new FireflyException('Unfortunately, reports of the type "' . e($reportType) . '" are not yet available. '); case 'default': - View::share( - 'subTitle', trans( - 'firefly.report_default', - [ - 'start' => $start->formatLocalized($this->monthFormat), - 'end' => $end->formatLocalized($this->monthFormat), - ] - ) - ); - View::share('subTitleIcon', 'fa-calendar'); - // more than one year date difference means year report. if ($start->diffInMonths($end) > 12) { return $this->defaultMultiYear($reportType, $start, $end, $accounts); @@ -125,27 +129,92 @@ class ReportController extends Controller return $this->defaultYear($reportType, $start, $end, $accounts); } + // otherwise default return $this->defaultMonth($reportType, $start, $end, $accounts); case 'audit': - - View::share( - 'subTitle', trans( - 'firefly.report_audit', - [ - 'start' => $start->formatLocalized($this->monthFormat), - 'end' => $end->formatLocalized($this->monthFormat), - ] - ) - ); - View::share('subTitleIcon', 'fa-calendar'); - - throw new FireflyException('Unfortunately, reports of the type "' . e($reportType) . '" are not yet available. '); - break; + // always default + return $this->auditReport($start, $end, $accounts); } } + /** + * @param Carbon $start + * @param Carbon $end + * @param Collection $accounts + * + * @return View + */ + private function auditReport(Carbon $start, Carbon $end, Collection $accounts) + { + /** @var ARI $repos */ + $repos = app('FireflyIII\Repositories\Account\AccountRepositoryInterface'); + $auditData = []; + $dayBefore = clone $start; + $dayBefore->subDay(); + /** @var Account $account */ + foreach ($accounts as $account) { + + // balance the day before: + $id = $account->id; + $first = $repos->oldestJournalDate($account); + $last = $repos->newestJournalDate($account); + $exists = false; + $journals = new Collection; + $dayBeforeBalance = Steam::balance($account, $dayBefore); + + /* + * Is there even activity on this account between the requested dates? + */ + if ($start->between($first, $last) || $end->between($first, $last)) { + $exists = true; + $journals = $repos->getJournalsInRange($account, $start, $end); + + } + /* + * Reverse set, get balances. + */ + $journals = $journals->reverse(); + $startBalance = $dayBeforeBalance; + /** @var TransactionJournal $journal */ + foreach ($journals as $journal) { + $journal->before = $startBalance; + $transactionAmount = $journal->source_amount; + + // get currently relevant transaction: + if (intval($journal->destination_account_id) === $account->id) { + $transactionAmount = $journal->destination_amount; + } + $newBalance = bcadd($startBalance, $transactionAmount); + $journal->after = $newBalance; + $startBalance = $newBalance; + + } + + /* + * Reverse set again. + */ + $auditData[$id]['journals'] = $journals->reverse(); + $auditData[$id]['exists'] = $exists; + $auditData[$id]['end'] = $end->formatLocalized(trans('config.month_and_day')); + $auditData[$id]['endBalance'] = Steam::balance($account, $end); + $auditData[$id]['dayBefore'] = $dayBefore->formatLocalized(trans('config.month_and_day')); + $auditData[$id]['dayBeforeBalance'] = $dayBeforeBalance; + } + + + $reportType = 'audit'; + $accountIds = join(',', $accounts->pluck('id')->toArray()); + + $hideable = ['buttons', 'icon', 'description', 'balance_before', 'amount', 'balance_after', 'date', 'book_date', 'process_date', 'interest_date', + 'from', 'to', 'budget', 'category', 'bill', 'create_date', 'update_date', + ]; + $defaultShow = ['icon', 'description', 'balance_before', 'amount', 'balance_after', 'date', 'to']; + + return view('reports.audit.report', compact('start', 'end', 'reportType', 'accountIds', 'accounts', 'auditData', 'hideable', 'defaultShow')); + } + /** * @param $reportType * @param Carbon $start @@ -203,7 +272,7 @@ class ReportController extends Controller $expenseTopLength = 8; // list of users stuff: $budgets = app('FireflyIII\Repositories\Budget\BudgetRepositoryInterface')->getActiveBudgets(); - $categories = app('FireflyIII\Repositories\Category\CategoryRepositoryInterface')->listCategories(); + $categories = app('FireflyIII\Repositories\Category\CategoryRepositoryInterface')->getCategories(); $accountReport = $this->accountHelper->getAccountReport($start, $end, $accounts); $incomes = $this->helper->getIncomeReport($start, $end, $accounts); $expenses = $this->helper->getExpenseReport($start, $end, $accounts); @@ -264,6 +333,4 @@ class ReportController extends Controller ) ); } - - } diff --git a/app/Http/Controllers/TransactionController.php b/app/Http/Controllers/TransactionController.php index a0971dd904..b70fd3ac54 100644 --- a/app/Http/Controllers/TransactionController.php +++ b/app/Http/Controllers/TransactionController.php @@ -20,6 +20,7 @@ use FireflyIII\Repositories\Journal\JournalRepositoryInterface; use FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface; use Illuminate\Support\Collection; use Input; +use Log; use Preferences; use Response; use Session; @@ -307,6 +308,7 @@ class TransactionController extends Controller Session::flash('info', $att->getMessages()->get('attachments')); } + Log::debug('Triggered TransactionJournalStored with transaction journal #' . $journal->id.' and piggy #' . intval($request->get('piggy_bank_id'))); event(new TransactionJournalStored($journal, intval($request->get('piggy_bank_id')))); Session::flash('success', strval(trans('firefly.stored_journal', ['description' => e($journal->description)]))); diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php index 064d21119f..c7d8e2bb63 100644 --- a/app/Http/Kernel.php +++ b/app/Http/Kernel.php @@ -29,6 +29,23 @@ use Illuminate\View\Middleware\ShareErrorsFromSession; */ class Kernel extends HttpKernel { + /** + * The bootstrap classes for the application. + * + * Next upgrade should verify these are all here. + * + * @var array + */ + protected $bootstrappers = [ + 'Illuminate\Foundation\Bootstrap\DetectEnvironment', + 'Illuminate\Foundation\Bootstrap\LoadConfiguration', + 'FireflyIII\Bootstrap\ConfigureLogging', + 'Illuminate\Foundation\Bootstrap\HandleExceptions', + 'Illuminate\Foundation\Bootstrap\RegisterFacades', + 'Illuminate\Foundation\Bootstrap\RegisterProviders', + 'Illuminate\Foundation\Bootstrap\BootProviders', + ]; + /** * The application's global HTTP middleware stack. * diff --git a/app/Http/Middleware/Range.php b/app/Http/Middleware/Range.php index 584611dc7c..43b8d5420f 100644 --- a/app/Http/Middleware/Range.php +++ b/app/Http/Middleware/Range.php @@ -69,7 +69,7 @@ class Range /** @var \FireflyIII\Repositories\Journal\JournalRepositoryInterface $repository */ $repository = app('FireflyIII\Repositories\Journal\JournalRepositoryInterface'); $journal = $repository->first(); - if ($journal) { + if (!is_null($journal->id)) { Session::put('first', $journal->date); } else { Session::put('first', Carbon::now()->startOfYear()); diff --git a/app/Jobs/ExecuteRuleGroupOnExistingTransactions.php b/app/Jobs/ExecuteRuleGroupOnExistingTransactions.php index 242f9d85f1..20b33230e9 100644 --- a/app/Jobs/ExecuteRuleGroupOnExistingTransactions.php +++ b/app/Jobs/ExecuteRuleGroupOnExistingTransactions.php @@ -44,7 +44,7 @@ class ExecuteRuleGroupOnExistingTransactions extends Job implements ShouldQueue /** * @return Collection */ - public function getAccounts() + public function getAccounts(): Collection { return $this->accounts; } @@ -61,7 +61,7 @@ class ExecuteRuleGroupOnExistingTransactions extends Job implements ShouldQueue /** * @return \Carbon\Carbon */ - public function getEndDate() + public function getEndDate(): Carbon { return $this->endDate; } @@ -78,7 +78,7 @@ class ExecuteRuleGroupOnExistingTransactions extends Job implements ShouldQueue /** * @return \Carbon\Carbon */ - public function getStartDate() + public function getStartDate(): Carbon { return $this->startDate; } @@ -95,7 +95,7 @@ class ExecuteRuleGroupOnExistingTransactions extends Job implements ShouldQueue /** * @return User */ - public function getUser() + public function getUser(): User { return $this->user; } diff --git a/app/Jobs/MailError.php b/app/Jobs/MailError.php index 09b6af6cca..ff3298aa28 100644 --- a/app/Jobs/MailError.php +++ b/app/Jobs/MailError.php @@ -38,7 +38,6 @@ class MailError extends Job implements ShouldQueue * @param string $ipAddress * @param array $exceptionData * - * @internal param array $exception */ public function __construct(User $user, string $destination, string $ipAddress, array $exceptionData) { diff --git a/app/Models/Account.php b/app/Models/Account.php index 28a3c904ec..eaddfd0637 100644 --- a/app/Models/Account.php +++ b/app/Models/Account.php @@ -4,6 +4,8 @@ use Auth; use Crypt; use Illuminate\Database\Eloquent\Builder as EloquentBuilder; use Illuminate\Database\Eloquent\Model; +use Illuminate\Database\Eloquent\Relations\BelongsTo; +use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Database\Eloquent\SoftDeletes; use Illuminate\Database\Query\JoinClause; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; @@ -146,36 +148,39 @@ class Account extends Model } /** - * @return \Illuminate\Database\Eloquent\Relations\HasMany + * @return HasMany */ - public function accountMeta() + public function accountMeta(): HasMany { return $this->hasMany('FireflyIII\Models\AccountMeta'); } /** - * @codeCoverageIgnore - * @return \Illuminate\Database\Eloquent\Relations\BelongsTo + * @return BelongsTo */ - public function accountType() + public function accountType(): BelongsTo { return $this->belongsTo('FireflyIII\Models\AccountType'); } /** - * @codeCoverageIgnore + * FIXME can return null * * @param $value * * @return string */ - public function getIbanAttribute($value) + public function getIbanAttribute($value): string { if (is_null($value)) { - return null; + return ''; + } + $result = Crypt::decrypt($value); + if (is_null($result)) { + return ''; } - return Crypt::decrypt($value); + return $result; } /** @@ -184,7 +189,7 @@ class Account extends Model * * @return string */ - public function getMeta($fieldName): string + public function getMeta(string $fieldName): string { foreach ($this->accountMeta as $meta) { if ($meta->name == $fieldName) { @@ -196,13 +201,12 @@ class Account extends Model } /** - * @codeCoverageIgnore * * @param $value * * @return string */ - public function getNameAttribute($value) + public function getNameAttribute($value): string { if (intval($this->encrypted) == 1) { @@ -216,7 +220,7 @@ class Account extends Model * * @return string */ - public function getNameForEditformAttribute() + public function getNameForEditformAttribute(): string { $name = $this->name; if ($this->accountType->type == 'Cash account') { @@ -227,16 +231,14 @@ class Account extends Model } /** - * @codeCoverageIgnore - * @return \Illuminate\Database\Eloquent\Relations\HasMany + * @return HasMany */ - public function piggyBanks() + public function piggyBanks(): HasMany { return $this->hasMany('FireflyIII\Models\PiggyBank'); } /** - * @codeCoverageIgnore * * @param EloquentBuilder $query * @param array $types @@ -251,7 +253,6 @@ class Account extends Model } /** - * @codeCoverageIgnore * * @param EloquentBuilder $query * @param string $name @@ -269,7 +270,6 @@ class Account extends Model } /** - * @codeCoverageIgnore * * @param $value */ @@ -279,7 +279,6 @@ class Account extends Model } /** - * @codeCoverageIgnore * * @param $value */ @@ -292,7 +291,6 @@ class Account extends Model /** * @param $value * - * @codeCoverageIgnore */ public function setVirtualBalanceAttribute($value) { @@ -300,19 +298,17 @@ class Account extends Model } /** - * @codeCoverageIgnore - * @return \Illuminate\Database\Eloquent\Relations\HasMany + * @return HasMany */ - public function transactions() + public function transactions(): HasMany { return $this->hasMany('FireflyIII\Models\Transaction'); } /** - * @codeCoverageIgnore - * @return \Illuminate\Database\Eloquent\Relations\BelongsTo + * @return BelongsTo */ - public function user() + public function user(): BelongsTo { return $this->belongsTo('FireflyIII\User'); } diff --git a/app/Models/AccountMeta.php b/app/Models/AccountMeta.php index aaa4f2ca44..794c3c2128 100644 --- a/app/Models/AccountMeta.php +++ b/app/Models/AccountMeta.php @@ -1,6 +1,7 @@ belongsTo('FireflyIII\Models\Account'); } diff --git a/app/Models/AccountType.php b/app/Models/AccountType.php index 7af6352c90..f9b6757fd1 100644 --- a/app/Models/AccountType.php +++ b/app/Models/AccountType.php @@ -1,6 +1,7 @@ hasMany('FireflyIII\Models\Account'); } diff --git a/app/Models/Attachment.php b/app/Models/Attachment.php index 7685847ac2..8252cbf65f 100644 --- a/app/Models/Attachment.php +++ b/app/Models/Attachment.php @@ -6,6 +6,8 @@ namespace FireflyIII\Models; use Auth; use Crypt; use Illuminate\Database\Eloquent\Model; +use Illuminate\Database\Eloquent\Relations\BelongsTo; +use Illuminate\Database\Eloquent\Relations\MorphTo; use Illuminate\Database\Eloquent\SoftDeletes; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; @@ -70,8 +72,10 @@ class Attachment extends Model /** * Get all of the owning imageable models. + * + * @return MorphTo */ - public function attachable() + public function attachable(): MorphTo { return $this->morphTo(); } @@ -87,8 +91,6 @@ class Attachment extends Model } /** - * @codeCoverageIgnore - * * @param $value * * @return null|string @@ -103,8 +105,6 @@ class Attachment extends Model } /** - * @codeCoverageIgnore - * * @param $value * * @return null|string @@ -119,8 +119,6 @@ class Attachment extends Model } /** - * @codeCoverageIgnore - * * @param $value * * @return null|string @@ -135,7 +133,6 @@ class Attachment extends Model } /** - * @codeCoverageIgnore * * @param $value * @@ -151,7 +148,6 @@ class Attachment extends Model } /** - * @codeCoverageIgnore * * @param $value * @@ -169,7 +165,7 @@ class Attachment extends Model /** * @param string $value */ - public function setDescriptionAttribute($value) + public function setDescriptionAttribute(string $value) { $this->attributes['description'] = Crypt::encrypt($value); } @@ -177,7 +173,7 @@ class Attachment extends Model /** * @param string $value */ - public function setFilenameAttribute($value) + public function setFilenameAttribute(string $value) { $this->attributes['filename'] = Crypt::encrypt($value); } @@ -185,7 +181,7 @@ class Attachment extends Model /** * @param string $value */ - public function setMimeAttribute($value) + public function setMimeAttribute(string $value) { $this->attributes['mime'] = Crypt::encrypt($value); } @@ -193,7 +189,7 @@ class Attachment extends Model /** * @param string $value */ - public function setNotesAttribute($value) + public function setNotesAttribute(string $value) { $this->attributes['notes'] = Crypt::encrypt($value); } @@ -201,16 +197,15 @@ class Attachment extends Model /** * @param string $value */ - public function setTitleAttribute($value) + public function setTitleAttribute(string $value) { $this->attributes['title'] = Crypt::encrypt($value); } /** - * @codeCoverageIgnore - * @return \Illuminate\Database\Eloquent\Relations\BelongsTo + * @return BelongsTo */ - public function user() + public function user(): BelongsTo { return $this->belongsTo('FireflyIII\User'); } diff --git a/app/Models/Bill.php b/app/Models/Bill.php index 0742cc8e26..4ceb09a93e 100644 --- a/app/Models/Bill.php +++ b/app/Models/Bill.php @@ -3,6 +3,8 @@ use Auth; use Crypt; use Illuminate\Database\Eloquent\Model; +use Illuminate\Database\Eloquent\Relations\BelongsTo; +use Illuminate\Database\Eloquent\Relations\HasMany; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; /** @@ -135,17 +137,17 @@ class Bill extends Model } /** - * @return \Illuminate\Database\Eloquent\Relations\HasMany + * @return HasMany */ - public function transactionjournals() + public function transactionjournals(): HasMany { return $this->hasMany('FireflyIII\Models\TransactionJournal'); } /** - * @return \Illuminate\Database\Eloquent\Relations\BelongsTo + * @return BelongsTo */ - public function user() + public function user(): BelongsTo { return $this->belongsTo('FireflyIII\User'); } diff --git a/app/Models/Budget.php b/app/Models/Budget.php index 8b26f14c3c..092477fa6b 100644 --- a/app/Models/Budget.php +++ b/app/Models/Budget.php @@ -3,6 +3,7 @@ use Auth; use Crypt; use Illuminate\Database\Eloquent\Model; +use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\SoftDeletes; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; @@ -136,9 +137,9 @@ class Budget extends Model } /** - * @return \Illuminate\Database\Eloquent\Relations\BelongsTo + * @return BelongsTo */ - public function user() + public function user(): BelongsTo { return $this->belongsTo('FireflyIII\User'); } diff --git a/app/Models/Category.php b/app/Models/Category.php index ef6d20c3f9..f3139fdf7f 100644 --- a/app/Models/Category.php +++ b/app/Models/Category.php @@ -3,6 +3,7 @@ use Auth; use Crypt; use Illuminate\Database\Eloquent\Model; +use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\SoftDeletes; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; @@ -83,7 +84,6 @@ class Category extends Model } /** - * @codeCoverageIgnore * * @param $value * @@ -100,7 +100,6 @@ class Category extends Model } /** - * @codeCoverageIgnore * * @param $value */ @@ -111,7 +110,6 @@ class Category extends Model } /** - * @codeCoverageIgnore * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany */ public function transactionjournals() @@ -120,10 +118,9 @@ class Category extends Model } /** - * @codeCoverageIgnore - * @return \Illuminate\Database\Eloquent\Relations\BelongsTo + * @return BelongsTo */ - public function user() + public function user(): BelongsTo { return $this->belongsTo('FireflyIII\User'); } diff --git a/app/Models/Component.php b/app/Models/Component.php index 5e8214d2aa..f4794eb3f2 100644 --- a/app/Models/Component.php +++ b/app/Models/Component.php @@ -25,14 +25,7 @@ use Illuminate\Database\Eloquent\Model; */ class Component extends Model { + protected $dates = ['created_at', 'updated_at', 'deleted_at']; protected $fillable = ['user_id', 'name', 'class']; - /** - * @return array - */ - public function getDates() - { - return ['created_at', 'updated_at', 'deleted_at']; - } - } diff --git a/app/Models/ExportJob.php b/app/Models/ExportJob.php index 22a6d4020e..e571bbfea0 100644 --- a/app/Models/ExportJob.php +++ b/app/Models/ExportJob.php @@ -64,7 +64,6 @@ class ExportJob extends Model } /** - * @codeCoverageIgnore * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ public function user() diff --git a/app/Models/Tag.php b/app/Models/Tag.php index c7bcd66d71..9646cd855e 100644 --- a/app/Models/Tag.php +++ b/app/Models/Tag.php @@ -109,7 +109,6 @@ class Tag extends Model } /** - * @codeCoverageIgnore * * @param $value * @@ -125,7 +124,6 @@ class Tag extends Model } /** - * @codeCoverageIgnore * * @param $value * @@ -155,7 +153,6 @@ class Tag extends Model } /** - * @codeCoverageIgnore * * @param $value */ @@ -165,7 +162,6 @@ class Tag extends Model } /** - * @codeCoverageIgnore * * @param $value */ @@ -175,7 +171,6 @@ class Tag extends Model } /** - * @codeCoverageIgnore * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany */ public function transactionjournals() @@ -184,7 +179,6 @@ class Tag extends Model } /** - * @codeCoverageIgnore * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ public function user() diff --git a/app/Models/TransactionJournal.php b/app/Models/TransactionJournal.php index 77e7601115..c87e3f426d 100644 --- a/app/Models/TransactionJournal.php +++ b/app/Models/TransactionJournal.php @@ -158,7 +158,6 @@ class TransactionJournal extends TransactionJournalSupport } /** - * @codeCoverageIgnore * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ public function bill() @@ -167,7 +166,6 @@ class TransactionJournal extends TransactionJournalSupport } /** - * @codeCoverageIgnore * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany */ public function budgets() @@ -176,7 +174,6 @@ class TransactionJournal extends TransactionJournalSupport } /** - * @codeCoverageIgnore * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany */ public function categories() @@ -185,7 +182,6 @@ class TransactionJournal extends TransactionJournalSupport } /** - * @codeCoverageIgnore * * @param $value * @@ -220,7 +216,7 @@ class TransactionJournal extends TransactionJournalSupport * * @return string */ - public function getMeta($fieldName): string + public function getMeta($fieldName) { foreach ($this->transactionjournalmeta as $meta) { if ($meta->name == $fieldName) { @@ -298,7 +294,6 @@ class TransactionJournal extends TransactionJournalSupport } /** - * @codeCoverageIgnore * @return \Illuminate\Database\Eloquent\Relations\HasMany */ public function piggyBankEvents() @@ -322,7 +317,6 @@ class TransactionJournal extends TransactionJournalSupport } /** - * @codeCoverageIgnore * * @param EloquentBuilder $query * @param Carbon $date @@ -335,7 +329,6 @@ class TransactionJournal extends TransactionJournalSupport } /** - * @codeCoverageIgnore * * @param EloquentBuilder $query * @param Carbon $date @@ -391,7 +384,6 @@ class TransactionJournal extends TransactionJournalSupport } /** - * @codeCoverageIgnore * * @param EloquentBuilder $query * @param array $types @@ -406,7 +398,6 @@ class TransactionJournal extends TransactionJournalSupport } /** - * @codeCoverageIgnore * * @param $value */ @@ -417,7 +408,6 @@ class TransactionJournal extends TransactionJournalSupport } /** - * @codeCoverageIgnore * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany */ public function tags() @@ -426,7 +416,6 @@ class TransactionJournal extends TransactionJournalSupport } /** - * @codeCoverageIgnore * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ public function transactionCurrency() @@ -435,7 +424,6 @@ class TransactionJournal extends TransactionJournalSupport } /** - * @codeCoverageIgnore * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ public function transactionType() @@ -444,7 +432,6 @@ class TransactionJournal extends TransactionJournalSupport } /** - * @codeCoverageIgnore * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany */ public function transactiongroups() @@ -461,7 +448,6 @@ class TransactionJournal extends TransactionJournalSupport } /** - * @codeCoverageIgnore * @return \Illuminate\Database\Eloquent\Relations\HasMany */ public function transactions() @@ -470,7 +456,6 @@ class TransactionJournal extends TransactionJournalSupport } /** - * @codeCoverageIgnore * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ public function user() diff --git a/app/Models/TransactionJournalMeta.php b/app/Models/TransactionJournalMeta.php index 2ebe924c1f..19687815cf 100644 --- a/app/Models/TransactionJournalMeta.php +++ b/app/Models/TransactionJournalMeta.php @@ -31,14 +31,36 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo; * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\TransactionJournalMeta whereName($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\TransactionJournalMeta whereData($value) * @mixin \Eloquent + * @property string $hash + * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\TransactionJournalMeta whereHash($value) */ class TransactionJournalMeta extends Model { protected $dates = ['created_at', 'updated_at']; - protected $fillable = ['transaction_journal_id', 'name', 'data']; + protected $fillable = ['transaction_journal_id', 'name', 'data','hash']; protected $table = 'journal_meta'; + /** + * @param $value + * + * @return mixed + */ + public function getDataAttribute($value) + { + return json_decode($value); + } + + /** + * @param $value + */ + public function setDataAttribute($value) + { + $data = json_encode($value); + $this->attributes['data'] = $data; + $this->attributes['hash'] = hash('sha256', $data); + } + /** * * @return \Illuminate\Database\Eloquent\Relations\BelongsTo diff --git a/app/Models/TransactionType.php b/app/Models/TransactionType.php index c6c39a1946..0ee5638c96 100644 --- a/app/Models/TransactionType.php +++ b/app/Models/TransactionType.php @@ -63,7 +63,6 @@ class TransactionType extends Model } /** - * @codeCoverageIgnore * * @return \Illuminate\Database\Eloquent\Relations\HasMany */ diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index e370e91496..4475d28529 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -4,7 +4,8 @@ declare(strict_types = 1); namespace FireflyIII\Providers; use Illuminate\Support\ServiceProvider; - +use Log; +use Config; /** * Class AppServiceProvider * @@ -29,6 +30,10 @@ class AppServiceProvider extends ServiceProvider */ public function register() { - // + // make sure the logger doesn't log everything when it doesn't need to. + $monolog = Log::getMonolog(); + foreach ($monolog->getHandlers() as $handler) { + $handler->setLevel(Config::get('app.log-level')); + } } } diff --git a/app/Providers/EventServiceProvider.php b/app/Providers/EventServiceProvider.php index 6df4248721..929c1d5a3a 100644 --- a/app/Providers/EventServiceProvider.php +++ b/app/Providers/EventServiceProvider.php @@ -84,7 +84,7 @@ class EventServiceProvider extends ServiceProvider try { $repetition->save(); } catch (QueryException $e) { - Log::error('Trying to save new LimitRepetition failed: ' . $e->getMessage()); // @codeCoverageIgnore + Log::error('Trying to save new LimitRepetition failed: ' . $e->getMessage()); } } else { if ($set->count() == 1) { diff --git a/app/Providers/FireflyServiceProvider.php b/app/Providers/FireflyServiceProvider.php index 40018fdb48..9994b5ba36 100644 --- a/app/Providers/FireflyServiceProvider.php +++ b/app/Providers/FireflyServiceProvider.php @@ -24,7 +24,6 @@ use Validator; * Class FireflyServiceProvider * * @package FireflyIII\Providers - * @codeCoverageIgnore */ class FireflyServiceProvider extends ServiceProvider { diff --git a/app/Repositories/Account/AccountRepository.php b/app/Repositories/Account/AccountRepository.php index e37a21abbc..5de3ef5e38 100644 --- a/app/Repositories/Account/AccountRepository.php +++ b/app/Repositories/Account/AccountRepository.php @@ -14,6 +14,7 @@ use FireflyIII\Models\Transaction; use FireflyIII\Models\TransactionJournal; use FireflyIII\Models\TransactionType; use FireflyIII\User; +use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Pagination\LengthAwarePaginator; use Illuminate\Support\Collection; @@ -62,7 +63,7 @@ class AccountRepository implements AccountRepositoryInterface * @param Account $account * @param Account $moveTo * - * @return boolean + * @return bool */ public function destroy(Account $account, Account $moveTo = null): bool { @@ -174,7 +175,7 @@ class AccountRepository implements AccountRepositoryInterface * * @return Collection */ - public function getExpensesByDestination(Account $account, Collection $accounts, Carbon $start, Carbon $end) + public function getExpensesByDestination(Account $account, Collection $accounts, Carbon $start, Carbon $end): Collection { $ids = $accounts->pluck('id')->toArray(); $journals = $this->user->transactionjournals() @@ -253,13 +254,38 @@ class AccountRepository implements AccountRepositoryInterface return $set; } + /** + * Returns a list of transactions TO the given (asset) $account, but none from the + * given list of accounts + * + * @param Account $account + * @param Collection $accounts + * @param Carbon $start + * @param Carbon $end + * + * @return Collection + */ + public function getIncomeByDestination(Account $account, Collection $accounts, Carbon $start, Carbon $end): Collection + { + $ids = $accounts->pluck('id')->toArray(); + $journals = $this->user->transactionjournals() + ->expanded() + ->before($end) + ->where('source_account.id', $account->id) + ->whereIn('destination_account.id', $ids) + ->after($start) + ->get(TransactionJournal::QUERYFIELDS); + + return $journals; + } + /** * @param Account $account * @param int $page * * @return LengthAwarePaginator */ - public function getJournals(Account $account, $page): LengthAwarePaginator + public function getJournals(Account $account, int $page): LengthAwarePaginator { $offset = ($page - 1) * 50; $query = $this->user @@ -280,6 +306,32 @@ class AccountRepository implements AccountRepositoryInterface } + /** + * @param Account $account + * @param Carbon $start + * @param Carbon $end + * + * @return Collection + */ + public function getJournalsInRange(Account $account, Carbon $start, Carbon $end): Collection + { + $query = $this->user + ->transactionJournals() + ->expanded() + ->where( + function (Builder $q) use ($account) { + $q->where('destination_account.id', $account->id); + $q->orWhere('source_account.id', $account->id); + } + ) + ->after($start) + ->before($end); + + $set = $query->get(TransactionJournal::QUERYFIELDS); + + return $set; + } + /** * Get the accounts of a user that have piggy banks connected to them. * @@ -297,7 +349,6 @@ class AccountRepository implements AccountRepositoryInterface if (count($ids) > 0) { $accounts = $this->user->accounts()->whereIn('id', $ids)->where('accounts.active', 1)->get(); } - bcscale(2); $accounts->each( function (Account $account) use ($start, $end) { @@ -338,8 +389,6 @@ class AccountRepository implements AccountRepositoryInterface $start = clone Session::get('start', new Carbon); $end = clone Session::get('end', new Carbon); - bcscale(2); - $accounts->each( function (Account $account) use ($start, $end) { $account->startBalance = Steam::balance($account, $start); @@ -387,6 +436,56 @@ class AccountRepository implements AccountRepositoryInterface } + /** + * Returns the date of the very last transaction in this account. + * + * @param Account $account + * + * @return Carbon + */ + public function newestJournalDate(Account $account): Carbon + { + /** @var TransactionJournal $journal */ + $journal = TransactionJournal:: + leftJoin('transactions', 'transactions.transaction_journal_id', '=', 'transaction_journals.id') + ->where('transactions.account_id', $account->id) + ->orderBy('transaction_journals.date', 'ASC') + ->first(['transaction_journals.*']); + if (is_null($journal)) { + $date = new Carbon; + $date->addYear(); // in the future. + } else { + $date = $journal->date; + } + + return $date; + } + + /** + * Returns the date of the very first transaction in this account. + * + * @param Account $account + * + * @return Carbon + */ + public function oldestJournalDate(Account $account): Carbon + { + /** @var TransactionJournal $journal */ + $journal = TransactionJournal:: + leftJoin('transactions', 'transactions.transaction_journal_id', '=', 'transaction_journals.id') + ->where('transactions.account_id', $account->id) + ->orderBy('transaction_journals.date', 'DESC') + ->first(['transaction_journals.*']); + if (is_null($journal)) { + $date = new Carbon; + $date->addYear(); // in the future. + } else { + $date = $journal->date; + } + + return $date; + } + /** * @param Account $account * @@ -449,7 +548,7 @@ class AccountRepository implements AccountRepositoryInterface * * @return AccountMeta */ - public function storeMeta($account, $name, $value): AccountMeta + public function storeMeta(Account $account, string $name, $value): AccountMeta { return AccountMeta::create(['name' => $name, 'data' => $value, 'account_id' => $account->id,]); } @@ -542,9 +641,7 @@ class AccountRepository implements AccountRepositoryInterface if (!$existingAccount) { Log::error('Account create error: ' . $newAccount->getErrors()->toJson()); abort(500); - // @codeCoverageIgnoreStart } - // @codeCoverageIgnoreEnd $newAccount = $existingAccount; } @@ -676,29 +773,4 @@ class AccountRepository implements AccountRepositoryInterface } } - - /** - * Returns a list of transactions TO the given (asset) $account, but none from the - * given list of accounts - * - * @param Account $account - * @param Collection $accounts - * @param Carbon $start - * @param Carbon $end - * - * @return Collection - */ - public function getIncomeByDestination(Account $account, Collection $accounts, Carbon $start, Carbon $end) - { - $ids = $accounts->pluck('id')->toArray(); - $journals = $this->user->transactionjournals() - ->expanded() - ->before($end) - ->where('source_account.id', $account->id) - ->whereIn('destination_account.id', $ids) - ->after($start) - ->get(TransactionJournal::QUERYFIELDS); - - return $journals; - } } diff --git a/app/Repositories/Account/AccountRepositoryInterface.php b/app/Repositories/Account/AccountRepositoryInterface.php index 0e7fba5fd0..68fb208b0b 100644 --- a/app/Repositories/Account/AccountRepositoryInterface.php +++ b/app/Repositories/Account/AccountRepositoryInterface.php @@ -31,7 +31,7 @@ interface AccountRepositoryInterface * @param Account $account * @param Account $moveTo * - * @return boolean + * @return bool */ public function destroy(Account $account, Account $moveTo): bool; @@ -82,7 +82,7 @@ interface AccountRepositoryInterface * * @return Collection */ - public function getExpensesByDestination(Account $account, Collection $accounts, Carbon $start, Carbon $end); + public function getExpensesByDestination(Account $account, Collection $accounts, Carbon $start, Carbon $end): Collection; /** * @param TransactionJournal $journal @@ -119,7 +119,7 @@ interface AccountRepositoryInterface * * @return Collection */ - public function getIncomeByDestination(Account $account, Collection $accounts, Carbon $start, Carbon $end); + public function getIncomeByDestination(Account $account, Collection $accounts, Carbon $start, Carbon $end): Collection; /** * @param Account $account @@ -127,7 +127,16 @@ interface AccountRepositoryInterface * * @return LengthAwarePaginator */ - public function getJournals(Account $account, $page): LengthAwarePaginator; + public function getJournals(Account $account, int $page): LengthAwarePaginator; + + /** + * @param Account $account + * @param Carbon $start + * @param Carbon $end + * + * @return Collection + */ + public function getJournalsInRange(Account $account, Carbon $start, Carbon $end): Collection; /** * Get the accounts of a user that have piggy banks connected to them. @@ -151,6 +160,24 @@ interface AccountRepositoryInterface */ public function leftOnAccount(Account $account, Carbon $date): string; + /** + * Returns the date of the very last transaction in this account. + * + * @param Account $account + * + * @return Carbon + */ + public function newestJournalDate(Account $account): Carbon; + + /** + * Returns the date of the very first transaction in this account. + * + * @param Account $account + * + * @return Carbon + */ + public function oldestJournalDate(Account $account): Carbon; + /** * @param Account $account * @@ -172,7 +199,7 @@ interface AccountRepositoryInterface * * @return AccountMeta */ - public function storeMeta($account, $name, $value): AccountMeta; + public function storeMeta(Account $account, string $name, $value): AccountMeta; /** * @return string diff --git a/app/Repositories/Bill/BillRepository.php b/app/Repositories/Bill/BillRepository.php index 6eb28ea1d3..7420b1f902 100644 --- a/app/Repositories/Bill/BillRepository.php +++ b/app/Repositories/Bill/BillRepository.php @@ -40,7 +40,7 @@ class BillRepository implements BillRepositoryInterface /** * @param Bill $bill * - * @return boolean + * @return bool */ public function destroy(Bill $bill): bool { @@ -77,7 +77,7 @@ class BillRepository implements BillRepositoryInterface ->get( [ 'bills.*', - DB::raw('(`bills`.`amount_min` + `bills`.`amount_max` / 2) as `expectedAmount`'), + DB::raw('((`bills`.`amount_min` + `bills`.`amount_max`) / 2) as `expectedAmount`'), ] )->sortBy('name'); diff --git a/app/Repositories/Budget/BudgetRepository.php b/app/Repositories/Budget/BudgetRepository.php index dd7cffd278..fee7ec4421 100644 --- a/app/Repositories/Budget/BudgetRepository.php +++ b/app/Repositories/Budget/BudgetRepository.php @@ -48,27 +48,28 @@ class BudgetRepository extends ComponentRepository implements BudgetRepositoryIn * * @return string */ - public function balanceInPeriod(Budget $budget, Carbon $start, Carbon $end, Collection $accounts) + public function balanceInPeriod(Budget $budget, Carbon $start, Carbon $end, Collection $accounts): string { return $this->commonBalanceInPeriod($budget, $start, $end, $accounts); } /** - * @return void + * @return bool */ - public function cleanupBudgets() + public function cleanupBudgets(): bool { // delete limits with amount 0: BudgetLimit::where('amount', 0)->delete(); + return true; } /** * @param Budget $budget * - * @return boolean + * @return bool */ - public function destroy(Budget $budget) + public function destroy(Budget $budget): bool { $budget->delete(); @@ -114,7 +115,7 @@ class BudgetRepository extends ComponentRepository implements BudgetRepositoryIn * * @return Carbon */ - public function firstActivity(Budget $budget) + public function firstActivity(Budget $budget): Carbon { $first = $budget->transactionjournals()->orderBy('date', 'ASC')->first(); if ($first) { @@ -127,7 +128,7 @@ class BudgetRepository extends ComponentRepository implements BudgetRepositoryIn /** * @return Collection */ - public function getActiveBudgets() + public function getActiveBudgets(): Collection { /** @var Collection $set */ $set = $this->user->budgets()->where('active', 1)->get(); @@ -147,7 +148,7 @@ class BudgetRepository extends ComponentRepository implements BudgetRepositoryIn * * @return Collection */ - public function getAllBudgetLimitRepetitions(Carbon $start, Carbon $end) + public function getAllBudgetLimitRepetitions(Carbon $start, Carbon $end): Collection { /** @var Collection $repetitions */ return LimitRepetition:: @@ -167,7 +168,7 @@ class BudgetRepository extends ComponentRepository implements BudgetRepositoryIn * * @return Collection */ - public function getAllWithoutBudget(Account $account, Collection $accounts, Carbon $start, Carbon $end) + public function getAllWithoutBudget(Account $account, Collection $accounts, Carbon $start, Carbon $end): Collection { $ids = $accounts->pluck('id')->toArray(); @@ -192,7 +193,7 @@ class BudgetRepository extends ComponentRepository implements BudgetRepositoryIn * * @return Collection */ - public function getBudgetedPerYear(Collection $budgets, Carbon $start, Carbon $end) + public function getBudgetedPerYear(Collection $budgets, Carbon $start, Carbon $end): Collection { $budgetIds = $budgets->pluck('id')->toArray(); @@ -218,7 +219,7 @@ class BudgetRepository extends ComponentRepository implements BudgetRepositoryIn /** * @return Collection */ - public function getBudgets() + public function getBudgets(): Collection { /** @var Collection $set */ $set = $this->user->budgets()->get(); @@ -242,7 +243,7 @@ class BudgetRepository extends ComponentRepository implements BudgetRepositoryIn * * @return array */ - public function getBudgetsAndExpensesPerMonth(Collection $accounts, Carbon $start, Carbon $end) + public function getBudgetsAndExpensesPerMonth(Collection $accounts, Carbon $start, Carbon $end): array { $ids = $accounts->pluck('id')->toArray(); @@ -303,7 +304,7 @@ class BudgetRepository extends ComponentRepository implements BudgetRepositoryIn * * @return array */ - public function getBudgetsAndExpensesPerYear(Collection $budgets, Collection $accounts, Carbon $start, Carbon $end) + public function getBudgetsAndExpensesPerYear(Collection $budgets, Collection $accounts, Carbon $start, Carbon $end): array { $ids = $accounts->pluck('id')->toArray(); $budgetIds = $budgets->pluck('id')->toArray(); @@ -362,7 +363,7 @@ class BudgetRepository extends ComponentRepository implements BudgetRepositoryIn * * @return Collection */ - public function getBudgetsAndLimitsInRange(Carbon $start, Carbon $end) + public function getBudgetsAndLimitsInRange(Carbon $start, Carbon $end): Collection { /** @var Collection $set */ $set = $this->user @@ -402,14 +403,17 @@ class BudgetRepository extends ComponentRepository implements BudgetRepositoryIn * @param Carbon $start * @param Carbon $end * - * @return LimitRepetition|null + * @return LimitRepetition */ - public function getCurrentRepetition(Budget $budget, Carbon $start, Carbon $end) + public function getCurrentRepetition(Budget $budget, Carbon $start, Carbon $end): LimitRepetition { $data = $budget->limitrepetitions() ->where('limit_repetitions.startdate', $start->format('Y-m-d 00:00:00')) ->where('limit_repetitions.enddate', $end->format('Y-m-d 00:00:00')) ->first(['limit_repetitions.*']); + if(is_null($data)) { + return new LimitRepetition; + } return $data; } @@ -448,7 +452,7 @@ class BudgetRepository extends ComponentRepository implements BudgetRepositoryIn * * @return Collection */ - public function getExpensesPerDay(Budget $budget, Carbon $start, Carbon $end) + public function getExpensesPerDay(Budget $budget, Carbon $start, Carbon $end): Collection { $set = $this->user->budgets() ->leftJoin('budget_transaction_journal', 'budget_transaction_journal.budget_id', '=', 'budgets.id') @@ -471,7 +475,7 @@ class BudgetRepository extends ComponentRepository implements BudgetRepositoryIn * * @return Carbon */ - public function getFirstBudgetLimitDate(Budget $budget) + public function getFirstBudgetLimitDate(Budget $budget): Carbon { $limit = $budget->budgetlimits()->orderBy('startdate', 'ASC')->first(); if ($limit) { @@ -484,7 +488,7 @@ class BudgetRepository extends ComponentRepository implements BudgetRepositoryIn /** * @return Collection */ - public function getInactiveBudgets() + public function getInactiveBudgets(): Collection { /** @var Collection $set */ $set = $this->user->budgets()->where('active', 0)->get(); @@ -507,7 +511,7 @@ class BudgetRepository extends ComponentRepository implements BudgetRepositoryIn * * @return LengthAwarePaginator */ - public function getJournals(Budget $budget, LimitRepetition $repetition = null, int $take = 50) + public function getJournals(Budget $budget, LimitRepetition $repetition = null, int $take = 50): LengthAwarePaginator { $offset = intval(Input::get('page')) > 0 ? intval(Input::get('page')) * $take : 0; $setQuery = $budget->transactionjournals()->expanded() @@ -539,7 +543,7 @@ class BudgetRepository extends ComponentRepository implements BudgetRepositoryIn * * @return Collection */ - public function getWithoutBudget(Carbon $start, Carbon $end) + public function getWithoutBudget(Carbon $start, Carbon $end): Collection { return $this->user ->transactionjournals() @@ -559,7 +563,7 @@ class BudgetRepository extends ComponentRepository implements BudgetRepositoryIn * * @return Collection */ - public function getWithoutBudgetForAccounts(Collection $accounts, Carbon $start, Carbon $end) + public function getWithoutBudgetForAccounts(Collection $accounts, Carbon $start, Carbon $end): Collection { $ids = $accounts->pluck('id')->toArray(); @@ -633,7 +637,7 @@ class BudgetRepository extends ComponentRepository implements BudgetRepositoryIn * * @return array */ - public function spentAllPerDayForAccounts(Collection $accounts, Carbon $start, Carbon $end) + public function spentAllPerDayForAccounts(Collection $accounts, Carbon $start, Carbon $end): array { $ids = $accounts->pluck('id')->toArray(); /** @var Collection $query */ @@ -674,7 +678,7 @@ class BudgetRepository extends ComponentRepository implements BudgetRepositoryIn * * @return Collection */ - public function spentPerBudgetPerAccount(Collection $budgets, Collection $accounts, Carbon $start, Carbon $end) + public function spentPerBudgetPerAccount(Collection $budgets, Collection $accounts, Carbon $start, Carbon $end): Collection { $accountIds = $accounts->pluck('id')->toArray(); $budgetIds = $budgets->pluck('id')->toArray(); @@ -752,7 +756,7 @@ class BudgetRepository extends ComponentRepository implements BudgetRepositoryIn * * @return Budget */ - public function store(array $data) + public function store(array $data): Budget { $newBudget = new Budget( [ @@ -771,7 +775,7 @@ class BudgetRepository extends ComponentRepository implements BudgetRepositoryIn * * @return Budget */ - public function update(Budget $budget, array $data) + public function update(Budget $budget, array $data): Budget { // update the account: $budget->name = $data['name']; @@ -788,7 +792,7 @@ class BudgetRepository extends ComponentRepository implements BudgetRepositoryIn * * @return BudgetLimit */ - public function updateLimitAmount(Budget $budget, Carbon $date, int $amount) + public function updateLimitAmount(Budget $budget, Carbon $date, int $amount): BudgetLimit { // there should be a budget limit for this startdate: /** @var BudgetLimit $limit */ diff --git a/app/Repositories/Budget/BudgetRepositoryInterface.php b/app/Repositories/Budget/BudgetRepositoryInterface.php index 3c33aa0d0f..4d6e55cd52 100644 --- a/app/Repositories/Budget/BudgetRepositoryInterface.php +++ b/app/Repositories/Budget/BudgetRepositoryInterface.php @@ -6,6 +6,7 @@ namespace FireflyIII\Repositories\Budget; use Carbon\Carbon; use FireflyIII\Models\Account; use FireflyIII\Models\Budget; +use FireflyIII\Models\BudgetLimit; use FireflyIII\Models\LimitRepetition; use Illuminate\Pagination\LengthAwarePaginator; use Illuminate\Support\Collection; @@ -32,16 +33,16 @@ interface BudgetRepositoryInterface public function balanceInPeriod(Budget $budget, Carbon $start, Carbon $end, Collection $accounts); /** - * @return void + * @return bool */ - public function cleanupBudgets(); + public function cleanupBudgets(): bool; /** * @param Budget $budget * - * @return boolean + * @return bool */ - public function destroy(Budget $budget); + public function destroy(Budget $budget): bool; /** * @param Budget $budget @@ -67,12 +68,12 @@ interface BudgetRepositoryInterface * * @return Carbon */ - public function firstActivity(Budget $budget); + public function firstActivity(Budget $budget): Carbon; /** * @return Collection */ - public function getActiveBudgets(); + public function getActiveBudgets(): Collection; /** * @param Carbon $start @@ -80,17 +81,17 @@ interface BudgetRepositoryInterface * * @return Collection */ - public function getAllBudgetLimitRepetitions(Carbon $start, Carbon $end); + public function getAllBudgetLimitRepetitions(Carbon $start, Carbon $end): Collection; /** - * @param Account $account + * @param Account $account * @param Collection $accounts - * @param Carbon $start - * @param Carbon $end + * @param Carbon $start + * @param Carbon $end * * @return Collection */ - public function getAllWithoutBudget(Account $account, Collection $accounts, Carbon $start, Carbon $end); + public function getAllWithoutBudget(Account $account, Collection $accounts, Carbon $start, Carbon $end): Collection; /** * Get the budgeted amounts for each budgets in each year. @@ -101,12 +102,12 @@ interface BudgetRepositoryInterface * * @return Collection */ - public function getBudgetedPerYear(Collection $budgets, Carbon $start, Carbon $end); + public function getBudgetedPerYear(Collection $budgets, Carbon $start, Carbon $end): Collection; /** * @return Collection */ - public function getBudgets(); + public function getBudgets(): Collection; /** * Returns an array with every budget in it and the expenses for each budget @@ -118,7 +119,7 @@ interface BudgetRepositoryInterface * * @return array */ - public function getBudgetsAndExpensesPerMonth(Collection $accounts, Carbon $start, Carbon $end); + public function getBudgetsAndExpensesPerMonth(Collection $accounts, Carbon $start, Carbon $end): array; /** * Returns an array with every budget in it and the expenses for each budget @@ -131,7 +132,7 @@ interface BudgetRepositoryInterface * * @return array */ - public function getBudgetsAndExpensesPerYear(Collection $budgets, Collection $accounts, Carbon $start, Carbon $end); + public function getBudgetsAndExpensesPerYear(Collection $budgets, Collection $accounts, Carbon $start, Carbon $end): array; /** * Returns a list of budgets, budget limits and limit repetitions @@ -142,16 +143,16 @@ interface BudgetRepositoryInterface * * @return Collection */ - public function getBudgetsAndLimitsInRange(Carbon $start, Carbon $end); + public function getBudgetsAndLimitsInRange(Carbon $start, Carbon $end): Collection; /** * @param Budget $budget * @param Carbon $start * @param Carbon $end * - * @return LimitRepetition|null + * @return LimitRepetition */ - public function getCurrentRepetition(Budget $budget, Carbon $start, Carbon $end); + public function getCurrentRepetition(Budget $budget, Carbon $start, Carbon $end): LimitRepetition; /** * Returns all expenses for the given budget and the given accounts, in the given period. @@ -175,19 +176,19 @@ interface BudgetRepositoryInterface * * @return Collection */ - public function getExpensesPerDay(Budget $budget, Carbon $start, Carbon $end); + public function getExpensesPerDay(Budget $budget, Carbon $start, Carbon $end):Collection; /** * @param Budget $budget * * @return Carbon */ - public function getFirstBudgetLimitDate(Budget $budget); + public function getFirstBudgetLimitDate(Budget $budget):Carbon; /** * @return Collection */ - public function getInactiveBudgets(); + public function getInactiveBudgets(): Collection; /** * Returns all the transaction journals for a limit, possibly limited by a limit repetition. @@ -198,7 +199,7 @@ interface BudgetRepositoryInterface * * @return LengthAwarePaginator */ - public function getJournals(Budget $budget, LimitRepetition $repetition = null, int $take = 50); + public function getJournals(Budget $budget, LimitRepetition $repetition = null, int $take = 50): LengthAwarePaginator; /** * @param Carbon $start @@ -206,7 +207,7 @@ interface BudgetRepositoryInterface * * @return Collection */ - public function getWithoutBudget(Carbon $start, Carbon $end); + public function getWithoutBudget(Carbon $start, Carbon $end): Collection; /** * @param Collection $accounts @@ -215,7 +216,7 @@ interface BudgetRepositoryInterface * * @return Collection */ - public function getWithoutBudgetForAccounts(Collection $accounts, Carbon $start, Carbon $end); + public function getWithoutBudgetForAccounts(Collection $accounts, Carbon $start, Carbon $end): Collection; /** * @param Collection $accounts @@ -244,7 +245,7 @@ interface BudgetRepositoryInterface * * @return array */ - public function spentAllPerDayForAccounts(Collection $accounts, Carbon $start, Carbon $end); + public function spentAllPerDayForAccounts(Collection $accounts, Carbon $start, Carbon $end): array; /** * Returns a list of expenses (in the field "spent", grouped per budget per account. @@ -256,7 +257,7 @@ interface BudgetRepositoryInterface * * @return Collection */ - public function spentPerBudgetPerAccount(Collection $budgets, Collection $accounts, Carbon $start, Carbon $end); + public function spentPerBudgetPerAccount(Collection $budgets, Collection $accounts, Carbon $start, Carbon $end): Collection; /** * Returns an array with the following key:value pairs: @@ -279,7 +280,7 @@ interface BudgetRepositoryInterface * * @return Budget */ - public function store(array $data); + public function store(array $data): Budget; /** * @param Budget $budget @@ -287,15 +288,15 @@ interface BudgetRepositoryInterface * * @return Budget */ - public function update(Budget $budget, array $data); + public function update(Budget $budget, array $data) : Budget; /** * @param Budget $budget * @param Carbon $date * @param int $amount * - * @return mixed + * @return BudgetLimit */ - public function updateLimitAmount(Budget $budget, Carbon $date, int $amount); + public function updateLimitAmount(Budget $budget, Carbon $date, int $amount) : BudgetLimit; } diff --git a/app/Repositories/Category/CategoryRepository.php b/app/Repositories/Category/CategoryRepository.php index fa9ecc98bf..14f5495fc4 100644 --- a/app/Repositories/Category/CategoryRepository.php +++ b/app/Repositories/Category/CategoryRepository.php @@ -7,7 +7,6 @@ use Carbon\Carbon; use DB; use FireflyIII\Models\Category; use FireflyIII\Models\TransactionType; -use FireflyIII\Sql\Query; use FireflyIII\User; use Illuminate\Database\Query\JoinClause; use Illuminate\Support\Collection; @@ -19,6 +18,10 @@ use Illuminate\Support\Collection; */ class CategoryRepository implements CategoryRepositoryInterface { + const SPENT = 1; + const EARNED = 2; + + /** @var User */ private $user; @@ -43,7 +46,7 @@ class CategoryRepository implements CategoryRepositoryInterface * * @return Collection */ - public function earnedForAccountsPerMonth(Collection $accounts, Carbon $start, Carbon $end) + public function earnedForAccountsPerMonth(Collection $accounts, Carbon $start, Carbon $end): Collection { $collection = $this->user->categories() @@ -87,7 +90,7 @@ class CategoryRepository implements CategoryRepositoryInterface * * @return Collection */ - public function listCategories() + public function getCategories(): Collection { /** @var Collection $set */ $set = $this->user->categories()->orderBy('name', 'ASC')->get(); @@ -114,7 +117,7 @@ class CategoryRepository implements CategoryRepositoryInterface * * @return Collection */ - public function listMultiYear(Collection $categories, Collection $accounts, Carbon $start, Carbon $end) + public function listMultiYear(Collection $categories, Collection $accounts, Carbon $start, Carbon $end): Collection { $set = $this->user->categories() @@ -152,7 +155,7 @@ class CategoryRepository implements CategoryRepositoryInterface * * @return Collection */ - public function listNoCategory(Carbon $start, Carbon $end) + public function listNoCategory(Carbon $start, Carbon $end): Collection { return $this->user ->transactionjournals() @@ -177,7 +180,7 @@ class CategoryRepository implements CategoryRepositoryInterface * * @return Collection */ - public function spentForAccountsPerMonth(Collection $accounts, Carbon $start, Carbon $end) + public function spentForAccountsPerMonth(Collection $accounts, Carbon $start, Carbon $end): Collection { $accountIds = $accounts->pluck('id')->toArray(); $query = $this->user->categories() @@ -228,9 +231,9 @@ class CategoryRepository implements CategoryRepositoryInterface * * @return string */ - public function sumEarnedNoCategory(Collection $accounts, Carbon $start, Carbon $end) + public function sumEarnedNoCategory(Collection $accounts, Carbon $start, Carbon $end): string { - return $this->sumNoCategory($accounts, $start, $end, Query::EARNED); + return $this->sumNoCategory($accounts, $start, $end, self::EARNED); } /** @@ -243,9 +246,14 @@ class CategoryRepository implements CategoryRepositoryInterface * * @return string */ - public function sumSpentNoCategory(Collection $accounts, Carbon $start, Carbon $end) + public function sumSpentNoCategory(Collection $accounts, Carbon $start, Carbon $end): string { - return $this->sumNoCategory($accounts, $start, $end, Query::SPENT); + $sum = $this->sumNoCategory($accounts, $start, $end, self::SPENT); + if (is_null($sum)) { + return '0'; + } + + return $sum; } /** @@ -259,10 +267,10 @@ class CategoryRepository implements CategoryRepositoryInterface * * @return string */ - protected function sumNoCategory(Collection $accounts, Carbon $start, Carbon $end, $group = Query::EARNED) + protected function sumNoCategory(Collection $accounts, Carbon $start, Carbon $end, $group = self::EARNED) { $accountIds = $accounts->pluck('id')->toArray(); - if ($group == Query::EARNED) { + if ($group == self::EARNED) { $types = [TransactionType::DEPOSIT]; } else { $types = [TransactionType::WITHDRAWAL]; diff --git a/app/Repositories/Category/CategoryRepositoryInterface.php b/app/Repositories/Category/CategoryRepositoryInterface.php index ec89ccec5e..5c5966c8b7 100644 --- a/app/Repositories/Category/CategoryRepositoryInterface.php +++ b/app/Repositories/Category/CategoryRepositoryInterface.php @@ -26,14 +26,14 @@ interface CategoryRepositoryInterface * * @return Collection */ - public function earnedForAccountsPerMonth(Collection $accounts, Carbon $start, Carbon $end); + public function earnedForAccountsPerMonth(Collection $accounts, Carbon $start, Carbon $end): Collection; /** * Returns a list of all the categories belonging to a user. * * @return Collection */ - public function listCategories(); + public function getCategories(): Collection; /** * This method returns a very special collection for each category: @@ -49,7 +49,7 @@ interface CategoryRepositoryInterface * * @return Collection */ - public function listMultiYear(Collection $categories, Collection $accounts, Carbon $start, Carbon $end); + public function listMultiYear(Collection $categories, Collection $accounts, Carbon $start, Carbon $end): Collection; /** * Returns a list of transaction journals in the range (all types, all accounts) that have no category @@ -60,7 +60,7 @@ interface CategoryRepositoryInterface * * @return Collection */ - public function listNoCategory(Carbon $start, Carbon $end); + public function listNoCategory(Carbon $start, Carbon $end): Collection; /** * Returns a collection of Categories appended with the amount of money that has been spent @@ -73,7 +73,7 @@ interface CategoryRepositoryInterface * * @return Collection */ - public function spentForAccountsPerMonth(Collection $accounts, Carbon $start, Carbon $end); + public function spentForAccountsPerMonth(Collection $accounts, Carbon $start, Carbon $end): Collection; /** * Returns the total amount of money related to transactions without any category connected to @@ -85,7 +85,7 @@ interface CategoryRepositoryInterface * * @return string */ - public function sumEarnedNoCategory(Collection $accounts, Carbon $start, Carbon $end); + public function sumEarnedNoCategory(Collection $accounts, Carbon $start, Carbon $end): string; /** * Returns the total amount of money related to transactions without any category connected to @@ -97,6 +97,6 @@ interface CategoryRepositoryInterface * * @return string */ - public function sumSpentNoCategory(Collection $accounts, Carbon $start, Carbon $end); + public function sumSpentNoCategory(Collection $accounts, Carbon $start, Carbon $end): string; } diff --git a/app/Repositories/Category/SingleCategoryRepository.php b/app/Repositories/Category/SingleCategoryRepository.php index 1562ed4846..ea7dd6fc29 100644 --- a/app/Repositories/Category/SingleCategoryRepository.php +++ b/app/Repositories/Category/SingleCategoryRepository.php @@ -37,7 +37,7 @@ class SingleCategoryRepository extends ComponentRepository implements SingleCate * * @return int */ - public function countJournals(Category $category) + public function countJournals(Category $category): int { return $category->transactionjournals()->count(); @@ -51,7 +51,7 @@ class SingleCategoryRepository extends ComponentRepository implements SingleCate * * @return int */ - public function countJournalsInRange(Category $category, Carbon $start, Carbon $end) + public function countJournalsInRange(Category $category, Carbon $start, Carbon $end): int { return $category->transactionjournals()->before($end)->after($start)->count(); } @@ -59,9 +59,9 @@ class SingleCategoryRepository extends ComponentRepository implements SingleCate /** * @param Category $category * - * @return boolean + * @return bool */ - public function destroy(Category $category) + public function destroy(Category $category): bool { $category->delete(); @@ -82,7 +82,7 @@ class SingleCategoryRepository extends ComponentRepository implements SingleCate * * @return array */ - public function earnedPerDay(Category $category, Carbon $start, Carbon $end) + public function earnedPerDay(Category $category, Carbon $start, Carbon $end): array { /** @var Collection $query */ $query = $category->transactionjournals() @@ -123,7 +123,7 @@ class SingleCategoryRepository extends ComponentRepository implements SingleCate * * @return Carbon */ - public function getFirstActivityDate(Category $category) + public function getFirstActivityDate(Category $category): Carbon { /** @var TransactionJournal $first */ $first = $category->transactionjournals()->orderBy('date', 'ASC')->first(); @@ -141,7 +141,7 @@ class SingleCategoryRepository extends ComponentRepository implements SingleCate * * @return Collection */ - public function getJournals(Category $category, $page) + public function getJournals(Category $category, $page): Collection { $offset = $page > 0 ? $page * 50 : 0; @@ -162,7 +162,7 @@ class SingleCategoryRepository extends ComponentRepository implements SingleCate * * @return Collection */ - public function getJournalsForAccountsInRange(Category $category, Collection $accounts, Carbon $start, Carbon $end) + public function getJournalsForAccountsInRange(Category $category, Collection $accounts, Carbon $start, Carbon $end): Collection { $ids = $accounts->pluck('id')->toArray(); @@ -181,9 +181,9 @@ class SingleCategoryRepository extends ComponentRepository implements SingleCate * @param Carbon $start * @param Carbon $end * - * @return mixed + * @return Collection */ - public function getJournalsInRange(Category $category, $page, Carbon $start, Carbon $end) + public function getJournalsInRange(Category $category, $page, Carbon $start, Carbon $end): Collection { $offset = $page > 0 ? $page * 50 : 0; @@ -201,7 +201,7 @@ class SingleCategoryRepository extends ComponentRepository implements SingleCate * * @return Carbon|null */ - public function getLatestActivity(Category $category) + public function getLatestActivity(Category $category): Carbon { $latest = $category->transactionjournals() ->orderBy('transaction_journals.date', 'DESC') @@ -212,7 +212,7 @@ class SingleCategoryRepository extends ComponentRepository implements SingleCate return $latest->date; } - return null; + return new Carbon('1900-01-01'); } /** @@ -229,7 +229,7 @@ class SingleCategoryRepository extends ComponentRepository implements SingleCate * * @return array */ - public function spentPerDay(Category $category, Carbon $start, Carbon $end) + public function spentPerDay(Category $category, Carbon $start, Carbon $end): array { /** @var Collection $query */ $query = $category->transactionjournals() @@ -253,7 +253,7 @@ class SingleCategoryRepository extends ComponentRepository implements SingleCate * * @return Category */ - public function store(array $data) + public function store(array $data): Category { $newCategory = Category::firstOrCreateEncrypted( [ @@ -272,7 +272,7 @@ class SingleCategoryRepository extends ComponentRepository implements SingleCate * * @return Category */ - public function update(Category $category, array $data) + public function update(Category $category, array $data): Category { // update the account: $category->name = $data['name']; diff --git a/app/Repositories/Category/SingleCategoryRepositoryInterface.php b/app/Repositories/Category/SingleCategoryRepositoryInterface.php index 88104b957b..29649457be 100644 --- a/app/Repositories/Category/SingleCategoryRepositoryInterface.php +++ b/app/Repositories/Category/SingleCategoryRepositoryInterface.php @@ -20,7 +20,7 @@ interface SingleCategoryRepositoryInterface * * @return int */ - public function countJournals(Category $category); + public function countJournals(Category $category): int; /** * @param Category $category @@ -30,14 +30,14 @@ interface SingleCategoryRepositoryInterface * * @return int */ - public function countJournalsInRange(Category $category, Carbon $start, Carbon $end); + public function countJournalsInRange(Category $category, Carbon $start, Carbon $end): int; /** * @param Category $category * - * @return boolean + * @return bool */ - public function destroy(Category $category); + public function destroy(Category $category): bool; /** * Returns an array with the following key:value pairs: @@ -53,7 +53,7 @@ interface SingleCategoryRepositoryInterface * * @return array */ - public function earnedPerDay(Category $category, Carbon $start, Carbon $end); + public function earnedPerDay(Category $category, Carbon $start, Carbon $end): array; /** * Find a category @@ -69,7 +69,7 @@ interface SingleCategoryRepositoryInterface * * @return Carbon */ - public function getFirstActivityDate(Category $category); + public function getFirstActivityDate(Category $category): Carbon; /** * @param Category $category @@ -77,7 +77,7 @@ interface SingleCategoryRepositoryInterface * * @return Collection */ - public function getJournals(Category $category, $page); + public function getJournals(Category $category, $page): Collection; /** * @param Category $category @@ -88,7 +88,7 @@ interface SingleCategoryRepositoryInterface * * @return Collection */ - public function getJournalsForAccountsInRange(Category $category, Collection $accounts, Carbon $start, Carbon $end); + public function getJournalsForAccountsInRange(Category $category, Collection $accounts, Carbon $start, Carbon $end): Collection; /** * @param Category $category @@ -99,14 +99,14 @@ interface SingleCategoryRepositoryInterface * * @return Collection */ - public function getJournalsInRange(Category $category, $page, Carbon $start, Carbon $end); + public function getJournalsInRange(Category $category, $page, Carbon $start, Carbon $end): Collection; /** * @param Category $category * - * @return Carbon|null + * @return Carbon */ - public function getLatestActivity(Category $category); + public function getLatestActivity(Category $category): Carbon; /** * Returns an array with the following key:value pairs: @@ -122,7 +122,7 @@ interface SingleCategoryRepositoryInterface * * @return array */ - public function spentPerDay(Category $category, Carbon $start, Carbon $end); + public function spentPerDay(Category $category, Carbon $start, Carbon $end): array; /** @@ -130,7 +130,7 @@ interface SingleCategoryRepositoryInterface * * @return Category */ - public function store(array $data); + public function store(array $data): Category; /** * @param Category $category @@ -138,5 +138,5 @@ interface SingleCategoryRepositoryInterface * * @return Category */ - public function update(Category $category, array $data); + public function update(Category $category, array $data): Category; } diff --git a/app/Repositories/Currency/CurrencyRepository.php b/app/Repositories/Currency/CurrencyRepository.php index 02328f291a..f9d60c9740 100644 --- a/app/Repositories/Currency/CurrencyRepository.php +++ b/app/Repositories/Currency/CurrencyRepository.php @@ -21,7 +21,7 @@ class CurrencyRepository implements CurrencyRepositoryInterface * * @return int */ - public function countJournals(TransactionCurrency $currency) + public function countJournals(TransactionCurrency $currency): int { return $currency->transactionJournals()->count(); } @@ -98,7 +98,7 @@ class CurrencyRepository implements CurrencyRepositoryInterface /** * @return Collection */ - public function get() + public function get(): Collection { return TransactionCurrency::get(); } @@ -108,7 +108,7 @@ class CurrencyRepository implements CurrencyRepositoryInterface * * @return TransactionCurrency */ - public function getCurrencyByPreference(Preference $preference) + public function getCurrencyByPreference(Preference $preference): TransactionCurrency { $preferred = TransactionCurrency::whereCode($preference->data)->first(); if (is_null($preferred)) { @@ -123,7 +123,7 @@ class CurrencyRepository implements CurrencyRepositoryInterface * * @return TransactionCurrency */ - public function store(array $data) + public function store(array $data): TransactionCurrency { $currency = TransactionCurrency::create( [ @@ -142,7 +142,7 @@ class CurrencyRepository implements CurrencyRepositoryInterface * * @return TransactionCurrency */ - public function update(TransactionCurrency $currency, array $data) + public function update(TransactionCurrency $currency, array $data): TransactionCurrency { $currency->code = $data['code']; $currency->symbol = $data['symbol']; diff --git a/app/Repositories/Currency/CurrencyRepositoryInterface.php b/app/Repositories/Currency/CurrencyRepositoryInterface.php index 3b82882dd3..2aba1b93bc 100644 --- a/app/Repositories/Currency/CurrencyRepositoryInterface.php +++ b/app/Repositories/Currency/CurrencyRepositoryInterface.php @@ -20,7 +20,7 @@ interface CurrencyRepositoryInterface * * @return int */ - public function countJournals(TransactionCurrency $currency); + public function countJournals(TransactionCurrency $currency): int; /** * Find by ID @@ -61,21 +61,21 @@ interface CurrencyRepositoryInterface /** * @return Collection */ - public function get(); + public function get(): Collection; /** * @param Preference $preference * * @return TransactionCurrency */ - public function getCurrencyByPreference(Preference $preference); + public function getCurrencyByPreference(Preference $preference): TransactionCurrency; /** * @param array $data * * @return TransactionCurrency */ - public function store(array $data); + public function store(array $data): TransactionCurrency; /** * @param TransactionCurrency $currency @@ -83,6 +83,6 @@ interface CurrencyRepositoryInterface * * @return TransactionCurrency */ - public function update(TransactionCurrency $currency, array $data); + public function update(TransactionCurrency $currency, array $data): TransactionCurrency; } diff --git a/app/Repositories/ExportJob/ExportJobRepository.php b/app/Repositories/ExportJob/ExportJobRepository.php index 6d477feb5d..c913972cea 100644 --- a/app/Repositories/ExportJob/ExportJobRepository.php +++ b/app/Repositories/ExportJob/ExportJobRepository.php @@ -38,7 +38,7 @@ class ExportJobRepository implements ExportJobRepositoryInterface /** * @return bool */ - public function cleanup() + public function cleanup(): bool { $dayAgo = Carbon::create()->subDay(); $set = ExportJob::where('created_at', '<', $dayAgo->format('Y-m-d H:i:s')) @@ -66,7 +66,7 @@ class ExportJobRepository implements ExportJobRepositoryInterface /** * @return ExportJob */ - public function create() + public function create(): ExportJob { $exportJob = new ExportJob; $exportJob->user()->associate($this->user); @@ -81,11 +81,14 @@ class ExportJobRepository implements ExportJobRepositoryInterface } /** + * + * FIXME this may return null + * * @param string $key * * @return ExportJob|null */ - public function findByKey(string $key) + public function findByKey(string $key): ExportJob { return $this->user->exportJobs()->where('key', $key)->first(); } diff --git a/app/Repositories/ExportJob/ExportJobRepositoryInterface.php b/app/Repositories/ExportJob/ExportJobRepositoryInterface.php index 9c1dd4c434..43572ed1c2 100644 --- a/app/Repositories/ExportJob/ExportJobRepositoryInterface.php +++ b/app/Repositories/ExportJob/ExportJobRepositoryInterface.php @@ -22,18 +22,18 @@ interface ExportJobRepositoryInterface /** * @return bool */ - public function cleanup(); + public function cleanup(): bool; /** * @return ExportJob */ - public function create(); + public function create(): ExportJob; /** * @param string $key * * @return ExportJob|null */ - public function findByKey(string $key); + public function findByKey(string $key): ExportJob; } diff --git a/app/Repositories/Journal/JournalCollector.php b/app/Repositories/Journal/JournalCollector.php index c971f9091a..804b48c087 100644 --- a/app/Repositories/Journal/JournalCollector.php +++ b/app/Repositories/Journal/JournalCollector.php @@ -49,7 +49,7 @@ class JournalCollector /** * @return Collection */ - public function collect() + public function collect(): Collection { // get all the journals: $ids = $this->accounts->pluck('id')->toArray(); diff --git a/app/Repositories/Journal/JournalRepository.php b/app/Repositories/Journal/JournalRepository.php index 956a4645f3..aad47de6d3 100644 --- a/app/Repositories/Journal/JournalRepository.php +++ b/app/Repositories/Journal/JournalRepository.php @@ -44,7 +44,7 @@ class JournalRepository implements JournalRepositoryInterface * * @return bool */ - public function delete(TransactionJournal $journal) + public function delete(TransactionJournal $journal): bool { $journal->delete(); @@ -56,9 +56,12 @@ class JournalRepository implements JournalRepositoryInterface * * @return TransactionJournal */ - public function first() + public function first(): TransactionJournal { $entry = $this->user->transactionjournals()->orderBy('date', 'ASC')->first(['transaction_journals.*']); + if (is_null($entry)) { + return new TransactionJournal; + } return $entry; } @@ -67,9 +70,9 @@ class JournalRepository implements JournalRepositoryInterface * @param TransactionJournal $journal * @param Transaction $transaction * - * @return integer + * @return string */ - public function getAmountBefore(TransactionJournal $journal, Transaction $transaction) + public function getAmountBefore(TransactionJournal $journal, Transaction $transaction): string { $set = $transaction->account->transactions()->leftJoin( 'transaction_journals', 'transaction_journals.id', '=', 'transactions.transaction_journal_id' @@ -94,7 +97,7 @@ class JournalRepository implements JournalRepositoryInterface * * @return Collection */ - public function getCollectionOfTypes(array $types, int $offset, int $count) + public function getCollectionOfTypes(array $types, int $offset, int $count): Collection { $set = $this->user->transactionJournals() ->expanded() @@ -113,7 +116,7 @@ class JournalRepository implements JournalRepositoryInterface * * @return Collection */ - public function getJournalsOfType(TransactionType $dbType) + public function getJournalsOfType(TransactionType $dbType): Collection { return $this->user->transactionjournals()->where('transaction_type_id', $dbType->id)->orderBy('id', 'DESC')->take(50)->get(); } @@ -127,7 +130,7 @@ class JournalRepository implements JournalRepositoryInterface * * @return LengthAwarePaginator */ - public function getJournalsOfTypes(array $types, int $offset, int $page, int $pagesize = 50) + public function getJournalsOfTypes(array $types, int $offset, int $page, int $pagesize = 50): LengthAwarePaginator { $set = $this->user ->transactionJournals() @@ -151,7 +154,7 @@ class JournalRepository implements JournalRepositoryInterface * * @return TransactionType */ - public function getTransactionType(string $type) + public function getTransactionType(string $type): TransactionType { return TransactionType::whereType($type)->first(); } @@ -162,7 +165,7 @@ class JournalRepository implements JournalRepositoryInterface * * @return TransactionJournal */ - public function getWithDate(int $journalId, Carbon $date) + public function getWithDate(int $journalId, Carbon $date): TransactionJournal { return $this->user->transactionjournals()->where('id', $journalId)->where('date', $date->format('Y-m-d 00:00:00'))->first(); } @@ -175,9 +178,9 @@ class JournalRepository implements JournalRepositoryInterface * @param TransactionJournal $journal * @param array $array * - * @return void + * @return bool */ - public function saveTags(TransactionJournal $journal, array $array) + public function saveTags(TransactionJournal $journal, array $array): bool { /** @var \FireflyIII\Repositories\Tag\TagRepositoryInterface $tagRepository */ $tagRepository = app('FireflyIII\Repositories\Tag\TagRepositoryInterface'); @@ -190,6 +193,8 @@ class JournalRepository implements JournalRepositoryInterface } } } + + return true; } /** @@ -197,7 +202,7 @@ class JournalRepository implements JournalRepositoryInterface * * @return TransactionJournal */ - public function store(array $data) + public function store(array $data): TransactionJournal { // find transaction type. $transactionType = TransactionType::where('type', ucfirst($data['what']))->first(); @@ -269,7 +274,7 @@ class JournalRepository implements JournalRepositoryInterface * * @return TransactionJournal */ - public function update(TransactionJournal $journal, array $data) + public function update(TransactionJournal $journal, array $data): TransactionJournal { // update actual journal. $journal->transaction_currency_id = $data['amount_currency_id_amount']; @@ -329,9 +334,9 @@ class JournalRepository implements JournalRepositoryInterface * @param TransactionJournal $journal * @param array $array * - * @return void + * @return bool */ - public function updateTags(TransactionJournal $journal, array $array) + public function updateTags(TransactionJournal $journal, array $array): bool { // create tag repository /** @var \FireflyIII\Repositories\Tag\TagRepositoryInterface $tagRepository */ @@ -363,6 +368,8 @@ class JournalRepository implements JournalRepositoryInterface foreach ($tags as $tag) { $tagRepository->connect($journal, $tag); } + + return true; } /** @@ -373,7 +380,7 @@ class JournalRepository implements JournalRepositoryInterface * @throws FireflyException * @SuppressWarnings(PHPMD.CyclomaticComplexity) */ - protected function storeAccounts(TransactionType $type, array $data) + protected function storeAccounts(TransactionType $type, array $data): array { $fromAccount = null; $toAccount = null; @@ -395,18 +402,14 @@ class JournalRepository implements JournalRepositoryInterface if (is_null($toAccount)) { Log::error('"to"-account is null, so we cannot continue!'); throw new FireflyException('"to"-account is null, so we cannot continue!'); - // @codeCoverageIgnoreStart } - // @codeCoverageIgnoreEnd if (is_null($fromAccount)) { Log::error('"from"-account is null, so we cannot continue!'); throw new FireflyException('"from"-account is null, so we cannot continue!'); - // @codeCoverageIgnoreStart } - // @codeCoverageIgnoreEnd return [$fromAccount, $toAccount]; } @@ -416,7 +419,7 @@ class JournalRepository implements JournalRepositoryInterface * * @return array */ - protected function storeDepositAccounts(array $data) + protected function storeDepositAccounts(array $data): array { $toAccount = Account::find($data['account_id']); @@ -440,7 +443,7 @@ class JournalRepository implements JournalRepositoryInterface * * @return array */ - protected function storeWithdrawalAccounts(array $data) + protected function storeWithdrawalAccounts(array $data): array { $fromAccount = Account::find($data['account_id']); diff --git a/app/Repositories/Journal/JournalRepositoryInterface.php b/app/Repositories/Journal/JournalRepositoryInterface.php index d917190cbc..e7bfa81bce 100644 --- a/app/Repositories/Journal/JournalRepositoryInterface.php +++ b/app/Repositories/Journal/JournalRepositoryInterface.php @@ -22,38 +22,22 @@ interface JournalRepositoryInterface * * @return bool */ - public function delete(TransactionJournal $journal); + public function delete(TransactionJournal $journal): bool; /** * Get users first transaction journal * * @return TransactionJournal */ - public function first(); + public function first(): TransactionJournal; /** * @param TransactionJournal $journal * @param Transaction $transaction * - * @return float + * @return string */ - public function getAmountBefore(TransactionJournal $journal, Transaction $transaction); - - /** - * @param TransactionType $dbType - * - * @return Collection - */ - public function getJournalsOfType(TransactionType $dbType); - - /** - * @param array $types - * @param int $offset - * @param int $page - * - * @return LengthAwarePaginator - */ - public function getJournalsOfTypes(array $types, int $offset, int $page); + public function getAmountBefore(TransactionJournal $journal, Transaction $transaction): string; /** * @param array $types @@ -62,14 +46,30 @@ interface JournalRepositoryInterface * * @return Collection */ - public function getCollectionOfTypes(array $types, int $offset, int $count); + public function getCollectionOfTypes(array $types, int $offset, int $count):Collection; + + /** + * @param TransactionType $dbType + * + * @return Collection + */ + public function getJournalsOfType(TransactionType $dbType): Collection; + + /** + * @param array $types + * @param int $offset + * @param int $page + * + * @return LengthAwarePaginator + */ + public function getJournalsOfTypes(array $types, int $offset, int $page): LengthAwarePaginator; /** * @param string $type * * @return TransactionType */ - public function getTransactionType(string $type); + public function getTransactionType(string $type): TransactionType; /** * @param int $journalId @@ -77,7 +77,7 @@ interface JournalRepositoryInterface * * @return TransactionJournal */ - public function getWithDate(int $journalId, Carbon $date); + public function getWithDate(int $journalId, Carbon $date): TransactionJournal; /** * @param TransactionJournal $journal @@ -90,30 +90,30 @@ interface JournalRepositoryInterface * @param TransactionJournal $journal * @param array $array * - * @return void + * @return bool */ - public function saveTags(TransactionJournal $journal, array $array); + public function saveTags(TransactionJournal $journal, array $array): bool; /** * @param array $data * * @return TransactionJournal */ - public function store(array $data); + public function store(array $data): TransactionJournal; /** * @param TransactionJournal $journal * @param array $data * - * @return mixed + * @return TransactionJournal */ - public function update(TransactionJournal $journal, array $data); + public function update(TransactionJournal $journal, array $data): TransactionJournal; /** * @param TransactionJournal $journal * @param array $array * - * @return mixed + * @return bool */ - public function updateTags(TransactionJournal $journal, array $array); + public function updateTags(TransactionJournal $journal, array $array): bool; } diff --git a/app/Repositories/PiggyBank/PiggyBankRepository.php b/app/Repositories/PiggyBank/PiggyBankRepository.php index 48b285486a..c288e8b3a8 100644 --- a/app/Repositories/PiggyBank/PiggyBankRepository.php +++ b/app/Repositories/PiggyBank/PiggyBankRepository.php @@ -35,11 +35,23 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface * @param PiggyBank $piggyBank * @param string $amount * + * @return PiggyBankEvent + */ + public function createEvent(PiggyBank $piggyBank, string $amount): PiggyBankEvent + { + $event = PiggyBankEvent::create(['date' => Carbon::now(), 'amount' => $amount, 'piggy_bank_id' => $piggyBank->id]); + + return $event; + } + + /** + * @param PiggyBank $piggyBank + * * @return bool */ - public function createEvent(PiggyBank $piggyBank, string $amount) + public function destroy(PiggyBank $piggyBank): bool { - PiggyBankEvent::create(['date' => Carbon::now(), 'amount' => $amount, 'piggy_bank_id' => $piggyBank->id]); + $piggyBank->delete(); return true; } @@ -47,11 +59,13 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface /** * @param PiggyBank $piggyBank * - * @return boolean|null + * @return Collection */ - public function destroy(PiggyBank $piggyBank) + public function getEventSummarySet(PiggyBank $piggyBank): Collection { - return $piggyBank->delete(); + $var = DB::table('piggy_bank_events')->where('piggy_bank_id', $piggyBank->id)->groupBy('date')->get(['date', DB::raw('SUM(`amount`) AS `sum`')]); + + return new Collection($var); } /** @@ -59,17 +73,7 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface * * @return Collection */ - public function getEventSummarySet(PiggyBank $piggyBank) - { - return DB::table('piggy_bank_events')->where('piggy_bank_id', $piggyBank->id)->groupBy('date')->get(['date', DB::raw('SUM(`amount`) AS `sum`')]); - } - - /** - * @param PiggyBank $piggyBank - * - * @return Collection - */ - public function getEvents(PiggyBank $piggyBank) + public function getEvents(PiggyBank $piggyBank): Collection { return $piggyBank->piggyBankEvents()->orderBy('date', 'DESC')->orderBy('id', 'DESC')->get(); } @@ -77,7 +81,7 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface /** * @return int */ - public function getMaxOrder() + public function getMaxOrder(): int { return intval($this->user->piggyBanks()->max('order')); } @@ -85,7 +89,7 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface /** * @return Collection */ - public function getPiggyBanks() + public function getPiggyBanks(): Collection { /** @var Collection $set */ $set = $this->user->piggyBanks()->orderBy('order', 'ASC')->get(); @@ -96,9 +100,9 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface /** * Set all piggy banks to order 0. * - * @return boolean + * @return bool */ - public function reset() + public function reset(): bool { // split query to make it work in sqlite: $set = PiggyBank:: @@ -119,9 +123,9 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface * @param int $piggyBankId * @param int $order * - * @return void + * @return bool */ - public function setOrder(int $piggyBankId, int $order) + public function setOrder(int $piggyBankId, int $order): bool { $piggyBank = PiggyBank::leftJoin('accounts', 'accounts.id', '=', 'piggy_banks.account_id')->where('accounts.user_id', $this->user->id) ->where('piggy_banks.id', $piggyBankId)->first(['piggy_banks.*']); @@ -129,6 +133,8 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface $piggyBank->order = $order; $piggyBank->save(); } + + return true; } /** @@ -136,7 +142,7 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface * * @return PiggyBank */ - public function store(array $data) + public function store(array $data): PiggyBank { $data['remind_me'] = false; $data['reminder_skip'] = 0; @@ -152,7 +158,7 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface * * @return PiggyBank */ - public function update(PiggyBank $piggyBank, array $data) + public function update(PiggyBank $piggyBank, array $data): PiggyBank { $piggyBank->name = $data['name']; diff --git a/app/Repositories/PiggyBank/PiggyBankRepositoryInterface.php b/app/Repositories/PiggyBank/PiggyBankRepositoryInterface.php index d57f6300c0..206e4704b8 100644 --- a/app/Repositories/PiggyBank/PiggyBankRepositoryInterface.php +++ b/app/Repositories/PiggyBank/PiggyBankRepositoryInterface.php @@ -4,6 +4,7 @@ declare(strict_types = 1); namespace FireflyIII\Repositories\PiggyBank; use FireflyIII\Models\PiggyBank; +use FireflyIII\Models\PiggyBankEvent; use Illuminate\Support\Collection; /** @@ -18,47 +19,47 @@ interface PiggyBankRepositoryInterface * @param PiggyBank $piggyBank * @param string $amount * - * @return bool + * @return PiggyBankEvent */ - public function createEvent(PiggyBank $piggyBank, string $amount); + public function createEvent(PiggyBank $piggyBank, string $amount): PiggyBankEvent; /** * @param PiggyBank $piggyBank * * @return bool */ - public function destroy(PiggyBank $piggyBank); + public function destroy(PiggyBank $piggyBank): bool; /** * @param PiggyBank $piggyBank * * @return Collection */ - public function getEventSummarySet(PiggyBank $piggyBank); + public function getEventSummarySet(PiggyBank $piggyBank) : Collection; /** * @param PiggyBank $piggyBank * * @return Collection */ - public function getEvents(PiggyBank $piggyBank); + public function getEvents(PiggyBank $piggyBank) : Collection; /** * @return int */ - public function getMaxOrder(); + public function getMaxOrder(): int; /** * @return Collection */ - public function getPiggyBanks(); + public function getPiggyBanks() : Collection; /** * Set all piggy banks to order 0. * - * @return void + * @return bool */ - public function reset(); + public function reset(): bool; /** * @@ -67,9 +68,9 @@ interface PiggyBankRepositoryInterface * @param int $piggyBankId * @param int $order * - * @return void + * @return bool */ - public function setOrder(int $piggyBankId, int $order); + public function setOrder(int $piggyBankId, int $order): bool; /** @@ -77,7 +78,7 @@ interface PiggyBankRepositoryInterface * * @return PiggyBank */ - public function store(array $data); + public function store(array $data): PiggyBank; /** * @param PiggyBank $piggyBank @@ -85,5 +86,5 @@ interface PiggyBankRepositoryInterface * * @return PiggyBank */ - public function update(PiggyBank $piggyBank, array $data); + public function update(PiggyBank $piggyBank, array $data): PiggyBank; } diff --git a/app/Repositories/Rule/RuleRepository.php b/app/Repositories/Rule/RuleRepository.php index f5351ab955..e2d83e1790 100644 --- a/app/Repositories/Rule/RuleRepository.php +++ b/app/Repositories/Rule/RuleRepository.php @@ -40,7 +40,7 @@ class RuleRepository implements RuleRepositoryInterface /** * @return int */ - public function count() + public function count(): int { return $this->user->rules()->count(); } @@ -50,7 +50,7 @@ class RuleRepository implements RuleRepositoryInterface * * @return bool */ - public function destroy(Rule $rule) + public function destroy(Rule $rule): bool { foreach ($rule->ruleTriggers as $trigger) { $trigger->delete(); @@ -64,9 +64,11 @@ class RuleRepository implements RuleRepositoryInterface } /** + * FIXME can return null + * * @return RuleGroup */ - public function getFirstRuleGroup() + public function getFirstRuleGroup(): RuleGroup { return $this->user->ruleGroups()->first(); } @@ -76,7 +78,7 @@ class RuleRepository implements RuleRepositoryInterface * * @return int */ - public function getHighestOrderInRuleGroup(RuleGroup $ruleGroup) + public function getHighestOrderInRuleGroup(RuleGroup $ruleGroup): int { return intval($ruleGroup->rules()->max('order')); } @@ -102,7 +104,7 @@ class RuleRepository implements RuleRepositoryInterface * * @return bool */ - public function moveDown(Rule $rule) + public function moveDown(Rule $rule): bool { $order = $rule->order; @@ -117,6 +119,7 @@ class RuleRepository implements RuleRepositoryInterface $rule->order = ($rule->order + 1); $rule->save(); $this->resetRulesInGroupOrder($rule->ruleGroup); + return true; } /** @@ -124,7 +127,7 @@ class RuleRepository implements RuleRepositoryInterface * * @return bool */ - public function moveUp(Rule $rule) + public function moveUp(Rule $rule): bool { $order = $rule->order; @@ -138,6 +141,7 @@ class RuleRepository implements RuleRepositoryInterface $rule->order = ($rule->order - 1); $rule->save(); $this->resetRulesInGroupOrder($rule->ruleGroup); + return true; } /** @@ -146,7 +150,7 @@ class RuleRepository implements RuleRepositoryInterface * * @return bool */ - public function reorderRuleActions(Rule $rule, array $ids) + public function reorderRuleActions(Rule $rule, array $ids): bool { $order = 1; foreach ($ids as $actionId) { @@ -168,7 +172,7 @@ class RuleRepository implements RuleRepositoryInterface * * @return bool */ - public function reorderRuleTriggers(Rule $rule, array $ids) + public function reorderRuleTriggers(Rule $rule, array $ids): bool { $order = 1; foreach ($ids as $triggerId) { @@ -189,7 +193,7 @@ class RuleRepository implements RuleRepositoryInterface * * @return bool */ - public function resetRulesInGroupOrder(RuleGroup $ruleGroup) + public function resetRulesInGroupOrder(RuleGroup $ruleGroup): bool { $ruleGroup->rules()->whereNotNull('deleted_at')->update(['order' => 0]); @@ -214,7 +218,7 @@ class RuleRepository implements RuleRepositoryInterface * * @return Rule */ - public function store(array $data) + public function store(array $data): Rule { /** @var RuleGroup $ruleGroup */ $ruleGroup = $this->user->ruleGroups()->find($data['rule_group_id']); @@ -250,7 +254,7 @@ class RuleRepository implements RuleRepositoryInterface * * @return RuleAction */ - public function storeAction(Rule $rule, array $values) + public function storeAction(Rule $rule, array $values): RuleAction { $ruleAction = new RuleAction; $ruleAction->rule()->associate($rule); @@ -271,7 +275,7 @@ class RuleRepository implements RuleRepositoryInterface * * @return RuleTrigger */ - public function storeTrigger(Rule $rule, array $values) + public function storeTrigger(Rule $rule, array $values): RuleTrigger { $ruleTrigger = new RuleTrigger; $ruleTrigger->rule()->associate($rule); @@ -291,7 +295,7 @@ class RuleRepository implements RuleRepositoryInterface * * @return Rule */ - public function update(Rule $rule, array $data) + public function update(Rule $rule, array $data): Rule { // update rule: $rule->active = $data['active']; @@ -319,8 +323,10 @@ class RuleRepository implements RuleRepositoryInterface /** * @param Rule $rule * @param array $data + * + * @return bool */ - private function storeActions(Rule $rule, array $data) + private function storeActions(Rule $rule, array $data): bool { $order = 1; foreach ($data['rule-actions'] as $index => $action) { @@ -336,14 +342,16 @@ class RuleRepository implements RuleRepositoryInterface $this->storeAction($rule, $actionValues); } + return true; } /** * @param Rule $rule * @param array $data + * @return bool */ - private function storeTriggers(Rule $rule, array $data) + private function storeTriggers(Rule $rule, array $data): bool { $order = 1; $stopProcessing = false; @@ -370,5 +378,6 @@ class RuleRepository implements RuleRepositoryInterface $this->storeTrigger($rule, $triggerValues); $order++; } + return true; } } diff --git a/app/Repositories/Rule/RuleRepositoryInterface.php b/app/Repositories/Rule/RuleRepositoryInterface.php index c3556c7bbb..4c98093d20 100644 --- a/app/Repositories/Rule/RuleRepositoryInterface.php +++ b/app/Repositories/Rule/RuleRepositoryInterface.php @@ -26,26 +26,26 @@ interface RuleRepositoryInterface /** * @return int */ - public function count(); + public function count(): int; /** * @param Rule $rule * * @return bool */ - public function destroy(Rule $rule); + public function destroy(Rule $rule): bool; /** * @return RuleGroup */ - public function getFirstRuleGroup(); + public function getFirstRuleGroup(): RuleGroup; /** * @param RuleGroup $ruleGroup * * @return int */ - public function getHighestOrderInRuleGroup(RuleGroup $ruleGroup); + public function getHighestOrderInRuleGroup(RuleGroup $ruleGroup): int; /** * @param Rule $rule @@ -59,14 +59,14 @@ interface RuleRepositoryInterface * * @return bool */ - public function moveDown(Rule $rule); + public function moveDown(Rule $rule): bool; /** * @param Rule $rule * * @return bool */ - public function moveUp(Rule $rule); + public function moveUp(Rule $rule): bool; /** * @param Rule $rule @@ -74,7 +74,7 @@ interface RuleRepositoryInterface * * @return bool */ - public function reorderRuleActions(Rule $rule, array $ids); + public function reorderRuleActions(Rule $rule, array $ids): bool; /** * @param Rule $rule @@ -82,21 +82,21 @@ interface RuleRepositoryInterface * * @return bool */ - public function reorderRuleTriggers(Rule $rule, array $ids); + public function reorderRuleTriggers(Rule $rule, array $ids): bool; /** * @param RuleGroup $ruleGroup * * @return bool */ - public function resetRulesInGroupOrder(RuleGroup $ruleGroup); + public function resetRulesInGroupOrder(RuleGroup $ruleGroup): bool; /** * @param array $data * * @return Rule */ - public function store(array $data); + public function store(array $data): Rule; /** * @param Rule $rule @@ -104,7 +104,7 @@ interface RuleRepositoryInterface * * @return RuleAction */ - public function storeAction(Rule $rule, array $values); + public function storeAction(Rule $rule, array $values): RuleAction; /** * @param Rule $rule @@ -112,7 +112,7 @@ interface RuleRepositoryInterface * * @return RuleTrigger */ - public function storeTrigger(Rule $rule, array $values); + public function storeTrigger(Rule $rule, array $values): RuleTrigger; /** * @param Rule $rule @@ -120,6 +120,6 @@ interface RuleRepositoryInterface * * @return Rule */ - public function update(Rule $rule, array $data); + public function update(Rule $rule, array $data): Rule; } diff --git a/app/Repositories/RuleGroup/RuleGroupRepository.php b/app/Repositories/RuleGroup/RuleGroupRepository.php index 8cacdc0fa8..f2e74925d8 100644 --- a/app/Repositories/RuleGroup/RuleGroupRepository.php +++ b/app/Repositories/RuleGroup/RuleGroupRepository.php @@ -33,7 +33,7 @@ class RuleGroupRepository implements RuleGroupRepositoryInterface /** * @return int */ - public function count() + public function count(): int { return $this->user->ruleGroups()->count(); } @@ -42,9 +42,9 @@ class RuleGroupRepository implements RuleGroupRepositoryInterface * @param RuleGroup $ruleGroup * @param RuleGroup $moveTo * - * @return boolean + * @return bool */ - public function destroy(RuleGroup $ruleGroup, RuleGroup $moveTo = null) + public function destroy(RuleGroup $ruleGroup, RuleGroup $moveTo = null): bool { /** @var Rule $rule */ foreach ($ruleGroup->rules as $rule) { @@ -72,7 +72,7 @@ class RuleGroupRepository implements RuleGroupRepositoryInterface /** * @return Collection */ - public function get() + public function get(): Collection { return $this->user->ruleGroups()->orderBy('order', 'ASC')->get(); } @@ -80,7 +80,7 @@ class RuleGroupRepository implements RuleGroupRepositoryInterface /** * @return int */ - public function getHighestOrderRuleGroup() + public function getHighestOrderRuleGroup(): int { $entry = $this->user->ruleGroups()->max('order'); @@ -119,7 +119,7 @@ class RuleGroupRepository implements RuleGroupRepositoryInterface * * @return bool */ - public function moveDown(RuleGroup $ruleGroup) + public function moveDown(RuleGroup $ruleGroup): bool { $order = $ruleGroup->order; @@ -133,6 +133,7 @@ class RuleGroupRepository implements RuleGroupRepositoryInterface $ruleGroup->order = ($ruleGroup->order + 1); $ruleGroup->save(); $this->resetRuleGroupOrder(); + return true; } /** @@ -140,7 +141,7 @@ class RuleGroupRepository implements RuleGroupRepositoryInterface * * @return bool */ - public function moveUp(RuleGroup $ruleGroup) + public function moveUp(RuleGroup $ruleGroup): bool { $order = $ruleGroup->order; @@ -154,12 +155,13 @@ class RuleGroupRepository implements RuleGroupRepositoryInterface $ruleGroup->order = ($ruleGroup->order - 1); $ruleGroup->save(); $this->resetRuleGroupOrder(); + return true; } /** * @return bool */ - public function resetRuleGroupOrder() + public function resetRuleGroupOrder(): bool { $this->user->ruleGroups()->whereNotNull('deleted_at')->update(['order' => 0]); @@ -181,7 +183,7 @@ class RuleGroupRepository implements RuleGroupRepositoryInterface * * @return bool */ - public function resetRulesInGroupOrder(RuleGroup $ruleGroup) + public function resetRulesInGroupOrder(RuleGroup $ruleGroup): bool { $ruleGroup->rules()->whereNotNull('deleted_at')->update(['order' => 0]); @@ -206,7 +208,7 @@ class RuleGroupRepository implements RuleGroupRepositoryInterface * * @return RuleGroup */ - public function store(array $data) + public function store(array $data): RuleGroup { $order = $this->getHighestOrderRuleGroup(); @@ -233,7 +235,7 @@ class RuleGroupRepository implements RuleGroupRepositoryInterface * * @return RuleGroup */ - public function update(RuleGroup $ruleGroup, array $data) + public function update(RuleGroup $ruleGroup, array $data): RuleGroup { // update the account: $ruleGroup->title = $data['title']; diff --git a/app/Repositories/RuleGroup/RuleGroupRepositoryInterface.php b/app/Repositories/RuleGroup/RuleGroupRepositoryInterface.php index 332a481354..8e91189457 100644 --- a/app/Repositories/RuleGroup/RuleGroupRepositoryInterface.php +++ b/app/Repositories/RuleGroup/RuleGroupRepositoryInterface.php @@ -20,7 +20,7 @@ interface RuleGroupRepositoryInterface /** * @return int */ - public function count(); + public function count(): int; /** * @param RuleGroup $ruleGroup @@ -28,17 +28,17 @@ interface RuleGroupRepositoryInterface * * @return bool */ - public function destroy(RuleGroup $ruleGroup, RuleGroup $moveTo = null); + public function destroy(RuleGroup $ruleGroup, RuleGroup $moveTo = null): bool; /** * @return Collection */ - public function get(); + public function get(): Collection; /** * @return int */ - public function getHighestOrderRuleGroup(); + public function getHighestOrderRuleGroup(): int; /** * @param User $user @@ -52,33 +52,33 @@ interface RuleGroupRepositoryInterface * * @return bool */ - public function moveDown(RuleGroup $ruleGroup); + public function moveDown(RuleGroup $ruleGroup): bool; /** * @param RuleGroup $ruleGroup * * @return bool */ - public function moveUp(RuleGroup $ruleGroup); + public function moveUp(RuleGroup $ruleGroup): bool; /** * @return bool */ - public function resetRuleGroupOrder(); + public function resetRuleGroupOrder(): bool; /** * @param RuleGroup $ruleGroup * * @return bool */ - public function resetRulesInGroupOrder(RuleGroup $ruleGroup); + public function resetRulesInGroupOrder(RuleGroup $ruleGroup): bool; /** * @param array $data * * @return RuleGroup */ - public function store(array $data); + public function store(array $data): RuleGroup; /** * @param RuleGroup $ruleGroup @@ -86,7 +86,7 @@ interface RuleGroupRepositoryInterface * * @return RuleGroup */ - public function update(RuleGroup $ruleGroup, array $data); + public function update(RuleGroup $ruleGroup, array $data): RuleGroup; } diff --git a/app/Repositories/Tag/TagRepository.php b/app/Repositories/Tag/TagRepository.php index 7ec2bcd6c8..14fea48a91 100644 --- a/app/Repositories/Tag/TagRepository.php +++ b/app/Repositories/Tag/TagRepository.php @@ -42,7 +42,7 @@ class TagRepository implements TagRepositoryInterface * * @return Collection */ - public function allCoveredByBalancingActs(Collection $accounts, Carbon $start, Carbon $end) + public function allCoveredByBalancingActs(Collection $accounts, Carbon $start, Carbon $end): Collection { $ids = $accounts->pluck('id')->toArray(); $set = $this->user->tags() @@ -84,9 +84,9 @@ class TagRepository implements TagRepositoryInterface * * @SuppressWarnings(PHPMD.CyclomaticComplexity) // it's exactly 5. * - * @return boolean + * @return bool */ - public function connect(TransactionJournal $journal, Tag $tag) + public function connect(TransactionJournal $journal, Tag $tag): bool { /* * Already connected: @@ -125,7 +125,7 @@ class TagRepository implements TagRepositoryInterface * * @return string */ - public function coveredByBalancingActs(Account $account, Carbon $start, Carbon $end) + public function coveredByBalancingActs(Account $account, Carbon $start, Carbon $end): string { // the quickest way to do this is by scanning all balancingAct tags // because there will be less of them any way. @@ -152,20 +152,19 @@ class TagRepository implements TagRepositoryInterface /** * @param Tag $tag * - * @return boolean + * @return bool */ - public function destroy(Tag $tag) + public function destroy(Tag $tag): bool { $tag->delete(); return true; } - // @codeCoverageIgnoreEnd /** * @return Collection */ - public function get() + public function get(): Collection { /** @var Collection $tags */ $tags = $this->user->tags()->get(); @@ -183,7 +182,7 @@ class TagRepository implements TagRepositoryInterface * * @return Tag */ - public function store(array $data) + public function store(array $data): Tag { $tag = new Tag; $tag->tag = $data['tag']; @@ -208,7 +207,7 @@ class TagRepository implements TagRepositoryInterface * * @return bool */ - public function tagAllowAdvance(Tag $tag) + public function tagAllowAdvance(Tag $tag): bool { /* * If this tag is a balancing act, and it contains transfers, it cannot be @@ -247,7 +246,7 @@ class TagRepository implements TagRepositoryInterface * * @return bool */ - public function tagAllowBalancing(Tag $tag) + public function tagAllowBalancing(Tag $tag): bool { /* * If has more than two transactions already, cannot become a balancing act: @@ -275,7 +274,7 @@ class TagRepository implements TagRepositoryInterface * * @return Tag */ - public function update(Tag $tag, array $data) + public function update(Tag $tag, array $data): Tag { $tag->tag = $data['tag']; $tag->date = $data['date']; @@ -295,9 +294,9 @@ class TagRepository implements TagRepositoryInterface * * @SuppressWarnings(PHPMD.CyclomaticComplexity) * - * @return boolean + * @return bool */ - protected function connectAdvancePayment(TransactionJournal $journal, Tag $tag) + protected function connectAdvancePayment(TransactionJournal $journal, Tag $tag): bool { /** @var TransactionType $transfer */ $transfer = TransactionType::whereType(TransactionType::TRANSFER)->first(); @@ -332,7 +331,7 @@ class TagRepository implements TagRepositoryInterface } // this statement is unreachable. - return false; // @codeCoverageIgnore + return false; } @@ -340,9 +339,9 @@ class TagRepository implements TagRepositoryInterface * @param TransactionJournal $journal * @param Tag $tag * - * @return boolean + * @return bool */ - protected function connectBalancingAct(TransactionJournal $journal, Tag $tag) + protected function connectBalancingAct(TransactionJournal $journal, Tag $tag): bool { /** @var TransactionType $withdrawal */ $withdrawal = TransactionType::whereType(TransactionType::WITHDRAWAL)->first(); @@ -380,7 +379,7 @@ class TagRepository implements TagRepositoryInterface * * @return bool */ - protected function matchAll(TransactionJournal $journal, Tag $tag) + protected function matchAll(TransactionJournal $journal, Tag $tag): bool { $match = true; /** @var TransactionJournal $check */ diff --git a/app/Repositories/Tag/TagRepositoryInterface.php b/app/Repositories/Tag/TagRepositoryInterface.php index 77c2d73c8b..0520c1caaf 100644 --- a/app/Repositories/Tag/TagRepositoryInterface.php +++ b/app/Repositories/Tag/TagRepositoryInterface.php @@ -24,15 +24,15 @@ interface TagRepositoryInterface * * @return Collection */ - public function allCoveredByBalancingActs(Collection $accounts, Carbon $start, Carbon $end); + public function allCoveredByBalancingActs(Collection $accounts, Carbon $start, Carbon $end): Collection; /** * @param TransactionJournal $journal * @param Tag $tag * - * @return boolean + * @return bool */ - public function connect(TransactionJournal $journal, Tag $tag); + public function connect(TransactionJournal $journal, Tag $tag): bool; /** * @deprecated @@ -49,26 +49,26 @@ interface TagRepositoryInterface * * @return string */ - public function coveredByBalancingActs(Account $account, Carbon $start, Carbon $end); + public function coveredByBalancingActs(Account $account, Carbon $start, Carbon $end): string; /** * @param Tag $tag * - * @return boolean + * @return bool */ - public function destroy(Tag $tag); + public function destroy(Tag $tag): bool; /** * @return Collection */ - public function get(); + public function get(): Collection; /** * @param array $data * * @return Tag */ - public function store(array $data); + public function store(array $data): Tag; /** * Can a tag become an advance payment? @@ -77,7 +77,7 @@ interface TagRepositoryInterface * * @return bool */ - public function tagAllowAdvance(Tag $tag); + public function tagAllowAdvance(Tag $tag): bool; /** * Can a tag become a balancing act? @@ -86,7 +86,7 @@ interface TagRepositoryInterface * * @return bool */ - public function tagAllowBalancing(Tag $tag); + public function tagAllowBalancing(Tag $tag): bool; /** * @param Tag $tag @@ -94,5 +94,5 @@ interface TagRepositoryInterface * * @return Tag */ - public function update(Tag $tag, array $data); + public function update(Tag $tag, array $data): Tag; } diff --git a/app/Rules/Actions/ActionInterface.php b/app/Rules/Actions/ActionInterface.php index 8b90cb39df..42f95b37db 100644 --- a/app/Rules/Actions/ActionInterface.php +++ b/app/Rules/Actions/ActionInterface.php @@ -32,5 +32,5 @@ interface ActionInterface * * @return bool */ - public function act(TransactionJournal $journal); + public function act(TransactionJournal $journal): bool; } diff --git a/app/Rules/Actions/AddTag.php b/app/Rules/Actions/AddTag.php index 80a5750119..87d2b8e743 100644 --- a/app/Rules/Actions/AddTag.php +++ b/app/Rules/Actions/AddTag.php @@ -42,7 +42,7 @@ class AddTag implements ActionInterface * * @return bool */ - public function act(TransactionJournal $journal) + public function act(TransactionJournal $journal): bool { // journal has this tag maybe? $tag = Tag::firstOrCreateEncrypted(['tag' => $this->action->action_value, 'user_id' => Auth::user()->id]); diff --git a/app/Rules/Actions/AppendDescription.php b/app/Rules/Actions/AppendDescription.php index d858959025..281b1a0857 100644 --- a/app/Rules/Actions/AppendDescription.php +++ b/app/Rules/Actions/AppendDescription.php @@ -39,7 +39,7 @@ class AppendDescription implements ActionInterface * * @return bool */ - public function act(TransactionJournal $journal) + public function act(TransactionJournal $journal): bool { $journal->description = $journal->description . $this->action->action_value; $journal->save(); diff --git a/app/Rules/Actions/ClearBudget.php b/app/Rules/Actions/ClearBudget.php index 441157f07e..0cea12a61e 100644 --- a/app/Rules/Actions/ClearBudget.php +++ b/app/Rules/Actions/ClearBudget.php @@ -40,7 +40,7 @@ class ClearBudget implements ActionInterface * * @return bool */ - public function act(TransactionJournal $journal) + public function act(TransactionJournal $journal): bool { $journal->budgets()->detach(); diff --git a/app/Rules/Actions/ClearCategory.php b/app/Rules/Actions/ClearCategory.php index 16e435b505..3a1c5d1d7f 100644 --- a/app/Rules/Actions/ClearCategory.php +++ b/app/Rules/Actions/ClearCategory.php @@ -40,7 +40,7 @@ class ClearCategory implements ActionInterface * * @return bool */ - public function act(TransactionJournal $journal) + public function act(TransactionJournal $journal): bool { $journal->categories()->detach(); diff --git a/app/Rules/Actions/PrependDescription.php b/app/Rules/Actions/PrependDescription.php index a0eeca1549..52b4b4f2f0 100644 --- a/app/Rules/Actions/PrependDescription.php +++ b/app/Rules/Actions/PrependDescription.php @@ -39,7 +39,7 @@ class PrependDescription implements ActionInterface * * @return bool */ - public function act(TransactionJournal $journal) + public function act(TransactionJournal $journal): bool { $journal->description = $this->action->action_value . $journal->description; $journal->save(); diff --git a/app/Rules/Actions/RemoveAllTags.php b/app/Rules/Actions/RemoveAllTags.php index e3217011d9..3bcd36f8af 100644 --- a/app/Rules/Actions/RemoveAllTags.php +++ b/app/Rules/Actions/RemoveAllTags.php @@ -39,7 +39,7 @@ class RemoveAllTags implements ActionInterface * * @return bool */ - public function act(TransactionJournal $journal) + public function act(TransactionJournal $journal): bool { $journal->tags()->detach(); diff --git a/app/Rules/Actions/RemoveTag.php b/app/Rules/Actions/RemoveTag.php index a090e57009..a6b5c87327 100644 --- a/app/Rules/Actions/RemoveTag.php +++ b/app/Rules/Actions/RemoveTag.php @@ -42,7 +42,7 @@ class RemoveTag implements ActionInterface * * @return bool */ - public function act(TransactionJournal $journal) + public function act(TransactionJournal $journal): bool { // if tag does not exist, no need to continue: $name = $this->action->action_value; diff --git a/app/Rules/Actions/SetBudget.php b/app/Rules/Actions/SetBudget.php index 54847f836b..9ea73e2a39 100644 --- a/app/Rules/Actions/SetBudget.php +++ b/app/Rules/Actions/SetBudget.php @@ -43,7 +43,7 @@ class SetBudget implements ActionInterface * * @return bool */ - public function act(TransactionJournal $journal) + public function act(TransactionJournal $journal): bool { /** @var BudgetRepositoryInterface $repository */ $repository = app('FireflyIII\Repositories\Budget\BudgetRepositoryInterface'); diff --git a/app/Rules/Actions/SetCategory.php b/app/Rules/Actions/SetCategory.php index 24107459a5..86ccef422d 100644 --- a/app/Rules/Actions/SetCategory.php +++ b/app/Rules/Actions/SetCategory.php @@ -43,7 +43,7 @@ class SetCategory implements ActionInterface * * @return bool */ - public function act(TransactionJournal $journal) + public function act(TransactionJournal $journal): bool { $name = $this->action->action_value; $category = Category::firstOrCreateEncrypted(['name' => $name, 'user_id' => Auth::user()->id]); diff --git a/app/Rules/Actions/SetDescription.php b/app/Rules/Actions/SetDescription.php index a3c822ddb1..47dabc12d6 100644 --- a/app/Rules/Actions/SetDescription.php +++ b/app/Rules/Actions/SetDescription.php @@ -39,7 +39,7 @@ class SetDescription implements ActionInterface * * @return bool */ - public function act(TransactionJournal $journal) + public function act(TransactionJournal $journal): bool { $journal->description = $this->action->action_value; $journal->save(); diff --git a/app/Rules/Processor.php b/app/Rules/Processor.php index eb3d5da5e3..58e5d406e2 100644 --- a/app/Rules/Processor.php +++ b/app/Rules/Processor.php @@ -117,7 +117,7 @@ final class Processor * * @return \FireflyIII\Models\Rule */ - public function getRule() + public function getRule(): Rule { return $this->rule; } @@ -131,18 +131,20 @@ final class Processor * * @return bool */ - public function handleTransactionJournal(TransactionJournal $journal) + public function handleTransactionJournal(TransactionJournal $journal): bool { $this->journal = $journal; // get all triggers: $triggered = $this->triggered(); if ($triggered) { if ($this->actions->count() > 0) { + Log::debug('Journal #' . $journal->id . ' triggered, actions executed.'); $this->actions(); } return true; } + Log::debug('Journal #' . $journal->id . ' not triggered, did nothing.'); return false; diff --git a/app/Rules/TransactionMatcher.php b/app/Rules/TransactionMatcher.php index 3c970430dc..80be3c7366 100644 --- a/app/Rules/TransactionMatcher.php +++ b/app/Rules/TransactionMatcher.php @@ -115,7 +115,7 @@ class TransactionMatcher * * @return TransactionMatcher */ - public function setLimit($limit): TransactionMatcher + public function setLimit(int $limit): TransactionMatcher { $this->limit = $limit; @@ -135,7 +135,7 @@ class TransactionMatcher * * @return TransactionMatcher */ - public function setRange($range): TransactionMatcher + public function setRange(int $range): TransactionMatcher { $this->range = $range; @@ -156,7 +156,7 @@ class TransactionMatcher * * @return TransactionMatcher */ - public function setTriggers($triggers): TransactionMatcher + public function setTriggers(array $triggers): TransactionMatcher { $this->triggers = $triggers; diff --git a/app/Rules/Triggers/AmountExactly.php b/app/Rules/Triggers/AmountExactly.php index 0f2adce2a0..7a6ca714dd 100644 --- a/app/Rules/Triggers/AmountExactly.php +++ b/app/Rules/Triggers/AmountExactly.php @@ -51,7 +51,7 @@ final class AmountExactly extends AbstractTrigger implements TriggerInterface * * @return bool */ - public function triggered(TransactionJournal $journal) + public function triggered(TransactionJournal $journal): bool { $amount = $journal->destination_amount ?? TransactionJournal::amountPositive($journal); $compare = $this->triggerValue; diff --git a/app/Rules/Triggers/AmountLess.php b/app/Rules/Triggers/AmountLess.php index fa96f756dd..e6d8cc9c27 100644 --- a/app/Rules/Triggers/AmountLess.php +++ b/app/Rules/Triggers/AmountLess.php @@ -51,7 +51,7 @@ final class AmountLess extends AbstractTrigger implements TriggerInterface * * @return bool */ - public function triggered(TransactionJournal $journal) + public function triggered(TransactionJournal $journal): bool { $amount = $journal->destination_amount ?? TransactionJournal::amountPositive($journal); $compare = $this->triggerValue; diff --git a/app/Rules/Triggers/AmountMore.php b/app/Rules/Triggers/AmountMore.php index 8c95bf4568..ce8b2c7573 100644 --- a/app/Rules/Triggers/AmountMore.php +++ b/app/Rules/Triggers/AmountMore.php @@ -51,7 +51,7 @@ final class AmountMore extends AbstractTrigger implements TriggerInterface * * @return bool */ - public function triggered(TransactionJournal $journal) + public function triggered(TransactionJournal $journal): bool { $amount = $journal->destination_amount ?? TransactionJournal::amountPositive($journal); $compare = $this->triggerValue; diff --git a/app/Rules/Triggers/DescriptionContains.php b/app/Rules/Triggers/DescriptionContains.php index 284ffa311e..6f75479ce4 100644 --- a/app/Rules/Triggers/DescriptionContains.php +++ b/app/Rules/Triggers/DescriptionContains.php @@ -51,7 +51,7 @@ final class DescriptionContains extends AbstractTrigger implements TriggerInterf * * @return bool */ - public function triggered(TransactionJournal $journal) + public function triggered(TransactionJournal $journal): bool { $search = strtolower($this->triggerValue); $source = strtolower($journal->description); diff --git a/app/Rules/Triggers/DescriptionEnds.php b/app/Rules/Triggers/DescriptionEnds.php index 8bec9cc1fe..751645ff85 100644 --- a/app/Rules/Triggers/DescriptionEnds.php +++ b/app/Rules/Triggers/DescriptionEnds.php @@ -50,7 +50,7 @@ final class DescriptionEnds extends AbstractTrigger implements TriggerInterface * * @return bool */ - public function triggered(TransactionJournal $journal) + public function triggered(TransactionJournal $journal): bool { $description = strtolower($journal->description); $descriptionLength = strlen($description); diff --git a/app/Rules/Triggers/DescriptionIs.php b/app/Rules/Triggers/DescriptionIs.php index 5dcec9b3d1..81bfb8ad7c 100644 --- a/app/Rules/Triggers/DescriptionIs.php +++ b/app/Rules/Triggers/DescriptionIs.php @@ -50,7 +50,7 @@ final class DescriptionIs extends AbstractTrigger implements TriggerInterface * * @return bool */ - public function triggered(TransactionJournal $journal) + public function triggered(TransactionJournal $journal): bool { $description = strtolower($journal->description); $search = strtolower($this->triggerValue); diff --git a/app/Rules/Triggers/DescriptionStarts.php b/app/Rules/Triggers/DescriptionStarts.php index 5763f30d59..295333c95b 100644 --- a/app/Rules/Triggers/DescriptionStarts.php +++ b/app/Rules/Triggers/DescriptionStarts.php @@ -50,7 +50,7 @@ final class DescriptionStarts extends AbstractTrigger implements TriggerInterfac * * @return bool */ - public function triggered(TransactionJournal $journal) + public function triggered(TransactionJournal $journal): bool { $description = strtolower($journal->description); $search = strtolower($this->triggerValue); diff --git a/app/Rules/Triggers/FromAccountContains.php b/app/Rules/Triggers/FromAccountContains.php index 6510a1fb71..58799b60d4 100644 --- a/app/Rules/Triggers/FromAccountContains.php +++ b/app/Rules/Triggers/FromAccountContains.php @@ -50,7 +50,7 @@ final class FromAccountContains extends AbstractTrigger implements TriggerInterf * * @return bool */ - public function triggered(TransactionJournal $journal) + public function triggered(TransactionJournal $journal): bool { $fromAccountName = strtolower($journal->source_account_name ?? TransactionJournal::sourceAccount($journal)->name); $search = strtolower($this->triggerValue); diff --git a/app/Rules/Triggers/FromAccountEnds.php b/app/Rules/Triggers/FromAccountEnds.php index eaee5223fa..96e83fadcf 100644 --- a/app/Rules/Triggers/FromAccountEnds.php +++ b/app/Rules/Triggers/FromAccountEnds.php @@ -50,7 +50,7 @@ final class FromAccountEnds extends AbstractTrigger implements TriggerInterface * * @return bool */ - public function triggered(TransactionJournal $journal) + public function triggered(TransactionJournal $journal): bool { $name = strtolower($journal->source_account_name ?? TransactionJournal::sourceAccount($journal)->name); $nameLength = strlen($name); diff --git a/app/Rules/Triggers/FromAccountIs.php b/app/Rules/Triggers/FromAccountIs.php index 1344847929..061044cf7d 100644 --- a/app/Rules/Triggers/FromAccountIs.php +++ b/app/Rules/Triggers/FromAccountIs.php @@ -50,7 +50,7 @@ final class FromAccountIs extends AbstractTrigger implements TriggerInterface * * @return bool */ - public function triggered(TransactionJournal $journal) + public function triggered(TransactionJournal $journal): bool { $name = strtolower($journal->source_account_name ?? TransactionJournal::sourceAccount($journal)->name); $search = strtolower($this->triggerValue); diff --git a/app/Rules/Triggers/FromAccountStarts.php b/app/Rules/Triggers/FromAccountStarts.php index 32027e4587..62eaafac67 100644 --- a/app/Rules/Triggers/FromAccountStarts.php +++ b/app/Rules/Triggers/FromAccountStarts.php @@ -50,7 +50,7 @@ final class FromAccountStarts extends AbstractTrigger implements TriggerInterfac * * @return bool */ - public function triggered(TransactionJournal $journal) + public function triggered(TransactionJournal $journal): bool { $name = strtolower($journal->source_account_name ?? TransactionJournal::sourceAccount($journal)->name); $search = strtolower($this->triggerValue); diff --git a/app/Rules/Triggers/ToAccountContains.php b/app/Rules/Triggers/ToAccountContains.php index e898743ab0..f6d7c31c68 100644 --- a/app/Rules/Triggers/ToAccountContains.php +++ b/app/Rules/Triggers/ToAccountContains.php @@ -50,7 +50,7 @@ final class ToAccountContains extends AbstractTrigger implements TriggerInterfac * * @return bool */ - public function triggered(TransactionJournal $journal) + public function triggered(TransactionJournal $journal): bool { $toAccountName = strtolower($journal->destination_account_name ?? TransactionJournal::destinationAccount($journal)->name); $search = strtolower($this->triggerValue); diff --git a/app/Rules/Triggers/ToAccountEnds.php b/app/Rules/Triggers/ToAccountEnds.php index a6acfafc90..f01d8d8ba5 100644 --- a/app/Rules/Triggers/ToAccountEnds.php +++ b/app/Rules/Triggers/ToAccountEnds.php @@ -50,7 +50,7 @@ final class ToAccountEnds extends AbstractTrigger implements TriggerInterface * * @return bool */ - public function triggered(TransactionJournal $journal) + public function triggered(TransactionJournal $journal): bool { $toAccountName = strtolower($journal->destination_account_name ?? TransactionJournal::destinationAccount($journal)->name); $toAccountNameLength = strlen($toAccountName); diff --git a/app/Rules/Triggers/ToAccountIs.php b/app/Rules/Triggers/ToAccountIs.php index 03506aa9bc..6d1ea0181e 100644 --- a/app/Rules/Triggers/ToAccountIs.php +++ b/app/Rules/Triggers/ToAccountIs.php @@ -50,7 +50,7 @@ final class ToAccountIs extends AbstractTrigger implements TriggerInterface * * @return bool */ - public function triggered(TransactionJournal $journal) + public function triggered(TransactionJournal $journal): bool { $toAccountName = strtolower($journal->destination_account_name ?? TransactionJournal::destinationAccount($journal)->name); $search = strtolower($this->triggerValue); diff --git a/app/Rules/Triggers/ToAccountStarts.php b/app/Rules/Triggers/ToAccountStarts.php index 2e3c5655ce..8f00f80d0c 100644 --- a/app/Rules/Triggers/ToAccountStarts.php +++ b/app/Rules/Triggers/ToAccountStarts.php @@ -50,7 +50,7 @@ final class ToAccountStarts extends AbstractTrigger implements TriggerInterface * * @return bool */ - public function triggered(TransactionJournal $journal) + public function triggered(TransactionJournal $journal): bool { $toAccountName = strtolower($journal->destination_account_name ?? TransactionJournal::destinationAccount($journal)->name); $search = strtolower($this->triggerValue); diff --git a/app/Rules/Triggers/TransactionType.php b/app/Rules/Triggers/TransactionType.php index b6a0669add..a57d1aa1cc 100644 --- a/app/Rules/Triggers/TransactionType.php +++ b/app/Rules/Triggers/TransactionType.php @@ -50,7 +50,7 @@ final class TransactionType extends AbstractTrigger implements TriggerInterface * * @return bool */ - public function triggered(TransactionJournal $journal) + public function triggered(TransactionJournal $journal): bool { $type = !is_null($journal->transaction_type_type) ? $journal->transaction_type_type : strtolower($journal->transactionType->type); $search = strtolower($this->triggerValue); diff --git a/app/Rules/Triggers/TriggerInterface.php b/app/Rules/Triggers/TriggerInterface.php index 5b7dd50cbf..2cd5bd2c2c 100644 --- a/app/Rules/Triggers/TriggerInterface.php +++ b/app/Rules/Triggers/TriggerInterface.php @@ -43,5 +43,5 @@ interface TriggerInterface * * @return bool */ - public function triggered(TransactionJournal $journal); + public function triggered(TransactionJournal $journal): bool; } diff --git a/app/Rules/Triggers/UserAction.php b/app/Rules/Triggers/UserAction.php index 7aa76ef43c..32f9698a91 100644 --- a/app/Rules/Triggers/UserAction.php +++ b/app/Rules/Triggers/UserAction.php @@ -48,7 +48,7 @@ final class UserAction extends AbstractTrigger implements TriggerInterface * * @return bool */ - public function triggered(TransactionJournal $journal) + public function triggered(TransactionJournal $journal): bool { return true; } diff --git a/app/Sql/Query.php b/app/Sql/Query.php deleted file mode 100644 index ccc9a6244f..0000000000 --- a/app/Sql/Query.php +++ /dev/null @@ -1,18 +0,0 @@ -get(); } @@ -120,7 +120,7 @@ class Amount /** * @return string */ - public function getCurrencyCode() + public function getCurrencyCode(): string { $cache = new CacheProperties; @@ -139,14 +139,14 @@ class Amount } $cache->store(env('DEFAULT_CURRENCY', 'EUR')); - return env('DEFAULT_CURRENCY', 'EUR'); // @codeCoverageIgnore + return env('DEFAULT_CURRENCY', 'EUR'); } } /** * @return string */ - public function getCurrencySymbol() + public function getCurrencySymbol(): string { $cache = new CacheProperties; $cache->addProperty('getCurrencySymbol'); @@ -165,7 +165,7 @@ class Amount /** * @return TransactionCurrency */ - public function getDefaultCurrency() + public function getDefaultCurrency(): TransactionCurrency { $cache = new CacheProperties; $cache->addProperty('getDefaultCurrency'); diff --git a/app/Support/CacheProperties.php b/app/Support/CacheProperties.php index 710b971eab..19f6c0f6cc 100644 --- a/app/Support/CacheProperties.php +++ b/app/Support/CacheProperties.php @@ -14,7 +14,6 @@ use Preferences as Prefs; /** * Class CacheProperties * - * @codeCoverageIgnore * @package FireflyIII\Support */ class CacheProperties diff --git a/app/Support/ExpandedForm.php b/app/Support/ExpandedForm.php index 65dcb3dd86..c92580de77 100644 --- a/app/Support/ExpandedForm.php +++ b/app/Support/ExpandedForm.php @@ -246,17 +246,15 @@ class ExpandedForm * * @return string */ - public function optionsList($type, $name): string + public function optionsList(string $type, string $name): string { $previousValue = null; - // @codeCoverageIgnoreStart try { $previousValue = Input::old('post_submit_action'); } catch (RuntimeException $e) { // don't care } - // @codeCoverageIgnoreEnd $previousValue = is_null($previousValue) ? 'store' : $previousValue; $html = view('form.options', compact('type', 'name', 'previousValue'))->render(); @@ -391,7 +389,6 @@ class ExpandedForm $preFilled = session('preFilled'); $value = isset($preFilled[$name]) && is_null($value) ? $preFilled[$name] : $value; } - // @codeCoverageIgnoreStart try { if (!is_null(Input::old($name))) { $value = Input::old($name); @@ -400,7 +397,6 @@ class ExpandedForm // don't care about session errors. } - // @codeCoverageIgnoreEnd return $value; } diff --git a/app/Support/Facades/Amount.php b/app/Support/Facades/Amount.php index c6d2b43250..ea067dcb32 100644 --- a/app/Support/Facades/Amount.php +++ b/app/Support/Facades/Amount.php @@ -8,7 +8,6 @@ use Illuminate\Support\Facades\Facade; /** * Class Amount * - * @codeCoverageIgnore * @package FireflyIII\Support\Facades */ class Amount extends Facade diff --git a/app/Support/Facades/ExpandedForm.php b/app/Support/Facades/ExpandedForm.php index 006a88f2c3..50ad979629 100644 --- a/app/Support/Facades/ExpandedForm.php +++ b/app/Support/Facades/ExpandedForm.php @@ -8,7 +8,6 @@ use Illuminate\Support\Facades\Facade; /** * Class Amount * - * @codeCoverageIgnore * @package FireflyIII\Support\Facades */ class ExpandedForm extends Facade diff --git a/app/Support/Facades/Navigation.php b/app/Support/Facades/Navigation.php index dba4ed838b..b00578a601 100644 --- a/app/Support/Facades/Navigation.php +++ b/app/Support/Facades/Navigation.php @@ -8,7 +8,6 @@ use Illuminate\Support\Facades\Facade; /** * Class Navigation * - * @codeCoverageIgnore * @package FireflyIII\Support\Facades */ class Navigation extends Facade diff --git a/app/Support/Facades/Preferences.php b/app/Support/Facades/Preferences.php index 06b7033813..f51347a6e0 100644 --- a/app/Support/Facades/Preferences.php +++ b/app/Support/Facades/Preferences.php @@ -8,7 +8,6 @@ use Illuminate\Support\Facades\Facade; /** * Class Preferences * - * @codeCoverageIgnore * @package FireflyIII\Support\Facades */ class Preferences extends Facade diff --git a/app/Support/Facades/Steam.php b/app/Support/Facades/Steam.php index 5c93adcd8b..9fa7b179b1 100644 --- a/app/Support/Facades/Steam.php +++ b/app/Support/Facades/Steam.php @@ -8,7 +8,6 @@ use Illuminate\Support\Facades\Facade; /** * Class Steam * - * @codeCoverageIgnore * @package FireflyIII\Support\Facades */ class Steam extends Facade diff --git a/app/Support/Models/TransactionJournalSupport.php b/app/Support/Models/TransactionJournalSupport.php index 2a2a5faf1a..253361547a 100644 --- a/app/Support/Models/TransactionJournalSupport.php +++ b/app/Support/Models/TransactionJournalSupport.php @@ -39,7 +39,7 @@ class TransactionJournalSupport extends Model $cache->addProperty('transaction-journal'); $cache->addProperty('amount'); if ($cache->has()) { - return $cache->get(); // @codeCoverageIgnore + return $cache->get(); } $transaction = $journal->transactions->sortByDesc('amount')->first(); @@ -66,7 +66,7 @@ class TransactionJournalSupport extends Model $cache->addProperty('transaction-journal'); $cache->addProperty('amount-positive'); if ($cache->has()) { - return $cache->get(); // @codeCoverageIgnore + return $cache->get(); } $amount = '0'; @@ -143,7 +143,7 @@ class TransactionJournalSupport extends Model $cache->addProperty('transaction-journal'); $cache->addProperty('destination-account'); if ($cache->has()) { - return $cache->get(); // @codeCoverageIgnore + return $cache->get(); } $transaction = $journal->transactions()->where('amount', '>', 0)->first(); if (!is_null($transaction)) { @@ -168,7 +168,7 @@ class TransactionJournalSupport extends Model $cache->addProperty('transaction-journal'); $cache->addProperty('destination-account-type-str'); if ($cache->has()) { - return $cache->get(); // @codeCoverageIgnore + return $cache->get(); } $account = self::destinationAccount($journal); @@ -225,7 +225,7 @@ class TransactionJournalSupport extends Model $cache->addProperty('transaction-journal'); $cache->addProperty('source-account'); if ($cache->has()) { - return $cache->get(); // @codeCoverageIgnore + return $cache->get(); } $transaction = $journal->transactions()->where('amount', '<', 0)->first(); if (!is_null($transaction)) { @@ -250,7 +250,7 @@ class TransactionJournalSupport extends Model $cache->addProperty('transaction-journal'); $cache->addProperty('source-account-type-str'); if ($cache->has()) { - return $cache->get(); // @codeCoverageIgnore + return $cache->get(); } $account = self::sourceAccount($journal); @@ -272,7 +272,7 @@ class TransactionJournalSupport extends Model $cache->addProperty('transaction-journal'); $cache->addProperty('type-string'); if ($cache->has()) { - return $cache->get(); // @codeCoverageIgnore + return $cache->get(); } $typeStr = $journal->transaction_type_type ?? $journal->transactionType->type; diff --git a/app/Support/Navigation.php b/app/Support/Navigation.php index 51cb6091bc..0d3777e93e 100644 --- a/app/Support/Navigation.php +++ b/app/Support/Navigation.php @@ -23,7 +23,7 @@ class Navigation * @return \Carbon\Carbon * @throws FireflyException */ - public function addPeriod(Carbon $theDate, string $repeatFreq, int $skip) + public function addPeriod(Carbon $theDate, string $repeatFreq, int $skip): Carbon { $date = clone $theDate; $add = ($skip + 1); @@ -62,7 +62,7 @@ class Navigation * @return \Carbon\Carbon * @throws FireflyException */ - public function endOfPeriod(Carbon $theCurrentEnd, string $repeatFreq) + public function endOfPeriod(Carbon $theCurrentEnd, string $repeatFreq): Carbon { $currentEnd = clone $theCurrentEnd; @@ -121,7 +121,7 @@ class Navigation * * @return \Carbon\Carbon */ - public function endOfX(Carbon $theCurrentEnd, string $repeatFreq, Carbon $maxDate = null) + public function endOfX(Carbon $theCurrentEnd, string $repeatFreq, Carbon $maxDate = null): Carbon { $functionMap = [ '1D' => 'endOfDay', @@ -162,7 +162,7 @@ class Navigation * @return string * @throws FireflyException */ - public function periodShow(Carbon $date, string $repeatFrequency) + public function periodShow(Carbon $date, string $repeatFrequency): string { $formatMap = [ '1D' => trans('config.specific_day'), @@ -197,7 +197,7 @@ class Navigation * @return \Carbon\Carbon * @throws FireflyException */ - public function startOfPeriod(Carbon $theDate, string $repeatFreq) + public function startOfPeriod(Carbon $theDate, string $repeatFreq): Carbon { $date = clone $theDate; @@ -248,7 +248,7 @@ class Navigation * @return \Carbon\Carbon * @throws FireflyException */ - public function subtractPeriod(Carbon $theDate, string $repeatFreq, int $subtract = 1) + public function subtractPeriod(Carbon $theDate, string $repeatFreq, int $subtract = 1): Carbon { $date = clone $theDate; // 1D 1W 1M 3M 6M 1Y @@ -308,7 +308,7 @@ class Navigation * @return \Carbon\Carbon * @throws FireflyException */ - public function updateEndDate(string $range, Carbon $start) + public function updateEndDate(string $range, Carbon $start): Carbon { $functionMap = [ '1D' => 'endOfDay', @@ -344,7 +344,7 @@ class Navigation * @return \Carbon\Carbon * @throws FireflyException */ - public function updateStartDate(string $range, Carbon $start) + public function updateStartDate(string $range, Carbon $start): Carbon { $functionMap = [ '1D' => 'startOfDay', diff --git a/app/Support/Preferences.php b/app/Support/Preferences.php index a5652749f2..52b958816b 100644 --- a/app/Support/Preferences.php +++ b/app/Support/Preferences.php @@ -38,7 +38,7 @@ class Preferences * @param $name * @param null $default * - * @return Preference|null + * @return \FireflyIII\Models\Preference|null */ public function get($name, $default = null) { @@ -83,7 +83,7 @@ class Preferences /** * @return string */ - public function lastActivity() + public function lastActivity(): string { $preference = $this->get('lastActivity', microtime())->data; @@ -93,7 +93,7 @@ class Preferences /** * @return bool */ - public function mark() + public function mark(): bool { $this->set('lastActivity', microtime()); @@ -106,11 +106,15 @@ class Preferences * * @return Preference */ - public function set($name, $value) + public function set($name, $value): Preference { $user = Auth::user(); if (is_null($user)) { - return $value; + // make new preference, return it: + $pref = new Preference; + $pref->name = $name; + $pref->data = $value; + return $pref; } return $this->setForUser(Auth::user(), $name, $value); @@ -123,7 +127,7 @@ class Preferences * * @return Preference */ - public function setForUser(User $user, $name, $value) + public function setForUser(User $user, $name, $value): Preference { $fullName = 'preference' . $user->id . $name; Cache::forget($fullName); diff --git a/app/Support/Search/Search.php b/app/Support/Search/Search.php index 3a85e69577..deb68245dd 100644 --- a/app/Support/Search/Search.php +++ b/app/Support/Search/Search.php @@ -103,16 +103,16 @@ class Search implements SearchInterface public function searchTransactions(array $words): Collection { // decrypted transaction journals: - $decrypted = Auth::user()->transactionjournals()->expanded()->where('encrypted', 0)->where( + $decrypted = Auth::user()->transactionjournals()->expanded()->where('transaction_journals.encrypted', 0)->where( function (EloquentBuilder $q) use ($words) { foreach ($words as $word) { - $q->orWhere('description', 'LIKE', '%' . e($word) . '%'); + $q->orWhere('transaction_journals.description', 'LIKE', '%' . e($word) . '%'); } } )->get(TransactionJournal::QUERYFIELDS); // encrypted - $all = Auth::user()->transactionjournals()->expanded()->where('encrypted', 1)->get(TransactionJournal::QUERYFIELDS); + $all = Auth::user()->transactionjournals()->expanded()->where('transaction_journals.encrypted', 1)->get(TransactionJournal::QUERYFIELDS); $set = $all->filter( function (TransactionJournal $journal) use ($words) { foreach ($words as $word) { diff --git a/app/Support/Steam.php b/app/Support/Steam.php index b5c7c1db19..3e73432113 100644 --- a/app/Support/Steam.php +++ b/app/Support/Steam.php @@ -35,7 +35,7 @@ class Steam $cache->addProperty($date); $cache->addProperty($ignoreVirtualBalance); if ($cache->has()) { - return $cache->get(); // @codeCoverageIgnore + return $cache->get(); } $balance = strval( @@ -63,7 +63,7 @@ class Steam * * @return array */ - public function balanceInRange(Account $account, Carbon $start, Carbon $end) + public function balanceInRange(Account $account, Carbon $start, Carbon $end): array { // abuse chart properties: $cache = new CacheProperties; @@ -72,7 +72,7 @@ class Steam $cache->addProperty($start); $cache->addProperty($end); if ($cache->has()) { - return $cache->get(); // @codeCoverageIgnore + return $cache->get(); } $balances = []; @@ -110,7 +110,7 @@ class Steam * * @return array */ - public function balancesById(array $ids, Carbon $date) + public function balancesById(array $ids, Carbon $date): array { // abuse chart properties: @@ -119,7 +119,7 @@ class Steam $cache->addProperty('balances'); $cache->addProperty($date); if ($cache->has()) { - return $cache->get(); // @codeCoverageIgnore + return $cache->get(); } $balances = Transaction:: @@ -147,7 +147,7 @@ class Steam * * @return array */ - public function getLastActivities(array $accounts) + public function getLastActivities(array $accounts): array { $list = []; @@ -170,7 +170,7 @@ class Steam * * @return int */ - public function phpBytes($string) + public function phpBytes($string): int { $string = strtolower($string); diff --git a/app/Support/Twig/Budget.php b/app/Support/Twig/Budget.php index d3a1d0cd89..3363f356ac 100644 --- a/app/Support/Twig/Budget.php +++ b/app/Support/Twig/Budget.php @@ -10,7 +10,6 @@ use Twig_Extension; use Twig_SimpleFunction; /** - * @codeCoverageIgnore * Class Budget * * @package FireflyIII\Support\Twig @@ -29,7 +28,7 @@ class Budget extends Twig_Extension $cache->addProperty($repetition->id); $cache->addProperty('spentInRepetition'); if ($cache->has()) { - return $cache->get(); // @codeCoverageIgnore + return $cache->get(); } $sum = Auth::user()->transactionjournals() diff --git a/app/Support/Twig/General.php b/app/Support/Twig/General.php index 2a4b16e1d3..5373708ef6 100644 --- a/app/Support/Twig/General.php +++ b/app/Support/Twig/General.php @@ -14,7 +14,6 @@ use Twig_SimpleFilter; use Twig_SimpleFunction; /** - * @codeCoverageIgnore * * Class TwigSupport * diff --git a/app/Support/Twig/PiggyBank.php b/app/Support/Twig/PiggyBank.php index dd5d341ffa..4c101e21fb 100644 --- a/app/Support/Twig/PiggyBank.php +++ b/app/Support/Twig/PiggyBank.php @@ -8,7 +8,6 @@ use Twig_Extension; use Twig_SimpleFunction; /** - * @codeCoverageIgnore * * Class PiggyBank * @@ -20,7 +19,7 @@ class PiggyBank extends Twig_Extension /** * */ - public function getFunctions() + public function getFunctions(): array { $functions = []; @@ -38,7 +37,7 @@ class PiggyBank extends Twig_Extension * * @return string The extension name */ - public function getName() + public function getName(): string { return 'FireflyIII\Support\Twig\PiggyBank'; } diff --git a/app/Support/Twig/Rule.php b/app/Support/Twig/Rule.php index 8c83e2ca10..e91f16509e 100644 --- a/app/Support/Twig/Rule.php +++ b/app/Support/Twig/Rule.php @@ -18,7 +18,7 @@ class Rule extends Twig_Extension /** * @return Twig_SimpleFunction */ - public function allJournalTriggers() + public function allJournalTriggers(): Twig_SimpleFunction { return new Twig_SimpleFunction( 'allJournalTriggers', function () { @@ -33,7 +33,7 @@ class Rule extends Twig_Extension /** * @return Twig_SimpleFunction */ - public function allRuleTriggers() + public function allRuleTriggers(): Twig_SimpleFunction { return new Twig_SimpleFunction( 'allRuleTriggers', function () { @@ -56,7 +56,7 @@ class Rule extends Twig_Extension /** * @return Twig_SimpleFunction */ - public function allActionTriggers() + public function allActionTriggers(): Twig_SimpleFunction { return new Twig_SimpleFunction( 'allRuleActions', function () { @@ -76,7 +76,7 @@ class Rule extends Twig_Extension /** * @return array */ - public function getFunctions() + public function getFunctions(): array { return [ $this->allJournalTriggers(), @@ -91,7 +91,7 @@ class Rule extends Twig_Extension * * @return string The extension name */ - public function getName() + public function getName(): string { return 'FireflyIII\Support\Twig\Rule'; } diff --git a/app/Support/Twig/Translation.php b/app/Support/Twig/Translation.php index 028cc814a1..4af3055432 100644 --- a/app/Support/Twig/Translation.php +++ b/app/Support/Twig/Translation.php @@ -7,7 +7,6 @@ use Twig_Extension; use Twig_SimpleFilter; /** - * @codeCoverageIgnore * * Class Budget * @@ -19,7 +18,7 @@ class Translation extends Twig_Extension /** * @return array */ - public function getFilters() + public function getFilters(): array { $filters = []; @@ -37,7 +36,7 @@ class Translation extends Twig_Extension /** * {@inheritDoc} */ - public function getName() + public function getName(): string { return 'FireflyIII\Support\Twig\Translation'; } diff --git a/composer.json b/composer.json index 98a2dd3ee7..b1017007ed 100644 --- a/composer.json +++ b/composer.json @@ -57,6 +57,7 @@ "php artisan key:generate" ], "post-install-cmd": [ + "php artisan cache:clear", "php artisan clear-compiled", "php artisan optimize", "php artisan firefly:upgrade-instructions" @@ -65,6 +66,7 @@ "php artisan clear-compiled" ], "post-update-cmd": [ + "php artisan cache:clear", "php artisan optimize", "php artisan firefly:upgrade-instructions" ] diff --git a/composer.lock b/composer.lock index ca0d8be608..09584c13fc 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "c1638ed0abc18262bab1f791b48af111", + "hash": "eccf1460fa3a4cecc969593ffca9397e", "content-hash": "3551da50dc493828d3ae5d73c10984f0", "packages": [ { @@ -51,16 +51,16 @@ }, { "name": "christian-riesen/base32", - "version": "1.2.2", + "version": "1.3.0", "source": { "type": "git", "url": "https://github.com/ChristianRiesen/base32.git", - "reference": "fbe67d49d45dc789f942ef828c787550ebb894bc" + "reference": "fde061a370b0a97fdcd33d9d5f7b1b70ce1f79d4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ChristianRiesen/base32/zipball/fbe67d49d45dc789f942ef828c787550ebb894bc", - "reference": "fbe67d49d45dc789f942ef828c787550ebb894bc", + "url": "https://api.github.com/repos/ChristianRiesen/base32/zipball/fde061a370b0a97fdcd33d9d5f7b1b70ce1f79d4", + "reference": "fde061a370b0a97fdcd33d9d5f7b1b70ce1f79d4", "shasum": "" }, "require": { @@ -101,7 +101,7 @@ "encode", "rfc4648" ], - "time": "2015-09-27 23:45:02" + "time": "2016-04-07 07:45:31" }, { "name": "classpreloader/classpreloader", @@ -1245,16 +1245,16 @@ }, { "name": "monolog/monolog", - "version": "1.18.2", + "version": "1.19.0", "source": { "type": "git", "url": "https://github.com/Seldaek/monolog.git", - "reference": "064b38c16790249488e7a8b987acf1c9d7383c09" + "reference": "5f56ed5212dc509c8dc8caeba2715732abb32dbf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/064b38c16790249488e7a8b987acf1c9d7383c09", - "reference": "064b38c16790249488e7a8b987acf1c9d7383c09", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/5f56ed5212dc509c8dc8caeba2715732abb32dbf", + "reference": "5f56ed5212dc509c8dc8caeba2715732abb32dbf", "shasum": "" }, "require": { @@ -1319,7 +1319,7 @@ "logging", "psr-3" ], - "time": "2016-04-02 13:12:58" + "time": "2016-04-12 18:29:35" }, { "name": "mtdowling/cron-expression", @@ -2785,16 +2785,16 @@ }, { "name": "watson/validating", - "version": "2.1.1", + "version": "2.2.1", "source": { "type": "git", "url": "https://github.com/dwightwatson/validating.git", - "reference": "f86c284d599a66120c651b9cd41da60eb6124e96" + "reference": "64dc3d211372576d468e2bfaf3c7b7ace66ee970" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/dwightwatson/validating/zipball/f86c284d599a66120c651b9cd41da60eb6124e96", - "reference": "f86c284d599a66120c651b9cd41da60eb6124e96", + "url": "https://api.github.com/repos/dwightwatson/validating/zipball/64dc3d211372576d468e2bfaf3c7b7ace66ee970", + "reference": "64dc3d211372576d468e2bfaf3c7b7ace66ee970", "shasum": "" }, "require": { @@ -2836,7 +2836,7 @@ "laravel", "validation" ], - "time": "2016-03-29 13:54:50" + "time": "2016-04-07 14:59:06" } ], "packages-dev": null, diff --git a/config/app.php b/config/app.php index 7efa1d2687..8ba2732c0d 100644 --- a/config/app.php +++ b/config/app.php @@ -108,7 +108,8 @@ return [ | */ - 'log' => env('APP_LOG', 'daily'), + 'log' => env('APP_LOG', 'daily'), + 'log-level' => env('LOG_LEVEL', 'info'), /* |-------------------------------------------------------------------------- diff --git a/config/cache.php b/config/cache.php index 379135b0eb..2a9a8d9613 100644 --- a/config/cache.php +++ b/config/cache.php @@ -74,6 +74,6 @@ return [ | */ - 'prefix' => 'laravel', + 'prefix' => 'firefly', ]; diff --git a/config/firefly.php b/config/firefly.php index 45a42815f5..ec3bb71294 100644 --- a/config/firefly.php +++ b/config/firefly.php @@ -2,7 +2,7 @@ return [ 'chart' => 'chartjs', - 'version' => '3.8.2', + 'version' => '3.8.3', 'index_periods' => ['1D', '1W', '1M', '3M', '6M', '1Y', 'custom'], 'budget_periods' => ['daily', 'weekly', 'monthly', 'quarterly', 'half-year', 'yearly'], 'csv_import_enabled' => true, diff --git a/database/migrations/2016_04_08_181054_changes_for_v383.php b/database/migrations/2016_04_08_181054_changes_for_v383.php new file mode 100644 index 0000000000..d39dcf77fd --- /dev/null +++ b/database/migrations/2016_04_08_181054_changes_for_v383.php @@ -0,0 +1,36 @@ +string('hash', 64)->nullable(); + } + ); + } +} diff --git a/public/bootstrap/css/bootstrap.min.css b/public/bootstrap/css/bootstrap.min.css deleted file mode 100644 index d65c66b1ba..0000000000 --- a/public/bootstrap/css/bootstrap.min.css +++ /dev/null @@ -1,5 +0,0 @@ -/*! - * Bootstrap v3.3.5 (http://getbootstrap.com) - * Copyright 2011-2015 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - *//*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */html{font-family:sans-serif;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}dfn{font-style:italic}h1{margin:.67em 0;font-size:2em}mark{color:#000;background:#ff0}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{height:0;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{margin:0;font:inherit;color:inherit}button{overflow:visible}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{padding:0;border:0}input{line-height:normal}input[type=checkbox],input[type=radio]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;-webkit-appearance:textfield}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}fieldset{padding:.35em .625em .75em;margin:0 2px;border:1px solid silver}legend{padding:0;border:0}textarea{overflow:auto}optgroup{font-weight:700}table{border-spacing:0;border-collapse:collapse}td,th{padding:0}/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */@media print{*,:after,:before{color:#000!important;text-shadow:none!important;background:0 0!important;-webkit-box-shadow:none!important;box-shadow:none!important}a,a:visited{text-decoration:underline}a[href]:after{content:" (" attr(href) ")"}abbr[title]:after{content:" (" attr(title) ")"}a[href^="javascript:"]:after,a[href^="#"]:after{content:""}blockquote,pre{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}img,tr{page-break-inside:avoid}img{max-width:100%!important}h2,h3,p{orphans:3;widows:3}h2,h3{page-break-after:avoid}.navbar{display:none}.btn>.caret,.dropup>.btn>.caret{border-top-color:#000!important}.label{border:1px solid #000}.table{border-collapse:collapse!important}.table td,.table th{background-color:#fff!important}.table-bordered td,.table-bordered th{border:1px solid #ddd!important}}@font-face{font-family:'Glyphicons Halflings';src:url(../fonts/glyphicons-halflings-regular.eot);src:url(../fonts/glyphicons-halflings-regular.eot?#iefix) format('embedded-opentype'),url(../fonts/glyphicons-halflings-regular.woff2) format('woff2'),url(../fonts/glyphicons-halflings-regular.woff) format('woff'),url(../fonts/glyphicons-halflings-regular.ttf) format('truetype'),url(../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular) format('svg')}.glyphicon{position:relative;top:1px;display:inline-block;font-family:'Glyphicons Halflings';font-style:normal;font-weight:400;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.glyphicon-asterisk:before{content:"\2a"}.glyphicon-plus:before{content:"\2b"}.glyphicon-eur:before,.glyphicon-euro:before{content:"\20ac"}.glyphicon-minus:before{content:"\2212"}.glyphicon-cloud:before{content:"\2601"}.glyphicon-envelope:before{content:"\2709"}.glyphicon-pencil:before{content:"\270f"}.glyphicon-glass:before{content:"\e001"}.glyphicon-music:before{content:"\e002"}.glyphicon-search:before{content:"\e003"}.glyphicon-heart:before{content:"\e005"}.glyphicon-star:before{content:"\e006"}.glyphicon-star-empty:before{content:"\e007"}.glyphicon-user:before{content:"\e008"}.glyphicon-film:before{content:"\e009"}.glyphicon-th-large:before{content:"\e010"}.glyphicon-th:before{content:"\e011"}.glyphicon-th-list:before{content:"\e012"}.glyphicon-ok:before{content:"\e013"}.glyphicon-remove:before{content:"\e014"}.glyphicon-zoom-in:before{content:"\e015"}.glyphicon-zoom-out:before{content:"\e016"}.glyphicon-off:before{content:"\e017"}.glyphicon-signal:before{content:"\e018"}.glyphicon-cog:before{content:"\e019"}.glyphicon-trash:before{content:"\e020"}.glyphicon-home:before{content:"\e021"}.glyphicon-file:before{content:"\e022"}.glyphicon-time:before{content:"\e023"}.glyphicon-road:before{content:"\e024"}.glyphicon-download-alt:before{content:"\e025"}.glyphicon-download:before{content:"\e026"}.glyphicon-upload:before{content:"\e027"}.glyphicon-inbox:before{content:"\e028"}.glyphicon-play-circle:before{content:"\e029"}.glyphicon-repeat:before{content:"\e030"}.glyphicon-refresh:before{content:"\e031"}.glyphicon-list-alt:before{content:"\e032"}.glyphicon-lock:before{content:"\e033"}.glyphicon-flag:before{content:"\e034"}.glyphicon-headphones:before{content:"\e035"}.glyphicon-volume-off:before{content:"\e036"}.glyphicon-volume-down:before{content:"\e037"}.glyphicon-volume-up:before{content:"\e038"}.glyphicon-qrcode:before{content:"\e039"}.glyphicon-barcode:before{content:"\e040"}.glyphicon-tag:before{content:"\e041"}.glyphicon-tags:before{content:"\e042"}.glyphicon-book:before{content:"\e043"}.glyphicon-bookmark:before{content:"\e044"}.glyphicon-print:before{content:"\e045"}.glyphicon-camera:before{content:"\e046"}.glyphicon-font:before{content:"\e047"}.glyphicon-bold:before{content:"\e048"}.glyphicon-italic:before{content:"\e049"}.glyphicon-text-height:before{content:"\e050"}.glyphicon-text-width:before{content:"\e051"}.glyphicon-align-left:before{content:"\e052"}.glyphicon-align-center:before{content:"\e053"}.glyphicon-align-right:before{content:"\e054"}.glyphicon-align-justify:before{content:"\e055"}.glyphicon-list:before{content:"\e056"}.glyphicon-indent-left:before{content:"\e057"}.glyphicon-indent-right:before{content:"\e058"}.glyphicon-facetime-video:before{content:"\e059"}.glyphicon-picture:before{content:"\e060"}.glyphicon-map-marker:before{content:"\e062"}.glyphicon-adjust:before{content:"\e063"}.glyphicon-tint:before{content:"\e064"}.glyphicon-edit:before{content:"\e065"}.glyphicon-share:before{content:"\e066"}.glyphicon-check:before{content:"\e067"}.glyphicon-move:before{content:"\e068"}.glyphicon-step-backward:before{content:"\e069"}.glyphicon-fast-backward:before{content:"\e070"}.glyphicon-backward:before{content:"\e071"}.glyphicon-play:before{content:"\e072"}.glyphicon-pause:before{content:"\e073"}.glyphicon-stop:before{content:"\e074"}.glyphicon-forward:before{content:"\e075"}.glyphicon-fast-forward:before{content:"\e076"}.glyphicon-step-forward:before{content:"\e077"}.glyphicon-eject:before{content:"\e078"}.glyphicon-chevron-left:before{content:"\e079"}.glyphicon-chevron-right:before{content:"\e080"}.glyphicon-plus-sign:before{content:"\e081"}.glyphicon-minus-sign:before{content:"\e082"}.glyphicon-remove-sign:before{content:"\e083"}.glyphicon-ok-sign:before{content:"\e084"}.glyphicon-question-sign:before{content:"\e085"}.glyphicon-info-sign:before{content:"\e086"}.glyphicon-screenshot:before{content:"\e087"}.glyphicon-remove-circle:before{content:"\e088"}.glyphicon-ok-circle:before{content:"\e089"}.glyphicon-ban-circle:before{content:"\e090"}.glyphicon-arrow-left:before{content:"\e091"}.glyphicon-arrow-right:before{content:"\e092"}.glyphicon-arrow-up:before{content:"\e093"}.glyphicon-arrow-down:before{content:"\e094"}.glyphicon-share-alt:before{content:"\e095"}.glyphicon-resize-full:before{content:"\e096"}.glyphicon-resize-small:before{content:"\e097"}.glyphicon-exclamation-sign:before{content:"\e101"}.glyphicon-gift:before{content:"\e102"}.glyphicon-leaf:before{content:"\e103"}.glyphicon-fire:before{content:"\e104"}.glyphicon-eye-open:before{content:"\e105"}.glyphicon-eye-close:before{content:"\e106"}.glyphicon-warning-sign:before{content:"\e107"}.glyphicon-plane:before{content:"\e108"}.glyphicon-calendar:before{content:"\e109"}.glyphicon-random:before{content:"\e110"}.glyphicon-comment:before{content:"\e111"}.glyphicon-magnet:before{content:"\e112"}.glyphicon-chevron-up:before{content:"\e113"}.glyphicon-chevron-down:before{content:"\e114"}.glyphicon-retweet:before{content:"\e115"}.glyphicon-shopping-cart:before{content:"\e116"}.glyphicon-folder-close:before{content:"\e117"}.glyphicon-folder-open:before{content:"\e118"}.glyphicon-resize-vertical:before{content:"\e119"}.glyphicon-resize-horizontal:before{content:"\e120"}.glyphicon-hdd:before{content:"\e121"}.glyphicon-bullhorn:before{content:"\e122"}.glyphicon-bell:before{content:"\e123"}.glyphicon-certificate:before{content:"\e124"}.glyphicon-thumbs-up:before{content:"\e125"}.glyphicon-thumbs-down:before{content:"\e126"}.glyphicon-hand-right:before{content:"\e127"}.glyphicon-hand-left:before{content:"\e128"}.glyphicon-hand-up:before{content:"\e129"}.glyphicon-hand-down:before{content:"\e130"}.glyphicon-circle-arrow-right:before{content:"\e131"}.glyphicon-circle-arrow-left:before{content:"\e132"}.glyphicon-circle-arrow-up:before{content:"\e133"}.glyphicon-circle-arrow-down:before{content:"\e134"}.glyphicon-globe:before{content:"\e135"}.glyphicon-wrench:before{content:"\e136"}.glyphicon-tasks:before{content:"\e137"}.glyphicon-filter:before{content:"\e138"}.glyphicon-briefcase:before{content:"\e139"}.glyphicon-fullscreen:before{content:"\e140"}.glyphicon-dashboard:before{content:"\e141"}.glyphicon-paperclip:before{content:"\e142"}.glyphicon-heart-empty:before{content:"\e143"}.glyphicon-link:before{content:"\e144"}.glyphicon-phone:before{content:"\e145"}.glyphicon-pushpin:before{content:"\e146"}.glyphicon-usd:before{content:"\e148"}.glyphicon-gbp:before{content:"\e149"}.glyphicon-sort:before{content:"\e150"}.glyphicon-sort-by-alphabet:before{content:"\e151"}.glyphicon-sort-by-alphabet-alt:before{content:"\e152"}.glyphicon-sort-by-order:before{content:"\e153"}.glyphicon-sort-by-order-alt:before{content:"\e154"}.glyphicon-sort-by-attributes:before{content:"\e155"}.glyphicon-sort-by-attributes-alt:before{content:"\e156"}.glyphicon-unchecked:before{content:"\e157"}.glyphicon-expand:before{content:"\e158"}.glyphicon-collapse-down:before{content:"\e159"}.glyphicon-collapse-up:before{content:"\e160"}.glyphicon-log-in:before{content:"\e161"}.glyphicon-flash:before{content:"\e162"}.glyphicon-log-out:before{content:"\e163"}.glyphicon-new-window:before{content:"\e164"}.glyphicon-record:before{content:"\e165"}.glyphicon-save:before{content:"\e166"}.glyphicon-open:before{content:"\e167"}.glyphicon-saved:before{content:"\e168"}.glyphicon-import:before{content:"\e169"}.glyphicon-export:before{content:"\e170"}.glyphicon-send:before{content:"\e171"}.glyphicon-floppy-disk:before{content:"\e172"}.glyphicon-floppy-saved:before{content:"\e173"}.glyphicon-floppy-remove:before{content:"\e174"}.glyphicon-floppy-save:before{content:"\e175"}.glyphicon-floppy-open:before{content:"\e176"}.glyphicon-credit-card:before{content:"\e177"}.glyphicon-transfer:before{content:"\e178"}.glyphicon-cutlery:before{content:"\e179"}.glyphicon-header:before{content:"\e180"}.glyphicon-compressed:before{content:"\e181"}.glyphicon-earphone:before{content:"\e182"}.glyphicon-phone-alt:before{content:"\e183"}.glyphicon-tower:before{content:"\e184"}.glyphicon-stats:before{content:"\e185"}.glyphicon-sd-video:before{content:"\e186"}.glyphicon-hd-video:before{content:"\e187"}.glyphicon-subtitles:before{content:"\e188"}.glyphicon-sound-stereo:before{content:"\e189"}.glyphicon-sound-dolby:before{content:"\e190"}.glyphicon-sound-5-1:before{content:"\e191"}.glyphicon-sound-6-1:before{content:"\e192"}.glyphicon-sound-7-1:before{content:"\e193"}.glyphicon-copyright-mark:before{content:"\e194"}.glyphicon-registration-mark:before{content:"\e195"}.glyphicon-cloud-download:before{content:"\e197"}.glyphicon-cloud-upload:before{content:"\e198"}.glyphicon-tree-conifer:before{content:"\e199"}.glyphicon-tree-deciduous:before{content:"\e200"}.glyphicon-cd:before{content:"\e201"}.glyphicon-save-file:before{content:"\e202"}.glyphicon-open-file:before{content:"\e203"}.glyphicon-level-up:before{content:"\e204"}.glyphicon-copy:before{content:"\e205"}.glyphicon-paste:before{content:"\e206"}.glyphicon-alert:before{content:"\e209"}.glyphicon-equalizer:before{content:"\e210"}.glyphicon-king:before{content:"\e211"}.glyphicon-queen:before{content:"\e212"}.glyphicon-pawn:before{content:"\e213"}.glyphicon-bishop:before{content:"\e214"}.glyphicon-knight:before{content:"\e215"}.glyphicon-baby-formula:before{content:"\e216"}.glyphicon-tent:before{content:"\26fa"}.glyphicon-blackboard:before{content:"\e218"}.glyphicon-bed:before{content:"\e219"}.glyphicon-apple:before{content:"\f8ff"}.glyphicon-erase:before{content:"\e221"}.glyphicon-hourglass:before{content:"\231b"}.glyphicon-lamp:before{content:"\e223"}.glyphicon-duplicate:before{content:"\e224"}.glyphicon-piggy-bank:before{content:"\e225"}.glyphicon-scissors:before{content:"\e226"}.glyphicon-bitcoin:before{content:"\e227"}.glyphicon-btc:before{content:"\e227"}.glyphicon-xbt:before{content:"\e227"}.glyphicon-yen:before{content:"\00a5"}.glyphicon-jpy:before{content:"\00a5"}.glyphicon-ruble:before{content:"\20bd"}.glyphicon-rub:before{content:"\20bd"}.glyphicon-scale:before{content:"\e230"}.glyphicon-ice-lolly:before{content:"\e231"}.glyphicon-ice-lolly-tasted:before{content:"\e232"}.glyphicon-education:before{content:"\e233"}.glyphicon-option-horizontal:before{content:"\e234"}.glyphicon-option-vertical:before{content:"\e235"}.glyphicon-menu-hamburger:before{content:"\e236"}.glyphicon-modal-window:before{content:"\e237"}.glyphicon-oil:before{content:"\e238"}.glyphicon-grain:before{content:"\e239"}.glyphicon-sunglasses:before{content:"\e240"}.glyphicon-text-size:before{content:"\e241"}.glyphicon-text-color:before{content:"\e242"}.glyphicon-text-background:before{content:"\e243"}.glyphicon-object-align-top:before{content:"\e244"}.glyphicon-object-align-bottom:before{content:"\e245"}.glyphicon-object-align-horizontal:before{content:"\e246"}.glyphicon-object-align-left:before{content:"\e247"}.glyphicon-object-align-vertical:before{content:"\e248"}.glyphicon-object-align-right:before{content:"\e249"}.glyphicon-triangle-right:before{content:"\e250"}.glyphicon-triangle-left:before{content:"\e251"}.glyphicon-triangle-bottom:before{content:"\e252"}.glyphicon-triangle-top:before{content:"\e253"}.glyphicon-console:before{content:"\e254"}.glyphicon-superscript:before{content:"\e255"}.glyphicon-subscript:before{content:"\e256"}.glyphicon-menu-left:before{content:"\e257"}.glyphicon-menu-right:before{content:"\e258"}.glyphicon-menu-down:before{content:"\e259"}.glyphicon-menu-up:before{content:"\e260"}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}:after,:before{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html{font-size:10px;-webkit-tap-highlight-color:rgba(0,0,0,0)}body{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:1.42857143;color:#333;background-color:#fff}button,input,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit}a{color:#337ab7;text-decoration:none}a:focus,a:hover{color:#23527c;text-decoration:underline}a:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}figure{margin:0}img{vertical-align:middle}.carousel-inner>.item>a>img,.carousel-inner>.item>img,.img-responsive,.thumbnail a>img,.thumbnail>img{display:block;max-width:100%;height:auto}.img-rounded{border-radius:6px}.img-thumbnail{display:inline-block;max-width:100%;height:auto;padding:4px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.img-circle{border-radius:50%}hr{margin-top:20px;margin-bottom:20px;border:0;border-top:1px solid #eee}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}[role=button]{cursor:pointer}.h1,.h2,.h3,.h4,.h5,.h6,h1,h2,h3,h4,h5,h6{font-family:inherit;font-weight:500;line-height:1.1;color:inherit}.h1 .small,.h1 small,.h2 .small,.h2 small,.h3 .small,.h3 small,.h4 .small,.h4 small,.h5 .small,.h5 small,.h6 .small,.h6 small,h1 .small,h1 small,h2 .small,h2 small,h3 .small,h3 small,h4 .small,h4 small,h5 .small,h5 small,h6 .small,h6 small{font-weight:400;line-height:1;color:#777}.h1,.h2,.h3,h1,h2,h3{margin-top:20px;margin-bottom:10px}.h1 .small,.h1 small,.h2 .small,.h2 small,.h3 .small,.h3 small,h1 .small,h1 small,h2 .small,h2 small,h3 .small,h3 small{font-size:65%}.h4,.h5,.h6,h4,h5,h6{margin-top:10px;margin-bottom:10px}.h4 .small,.h4 small,.h5 .small,.h5 small,.h6 .small,.h6 small,h4 .small,h4 small,h5 .small,h5 small,h6 .small,h6 small{font-size:75%}.h1,h1{font-size:36px}.h2,h2{font-size:30px}.h3,h3{font-size:24px}.h4,h4{font-size:18px}.h5,h5{font-size:14px}.h6,h6{font-size:12px}p{margin:0 0 10px}.lead{margin-bottom:20px;font-size:16px;font-weight:300;line-height:1.4}@media (min-width:768px){.lead{font-size:21px}}.small,small{font-size:85%}.mark,mark{padding:.2em;background-color:#fcf8e3}.text-left{text-align:left}.text-right{text-align:right}.text-center{text-align:center}.text-justify{text-align:justify}.text-nowrap{white-space:nowrap}.text-lowercase{text-transform:lowercase}.text-uppercase{text-transform:uppercase}.text-capitalize{text-transform:capitalize}.text-muted{color:#777}.text-primary{color:#337ab7}a.text-primary:focus,a.text-primary:hover{color:#286090}.text-success{color:#3c763d}a.text-success:focus,a.text-success:hover{color:#2b542c}.text-info{color:#31708f}a.text-info:focus,a.text-info:hover{color:#245269}.text-warning{color:#8a6d3b}a.text-warning:focus,a.text-warning:hover{color:#66512c}.text-danger{color:#a94442}a.text-danger:focus,a.text-danger:hover{color:#843534}.bg-primary{color:#fff;background-color:#337ab7}a.bg-primary:focus,a.bg-primary:hover{background-color:#286090}.bg-success{background-color:#dff0d8}a.bg-success:focus,a.bg-success:hover{background-color:#c1e2b3}.bg-info{background-color:#d9edf7}a.bg-info:focus,a.bg-info:hover{background-color:#afd9ee}.bg-warning{background-color:#fcf8e3}a.bg-warning:focus,a.bg-warning:hover{background-color:#f7ecb5}.bg-danger{background-color:#f2dede}a.bg-danger:focus,a.bg-danger:hover{background-color:#e4b9b9}.page-header{padding-bottom:9px;margin:40px 0 20px;border-bottom:1px solid #eee}ol,ul{margin-top:0;margin-bottom:10px}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}.list-unstyled{padding-left:0;list-style:none}.list-inline{padding-left:0;margin-left:-5px;list-style:none}.list-inline>li{display:inline-block;padding-right:5px;padding-left:5px}dl{margin-top:0;margin-bottom:20px}dd,dt{line-height:1.42857143}dt{font-weight:700}dd{margin-left:0}@media (min-width:768px){.dl-horizontal dt{float:left;width:160px;overflow:hidden;clear:left;text-align:right;text-overflow:ellipsis;white-space:nowrap}.dl-horizontal dd{margin-left:180px}}abbr[data-original-title],abbr[title]{cursor:help;border-bottom:1px dotted #777}.initialism{font-size:90%;text-transform:uppercase}blockquote{padding:10px 20px;margin:0 0 20px;font-size:17.5px;border-left:5px solid #eee}blockquote ol:last-child,blockquote p:last-child,blockquote ul:last-child{margin-bottom:0}blockquote .small,blockquote footer,blockquote small{display:block;font-size:80%;line-height:1.42857143;color:#777}blockquote .small:before,blockquote footer:before,blockquote small:before{content:'\2014 \00A0'}.blockquote-reverse,blockquote.pull-right{padding-right:15px;padding-left:0;text-align:right;border-right:5px solid #eee;border-left:0}.blockquote-reverse .small:before,.blockquote-reverse footer:before,.blockquote-reverse small:before,blockquote.pull-right .small:before,blockquote.pull-right footer:before,blockquote.pull-right small:before{content:''}.blockquote-reverse .small:after,.blockquote-reverse footer:after,.blockquote-reverse small:after,blockquote.pull-right .small:after,blockquote.pull-right footer:after,blockquote.pull-right small:after{content:'\00A0 \2014'}address{margin-bottom:20px;font-style:normal;line-height:1.42857143}code,kbd,pre,samp{font-family:Menlo,Monaco,Consolas,"Courier New",monospace}code{padding:2px 4px;font-size:90%;color:#c7254e;background-color:#f9f2f4;border-radius:4px}kbd{padding:2px 4px;font-size:90%;color:#fff;background-color:#333;border-radius:3px;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.25);box-shadow:inset 0 -1px 0 rgba(0,0,0,.25)}kbd kbd{padding:0;font-size:100%;font-weight:700;-webkit-box-shadow:none;box-shadow:none}pre{display:block;padding:9.5px;margin:0 0 10px;font-size:13px;line-height:1.42857143;color:#333;word-break:break-all;word-wrap:break-word;background-color:#f5f5f5;border:1px solid #ccc;border-radius:4px}pre code{padding:0;font-size:inherit;color:inherit;white-space:pre-wrap;background-color:transparent;border-radius:0}.pre-scrollable{max-height:340px;overflow-y:scroll}.container{padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}@media (min-width:768px){.container{width:750px}}@media (min-width:992px){.container{width:970px}}@media (min-width:1200px){.container{width:1170px}}.container-fluid{padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}.row{margin-right:-15px;margin-left:-15px}.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9{position:relative;min-height:1px;padding-right:15px;padding-left:15px}.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9{float:left}.col-xs-12{width:100%}.col-xs-11{width:91.66666667%}.col-xs-10{width:83.33333333%}.col-xs-9{width:75%}.col-xs-8{width:66.66666667%}.col-xs-7{width:58.33333333%}.col-xs-6{width:50%}.col-xs-5{width:41.66666667%}.col-xs-4{width:33.33333333%}.col-xs-3{width:25%}.col-xs-2{width:16.66666667%}.col-xs-1{width:8.33333333%}.col-xs-pull-12{right:100%}.col-xs-pull-11{right:91.66666667%}.col-xs-pull-10{right:83.33333333%}.col-xs-pull-9{right:75%}.col-xs-pull-8{right:66.66666667%}.col-xs-pull-7{right:58.33333333%}.col-xs-pull-6{right:50%}.col-xs-pull-5{right:41.66666667%}.col-xs-pull-4{right:33.33333333%}.col-xs-pull-3{right:25%}.col-xs-pull-2{right:16.66666667%}.col-xs-pull-1{right:8.33333333%}.col-xs-pull-0{right:auto}.col-xs-push-12{left:100%}.col-xs-push-11{left:91.66666667%}.col-xs-push-10{left:83.33333333%}.col-xs-push-9{left:75%}.col-xs-push-8{left:66.66666667%}.col-xs-push-7{left:58.33333333%}.col-xs-push-6{left:50%}.col-xs-push-5{left:41.66666667%}.col-xs-push-4{left:33.33333333%}.col-xs-push-3{left:25%}.col-xs-push-2{left:16.66666667%}.col-xs-push-1{left:8.33333333%}.col-xs-push-0{left:auto}.col-xs-offset-12{margin-left:100%}.col-xs-offset-11{margin-left:91.66666667%}.col-xs-offset-10{margin-left:83.33333333%}.col-xs-offset-9{margin-left:75%}.col-xs-offset-8{margin-left:66.66666667%}.col-xs-offset-7{margin-left:58.33333333%}.col-xs-offset-6{margin-left:50%}.col-xs-offset-5{margin-left:41.66666667%}.col-xs-offset-4{margin-left:33.33333333%}.col-xs-offset-3{margin-left:25%}.col-xs-offset-2{margin-left:16.66666667%}.col-xs-offset-1{margin-left:8.33333333%}.col-xs-offset-0{margin-left:0}@media (min-width:768px){.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9{float:left}.col-sm-12{width:100%}.col-sm-11{width:91.66666667%}.col-sm-10{width:83.33333333%}.col-sm-9{width:75%}.col-sm-8{width:66.66666667%}.col-sm-7{width:58.33333333%}.col-sm-6{width:50%}.col-sm-5{width:41.66666667%}.col-sm-4{width:33.33333333%}.col-sm-3{width:25%}.col-sm-2{width:16.66666667%}.col-sm-1{width:8.33333333%}.col-sm-pull-12{right:100%}.col-sm-pull-11{right:91.66666667%}.col-sm-pull-10{right:83.33333333%}.col-sm-pull-9{right:75%}.col-sm-pull-8{right:66.66666667%}.col-sm-pull-7{right:58.33333333%}.col-sm-pull-6{right:50%}.col-sm-pull-5{right:41.66666667%}.col-sm-pull-4{right:33.33333333%}.col-sm-pull-3{right:25%}.col-sm-pull-2{right:16.66666667%}.col-sm-pull-1{right:8.33333333%}.col-sm-pull-0{right:auto}.col-sm-push-12{left:100%}.col-sm-push-11{left:91.66666667%}.col-sm-push-10{left:83.33333333%}.col-sm-push-9{left:75%}.col-sm-push-8{left:66.66666667%}.col-sm-push-7{left:58.33333333%}.col-sm-push-6{left:50%}.col-sm-push-5{left:41.66666667%}.col-sm-push-4{left:33.33333333%}.col-sm-push-3{left:25%}.col-sm-push-2{left:16.66666667%}.col-sm-push-1{left:8.33333333%}.col-sm-push-0{left:auto}.col-sm-offset-12{margin-left:100%}.col-sm-offset-11{margin-left:91.66666667%}.col-sm-offset-10{margin-left:83.33333333%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-8{margin-left:66.66666667%}.col-sm-offset-7{margin-left:58.33333333%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-5{margin-left:41.66666667%}.col-sm-offset-4{margin-left:33.33333333%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-2{margin-left:16.66666667%}.col-sm-offset-1{margin-left:8.33333333%}.col-sm-offset-0{margin-left:0}}@media (min-width:992px){.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9{float:left}.col-md-12{width:100%}.col-md-11{width:91.66666667%}.col-md-10{width:83.33333333%}.col-md-9{width:75%}.col-md-8{width:66.66666667%}.col-md-7{width:58.33333333%}.col-md-6{width:50%}.col-md-5{width:41.66666667%}.col-md-4{width:33.33333333%}.col-md-3{width:25%}.col-md-2{width:16.66666667%}.col-md-1{width:8.33333333%}.col-md-pull-12{right:100%}.col-md-pull-11{right:91.66666667%}.col-md-pull-10{right:83.33333333%}.col-md-pull-9{right:75%}.col-md-pull-8{right:66.66666667%}.col-md-pull-7{right:58.33333333%}.col-md-pull-6{right:50%}.col-md-pull-5{right:41.66666667%}.col-md-pull-4{right:33.33333333%}.col-md-pull-3{right:25%}.col-md-pull-2{right:16.66666667%}.col-md-pull-1{right:8.33333333%}.col-md-pull-0{right:auto}.col-md-push-12{left:100%}.col-md-push-11{left:91.66666667%}.col-md-push-10{left:83.33333333%}.col-md-push-9{left:75%}.col-md-push-8{left:66.66666667%}.col-md-push-7{left:58.33333333%}.col-md-push-6{left:50%}.col-md-push-5{left:41.66666667%}.col-md-push-4{left:33.33333333%}.col-md-push-3{left:25%}.col-md-push-2{left:16.66666667%}.col-md-push-1{left:8.33333333%}.col-md-push-0{left:auto}.col-md-offset-12{margin-left:100%}.col-md-offset-11{margin-left:91.66666667%}.col-md-offset-10{margin-left:83.33333333%}.col-md-offset-9{margin-left:75%}.col-md-offset-8{margin-left:66.66666667%}.col-md-offset-7{margin-left:58.33333333%}.col-md-offset-6{margin-left:50%}.col-md-offset-5{margin-left:41.66666667%}.col-md-offset-4{margin-left:33.33333333%}.col-md-offset-3{margin-left:25%}.col-md-offset-2{margin-left:16.66666667%}.col-md-offset-1{margin-left:8.33333333%}.col-md-offset-0{margin-left:0}}@media (min-width:1200px){.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9{float:left}.col-lg-12{width:100%}.col-lg-11{width:91.66666667%}.col-lg-10{width:83.33333333%}.col-lg-9{width:75%}.col-lg-8{width:66.66666667%}.col-lg-7{width:58.33333333%}.col-lg-6{width:50%}.col-lg-5{width:41.66666667%}.col-lg-4{width:33.33333333%}.col-lg-3{width:25%}.col-lg-2{width:16.66666667%}.col-lg-1{width:8.33333333%}.col-lg-pull-12{right:100%}.col-lg-pull-11{right:91.66666667%}.col-lg-pull-10{right:83.33333333%}.col-lg-pull-9{right:75%}.col-lg-pull-8{right:66.66666667%}.col-lg-pull-7{right:58.33333333%}.col-lg-pull-6{right:50%}.col-lg-pull-5{right:41.66666667%}.col-lg-pull-4{right:33.33333333%}.col-lg-pull-3{right:25%}.col-lg-pull-2{right:16.66666667%}.col-lg-pull-1{right:8.33333333%}.col-lg-pull-0{right:auto}.col-lg-push-12{left:100%}.col-lg-push-11{left:91.66666667%}.col-lg-push-10{left:83.33333333%}.col-lg-push-9{left:75%}.col-lg-push-8{left:66.66666667%}.col-lg-push-7{left:58.33333333%}.col-lg-push-6{left:50%}.col-lg-push-5{left:41.66666667%}.col-lg-push-4{left:33.33333333%}.col-lg-push-3{left:25%}.col-lg-push-2{left:16.66666667%}.col-lg-push-1{left:8.33333333%}.col-lg-push-0{left:auto}.col-lg-offset-12{margin-left:100%}.col-lg-offset-11{margin-left:91.66666667%}.col-lg-offset-10{margin-left:83.33333333%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-8{margin-left:66.66666667%}.col-lg-offset-7{margin-left:58.33333333%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-5{margin-left:41.66666667%}.col-lg-offset-4{margin-left:33.33333333%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-2{margin-left:16.66666667%}.col-lg-offset-1{margin-left:8.33333333%}.col-lg-offset-0{margin-left:0}}table{background-color:transparent}caption{padding-top:8px;padding-bottom:8px;color:#777;text-align:left}th{text-align:left}.table{width:100%;max-width:100%;margin-bottom:20px}.table>tbody>tr>td,.table>tbody>tr>th,.table>tfoot>tr>td,.table>tfoot>tr>th,.table>thead>tr>td,.table>thead>tr>th{padding:8px;line-height:1.42857143;vertical-align:top;border-top:1px solid #ddd}.table>thead>tr>th{vertical-align:bottom;border-bottom:2px solid #ddd}.table>caption+thead>tr:first-child>td,.table>caption+thead>tr:first-child>th,.table>colgroup+thead>tr:first-child>td,.table>colgroup+thead>tr:first-child>th,.table>thead:first-child>tr:first-child>td,.table>thead:first-child>tr:first-child>th{border-top:0}.table>tbody+tbody{border-top:2px solid #ddd}.table .table{background-color:#fff}.table-condensed>tbody>tr>td,.table-condensed>tbody>tr>th,.table-condensed>tfoot>tr>td,.table-condensed>tfoot>tr>th,.table-condensed>thead>tr>td,.table-condensed>thead>tr>th{padding:5px}.table-bordered{border:1px solid #ddd}.table-bordered>tbody>tr>td,.table-bordered>tbody>tr>th,.table-bordered>tfoot>tr>td,.table-bordered>tfoot>tr>th,.table-bordered>thead>tr>td,.table-bordered>thead>tr>th{border:1px solid #ddd}.table-bordered>thead>tr>td,.table-bordered>thead>tr>th{border-bottom-width:2px}.table-striped>tbody>tr:nth-of-type(odd){background-color:#f9f9f9}.table-hover>tbody>tr:hover{background-color:#f5f5f5}table col[class*=col-]{position:static;display:table-column;float:none}table td[class*=col-],table th[class*=col-]{position:static;display:table-cell;float:none}.table>tbody>tr.active>td,.table>tbody>tr.active>th,.table>tbody>tr>td.active,.table>tbody>tr>th.active,.table>tfoot>tr.active>td,.table>tfoot>tr.active>th,.table>tfoot>tr>td.active,.table>tfoot>tr>th.active,.table>thead>tr.active>td,.table>thead>tr.active>th,.table>thead>tr>td.active,.table>thead>tr>th.active{background-color:#f5f5f5}.table-hover>tbody>tr.active:hover>td,.table-hover>tbody>tr.active:hover>th,.table-hover>tbody>tr:hover>.active,.table-hover>tbody>tr>td.active:hover,.table-hover>tbody>tr>th.active:hover{background-color:#e8e8e8}.table>tbody>tr.success>td,.table>tbody>tr.success>th,.table>tbody>tr>td.success,.table>tbody>tr>th.success,.table>tfoot>tr.success>td,.table>tfoot>tr.success>th,.table>tfoot>tr>td.success,.table>tfoot>tr>th.success,.table>thead>tr.success>td,.table>thead>tr.success>th,.table>thead>tr>td.success,.table>thead>tr>th.success{background-color:#dff0d8}.table-hover>tbody>tr.success:hover>td,.table-hover>tbody>tr.success:hover>th,.table-hover>tbody>tr:hover>.success,.table-hover>tbody>tr>td.success:hover,.table-hover>tbody>tr>th.success:hover{background-color:#d0e9c6}.table>tbody>tr.info>td,.table>tbody>tr.info>th,.table>tbody>tr>td.info,.table>tbody>tr>th.info,.table>tfoot>tr.info>td,.table>tfoot>tr.info>th,.table>tfoot>tr>td.info,.table>tfoot>tr>th.info,.table>thead>tr.info>td,.table>thead>tr.info>th,.table>thead>tr>td.info,.table>thead>tr>th.info{background-color:#d9edf7}.table-hover>tbody>tr.info:hover>td,.table-hover>tbody>tr.info:hover>th,.table-hover>tbody>tr:hover>.info,.table-hover>tbody>tr>td.info:hover,.table-hover>tbody>tr>th.info:hover{background-color:#c4e3f3}.table>tbody>tr.warning>td,.table>tbody>tr.warning>th,.table>tbody>tr>td.warning,.table>tbody>tr>th.warning,.table>tfoot>tr.warning>td,.table>tfoot>tr.warning>th,.table>tfoot>tr>td.warning,.table>tfoot>tr>th.warning,.table>thead>tr.warning>td,.table>thead>tr.warning>th,.table>thead>tr>td.warning,.table>thead>tr>th.warning{background-color:#fcf8e3}.table-hover>tbody>tr.warning:hover>td,.table-hover>tbody>tr.warning:hover>th,.table-hover>tbody>tr:hover>.warning,.table-hover>tbody>tr>td.warning:hover,.table-hover>tbody>tr>th.warning:hover{background-color:#faf2cc}.table>tbody>tr.danger>td,.table>tbody>tr.danger>th,.table>tbody>tr>td.danger,.table>tbody>tr>th.danger,.table>tfoot>tr.danger>td,.table>tfoot>tr.danger>th,.table>tfoot>tr>td.danger,.table>tfoot>tr>th.danger,.table>thead>tr.danger>td,.table>thead>tr.danger>th,.table>thead>tr>td.danger,.table>thead>tr>th.danger{background-color:#f2dede}.table-hover>tbody>tr.danger:hover>td,.table-hover>tbody>tr.danger:hover>th,.table-hover>tbody>tr:hover>.danger,.table-hover>tbody>tr>td.danger:hover,.table-hover>tbody>tr>th.danger:hover{background-color:#ebcccc}.table-responsive{min-height:.01%;overflow-x:auto}@media screen and (max-width:767px){.table-responsive{width:100%;margin-bottom:15px;overflow-y:hidden;-ms-overflow-style:-ms-autohiding-scrollbar;border:1px solid #ddd}.table-responsive>.table{margin-bottom:0}.table-responsive>.table>tbody>tr>td,.table-responsive>.table>tbody>tr>th,.table-responsive>.table>tfoot>tr>td,.table-responsive>.table>tfoot>tr>th,.table-responsive>.table>thead>tr>td,.table-responsive>.table>thead>tr>th{white-space:nowrap}.table-responsive>.table-bordered{border:0}.table-responsive>.table-bordered>tbody>tr>td:first-child,.table-responsive>.table-bordered>tbody>tr>th:first-child,.table-responsive>.table-bordered>tfoot>tr>td:first-child,.table-responsive>.table-bordered>tfoot>tr>th:first-child,.table-responsive>.table-bordered>thead>tr>td:first-child,.table-responsive>.table-bordered>thead>tr>th:first-child{border-left:0}.table-responsive>.table-bordered>tbody>tr>td:last-child,.table-responsive>.table-bordered>tbody>tr>th:last-child,.table-responsive>.table-bordered>tfoot>tr>td:last-child,.table-responsive>.table-bordered>tfoot>tr>th:last-child,.table-responsive>.table-bordered>thead>tr>td:last-child,.table-responsive>.table-bordered>thead>tr>th:last-child{border-right:0}.table-responsive>.table-bordered>tbody>tr:last-child>td,.table-responsive>.table-bordered>tbody>tr:last-child>th,.table-responsive>.table-bordered>tfoot>tr:last-child>td,.table-responsive>.table-bordered>tfoot>tr:last-child>th{border-bottom:0}}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;padding:0;margin-bottom:20px;font-size:21px;line-height:inherit;color:#333;border:0;border-bottom:1px solid #e5e5e5}label{display:inline-block;max-width:100%;margin-bottom:5px;font-weight:700}input[type=search]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}input[type=checkbox],input[type=radio]{margin:4px 0 0;margin-top:1px\9;line-height:normal}input[type=file]{display:block}input[type=range]{display:block;width:100%}select[multiple],select[size]{height:auto}input[type=file]:focus,input[type=checkbox]:focus,input[type=radio]:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}output{display:block;padding-top:7px;font-size:14px;line-height:1.42857143;color:#555}.form-control{display:block;width:100%;height:34px;padding:6px 12px;font-size:14px;line-height:1.42857143;color:#555;background-color:#fff;background-image:none;border:1px solid #ccc;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075);-webkit-transition:border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;-o-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s}.form-control:focus{border-color:#66afe9;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6)}.form-control::-moz-placeholder{color:#999;opacity:1}.form-control:-ms-input-placeholder{color:#999}.form-control::-webkit-input-placeholder{color:#999}.form-control[disabled],.form-control[readonly],fieldset[disabled] .form-control{background-color:#eee;opacity:1}.form-control[disabled],fieldset[disabled] .form-control{cursor:not-allowed}textarea.form-control{height:auto}input[type=search]{-webkit-appearance:none}@media screen and (-webkit-min-device-pixel-ratio:0){input[type=date].form-control,input[type=time].form-control,input[type=datetime-local].form-control,input[type=month].form-control{line-height:34px}.input-group-sm input[type=date],.input-group-sm input[type=time],.input-group-sm input[type=datetime-local],.input-group-sm input[type=month],input[type=date].input-sm,input[type=time].input-sm,input[type=datetime-local].input-sm,input[type=month].input-sm{line-height:30px}.input-group-lg input[type=date],.input-group-lg input[type=time],.input-group-lg input[type=datetime-local],.input-group-lg input[type=month],input[type=date].input-lg,input[type=time].input-lg,input[type=datetime-local].input-lg,input[type=month].input-lg{line-height:46px}}.form-group{margin-bottom:15px}.checkbox,.radio{position:relative;display:block;margin-top:10px;margin-bottom:10px}.checkbox label,.radio label{min-height:20px;padding-left:20px;margin-bottom:0;font-weight:400;cursor:pointer}.checkbox input[type=checkbox],.checkbox-inline input[type=checkbox],.radio input[type=radio],.radio-inline input[type=radio]{position:absolute;margin-top:4px\9;margin-left:-20px}.checkbox+.checkbox,.radio+.radio{margin-top:-5px}.checkbox-inline,.radio-inline{position:relative;display:inline-block;padding-left:20px;margin-bottom:0;font-weight:400;vertical-align:middle;cursor:pointer}.checkbox-inline+.checkbox-inline,.radio-inline+.radio-inline{margin-top:0;margin-left:10px}fieldset[disabled] input[type=checkbox],fieldset[disabled] input[type=radio],input[type=checkbox].disabled,input[type=checkbox][disabled],input[type=radio].disabled,input[type=radio][disabled]{cursor:not-allowed}.checkbox-inline.disabled,.radio-inline.disabled,fieldset[disabled] .checkbox-inline,fieldset[disabled] .radio-inline{cursor:not-allowed}.checkbox.disabled label,.radio.disabled label,fieldset[disabled] .checkbox label,fieldset[disabled] .radio label{cursor:not-allowed}.form-control-static{min-height:34px;padding-top:7px;padding-bottom:7px;margin-bottom:0}.form-control-static.input-lg,.form-control-static.input-sm{padding-right:0;padding-left:0}.input-sm{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-sm{height:30px;line-height:30px}select[multiple].input-sm,textarea.input-sm{height:auto}.form-group-sm .form-control{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.form-group-sm select.form-control{height:30px;line-height:30px}.form-group-sm select[multiple].form-control,.form-group-sm textarea.form-control{height:auto}.form-group-sm .form-control-static{height:30px;min-height:32px;padding:6px 10px;font-size:12px;line-height:1.5}.input-lg{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}select.input-lg{height:46px;line-height:46px}select[multiple].input-lg,textarea.input-lg{height:auto}.form-group-lg .form-control{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}.form-group-lg select.form-control{height:46px;line-height:46px}.form-group-lg select[multiple].form-control,.form-group-lg textarea.form-control{height:auto}.form-group-lg .form-control-static{height:46px;min-height:38px;padding:11px 16px;font-size:18px;line-height:1.3333333}.has-feedback{position:relative}.has-feedback .form-control{padding-right:42.5px}.form-control-feedback{position:absolute;top:0;right:0;z-index:2;display:block;width:34px;height:34px;line-height:34px;text-align:center;pointer-events:none}.form-group-lg .form-control+.form-control-feedback,.input-group-lg+.form-control-feedback,.input-lg+.form-control-feedback{width:46px;height:46px;line-height:46px}.form-group-sm .form-control+.form-control-feedback,.input-group-sm+.form-control-feedback,.input-sm+.form-control-feedback{width:30px;height:30px;line-height:30px}.has-success .checkbox,.has-success .checkbox-inline,.has-success .control-label,.has-success .help-block,.has-success .radio,.has-success .radio-inline,.has-success.checkbox label,.has-success.checkbox-inline label,.has-success.radio label,.has-success.radio-inline label{color:#3c763d}.has-success .form-control{border-color:#3c763d;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-success .form-control:focus{border-color:#2b542c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168}.has-success .input-group-addon{color:#3c763d;background-color:#dff0d8;border-color:#3c763d}.has-success .form-control-feedback{color:#3c763d}.has-warning .checkbox,.has-warning .checkbox-inline,.has-warning .control-label,.has-warning .help-block,.has-warning .radio,.has-warning .radio-inline,.has-warning.checkbox label,.has-warning.checkbox-inline label,.has-warning.radio label,.has-warning.radio-inline label{color:#8a6d3b}.has-warning .form-control{border-color:#8a6d3b;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-warning .form-control:focus{border-color:#66512c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b}.has-warning .input-group-addon{color:#8a6d3b;background-color:#fcf8e3;border-color:#8a6d3b}.has-warning .form-control-feedback{color:#8a6d3b}.has-error .checkbox,.has-error .checkbox-inline,.has-error .control-label,.has-error .help-block,.has-error .radio,.has-error .radio-inline,.has-error.checkbox label,.has-error.checkbox-inline label,.has-error.radio label,.has-error.radio-inline label{color:#a94442}.has-error .form-control{border-color:#a94442;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-error .form-control:focus{border-color:#843534;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483}.has-error .input-group-addon{color:#a94442;background-color:#f2dede;border-color:#a94442}.has-error .form-control-feedback{color:#a94442}.has-feedback label~.form-control-feedback{top:25px}.has-feedback label.sr-only~.form-control-feedback{top:0}.help-block{display:block;margin-top:5px;margin-bottom:10px;color:#737373}@media (min-width:768px){.form-inline .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.form-inline .form-control{display:inline-block;width:auto;vertical-align:middle}.form-inline .form-control-static{display:inline-block}.form-inline .input-group{display:inline-table;vertical-align:middle}.form-inline .input-group .form-control,.form-inline .input-group .input-group-addon,.form-inline .input-group .input-group-btn{width:auto}.form-inline .input-group>.form-control{width:100%}.form-inline .control-label{margin-bottom:0;vertical-align:middle}.form-inline .checkbox,.form-inline .radio{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.form-inline .checkbox label,.form-inline .radio label{padding-left:0}.form-inline .checkbox input[type=checkbox],.form-inline .radio input[type=radio]{position:relative;margin-left:0}.form-inline .has-feedback .form-control-feedback{top:0}}.form-horizontal .checkbox,.form-horizontal .checkbox-inline,.form-horizontal .radio,.form-horizontal .radio-inline{padding-top:7px;margin-top:0;margin-bottom:0}.form-horizontal .checkbox,.form-horizontal .radio{min-height:27px}.form-horizontal .form-group{margin-right:-15px;margin-left:-15px}@media (min-width:768px){.form-horizontal .control-label{padding-top:7px;margin-bottom:0;text-align:right}}.form-horizontal .has-feedback .form-control-feedback{right:15px}@media (min-width:768px){.form-horizontal .form-group-lg .control-label{padding-top:14.33px;font-size:18px}}@media (min-width:768px){.form-horizontal .form-group-sm .control-label{padding-top:6px;font-size:12px}}.btn{display:inline-block;padding:6px 12px;margin-bottom:0;font-size:14px;font-weight:400;line-height:1.42857143;text-align:center;white-space:nowrap;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-image:none;border:1px solid transparent;border-radius:4px}.btn.active.focus,.btn.active:focus,.btn.focus,.btn:active.focus,.btn:active:focus,.btn:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.btn.focus,.btn:focus,.btn:hover{color:#333;text-decoration:none}.btn.active,.btn:active{background-image:none;outline:0;-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn.disabled,.btn[disabled],fieldset[disabled] .btn{cursor:not-allowed;filter:alpha(opacity=65);-webkit-box-shadow:none;box-shadow:none;opacity:.65}a.btn.disabled,fieldset[disabled] a.btn{pointer-events:none}.btn-default{color:#333;background-color:#fff;border-color:#ccc}.btn-default.focus,.btn-default:focus{color:#333;background-color:#e6e6e6;border-color:#8c8c8c}.btn-default:hover{color:#333;background-color:#e6e6e6;border-color:#adadad}.btn-default.active,.btn-default:active,.open>.dropdown-toggle.btn-default{color:#333;background-color:#e6e6e6;border-color:#adadad}.btn-default.active.focus,.btn-default.active:focus,.btn-default.active:hover,.btn-default:active.focus,.btn-default:active:focus,.btn-default:active:hover,.open>.dropdown-toggle.btn-default.focus,.open>.dropdown-toggle.btn-default:focus,.open>.dropdown-toggle.btn-default:hover{color:#333;background-color:#d4d4d4;border-color:#8c8c8c}.btn-default.active,.btn-default:active,.open>.dropdown-toggle.btn-default{background-image:none}.btn-default.disabled,.btn-default.disabled.active,.btn-default.disabled.focus,.btn-default.disabled:active,.btn-default.disabled:focus,.btn-default.disabled:hover,.btn-default[disabled],.btn-default[disabled].active,.btn-default[disabled].focus,.btn-default[disabled]:active,.btn-default[disabled]:focus,.btn-default[disabled]:hover,fieldset[disabled] .btn-default,fieldset[disabled] .btn-default.active,fieldset[disabled] .btn-default.focus,fieldset[disabled] .btn-default:active,fieldset[disabled] .btn-default:focus,fieldset[disabled] .btn-default:hover{background-color:#fff;border-color:#ccc}.btn-default .badge{color:#fff;background-color:#333}.btn-primary{color:#fff;background-color:#337ab7;border-color:#2e6da4}.btn-primary.focus,.btn-primary:focus{color:#fff;background-color:#286090;border-color:#122b40}.btn-primary:hover{color:#fff;background-color:#286090;border-color:#204d74}.btn-primary.active,.btn-primary:active,.open>.dropdown-toggle.btn-primary{color:#fff;background-color:#286090;border-color:#204d74}.btn-primary.active.focus,.btn-primary.active:focus,.btn-primary.active:hover,.btn-primary:active.focus,.btn-primary:active:focus,.btn-primary:active:hover,.open>.dropdown-toggle.btn-primary.focus,.open>.dropdown-toggle.btn-primary:focus,.open>.dropdown-toggle.btn-primary:hover{color:#fff;background-color:#204d74;border-color:#122b40}.btn-primary.active,.btn-primary:active,.open>.dropdown-toggle.btn-primary{background-image:none}.btn-primary.disabled,.btn-primary.disabled.active,.btn-primary.disabled.focus,.btn-primary.disabled:active,.btn-primary.disabled:focus,.btn-primary.disabled:hover,.btn-primary[disabled],.btn-primary[disabled].active,.btn-primary[disabled].focus,.btn-primary[disabled]:active,.btn-primary[disabled]:focus,.btn-primary[disabled]:hover,fieldset[disabled] .btn-primary,fieldset[disabled] .btn-primary.active,fieldset[disabled] .btn-primary.focus,fieldset[disabled] .btn-primary:active,fieldset[disabled] .btn-primary:focus,fieldset[disabled] .btn-primary:hover{background-color:#337ab7;border-color:#2e6da4}.btn-primary .badge{color:#337ab7;background-color:#fff}.btn-success{color:#fff;background-color:#5cb85c;border-color:#4cae4c}.btn-success.focus,.btn-success:focus{color:#fff;background-color:#449d44;border-color:#255625}.btn-success:hover{color:#fff;background-color:#449d44;border-color:#398439}.btn-success.active,.btn-success:active,.open>.dropdown-toggle.btn-success{color:#fff;background-color:#449d44;border-color:#398439}.btn-success.active.focus,.btn-success.active:focus,.btn-success.active:hover,.btn-success:active.focus,.btn-success:active:focus,.btn-success:active:hover,.open>.dropdown-toggle.btn-success.focus,.open>.dropdown-toggle.btn-success:focus,.open>.dropdown-toggle.btn-success:hover{color:#fff;background-color:#398439;border-color:#255625}.btn-success.active,.btn-success:active,.open>.dropdown-toggle.btn-success{background-image:none}.btn-success.disabled,.btn-success.disabled.active,.btn-success.disabled.focus,.btn-success.disabled:active,.btn-success.disabled:focus,.btn-success.disabled:hover,.btn-success[disabled],.btn-success[disabled].active,.btn-success[disabled].focus,.btn-success[disabled]:active,.btn-success[disabled]:focus,.btn-success[disabled]:hover,fieldset[disabled] .btn-success,fieldset[disabled] .btn-success.active,fieldset[disabled] .btn-success.focus,fieldset[disabled] .btn-success:active,fieldset[disabled] .btn-success:focus,fieldset[disabled] .btn-success:hover{background-color:#5cb85c;border-color:#4cae4c}.btn-success .badge{color:#5cb85c;background-color:#fff}.btn-info{color:#fff;background-color:#5bc0de;border-color:#46b8da}.btn-info.focus,.btn-info:focus{color:#fff;background-color:#31b0d5;border-color:#1b6d85}.btn-info:hover{color:#fff;background-color:#31b0d5;border-color:#269abc}.btn-info.active,.btn-info:active,.open>.dropdown-toggle.btn-info{color:#fff;background-color:#31b0d5;border-color:#269abc}.btn-info.active.focus,.btn-info.active:focus,.btn-info.active:hover,.btn-info:active.focus,.btn-info:active:focus,.btn-info:active:hover,.open>.dropdown-toggle.btn-info.focus,.open>.dropdown-toggle.btn-info:focus,.open>.dropdown-toggle.btn-info:hover{color:#fff;background-color:#269abc;border-color:#1b6d85}.btn-info.active,.btn-info:active,.open>.dropdown-toggle.btn-info{background-image:none}.btn-info.disabled,.btn-info.disabled.active,.btn-info.disabled.focus,.btn-info.disabled:active,.btn-info.disabled:focus,.btn-info.disabled:hover,.btn-info[disabled],.btn-info[disabled].active,.btn-info[disabled].focus,.btn-info[disabled]:active,.btn-info[disabled]:focus,.btn-info[disabled]:hover,fieldset[disabled] .btn-info,fieldset[disabled] .btn-info.active,fieldset[disabled] .btn-info.focus,fieldset[disabled] .btn-info:active,fieldset[disabled] .btn-info:focus,fieldset[disabled] .btn-info:hover{background-color:#5bc0de;border-color:#46b8da}.btn-info .badge{color:#5bc0de;background-color:#fff}.btn-warning{color:#fff;background-color:#f0ad4e;border-color:#eea236}.btn-warning.focus,.btn-warning:focus{color:#fff;background-color:#ec971f;border-color:#985f0d}.btn-warning:hover{color:#fff;background-color:#ec971f;border-color:#d58512}.btn-warning.active,.btn-warning:active,.open>.dropdown-toggle.btn-warning{color:#fff;background-color:#ec971f;border-color:#d58512}.btn-warning.active.focus,.btn-warning.active:focus,.btn-warning.active:hover,.btn-warning:active.focus,.btn-warning:active:focus,.btn-warning:active:hover,.open>.dropdown-toggle.btn-warning.focus,.open>.dropdown-toggle.btn-warning:focus,.open>.dropdown-toggle.btn-warning:hover{color:#fff;background-color:#d58512;border-color:#985f0d}.btn-warning.active,.btn-warning:active,.open>.dropdown-toggle.btn-warning{background-image:none}.btn-warning.disabled,.btn-warning.disabled.active,.btn-warning.disabled.focus,.btn-warning.disabled:active,.btn-warning.disabled:focus,.btn-warning.disabled:hover,.btn-warning[disabled],.btn-warning[disabled].active,.btn-warning[disabled].focus,.btn-warning[disabled]:active,.btn-warning[disabled]:focus,.btn-warning[disabled]:hover,fieldset[disabled] .btn-warning,fieldset[disabled] .btn-warning.active,fieldset[disabled] .btn-warning.focus,fieldset[disabled] .btn-warning:active,fieldset[disabled] .btn-warning:focus,fieldset[disabled] .btn-warning:hover{background-color:#f0ad4e;border-color:#eea236}.btn-warning .badge{color:#f0ad4e;background-color:#fff}.btn-danger{color:#fff;background-color:#d9534f;border-color:#d43f3a}.btn-danger.focus,.btn-danger:focus{color:#fff;background-color:#c9302c;border-color:#761c19}.btn-danger:hover{color:#fff;background-color:#c9302c;border-color:#ac2925}.btn-danger.active,.btn-danger:active,.open>.dropdown-toggle.btn-danger{color:#fff;background-color:#c9302c;border-color:#ac2925}.btn-danger.active.focus,.btn-danger.active:focus,.btn-danger.active:hover,.btn-danger:active.focus,.btn-danger:active:focus,.btn-danger:active:hover,.open>.dropdown-toggle.btn-danger.focus,.open>.dropdown-toggle.btn-danger:focus,.open>.dropdown-toggle.btn-danger:hover{color:#fff;background-color:#ac2925;border-color:#761c19}.btn-danger.active,.btn-danger:active,.open>.dropdown-toggle.btn-danger{background-image:none}.btn-danger.disabled,.btn-danger.disabled.active,.btn-danger.disabled.focus,.btn-danger.disabled:active,.btn-danger.disabled:focus,.btn-danger.disabled:hover,.btn-danger[disabled],.btn-danger[disabled].active,.btn-danger[disabled].focus,.btn-danger[disabled]:active,.btn-danger[disabled]:focus,.btn-danger[disabled]:hover,fieldset[disabled] .btn-danger,fieldset[disabled] .btn-danger.active,fieldset[disabled] .btn-danger.focus,fieldset[disabled] .btn-danger:active,fieldset[disabled] .btn-danger:focus,fieldset[disabled] .btn-danger:hover{background-color:#d9534f;border-color:#d43f3a}.btn-danger .badge{color:#d9534f;background-color:#fff}.btn-link{font-weight:400;color:#337ab7;border-radius:0}.btn-link,.btn-link.active,.btn-link:active,.btn-link[disabled],fieldset[disabled] .btn-link{background-color:transparent;-webkit-box-shadow:none;box-shadow:none}.btn-link,.btn-link:active,.btn-link:focus,.btn-link:hover{border-color:transparent}.btn-link:focus,.btn-link:hover{color:#23527c;text-decoration:underline;background-color:transparent}.btn-link[disabled]:focus,.btn-link[disabled]:hover,fieldset[disabled] .btn-link:focus,fieldset[disabled] .btn-link:hover{color:#777;text-decoration:none}.btn-group-lg>.btn,.btn-lg{padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}.btn-group-sm>.btn,.btn-sm{padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.btn-group-xs>.btn,.btn-xs{padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px}.btn-block{display:block;width:100%}.btn-block+.btn-block{margin-top:5px}input[type=button].btn-block,input[type=reset].btn-block,input[type=submit].btn-block{width:100%}.fade{opacity:0;-webkit-transition:opacity .15s linear;-o-transition:opacity .15s linear;transition:opacity .15s linear}.fade.in{opacity:1}.collapse{display:none}.collapse.in{display:block}tr.collapse.in{display:table-row}tbody.collapse.in{display:table-row-group}.collapsing{position:relative;height:0;overflow:hidden;-webkit-transition-timing-function:ease;-o-transition-timing-function:ease;transition-timing-function:ease;-webkit-transition-duration:.35s;-o-transition-duration:.35s;transition-duration:.35s;-webkit-transition-property:height,visibility;-o-transition-property:height,visibility;transition-property:height,visibility}.caret{display:inline-block;width:0;height:0;margin-left:2px;vertical-align:middle;border-top:4px dashed;border-top:4px solid\9;border-right:4px solid transparent;border-left:4px solid transparent}.dropdown,.dropup{position:relative}.dropdown-toggle:focus{outline:0}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;font-size:14px;text-align:left;list-style:none;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.15);border-radius:4px;-webkit-box-shadow:0 6px 12px rgba(0,0,0,.175);box-shadow:0 6px 12px rgba(0,0,0,.175)}.dropdown-menu.pull-right{right:0;left:auto}.dropdown-menu .divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.dropdown-menu>li>a{display:block;padding:3px 20px;clear:both;font-weight:400;line-height:1.42857143;color:#333;white-space:nowrap}.dropdown-menu>li>a:focus,.dropdown-menu>li>a:hover{color:#262626;text-decoration:none;background-color:#f5f5f5}.dropdown-menu>.active>a,.dropdown-menu>.active>a:focus,.dropdown-menu>.active>a:hover{color:#fff;text-decoration:none;background-color:#337ab7;outline:0}.dropdown-menu>.disabled>a,.dropdown-menu>.disabled>a:focus,.dropdown-menu>.disabled>a:hover{color:#777}.dropdown-menu>.disabled>a:focus,.dropdown-menu>.disabled>a:hover{text-decoration:none;cursor:not-allowed;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.open>.dropdown-menu{display:block}.open>a{outline:0}.dropdown-menu-right{right:0;left:auto}.dropdown-menu-left{right:auto;left:0}.dropdown-header{display:block;padding:3px 20px;font-size:12px;line-height:1.42857143;color:#777;white-space:nowrap}.dropdown-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:990}.pull-right>.dropdown-menu{right:0;left:auto}.dropup .caret,.navbar-fixed-bottom .dropdown .caret{content:"";border-top:0;border-bottom:4px dashed;border-bottom:4px solid\9}.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:2px}@media (min-width:768px){.navbar-right .dropdown-menu{right:0;left:auto}.navbar-right .dropdown-menu-left{right:auto;left:0}}.btn-group,.btn-group-vertical{position:relative;display:inline-block;vertical-align:middle}.btn-group-vertical>.btn,.btn-group>.btn{position:relative;float:left}.btn-group-vertical>.btn.active,.btn-group-vertical>.btn:active,.btn-group-vertical>.btn:focus,.btn-group-vertical>.btn:hover,.btn-group>.btn.active,.btn-group>.btn:active,.btn-group>.btn:focus,.btn-group>.btn:hover{z-index:2}.btn-group .btn+.btn,.btn-group .btn+.btn-group,.btn-group .btn-group+.btn,.btn-group .btn-group+.btn-group{margin-left:-1px}.btn-toolbar{margin-left:-5px}.btn-toolbar .btn,.btn-toolbar .btn-group,.btn-toolbar .input-group{float:left}.btn-toolbar>.btn,.btn-toolbar>.btn-group,.btn-toolbar>.input-group{margin-left:5px}.btn-group>.btn:not(:first-child):not(:last-child):not(.dropdown-toggle){border-radius:0}.btn-group>.btn:first-child{margin-left:0}.btn-group>.btn:first-child:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn:last-child:not(:first-child),.btn-group>.dropdown-toggle:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.btn-group>.btn-group{float:left}.btn-group>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn-group:last-child:not(:first-child)>.btn:first-child{border-top-left-radius:0;border-bottom-left-radius:0}.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0}.btn-group>.btn+.dropdown-toggle{padding-right:8px;padding-left:8px}.btn-group>.btn-lg+.dropdown-toggle{padding-right:12px;padding-left:12px}.btn-group.open .dropdown-toggle{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn-group.open .dropdown-toggle.btn-link{-webkit-box-shadow:none;box-shadow:none}.btn .caret{margin-left:0}.btn-lg .caret{border-width:5px 5px 0;border-bottom-width:0}.dropup .btn-lg .caret{border-width:0 5px 5px}.btn-group-vertical>.btn,.btn-group-vertical>.btn-group,.btn-group-vertical>.btn-group>.btn{display:block;float:none;width:100%;max-width:100%}.btn-group-vertical>.btn-group>.btn{float:none}.btn-group-vertical>.btn+.btn,.btn-group-vertical>.btn+.btn-group,.btn-group-vertical>.btn-group+.btn,.btn-group-vertical>.btn-group+.btn-group{margin-top:-1px;margin-left:0}.btn-group-vertical>.btn:not(:first-child):not(:last-child){border-radius:0}.btn-group-vertical>.btn:first-child:not(:last-child){border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn:last-child:not(:first-child){border-top-left-radius:0;border-top-right-radius:0;border-bottom-left-radius:4px}.btn-group-vertical>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group-vertical>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group-vertical>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn-group:last-child:not(:first-child)>.btn:first-child{border-top-left-radius:0;border-top-right-radius:0}.btn-group-justified{display:table;width:100%;table-layout:fixed;border-collapse:separate}.btn-group-justified>.btn,.btn-group-justified>.btn-group{display:table-cell;float:none;width:1%}.btn-group-justified>.btn-group .btn{width:100%}.btn-group-justified>.btn-group .dropdown-menu{left:auto}[data-toggle=buttons]>.btn input[type=checkbox],[data-toggle=buttons]>.btn input[type=radio],[data-toggle=buttons]>.btn-group>.btn input[type=checkbox],[data-toggle=buttons]>.btn-group>.btn input[type=radio]{position:absolute;clip:rect(0,0,0,0);pointer-events:none}.input-group{position:relative;display:table;border-collapse:separate}.input-group[class*=col-]{float:none;padding-right:0;padding-left:0}.input-group .form-control{position:relative;z-index:2;float:left;width:100%;margin-bottom:0}.input-group-lg>.form-control,.input-group-lg>.input-group-addon,.input-group-lg>.input-group-btn>.btn{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}select.input-group-lg>.form-control,select.input-group-lg>.input-group-addon,select.input-group-lg>.input-group-btn>.btn{height:46px;line-height:46px}select[multiple].input-group-lg>.form-control,select[multiple].input-group-lg>.input-group-addon,select[multiple].input-group-lg>.input-group-btn>.btn,textarea.input-group-lg>.form-control,textarea.input-group-lg>.input-group-addon,textarea.input-group-lg>.input-group-btn>.btn{height:auto}.input-group-sm>.form-control,.input-group-sm>.input-group-addon,.input-group-sm>.input-group-btn>.btn{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-group-sm>.form-control,select.input-group-sm>.input-group-addon,select.input-group-sm>.input-group-btn>.btn{height:30px;line-height:30px}select[multiple].input-group-sm>.form-control,select[multiple].input-group-sm>.input-group-addon,select[multiple].input-group-sm>.input-group-btn>.btn,textarea.input-group-sm>.form-control,textarea.input-group-sm>.input-group-addon,textarea.input-group-sm>.input-group-btn>.btn{height:auto}.input-group .form-control,.input-group-addon,.input-group-btn{display:table-cell}.input-group .form-control:not(:first-child):not(:last-child),.input-group-addon:not(:first-child):not(:last-child),.input-group-btn:not(:first-child):not(:last-child){border-radius:0}.input-group-addon,.input-group-btn{width:1%;white-space:nowrap;vertical-align:middle}.input-group-addon{padding:6px 12px;font-size:14px;font-weight:400;line-height:1;color:#555;text-align:center;background-color:#eee;border:1px solid #ccc;border-radius:4px}.input-group-addon.input-sm{padding:5px 10px;font-size:12px;border-radius:3px}.input-group-addon.input-lg{padding:10px 16px;font-size:18px;border-radius:6px}.input-group-addon input[type=checkbox],.input-group-addon input[type=radio]{margin-top:0}.input-group .form-control:first-child,.input-group-addon:first-child,.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group>.btn,.input-group-btn:first-child>.dropdown-toggle,.input-group-btn:last-child>.btn-group:not(:last-child)>.btn,.input-group-btn:last-child>.btn:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.input-group-addon:first-child{border-right:0}.input-group .form-control:last-child,.input-group-addon:last-child,.input-group-btn:first-child>.btn-group:not(:first-child)>.btn,.input-group-btn:first-child>.btn:not(:first-child),.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group>.btn,.input-group-btn:last-child>.dropdown-toggle{border-top-left-radius:0;border-bottom-left-radius:0}.input-group-addon:last-child{border-left:0}.input-group-btn{position:relative;font-size:0;white-space:nowrap}.input-group-btn>.btn{position:relative}.input-group-btn>.btn+.btn{margin-left:-1px}.input-group-btn>.btn:active,.input-group-btn>.btn:focus,.input-group-btn>.btn:hover{z-index:2}.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group{margin-right:-1px}.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group{z-index:2;margin-left:-1px}.nav{padding-left:0;margin-bottom:0;list-style:none}.nav>li{position:relative;display:block}.nav>li>a{position:relative;display:block;padding:10px 15px}.nav>li>a:focus,.nav>li>a:hover{text-decoration:none;background-color:#eee}.nav>li.disabled>a{color:#777}.nav>li.disabled>a:focus,.nav>li.disabled>a:hover{color:#777;text-decoration:none;cursor:not-allowed;background-color:transparent}.nav .open>a,.nav .open>a:focus,.nav .open>a:hover{background-color:#eee;border-color:#337ab7}.nav .nav-divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.nav>li>a>img{max-width:none}.nav-tabs{border-bottom:1px solid #ddd}.nav-tabs>li{float:left;margin-bottom:-1px}.nav-tabs>li>a{margin-right:2px;line-height:1.42857143;border:1px solid transparent;border-radius:4px 4px 0 0}.nav-tabs>li>a:hover{border-color:#eee #eee #ddd}.nav-tabs>li.active>a,.nav-tabs>li.active>a:focus,.nav-tabs>li.active>a:hover{color:#555;cursor:default;background-color:#fff;border:1px solid #ddd;border-bottom-color:transparent}.nav-tabs.nav-justified{width:100%;border-bottom:0}.nav-tabs.nav-justified>li{float:none}.nav-tabs.nav-justified>li>a{margin-bottom:5px;text-align:center}.nav-tabs.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-tabs.nav-justified>li{display:table-cell;width:1%}.nav-tabs.nav-justified>li>a{margin-bottom:0}}.nav-tabs.nav-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:focus,.nav-tabs.nav-justified>.active>a:hover{border:1px solid #ddd}@media (min-width:768px){.nav-tabs.nav-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:focus,.nav-tabs.nav-justified>.active>a:hover{border-bottom-color:#fff}}.nav-pills>li{float:left}.nav-pills>li>a{border-radius:4px}.nav-pills>li+li{margin-left:2px}.nav-pills>li.active>a,.nav-pills>li.active>a:focus,.nav-pills>li.active>a:hover{color:#fff;background-color:#337ab7}.nav-stacked>li{float:none}.nav-stacked>li+li{margin-top:2px;margin-left:0}.nav-justified{width:100%}.nav-justified>li{float:none}.nav-justified>li>a{margin-bottom:5px;text-align:center}.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-justified>li{display:table-cell;width:1%}.nav-justified>li>a{margin-bottom:0}}.nav-tabs-justified{border-bottom:0}.nav-tabs-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:focus,.nav-tabs-justified>.active>a:hover{border:1px solid #ddd}@media (min-width:768px){.nav-tabs-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:focus,.nav-tabs-justified>.active>a:hover{border-bottom-color:#fff}}.tab-content>.tab-pane{display:none}.tab-content>.active{display:block}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-left-radius:0;border-top-right-radius:0}.navbar{position:relative;min-height:50px;margin-bottom:20px;border:1px solid transparent}@media (min-width:768px){.navbar{border-radius:4px}}@media (min-width:768px){.navbar-header{float:left}}.navbar-collapse{padding-right:15px;padding-left:15px;overflow-x:visible;-webkit-overflow-scrolling:touch;border-top:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 0 rgba(255,255,255,.1)}.navbar-collapse.in{overflow-y:auto}@media (min-width:768px){.navbar-collapse{width:auto;border-top:0;-webkit-box-shadow:none;box-shadow:none}.navbar-collapse.collapse{display:block!important;height:auto!important;padding-bottom:0;overflow:visible!important}.navbar-collapse.in{overflow-y:visible}.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse,.navbar-static-top .navbar-collapse{padding-right:0;padding-left:0}}.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse{max-height:340px}@media (max-device-width:480px) and (orientation:landscape){.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse{max-height:200px}}.container-fluid>.navbar-collapse,.container-fluid>.navbar-header,.container>.navbar-collapse,.container>.navbar-header{margin-right:-15px;margin-left:-15px}@media (min-width:768px){.container-fluid>.navbar-collapse,.container-fluid>.navbar-header,.container>.navbar-collapse,.container>.navbar-header{margin-right:0;margin-left:0}}.navbar-static-top{z-index:1000;border-width:0 0 1px}@media (min-width:768px){.navbar-static-top{border-radius:0}}.navbar-fixed-bottom,.navbar-fixed-top{position:fixed;right:0;left:0;z-index:1030}@media (min-width:768px){.navbar-fixed-bottom,.navbar-fixed-top{border-radius:0}}.navbar-fixed-top{top:0;border-width:0 0 1px}.navbar-fixed-bottom{bottom:0;margin-bottom:0;border-width:1px 0 0}.navbar-brand{float:left;height:50px;padding:15px 15px;font-size:18px;line-height:20px}.navbar-brand:focus,.navbar-brand:hover{text-decoration:none}.navbar-brand>img{display:block}@media (min-width:768px){.navbar>.container .navbar-brand,.navbar>.container-fluid .navbar-brand{margin-left:-15px}}.navbar-toggle{position:relative;float:right;padding:9px 10px;margin-top:8px;margin-right:15px;margin-bottom:8px;background-color:transparent;background-image:none;border:1px solid transparent;border-radius:4px}.navbar-toggle:focus{outline:0}.navbar-toggle .icon-bar{display:block;width:22px;height:2px;border-radius:1px}.navbar-toggle .icon-bar+.icon-bar{margin-top:4px}@media (min-width:768px){.navbar-toggle{display:none}}.navbar-nav{margin:7.5px -15px}.navbar-nav>li>a{padding-top:10px;padding-bottom:10px;line-height:20px}@media (max-width:767px){.navbar-nav .open .dropdown-menu{position:static;float:none;width:auto;margin-top:0;background-color:transparent;border:0;-webkit-box-shadow:none;box-shadow:none}.navbar-nav .open .dropdown-menu .dropdown-header,.navbar-nav .open .dropdown-menu>li>a{padding:5px 15px 5px 25px}.navbar-nav .open .dropdown-menu>li>a{line-height:20px}.navbar-nav .open .dropdown-menu>li>a:focus,.navbar-nav .open .dropdown-menu>li>a:hover{background-image:none}}@media (min-width:768px){.navbar-nav{float:left;margin:0}.navbar-nav>li{float:left}.navbar-nav>li>a{padding-top:15px;padding-bottom:15px}}.navbar-form{padding:10px 15px;margin-top:8px;margin-right:-15px;margin-bottom:8px;margin-left:-15px;border-top:1px solid transparent;border-bottom:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 1px 0 rgba(255,255,255,.1)}@media (min-width:768px){.navbar-form .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.navbar-form .form-control{display:inline-block;width:auto;vertical-align:middle}.navbar-form .form-control-static{display:inline-block}.navbar-form .input-group{display:inline-table;vertical-align:middle}.navbar-form .input-group .form-control,.navbar-form .input-group .input-group-addon,.navbar-form .input-group .input-group-btn{width:auto}.navbar-form .input-group>.form-control{width:100%}.navbar-form .control-label{margin-bottom:0;vertical-align:middle}.navbar-form .checkbox,.navbar-form .radio{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.navbar-form .checkbox label,.navbar-form .radio label{padding-left:0}.navbar-form .checkbox input[type=checkbox],.navbar-form .radio input[type=radio]{position:relative;margin-left:0}.navbar-form .has-feedback .form-control-feedback{top:0}}@media (max-width:767px){.navbar-form .form-group{margin-bottom:5px}.navbar-form .form-group:last-child{margin-bottom:0}}@media (min-width:768px){.navbar-form{width:auto;padding-top:0;padding-bottom:0;margin-right:0;margin-left:0;border:0;-webkit-box-shadow:none;box-shadow:none}}.navbar-nav>li>.dropdown-menu{margin-top:0;border-top-left-radius:0;border-top-right-radius:0}.navbar-fixed-bottom .navbar-nav>li>.dropdown-menu{margin-bottom:0;border-top-left-radius:4px;border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.navbar-btn{margin-top:8px;margin-bottom:8px}.navbar-btn.btn-sm{margin-top:10px;margin-bottom:10px}.navbar-btn.btn-xs{margin-top:14px;margin-bottom:14px}.navbar-text{margin-top:15px;margin-bottom:15px}@media (min-width:768px){.navbar-text{float:left;margin-right:15px;margin-left:15px}}@media (min-width:768px){.navbar-left{float:left!important}.navbar-right{float:right!important;margin-right:-15px}.navbar-right~.navbar-right{margin-right:0}}.navbar-default{background-color:#f8f8f8;border-color:#e7e7e7}.navbar-default .navbar-brand{color:#777}.navbar-default .navbar-brand:focus,.navbar-default .navbar-brand:hover{color:#5e5e5e;background-color:transparent}.navbar-default .navbar-text{color:#777}.navbar-default .navbar-nav>li>a{color:#777}.navbar-default .navbar-nav>li>a:focus,.navbar-default .navbar-nav>li>a:hover{color:#333;background-color:transparent}.navbar-default .navbar-nav>.active>a,.navbar-default .navbar-nav>.active>a:focus,.navbar-default .navbar-nav>.active>a:hover{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav>.disabled>a,.navbar-default .navbar-nav>.disabled>a:focus,.navbar-default .navbar-nav>.disabled>a:hover{color:#ccc;background-color:transparent}.navbar-default .navbar-toggle{border-color:#ddd}.navbar-default .navbar-toggle:focus,.navbar-default .navbar-toggle:hover{background-color:#ddd}.navbar-default .navbar-toggle .icon-bar{background-color:#888}.navbar-default .navbar-collapse,.navbar-default .navbar-form{border-color:#e7e7e7}.navbar-default .navbar-nav>.open>a,.navbar-default .navbar-nav>.open>a:focus,.navbar-default .navbar-nav>.open>a:hover{color:#555;background-color:#e7e7e7}@media (max-width:767px){.navbar-default .navbar-nav .open .dropdown-menu>li>a{color:#777}.navbar-default .navbar-nav .open .dropdown-menu>li>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>li>a:hover{color:#333;background-color:transparent}.navbar-default .navbar-nav .open .dropdown-menu>.active>a,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:hover{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:hover{color:#ccc;background-color:transparent}}.navbar-default .navbar-link{color:#777}.navbar-default .navbar-link:hover{color:#333}.navbar-default .btn-link{color:#777}.navbar-default .btn-link:focus,.navbar-default .btn-link:hover{color:#333}.navbar-default .btn-link[disabled]:focus,.navbar-default .btn-link[disabled]:hover,fieldset[disabled] .navbar-default .btn-link:focus,fieldset[disabled] .navbar-default .btn-link:hover{color:#ccc}.navbar-inverse{background-color:#222;border-color:#080808}.navbar-inverse .navbar-brand{color:#9d9d9d}.navbar-inverse .navbar-brand:focus,.navbar-inverse .navbar-brand:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-text{color:#9d9d9d}.navbar-inverse .navbar-nav>li>a{color:#9d9d9d}.navbar-inverse .navbar-nav>li>a:focus,.navbar-inverse .navbar-nav>li>a:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav>.active>a,.navbar-inverse .navbar-nav>.active>a:focus,.navbar-inverse .navbar-nav>.active>a:hover{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav>.disabled>a,.navbar-inverse .navbar-nav>.disabled>a:focus,.navbar-inverse .navbar-nav>.disabled>a:hover{color:#444;background-color:transparent}.navbar-inverse .navbar-toggle{border-color:#333}.navbar-inverse .navbar-toggle:focus,.navbar-inverse .navbar-toggle:hover{background-color:#333}.navbar-inverse .navbar-toggle .icon-bar{background-color:#fff}.navbar-inverse .navbar-collapse,.navbar-inverse .navbar-form{border-color:#101010}.navbar-inverse .navbar-nav>.open>a,.navbar-inverse .navbar-nav>.open>a:focus,.navbar-inverse .navbar-nav>.open>a:hover{color:#fff;background-color:#080808}@media (max-width:767px){.navbar-inverse .navbar-nav .open .dropdown-menu>.dropdown-header{border-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu .divider{background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a{color:#9d9d9d}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:hover{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:hover{color:#444;background-color:transparent}}.navbar-inverse .navbar-link{color:#9d9d9d}.navbar-inverse .navbar-link:hover{color:#fff}.navbar-inverse .btn-link{color:#9d9d9d}.navbar-inverse .btn-link:focus,.navbar-inverse .btn-link:hover{color:#fff}.navbar-inverse .btn-link[disabled]:focus,.navbar-inverse .btn-link[disabled]:hover,fieldset[disabled] .navbar-inverse .btn-link:focus,fieldset[disabled] .navbar-inverse .btn-link:hover{color:#444}.breadcrumb{padding:8px 15px;margin-bottom:20px;list-style:none;background-color:#f5f5f5;border-radius:4px}.breadcrumb>li{display:inline-block}.breadcrumb>li+li:before{padding:0 5px;color:#ccc;content:"/\00a0"}.breadcrumb>.active{color:#777}.pagination{display:inline-block;padding-left:0;margin:20px 0;border-radius:4px}.pagination>li{display:inline}.pagination>li>a,.pagination>li>span{position:relative;float:left;padding:6px 12px;margin-left:-1px;line-height:1.42857143;color:#337ab7;text-decoration:none;background-color:#fff;border:1px solid #ddd}.pagination>li:first-child>a,.pagination>li:first-child>span{margin-left:0;border-top-left-radius:4px;border-bottom-left-radius:4px}.pagination>li:last-child>a,.pagination>li:last-child>span{border-top-right-radius:4px;border-bottom-right-radius:4px}.pagination>li>a:focus,.pagination>li>a:hover,.pagination>li>span:focus,.pagination>li>span:hover{z-index:3;color:#23527c;background-color:#eee;border-color:#ddd}.pagination>.active>a,.pagination>.active>a:focus,.pagination>.active>a:hover,.pagination>.active>span,.pagination>.active>span:focus,.pagination>.active>span:hover{z-index:2;color:#fff;cursor:default;background-color:#337ab7;border-color:#337ab7}.pagination>.disabled>a,.pagination>.disabled>a:focus,.pagination>.disabled>a:hover,.pagination>.disabled>span,.pagination>.disabled>span:focus,.pagination>.disabled>span:hover{color:#777;cursor:not-allowed;background-color:#fff;border-color:#ddd}.pagination-lg>li>a,.pagination-lg>li>span{padding:10px 16px;font-size:18px;line-height:1.3333333}.pagination-lg>li:first-child>a,.pagination-lg>li:first-child>span{border-top-left-radius:6px;border-bottom-left-radius:6px}.pagination-lg>li:last-child>a,.pagination-lg>li:last-child>span{border-top-right-radius:6px;border-bottom-right-radius:6px}.pagination-sm>li>a,.pagination-sm>li>span{padding:5px 10px;font-size:12px;line-height:1.5}.pagination-sm>li:first-child>a,.pagination-sm>li:first-child>span{border-top-left-radius:3px;border-bottom-left-radius:3px}.pagination-sm>li:last-child>a,.pagination-sm>li:last-child>span{border-top-right-radius:3px;border-bottom-right-radius:3px}.pager{padding-left:0;margin:20px 0;text-align:center;list-style:none}.pager li{display:inline}.pager li>a,.pager li>span{display:inline-block;padding:5px 14px;background-color:#fff;border:1px solid #ddd;border-radius:15px}.pager li>a:focus,.pager li>a:hover{text-decoration:none;background-color:#eee}.pager .next>a,.pager .next>span{float:right}.pager .previous>a,.pager .previous>span{float:left}.pager .disabled>a,.pager .disabled>a:focus,.pager .disabled>a:hover,.pager .disabled>span{color:#777;cursor:not-allowed;background-color:#fff}.label{display:inline;padding:.2em .6em .3em;font-size:75%;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25em}a.label:focus,a.label:hover{color:#fff;text-decoration:none;cursor:pointer}.label:empty{display:none}.btn .label{position:relative;top:-1px}.label-default{background-color:#777}.label-default[href]:focus,.label-default[href]:hover{background-color:#5e5e5e}.label-primary{background-color:#337ab7}.label-primary[href]:focus,.label-primary[href]:hover{background-color:#286090}.label-success{background-color:#5cb85c}.label-success[href]:focus,.label-success[href]:hover{background-color:#449d44}.label-info{background-color:#5bc0de}.label-info[href]:focus,.label-info[href]:hover{background-color:#31b0d5}.label-warning{background-color:#f0ad4e}.label-warning[href]:focus,.label-warning[href]:hover{background-color:#ec971f}.label-danger{background-color:#d9534f}.label-danger[href]:focus,.label-danger[href]:hover{background-color:#c9302c}.badge{display:inline-block;min-width:10px;padding:3px 7px;font-size:12px;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:middle;background-color:#777;border-radius:10px}.badge:empty{display:none}.btn .badge{position:relative;top:-1px}.btn-group-xs>.btn .badge,.btn-xs .badge{top:0;padding:1px 5px}a.badge:focus,a.badge:hover{color:#fff;text-decoration:none;cursor:pointer}.list-group-item.active>.badge,.nav-pills>.active>a>.badge{color:#337ab7;background-color:#fff}.list-group-item>.badge{float:right}.list-group-item>.badge+.badge{margin-right:5px}.nav-pills>li>a>.badge{margin-left:3px}.jumbotron{padding-top:30px;padding-bottom:30px;margin-bottom:30px;color:inherit;background-color:#eee}.jumbotron .h1,.jumbotron h1{color:inherit}.jumbotron p{margin-bottom:15px;font-size:21px;font-weight:200}.jumbotron>hr{border-top-color:#d5d5d5}.container .jumbotron,.container-fluid .jumbotron{border-radius:6px}.jumbotron .container{max-width:100%}@media screen and (min-width:768px){.jumbotron{padding-top:48px;padding-bottom:48px}.container .jumbotron,.container-fluid .jumbotron{padding-right:60px;padding-left:60px}.jumbotron .h1,.jumbotron h1{font-size:63px}}.thumbnail{display:block;padding:4px;margin-bottom:20px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:border .2s ease-in-out;-o-transition:border .2s ease-in-out;transition:border .2s ease-in-out}.thumbnail a>img,.thumbnail>img{margin-right:auto;margin-left:auto}a.thumbnail.active,a.thumbnail:focus,a.thumbnail:hover{border-color:#337ab7}.thumbnail .caption{padding:9px;color:#333}.alert{padding:15px;margin-bottom:20px;border:1px solid transparent;border-radius:4px}.alert h4{margin-top:0;color:inherit}.alert .alert-link{font-weight:700}.alert>p,.alert>ul{margin-bottom:0}.alert>p+p{margin-top:5px}.alert-dismissable,.alert-dismissible{padding-right:35px}.alert-dismissable .close,.alert-dismissible .close{position:relative;top:-2px;right:-21px;color:inherit}.alert-success{color:#3c763d;background-color:#dff0d8;border-color:#d6e9c6}.alert-success hr{border-top-color:#c9e2b3}.alert-success .alert-link{color:#2b542c}.alert-info{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.alert-info hr{border-top-color:#a6e1ec}.alert-info .alert-link{color:#245269}.alert-warning{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc}.alert-warning hr{border-top-color:#f7e1b5}.alert-warning .alert-link{color:#66512c}.alert-danger{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.alert-danger hr{border-top-color:#e4b9c0}.alert-danger .alert-link{color:#843534}@-webkit-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-o-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}.progress{height:20px;margin-bottom:20px;overflow:hidden;background-color:#f5f5f5;border-radius:4px;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.1);box-shadow:inset 0 1px 2px rgba(0,0,0,.1)}.progress-bar{float:left;width:0;height:100%;font-size:12px;line-height:20px;color:#fff;text-align:center;background-color:#337ab7;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);-webkit-transition:width .6s ease;-o-transition:width .6s ease;transition:width .6s ease}.progress-bar-striped,.progress-striped .progress-bar{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);-webkit-background-size:40px 40px;background-size:40px 40px}.progress-bar.active,.progress.active .progress-bar{-webkit-animation:progress-bar-stripes 2s linear infinite;-o-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}.progress-bar-success{background-color:#5cb85c}.progress-striped .progress-bar-success{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-info{background-color:#5bc0de}.progress-striped .progress-bar-info{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-warning{background-color:#f0ad4e}.progress-striped .progress-bar-warning{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-danger{background-color:#d9534f}.progress-striped .progress-bar-danger{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.media{margin-top:15px}.media:first-child{margin-top:0}.media,.media-body{overflow:hidden;zoom:1}.media-body{width:10000px}.media-object{display:block}.media-object.img-thumbnail{max-width:none}.media-right,.media>.pull-right{padding-left:10px}.media-left,.media>.pull-left{padding-right:10px}.media-body,.media-left,.media-right{display:table-cell;vertical-align:top}.media-middle{vertical-align:middle}.media-bottom{vertical-align:bottom}.media-heading{margin-top:0;margin-bottom:5px}.media-list{padding-left:0;list-style:none}.list-group{padding-left:0;margin-bottom:20px}.list-group-item{position:relative;display:block;padding:10px 15px;margin-bottom:-1px;background-color:#fff;border:1px solid #ddd}.list-group-item:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.list-group-item:last-child{margin-bottom:0;border-bottom-right-radius:4px;border-bottom-left-radius:4px}a.list-group-item,button.list-group-item{color:#555}a.list-group-item .list-group-item-heading,button.list-group-item .list-group-item-heading{color:#333}a.list-group-item:focus,a.list-group-item:hover,button.list-group-item:focus,button.list-group-item:hover{color:#555;text-decoration:none;background-color:#f5f5f5}button.list-group-item{width:100%;text-align:left}.list-group-item.disabled,.list-group-item.disabled:focus,.list-group-item.disabled:hover{color:#777;cursor:not-allowed;background-color:#eee}.list-group-item.disabled .list-group-item-heading,.list-group-item.disabled:focus .list-group-item-heading,.list-group-item.disabled:hover .list-group-item-heading{color:inherit}.list-group-item.disabled .list-group-item-text,.list-group-item.disabled:focus .list-group-item-text,.list-group-item.disabled:hover .list-group-item-text{color:#777}.list-group-item.active,.list-group-item.active:focus,.list-group-item.active:hover{z-index:2;color:#fff;background-color:#337ab7;border-color:#337ab7}.list-group-item.active .list-group-item-heading,.list-group-item.active .list-group-item-heading>.small,.list-group-item.active .list-group-item-heading>small,.list-group-item.active:focus .list-group-item-heading,.list-group-item.active:focus .list-group-item-heading>.small,.list-group-item.active:focus .list-group-item-heading>small,.list-group-item.active:hover .list-group-item-heading,.list-group-item.active:hover .list-group-item-heading>.small,.list-group-item.active:hover .list-group-item-heading>small{color:inherit}.list-group-item.active .list-group-item-text,.list-group-item.active:focus .list-group-item-text,.list-group-item.active:hover .list-group-item-text{color:#c7ddef}.list-group-item-success{color:#3c763d;background-color:#dff0d8}a.list-group-item-success,button.list-group-item-success{color:#3c763d}a.list-group-item-success .list-group-item-heading,button.list-group-item-success .list-group-item-heading{color:inherit}a.list-group-item-success:focus,a.list-group-item-success:hover,button.list-group-item-success:focus,button.list-group-item-success:hover{color:#3c763d;background-color:#d0e9c6}a.list-group-item-success.active,a.list-group-item-success.active:focus,a.list-group-item-success.active:hover,button.list-group-item-success.active,button.list-group-item-success.active:focus,button.list-group-item-success.active:hover{color:#fff;background-color:#3c763d;border-color:#3c763d}.list-group-item-info{color:#31708f;background-color:#d9edf7}a.list-group-item-info,button.list-group-item-info{color:#31708f}a.list-group-item-info .list-group-item-heading,button.list-group-item-info .list-group-item-heading{color:inherit}a.list-group-item-info:focus,a.list-group-item-info:hover,button.list-group-item-info:focus,button.list-group-item-info:hover{color:#31708f;background-color:#c4e3f3}a.list-group-item-info.active,a.list-group-item-info.active:focus,a.list-group-item-info.active:hover,button.list-group-item-info.active,button.list-group-item-info.active:focus,button.list-group-item-info.active:hover{color:#fff;background-color:#31708f;border-color:#31708f}.list-group-item-warning{color:#8a6d3b;background-color:#fcf8e3}a.list-group-item-warning,button.list-group-item-warning{color:#8a6d3b}a.list-group-item-warning .list-group-item-heading,button.list-group-item-warning .list-group-item-heading{color:inherit}a.list-group-item-warning:focus,a.list-group-item-warning:hover,button.list-group-item-warning:focus,button.list-group-item-warning:hover{color:#8a6d3b;background-color:#faf2cc}a.list-group-item-warning.active,a.list-group-item-warning.active:focus,a.list-group-item-warning.active:hover,button.list-group-item-warning.active,button.list-group-item-warning.active:focus,button.list-group-item-warning.active:hover{color:#fff;background-color:#8a6d3b;border-color:#8a6d3b}.list-group-item-danger{color:#a94442;background-color:#f2dede}a.list-group-item-danger,button.list-group-item-danger{color:#a94442}a.list-group-item-danger .list-group-item-heading,button.list-group-item-danger .list-group-item-heading{color:inherit}a.list-group-item-danger:focus,a.list-group-item-danger:hover,button.list-group-item-danger:focus,button.list-group-item-danger:hover{color:#a94442;background-color:#ebcccc}a.list-group-item-danger.active,a.list-group-item-danger.active:focus,a.list-group-item-danger.active:hover,button.list-group-item-danger.active,button.list-group-item-danger.active:focus,button.list-group-item-danger.active:hover{color:#fff;background-color:#a94442;border-color:#a94442}.list-group-item-heading{margin-top:0;margin-bottom:5px}.list-group-item-text{margin-bottom:0;line-height:1.3}.panel{margin-bottom:20px;background-color:#fff;border:1px solid transparent;border-radius:4px;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.05);box-shadow:0 1px 1px rgba(0,0,0,.05)}.panel-body{padding:15px}.panel-heading{padding:10px 15px;border-bottom:1px solid transparent;border-top-left-radius:3px;border-top-right-radius:3px}.panel-heading>.dropdown .dropdown-toggle{color:inherit}.panel-title{margin-top:0;margin-bottom:0;font-size:16px;color:inherit}.panel-title>.small,.panel-title>.small>a,.panel-title>a,.panel-title>small,.panel-title>small>a{color:inherit}.panel-footer{padding:10px 15px;background-color:#f5f5f5;border-top:1px solid #ddd;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.list-group,.panel>.panel-collapse>.list-group{margin-bottom:0}.panel>.list-group .list-group-item,.panel>.panel-collapse>.list-group .list-group-item{border-width:1px 0;border-radius:0}.panel>.list-group:first-child .list-group-item:first-child,.panel>.panel-collapse>.list-group:first-child .list-group-item:first-child{border-top:0;border-top-left-radius:3px;border-top-right-radius:3px}.panel>.list-group:last-child .list-group-item:last-child,.panel>.panel-collapse>.list-group:last-child .list-group-item:last-child{border-bottom:0;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.panel-heading+.panel-collapse>.list-group .list-group-item:first-child{border-top-left-radius:0;border-top-right-radius:0}.panel-heading+.list-group .list-group-item:first-child{border-top-width:0}.list-group+.panel-footer{border-top-width:0}.panel>.panel-collapse>.table,.panel>.table,.panel>.table-responsive>.table{margin-bottom:0}.panel>.panel-collapse>.table caption,.panel>.table caption,.panel>.table-responsive>.table caption{padding-right:15px;padding-left:15px}.panel>.table-responsive:first-child>.table:first-child,.panel>.table:first-child{border-top-left-radius:3px;border-top-right-radius:3px}.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child,.panel>.table:first-child>thead:first-child>tr:first-child{border-top-left-radius:3px;border-top-right-radius:3px}.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:first-child,.panel>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table:first-child>thead:first-child>tr:first-child th:first-child{border-top-left-radius:3px}.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:last-child,.panel>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table:first-child>thead:first-child>tr:first-child th:last-child{border-top-right-radius:3px}.panel>.table-responsive:last-child>.table:last-child,.panel>.table:last-child{border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child{border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:first-child,.panel>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:first-child{border-bottom-left-radius:3px}.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:last-child{border-bottom-right-radius:3px}.panel>.panel-body+.table,.panel>.panel-body+.table-responsive,.panel>.table+.panel-body,.panel>.table-responsive+.panel-body{border-top:1px solid #ddd}.panel>.table>tbody:first-child>tr:first-child td,.panel>.table>tbody:first-child>tr:first-child th{border-top:0}.panel>.table-bordered,.panel>.table-responsive>.table-bordered{border:0}.panel>.table-bordered>tbody>tr>td:first-child,.panel>.table-bordered>tbody>tr>th:first-child,.panel>.table-bordered>tfoot>tr>td:first-child,.panel>.table-bordered>tfoot>tr>th:first-child,.panel>.table-bordered>thead>tr>td:first-child,.panel>.table-bordered>thead>tr>th:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:first-child,.panel>.table-responsive>.table-bordered>thead>tr>td:first-child,.panel>.table-responsive>.table-bordered>thead>tr>th:first-child{border-left:0}.panel>.table-bordered>tbody>tr>td:last-child,.panel>.table-bordered>tbody>tr>th:last-child,.panel>.table-bordered>tfoot>tr>td:last-child,.panel>.table-bordered>tfoot>tr>th:last-child,.panel>.table-bordered>thead>tr>td:last-child,.panel>.table-bordered>thead>tr>th:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:last-child,.panel>.table-responsive>.table-bordered>thead>tr>td:last-child,.panel>.table-responsive>.table-bordered>thead>tr>th:last-child{border-right:0}.panel>.table-bordered>tbody>tr:first-child>td,.panel>.table-bordered>tbody>tr:first-child>th,.panel>.table-bordered>thead>tr:first-child>td,.panel>.table-bordered>thead>tr:first-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>th,.panel>.table-responsive>.table-bordered>thead>tr:first-child>td,.panel>.table-responsive>.table-bordered>thead>tr:first-child>th{border-bottom:0}.panel>.table-bordered>tbody>tr:last-child>td,.panel>.table-bordered>tbody>tr:last-child>th,.panel>.table-bordered>tfoot>tr:last-child>td,.panel>.table-bordered>tfoot>tr:last-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>th,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>td,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>th{border-bottom:0}.panel>.table-responsive{margin-bottom:0;border:0}.panel-group{margin-bottom:20px}.panel-group .panel{margin-bottom:0;border-radius:4px}.panel-group .panel+.panel{margin-top:5px}.panel-group .panel-heading{border-bottom:0}.panel-group .panel-heading+.panel-collapse>.list-group,.panel-group .panel-heading+.panel-collapse>.panel-body{border-top:1px solid #ddd}.panel-group .panel-footer{border-top:0}.panel-group .panel-footer+.panel-collapse .panel-body{border-bottom:1px solid #ddd}.panel-default{border-color:#ddd}.panel-default>.panel-heading{color:#333;background-color:#f5f5f5;border-color:#ddd}.panel-default>.panel-heading+.panel-collapse>.panel-body{border-top-color:#ddd}.panel-default>.panel-heading .badge{color:#f5f5f5;background-color:#333}.panel-default>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#ddd}.panel-primary{border-color:#337ab7}.panel-primary>.panel-heading{color:#fff;background-color:#337ab7;border-color:#337ab7}.panel-primary>.panel-heading+.panel-collapse>.panel-body{border-top-color:#337ab7}.panel-primary>.panel-heading .badge{color:#337ab7;background-color:#fff}.panel-primary>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#337ab7}.panel-success{border-color:#d6e9c6}.panel-success>.panel-heading{color:#3c763d;background-color:#dff0d8;border-color:#d6e9c6}.panel-success>.panel-heading+.panel-collapse>.panel-body{border-top-color:#d6e9c6}.panel-success>.panel-heading .badge{color:#dff0d8;background-color:#3c763d}.panel-success>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#d6e9c6}.panel-info{border-color:#bce8f1}.panel-info>.panel-heading{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.panel-info>.panel-heading+.panel-collapse>.panel-body{border-top-color:#bce8f1}.panel-info>.panel-heading .badge{color:#d9edf7;background-color:#31708f}.panel-info>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#bce8f1}.panel-warning{border-color:#faebcc}.panel-warning>.panel-heading{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc}.panel-warning>.panel-heading+.panel-collapse>.panel-body{border-top-color:#faebcc}.panel-warning>.panel-heading .badge{color:#fcf8e3;background-color:#8a6d3b}.panel-warning>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#faebcc}.panel-danger{border-color:#ebccd1}.panel-danger>.panel-heading{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.panel-danger>.panel-heading+.panel-collapse>.panel-body{border-top-color:#ebccd1}.panel-danger>.panel-heading .badge{color:#f2dede;background-color:#a94442}.panel-danger>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#ebccd1}.embed-responsive{position:relative;display:block;height:0;padding:0;overflow:hidden}.embed-responsive .embed-responsive-item,.embed-responsive embed,.embed-responsive iframe,.embed-responsive object,.embed-responsive video{position:absolute;top:0;bottom:0;left:0;width:100%;height:100%;border:0}.embed-responsive-16by9{padding-bottom:56.25%}.embed-responsive-4by3{padding-bottom:75%}.well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#f5f5f5;border:1px solid #e3e3e3;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.05);box-shadow:inset 0 1px 1px rgba(0,0,0,.05)}.well blockquote{border-color:#ddd;border-color:rgba(0,0,0,.15)}.well-lg{padding:24px;border-radius:6px}.well-sm{padding:9px;border-radius:3px}.close{float:right;font-size:21px;font-weight:700;line-height:1;color:#000;text-shadow:0 1px 0 #fff;filter:alpha(opacity=20);opacity:.2}.close:focus,.close:hover{color:#000;text-decoration:none;cursor:pointer;filter:alpha(opacity=50);opacity:.5}button.close{-webkit-appearance:none;padding:0;cursor:pointer;background:0 0;border:0}.modal-open{overflow:hidden}.modal{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1050;display:none;overflow:hidden;-webkit-overflow-scrolling:touch;outline:0}.modal.fade .modal-dialog{-webkit-transition:-webkit-transform .3s ease-out;-o-transition:-o-transform .3s ease-out;transition:transform .3s ease-out;-webkit-transform:translate(0,-25%);-ms-transform:translate(0,-25%);-o-transform:translate(0,-25%);transform:translate(0,-25%)}.modal.in .modal-dialog{-webkit-transform:translate(0,0);-ms-transform:translate(0,0);-o-transform:translate(0,0);transform:translate(0,0)}.modal-open .modal{overflow-x:hidden;overflow-y:auto}.modal-dialog{position:relative;width:auto;margin:10px}.modal-content{position:relative;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #999;border:1px solid rgba(0,0,0,.2);border-radius:6px;outline:0;-webkit-box-shadow:0 3px 9px rgba(0,0,0,.5);box-shadow:0 3px 9px rgba(0,0,0,.5)}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;background-color:#000}.modal-backdrop.fade{filter:alpha(opacity=0);opacity:0}.modal-backdrop.in{filter:alpha(opacity=50);opacity:.5}.modal-header{min-height:16.43px;padding:15px;border-bottom:1px solid #e5e5e5}.modal-header .close{margin-top:-2px}.modal-title{margin:0;line-height:1.42857143}.modal-body{position:relative;padding:15px}.modal-footer{padding:15px;text-align:right;border-top:1px solid #e5e5e5}.modal-footer .btn+.btn{margin-bottom:0;margin-left:5px}.modal-footer .btn-group .btn+.btn{margin-left:-1px}.modal-footer .btn-block+.btn-block{margin-left:0}.modal-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}@media (min-width:768px){.modal-dialog{width:600px;margin:30px auto}.modal-content{-webkit-box-shadow:0 5px 15px rgba(0,0,0,.5);box-shadow:0 5px 15px rgba(0,0,0,.5)}.modal-sm{width:300px}}@media (min-width:992px){.modal-lg{width:900px}}.tooltip{position:absolute;z-index:1070;display:block;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:12px;font-style:normal;font-weight:400;line-height:1.42857143;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;word-wrap:normal;white-space:normal;filter:alpha(opacity=0);opacity:0;line-break:auto}.tooltip.in{filter:alpha(opacity=90);opacity:.9}.tooltip.top{padding:5px 0;margin-top:-3px}.tooltip.right{padding:0 5px;margin-left:3px}.tooltip.bottom{padding:5px 0;margin-top:3px}.tooltip.left{padding:0 5px;margin-left:-3px}.tooltip-inner{max-width:200px;padding:3px 8px;color:#fff;text-align:center;background-color:#000;border-radius:4px}.tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}.tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-left .tooltip-arrow{right:5px;bottom:0;margin-bottom:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-right .tooltip-arrow{bottom:0;left:5px;margin-bottom:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-width:5px 5px 5px 0;border-right-color:#000}.tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-width:5px 0 5px 5px;border-left-color:#000}.tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-left .tooltip-arrow{top:0;right:5px;margin-top:-5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-right .tooltip-arrow{top:0;left:5px;margin-top:-5px;border-width:0 5px 5px;border-bottom-color:#000}.popover{position:absolute;top:0;left:0;z-index:1060;display:none;max-width:276px;padding:1px;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;font-style:normal;font-weight:400;line-height:1.42857143;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;word-wrap:normal;white-space:normal;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.2);border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px rgba(0,0,0,.2);line-break:auto}.popover.top{margin-top:-10px}.popover.right{margin-left:10px}.popover.bottom{margin-top:10px}.popover.left{margin-left:-10px}.popover-title{padding:8px 14px;margin:0;font-size:14px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;border-radius:5px 5px 0 0}.popover-content{padding:9px 14px}.popover>.arrow,.popover>.arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.popover>.arrow{border-width:11px}.popover>.arrow:after{content:"";border-width:10px}.popover.top>.arrow{bottom:-11px;left:50%;margin-left:-11px;border-top-color:#999;border-top-color:rgba(0,0,0,.25);border-bottom-width:0}.popover.top>.arrow:after{bottom:1px;margin-left:-10px;content:" ";border-top-color:#fff;border-bottom-width:0}.popover.right>.arrow{top:50%;left:-11px;margin-top:-11px;border-right-color:#999;border-right-color:rgba(0,0,0,.25);border-left-width:0}.popover.right>.arrow:after{bottom:-10px;left:1px;content:" ";border-right-color:#fff;border-left-width:0}.popover.bottom>.arrow{top:-11px;left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#999;border-bottom-color:rgba(0,0,0,.25)}.popover.bottom>.arrow:after{top:1px;margin-left:-10px;content:" ";border-top-width:0;border-bottom-color:#fff}.popover.left>.arrow{top:50%;right:-11px;margin-top:-11px;border-right-width:0;border-left-color:#999;border-left-color:rgba(0,0,0,.25)}.popover.left>.arrow:after{right:1px;bottom:-10px;content:" ";border-right-width:0;border-left-color:#fff}.carousel{position:relative}.carousel-inner{position:relative;width:100%;overflow:hidden}.carousel-inner>.item{position:relative;display:none;-webkit-transition:.6s ease-in-out left;-o-transition:.6s ease-in-out left;transition:.6s ease-in-out left}.carousel-inner>.item>a>img,.carousel-inner>.item>img{line-height:1}@media all and (transform-3d),(-webkit-transform-3d){.carousel-inner>.item{-webkit-transition:-webkit-transform .6s ease-in-out;-o-transition:-o-transform .6s ease-in-out;transition:transform .6s ease-in-out;-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-perspective:1000px;perspective:1000px}.carousel-inner>.item.active.right,.carousel-inner>.item.next{left:0;-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0)}.carousel-inner>.item.active.left,.carousel-inner>.item.prev{left:0;-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0)}.carousel-inner>.item.active,.carousel-inner>.item.next.left,.carousel-inner>.item.prev.right{left:0;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}}.carousel-inner>.active,.carousel-inner>.next,.carousel-inner>.prev{display:block}.carousel-inner>.active{left:0}.carousel-inner>.next,.carousel-inner>.prev{position:absolute;top:0;width:100%}.carousel-inner>.next{left:100%}.carousel-inner>.prev{left:-100%}.carousel-inner>.next.left,.carousel-inner>.prev.right{left:0}.carousel-inner>.active.left{left:-100%}.carousel-inner>.active.right{left:100%}.carousel-control{position:absolute;top:0;bottom:0;left:0;width:15%;font-size:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.6);filter:alpha(opacity=50);opacity:.5}.carousel-control.left{background-image:-webkit-linear-gradient(left,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);background-image:-o-linear-gradient(left,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);background-image:-webkit-gradient(linear,left top,right top,from(rgba(0,0,0,.5)),to(rgba(0,0,0,.0001)));background-image:linear-gradient(to right,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1);background-repeat:repeat-x}.carousel-control.right{right:0;left:auto;background-image:-webkit-linear-gradient(left,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);background-image:-o-linear-gradient(left,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);background-image:-webkit-gradient(linear,left top,right top,from(rgba(0,0,0,.0001)),to(rgba(0,0,0,.5)));background-image:linear-gradient(to right,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1);background-repeat:repeat-x}.carousel-control:focus,.carousel-control:hover{color:#fff;text-decoration:none;filter:alpha(opacity=90);outline:0;opacity:.9}.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next,.carousel-control .icon-prev{position:absolute;top:50%;z-index:5;display:inline-block;margin-top:-10px}.carousel-control .glyphicon-chevron-left,.carousel-control .icon-prev{left:50%;margin-left:-10px}.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next{right:50%;margin-right:-10px}.carousel-control .icon-next,.carousel-control .icon-prev{width:20px;height:20px;font-family:serif;line-height:1}.carousel-control .icon-prev:before{content:'\2039'}.carousel-control .icon-next:before{content:'\203a'}.carousel-indicators{position:absolute;bottom:10px;left:50%;z-index:15;width:60%;padding-left:0;margin-left:-30%;text-align:center;list-style:none}.carousel-indicators li{display:inline-block;width:10px;height:10px;margin:1px;text-indent:-999px;cursor:pointer;background-color:#000\9;background-color:rgba(0,0,0,0);border:1px solid #fff;border-radius:10px}.carousel-indicators .active{width:12px;height:12px;margin:0;background-color:#fff}.carousel-caption{position:absolute;right:15%;bottom:20px;left:15%;z-index:10;padding-top:20px;padding-bottom:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.6)}.carousel-caption .btn{text-shadow:none}@media screen and (min-width:768px){.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next,.carousel-control .icon-prev{width:30px;height:30px;margin-top:-15px;font-size:30px}.carousel-control .glyphicon-chevron-left,.carousel-control .icon-prev{margin-left:-15px}.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next{margin-right:-15px}.carousel-caption{right:20%;left:20%;padding-bottom:30px}.carousel-indicators{bottom:20px}}.btn-group-vertical>.btn-group:after,.btn-group-vertical>.btn-group:before,.btn-toolbar:after,.btn-toolbar:before,.clearfix:after,.clearfix:before,.container-fluid:after,.container-fluid:before,.container:after,.container:before,.dl-horizontal dd:after,.dl-horizontal dd:before,.form-horizontal .form-group:after,.form-horizontal .form-group:before,.modal-footer:after,.modal-footer:before,.nav:after,.nav:before,.navbar-collapse:after,.navbar-collapse:before,.navbar-header:after,.navbar-header:before,.navbar:after,.navbar:before,.pager:after,.pager:before,.panel-body:after,.panel-body:before,.row:after,.row:before{display:table;content:" "}.btn-group-vertical>.btn-group:after,.btn-toolbar:after,.clearfix:after,.container-fluid:after,.container:after,.dl-horizontal dd:after,.form-horizontal .form-group:after,.modal-footer:after,.nav:after,.navbar-collapse:after,.navbar-header:after,.navbar:after,.pager:after,.panel-body:after,.row:after{clear:both}.center-block{display:block;margin-right:auto;margin-left:auto}.pull-right{float:right!important}.pull-left{float:left!important}.hide{display:none!important}.show{display:block!important}.invisible{visibility:hidden}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.hidden{display:none!important}.affix{position:fixed}@-ms-viewport{width:device-width}.visible-lg,.visible-md,.visible-sm,.visible-xs{display:none!important}.visible-lg-block,.visible-lg-inline,.visible-lg-inline-block,.visible-md-block,.visible-md-inline,.visible-md-inline-block,.visible-sm-block,.visible-sm-inline,.visible-sm-inline-block,.visible-xs-block,.visible-xs-inline,.visible-xs-inline-block{display:none!important}@media (max-width:767px){.visible-xs{display:block!important}table.visible-xs{display:table!important}tr.visible-xs{display:table-row!important}td.visible-xs,th.visible-xs{display:table-cell!important}}@media (max-width:767px){.visible-xs-block{display:block!important}}@media (max-width:767px){.visible-xs-inline{display:inline!important}}@media (max-width:767px){.visible-xs-inline-block{display:inline-block!important}}@media (min-width:768px) and (max-width:991px){.visible-sm{display:block!important}table.visible-sm{display:table!important}tr.visible-sm{display:table-row!important}td.visible-sm,th.visible-sm{display:table-cell!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-block{display:block!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-inline{display:inline!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-inline-block{display:inline-block!important}}@media (min-width:992px) and (max-width:1199px){.visible-md{display:block!important}table.visible-md{display:table!important}tr.visible-md{display:table-row!important}td.visible-md,th.visible-md{display:table-cell!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-block{display:block!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-inline{display:inline!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-inline-block{display:inline-block!important}}@media (min-width:1200px){.visible-lg{display:block!important}table.visible-lg{display:table!important}tr.visible-lg{display:table-row!important}td.visible-lg,th.visible-lg{display:table-cell!important}}@media (min-width:1200px){.visible-lg-block{display:block!important}}@media (min-width:1200px){.visible-lg-inline{display:inline!important}}@media (min-width:1200px){.visible-lg-inline-block{display:inline-block!important}}@media (max-width:767px){.hidden-xs{display:none!important}}@media (min-width:768px) and (max-width:991px){.hidden-sm{display:none!important}}@media (min-width:992px) and (max-width:1199px){.hidden-md{display:none!important}}@media (min-width:1200px){.hidden-lg{display:none!important}}.visible-print{display:none!important}@media print{.visible-print{display:block!important}table.visible-print{display:table!important}tr.visible-print{display:table-row!important}td.visible-print,th.visible-print{display:table-cell!important}}.visible-print-block{display:none!important}@media print{.visible-print-block{display:block!important}}.visible-print-inline{display:none!important}@media print{.visible-print-inline{display:inline!important}}.visible-print-inline-block{display:none!important}@media print{.visible-print-inline-block{display:inline-block!important}}@media print{.hidden-print{display:none!important}} \ No newline at end of file diff --git a/public/bootstrap/js/bootstrap.min.js b/public/bootstrap/js/bootstrap.min.js deleted file mode 100644 index 133aeecb98..0000000000 --- a/public/bootstrap/js/bootstrap.min.js +++ /dev/null @@ -1,7 +0,0 @@ -/*! - * Bootstrap v3.3.5 (http://getbootstrap.com) - * Copyright 2011-2015 Twitter, Inc. - * Licensed under the MIT license - */ -if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){"use strict";var b=a.fn.jquery.split(" ")[0].split(".");if(b[0]<2&&b[1]<9||1==b[0]&&9==b[1]&&b[2]<1)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher")}(jQuery),+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one("bsTransitionEnd",function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b(),a.support.transition&&(a.event.special.bsTransitionEnd={bindType:a.support.transition.end,delegateType:a.support.transition.end,handle:function(b){return a(b.target).is(this)?b.handleObj.handler.apply(this,arguments):void 0}})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var c=a(this),e=c.data("bs.alert");e||c.data("bs.alert",e=new d(this)),"string"==typeof b&&e[b].call(c)})}var c='[data-dismiss="alert"]',d=function(b){a(b).on("click",c,this.close)};d.VERSION="3.3.5",d.TRANSITION_DURATION=150,d.prototype.close=function(b){function c(){g.detach().trigger("closed.bs.alert").remove()}var e=a(this),f=e.attr("data-target");f||(f=e.attr("href"),f=f&&f.replace(/.*(?=#[^\s]*$)/,""));var g=a(f);b&&b.preventDefault(),g.length||(g=e.closest(".alert")),g.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(g.removeClass("in"),a.support.transition&&g.hasClass("fade")?g.one("bsTransitionEnd",c).emulateTransitionEnd(d.TRANSITION_DURATION):c())};var e=a.fn.alert;a.fn.alert=b,a.fn.alert.Constructor=d,a.fn.alert.noConflict=function(){return a.fn.alert=e,this},a(document).on("click.bs.alert.data-api",c,d.prototype.close)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof b&&b;e||d.data("bs.button",e=new c(this,f)),"toggle"==b?e.toggle():b&&e.setState(b)})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.isLoading=!1};c.VERSION="3.3.5",c.DEFAULTS={loadingText:"loading..."},c.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",null==f.resetText&&d.data("resetText",d[e]()),setTimeout(a.proxy(function(){d[e](null==f[b]?this.options[b]:f[b]),"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c))},this),0)},c.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")?(c.prop("checked")&&(a=!1),b.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==c.prop("type")&&(c.prop("checked")!==this.$element.hasClass("active")&&(a=!1),this.$element.toggleClass("active")),c.prop("checked",this.$element.hasClass("active")),a&&c.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var d=a.fn.button;a.fn.button=b,a.fn.button.Constructor=c,a.fn.button.noConflict=function(){return a.fn.button=d,this},a(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(c){var d=a(c.target);d.hasClass("btn")||(d=d.closest(".btn")),b.call(d,"toggle"),a(c.target).is('input[type="radio"]')||a(c.target).is('input[type="checkbox"]')||c.preventDefault()}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(b){a(b.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(b.type))})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b),g="string"==typeof b?b:f.slide;e||d.data("bs.carousel",e=new c(this,f)),"number"==typeof b?e.to(b):g?e[g]():f.interval&&e.pause().cycle()})}var c=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",a.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",a.proxy(this.pause,this)).on("mouseleave.bs.carousel",a.proxy(this.cycle,this))};c.VERSION="3.3.5",c.TRANSITION_DURATION=600,c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},c.prototype.keydown=function(a){if(!/input|textarea/i.test(a.target.tagName)){switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}a.preventDefault()}},c.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(a){return this.$items=a.parent().children(".item"),this.$items.index(a||this.$active)},c.prototype.getItemForDirection=function(a,b){var c=this.getItemIndex(b),d="prev"==a&&0===c||"next"==a&&c==this.$items.length-1;if(d&&!this.options.wrap)return b;var e="prev"==a?-1:1,f=(c+e)%this.$items.length;return this.$items.eq(f)},c.prototype.to=function(a){var b=this,c=this.getItemIndex(this.$active=this.$element.find(".item.active"));return a>this.$items.length-1||0>a?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){b.to(a)}):c==a?this.pause().cycle():this.slide(a>c?"next":"prev",this.$items.eq(a))},c.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){return this.sliding?void 0:this.slide("next")},c.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},c.prototype.slide=function(b,d){var e=this.$element.find(".item.active"),f=d||this.getItemForDirection(b,e),g=this.interval,h="next"==b?"left":"right",i=this;if(f.hasClass("active"))return this.sliding=!1;var j=f[0],k=a.Event("slide.bs.carousel",{relatedTarget:j,direction:h});if(this.$element.trigger(k),!k.isDefaultPrevented()){if(this.sliding=!0,g&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var l=a(this.$indicators.children()[this.getItemIndex(f)]);l&&l.addClass("active")}var m=a.Event("slid.bs.carousel",{relatedTarget:j,direction:h});return a.support.transition&&this.$element.hasClass("slide")?(f.addClass(b),f[0].offsetWidth,e.addClass(h),f.addClass(h),e.one("bsTransitionEnd",function(){f.removeClass([b,h].join(" ")).addClass("active"),e.removeClass(["active",h].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger(m)},0)}).emulateTransitionEnd(c.TRANSITION_DURATION)):(e.removeClass("active"),f.addClass("active"),this.sliding=!1,this.$element.trigger(m)),g&&this.cycle(),this}};var d=a.fn.carousel;a.fn.carousel=b,a.fn.carousel.Constructor=c,a.fn.carousel.noConflict=function(){return a.fn.carousel=d,this};var e=function(c){var d,e=a(this),f=a(e.attr("data-target")||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""));if(f.hasClass("carousel")){var g=a.extend({},f.data(),e.data()),h=e.attr("data-slide-to");h&&(g.interval=!1),b.call(f,g),h&&f.data("bs.carousel").to(h),c.preventDefault()}};a(document).on("click.bs.carousel.data-api","[data-slide]",e).on("click.bs.carousel.data-api","[data-slide-to]",e),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var c=a(this);b.call(c,c.data())})})}(jQuery),+function(a){"use strict";function b(b){var c,d=b.attr("data-target")||(c=b.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"");return a(d)}function c(b){return this.each(function(){var c=a(this),e=c.data("bs.collapse"),f=a.extend({},d.DEFAULTS,c.data(),"object"==typeof b&&b);!e&&f.toggle&&/show|hide/.test(b)&&(f.toggle=!1),e||c.data("bs.collapse",e=new d(this,f)),"string"==typeof b&&e[b]()})}var d=function(b,c){this.$element=a(b),this.options=a.extend({},d.DEFAULTS,c),this.$trigger=a('[data-toggle="collapse"][href="#'+b.id+'"],[data-toggle="collapse"][data-target="#'+b.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};d.VERSION="3.3.5",d.TRANSITION_DURATION=350,d.DEFAULTS={toggle:!0},d.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},d.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b,e=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(e&&e.length&&(b=e.data("bs.collapse"),b&&b.transitioning))){var f=a.Event("show.bs.collapse");if(this.$element.trigger(f),!f.isDefaultPrevented()){e&&e.length&&(c.call(e,"hide"),b||e.data("bs.collapse",null));var g=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[g](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var h=function(){this.$element.removeClass("collapsing").addClass("collapse in")[g](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return h.call(this);var i=a.camelCase(["scroll",g].join("-"));this.$element.one("bsTransitionEnd",a.proxy(h,this)).emulateTransitionEnd(d.TRANSITION_DURATION)[g](this.$element[0][i])}}}},d.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var e=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return a.support.transition?void this.$element[c](0).one("bsTransitionEnd",a.proxy(e,this)).emulateTransitionEnd(d.TRANSITION_DURATION):e.call(this)}}},d.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},d.prototype.getParent=function(){return a(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(a.proxy(function(c,d){var e=a(d);this.addAriaAndCollapsedClass(b(e),e)},this)).end()},d.prototype.addAriaAndCollapsedClass=function(a,b){var c=a.hasClass("in");a.attr("aria-expanded",c),b.toggleClass("collapsed",!c).attr("aria-expanded",c)};var e=a.fn.collapse;a.fn.collapse=c,a.fn.collapse.Constructor=d,a.fn.collapse.noConflict=function(){return a.fn.collapse=e,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(d){var e=a(this);e.attr("data-target")||d.preventDefault();var f=b(e),g=f.data("bs.collapse"),h=g?"toggle":e.data();c.call(f,h)})}(jQuery),+function(a){"use strict";function b(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}function c(c){c&&3===c.which||(a(e).remove(),a(f).each(function(){var d=a(this),e=b(d),f={relatedTarget:this};e.hasClass("open")&&(c&&"click"==c.type&&/input|textarea/i.test(c.target.tagName)&&a.contains(e[0],c.target)||(e.trigger(c=a.Event("hide.bs.dropdown",f)),c.isDefaultPrevented()||(d.attr("aria-expanded","false"),e.removeClass("open").trigger("hidden.bs.dropdown",f))))}))}function d(b){return this.each(function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new g(this)),"string"==typeof b&&d[b].call(c)})}var e=".dropdown-backdrop",f='[data-toggle="dropdown"]',g=function(b){a(b).on("click.bs.dropdown",this.toggle)};g.VERSION="3.3.5",g.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=b(e),g=f.hasClass("open");if(c(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(a(this)).on("click",c);var h={relatedTarget:this};if(f.trigger(d=a.Event("show.bs.dropdown",h)),d.isDefaultPrevented())return;e.trigger("focus").attr("aria-expanded","true"),f.toggleClass("open").trigger("shown.bs.dropdown",h)}return!1}},g.prototype.keydown=function(c){if(/(38|40|27|32)/.test(c.which)&&!/input|textarea/i.test(c.target.tagName)){var d=a(this);if(c.preventDefault(),c.stopPropagation(),!d.is(".disabled, :disabled")){var e=b(d),g=e.hasClass("open");if(!g&&27!=c.which||g&&27==c.which)return 27==c.which&&e.find(f).trigger("focus"),d.trigger("click");var h=" li:not(.disabled):visible a",i=e.find(".dropdown-menu"+h);if(i.length){var j=i.index(c.target);38==c.which&&j>0&&j--,40==c.which&&j| {{ 'csv_column_name'|_ }} | -{{ 'csv_column_example'|_ }} | -{{ 'csv_column_role'|_ }} | -{{ 'csv_do_map_value'|_ }} | +
|---|---|---|---|
| {{ 'csv_column_name'|_ }} | +{{ 'csv_column_example'|_ }} | +{{ 'csv_column_role'|_ }} | +{{ 'csv_do_map_value'|_ }} | +
| {{ 'csv_field_value'|_ }} | -{{ 'csv_field_mapped_to'|_ }} | +
|---|---|
| {{ 'csv_field_value'|_ }} | +{{ 'csv_field_mapped_to'|_ }} | +