mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-19 02:45:58 +00:00
Fix comma parsing when users search for amount:12,34
This commit is contained in:
@@ -498,17 +498,27 @@ class OperatorQuerySearch implements SearchInterface
|
|||||||
// amount
|
// amount
|
||||||
//
|
//
|
||||||
case 'amount_exactly':
|
case 'amount_exactly':
|
||||||
$amount = app('steam')->positive((string)$value);
|
|
||||||
|
// strip comma's, make dots.
|
||||||
|
$value = str_replace(',', '.', (string)$value);
|
||||||
|
|
||||||
|
$amount = app('steam')->positive($value);
|
||||||
Log::debug(sprintf('Set "%s" using collector with value "%s"', $operator, $amount));
|
Log::debug(sprintf('Set "%s" using collector with value "%s"', $operator, $amount));
|
||||||
$this->collector->amountIs($amount);
|
$this->collector->amountIs($amount);
|
||||||
break;
|
break;
|
||||||
case 'amount_less':
|
case 'amount_less':
|
||||||
$amount = app('steam')->positive((string)$value);
|
// strip comma's, make dots.
|
||||||
|
$value = str_replace(',', '.', (string)$value);
|
||||||
|
|
||||||
|
$amount = app('steam')->positive($value);
|
||||||
Log::debug(sprintf('Set "%s" using collector with value "%s"', $operator, $amount));
|
Log::debug(sprintf('Set "%s" using collector with value "%s"', $operator, $amount));
|
||||||
$this->collector->amountLess($amount);
|
$this->collector->amountLess($amount);
|
||||||
break;
|
break;
|
||||||
case 'amount_more':
|
case 'amount_more':
|
||||||
$amount = app('steam')->positive((string)$value);
|
// strip comma's, make dots.
|
||||||
|
$value = str_replace(',', '.', (string)$value);
|
||||||
|
|
||||||
|
$amount = app('steam')->positive($value);
|
||||||
Log::debug(sprintf('Set "%s" using collector with value "%s"', $operator, $amount));
|
Log::debug(sprintf('Set "%s" using collector with value "%s"', $operator, $amount));
|
||||||
$this->collector->amountMore($amount);
|
$this->collector->amountMore($amount);
|
||||||
break;
|
break;
|
||||||
|
Reference in New Issue
Block a user