Skip to content

Commit

Permalink
Avoid CVR city containing postal code if city is found
Browse files Browse the repository at this point in the history
  • Loading branch information
jekuaitk committed Jan 28, 2025
1 parent 2b86bf6 commit 46c67f4
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/Plugin/os2web/DataLookup/DatafordelerCVR.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,8 @@ public function lookup(string $param): CompanyLookupResult {
$cvrResult->setFloor($address->CVRAdresse_etagebetegnelse ?? '');
$cvrResult->setApartmentNr($address->CVRAdresse_doerbetegnelse ?? '');
$cvrResult->setPostalCode($address->CVRAdresse_postnummer ?? '');
$city = implode(' ', array_filter([
$address->CVRAdresse_postdistrikt ?? NULL,
$cvrResult->getPostalCode() ?? NULL,
]));
$cvrResult->setCity($city);
$city = $address->CVRAdresse_postdistrikt ?? $cvrResult->getPostalCode();
$cvrResult->setCity($city);
$cvrResult->setMunicipalityCode($address->CVRAdresse_kommunekode ?? '');

// Composing full address in one line.
Expand Down

0 comments on commit 46c67f4

Please sign in to comment.