close #2543 Fixed: remove not equal report basis and financial year option. ( #363b0t5 )
This commit is contained in:
@@ -132,9 +132,6 @@ abstract class Report
|
||||
$input = request('search');
|
||||
|
||||
// Remove year as it's handled based on financial start
|
||||
$search_not_year = 'not year:' . $this->getSearchStringValue('year', '', $input);
|
||||
$input = str_replace($search_not_year, '', $input);
|
||||
|
||||
$search_year = 'year:' . $this->getSearchStringValue('year', '', $input);
|
||||
$input = str_replace($search_year, '', $input);
|
||||
|
||||
|
||||
@@ -30,5 +30,10 @@ class AddBasis extends Listener
|
||||
$event->class->filters['basis'] = $this->getBasis();
|
||||
$event->class->filters['keys']['basis'] = 'basis';
|
||||
$event->class->filters['defaults']['basis'] = $event->class->getSetting('basis', 'accrual');
|
||||
$event->class->filters['operators']['basis'] = [
|
||||
'equal' => true,
|
||||
'not_equal' => false,
|
||||
'rande' => false,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,6 @@ namespace App\Traits;
|
||||
use App\Traits\SearchString;
|
||||
use Carbon\CarbonPeriod;
|
||||
use Date;
|
||||
use Lorisleiva\LaravelSearchString\SearchStringManager;
|
||||
|
||||
trait DateTime
|
||||
{
|
||||
@@ -56,31 +55,7 @@ trait DateTime
|
||||
$end = $financial_start->addYear(1)->subDays(1)->endOfDay()->format('Y-m-d H:i:s');
|
||||
}
|
||||
|
||||
// Looking year or not year
|
||||
$query_type = 'whereBetween';
|
||||
|
||||
if (request('search')) {
|
||||
$search_string_manager = new SearchStringManager($query->getModel());
|
||||
$parse = $search_string_manager->parse(request('search'));
|
||||
|
||||
if (! empty($parse->expressions)) {
|
||||
foreach ($parse->expressions as $filter) {
|
||||
if (! $filter instanceof \Lorisleiva\LaravelSearchString\AST\NotSymbol) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($filter->expression->key != 'year') {
|
||||
continue;
|
||||
}
|
||||
|
||||
$query_type = 'whereNotBetween';
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $query->{$query_type}($field, [$start, $end]);
|
||||
return $query->whereBetween($field, [$start, $end]);
|
||||
}
|
||||
|
||||
public function getTimezones()
|
||||
|
||||
Reference in New Issue
Block a user