GX-Bug #52341 » VatValidationFix.patch
| src/includes/classes/vat_validation.php (revision ) | ||
|---|---|---|
| 270 | 270 |
// land bestimmen |
| 271 | 271 |
$country = strtolower(substr($vat_id, 0, 2)); |
| 272 | 272 | |
| 273 |
$t_result = 8; //unknown country |
|
| 274 | ||
| 273 |
if($this->live_check == 'true') {
|
|
| 275 |
if($this->live_check == 'true') {
|
|
| 274 | 276 |
$country_iso_code = strtoupper($country); |
| 275 | 277 | |
| 276 |
//Check VAT for EU countries only |
|
| 277 |
switch ($country_iso_code) {
|
|
| 278 |
// EU countries |
|
| 279 |
case 'AT': |
|
| 280 |
case 'BE': |
|
| 281 |
case 'BG': |
|
| 282 |
case 'CY': |
|
| 283 |
case 'CZ': |
|
| 284 |
case 'DE': |
|
| 285 |
case 'DK': |
|
| 286 |
case 'EE': |
|
| 287 |
case 'EL': |
|
| 288 |
case 'ES': |
|
| 289 |
case 'FI': |
|
| 290 |
case 'FR': |
|
| 291 |
case 'GB': |
|
| 292 |
case 'HU': |
|
| 293 |
case 'IE': |
|
| 294 |
case 'IT': |
|
| 295 |
case 'LT': |
|
| 296 |
case 'LU': |
|
| 297 |
case 'LV': |
|
| 298 |
case 'MT': |
|
| 299 |
case 'NL': |
|
| 300 |
case 'PL': |
|
| 301 |
case 'PT': |
|
| 302 |
case 'RO': |
|
| 303 |
case 'SE': |
|
| 304 |
case 'SI': |
|
| 305 |
case 'SK': |
|
| 306 |
$t_result = $this->checkVatID_EU($vat_id, $country_iso_code); |
|
| 278 |
$t_result = $this->checkVatID_EU($vat_id, $country_iso_code); |
|
| 307 |
break; |
|
| 308 |
default: |
|
| 309 |
$t_result = 8; //unknown country |
|
| 310 |
} |
|
| 279 | ||
| 311 | 280 |
} else {
|
| 312 | 281 |
$vat_id = trim(chop($vat_id)); |
| 313 | 282 |
$t_result = $this->gm_validate_vatid($country, $vat_id); |