Skip to content

Commit

Permalink
Merge pull request #443 from nemiah/balance
Browse files Browse the repository at this point in the history
fix getEndBalance value when < 0
  • Loading branch information
nemiah authored Jul 12, 2024
2 parents 9e5f1bf + eebafc7 commit f6f6ce8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Fhp/Model/StatementOfAccount/StatementOfAccount.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
Expand Down

0 comments on commit f6f6ce8

Please sign in to comment.