Fix default values for country and currency in customer data
Previously, the country and currency fields could return null if not explicitly set. This update ensures that 'Ukendt' is returned as the default country and 'DKK' as the default currency when no value is provided, enhancing data consistency.
This commit is contained in:
@@ -191,7 +191,7 @@ class economic_customer
|
||||
public function getCountry(): string
|
||||
{
|
||||
self::requireSelected();
|
||||
return $this->customer_data_object->country;
|
||||
return $this->customer_data_object->country ?? 'Ukendt';
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -213,7 +213,7 @@ class economic_customer
|
||||
public function getCurrency(): string
|
||||
{
|
||||
self::requireSelected();
|
||||
return $this->customer_data_object->currency;
|
||||
return $this->customer_data_object->currency ?? 'DKK';
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user