Lots of new code to test the import routine.

Signed-off-by: James Cole <thegrumpydictator@gmail.com>
This commit is contained in:
James Cole
2016-08-11 10:21:32 +02:00
parent efe9933721
commit 186b704509
27 changed files with 1315 additions and 67 deletions

View File

@@ -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;

View File

@@ -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',

View File

@@ -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);

View File

@@ -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);

View File

@@ -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;
}
}