mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Rewrote importer to be more clean about the stage it is in.
This commit is contained in:
@@ -50,6 +50,7 @@ class FileConfigurator implements ConfiguratorInterface
|
||||
'column-roles' => [], // unknown
|
||||
'column-do-mapping' => [], // not yet set which columns must be mapped
|
||||
'column-mapping-config' => [], // no mapping made yet.
|
||||
'file-type' => 'csv', // assume
|
||||
'has-config-file' => true,
|
||||
'apply-rules' => true,
|
||||
'match-bills' => false,
|
||||
@@ -132,7 +133,7 @@ class FileConfigurator implements ConfiguratorInterface
|
||||
}
|
||||
$config = $this->getConfig();
|
||||
$stage = $config['stage'] ?? 'initial';
|
||||
switch($stage) {
|
||||
switch ($stage) {
|
||||
case 'initial': // has nothing, no file upload or anything.
|
||||
return 'import.file.initial';
|
||||
case 'upload-config': // has file, needs file config.
|
||||
@@ -189,7 +190,10 @@ class FileConfigurator implements ConfiguratorInterface
|
||||
$this->job = $job;
|
||||
$this->repository = app(ImportJobRepositoryInterface::class);
|
||||
$this->repository->setUser($job->user);
|
||||
$this->repository->setConfiguration($job, $this->defaultConfig);
|
||||
|
||||
$config = $this->getConfig();
|
||||
$newConfig = array_merge($this->defaultConfig, $config);
|
||||
$this->repository->setConfiguration($job, $newConfig);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -50,7 +50,10 @@ class SnsDescription implements SpecificInterface
|
||||
*/
|
||||
public function run(array $row): array
|
||||
{
|
||||
$row = array_values($row);
|
||||
$row = array_values($row);
|
||||
if (!isset($row[17])) {
|
||||
return $row;
|
||||
}
|
||||
$row[17] = ltrim($row[17], "'");
|
||||
$row[17] = rtrim($row[17], "'");
|
||||
|
||||
|
Reference in New Issue
Block a user