Skip to content

Commit 4122eee

Browse files
committed
Merge branch 'release/v1.3.5'
2 parents 27a9a99 + 6539c5b commit 4122eee

5 files changed

Lines changed: 24 additions & 15 deletions

File tree

app/Services/CSV/Conversion/Task/Accounts.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,7 @@ private function processTransaction(array $transaction): array
512512
$sourceArray = $this->getSourceArray($transaction);
513513
$destArray = $this->getDestinationArray($transaction);
514514
$source = $this->findAccount($sourceArray, $this->account);
515-
$destination = $this->findAccount($destArray, $this->account);
515+
$destination = $this->findAccount($destArray, null);
516516

517517
/*
518518
* First, set source and destination in the transaction array:

app/Services/Camt/Transaction.php

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -315,11 +315,13 @@ public function getFieldByIndex(string $field, int $index): string
315315
if (0 === count($this->levelD) || !array_key_exists($index, $this->levelD)) {
316316
return $result;
317317
}
318-
/** @var EntryTransactionDetail $info */
319-
$info = $this->levelD[$index];
320-
$opposingAccount = $this->getOpposingParty($info)?->getAccount();
321-
if (null !== $opposingAccount && IbanAccount::class === get_class($opposingAccount)) {
322-
$result = (string)$opposingAccount->getIdentification();
318+
/** @var EntryTransactionDetail|null $info */
319+
$info = $this->levelD[$index] ?? null;
320+
if (null !== $info) {
321+
$opposingAccount = $this->getOpposingParty($info)?->getAccount();
322+
if (is_object($opposingAccount) && IbanAccount::class === get_class($opposingAccount)) {
323+
$result = (string)$opposingAccount->getIdentification();
324+
}
323325
}
324326

325327
return $result;
@@ -422,7 +424,8 @@ private function getOpposingParty(EntryTransactionDetail $transactionDetail): Re
422424
{
423425
$relatedParties = $transactionDetail->getRelatedParties();
424426
$targetRelatedPartyObject = "Genkgo\Camt\DTO\Creditor";
425-
if ($transactionDetail->getAmount()->getAmount() > 0) { // which part in this array is the interesting one?
427+
$amount = $transactionDetail?->getAmount()?->getAmount();
428+
if (null !== $amount && $amount > 0) { // which part in this array is the interesting one?
426429
$targetRelatedPartyObject = "Genkgo\Camt\DTO\Debtor";
427430
}
428431
foreach ($relatedParties as $relatedParty) {

changelog.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
All notable changes to this project will be documented in this file.
33
This project adheres to [Semantic Versioning](http://semver.org/).
44

5+
## 1.3.5 - 2023-08-23
6+
7+
### Fixed
8+
- Error in CSV import would break imports for many users, thanks for reporting!
9+
- Many null pointers removed from CAMT.053 import.
10+
511
## 1.3.4 - 2023-08-21
612

713
> ⚠️ This release may create duplicate transactions. Don't import large batches!

composer.lock

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/importer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
declare(strict_types=1);
2424

2525
return [
26-
'version' => '1.3.4',
26+
'version' => '1.3.5',
2727
'flows' => ['nordigen', 'spectre', 'file'],
2828
'flow_titles' => [
2929
'file' => 'File',

0 commit comments

Comments
 (0)