Finish up bunq import routine.

This commit is contained in:
James Cole
2018-03-24 18:55:02 +01:00
parent 3c9b7c07af
commit 6a6482dc7f
24 changed files with 696 additions and 79 deletions

View File

@@ -162,9 +162,14 @@ class AccountFactory
if ($accountTypeId > 0) {
return AccountType::find($accountTypeId);
}
$type = config('firefly.accountTypeByIdentifier.' . strval($accountType));
$type = config('firefly.accountTypeByIdentifier.' . strval($accountType));
$result = AccountType::whereType($type)->first();
if (is_null($result) && !is_null($accountType)) {
// try as full name:
$result = AccountType::whereType($accountType)->first();
}
return AccountType::whereType($type)->first();
return $result;
}

View File

@@ -93,7 +93,7 @@ class TransactionJournalFactory
// store date meta fields (if present):
$fields = ['sepa-cc', 'sepa-ct-op', 'sepa-ct-id', 'sepa-db', 'sepa-country', 'sepa-ep', 'sepa-ci', 'interest_date', 'book_date', 'process_date',
'due_date', 'payment_date', 'invoice_date', 'internal_reference',];
'due_date', 'payment_date', 'invoice_date', 'internal_reference','bunq_payment_id'];
foreach ($fields as $field) {
$this->storeMeta($journal, $data, $field);

View File

@@ -56,7 +56,7 @@ class TransactionJournalMetaFactory
if ($data['data'] instanceof Carbon) {
$value = $data['data']->toW3cString();
}
if (strlen($value) === 0) {
if (strlen(strval($value)) === 0) {
// don't store blank strings.
if (!is_null($entry)) {
try {