Fix functions moveValutadatumDescription and removeNameIngDescription

This commit is contained in:
Ruben Verhoef 2020-03-26 19:52:30 +01:00
parent ecb61676ab
commit 8c552b8fa8

View File

@ -112,10 +112,11 @@ class IngDescription implements SpecificInterface
protected function moveValutadatumDescription(): void
{
$matches = [];
preg_match('/Valutadatum: ([0-9-]+)/', $this->row[8], $matches);
if (preg_match('/Valutadatum: ([0-9-]+)/', $this->row[8], $matches)) {
$this->row[9] = date("Ymd", strtotime($matches[1]));
$this->row[8] = preg_replace('/Valutadatum: [0-9-]+/', '', $this->row[8]);
}
}
/**
* Remove IBAN number out of the description
@ -140,11 +141,7 @@ class IngDescription implements SpecificInterface
*/
protected function removeNameIngDescription(): void
{
$matches = [];
if (preg_match('/Valutadatum: ([0-9-]+)/', $this->row[8], $matches)) {
$this->row[9] = date("Ymd", strtotime($matches[1]));
$this->row[8] = preg_replace('/Valutadatum: [0-9-]+/', '', $this->row[8]);
}
$this->row[8] = preg_replace('/Naam:.*?([a-zA-Z\/]+:)/', '$1', $this->row[8]);
}
/**