diff --git a/lib/Fhp/Model/StatementOfAccount/StatementOfAccount.php b/lib/Fhp/Model/StatementOfAccount/StatementOfAccount.php index dd0b0a3..2cf2e60 100644 --- a/lib/Fhp/Model/StatementOfAccount/StatementOfAccount.php +++ b/lib/Fhp/Model/StatementOfAccount/StatementOfAccount.php @@ -77,7 +77,7 @@ public static function fromMT940Array(array $array): StatementOfAccount $statementModel->setStartBalance((float) $statement['start_balance']['amount']); } if (isset($statement['end_balance'])) { - $statementModel->setEndBalance((float) $statement['end_balance']['amount']); + $statementModel->setEndBalance((float) $statement['end_balance']['amount'] * ($statement["end_balance"]['credit_debit'] == MT940::CD_CREDIT ? 1 : -1)); } if (isset($statement['start_balance']['credit_debit'])) { $statementModel->setCreditDebit($statement['start_balance']['credit_debit']);