﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	blockedby	blocking
2566	"Warning ""Undefined variable $vat"" in /create_*account.php"	noRiddle	somebody	"Sowohl in ''/create-account.php'' als auch in ''create_guest_account.php'' kommt es je nach Konfiguration-Einstellungen zu diesen Warnings:
{{{
WARNING found for URL: /create_account.php
Undefined variable $vat in File: PATH/create_account.php on Line: 150
WARNING found for URL: /create_account.php   {}   {}
Undefined variable $vat in File: PATH/create_account.php on Line: 150
WARNING found for URL: /create_account.php   {}   {}
Undefined variable $vat in File: PATH/create_account.php on Line: 314
}}}

Das liegt daran, daß in den zugehörigen Template-Dateien 
{{{
{if $vat == '1'}
}}}

innerhalb der Kondition
{{{
{if $company == '1'}
}}}

abgefragt wird.

Wenn man also
''Konfiguration => Kunden Details => ""Firma""''
nicht aktiviert hat, wohl jedoch
''Erw. Konfiguration  -> USt-!IdNr. => ""USt-!IdNr. abfragen""''
wird das VAT-Feld im Template nicht angezeigt und befindet sich somit nicht im $_POST-Array.

In der zugehörigen PHP-Datei wird für die Verarbeitung des $_POST!['vat']  jedoch lediglich nach
''Erw. Konfiguration  -> USt-!IdNr. => ""USt-!IdNr. abfragen""''
abgefragt:
{{{
  if (ACCOUNT_COMPANY_VAT_CHECK == 'true') {
    require_once(DIR_WS_CLASSES.'vat_validation.php');
    $vatID = new vat_validation($vat, '', '', (int)$country);
    $customers_status = $vatID->vat_info['status'];
    $customers_vat_id_status = isset($vatID->vat_info['vat_id_status']) ? $vatID->vat_info['vat_id_status'] : '';
    if (isset($vatID->vat_info['error']) && $vatID->vat_info['error']==1){
      $messageStack->add('create_account', ENTRY_VAT_ERROR);
      $error = true;
    }
  }
}}}
und

{{{
    if (ACCOUNT_COMPANY_VAT_CHECK == 'true') {
      $sql_data_array['customers_vat_id'] = $vat;
      $sql_data_array['customers_vat_id_status'] = $customers_vat_id_status;
    }
}}}

Entweder möchte man die Abhängigkeit Feld<=>Firma beibehalten, dann muß das in der PHP-Datei angepasst werden
oder man möchte die Abhängigkeit nicht, dann muß es im Template angepasst werden.


Zugehöriger Thread: [https://www.modified-shop.org/forum/index.php?topic=43067.msg399729#msg399729 Fehler Log bei Account Erstellung]


Gruß,
noRiddle"	Bug/Fehler	closed	normal	modified-shop-2.0.8.0	Shop	2.0.7.2	fixed				
