Merge branch 'develop' of github.com:firefly-iii/firefly-iii into develop

This commit is contained in:
James Cole 2022-01-26 18:43:24 +01:00
commit bad57c907c
6 changed files with 65 additions and 0 deletions

View File

@ -212,6 +212,40 @@ trait MetaCollection
return $this; return $this;
} }
/**
* @inheritDoc
*/
public function withoutExternalUrl(): GroupCollectorInterface
{
if (false === $this->hasJoinedMetaTables) {
$this->hasJoinedMetaTables = true;
$this->query->leftJoin('journal_meta', 'transaction_journals.id', '=', 'journal_meta.transaction_journal_id');
}
$this->query->where(function(Builder $q1) {
$q1->where(function(Builder $q2) {
$q2->where('journal_meta.name', '=', 'external_url');
$q2->whereNull('journal_meta.data');
})->orWhereNull('journal_meta.name');
});
return $this;
}
/**
* @inheritDoc
*/
public function withExternalUrl(): GroupCollectorInterface
{
if (false === $this->hasJoinedMetaTables) {
$this->hasJoinedMetaTables = true;
$this->query->leftJoin('journal_meta', 'transaction_journals.id', '=', 'journal_meta.transaction_journal_id');
}
$this->query->where('journal_meta.name', '=', 'external_url');
$this->query->whereNotNull('journal_meta.data');
return $this;
}
/** /**
* @inheritDoc * @inheritDoc
*/ */

View File

@ -305,6 +305,20 @@ interface GroupCollectorInterface
*/ */
public function setExternalId(string $externalId): GroupCollectorInterface; public function setExternalId(string $externalId): GroupCollectorInterface;
/**
* Transactions without an external URL
*
* @return GroupCollectorInterface
*/
public function withoutExternalUrl(): GroupCollectorInterface;
/**
* Transactions with an external URL
*
* @return GroupCollectorInterface
*/
public function withExternalUrl(): GroupCollectorInterface;
/** /**
* Limit results to a specific foreign currency. * Limit results to a specific foreign currency.
* *

View File

@ -627,6 +627,15 @@ class OperatorQuerySearch implements SearchInterface
$this->collector->setUpdatedAt($updatedAt); $this->collector->setUpdatedAt($updatedAt);
break; break;
// //
// external URL
//
case 'no_external_url':
$this->collector->withoutExternalUrl();
break;
case 'any_external_url':
$this->collector->withExternalUrl();
break;
//
// other fields // other fields
// //
case 'external_id': case 'external_id':

View File

@ -518,6 +518,8 @@ return [
'notes_are' => ['alias' => false, 'needs_context' => true,], 'notes_are' => ['alias' => false, 'needs_context' => true,],
'no_notes' => ['alias' => false, 'needs_context' => false,], 'no_notes' => ['alias' => false, 'needs_context' => false,],
'any_notes' => ['alias' => false, 'needs_context' => false,], 'any_notes' => ['alias' => false, 'needs_context' => false,],
'no_external_url' => ['alias' => false, 'needs_context' => false,],
'any_external_url' => ['alias' => false, 'needs_context' => false,],
// one exact (or array of) journals: // one exact (or array of) journals:
'id' => ['alias' => false, 'trigger_class' => null, 'needs_context' => true,], 'id' => ['alias' => false, 'trigger_class' => null, 'needs_context' => true,],

View File

@ -348,6 +348,8 @@ function updateTriggerInput(selectList) {
case 'source_is_cash': case 'source_is_cash':
case 'destination_is_cash': case 'destination_is_cash':
case 'account_is_cash': case 'account_is_cash':
case 'no_external_url':
case 'any_external_url':
console.log('Select list value is ' + selectList.val() + ', so input needs to be disabled.'); console.log('Select list value is ' + selectList.val() + ', so input needs to be disabled.');
inputResult.prop('disabled', true); inputResult.prop('disabled', true);
inputResult.typeahead('destroy'); inputResult.typeahead('destroy');

View File

@ -291,6 +291,8 @@ return [
'search_modifier_created_on' => 'Transaction was created on ":value"', 'search_modifier_created_on' => 'Transaction was created on ":value"',
'search_modifier_updated_on' => 'Transaction was last updated on ":value"', 'search_modifier_updated_on' => 'Transaction was last updated on ":value"',
'search_modifier_external_id' => 'External ID is ":value"', 'search_modifier_external_id' => 'External ID is ":value"',
'search_modifier_no_external_url' => 'The transaction has no external URL',
'search_modifier_any_external_url' => 'The transaction must have a (any) external URL',
'search_modifier_internal_reference' => 'Internal reference is ":value"', 'search_modifier_internal_reference' => 'Internal reference is ":value"',
'search_modifier_description_starts' => 'Description is ":value"', 'search_modifier_description_starts' => 'Description is ":value"',
'search_modifier_description_ends' => 'Description ends with ":value"', 'search_modifier_description_ends' => 'Description ends with ":value"',
@ -562,6 +564,8 @@ return [
'rule_trigger_internal_reference' => 'Internal reference is ":trigger_value"', 'rule_trigger_internal_reference' => 'Internal reference is ":trigger_value"',
'rule_trigger_journal_id_choice' => 'Transaction journal ID is..', 'rule_trigger_journal_id_choice' => 'Transaction journal ID is..',
'rule_trigger_journal_id' => 'Transaction journal ID is ":trigger_value"', 'rule_trigger_journal_id' => 'Transaction journal ID is ":trigger_value"',
'rule_trigger_no_external_url' => 'Transaction has no external URL',
'rule_trigger_any_external_url' => 'Transaction has an external URL',
// actions // actions
'rule_action_delete_transaction_choice' => 'DELETE transaction (!)', 'rule_action_delete_transaction_choice' => 'DELETE transaction (!)',