Index: /branches/version-2_13-dev/data/class/pages/admin/order/LC_Page_Admin_Order_Edit.php
===================================================================
--- /branches/version-2_13-dev/data/class/pages/admin/order/LC_Page_Admin_Order_Edit.php	(revision 22567)
+++ /branches/version-2_13-dev/data/class/pages/admin/order/LC_Page_Admin_Order_Edit.php	(revision 22792)
@@ -32,5 +32,5 @@
  * @version $Id$
  */
-class LC_Page_Admin_Order_Edit extends LC_Page_Admin_Order_Ex 
+class LC_Page_Admin_Order_Edit extends LC_Page_Admin_Order_Ex
 {
 
@@ -311,381 +311,381 @@
     }
 
-/**
- * デストラクタ.
- *
- * @return void
- */
-function destroy()
-{
-    parent::destroy();
-}
-
-/**
- * パラメーター情報の初期化を行う.
- *
- * @param SC_FormParam $objFormParam SC_FormParam インスタンス
- * @return void
- */
-function lfInitParam(&$objFormParam)
-{
-    // 検索条件のパラメーターを初期化
-    parent::lfInitParam($objFormParam);
-
-    // お客様情報
-    $objFormParam->addParam('注文者 お名前(姓)', 'order_name01', STEXT_LEN, 'KVa', array('EXIST_CHECK', 'SPTAB_CHECK', 'MAX_LENGTH_CHECK'));
-    $objFormParam->addParam('注文者 お名前(名)', 'order_name02', STEXT_LEN, 'KVa', array('EXIST_CHECK', 'SPTAB_CHECK', 'MAX_LENGTH_CHECK'));
-    $objFormParam->addParam('注文者 お名前(フリガナ・姓)', 'order_kana01', STEXT_LEN, 'KVCa', array('EXIST_CHECK', 'SPTAB_CHECK', 'MAX_LENGTH_CHECK'));
-    $objFormParam->addParam('注文者 お名前(フリガナ・名)', 'order_kana02', STEXT_LEN, 'KVCa', array('EXIST_CHECK', 'SPTAB_CHECK', 'MAX_LENGTH_CHECK'));
-    $objFormParam->addParam('メールアドレス', 'order_email', null, 'KVCa', array('NO_SPTAB', 'EMAIL_CHECK', 'EMAIL_CHAR_CHECK'));
-    $objFormParam->addParam('郵便番号1', 'order_zip01', ZIP01_LEN, 'n', array('NUM_CHECK', 'NUM_COUNT_CHECK'));
-    $objFormParam->addParam('郵便番号2', 'order_zip02', ZIP02_LEN, 'n', array('NUM_CHECK', 'NUM_COUNT_CHECK'));
-    $objFormParam->addParam('都道府県', 'order_pref', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK'));
-    $objFormParam->addParam('住所1', 'order_addr01', MTEXT_LEN, 'KVa', array('SPTAB_CHECK', 'MAX_LENGTH_CHECK'));
-    $objFormParam->addParam('住所2', 'order_addr02', MTEXT_LEN, 'KVa', array('SPTAB_CHECK', 'MAX_LENGTH_CHECK'));
-    $objFormParam->addParam('電話番号1', 'order_tel01', TEL_ITEM_LEN, 'n', array('MAX_LENGTH_CHECK' ,'NUM_CHECK'));
-    $objFormParam->addParam('電話番号2', 'order_tel02', TEL_ITEM_LEN, 'n', array('MAX_LENGTH_CHECK' ,'NUM_CHECK'));
-    $objFormParam->addParam('電話番号3', 'order_tel03', TEL_ITEM_LEN, 'n', array('MAX_LENGTH_CHECK' ,'NUM_CHECK'));
-    $objFormParam->addParam('FAX番号1', 'order_fax01', TEL_ITEM_LEN, 'n', array('MAX_LENGTH_CHECK' ,'NUM_CHECK'));
-    $objFormParam->addParam('FAX番号2', 'order_fax02', TEL_ITEM_LEN, 'n', array('MAX_LENGTH_CHECK' ,'NUM_CHECK'));
-    $objFormParam->addParam('FAX番号3', 'order_fax03', TEL_ITEM_LEN, 'n', array('MAX_LENGTH_CHECK' ,'NUM_CHECK'));
-
-    // 受注商品情報
-    $objFormParam->addParam('値引き', 'discount', INT_LEN, 'n', array('EXIST_CHECK', 'MAX_LENGTH_CHECK', 'NUM_CHECK'), '0');
-    $objFormParam->addParam('送料', 'deliv_fee', INT_LEN, 'n', array('EXIST_CHECK', 'MAX_LENGTH_CHECK', 'NUM_CHECK'), '0');
-    $objFormParam->addParam('手数料', 'charge', INT_LEN, 'n', array('EXIST_CHECK', 'MAX_LENGTH_CHECK', 'NUM_CHECK'), '0');
-
-    // ポイント機能ON時のみ
-    if (USE_POINT !== false) {
-        $objFormParam->addParam('利用ポイント', 'use_point', INT_LEN, 'n', array('EXIST_CHECK', 'MAX_LENGTH_CHECK', 'NUM_CHECK'));
-    }
-
-    $objFormParam->addParam('配送業者', 'deliv_id', INT_LEN, 'n', array('EXIST_CHECK', 'MAX_LENGTH_CHECK', 'NUM_CHECK'));
-    $objFormParam->addParam('お支払い方法', 'payment_id', INT_LEN, 'n', array('EXIST_CHECK', 'MAX_LENGTH_CHECK', 'NUM_CHECK'));
-    $objFormParam->addParam('対応状況', 'status', INT_LEN, 'n', array('EXIST_CHECK', 'MAX_LENGTH_CHECK', 'NUM_CHECK'));
-    $objFormParam->addParam('お支払方法名称', 'payment_method');
-
-
-    // 受注詳細情報
-    $objFormParam->addParam('商品種別ID', 'product_type_id', INT_LEN, 'n', array('EXIST_CHECK', 'MAX_LENGTH_CHECK', 'NUM_CHECK'), '0');
-    $objFormParam->addParam('単価', 'price', INT_LEN, 'n', array('EXIST_CHECK', 'MAX_LENGTH_CHECK', 'NUM_CHECK'), '0');
-    $objFormParam->addParam('数量', 'quantity', INT_LEN, 'n', array('EXIST_CHECK', 'MAX_LENGTH_CHECK', 'NUM_CHECK'), '0');
-    $objFormParam->addParam('商品ID', 'product_id', INT_LEN, 'n', array('EXIST_CHECK', 'MAX_LENGTH_CHECK', 'NUM_CHECK'), '0');
-    $objFormParam->addParam('商品規格ID', 'product_class_id', INT_LEN, 'n', array('EXIST_CHECK', 'MAX_LENGTH_CHECK', 'NUM_CHECK'), '0');
-    $objFormParam->addParam('ポイント付与率', 'point_rate');
-    $objFormParam->addParam('商品コード', 'product_code');
-    $objFormParam->addParam('商品名', 'product_name');
-    $objFormParam->addParam('規格名1', 'classcategory_name1');
-    $objFormParam->addParam('規格名2', 'classcategory_name2');
-    $objFormParam->addParam('税率', 'tax_rate');
-    $objFormParam->addParam('課税規則', 'tax_rule');
-    $objFormParam->addParam('メモ', 'note', MTEXT_LEN, 'KVa', array('MAX_LENGTH_CHECK'));
-    $objFormParam->addParam('削除用項番', 'delete_no', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK'));
-
-    // DB読込用
-    $objFormParam->addParam('小計', 'subtotal');
-    $objFormParam->addParam('合計', 'total');
-    $objFormParam->addParam('支払い合計', 'payment_total');
-    $objFormParam->addParam('加算ポイント', 'add_point');
-    $objFormParam->addParam('お誕生日ポイント', 'birth_point', null, 'n', array(), 0);
-    $objFormParam->addParam('消費税合計', 'tax');
-    $objFormParam->addParam('最終保持ポイント', 'total_point');
-    $objFormParam->addParam('会員ID', 'customer_id', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK'), '0');
-    $objFormParam->addParam('会員ID', 'edit_customer_id', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK'), '0');
-    $objFormParam->addParam('現在のポイント', 'customer_point');
-    $objFormParam->addParam('受注前ポイント', 'point');
-    $objFormParam->addParam('注文番号', 'order_id');
-    $objFormParam->addParam('受注日', 'create_date');
-    $objFormParam->addParam('発送日', 'commit_date');
-    $objFormParam->addParam('備考', 'message');
-    $objFormParam->addParam('入金日', 'payment_date');
-    $objFormParam->addParam('端末種別', 'device_type_id');
-    $objFormParam->addParam('税率', 'order_tax_rate');
-    $objFormParam->addParam('課税規則', 'order_tax_rule');
-
-    // 複数情報
-    $objFormParam->addParam('配送数', 'shipping_quantity', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK'), 1);
-    $objFormParam->addParam('配送ID', 'shipping_id', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK'), 0);
-    $objFormParam->addParam('お名前(姓)', 'shipping_name01', STEXT_LEN, 'KVa', array('SPTAB_CHECK', 'MAX_LENGTH_CHECK'));
-    $objFormParam->addParam('お名前(名)', 'shipping_name02', STEXT_LEN, 'KVa', array('SPTAB_CHECK', 'MAX_LENGTH_CHECK'));
-    $objFormParam->addParam('お名前(フリガナ・姓)', 'shipping_kana01', STEXT_LEN, 'KVCa', array('SPTAB_CHECK', 'MAX_LENGTH_CHECK'));
-    $objFormParam->addParam('お名前(フリガナ・名)', 'shipping_kana02', STEXT_LEN, 'KVCa', array('SPTAB_CHECK', 'MAX_LENGTH_CHECK'));
-    $objFormParam->addParam('郵便番号1', 'shipping_zip01', ZIP01_LEN, 'n', array('NUM_CHECK', 'NUM_COUNT_CHECK'));
-    $objFormParam->addParam('郵便番号2', 'shipping_zip02', ZIP02_LEN, 'n', array('NUM_CHECK', 'NUM_COUNT_CHECK'));
-    $objFormParam->addParam('都道府県', 'shipping_pref', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK'));
-    $objFormParam->addParam('住所1', 'shipping_addr01', MTEXT_LEN, 'KVa', array('SPTAB_CHECK', 'MAX_LENGTH_CHECK'));
-    $objFormParam->addParam('住所2', 'shipping_addr02', MTEXT_LEN, 'KVa', array('SPTAB_CHECK', 'MAX_LENGTH_CHECK'));
-    $objFormParam->addParam('電話番号1', 'shipping_tel01', TEL_ITEM_LEN, 'n', array('MAX_LENGTH_CHECK' ,'NUM_CHECK'));
-    $objFormParam->addParam('電話番号2', 'shipping_tel02', TEL_ITEM_LEN, 'n', array('MAX_LENGTH_CHECK' ,'NUM_CHECK'));
-    $objFormParam->addParam('電話番号3', 'shipping_tel03', TEL_ITEM_LEN, 'n', array('MAX_LENGTH_CHECK' ,'NUM_CHECK'));
-    $objFormParam->addParam('FAX番号1', 'shipping_fax01', TEL_ITEM_LEN, 'n', array('MAX_LENGTH_CHECK' ,'NUM_CHECK'));
-    $objFormParam->addParam('FAX番号2', 'shipping_fax02', TEL_ITEM_LEN, 'n', array('MAX_LENGTH_CHECK' ,'NUM_CHECK'));
-    $objFormParam->addParam('FAX番号3', 'shipping_fax03', TEL_ITEM_LEN, 'n', array('MAX_LENGTH_CHECK' ,'NUM_CHECK'));
-    $objFormParam->addParam('お届け時間ID', 'time_id', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK'));
-    $objFormParam->addParam('お届け日(年)', 'shipping_date_year', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK'));
-    $objFormParam->addParam('お届け日(月)', 'shipping_date_month', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK'));
-    $objFormParam->addParam('お届け日(日)', 'shipping_date_day', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK'));
-    $objFormParam->addParam('お届け日', 'shipping_date', STEXT_LEN, 'KVa', array('SPTAB_CHECK', 'MAX_LENGTH_CHECK'));
-    $objFormParam->addParam('配送商品数量', 'shipping_product_quantity', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK'));
-
-    $objFormParam->addParam('商品規格ID', 'shipment_product_class_id', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK'));
-    $objFormParam->addParam('商品コード', 'shipment_product_code');
-    $objFormParam->addParam('商品名', 'shipment_product_name');
-    $objFormParam->addParam('規格名1', 'shipment_classcategory_name1');
-    $objFormParam->addParam('規格名2', 'shipment_classcategory_name2');
-    $objFormParam->addParam('単価', 'shipment_price', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK'), '0');
-    $objFormParam->addParam('数量', 'shipment_quantity', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK'), '0');
-
-    $objFormParam->addParam('商品項番', 'no', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK'));
-    $objFormParam->addParam('追加商品規格ID', 'add_product_class_id', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK'));
-    $objFormParam->addParam('修正商品規格ID', 'edit_product_class_id', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK'));
-    $objFormParam->addParam('対象届け先ID', 'select_shipping_id', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK'));
-    $objFormParam->addParam('アンカーキー', 'anchor_key', STEXT_LEN, 'KVa', array('SPTAB_CHECK', 'MAX_LENGTH_CHECK'));
-}
-
-/**
- * 複数配送用フォームの初期化を行う.
- *
- * @param SC_FormParam $objFormParam SC_FormParam インスタンス
- * @return void
- */
-function lfInitMultipleParam(&$objFormParam)
-{
-    $objFormParam->addParam('商品規格ID', 'multiple_product_class_id', INT_LEN, 'n', array('EXIST_CHECK', 'MAX_LENGTH_CHECK', 'NUM_CHECK'));
-    $objFormParam->addParam('商品コード', 'multiple_product_code', INT_LEN, 'n', array('EXIST_CHECK', 'MAX_LENGTH_CHECK', 'NUM_CHECK'), 1);
-    $objFormParam->addParam('商品名', 'multiple_product_name', INT_LEN, 'n', array('EXIST_CHECK', 'MAX_LENGTH_CHECK', 'NUM_CHECK'), 1);
-    $objFormParam->addParam('規格1', 'multiple_classcategory_name1', INT_LEN, 'n', array('EXIST_CHECK', 'MAX_LENGTH_CHECK', 'NUM_CHECK'), 1);
-    $objFormParam->addParam('規格2', 'multiple_classcategory_name2', INT_LEN, 'n', array('EXIST_CHECK', 'MAX_LENGTH_CHECK', 'NUM_CHECK'), 1);
-    $objFormParam->addParam('単価', 'multiple_price', INT_LEN, 'n', array('EXIST_CHECK', 'MAX_LENGTH_CHECK', 'NUM_CHECK'), 1);
-    $objFormParam->addParam('数量', 'multiple_quantity', INT_LEN, 'n', array('EXIST_CHECK', 'MAX_LENGTH_CHECK', 'NUM_CHECK'), 1);
-    $objFormParam->addParam('お届け先', 'multiple_shipping_id', INT_LEN, 'n', array('EXIST_CHECK', 'MAX_LENGTH_CHECK', 'NUM_CHECK'));
-}
-
-/**
- * 複数配送入力フォームで入力された値を SC_FormParam へ設定する.
- *
- * @param SC_FormParam $objFormParam SC_FormParam インスタンス
- * @return void
- */
-function setMultipleItemTo(&$objFormParam)
-{
-    $arrMultipleKey = array('multiple_shipping_id',
-            'multiple_product_class_id',
-            'multiple_product_name',
-            'multiple_product_code',
-            'multiple_classcategory_name1',
-            'multiple_classcategory_name2',
-            'multiple_price',
-            'multiple_quantity');
-    $arrMultipleParams = $objFormParam->getSwapArray($arrMultipleKey);
-
-    /*
-     * 複数配送フォームの入力値を shipping_id ごとにマージ
-     *
-     * $arrShipmentItem[お届け先ID][商品規格ID]['shipment_(key)'] = 値
-     */
-    $arrShipmentItem = array();
-    foreach ($arrMultipleParams as $arrMultiple) {
-        $shipping_id = $arrMultiple['multiple_shipping_id'];
-        $product_class_id = $arrMultiple['multiple_product_class_id'];
-        foreach ($arrMultiple as $key => $val) {
-            if ($key == 'multiple_quantity') {
-                $arrShipmentItem[$shipping_id][$product_class_id][str_replace('multiple', 'shipment', $key)] += $val;
-            } else {
-                $arrShipmentItem[$shipping_id][$product_class_id][str_replace('multiple', 'shipment', $key)] = $val;
-            }
-        }
-    }
-
-    /*
-     * フォームのお届け先ごとの配列を生成
-     *
-     * $arrShipmentForm['(key)'][$shipping_id][$item_index] = 値
-     * $arrProductQuantity[$shipping_id] = お届け先ごとの配送商品数量
-     */
-    $arrShipmentForm = array();
-    $arrProductQuantity = array();
-    $arrShippingIds = $objFormParam->getValue('shipping_id');
-    foreach ($arrShippingIds as $shipping_id) {
-        $item_index = 0;
-        foreach ($arrShipmentItem[$shipping_id] as $product_class_id => $shipment_item) {
-            foreach ($shipment_item as $key => $val) {
-                $arrShipmentForm[$key][$shipping_id][$item_index] = $val;
-            }
-            // 受注商品の数量を設定
-            $arrQuantity[$product_class_id] += $shipment_item['shipment_quantity'];
-            $item_index++;
-        }
-        // お届け先ごとの配送商品数量を設定
-        $arrProductQuantity[$shipping_id] = count($arrShipmentItem[$shipping_id]);
-    }
-
-    $objFormParam->setParam($arrShipmentForm);
-    $objFormParam->setValue('shipping_product_quantity', $arrProductQuantity);
-
-    // 受注商品の数量を変更
-    $arrDest = array();
-    foreach ($objFormParam->getValue('product_class_id') as $n => $order_product_class_id) {
-        $arrDest['quantity'][$n] = 0;
-    }
-    foreach ($arrQuantity as $product_class_id => $quantity) {
+    /**
+     * デストラクタ.
+     *
+     * @return void
+     */
+    function destroy()
+    {
+        parent::destroy();
+    }
+
+    /**
+     * パラメーター情報の初期化を行う.
+     *
+     * @param SC_FormParam $objFormParam SC_FormParam インスタンス
+     * @return void
+     */
+    function lfInitParam(&$objFormParam)
+    {
+        // 検索条件のパラメーターを初期化
+        parent::lfInitParam($objFormParam);
+
+        // お客様情報
+        $objFormParam->addParam('注文者 お名前(姓)', 'order_name01', STEXT_LEN, 'KVa', array('EXIST_CHECK', 'SPTAB_CHECK', 'MAX_LENGTH_CHECK'));
+        $objFormParam->addParam('注文者 お名前(名)', 'order_name02', STEXT_LEN, 'KVa', array('EXIST_CHECK', 'SPTAB_CHECK', 'MAX_LENGTH_CHECK'));
+        $objFormParam->addParam('注文者 お名前(フリガナ・姓)', 'order_kana01', STEXT_LEN, 'KVCa', array('EXIST_CHECK', 'SPTAB_CHECK', 'MAX_LENGTH_CHECK'));
+        $objFormParam->addParam('注文者 お名前(フリガナ・名)', 'order_kana02', STEXT_LEN, 'KVCa', array('EXIST_CHECK', 'SPTAB_CHECK', 'MAX_LENGTH_CHECK'));
+        $objFormParam->addParam('メールアドレス', 'order_email', null, 'KVCa', array('NO_SPTAB', 'EMAIL_CHECK', 'EMAIL_CHAR_CHECK'));
+        $objFormParam->addParam('郵便番号1', 'order_zip01', ZIP01_LEN, 'n', array('NUM_CHECK', 'NUM_COUNT_CHECK'));
+        $objFormParam->addParam('郵便番号2', 'order_zip02', ZIP02_LEN, 'n', array('NUM_CHECK', 'NUM_COUNT_CHECK'));
+        $objFormParam->addParam('都道府県', 'order_pref', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK'));
+        $objFormParam->addParam('住所1', 'order_addr01', MTEXT_LEN, 'KVa', array('SPTAB_CHECK', 'MAX_LENGTH_CHECK'));
+        $objFormParam->addParam('住所2', 'order_addr02', MTEXT_LEN, 'KVa', array('SPTAB_CHECK', 'MAX_LENGTH_CHECK'));
+        $objFormParam->addParam('電話番号1', 'order_tel01', TEL_ITEM_LEN, 'n', array('MAX_LENGTH_CHECK' ,'NUM_CHECK'));
+        $objFormParam->addParam('電話番号2', 'order_tel02', TEL_ITEM_LEN, 'n', array('MAX_LENGTH_CHECK' ,'NUM_CHECK'));
+        $objFormParam->addParam('電話番号3', 'order_tel03', TEL_ITEM_LEN, 'n', array('MAX_LENGTH_CHECK' ,'NUM_CHECK'));
+        $objFormParam->addParam('FAX番号1', 'order_fax01', TEL_ITEM_LEN, 'n', array('MAX_LENGTH_CHECK' ,'NUM_CHECK'));
+        $objFormParam->addParam('FAX番号2', 'order_fax02', TEL_ITEM_LEN, 'n', array('MAX_LENGTH_CHECK' ,'NUM_CHECK'));
+        $objFormParam->addParam('FAX番号3', 'order_fax03', TEL_ITEM_LEN, 'n', array('MAX_LENGTH_CHECK' ,'NUM_CHECK'));
+
+        // 受注商品情報
+        $objFormParam->addParam('値引き', 'discount', INT_LEN, 'n', array('EXIST_CHECK', 'MAX_LENGTH_CHECK', 'NUM_CHECK'), '0');
+        $objFormParam->addParam('送料', 'deliv_fee', INT_LEN, 'n', array('EXIST_CHECK', 'MAX_LENGTH_CHECK', 'NUM_CHECK'), '0');
+        $objFormParam->addParam('手数料', 'charge', INT_LEN, 'n', array('EXIST_CHECK', 'MAX_LENGTH_CHECK', 'NUM_CHECK'), '0');
+
+        // ポイント機能ON時のみ
+        if (USE_POINT !== false) {
+            $objFormParam->addParam('利用ポイント', 'use_point', INT_LEN, 'n', array('EXIST_CHECK', 'MAX_LENGTH_CHECK', 'NUM_CHECK'));
+        }
+
+        $objFormParam->addParam('配送業者', 'deliv_id', INT_LEN, 'n', array('EXIST_CHECK', 'MAX_LENGTH_CHECK', 'NUM_CHECK'));
+        $objFormParam->addParam('お支払い方法', 'payment_id', INT_LEN, 'n', array('EXIST_CHECK', 'MAX_LENGTH_CHECK', 'NUM_CHECK'));
+        $objFormParam->addParam('対応状況', 'status', INT_LEN, 'n', array('EXIST_CHECK', 'MAX_LENGTH_CHECK', 'NUM_CHECK'));
+        $objFormParam->addParam('お支払方法名称', 'payment_method');
+
+
+        // 受注詳細情報
+        $objFormParam->addParam('商品種別ID', 'product_type_id', INT_LEN, 'n', array('EXIST_CHECK', 'MAX_LENGTH_CHECK', 'NUM_CHECK'), '0');
+        $objFormParam->addParam('単価', 'price', INT_LEN, 'n', array('EXIST_CHECK', 'MAX_LENGTH_CHECK', 'NUM_CHECK'), '0');
+        $objFormParam->addParam('数量', 'quantity', INT_LEN, 'n', array('EXIST_CHECK', 'MAX_LENGTH_CHECK', 'NUM_CHECK'), '0');
+        $objFormParam->addParam('商品ID', 'product_id', INT_LEN, 'n', array('EXIST_CHECK', 'MAX_LENGTH_CHECK', 'NUM_CHECK'), '0');
+        $objFormParam->addParam('商品規格ID', 'product_class_id', INT_LEN, 'n', array('EXIST_CHECK', 'MAX_LENGTH_CHECK', 'NUM_CHECK'), '0');
+        $objFormParam->addParam('ポイント付与率', 'point_rate');
+        $objFormParam->addParam('商品コード', 'product_code');
+        $objFormParam->addParam('商品名', 'product_name');
+        $objFormParam->addParam('規格名1', 'classcategory_name1');
+        $objFormParam->addParam('規格名2', 'classcategory_name2');
+        $objFormParam->addParam('税率', 'tax_rate');
+        $objFormParam->addParam('課税規則', 'tax_rule');
+        $objFormParam->addParam('メモ', 'note', MTEXT_LEN, 'KVa', array('MAX_LENGTH_CHECK'));
+        $objFormParam->addParam('削除用項番', 'delete_no', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK'));
+
+        // DB読込用
+        $objFormParam->addParam('小計', 'subtotal');
+        $objFormParam->addParam('合計', 'total');
+        $objFormParam->addParam('支払い合計', 'payment_total');
+        $objFormParam->addParam('加算ポイント', 'add_point');
+        $objFormParam->addParam('お誕生日ポイント', 'birth_point', null, 'n', array(), 0);
+        $objFormParam->addParam('消費税合計', 'tax');
+        $objFormParam->addParam('最終保持ポイント', 'total_point');
+        $objFormParam->addParam('会員ID', 'customer_id', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK'), '0');
+        $objFormParam->addParam('会員ID', 'edit_customer_id', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK'), '0');
+        $objFormParam->addParam('現在のポイント', 'customer_point');
+        $objFormParam->addParam('受注前ポイント', 'point');
+        $objFormParam->addParam('注文番号', 'order_id');
+        $objFormParam->addParam('受注日', 'create_date');
+        $objFormParam->addParam('発送日', 'commit_date');
+        $objFormParam->addParam('備考', 'message');
+        $objFormParam->addParam('入金日', 'payment_date');
+        $objFormParam->addParam('端末種別', 'device_type_id');
+        $objFormParam->addParam('税率', 'order_tax_rate');
+        $objFormParam->addParam('課税規則', 'order_tax_rule');
+
+        // 複数情報
+        $objFormParam->addParam('配送数', 'shipping_quantity', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK'), 1);
+        $objFormParam->addParam('配送ID', 'shipping_id', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK'), 0);
+        $objFormParam->addParam('お名前(姓)', 'shipping_name01', STEXT_LEN, 'KVa', array('SPTAB_CHECK', 'MAX_LENGTH_CHECK'));
+        $objFormParam->addParam('お名前(名)', 'shipping_name02', STEXT_LEN, 'KVa', array('SPTAB_CHECK', 'MAX_LENGTH_CHECK'));
+        $objFormParam->addParam('お名前(フリガナ・姓)', 'shipping_kana01', STEXT_LEN, 'KVCa', array('SPTAB_CHECK', 'MAX_LENGTH_CHECK'));
+        $objFormParam->addParam('お名前(フリガナ・名)', 'shipping_kana02', STEXT_LEN, 'KVCa', array('SPTAB_CHECK', 'MAX_LENGTH_CHECK'));
+        $objFormParam->addParam('郵便番号1', 'shipping_zip01', ZIP01_LEN, 'n', array('NUM_CHECK', 'NUM_COUNT_CHECK'));
+        $objFormParam->addParam('郵便番号2', 'shipping_zip02', ZIP02_LEN, 'n', array('NUM_CHECK', 'NUM_COUNT_CHECK'));
+        $objFormParam->addParam('都道府県', 'shipping_pref', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK'));
+        $objFormParam->addParam('住所1', 'shipping_addr01', MTEXT_LEN, 'KVa', array('SPTAB_CHECK', 'MAX_LENGTH_CHECK'));
+        $objFormParam->addParam('住所2', 'shipping_addr02', MTEXT_LEN, 'KVa', array('SPTAB_CHECK', 'MAX_LENGTH_CHECK'));
+        $objFormParam->addParam('電話番号1', 'shipping_tel01', TEL_ITEM_LEN, 'n', array('MAX_LENGTH_CHECK' ,'NUM_CHECK'));
+        $objFormParam->addParam('電話番号2', 'shipping_tel02', TEL_ITEM_LEN, 'n', array('MAX_LENGTH_CHECK' ,'NUM_CHECK'));
+        $objFormParam->addParam('電話番号3', 'shipping_tel03', TEL_ITEM_LEN, 'n', array('MAX_LENGTH_CHECK' ,'NUM_CHECK'));
+        $objFormParam->addParam('FAX番号1', 'shipping_fax01', TEL_ITEM_LEN, 'n', array('MAX_LENGTH_CHECK' ,'NUM_CHECK'));
+        $objFormParam->addParam('FAX番号2', 'shipping_fax02', TEL_ITEM_LEN, 'n', array('MAX_LENGTH_CHECK' ,'NUM_CHECK'));
+        $objFormParam->addParam('FAX番号3', 'shipping_fax03', TEL_ITEM_LEN, 'n', array('MAX_LENGTH_CHECK' ,'NUM_CHECK'));
+        $objFormParam->addParam('お届け時間ID', 'time_id', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK'));
+        $objFormParam->addParam('お届け日(年)', 'shipping_date_year', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK'));
+        $objFormParam->addParam('お届け日(月)', 'shipping_date_month', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK'));
+        $objFormParam->addParam('お届け日(日)', 'shipping_date_day', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK'));
+        $objFormParam->addParam('お届け日', 'shipping_date', STEXT_LEN, 'KVa', array('SPTAB_CHECK', 'MAX_LENGTH_CHECK'));
+        $objFormParam->addParam('配送商品数量', 'shipping_product_quantity', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK'));
+
+        $objFormParam->addParam('商品規格ID', 'shipment_product_class_id', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK'));
+        $objFormParam->addParam('商品コード', 'shipment_product_code');
+        $objFormParam->addParam('商品名', 'shipment_product_name');
+        $objFormParam->addParam('規格名1', 'shipment_classcategory_name1');
+        $objFormParam->addParam('規格名2', 'shipment_classcategory_name2');
+        $objFormParam->addParam('単価', 'shipment_price', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK'), '0');
+        $objFormParam->addParam('数量', 'shipment_quantity', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK'), '0');
+
+        $objFormParam->addParam('商品項番', 'no', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK'));
+        $objFormParam->addParam('追加商品規格ID', 'add_product_class_id', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK'));
+        $objFormParam->addParam('修正商品規格ID', 'edit_product_class_id', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK'));
+        $objFormParam->addParam('対象届け先ID', 'select_shipping_id', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK'));
+        $objFormParam->addParam('アンカーキー', 'anchor_key', STEXT_LEN, 'KVa', array('SPTAB_CHECK', 'MAX_LENGTH_CHECK'));
+    }
+
+    /**
+     * 複数配送用フォームの初期化を行う.
+     *
+     * @param SC_FormParam $objFormParam SC_FormParam インスタンス
+     * @return void
+     */
+    function lfInitMultipleParam(&$objFormParam)
+    {
+        $objFormParam->addParam('商品規格ID', 'multiple_product_class_id', INT_LEN, 'n', array('EXIST_CHECK', 'MAX_LENGTH_CHECK', 'NUM_CHECK'));
+        $objFormParam->addParam('商品コード', 'multiple_product_code', INT_LEN, 'n', array('EXIST_CHECK', 'MAX_LENGTH_CHECK', 'NUM_CHECK'), 1);
+        $objFormParam->addParam('商品名', 'multiple_product_name', INT_LEN, 'n', array('EXIST_CHECK', 'MAX_LENGTH_CHECK', 'NUM_CHECK'), 1);
+        $objFormParam->addParam('規格1', 'multiple_classcategory_name1', INT_LEN, 'n', array('EXIST_CHECK', 'MAX_LENGTH_CHECK', 'NUM_CHECK'), 1);
+        $objFormParam->addParam('規格2', 'multiple_classcategory_name2', INT_LEN, 'n', array('EXIST_CHECK', 'MAX_LENGTH_CHECK', 'NUM_CHECK'), 1);
+        $objFormParam->addParam('単価', 'multiple_price', INT_LEN, 'n', array('EXIST_CHECK', 'MAX_LENGTH_CHECK', 'NUM_CHECK'), 1);
+        $objFormParam->addParam('数量', 'multiple_quantity', INT_LEN, 'n', array('EXIST_CHECK', 'MAX_LENGTH_CHECK', 'NUM_CHECK'), 1);
+        $objFormParam->addParam('お届け先', 'multiple_shipping_id', INT_LEN, 'n', array('EXIST_CHECK', 'MAX_LENGTH_CHECK', 'NUM_CHECK'));
+    }
+
+    /**
+     * 複数配送入力フォームで入力された値を SC_FormParam へ設定する.
+     *
+     * @param SC_FormParam $objFormParam SC_FormParam インスタンス
+     * @return void
+     */
+    function setMultipleItemTo(&$objFormParam)
+    {
+        $arrMultipleKey = array('multiple_shipping_id',
+                'multiple_product_class_id',
+                'multiple_product_name',
+                'multiple_product_code',
+                'multiple_classcategory_name1',
+                'multiple_classcategory_name2',
+                'multiple_price',
+                'multiple_quantity');
+        $arrMultipleParams = $objFormParam->getSwapArray($arrMultipleKey);
+
+        /*
+         * 複数配送フォームの入力値を shipping_id ごとにマージ
+         *
+         * $arrShipmentItem[お届け先ID][商品規格ID]['shipment_(key)'] = 値
+         */
+        $arrShipmentItem = array();
+        foreach ($arrMultipleParams as $arrMultiple) {
+            $shipping_id = $arrMultiple['multiple_shipping_id'];
+            $product_class_id = $arrMultiple['multiple_product_class_id'];
+            foreach ($arrMultiple as $key => $val) {
+                if ($key == 'multiple_quantity') {
+                    $arrShipmentItem[$shipping_id][$product_class_id][str_replace('multiple', 'shipment', $key)] += $val;
+                } else {
+                    $arrShipmentItem[$shipping_id][$product_class_id][str_replace('multiple', 'shipment', $key)] = $val;
+                }
+            }
+        }
+
+        /*
+         * フォームのお届け先ごとの配列を生成
+         *
+         * $arrShipmentForm['(key)'][$shipping_id][$item_index] = 値
+         * $arrProductQuantity[$shipping_id] = お届け先ごとの配送商品数量
+         */
+        $arrShipmentForm = array();
+        $arrProductQuantity = array();
+        $arrShippingIds = $objFormParam->getValue('shipping_id');
+        foreach ($arrShippingIds as $shipping_id) {
+            $item_index = 0;
+            foreach ($arrShipmentItem[$shipping_id] as $product_class_id => $shipment_item) {
+                foreach ($shipment_item as $key => $val) {
+                    $arrShipmentForm[$key][$shipping_id][$item_index] = $val;
+                }
+                // 受注商品の数量を設定
+                $arrQuantity[$product_class_id] += $shipment_item['shipment_quantity'];
+                $item_index++;
+            }
+            // お届け先ごとの配送商品数量を設定
+            $arrProductQuantity[$shipping_id] = count($arrShipmentItem[$shipping_id]);
+        }
+
+        $objFormParam->setParam($arrShipmentForm);
+        $objFormParam->setValue('shipping_product_quantity', $arrProductQuantity);
+
+        // 受注商品の数量を変更
+        $arrDest = array();
         foreach ($objFormParam->getValue('product_class_id') as $n => $order_product_class_id) {
-            if ($product_class_id == $order_product_class_id) {
-                $arrDest['quantity'][$n] = $quantity;
-            }
-        }
-    }
-    $objFormParam->setParam($arrDest);
-}
-
-/**
- * 受注データを取得して, SC_FormParam へ設定する.
- *
- * @param SC_FormParam $objFormParam SC_FormParam インスタンス
- * @param integer $order_id 取得元の受注ID
- * @return void
- */
-function setOrderToFormParam(&$objFormParam, $order_id)
-{
-    $objPurchase = new SC_Helper_Purchase_Ex();
-
-    // 受注詳細を設定
-    $arrOrderDetail = $objPurchase->getOrderDetail($order_id, false);
-    $objFormParam->setParam(SC_Utils_Ex::sfSwapArray($arrOrderDetail));
-
-    $arrShippingsTmp = $objPurchase->getShippings($order_id);
-    $arrShippings = array();
-    foreach ($arrShippingsTmp as $row) {
-        // お届け日の処理
-        if (!SC_Utils_Ex::isBlank($row['shipping_date'])) {
-            $ts = strtotime($row['shipping_date']);
-            $row['shipping_date_year'] = date('Y', $ts);
-            $row['shipping_date_month'] = date('n', $ts);
-            $row['shipping_date_day'] = date('j', $ts);
-        }
-        $arrShippings[$row['shipping_id']] = $row;
-    }
-    $objFormParam->setValue('shipping_quantity', count($arrShippings));
-    $objFormParam->setParam(SC_Utils_Ex::sfSwapArray($arrShippings));
-
-    /*
-     * 配送商品を設定
-     *
-     * $arrShipmentItem['shipment_(key)'][$shipping_id][$item_index] = 値
-     * $arrProductQuantity[$shipping_id] = お届け先ごとの配送商品数量
-     */
-    $arrProductQuantity = array();
-    $arrShipmentItem = array();
-    foreach ($arrShippings as $shipping_id => $arrShipping) {
-        $arrProductQuantity[$shipping_id] = count($arrShipping['shipment_item']);
-        foreach ($arrShipping['shipment_item'] as $item_index => $arrItem) {
-            foreach ($arrItem as $item_key => $item_val) {
-                $arrShipmentItem['shipment_' . $item_key][$shipping_id][$item_index] = $item_val;
-            }
-        }
-    }
-    $objFormParam->setValue('shipping_product_quantity', $arrProductQuantity);
-    $objFormParam->setParam($arrShipmentItem);
-
-    /*
-     * 受注情報を設定
-     * $arrOrderDetail と項目が重複しており, $arrOrderDetail は連想配列の値
-     * が渡ってくるため, $arrOrder で上書きする.
-     */
-    $arrOrder = $objPurchase->getOrder($order_id);
-    $objFormParam->setParam($arrOrder);
-
-    // ポイントを設定
-    list($db_point, $rollback_point) = SC_Helper_DB_Ex::sfGetRollbackPoint(
-            $order_id, $arrOrder['use_point'], $arrOrder['add_point'], $arrOrder['status']
-            );
-    $objFormParam->setValue('total_point', $db_point);
-    $objFormParam->setValue('point', $rollback_point);
-
-    if (!SC_Utils_Ex::isBlank($objFormParam->getValue('customer_id'))) {
-        $arrCustomer = SC_Helper_Customer_Ex::sfGetCustomerDataFromId($objFormParam->getValue('customer_id'));
-        $objFormParam->setValue('customer_point', $arrCustomer['point']);
-    }
-}
-
-/**
- * 入力内容のチェックを行う.
- *
- * @param SC_FormParam $objFormParam SC_FormParam インスタンス
- * @return array エラーメッセージの配列
- */
-function lfCheckError(&$objFormParam)
-{
-    $objProduct = new SC_Product_Ex();
-
-    $arrErr = $objFormParam->checkError();
-
-    if (!SC_Utils_Ex::isBlank($objErr->arrErr)) {
+            $arrDest['quantity'][$n] = 0;
+        }
+        foreach ($arrQuantity as $product_class_id => $quantity) {
+            foreach ($objFormParam->getValue('product_class_id') as $n => $order_product_class_id) {
+                if ($product_class_id == $order_product_class_id) {
+                    $arrDest['quantity'][$n] = $quantity;
+                }
+            }
+        }
+        $objFormParam->setParam($arrDest);
+    }
+
+    /**
+     * 受注データを取得して, SC_FormParam へ設定する.
+     *
+     * @param SC_FormParam $objFormParam SC_FormParam インスタンス
+     * @param integer $order_id 取得元の受注ID
+     * @return void
+     */
+    function setOrderToFormParam(&$objFormParam, $order_id)
+    {
+        $objPurchase = new SC_Helper_Purchase_Ex();
+
+        // 受注詳細を設定
+        $arrOrderDetail = $objPurchase->getOrderDetail($order_id, false);
+        $objFormParam->setParam(SC_Utils_Ex::sfSwapArray($arrOrderDetail));
+
+        $arrShippingsTmp = $objPurchase->getShippings($order_id);
+        $arrShippings = array();
+        foreach ($arrShippingsTmp as $row) {
+            // お届け日の処理
+            if (!SC_Utils_Ex::isBlank($row['shipping_date'])) {
+                $ts = strtotime($row['shipping_date']);
+                $row['shipping_date_year'] = date('Y', $ts);
+                $row['shipping_date_month'] = date('n', $ts);
+                $row['shipping_date_day'] = date('j', $ts);
+            }
+            $arrShippings[$row['shipping_id']] = $row;
+        }
+        $objFormParam->setValue('shipping_quantity', count($arrShippings));
+        $objFormParam->setParam(SC_Utils_Ex::sfSwapArray($arrShippings));
+
+        /*
+         * 配送商品を設定
+         *
+         * $arrShipmentItem['shipment_(key)'][$shipping_id][$item_index] = 値
+         * $arrProductQuantity[$shipping_id] = お届け先ごとの配送商品数量
+         */
+        $arrProductQuantity = array();
+        $arrShipmentItem = array();
+        foreach ($arrShippings as $shipping_id => $arrShipping) {
+            $arrProductQuantity[$shipping_id] = count($arrShipping['shipment_item']);
+            foreach ($arrShipping['shipment_item'] as $item_index => $arrItem) {
+                foreach ($arrItem as $item_key => $item_val) {
+                    $arrShipmentItem['shipment_' . $item_key][$shipping_id][$item_index] = $item_val;
+                }
+            }
+        }
+        $objFormParam->setValue('shipping_product_quantity', $arrProductQuantity);
+        $objFormParam->setParam($arrShipmentItem);
+
+        /*
+         * 受注情報を設定
+         * $arrOrderDetail と項目が重複しており, $arrOrderDetail は連想配列の値
+         * が渡ってくるため, $arrOrder で上書きする.
+         */
+        $arrOrder = $objPurchase->getOrder($order_id);
+        $objFormParam->setParam($arrOrder);
+
+        // ポイントを設定
+        list($db_point, $rollback_point) = SC_Helper_DB_Ex::sfGetRollbackPoint(
+                $order_id, $arrOrder['use_point'], $arrOrder['add_point'], $arrOrder['status']
+                );
+        $objFormParam->setValue('total_point', $db_point);
+        $objFormParam->setValue('point', $rollback_point);
+
+        if (!SC_Utils_Ex::isBlank($objFormParam->getValue('customer_id'))) {
+            $arrCustomer = SC_Helper_Customer_Ex::sfGetCustomerDataFromId($objFormParam->getValue('customer_id'));
+            $objFormParam->setValue('customer_point', $arrCustomer['point']);
+        }
+    }
+
+    /**
+     * 入力内容のチェックを行う.
+     *
+     * @param SC_FormParam $objFormParam SC_FormParam インスタンス
+     * @return array エラーメッセージの配列
+     */
+    function lfCheckError(&$objFormParam)
+    {
+        $objProduct = new SC_Product_Ex();
+
+        $arrErr = $objFormParam->checkError();
+
+        if (!SC_Utils_Ex::isBlank($objErr->arrErr)) {
+            return $arrErr;
+        }
+
+        $arrValues = $objFormParam->getHashArray();
+
+        // 商品の種類数
+        $max = count($arrValues['quantity']);
+        $subtotal = 0;
+        $totalpoint = 0;
+        $totaltax = 0;
+        for ($i = 0; $i < $max; $i++) {
+            // 小計の計算
+            $subtotal += SC_Helper_DB_Ex::sfCalcIncTax($arrValues['price'][$i], $arrValues['tax_rate'][$i], $arrValues['tax_rule'][$i]) * $arrValues['quantity'][$i];
+            // 小計の計算
+            $totaltax += SC_Utils_Ex::sfTax($arrValues['price'][$i], $arrValues['tax_rate'][$i], $arrValues['tax_rule'][$i]) * $arrValues['quantity'][$i];
+            // 加算ポイントの計算
+            $totalpoint += SC_Utils_Ex::sfPrePoint($arrValues['price'][$i], $arrValues['point_rate'][$i]) * $arrValues['quantity'][$i];
+
+            // 在庫数のチェック
+            $arrProduct = $objProduct->getDetailAndProductsClass($arrValues['product_class_id'][$i]);
+
+            // 編集前の値と比較するため受注詳細を取得
+            $objPurchase = new SC_Helper_Purchase_Ex();
+            $arrOrderDetail = SC_Utils_Ex::sfSwapArray($objPurchase->getOrderDetail($objFormParam->getValue('order_id'), false));
+
+            if ($arrProduct['stock_unlimited'] != '1'
+                    && $arrProduct['stock'] < $arrValues['quantity'][$i] - $arrOrderDetail['quantity'][$i]) {
+                $class_name1 = $arrValues['classcategory_name1'][$i];
+                $class_name1 = SC_Utils_Ex::isBlank($class_name1) ? 'なし' : $class_name1;
+                $class_name2 = $arrValues['classcategory_name2'][$i];
+                $class_name2 = SC_Utils_Ex::isBlank($class_name2) ? 'なし' : $class_name2;
+                $arrErr['quantity'][$i] .= $arrValues['product_name'][$i]
+                    . '/(' . $class_name1 . ')/(' . $class_name2 . ') の在庫が不足しています。 設定できる数量は「'
+                    . ($arrOrderDetail['quantity'][$i] + $arrProduct['stock']) . '」までです。<br />';
+            }
+        }
+
+        // 消費税
+        $arrValues['tax'] = $totaltax;
+        // 小計
+        $arrValues['subtotal'] = $subtotal;
+        // 合計
+        $arrValues['total'] = $subtotal - $arrValues['discount'] + $arrValues['deliv_fee'] + $arrValues['charge'];
+        // お支払い合計
+        $arrValues['payment_total'] = $arrValues['total'] - ($arrValues['use_point'] * POINT_VALUE);
+
+        // 加算ポイント
+        $arrValues['add_point'] = SC_Helper_DB_Ex::sfGetAddPoint($totalpoint, $arrValues['use_point']) + $arrValues['birth_point'];
+
+        // 最終保持ポイント
+        $arrValues['total_point'] = $objFormParam->getValue('point') - $arrValues['use_point'];
+
+        if ($arrValues['total'] < 0) {
+            $arrErr['total'] = '合計額がマイナス表示にならないように調整して下さい。<br />';
+        }
+
+        if ($arrValues['payment_total'] < 0) {
+            $arrErr['payment_total'] = 'お支払い合計額がマイナス表示にならないように調整して下さい。<br />';
+        }
+
+        if ($arrValues['total_point'] < 0) {
+            $arrErr['use_point'] = '最終保持ポイントがマイナス表示にならないように調整して下さい。<br />';
+        }
+
+        $objFormParam->setParam($arrValues);
         return $arrErr;
     }
-
-    $arrValues = $objFormParam->getHashArray();
-
-    // 商品の種類数
-    $max = count($arrValues['quantity']);
-    $subtotal = 0;
-    $totalpoint = 0;
-    $totaltax = 0;
-    for ($i = 0; $i < $max; $i++) {
-        // 小計の計算
-        $subtotal += SC_Helper_DB_Ex::sfCalcIncTax($arrValues['price'][$i], $arrValues['tax_rate'][$i], $arrValues['tax_rule'][$i]) * $arrValues['quantity'][$i];
-        // 小計の計算
-        $totaltax += SC_Utils_Ex::sfTax($arrValues['price'][$i], $arrValues['tax_rate'][$i], $arrValues['tax_rule'][$i]) * $arrValues['quantity'][$i];
-        // 加算ポイントの計算
-        $totalpoint += SC_Utils_Ex::sfPrePoint($arrValues['price'][$i], $arrValues['point_rate'][$i]) * $arrValues['quantity'][$i];
-
-        // 在庫数のチェック
-        $arrProduct = $objProduct->getDetailAndProductsClass($arrValues['product_class_id'][$i]);
-
-        // 編集前の値と比較するため受注詳細を取得
-        $objPurchase = new SC_Helper_Purchase_Ex();
-        $arrOrderDetail = SC_Utils_Ex::sfSwapArray($objPurchase->getOrderDetail($objFormParam->getValue('order_id'), false));
-
-        if ($arrProduct['stock_unlimited'] != '1'
-                && $arrProduct['stock'] < $arrValues['quantity'][$i] - $arrOrderDetail['quantity'][$i]) {
-            $class_name1 = $arrValues['classcategory_name1'][$i];
-            $class_name1 = SC_Utils_Ex::isBlank($class_name1) ? 'なし' : $class_name1;
-            $class_name2 = $arrValues['classcategory_name2'][$i];
-            $class_name2 = SC_Utils_Ex::isBlank($class_name2) ? 'なし' : $class_name2;
-            $arrErr['quantity'][$i] .= $arrValues['product_name'][$i]
-                . '/(' . $class_name1 . ')/(' . $class_name2 . ') の在庫が不足しています。 設定できる数量は「'
-                . ($arrOrderDetail['quantity'][$i] + $arrProduct['stock']) . '」までです。<br />';
-        }
-    }
-
-    // 消費税
-    $arrValues['tax'] = $totaltax;
-    // 小計
-    $arrValues['subtotal'] = $subtotal;
-    // 合計
-    $arrValues['total'] = $subtotal - $arrValues['discount'] + $arrValues['deliv_fee'] + $arrValues['charge'];
-    // お支払い合計
-    $arrValues['payment_total'] = $arrValues['total'] - ($arrValues['use_point'] * POINT_VALUE);
-
-    // 加算ポイント
-    $arrValues['add_point'] = SC_Helper_DB_Ex::sfGetAddPoint($totalpoint, $arrValues['use_point']) + $arrValues['birth_point'];
-
-    // 最終保持ポイント
-    $arrValues['total_point'] = $objFormParam->getValue('point') - $arrValues['use_point'];
-
-    if ($arrValues['total'] < 0) {
-        $arrErr['total'] = '合計額がマイナス表示にならないように調整して下さい。<br />';
-    }
-
-    if ($arrValues['payment_total'] < 0) {
-        $arrErr['payment_total'] = 'お支払い合計額がマイナス表示にならないように調整して下さい。<br />';
-    }
-
-    if ($arrValues['total_point'] < 0) {
-        $arrErr['use_point'] = '最終保持ポイントがマイナス表示にならないように調整して下さい。<br />';
-    }
-
-    $objFormParam->setParam($arrValues);
-    return $arrErr;
-}
 
     /**
@@ -1036,5 +1036,5 @@
 
     /**
-     * 複数配送のパラメータを取り出す 
+     * 複数配送のパラメータを取り出す
      *
      * @param SC_FormParam $objFormParam SC_FormParam インスタンス
