mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-29 18:20:01 +00:00
This should fix #693.
This commit is contained in:
@@ -68,6 +68,18 @@ class Roles implements ConfigurationInterface
|
||||
return $this->data;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ImportJob $job
|
||||
*
|
||||
* @return ConfigurationInterface
|
||||
*/
|
||||
public function setJob(ImportJob $job): ConfigurationInterface
|
||||
{
|
||||
$this->job = $job;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Store the result.
|
||||
*
|
||||
@@ -217,16 +229,20 @@ class Roles implements ConfigurationInterface
|
||||
*/
|
||||
private function setRolesComplete(): bool
|
||||
{
|
||||
$config = $this->job->configuration;
|
||||
$count = $config['column-count'];
|
||||
$assigned = 0;
|
||||
$config = $this->job->configuration;
|
||||
$count = $config['column-count'];
|
||||
$assigned = 0;
|
||||
$hasAmount = false;
|
||||
for ($i = 0; $i < $count; $i++) {
|
||||
$role = $config['column-roles'][$i] ?? '_ignore';
|
||||
if ($role !== '_ignore') {
|
||||
$assigned++;
|
||||
}
|
||||
if ($role === 'amount') {
|
||||
$hasAmount = true;
|
||||
}
|
||||
}
|
||||
if ($assigned > 0) {
|
||||
if ($assigned > 0 && $hasAmount) {
|
||||
$config['column-roles-complete'] = true;
|
||||
$this->job->configuration = $config;
|
||||
$this->job->save();
|
||||
@@ -248,16 +264,4 @@ class Roles implements ConfigurationInterface
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ImportJob $job
|
||||
*
|
||||
* @return ConfigurationInterface
|
||||
*/
|
||||
public function setJob(ImportJob $job): ConfigurationInterface
|
||||
{
|
||||
$this->job = $job;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user