mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Expand search with external ID searches.
This commit is contained in:
@@ -930,6 +930,18 @@ trait MetaCollection
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function withExternalId(): GroupCollectorInterface
|
||||
{
|
||||
$this->joinMetaDataTables();
|
||||
$this->query->where('journal_meta.name', '=', 'external_id');
|
||||
$this->query->whereNotNull('journal_meta.data');
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Limit results to a transactions without a bill.
|
||||
*
|
||||
@@ -988,6 +1000,26 @@ trait MetaCollection
|
||||
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function withoutExternalId(): GroupCollectorInterface
|
||||
{
|
||||
$this->joinMetaDataTables();
|
||||
// TODO not sure if this will work properly.
|
||||
$this->query->where(function (Builder $q1) {
|
||||
$q1->where(function (Builder $q2) {
|
||||
$q2->where('journal_meta.name', '=', 'external_id');
|
||||
$q2->whereNull('journal_meta.data');
|
||||
})->orWhere(function (Builder $q3) {
|
||||
$q3->where('journal_meta.name', '!=', 'external_id');
|
||||
})->orWhere(function (Builder $q4) {
|
||||
$q4->whereNull('journal_meta.name');
|
||||
});
|
||||
});
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return GroupCollectorInterface
|
||||
|
@@ -1306,12 +1306,19 @@ interface GroupCollectorInterface
|
||||
public function withCategoryInformation(): GroupCollectorInterface;
|
||||
|
||||
/**
|
||||
* Transactions with an external URL
|
||||
* Transactions with any external URL
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function withExternalUrl(): GroupCollectorInterface;
|
||||
|
||||
/**
|
||||
* Transactions with any external ID
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function withExternalId(): GroupCollectorInterface;
|
||||
|
||||
/**
|
||||
* Transaction must have meta date field X.
|
||||
*
|
||||
@@ -1362,6 +1369,13 @@ interface GroupCollectorInterface
|
||||
*/
|
||||
public function withoutExternalUrl(): GroupCollectorInterface;
|
||||
|
||||
/**
|
||||
* Transactions without an external ID
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function withoutExternalId(): GroupCollectorInterface;
|
||||
|
||||
/**
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
|
Reference in New Issue
Block a user