mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-01-10 12:24:50 +00:00
Expand test coverage and improve transaction management code.
This commit is contained in:
@@ -70,8 +70,15 @@ final class CurrencyIs extends AbstractTrigger implements TriggerInterface
|
||||
{
|
||||
/** @var CurrencyRepositoryInterface $repository */
|
||||
$repository = app(CurrencyRepositoryInterface::class);
|
||||
$currency = $repository->findByNameNull($this->triggerValue);
|
||||
$hit = true;
|
||||
|
||||
// if currency name contains " ("
|
||||
if (0 === strpos($this->triggerValue, ' (')) {
|
||||
$parts = explode(' (', $this->triggerValue);
|
||||
$this->triggerValue = $parts[0];
|
||||
}
|
||||
|
||||
$currency = $repository->findByNameNull($this->triggerValue);
|
||||
$hit = true;
|
||||
if (null !== $currency) {
|
||||
/** @var Transaction $transaction */
|
||||
foreach ($journal->transactions as $transaction) {
|
||||
|
||||
Reference in New Issue
Block a user