source/Application/Model/Voucher.php
public function markAsUsed($sOrderId, $sUserId, $dDiscount)
    {
        //saving oxreserved field
        if ($this->oxvouchers__oxid->value) {
            $this->oxvouchers__oxorderid->setValue($sOrderId);
            $this->oxvouchers__oxuserid->setValue($sUserId);
            $this->oxvouchers__oxdiscount->setValue($dDiscount);
            $this->oxvouchers__oxdateused->setValue(date("Y-m-d", \OxidEsales\Eshop\Core\Registry::getUtilsDate()->getTime()));
            $this->save();
        }
    }
public function markAsUsed($sOrderId, $sUserId, $dDiscount)
    {
        //saving oxreserved field
        if ($this->oxvouchers__oxid->value) {
            $this->oxvouchers__oxorderid->setValue($sOrderId);
            $this->oxvouchers__oxuserid->setValue($sUserId);
            $this->oxvouchers__oxdiscount->setValue($dDiscount);
            $this->oxvouchers__oxdateused->setValue(date("Y-m-d", \OxidEsales\Eshop\Core\Registry::getUtilsDate()->getTime()));
            $this->save();
        }
    }
public function markAsUsed ( $ sOrderId , $ sUserId , $ dDiscount ) { //saving oxreserved field if ( $ this -> oxvouchers__oxid -> value ) { $ this -> oxvouchers__oxorderid -> setValue ( $ sOrderId ) ; $ this -> oxvouchers__oxuserid -> setValue ( $ sUserId ) ; $ this -> oxvouchers__oxdiscount -> setValue ( $ dDiscount ) ; $ this -> oxvouchers__oxdateused -> setValue ( date ( "Y-m-d" , \ OxidEsales \ Eshop \ Core \ Registry :: getUtilsDate ( ) -> getTime ( ) ) ) ; $ this -> save ( ) ; } }
marks voucher as used

@param string $sOrderId  order id
@param string $sUserId   user id
@param double $dDiscount used discount
marks voucher as used