Firefly III: a personal finances manager
PHP accountingbudgetbudgetingbudgetscash-flowcashflowcredit-carddockerexpensesfinancefinancesfinanciallinuxmoneypaycheckpersonal-financephpphp7
Various code cleanup.
James Cole61d58a354e15
diff --git a/app/Http/Requests/JournalFormRequest.php b/app/Http/Requests/JournalFormRequest.phpindex 2ecc96af87..bde5f20166 100644--- a/app/Http/Requests/JournalFormRequest.php+++ b/app/Http/Requests/JournalFormRequest.php@@ -162,6 +162,30 @@ class JournalFormRequest extends Request{$string = $this->get($field) ?? '';+ $search = [+ "\xa0", // non-breaking space+ "\u{1680}", // OGHAM SPACE MARK+ "\u{180E}", // MONGOLIAN VOWEL SEPARATOR+ "\u{2000}", // EN QUAD+ "\u{2001}", // EM QUAD+ "\u{2002}", //EN SPACE+ "\u{2003}", //EM SPACE+ "\u{2004}", //THREE-PER-EM SPACE+ "\u{2005}", //FOUR-PER-EM SPACE+ "\u{2006}", //SIX-PER-EM SPACE+ "\u{2007}", //FIGURE SPACE+ "\u{2008}", //PUNCTUATION SPACE+ "\u{2009}", //THIN SPACE+ "\u{200A}", //HAIR SPACE+ "\u{200B}", //ZERO WIDTH SPACE+ "\u{202F}", //NARROW NO-BREAK SPACE+ "\u{205F}", //MEDIUM MATHEMATICAL SPACE+ "\u{3000}", //IDEOGRAPHIC SPACE+ "\u{FEFF}", // ZERO WIDTH NO -BREAK SPACE+ ];+ $replace = "\x20"; // plain old normal space+ $string = str_replace($search, $replace, $string);+return trim($string);}}diff --git a/app/Repositories/Account/AccountTasker.php b/app/Repositories/Account/AccountTasker.phpindex d1300e6f1c..126d084e8d 100644--- a/app/Repositories/Account/AccountTasker.php+++ b/app/Repositories/Account/AccountTasker.php@@ -108,9 +108,6 @@ class AccountTasker implements AccountTaskerInterface*/public function getAccountReport(Collection $accounts, Carbon $start, Carbon $end): array{- $startAmount = '0';- $endAmount = '0';- $diff = '0';$ids = $accounts->pluck('id')->toArray();$yesterday = clone $start;$yesterday->subDay();@@ -153,10 +150,6 @@ class AccountTasker implements AccountTaskerInterface$return['accounts'][$id] = $entry;}- foreach ($accounts as $account) {- $id = $account->id;- $diff = bcadd($diff, bcsub($return['accounts'][$id]['end_balance'], $return['accounts'][$id]['start_balance']));- }$return['difference'] = bcsub($return['end'], $return['start']);return $return;diff --git a/public/js/ff/transactions/mass/edit.js b/public/js/ff/transactions/mass/edit.jsindex 436cf88a67..0c2ec4a3ba 100644--- a/public/js/ff/transactions/mass/edit.js+++ b/public/js/ff/transactions/mass/edit.js@@ -13,7 +13,6 @@ $(document).ready(function () {// destination account names:if ($('input[name^="destination_account_name["]').length > 0) {- console.log('multi dest account');$.getJSON('json/expense-accounts').done(function (data) {$('input[name^="destination_account_name["]').typeahead({source: data});});diff --git a/public/js/ff/transactions/single/create.js b/public/js/ff/transactions/single/create.jsindex 0a9ce44fe7..7a38946984 100644--- a/public/js/ff/transactions/single/create.js+++ b/public/js/ff/transactions/single/create.js@@ -6,7 +6,7 @@* See the LICENSE file for details.*/-/** global: what, title, breadcrumbs, middleCrumbName, button, piggiesLength, txt, doSwitch, middleCrumbUrl */+/** global: what,Modernizr, title, breadcrumbs, middleCrumbName, button, piggiesLength, txt, doSwitch, middleCrumbUrl */$(document).ready(function () {"use strict";diff --git a/public/js/ff/transactions/single/edit.js b/public/js/ff/transactions/single/edit.jsindex b141df5335..a025212d43 100644--- a/public/js/ff/transactions/single/edit.js+++ b/public/js/ff/transactions/single/edit.js@@ -8,7 +8,7 @@* See the LICENSE file for details.*/-/** global: what */+/** global: what, Modernizr */$(document).ready(function () {"use strict";diff --git a/test.sh b/test.shindex 3c06c5acec..a88423359e 100755--- a/test.sh+++ b/test.sh@@ -70,7 +70,7 @@ thenphp artisan migrate:refresh --seed# call test data generation script- $(which php) /sites/FF3/test-data/artisan generate:data testing sqlite+ $(which php) /sites/FF3/test-data/artisan generate:data local sqlite# copy new database over backup (resets backup)cp $DATABASE $DATABASECOPYfi