<?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.Ordermanage.Instruction.Forwarddone
 * @author      netnee <mail@example.com>
 * @access      public
 */
class Admin_Ordermanage_Instruction_Forwarddone
{
    var $forward;
    
    var $pagename;
    var $title;
    var $upduser;
    
    var $orderno;
    
    var $res = false;
    var $created = false;
    
    
    /**
     * execute
     *
     * @access  public
     */
    function execute()
    {
        $log =& LogFactory::getLog();
        $log->debug("Admin_Ordermanage_Instruction_Forwarddoneが実行されました", "Admin_Ordermanage_Instruction_Forwarddone#execute");
        
        
        // 出荷指示更新
        $odrarray = array();
        if (is_array($this->orderno)){
            foreach($this->orderno as $val){
                $num_arr = explode("-", $val);
                if (is_numeric($num_arr[0]) && is_numeric($num_arr[1])){
                    $odrarray[] = array( "no" => $num_arr[0], "row"  => $num_arr[1], "updcnt" => $num_arr[2]);
                }
            }
        }
        
        if (!empty($odrarray)) $this->res = $this->forward->instructionUpdate($odrarray, 3, $this->upduser);
        
        
        return 'success';
    }
    
}
?>
