Skip to content

Commit 78d6df1

Browse files
committed
Set actual identifier from lookup on lookup result
1 parent b4f6858 commit 78d6df1

File tree

4 files changed

+4
-3
lines changed

4 files changed

+4
-3
lines changed

src/Plugin/os2web/DataLookup/DatafordelerCVR.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public function lookup(string $param): CompanyLookupResult {
8080
$cvrResult = new CompanyLookupResult();
8181
if ($result && isset($result->virksomhed) && !empty((array) $result->virksomhed)) {
8282
$cvrResult->setSuccessful();
83-
$cvrResult->setCvr($param);
83+
$cvrResult->setCvr($result->virksomhed->CVRNummer);
8484

8585
if ($result->virksomhedsnavn) {
8686
$cvrResult->setName($result->virksomhedsnavn->vaerdi);

src/Plugin/os2web/DataLookup/ServiceplatformenCPR.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ public function lookup(string $cpr): CprLookupResult {
164164
// If all goes well, we return an address array.
165165
if ($result['status']) {
166166
$cprResult->setSuccessful();
167+
// @todo Use a value from from $result to set CPR. But which key?
167168
$cprResult->setCpr($cpr);
168169
$cprResult->setName($result['adresseringsnavn'] ?? '');
169170
$cprResult->setStreet($result['vejadresseringsnavn'] ?? '');

src/Plugin/os2web/DataLookup/ServiceplatformenCPRExtended.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,9 @@ public function lookup(string $cpr, $fetchChildren = TRUE, $allowCprTestModeRepl
125125
// If all goes well, we return an address array.
126126
if ($result['status']) {
127127
$cprResult->setSuccessful();
128-
$cprResult->setCpr($cpr);
129128

130129
$persondata = $result['persondata'];
130+
$cprResult->setCpr($persondata->personnummer);
131131

132132
if ($persondata->status) {
133133
if ($persondata->status->status == self::CPR_STATUS_DEAD) {

src/Plugin/os2web/DataLookup/ServiceplatformenCVR.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ public function lookup(string $param): CompanyLookupResult {
120120
$cvrResult = new CompanyLookupResult();
121121
if ($result['status']) {
122122
$cvrResult->setSuccessful();
123-
$cvrResult->setCvr($param);
123+
$cvrResult->setCvr($result['cvr']);
124124

125125
$cvrResult->setName($result['company_name']);
126126
$cvrResult->setStreet($result['company_street']);

0 commit comments

Comments
 (0)