Returns whether the client is a company with a vat number.

@return bool
556219
protected function isCompany()
    {
        // Note: companies outside EU must also fill in their vat number!? Even
        // if there's no way to check it with a webservice like VIES.
        return !empty($this->invoice[Tag::Customer][Tag::CompanyName1]) && !empty($this->invoice[Tag::Customer][Tag::VatNumber]);
    }
797174
public function isPayPalOrder()
    {
        $active = false;

        $order = $this->getEditObject();
        if ($order && $order->getFieldData('oxpaymenttype') == 'oxidpaypal') {
            $active = true;
        }

        return $active;
    }
776616
public function IsValidForCurrentUser()
    {
        $bIsValidForUser = false;
        $bIsValidShippingCountry = false;
        $bIsValidBillingCountry = false;

        $oUser = TdbDataExtranetUser::GetInstance();
        $bIsValidGroup = $this->checkUserGroup($oUser);
        if ($bIsValidGroup) {
            $bIsValidForUser = $this->checkUser($oUser);
        }
        if ($bIsValidForUser && $bIsValidGroup) {
            $bIsValidShippingCountry = $this->checkUserShippingCountry($oUser);
        }
        if ($bIsValidForUser && $bIsValidGroup && $bIsValidShippingCountry) {
            $bIsValidBillingCountry = $this->checkUserBillingCountry($oUser);
        }

        return $bIsValidForUser && $bIsValidGroup && $bIsValidShippingCountry && $bIsValidBillingCountry;
    }
757578
private function validateIENew(string $vatNumber): bool
    {
        $checksum = strtoupper(substr($vatNumber, 7, 1));
        $checkNumber = substr($vatNumber, 0, 8);
        $checkval = 0;

        for ($i = 2; $i <= 8; $i++) {
            $checkval += (int)$checkNumber[8 - $i] * $i;
        }

        if (strlen($vatNumber) == 9) {
            $checkval += (9 * strpos($this->alphabet, $vatNumber[8]));
        }

        $checkval = ($checkval % 23);

        if ($checkval == 0) {
            return $checksum == 'W';
        }

        $checkchar = 'A';
        for ($i = $checkval - 1; $i > 0; $i--) {
            $checkchar++;
        }

        return $checkchar == $checksum;
    }
1221952
public static function isItSelfContact(){

        $ppcn_id = false;
        $action = Yii::app()->controller->action->id;
        switch (Yii::app()->controller->action->id) {
            
            //update
            case 'editableSaver':
                $ppcn_id = yii::app()->request->getParam('pk');
            //delete
            case 'delete':                
                if(!$ppcn_id){
                    $ppcn_id = yii::app()->request->getParam('ppcn_id');
                }
                if(!$ppcn_id){
                    return false;
                }
                
                $ppcn = PpcnPersonContact::model()->findByPk($ppcn_id);
                if(!$ppcn || $ppcn->ppcnPprs->pprs_id != Yii::app()->getModule('user')->user()->profile->person_id){
                    return false;            
                }
                
                break;

            //create
            case 'ajaxCreate':
                if(yii::app()->request->getParam('value') != Yii::app()->getModule('user')->user()->profile->person_id){
                    return false;            
                }

                break;

            default:
                return false;
                break;
        }

        return true;
        
    }
752609
protected function isEu()
    {
        return !$this->isNl() && $this->countries->isEu($this->invoice[Tag::Customer][Tag::CountryCode]);
    }
611436
public function requestValid()
    {
        $requestValid = true;

        $request = $this->getRequest();

        $ipnRequestVerifier = $this->getIPNRequestVerifier();
        $ipnRequestVerifier->setRequest($request);
        $ipnRequestVerifier->setShopOwner($this->getPayPalConfig()->getUserEmail());
        $requestCorrect = $ipnRequestVerifier->requestCorrect();

        if (!$requestCorrect) {
            $requestValid = false;

            $logger = $this->getLogger();
            $logger->setTitle("IPN VERIFICATION FAILURE BY PAYPAL");
            $logger->log($ipnRequestVerifier->getFailureMessage());
        }

        return $requestValid;
    }
1365050
public function validate(\OxidEsales\Eshop\Application\Model\CompanyVatIn $oVatIn)
    {
        $oCheckVat = new stdClass();
        $oCheckVat->countryCode = $oVatIn->getCountryCode();
        $oCheckVat->vatNumber = $oVatIn->getNumbers();

        $blResult = $this->_checkOnline($oCheckVat);
        if (!$blResult) {
            $this->setError('ID_NOT_VALID');
        }

        return $blResult;
    }
1244539
public function isEnabledPrivateSales()
    {
        if ($this->_blEnabledPrivateSales === null) {
            $this->_blEnabledPrivateSales = (bool) \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blPsLoginEnabled');
            if ($this->_blEnabledPrivateSales && ($canPreview = \OxidEsales\Eshop\Core\Registry::getUtils()->canPreview()) !== null) {
                $this->_blEnabledPrivateSales = !$canPreview;
            }
        }

        return $this->_blEnabledPrivateSales;
    }
59619
public function isValid()
    {
        if (!$this->oxorderfiles__oxmaxdownloadcount->value || ($this->oxorderfiles__oxdownloadcount->value < $this->oxorderfiles__oxmaxdownloadcount->value)) {
            if (!$this->oxorderfiles__oxlinkexpirationtime->value && !$this->oxorderfiles__oxdownloadxpirationtime->value) {
                return true;
            } else {
                $sNow = \OxidEsales\Eshop\Core\Registry::getUtilsDate()->getTime();
                $iTimestamp = strtotime($this->oxorderfiles__oxvaliduntil->value);
                if (!$iTimestamp || ($iTimestamp > $sNow)) {
                    return true;
                }
            }
        }

        return false;
    }
339686
public function hasOrganizationData() {
        return ( !is_null( $this->organizationName ) && !is_null( $this->organizationUniqueName )
                 && !is_null( $this->organizationId ) && !is_null( $this->organizationVersion ) );
    }
724682
public function isValid()
    {
        $payPalRequest = $this->getPayPalRequest();
        $payPalResponse = $this->getPayPalResponse();
        $shopOwnerUserName = $this->getShopOwnerUserName();
        $receiverEmailPayPal = $payPalRequest[self::RECEIVER_EMAIL];

        return ($payPalResponse->isPayPalAck() && $receiverEmailPayPal == $shopOwnerUserName);
    }
1112945
public function isAllowed()
    {
        /** @var \Magento\Framework\App\Request\Http $req */
        $req = $this->context->getRequest();

        if ($this->legacyContext->getAppState()->getAreaCode() !== FrontNameResolver::AREA_CODE
            && !$req->isAjax()
            && $this->sgConfig->isValid()
        ) {
            return true;
        }

        return false;
    }
824780
public function enviar()
    {
        if ($this->enviado) {
            return false;
        }

        http_response_code($this->estadoHttp);

        // Enviamos cabeceras
        foreach ($this->cabeceras as $cabecera => $valores) {
            foreach ($valores as $valor) {
                header($cabecera . ': ' . $valor, false);
            }
        }

        if (!empty($this->contenido)) {
            echo $this->contenido;
        }

        return $this->enviado = true;
    }
159272
public function IsValid()
	{
		$AccountType = $this->GetAccountType();
		
		if( $AccountType <= self::TypeInvalid || $AccountType >= 11 ) // EAccountType.Max
		{
			return false;
		}
		
		$AccountUniverse = $this->GetAccountUniverse();
		
		if( $AccountUniverse <= self::UniverseInvalid || $AccountUniverse >= self::UniverseMax )
		{
			return false;
		}
		
		$AccountID = $this->GetAccountID();
		$AccountInstance = $this->GetAccountInstance();
		
		if( $AccountType === self::TypeIndividual )
		{
			if( $AccountID == 0 || $AccountInstance > self::WebInstance )
			{
				return false;
			}
		}
		
		if( $AccountType === self::TypeClan )
		{
			if( $AccountID == 0 || $AccountInstance != 0 )
			{
				return false;
			}
		}
		
		if( $AccountType === self::TypeGameServer )
		{
			if( $AccountID == 0 )
			{
				return false;
			}
		}
		
		return true;
	}
558740
public function actualizarObjetoLdap(){
        if ($this->existe) {
            $dn = $this->entrada['dn'];
            $cambios = array();
            foreach ($this->cambios as $atributos) {
                $cambios[$atributos] = $this->entrada[$atributos];
            }
            return $this->modificarEntradaLdap($dn, $cambios);
        }else{
            $this->configurarErrorLdap('Actualizacion', 'Esa entrada no existe');
            return false;
        }
    }
1024615
static public function isSysCompanyUser(){
         if(Yii::app()->user->isGuest){
             return FALSE;
         }
         $a = self::getRoles();
         return isset($a[self::RoleSysCompanyUser]);
     }