Index: /branches/version-2_5-dev/data/class/helper/SC_Helper_Purchase.php
===================================================================
--- /branches/version-2_5-dev/data/class/helper/SC_Helper_Purchase.php	(revision 19943)
+++ /branches/version-2_5-dev/data/class/helper/SC_Helper_Purchase.php	(revision 19949)
@@ -541,5 +541,5 @@
             $sqlval['classcategory_name1'] = $d['classcategory_name1'];
             $sqlval['classcategory_name2'] = $d['classcategory_name2'];
-            $sqlval['price'] = $d['price'];
+            $sqlval['price'] = $d['price02'];
             $sqlval['quantity'] = $val['quantity'];
             $objQuery->insert("dtb_shipment_item", $sqlval);
Index: /branches/version-2_5-dev/data/class/pages/admin/order/LC_Page_Admin_Order_Edit.php
===================================================================
--- /branches/version-2_5-dev/data/class/pages/admin/order/LC_Page_Admin_Order_Edit.php	(revision 19935)
+++ /branches/version-2_5-dev/data/class/pages/admin/order/LC_Page_Admin_Order_Edit.php	(revision 19949)
@@ -219,5 +219,4 @@
         case 'multiple':
             $this->objFormParam->setParam($_POST);
-            $this->tpl_onload = "win03('" . URL_PATH . ADMIN_DIR . "order/multiple.php', 'multiple', '600', '500');";
             break;
 
@@ -408,4 +407,5 @@
         }
 
+        $arrQuantity = array();
         $this->arrShippingIds = array();
         $this->arrProductClassIds = array();
@@ -418,4 +418,5 @@
 
             foreach ($items as $productClassId => $item) {
+                $arrQuantity[$productClassId] += $item['quantity'];
                 foreach ($item as $itemKey => $itemVal) {
                     $this->objFormParam->setValue($itemKey . '_' . $shippingId . '_' . $productClassId, $itemVal);
@@ -423,4 +424,16 @@
             }
         }
+
+        // 受注商品の数量を変更
+        $dest = array();
+        foreach ($arrQuantity as $productClassId => $quantity) {
+            foreach ($this->arrForm['product_class_id'] as $n => $orderProductClassId) {
+                if ($productClassId == $orderProductClassId) {
+                    $dest['quantity'][$n] = $quantity;
+                }
+            }
+        }
+
+        $this->objFormParam->setParam($dest);
     }
 
@@ -496,4 +509,7 @@
     function lfGetOrderDetail($order_id) {
         $objQuery = new SC_Query();
+        $col = "T1.product_id, T1.product_class_id, T1.product_name, "
+            . "T1.product_code, T1.classcategory_name1, T1.classcategory_name2, "
+            . "T1.price, T1.quantity, T1.point_rate, T2.product_type_id";
         $from = <<< __EOS__
                  dtb_order_detail T1
@@ -501,5 +517,5 @@
               ON T1.product_class_id = T2.product_class_id
 __EOS__;
-        $arrRet = $objQuery->select("T1.*, T2.product_type_id", $from,
+        $arrRet = $objQuery->select($col, $from,
                                     "order_id = ?", array($order_id));
         return $arrRet;
@@ -599,4 +615,6 @@
     /**
      * DB更新処理
+     *
+     * TODO リファクタリング
      *
      * @param integer $order_id 注文番号
@@ -690,4 +708,58 @@
         }
 
+        // 配送情報の初期化
+        // FIXME UPDATE/INSERT にする
+        $objQuery->delete('dtb_shipping', "order_id = ?", array($order_id));
+        $objQuery->delete('dtb_shipment_item', "order_id = ?", array($order_id));
+
+        $arrParams = $this->objFormParam->getHashArray();
+        // 配送ID の配列を取得
+        $shippingIds = array();
+        foreach (array_keys($arrParams) as $key) {
+            if (preg_match('/^shipping_id_/', $key)) {
+                $shippingIds[] = $arrParams[$key];
+            }
+        }
+
+        $cols = $objQuery->listTableFields('dtb_shipping');
+        foreach ($shippingIds as $shipping_id) {
+
+            $arrParams['shipping_date_' .  $shipping_id] = SC_Utils_Ex::sfGetTimestamp($arrParams['shipping_date_year_' . $shipping_id],
+                                                                                       $arrParams['shipping_date_month_' . $shipping_id],
+                                                                                       $arrParams['shipping_date_day_' . $shipping_id]);
+            $dest = array();
+            foreach ($arrParams as $key => $val) {
+                $key = preg_replace('/_' . $shipping_id . '$/', '', $key);
+                if (in_array($key, $cols)) {
+                    $dest[$key] = $val;
+                }
+            }
+            $dest['shipping_id'] = $shipping_id;
+            $dest['order_id'] = $order_id;
+            $dest['create_date'] = 'Now()';
+            $dest['update_date'] = 'Now()';
+            $objQuery->insert('dtb_shipping', $dest);
+
+            // 商品規格ID の配列を取得
+            $productClassIds = array();
+            foreach (array_keys($arrParams) as $key) {
+                if (preg_match('/^product_class_id_' . $shipping_id . '_/', $key)) {
+                    $productClassIds[] = $arrParams[$key];
+                }
+            }
+
+            foreach ($productClassIds as $product_class_id) {
+                $item['shipping_id'] = $shipping_id;
+                $item['order_id'] = $order_id;
+                $item['product_class_id'] = $product_class_id;
+                $item['product_name'] = $arrParams['product_name_' . $shipping_id . '_' . $product_class_id];
+                $item['product_code'] = $arrParams['product_code_' . $shipping_id . '_' . $product_class_id];
+                $item['classcategory_name1'] = $arrParams['classcategory_name1_' . $shipping_id . '_' . $product_class_id];
+                $item['classcategory_name2'] = $arrParams['classcategory_name2_' . $shipping_id . '_' . $product_class_id];
+                $item['price'] = $arrParams['price_' . $shipping_id . '_' . $product_class_id];
+                $item['quantity'] = $arrParams['quantity_' . $shipping_id . '_' . $product_class_id];
+                $objQuery->insert("dtb_shipment_item", $item);
+            }
+        }
         $objQuery->commit();
     }
@@ -780,10 +852,14 @@
         $dest = array();
         foreach ($sqlval as $key => $val) {
-            if (in_array($cols, $key)) {
+            if (in_array($key, $cols)) {
                 $dest[$key] = $val;
             }
         }
-        $result = $objQuery->update($table, $dest, "order_id = ?", array($order_id));
-        if ($result == 0) {
+
+        $exists = $objQuery->count("dtb_order", "order_id = ?", array($order_id));
+        if ($exists > 0) {
+            $objQuery->update($table, $dest, "order_id = ?", array($order_id));
+        } else {
+            // TODO
             $dest['order_id'] = $order_id;
             $result = $objQuery->insert($table, $dest);
Index: /branches/version-2_5-dev/data/Smarty/templates/admin/order/edit.tpl
===================================================================
--- /branches/version-2_5-dev/data/Smarty/templates/admin/order/edit.tpl	(revision 19946)
+++ /branches/version-2_5-dev/data/Smarty/templates/admin/order/edit.tpl	(revision 19949)
@@ -56,4 +56,6 @@
 
     function fnMultiple() {
+        win03('<!--{$smarty.const.URL_PATH}--><!--{$smarty.const.ADMIN_DIR}-->order/multiple.php', 'multiple', '600', '500');
+        document.form1.anchor_key.value = "shipping";
         document.form1.mode.value = "multiple";
         document.form1.submit();
@@ -81,15 +83,14 @@
         <tr>
             <th>帳票出力</th>
-            <td><a class="btn-normal" href="javascript:;" onclick="win02('pdf.php?order_id=<!--{$arrForm.order_id.value}-->','pdf','1000','800'); return false;">帳票出力</a></td>
+            <td><a class="btn-normal" href="javascript:;" onclick="win02('pdf.php?order_id=<!--{$arrForm.order_id.value}-->','pdf','615','800'); return false;">帳票出力</a></td>
         </tr>
         <!--{/if}-->
         <tr>
             <th>注文番号</th>
-            <td><!--{$tpl_order_id|h}--></td>
+            <td><!--{$arrForm.order_id.value|h}--></td>
         </tr>
         <tr>
             <th>受注日</th>
-            <td><!--{$arrForm.create_date.value|sfDispDBDate}--></td>
-            <input type="hidden" name="create_date" value="<!--{$arrForm.create_date.value}-->" />
+            <td><!--{$arrForm.create_date.value|sfDispDBDate}--><input type="hidden" name="create_date" value="<!--{$arrForm.create_date.value}-->" /></td>
         </tr>
         <tr>
@@ -353,5 +354,5 @@
         <a class="btn-normal" href="javascript:;" name="input_from_order_data" onclick="fnCopyFromOrderData();">お客様情報へお届けする</a>
         <a class="btn-normal" href="javascript:;" name="input_from_order_data" onclick="fnCopyFromOrderData();">お届け先を新規追加</a>
-        <a class="btn-normal" href="javascript:;" name="input_from_order_data" onclick="fnModeSubmit('multiple','anchor_key','shipping');">複数のお届け先を指定する</a>
+        <a class="btn-normal" href="javascript:;" name="input_from_order_data" onclick="fnMultiple();">複数のお届け先を指定する</a>
     </h2>
 
@@ -536,5 +537,5 @@
                 <!--{assign var=key value="note"}-->
                 <span class="attention"><!--{$arrErr[$key]}--></span>
-                <textarea name="<!--{$key}-->" maxlength="<!--{$arrForm[$key].length}-->" cols="80" rows="6" class="area80" style="<!--{$arrErr[$key]|sfGetErrorColor}-->" ><!--{$arrForm[$key].value|h}--></textarea></td>
+                <textarea name="<!--{$key}-->" maxlength="<!--{$arrForm[$key].length}-->" cols="80" rows="6" class="area80" style="<!--{$arrErr[$key]|sfGetErrorColor}-->" ><!--{$arrForm[$key].value|h}--></textarea>
             </td>
         </tr>
Index: /branches/version-2_5-dev/data/Smarty/templates/admin/main_frame.tpl
===================================================================
--- /branches/version-2_5-dev/data/Smarty/templates/admin/main_frame.tpl	(revision 19943)
+++ /branches/version-2_5-dev/data/Smarty/templates/admin/main_frame.tpl	(revision 19949)
@@ -154,5 +154,4 @@
 
 </div>
-</div>
 </body>
 </html>
