source/Application/Model/Voucher.php
protected function _isAvailableWithSameSeries($aVouchers)
    {
        if (is_array($aVouchers)) {
            $sId = $this->getId();
            if (isset($aVouchers[$sId])) {
                unset($aVouchers[$sId]);
            }
            $oSeries = $this->getSerie();
            if (!$oSeries->oxvoucherseries__oxallowsameseries->value) {
                foreach ($aVouchers as $voucherId => $voucherNr) {
                    $oVoucher = oxNew(\OxidEsales\Eshop\Application\Model\Voucher::class);
                    $oVoucher->load($voucherId);
                    if ($this->oxvouchers__oxvoucherserieid->value == $oVoucher->oxvouchers__oxvoucherserieid->value) {
                        $oEx = oxNew(\OxidEsales\Eshop\Core\Exception\VoucherException::class);
                        $oEx->setMessage('ERROR_MESSAGE_VOUCHER_NOTALLOWEDSAMESERIES');
                        $oEx->setVoucherNr($this->oxvouchers__oxvouchernr->value);
                        throw $oEx;
                    }
                }
            }
        }

        return true;
    }
protected function _isAvailableWithSameSeries($aVouchers)
    {
        if (is_array($aVouchers)) {
            $sId = $this->getId();
            if (isset($aVouchers[$sId])) {
                unset($aVouchers[$sId]);
            }
            $oSeries = $this->getSerie();
            if (!$oSeries->oxvoucherseries__oxallowsameseries->value) {
                foreach ($aVouchers as $voucherId => $voucherNr) {
                    $oVoucher = oxNew(\OxidEsales\Eshop\Application\Model\Voucher::class);
                    $oVoucher->load($voucherId);
                    if ($this->oxvouchers__oxvoucherserieid->value == $oVoucher->oxvouchers__oxvoucherserieid->value) {
                        $oEx = oxNew(\OxidEsales\Eshop\Core\Exception\VoucherException::class);
                        $oEx->setMessage('ERROR_MESSAGE_VOUCHER_NOTALLOWEDSAMESERIES');
                        $oEx->setVoucherNr($this->oxvouchers__oxvouchernr->value);
                        throw $oEx;
                    }
                }
            }
        }

        return true;
    }
protected function _isAvailableWithSameSeries ( $ aVouchers ) { if ( is_array ( $ aVouchers ) ) { $ sId = $ this -> getId ( ) ; if ( isset ( $ aVouchers [ $ sId ] ) ) { unset ( $ aVouchers [ $ sId ] ) ; } $ oSeries = $ this -> getSerie ( ) ; if ( ! $ oSeries -> oxvoucherseries__oxallowsameseries -> value ) { foreach ( $ aVouchers as $ voucherId => $ voucherNr ) { $ oVoucher = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ Voucher :: class ) ; $ oVoucher -> load ( $ voucherId ) ; if ( $ this -> oxvouchers__oxvoucherserieid -> value == $ oVoucher -> oxvouchers__oxvoucherserieid -> value ) { $ oEx = oxNew ( \ OxidEsales \ Eshop \ Core \ Exception \ VoucherException :: class ) ; $ oEx -> setMessage ( 'ERROR_MESSAGE_VOUCHER_NOTALLOWEDSAMESERIES' ) ; $ oEx -> setVoucherNr ( $ this -> oxvouchers__oxvouchernr -> value ) ; throw $ oEx ; } } } } return true ; }
Checks if calculation with vouchers of the same series possible. Returns
true on success.

@param array $aVouchers array of vouchers

@throws oxVoucherException exception

@return bool
Checks if calculation with vouchers of the same series possible . Returns true on success .