src/ShopBundle/objects/db/TShopVoucher.class.php
public function checkMarkVoucherAsCompletelyUsed()
    {
        $bMarkVoucherAsCompletelyUsed = false;
        $oVoucherSeries = &$this->GetFieldShopVoucherSeries();
        if ('absolut' == $oVoucherSeries->fieldValueType && !is_null($oVoucherSeries->GetFieldShopVoucherSeriesSponsor())) {
            $dValueUsed = $this->GetValuePreviouslyUsed();
            if ($dValueUsed >= $this->GetVoucherSeriesOriginalValue()) {
                $bMarkVoucherAsCompletelyUsed = true;
            }
        } elseif ('absolut' == $oVoucherSeries->fieldValueType && is_null($oVoucherSeries->GetFieldShopVoucherSeriesSponsor())) {
            $bMarkVoucherAsCompletelyUsed = true;
        } else {
            $bMarkVoucherAsCompletelyUsed = true;
        }

        return $bMarkVoucherAsCompletelyUsed;
    }
public function checkMarkVoucherAsCompletelyUsed()
    {
        $bMarkVoucherAsCompletelyUsed = false;
        $oVoucherSeries = &$this->GetFieldShopVoucherSeries();
        if ('absolut' == $oVoucherSeries->fieldValueType && !is_null($oVoucherSeries->GetFieldShopVoucherSeriesSponsor())) {
            $dValueUsed = $this->GetValuePreviouslyUsed();
            if ($dValueUsed >= $this->GetVoucherSeriesOriginalValue()) {
                $bMarkVoucherAsCompletelyUsed = true;
            }
        } elseif ('absolut' == $oVoucherSeries->fieldValueType && is_null($oVoucherSeries->GetFieldShopVoucherSeriesSponsor())) {
            $bMarkVoucherAsCompletelyUsed = true;
        } else {
            $bMarkVoucherAsCompletelyUsed = true;
        }

        return $bMarkVoucherAsCompletelyUsed;
    }
public function checkMarkVoucherAsCompletelyUsed ( ) { $ bMarkVoucherAsCompletelyUsed = false ; $ oVoucherSeries = & $ this -> GetFieldShopVoucherSeries ( ) ; if ( 'absolut' == $ oVoucherSeries -> fieldValueType && ! is_null ( $ oVoucherSeries -> GetFieldShopVoucherSeriesSponsor ( ) ) ) { $ dValueUsed = $ this -> GetValuePreviouslyUsed ( ) ; if ( $ dValueUsed >= $ this -> GetVoucherSeriesOriginalValue ( ) ) { $ bMarkVoucherAsCompletelyUsed = true ; } } elseif ( 'absolut' == $ oVoucherSeries -> fieldValueType && is_null ( $ oVoucherSeries -> GetFieldShopVoucherSeriesSponsor ( ) ) ) { $ bMarkVoucherAsCompletelyUsed = true ; } else { $ bMarkVoucherAsCompletelyUsed = true ; } return $ bMarkVoucherAsCompletelyUsed ; }
if the voucher
1.) has an absolute value, a sponsor, and if the value has been used up
2.) has an absolute value, no sponsor
3.) has an relative value
we need to mark the voucher as used.

@return bool
if the voucher 1 . ) has an absolute value a sponsor and if the value has been used up 2 . ) has an absolute value no sponsor 3 . ) has an relative value we need to mark the voucher as used .