Firefly III: a personal finances manager
PHP accountingbudgetbudgetingbudgetscash-flowcashflowcredit-carddockerexpensesfinancefinancesfinanciallinuxmoneypaycheckpersonal-financephpphp7
Each CSV converter can set the certainty of their conversion.
James Cole7707c81b2dab
diff --git a/app/Import/Converter/AccountId.php b/app/Import/Converter/AccountId.phpindex 5ba5e19d61..221f5e4c84 100644--- a/app/Import/Converter/AccountId.php+++ b/app/Import/Converter/AccountId.php@@ -34,6 +34,8 @@ class AccountId extends BasicConverter implements ConverterInterfaceLog::debug('Going to convert using AssetAccountId', ['value' => $value]);if ($value === 0) {+ $this->setCertainty(0);+return new Account;}@@ -47,6 +49,8 @@ class AccountId extends BasicConverter implements ConverterInterfaceif (!is_null($account->id)) {Log::debug('Found account by ID', ['id' => $account->id]);+ $this->setCertainty(100);+return $account;}}@@ -54,11 +58,15 @@ class AccountId extends BasicConverter implements ConverterInterface// not mapped? Still try to find it first:$account = $repository->find($value);if (!is_null($account->id)) {+ $this->setCertainty(90);+Log::debug('Found account by ID ', ['id' => $account->id]);return $account;}+ $this->setCertainty(0);+// should not really happen. If the ID does not match FF, what is FF supposed to do?return new Account;diff --git a/app/Import/Converter/BasicConverter.php b/app/Import/Converter/BasicConverter.phpindex f160d0e4fa..d93590c81c 100644--- a/app/Import/Converter/BasicConverter.php+++ b/app/Import/Converter/BasicConverter.php@@ -40,6 +40,14 @@ class BasicConverterreturn $this->certainty;}+ /**+ * @param int $certainty+ */+ protected function setCertainty(int $certainty)+ {+ $this->certainty = $certainty;+ }+/*** @param array $config*/