Version 5.0.0 beta 9

This commit is contained in:
Neo committed 2025-12-19 17:47:00 -08:00
1 parent 214f649f1d
commit 56979f8ee8
202 files changed
+4403 -1123

No files matched your search

@@ -53,6 +53,11 @@ class BusinessAddress extends Address
'requireFullAddress' => TRUE,
'vat' => FALSE
);
/**
* @brief Country codes that require a business name
*/
protected static array $vatCountries = array( 'AT','BE','BG','HR','CY','CZ','DK','EE','FI','FR','DE','GR','HU','IE','IT','LV','LT','LU','MT','NL','PL','PT','RO','SK','SI','ES','SE','GB','GP','MQ','RE','BL','GF','MF','NC','PF','PM','TF','YT','WF' );
/**
* Get HTML
@@ -101,7 +106,7 @@ class BusinessAddress extends Address
{
$value->business = Request::i()->$name['business'];
if ( $this->options['vat'] and in_array( $value->country, array('AT','BE','BG','HR','CY','CZ','DK','EE','FI','FR','DE','GR','HU','IE','IT','LV','LT','LU','MT','NL','PL','PT','RO','SK','SI','ES','SE','GB') ) and Request::i()->$name['vat'] )
if ( $this->options['vat'] and in_array( $value->country, static::$vatCountries ) and Request::i()->$name['vat'] )
{
$value->vat = Request::i()->$name['vat'];
}
@@ -133,7 +138,7 @@ class BusinessAddress extends Address
if( $this->value )
{
if ( $this->value->business === '' )
if ( $this->options['vat'] and in_array( $this->value->country, static::$vatCountries ) and $this->value->business === '' )
{
throw new DomainException('cm_business_name_required');
}