mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2024-12-28 01:41:14 -06:00
Fix #2589
This commit is contained in:
parent
ec43c9999a
commit
f49ef1622e
@ -1162,4 +1162,40 @@ class GroupCollector implements GroupCollectorInterface
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Collect transactions created on a specific date.
|
||||
*
|
||||
* @param Carbon $date
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function setCreatedAt(Carbon $date): GroupCollectorInterface
|
||||
{
|
||||
$after = $date->format('Y-m-d 00:00:00');
|
||||
$before = $date->format('Y-m-d 23:59:59');
|
||||
$this->query->where('transaction_journals.created_at', '>=', $after);
|
||||
$this->query->where('transaction_journals.created_at', '<=', $before);
|
||||
Log::debug(sprintf('GroupCollector created_at is now after %s (inclusive)', $after));
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Collect transactions updated on a specific date.
|
||||
*
|
||||
* @param Carbon $date
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function setUpdatedAt(Carbon $date): GroupCollectorInterface
|
||||
{
|
||||
$after = $date->format('Y-m-d 00:00:00');
|
||||
$before = $date->format('Y-m-d 23:59:59');
|
||||
$this->query->where('transaction_journals.updated_at', '>=', $after);
|
||||
$this->query->where('transaction_journals.updated_at', '<=', $before);
|
||||
Log::debug(sprintf('GroupCollector created_at is now after %s (inclusive)', $after));
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
@ -139,6 +139,24 @@ interface GroupCollectorInterface
|
||||
*/
|
||||
public function setAfter(Carbon $date): GroupCollectorInterface;
|
||||
|
||||
/**
|
||||
* Collect transactions created on a specific date.
|
||||
*
|
||||
* @param Carbon $date
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function setCreatedAt(Carbon $date): GroupCollectorInterface;
|
||||
|
||||
/**
|
||||
* Collect transactions updated on a specific date.
|
||||
*
|
||||
* @param Carbon $date
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function setUpdatedAt(Carbon $date): GroupCollectorInterface;
|
||||
|
||||
/**
|
||||
* Collect transactions before a specific date.
|
||||
*
|
||||
|
@ -288,6 +288,16 @@ class Search implements SearchInterface
|
||||
$after = new Carbon($modifier['value']);
|
||||
$collector->setAfter($after);
|
||||
break;
|
||||
case 'created_at':
|
||||
Log::debug(sprintf('Set "%s" using collector with value "%s"', $modifier['type'], $modifier['value']));
|
||||
$createdAt = new Carbon($modifier['value']);
|
||||
$collector->setCreatedAt($createdAt);
|
||||
break;
|
||||
case 'updated_at':
|
||||
Log::debug(sprintf('Set "%s" using collector with value "%s"', $modifier['type'], $modifier['value']));
|
||||
$updatedAt = new Carbon($modifier['value']);
|
||||
$collector->setUpdatedAt($updatedAt);
|
||||
break;
|
||||
}
|
||||
}
|
||||
$collector->setAccounts($totalAccounts);
|
||||
|
@ -519,7 +519,8 @@ return [
|
||||
'default_currency' => 'EUR',
|
||||
'default_language' => 'en_US',
|
||||
'search_modifiers' => ['amount_is', 'amount', 'amount_max', 'amount_min', 'amount_less', 'amount_more', 'source', 'destination', 'category',
|
||||
'budget', 'bill', 'type', 'date', 'date_before', 'date_after', 'on', 'before', 'after','from','to','tag'],
|
||||
'budget', 'bill', 'type', 'date', 'date_before', 'date_after', 'on', 'before', 'after', 'from', 'to', 'tag', 'created_at',
|
||||
'updated_at'],
|
||||
// TODO notes has_attachments
|
||||
|
||||
'cer_providers' => [
|
||||
|
@ -253,6 +253,8 @@ return [
|
||||
'search_modifier_on' => 'Transaction date is :value',
|
||||
'search_modifier_before' => 'Transaction date is before :value',
|
||||
'search_modifier_after' => 'Transaction date is after :value',
|
||||
'search_modifier_created_at' => 'Transaction was created on :value',
|
||||
'search_modifier_updated_at' => 'Transaction was last updated on :value',
|
||||
'modifiers_applies_are' => 'The following modifiers are applied to the search as well:',
|
||||
'general_search_error' => 'An error occured while searching. Please check the log files for more information.',
|
||||
'search_box' => 'Search',
|
||||
|
Loading…
Reference in New Issue
Block a user