<?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.Update.Done
 * @author      H.Watanabe <hiroshi.watanabe@netnee.jp>
 * @access      public
 */
class Admin_Itemmanage_Change_Stock_Update_Done
{
    var $actionnm;

    var $itemstruct;
    var $stockview;

    var $title;
    var $pagename;
    var $from;
    var $div;

    var $structcd;
    var $stockcd;
    var $upduser;
    var $updcnt;

    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 $sellingprice;
    var $costprice;
    var $souryouprc;
    var $supplidiv;
    var $stocktitlecdcont;
    var $condition;
    var $scdstartdate;
    var $scdcompdate;
    var $stockstate;
    var $itemexp;

    var $stocktype;
    var $fromlist_salestartdate;
    var $fromlist_orderclosedate;

    /**
     * execute
     *
     * @access  public
     */
    function execute()
    {
        $log =& LogFactory::getLog();
        $log->debug("Admin_Itemmanage_Change_Stock_Update_Doneが実行されました", "Admin_Itemmanage_Change_Stock_Update_Done#execute");

        $div = (empty($this->div)) ? 2 : 1;

        if (empty($this->sellingprice)) {
            $this->sellingprice = NULL;
        }
        if (empty($this->costprice)) {
            $this->costprice = NULL;
        }
        if (empty($this->scdstartdate)) {
            $this->scdstartdate = NULL;
        }
        if (empty($this->scdcompdate)) {
            $this->scdcompdate = NULL;
        }
        if (empty($this->itemexp)) {
            $this->itemexp = NULL;
        }


        $row = $this->stockview->update( $this->cd, $this->structcd, $this->stockcd, $this->supplidiv,
                                            $this->stocktitlecdcont, $this->condition, $this->sellingprice,
                                            $this->souryouprc, $this->stockstate, $this->scdstartdate,
                                            $this->scdcompdate, $this->itemexp, $this->costprice,
                                            $this->upduser, $this->updcnt);


        if (!$row) return "error";
        return 'done_success';
    }
}
?>