Firefly III: a personal finances manager
PHP accountingbudgetbudgetingbudgetscash-flowcashflowcredit-carddockerexpensesfinancefinancesfinanciallinuxmoneypaycheckpersonal-financephpphp7
Extend ImportObject with row hash.
James Cole117bb602dc50
diff --git a/app/Import/ImportEntry.php b/app/Import/ImportEntry.phpindex 759263171e..931079fc55 100644--- a/app/Import/ImportEntry.php+++ b/app/Import/ImportEntry.php@@ -32,6 +32,8 @@ class ImportEntrypublic $externalID;/** @var array */public $fields = [];+ /** @var string */+ public $hash;/** @var User */public $user;/** @var bool */@@ -77,6 +79,10 @@ class ImportEntrydefault:Log::error('Import entry cannot handle object.', ['role' => $role]);throw new FireflyException('Import entry cannot handle object of type "' . $role . '".');+ case 'hash':+ $this->hash = $convertedValue;++ return;case 'amount':/** Easy enough.diff --git a/app/Import/Importer/CsvImporter.php b/app/Import/Importer/CsvImporter.phpindex 9732bb24fa..970529caa0 100644--- a/app/Import/Importer/CsvImporter.php+++ b/app/Import/Importer/CsvImporter.php@@ -100,6 +100,10 @@ class CsvImporter implements ImporterInterface$object->setUser($this->job->user);$config = $this->job->configuration;+ // hash the row:+ $hash = hash('sha256', json_encode($row));+ $object->importValue('hash', 100, $hash);+// and this is the point where the specifix go to work.foreach ($config['specifics'] as $name => $enabled) {/** @var SpecificInterface $specific */