mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Lots of new code to test the import routine.
Signed-off-by: James Cole <thegrumpydictator@gmail.com>
This commit is contained in:
@@ -36,6 +36,7 @@ class AssetAccountName extends BasicConverter implements ConverterInterface
|
||||
|
||||
if (strlen($value) === 0) {
|
||||
$this->setCertainty(0);
|
||||
|
||||
return new Account;
|
||||
}
|
||||
|
||||
@@ -49,6 +50,7 @@ class AssetAccountName extends BasicConverter implements ConverterInterface
|
||||
if (!is_null($account->id)) {
|
||||
Log::debug('Found account by ID', ['id' => $account->id]);
|
||||
$this->setCertainty(100);
|
||||
|
||||
return $account;
|
||||
}
|
||||
}
|
||||
@@ -56,7 +58,7 @@ class AssetAccountName extends BasicConverter implements ConverterInterface
|
||||
// not mapped? Still try to find it first:
|
||||
$account = $repository->findByName($value, [AccountType::ASSET]);
|
||||
if (!is_null($account->id)) {
|
||||
Log::debug('Found account by name', ['id' => $account->id]);
|
||||
Log::debug('Found asset account by name', ['value' => $value, 'id' => $account->id]);
|
||||
|
||||
return $account;
|
||||
}
|
||||
@@ -68,6 +70,8 @@ class AssetAccountName extends BasicConverter implements ConverterInterface
|
||||
);
|
||||
$this->setCertainty(100);
|
||||
|
||||
Log::debug('Created new asset account ', ['name' => $account->name, 'id' => $account->id]);
|
||||
|
||||
return $account;
|
||||
|
||||
|
||||
|
@@ -66,7 +66,7 @@ class BillName extends BasicConverter implements ConverterInterface
|
||||
'name' => $value,
|
||||
'match' => $value,
|
||||
'amount_min' => 1,
|
||||
'user_id' => $this->user->id,
|
||||
'user' => $this->user->id,
|
||||
'amount_max' => 10,
|
||||
'date' => date('Ymd'),
|
||||
'repeat_freq' => 'monthly',
|
||||
|
@@ -64,7 +64,7 @@ class BudgetName extends BasicConverter implements ConverterInterface
|
||||
$budget = $repository->store(
|
||||
[
|
||||
'name' => $value,
|
||||
'user_id' => $this->user->id,
|
||||
'user' => $this->user->id,
|
||||
]
|
||||
);
|
||||
$this->setCertainty(100);
|
||||
|
@@ -64,7 +64,7 @@ class CategoryName extends BasicConverter implements ConverterInterface
|
||||
$category = $repository->store(
|
||||
[
|
||||
'name' => $value,
|
||||
'user_id' => $this->user->id,
|
||||
'user' => $this->user->id,
|
||||
]
|
||||
);
|
||||
$this->setCertainty(100);
|
||||
|
@@ -54,7 +54,7 @@ class OpposingAccountName extends BasicConverter implements ConverterInterface
|
||||
// not mapped? Still try to find it first:
|
||||
$account = $repository->findByName($value, []);
|
||||
if (!is_null($account->id)) {
|
||||
Log::debug('Found account by name', ['id' => $account->id]);
|
||||
Log::debug('Found opposing account by name', ['id' => $account->id]);
|
||||
Log::warning(
|
||||
'The match between name and account is uncertain because the type of transactions may not have been determined.',
|
||||
['id' => $account->id, 'name' => $value]
|
||||
@@ -70,6 +70,8 @@ class OpposingAccountName extends BasicConverter implements ConverterInterface
|
||||
);
|
||||
$this->setCertainty(100);
|
||||
|
||||
Log::debug('Created new opposing account ', ['name' => $account->name, 'id' => $account->id]);
|
||||
|
||||
return $account;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user