From b14639bb7b507dfdad4562aa5c3f8623afc8f9ba Mon Sep 17 00:00:00 2001 From: Uwe Mueller Date: Wed, 22 Jan 2020 18:24:49 +0100 Subject: [PATCH] add custom parseStatementAccount for german Sparkasse to support "BLZ/Account" syntax --- src/Parser/Banking/Mt940/Engine/Spk.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/Parser/Banking/Mt940/Engine/Spk.php b/src/Parser/Banking/Mt940/Engine/Spk.php index 9d95b38..e7238c8 100644 --- a/src/Parser/Banking/Mt940/Engine/Spk.php +++ b/src/Parser/Banking/Mt940/Engine/Spk.php @@ -22,6 +22,23 @@ protected function parseStatementBank() return 'Spk'; } + /** + * Overloaded: the bankaccount may be "BLZ/Account". + * + * @inheritdoc + */ + protected function parseStatementAccount() + { + $results = []; + if (preg_match('#:25:(\d{8}/\d+)#', $this->getCurrentStatementData(), $results) + && !empty($results[1]) + ) { + return $this->sanitizeAccount($results[1]); + } + + return parent::parseStatementAccount(); + } + /** * Overloaded: Sparkasse uses 60M and 60F. *