mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2024-11-27 11:20:39 -06:00
Add thing to apply rules to fints #2081
This commit is contained in:
parent
58e55dc789
commit
2117fc2a5a
@ -82,8 +82,8 @@ class FinTS
|
||||
return $account->getAccountNumber() === $accountNumber;
|
||||
}
|
||||
);
|
||||
if (count($filteredAccounts) != 1) {
|
||||
throw new FireflyException("Cannot find account with number " . $accountNumber);
|
||||
if (1 !== count($filteredAccounts)) {
|
||||
throw new FireflyException(sprintf('Cannot find account with number "%s"', $accountNumber));
|
||||
}
|
||||
|
||||
return reset($filteredAccounts);
|
||||
|
@ -59,17 +59,19 @@ class NewFinTSJobHandler implements FinTSConfigurationInterface
|
||||
$config['fints_bank_code'] = (string)($data['fints_bank_code'] ?? '');
|
||||
$config['fints_username'] = (string)($data['fints_username'] ?? '');
|
||||
$config['fints_password'] = (string)(Crypt::encrypt($data['fints_password']) ?? '');
|
||||
$config['apply-rules'] = 1 === (int)$data['apply_rules'];
|
||||
|
||||
$this->repository->setConfiguration($this->importJob, $config);
|
||||
|
||||
|
||||
$incomplete = false;
|
||||
foreach ($config as $value) {
|
||||
$incomplete = '' === $value or $incomplete;
|
||||
}
|
||||
|
||||
if ($incomplete) {
|
||||
return new MessageBag([trans('import.incomplete_fints_form')]);
|
||||
}
|
||||
|
||||
$finTS = app(FinTS::class, ['config' => $this->importJob->configuration]);
|
||||
if (true !== ($checkConnection = $finTS->checkConnection())) {
|
||||
return new MessageBag([trans('import.fints_connection_failed', ['originalError' => $checkConnection])]);
|
||||
|
@ -20,6 +20,7 @@
|
||||
{{ ExpandedForm.text('fints_bank_code', data.fints_bank_code, {required: true}) }}
|
||||
{{ ExpandedForm.text('fints_username', data.fints_username, {helpText: trans('import.job_config_fints_username_help'), required: false}) }}
|
||||
{{ ExpandedForm.password('fints_password', {required: true}) }}
|
||||
{{ ExpandedForm.checkbox('apply_rules', 1, true) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user