<?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     Admin.Itemmanage.Change.Stock.Delete.Form
 * @author      H.Watanabe <hiroshi.watanabe@netnee.jp>
 * @access      public
 */
class Admin_Itemmanage_Change_Stock_Delete_Form
{
    var $actionnm;
    var $view;
    var $stockview;
    var $itemupdate;
    var $div;
    
    var $result;
    var $struct;
    var $stock;
    var $from;
    
    var $itemdiv;
    var $jancode;
    var $hinban;
    var $itemtitle;
    var $release_date_start;
    var $release_date_end;
    var $publish_date_start;
    var $publish_date_end;
    var $maker_capital;
    var $maker_name;
    var $media;
    var $cast;
    var $situation;
    var $photo_situation;
    var $publish_situation;
    var $sort;
    var $genre_select;
    
    var $cd;
    var $structcd;
    var $stockcd;
    
    var $itemnm;
    var $makeritemcd;
    var $medianm;
    var $makerprice;
    
    var $sellingprice;
    var $costprice;
    var $supplidiv;
    var $stocktitlecdcont;
    var $condition;
    var $stockstate;
    var $scdstartdate;
    var $scdcompdate;
    var $itemexp;
    var $updcnt;
    
    var $stocktitlecd;
    
    /**
     * execute
     *
     * @access  public
     */
    function execute()
    {
        $log =& LogFactory::getLog();
        $log->debug("Admin_Itemmanage_Change_Stock_Delete_Formが実行されました", "Admin_Itemmanage_Change_Stock_Delete_Form#execute");
        
        $this->result = $this->view->getOneItem();
        $this->struct = $this->view->getOneItemOneStruct();
        
        $this->itemnm      = $this->struct["itemnm"];
        $this->makeritemcd = $this->struct["makeritemcd"];
        $this->medianm     = $this->struct["medianm"];
        $this->makerprice  = $this->struct["makerprice"];
        
        $this->stock = $this->stockview->getStockTilteSelect($this->cd,$this->structcd,$this->stockcd);
        
        if ( !isset($this->sellingprice) && !isset($this->souryouprc) && !isset($this->costprice) && !isset($this->supplidiv) && 
                !isset($this->exhibitcount) && !isset($this->condition) && !isset($this->stockstate) && !isset($this->scdstartdate) && 
                !isset($this->scdcompdate) && !isset($this->itemexp) && !isset($this->updcnt)) {
            $this->sellingprice = $this->stock["sellingprice"];
            $this->souryouprc   = $this->stock["souryouprc"];
            $this->costprice    = $this->stock["costprice"];
            $this->supplidiv    = $this->stock["supplidiv"];
            $this->stocktitlecdcont = $this->stock["stocktitlecdcont"];
            $this->condition    = $this->stock["condition"];
            $this->stockstate   = $this->stock["stockstate"];
            $this->scdstartdate = $this->stock["scdstartdate"];
            $this->scdcompdate  = $this->stock["scdcompdate"];
            $this->itemexp      = $this->stock["itemexp"];
            $this->updcnt       = $this->stock["updcnt"];
            $this->stocktitlecd = $this->stock["stocktitlecd"];
        }

        return 'check_success';
    }
    
    /**
    * マスタより Name取得
    */
    function getSupplidivName()
    {
        return $this->itemupdate->getSupplidivName($this->supplidiv);
    }
    
    function getConditionName()
    {
        return $this->itemupdate->getConditionName($this->condition);
    }
    
    function getStockstateName()
    {
        return $this->itemupdate->getStockstateName($this->stockstate);
    }
    

}
?>
