mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 13:12:50 +01:00
Merge OFX fixes
This commit is contained in:
parent
9812eecd54
commit
0ff4fe09c7
@ -128,6 +128,7 @@ class BankAccountService extends BaseService
|
||||
|
||||
return $data;
|
||||
} catch (\Exception $e) {
|
||||
Utils::logError($e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -183,11 +184,12 @@ class BankAccountService extends BaseService
|
||||
$ofxParser = new \OfxParser\Parser();
|
||||
$ofx = $ofxParser->loadFromString($data);
|
||||
|
||||
$account->start_date = $ofx->BankAccount->Statement->startDate;
|
||||
$account->end_date = $ofx->BankAccount->Statement->endDate;
|
||||
$bankAccount = reset($ofx->bankAccounts);
|
||||
$account->start_date = $bankAccount->statement->startDate;
|
||||
$account->end_date = $bankAccount->statement->endDate;
|
||||
$account->transactions = [];
|
||||
|
||||
foreach ($ofx->BankAccount->Statement->transactions as $transaction) {
|
||||
foreach ($bankAccount->statement->transactions as $transaction) {
|
||||
// ensure transactions aren't imported as expenses twice
|
||||
if (isset($expenses[$transaction->uniqueId])) {
|
||||
continue;
|
||||
|
Loading…
Reference in New Issue
Block a user