mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Fixed some small issues in import routine.
This commit is contained in:
@@ -184,6 +184,7 @@ class Roles implements ConfigurationInterface
|
||||
*/
|
||||
private function ignoreUnmappableColumns(): bool
|
||||
{
|
||||
Log::debug('Now in ignoreUnmappableColumns()');
|
||||
$config = $this->getConfig();
|
||||
$count = $config['column-count'];
|
||||
for ($i = 0; $i < $count; ++$i) {
|
||||
@@ -254,24 +255,38 @@ class Roles implements ConfigurationInterface
|
||||
$hasForeignAmount = true;
|
||||
}
|
||||
}
|
||||
if ($assigned > 0 && $hasAmount && ($hasForeignCode === false && $hasForeignAmount === false)) {
|
||||
Log::debug(
|
||||
sprintf(
|
||||
'Assigned is %d, hasAmount %s, hasForeignCode %s, hasForeignAmount %s',
|
||||
$assigned,
|
||||
var_export($hasAmount, true),
|
||||
var_export($hasForeignCode, true),
|
||||
var_export($hasForeignAmount, true)
|
||||
)
|
||||
);
|
||||
// all assigned and correct foreign info
|
||||
if ($assigned > 0 && $hasAmount && ($hasForeignCode === $hasForeignAmount)) {
|
||||
$this->warning = '';
|
||||
$this->saveConfig($config);
|
||||
Log::debug('isRolesComplete() returns true.');
|
||||
|
||||
return true;
|
||||
}
|
||||
// warn if has foreign amount but no currency code:
|
||||
if ($hasForeignAmount && !$hasForeignCode) {
|
||||
$this->warning = strval(trans('import.foreign_amount_warning'));
|
||||
Log::debug('isRolesComplete() returns FALSE because foreign amount present without foreign code.');
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (0 === $assigned || !$hasAmount) {
|
||||
$this->warning = strval(trans('import.roles_warning'));
|
||||
Log::debug('isRolesComplete() returns FALSE because no amount present.');
|
||||
|
||||
return false;
|
||||
}
|
||||
Log::debug('isRolesComplete() returns FALSE because no reason.');
|
||||
|
||||
return false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user