This commit is contained in:
James Cole 2019-09-13 17:17:57 +02:00
parent 793af1991c
commit cbde7037ab
No known key found for this signature in database
GPG Key ID: C16961E655E74B5E
2 changed files with 4 additions and 2 deletions

View File

@ -140,7 +140,9 @@ class CurrencyController extends Controller
}
if ($this->repository->currencyInUse($currency)) {
$request->session()->flash('error', (string)trans('firefly.cannot_delete_currency', ['name' => e($currency->name)]));
$location = $this->repository->currencyInUseAt($currency);
$message = (string)trans(sprintf('firefly.cannot_disable_currency_%s', $location), ['name' => e($currency->name)]);
$request->session()->flash('error', $message);
Log::channel('audit')->info(sprintf('Tried to visit page to delete currency %s but currency is in use.', $currency->code));
return redirect(route('currencies.index'));

View File

@ -50,7 +50,7 @@ class CurrencyDestroyService
{
try {
$currency->forceDelete();
$currency->delete();
} catch (Exception $e) { // @codeCoverageIgnore
Log::error(sprintf('Could not delete transaction currency: %s', $e->getMessage())); // @codeCoverageIgnore
}