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