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,9 +112,10 @@ class IngDescription implements SpecificInterface
protected function moveValutadatumDescription(): void
{
$matches = [];
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]);
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]);
}
}
/**
@ -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]);
}
/**