mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-01-06 06:01:21 +00:00
Expand search with negated search options
This commit is contained in:
@@ -51,6 +51,20 @@ trait AmountCollection
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function amountIsNot(string $amount): GroupCollectorInterface
|
||||
{
|
||||
$this->query->where(
|
||||
static function (EloquentBuilder $q) use ($amount) {
|
||||
$q->where('source.amount','!=', app('steam')->negative($amount));
|
||||
}
|
||||
);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get transactions where the amount is less than.
|
||||
*
|
||||
@@ -106,6 +120,25 @@ trait AmountCollection
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get transactions with a specific foreign amount.
|
||||
*
|
||||
* @param string $amount
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function foreignAmountIsNot(string $amount): GroupCollectorInterface
|
||||
{
|
||||
$this->query->where(
|
||||
static function (EloquentBuilder $q) use ($amount) {
|
||||
$q->whereNull('source.foreign_amount');
|
||||
$q->orWhere('source.foreign_amount','!=', app('steam')->negative($amount));
|
||||
}
|
||||
);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get transactions where the amount is less than.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user