mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Various code cleanup.
This commit is contained in:
parent
be868d37f2
commit
61d58a354e
@ -162,6 +162,30 @@ class JournalFormRequest extends Request
|
|||||||
{
|
{
|
||||||
$string = $this->get($field) ?? '';
|
$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);
|
return trim($string);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -108,9 +108,6 @@ class AccountTasker implements AccountTaskerInterface
|
|||||||
*/
|
*/
|
||||||
public function getAccountReport(Collection $accounts, Carbon $start, Carbon $end): array
|
public function getAccountReport(Collection $accounts, Carbon $start, Carbon $end): array
|
||||||
{
|
{
|
||||||
$startAmount = '0';
|
|
||||||
$endAmount = '0';
|
|
||||||
$diff = '0';
|
|
||||||
$ids = $accounts->pluck('id')->toArray();
|
$ids = $accounts->pluck('id')->toArray();
|
||||||
$yesterday = clone $start;
|
$yesterday = clone $start;
|
||||||
$yesterday->subDay();
|
$yesterday->subDay();
|
||||||
@ -153,10 +150,6 @@ class AccountTasker implements AccountTaskerInterface
|
|||||||
$return['accounts'][$id] = $entry;
|
$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['difference'] = bcsub($return['end'], $return['start']);
|
||||||
|
|
||||||
return $return;
|
return $return;
|
||||||
|
@ -13,7 +13,6 @@ $(document).ready(function () {
|
|||||||
|
|
||||||
// destination account names:
|
// destination account names:
|
||||||
if ($('input[name^="destination_account_name["]').length > 0) {
|
if ($('input[name^="destination_account_name["]').length > 0) {
|
||||||
console.log('multi dest account');
|
|
||||||
$.getJSON('json/expense-accounts').done(function (data) {
|
$.getJSON('json/expense-accounts').done(function (data) {
|
||||||
$('input[name^="destination_account_name["]').typeahead({source: data});
|
$('input[name^="destination_account_name["]').typeahead({source: data});
|
||||||
});
|
});
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
* See the LICENSE file for details.
|
* 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 () {
|
$(document).ready(function () {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* See the LICENSE file for details.
|
* See the LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/** global: what */
|
/** global: what, Modernizr */
|
||||||
|
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
2
test.sh
2
test.sh
@ -70,7 +70,7 @@ then
|
|||||||
php artisan migrate:refresh --seed
|
php artisan migrate:refresh --seed
|
||||||
|
|
||||||
# call test data generation script
|
# 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)
|
# copy new database over backup (resets backup)
|
||||||
cp $DATABASE $DATABASECOPY
|
cp $DATABASE $DATABASECOPY
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user