<?php
/**
 * @copyright ONE/DEPO Project
 * @license   PHP License 3.01 <http://www.php.net/license/3_01.txt>
 */


/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */

/**
 * [[機能説明]]
 *
 * @package     Seller.Itemexhibit.Refund.Complete
 * @author      T.Shimano <shimano@fuco.jp>
 * @access      public
 */
class Seller_Itemexhibit_Refund_Complete
{
	// DBインターフェイス 
    var $refund;
    
    // 検索結果
    var $orderinfo;
    var $data;
    var $count;
    var $subitem;
    
    // ユーザー情報 
    var $auth;
    
    // 入力 
    var $orderno;
    var $refundtype;
    var $refundprice;
    var $comment;
    
    /**
     * [[機能説明]]
     *
     * @access  public
     */
    function execute()
    {
    	$memberCd = $this -> auth -> getAuthData("membercd");
    	 
    	$orderinfo = $this->refund->getOrderInfo($this->orderno, $memberCd);
    	 
    	if($this->refundtype == 'all' || $this->refundprice == $orderinfo["allprice"]) {
    	    $res = $this->refund->insert($this->orderno, $memberCd, $this->comment, NULL, "");
    	} else {
    		$res = $this->refund->insert($this->orderno, $memberCd, $this->comment, $this->refundprice, "");
    	}
    	if (!$res) {
            return 'error';
        }
        $log =& LogFactory::getLog();
        $log->debug("Seller_Itemexhibit_Refund_Completeが実行されました", "Seller_Itemexhibit_Refund_Complete#execute");
        return 'success';
    }
    
}
?>