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