Expand test coverage and improve transaction management code.

This commit is contained in:
James Cole
2019-07-01 20:22:35 +02:00
parent 94acb50a6f
commit 5bbe1eab7c
63 changed files with 1251 additions and 812 deletions

View File

@@ -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) {