<?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     [[package名]]
 * @author      Your Name <mail@example.com>
 * @access      public
 */
class Seller_Itemexhibit_Detail
{
    var $preaction;

    var $checklist;//listから受け取る受注番号
    var $orderno;
    var $orderrowno;

    var $auth;
    var $c_valuation;
    var $c_order;
    var $c_stock;

    var $consumerdate; 
    var $orderdate;
    var $sumprice;
    
    var $exists = true;
    
    var $page;
    
    /**
     * [[機能説明]]
     *
     * @access  public
     */
    function execute()
    {
        //購入者情報取得
        $membercd = $this->auth->getAuthData("membercd");
        $this->consumerdate = $this->c_valuation->getConsumerData($membercd, $this->orderno);

        if(empty($this->consumerdate)){
            $this->exists = false;
            return "success";
        }
        
        //$this -> consumerdate["orderdate"] = date('Y/m/d', strtotime($this -> consumerdate["orderdate"]));
        
        //受注Noから商品情報取得
        $orderno = $this->consumerdate["orderno"];
        $orderdetail = $this->c_order->getOrderDetailForSeller($orderno);
        $this->sumprice = 0;
        foreach($orderdetail as $key => $order){
            $this->orderrowno = $order["orderrowno"];
            $this->orderdate[$key]["itemnm"] = $order["itemnm"] ." ". $order["variationnm"]; 
            $this->orderdate[$key]["exno"] = $order["itemcd"] ."-". $order["structcd"] ."-". $order["stockcd"] ."-". $order["sellercd"];
            $this->orderdate[$key]["count"]      = $order["count"];
        }

        $log =& LogFactory::getLog();
        $log->debug("Seller_Itemexhibit_Detailが実行されました", "Seller_Itemexhibit_Detail#execute");
        return 'success';
    }
    

    function getPreaction()
    {
        return $this->preaction;
    }

    function setPreaction($preaction)
    {
        $this->preaction = $preaction;
    }
    
    function getDataExists()
    {
        return $this->exists;
    }

}
?>
