Index: branches/version-2_4/html/admin/customer/search_customer.php
===================================================================
--- branches/version-2_4/html/admin/customer/search_customer.php	(revision 17876)
+++ branches/version-2_4/html/admin/customer/search_customer.php	(revision 17876)
@@ -0,0 +1,35 @@
+<?php
+/*
+ * This file is part of EC-CUBE
+ *
+ * Copyright(c) 2000-2008 LOCKON CO.,LTD. All Rights Reserved.
+ *
+ * http://www.lockon.co.jp/
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+// {{{ requires
+require_once("../require.php");
+require_once(CLASS_EX_PATH . "page_extends/admin/customer/LC_Page_Admin_Customer_SearchCustomer_Ex.php");
+
+// }}}
+// {{{ generate page
+
+$objPage = new LC_Page_Admin_Customer_SearchCustomer_Ex();
+register_shutdown_function(array($objPage, "destroy"));
+$objPage->init();
+$objPage->process();
+?>
Index: branches/version-2_4/data/Smarty/templates/default/admin/customer/search_customer.tpl
===================================================================
--- branches/version-2_4/data/Smarty/templates/default/admin/customer/search_customer.tpl	(revision 17876)
+++ branches/version-2_4/data/Smarty/templates/default/admin/customer/search_customer.tpl	(revision 17876)
@@ -0,0 +1,151 @@
+<!--{*
+/*
+ * This file is part of EC-CUBE
+ *
+ * Copyright(c) 2000-2007 LOCKON CO.,LTD. All Rights Reserved.
+ *
+ * http://www.lockon.co.jp/
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.    See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA    02111-1307, USA.
+ */
+*}-->
+<!--　-->
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ja" lang="ja">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<!--{$smarty.const.CHAR_CODE}-->">
+<meta http-equiv="content-script-type" content="text/javascript">
+<meta http-equiv="content-style-type" content="text/css">
+.<link rel="stylesheet" href="<!--{$smarty.const.URL_DIR}-->admin/css/contents.css" type="text/css" media="all" />
+<script type="text/javascript" src="<!--{$TPL_DIR}-->js/css.js"></script>
+<script type="text/javascript" src="<!--{$TPL_DIR}-->js/navi.js"></script>
+<script type="text/javascript" src="<!--{$TPL_DIR}-->js/admin.js"></script>
+<script type="text/javascript">
+<!--
+self.moveTo(20,20);self.focus();
+
+function func_submit(customer_id){
+    var fm = window.opener.document.form1;
+    fm.edit_customer_id.value = customer_id;
+    fm.mode.value = 'search_customer';
+    fm.submit();
+    window.close();
+    return false;
+}
+//-->
+</script>
+
+<title>EC CUBE 管理者画面</title>
+</head>
+
+<body bgcolor="#ffffff" text="#494E5F" link="#006699" vlink="#006699" alink="#006699" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="preLoadImg('<!--{$TPL_DIR}-->')">
+<!--{$GLOBAL_ERR}-->
+<noscript>
+<link rel="stylesheet" href="<!--{$smarty.const.URL_DIR}-->admin/css/common.css" type="text/css" >
+</noscript>
+
+<!--▼CONTENTS-->
+<div align="center">
+　
+<!--▼検索フォーム-->
+<form name="form1" id="form1" method="post" action="<!--{$smarty.server.REQUEST_URI|escape}-->">
+<input name="mode" type="hidden" value="search">
+<input name="search_pageno" type="hidden" value="">
+<input name="customer_id" type="hidden" value="">
+<table bgcolor="#cccccc" width="420" border="0" cellspacing="1" cellpadding="5" summary=" ">
+    <tr class="fs12n">
+        <td bgcolor="#f0f0f0" width="100">顧客ID</td>
+        <td bgcolor="#ffffff" width="287" colspan="2">
+            <!--{if $arrErr.search_customer_id}--><span class="red12"><!--{$arrErr.search_customer_id}--></span><!--{/if}-->
+            <input type="text" name="search_customer_id" value="<!--{$arrForm.search_customer_id|escape}-->" size="40" class="box40" style="<!--{$arrErr.search_customer_id|sfGetErrorColor}-->"/>
+        </td>
+    </tr>
+    <tr class="fs12n">
+        <td bgcolor="#f0f0f0">担当者</td>
+        <td bgcolor="#ffffff">
+            <!--{if $arrErr.search_name01}--><span class="red12"><!--{$arrErr.search_name01}--></span><!--{/if}-->
+            <!--{if $arrErr.search_name02}--><span class="red12"><!--{$arrErr.search_name02}--></span><!--{/if}-->
+            姓&nbsp;&nbsp;<input type="text" name="search_name01" value="<!--{$arrForm.search_name01|escape}-->" size="15" class="box15" style="<!--{$arrErr.search_name01|sfGetErrorColor}-->"/>
+            &nbsp;名&nbsp;&nbsp;<input type="text" name="search_name02" value="<!--{$arrForm.search_name02|escape}-->" size="15" class="box15" style="<!--{$arrErr.search_name02|sfGetErrorColor}-->"/>
+        </td>
+    </tr>
+    <tr class="fs12n">
+        <td bgcolor="#f0f0f0">担当者(カナ)</td>
+        <td bgcolor="#ffffff">
+            <!--{if $arrErr.search_kana01}--><span class="red12"><!--{$arrErr.search_kana01}--></span><!--{/if}-->
+            <!--{if $arrErr.search_kana02}--><span class="red12"><!--{$arrErr.search_kana02}--></span><!--{/if}-->
+            セイ<input type="text" name="search_kana01" value="<!--{$arrForm.search_kana01|escape}-->" size="15" class="box15" style="<!--{$arrErr.search_kana01|sfGetErrorColor}-->"/>
+                                                メイ&nbsp;<input type="text" name="search_kana02" value="<!--{$arrForm.search_kana02|escape}-->" size="15" class="box15" style="<!--{$arrErr.search_kana02|sfGetErrorColor}-->"/>
+        </td>
+    </tr>
+</table>
+
+<br />
+<input type="submit" name="subm" value="検索を開始" />
+<br />
+<br />
+<!--{if $smarty.post.mode == 'search' }-->
+    <!--▼検索結果表示-->
+    <table width="420" border="0" cellspacing="0" cellpadding="0" summary=" " bgcolor="#FFFFFF">
+        <!--{if $tpl_linemax > 0}-->
+            <tr class="fs12">
+                <td align="left"><!--{$tpl_linemax}-->件が該当しました。	</td>
+            </tr>
+        <!--{/if}-->
+        <tr class="fs12">
+            <td align="center">
+            <!--▼ページナビ-->
+            <!--{$tpl_strnavi}-->
+            <!--▲ページナビ-->
+            </td>
+        </tr>
+        <tr><td height="10"></td></tr>
+    </table>
+
+    <!--▼検索後表示部分-->
+    <table width="420" border="0" cellspacing="1" cellpadding="5" bgcolor="#cccccc">
+        <tr bgcolor="#f0f0f0" align="center" class="fs12">
+            <td>顧客ID</td>
+            <td>顧客名(カナ)</td>
+            <td>TEL</td>
+            <td>決定</td>
+        </tr>
+        <!--{section name=cnt loop=$arrCustomer}-->
+        <!--▼顧客<!--{$smarty.section.cnt.iteration}-->-->
+        <tr bgcolor="#FFFFFF" class="fs12n">
+            <td width="90" align="center">
+            <!--{$arrCustomer[cnt].customer_id|escape}-->
+            </td>
+            <td><!--{$arrCustomer[cnt].name01|escape}--><!--{$arrCustomer[cnt].name02|escape}-->(<!--{$arrCustomer[cnt].kana01|escape}--><!--{$arrCustomer[cnt].kana02|escape}-->)</td>
+            <td><!--{$arrCustomer[cnt].tel01|escape}-->-<!--{$arrCustomer[cnt].tel02|escape}-->-<!--{$arrCustomer[cnt].tel03|escape}--></td>
+            <td align="center"><a href="" onClick="return func_submit(<!--{$arrCustomer[cnt].customer_id}-->)">決定</a></td>
+        </tr>
+        <!--▲商品<!--{$smarty.section.cnt.iteration}-->-->
+        <!--{sectionelse}-->
+        <tr bgcolor="#FFFFFF" class="fs10n">
+            <td colspan="4">会員情報が存在しません。</td>
+        </tr>
+        <!--{/section}-->
+    </table>
+
+    <!--▲検索結果表示-->
+<!--{/if}-->
+</form>
+
+</div>
+<!--▲CONTENTS-->
+
+</body>
+</html>
Index: branches/version-2_4/data/Smarty/templates/default/admin/order/edit.tpl
===================================================================
--- branches/version-2_4/data/Smarty/templates/default/admin/order/edit.tpl	(revision 17803)
+++ branches/version-2_4/data/Smarty/templates/default/admin/order/edit.tpl	(revision 17876)
@@ -55,5 +55,5 @@
 <input type="hidden" name="mode" value="<!--{$tpl_mode|default:"edit"}-->">
 <input type="hidden" name="order_id" value="<!--{$tpl_order_id}-->">
-<input type="hidden" name="edit_customer_id" value="<!--{$tpl_order_id}-->">
+<input type="hidden" name="edit_customer_id" value="">
 <input type="hidden" name="anchor_key" value="">
 <input type="hidden" id="add_product_id" name="add_product_id" value="">
@@ -153,5 +153,5 @@
                             <tr class="fs12n">
                                 <td bgcolor="#f2f1ec" width="110">発送日</td>
-                                <td bgcolor="#ffffff"><!--{$arrForm.commit_date|sfDispDBDate|default:"未発送"}--></td>
+                                <td bgcolor="#ffffff"><!--{$arrForm.commit_date.value|sfDispDBDate|default:"未発送"}--></td>
                             </tr>
                         </table>
@@ -172,7 +172,10 @@
                             <!--{/foreach}-->
                             <tr class="fs12n">
-                                <td bgcolor="#f2f1ec" width="717" colspan="4">▼お客様情報</td>
-                            </tr>
-                            <!--{if $tpl_mode != 'add'}-->
+                                <td bgcolor="#f2f1ec" width="717" colspan="4">▼お客様情報
+                                <!--{if $tpl_mode == 'add'}-->
+                                    &nbsp;&nbsp;&nbsp;<input type="button" name="address_input" value="顧客検索" onclick="fnOpenWindow('<!--{$smarty.const.SITE_URL}-->admin/customer/search_customer.php','search','500','650'); return false;" />
+                                <!--{/if}-->
+                                </td>
+                            </tr>
                                 <tr class="fs12n">
                                     <td bgcolor="#f2f1ec" width="110">受注番号</td>
@@ -182,4 +185,5 @@
                                     <!--{if $arrForm.customer_id.value > 0}-->
                                         <!--{$arrForm.customer_id.value}-->
+                                        <input type="hidden" name="customer_id" value="<!--{$arrForm.customer_id.value}-->">
                                     <!--{else}-->
                                         （非会員）
@@ -190,6 +194,6 @@
                                     <td bgcolor="#f2f1ec" width="110">受注日</td>
                                     <td bgcolor="#ffffff" width="607" colspan="3"><!--{$arrForm.create_date.value|sfDispDBDate}--></td>
+                                    <input type="hidden" name="create_date" value="<!--{$arrForm.create_date.value}-->">
                                 </tr>
-                            <!--{/if}-->
                             <tr class="fs12n">
                                 <td bgcolor="#f2f1ec" width="110">顧客名</td>
Index: branches/version-2_4/data/class_extends/page_extends/admin/customer/LC_Page_Admin_Customer_SearchCustomer_Ex.php
===================================================================
--- branches/version-2_4/data/class_extends/page_extends/admin/customer/LC_Page_Admin_Customer_SearchCustomer_Ex.php	(revision 17876)
+++ branches/version-2_4/data/class_extends/page_extends/admin/customer/LC_Page_Admin_Customer_SearchCustomer_Ex.php	(revision 17876)
@@ -0,0 +1,72 @@
+<?php
+/*
+ * This file is part of EC-CUBE
+ *
+ * Copyright(c) 2000-2008 LOCKON CO.,LTD. All Rights Reserved.
+ *
+ * http://www.lockon.co.jp/
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+// {{{ requires
+require_once(CLASS_PATH . "pages/admin/customer/LC_Page_Admin_Customer_SearchCustomer.php");
+
+/**
+ * ページクラス(拡張).
+ *
+ * LC_Page_Admin_Customer_SearchCustomer をカスタマイズする場合はこのクラスを編集する.
+ *
+ * @package Page
+ * @author LOCKON CO.,LTD.
+ * @version $Id$
+ */
+class LC_Page_Admin_Customer_SearchCustomer_Ex extends LC_Page_Admin_Customer_SearchCustomer
+{
+
+    // }}}
+    // {{{ functions
+
+    /**
+     * Page を初期化する.
+     *
+     * @return void
+     */
+    function init()
+    {
+        parent::init();
+    }
+
+    /**
+     * Page のプロセス.
+     *
+     * @return void
+     */
+    function process()
+    {
+        parent::process();
+    }
+
+    /**
+     * デストラクタ.
+     *
+     * @return void
+     */
+    function destroy()
+    {
+        parent::destroy();
+    }
+}
+?>
Index: branches/version-2_4/data/class/pages/admin/customer/LC_Page_Admin_Customer_SearchCustomer.php
===================================================================
--- branches/version-2_4/data/class/pages/admin/customer/LC_Page_Admin_Customer_SearchCustomer.php	(revision 17876)
+++ branches/version-2_4/data/class/pages/admin/customer/LC_Page_Admin_Customer_SearchCustomer.php	(revision 17876)
@@ -0,0 +1,190 @@
+<?php
+/*
+ * This file is part of EC-CUBE
+ *
+ * Copyright(c) 2000-2008 LOCKON CO.,LTD. All Rights Reserved.
+ *
+ * http://www.lockon.co.jp/
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+// {{{ requires
+require_once(CLASS_PATH . "pages/LC_Page.php");
+
+/**
+ * Admin_Customer_SearchCustomer のページクラス.
+ *
+ * @package Page
+ * @author LOCKON CO.,LTD.
+ * @version $Id$
+ */
+class LC_Page_Admin_Customer_SearchCustomer extends LC_Page
+{
+
+    // }}}
+    // {{{ functions
+
+    /**
+     * Page を初期化する.
+     *
+     * @return void
+     */
+    function init()
+    {
+        parent::init();
+        $this->tpl_mainpage = 'customer/search_customer.tpl';
+    }
+
+    /**
+     * Page のプロセス.
+     *
+     * @return void
+     */
+    function process()
+    {
+        $objView = new SC_AdminView();
+        // POSTのモードがsearchなら顧客検索開始
+        if($_POST['mode'] == 'search'){
+            $this->objFormParam = new SC_FormParam();
+            // 値の初期化
+            $this->lfInitParam();
+            // POST値の取得
+            $this->objFormParam->setParam($_POST);
+            // 入力値の変換
+            $this->objFormParam->convParam();
+
+            // 入力された値を取得する
+            $arrForm = $this->objFormParam->getHashArray();
+
+            // エラーチェック
+            $this->arrErr = $this->lfCheckError();
+            if( is_array($this->arrErr) === true && 0 < count($this->arrErr) ){
+                $is_select = false;
+            }else{
+                $where = "del_flg = 0";
+
+                // 検索
+                foreach($arrForm as $tmp_key => $val){
+                    if( is_array($val) === false && 0 < strlen($val)){
+                        $key = strtr($tmp_key , array('search_' => ''));
+                        switch($key){
+                            case 'customer_id':
+                                $where .= " AND customer_id = ? ";
+                                $sqlval[$key] = $val;
+                                break;
+                            case 'name01':
+                                    $where .= " AND name01 ILIKE ? ";
+                                    $sqlval[$key] = '%'.$val.'%';
+                                break;
+                            case 'name02':
+                                    $where .= " AND name02 ILIKE ? ";
+                                    $sqlval[$key] = '%'.$val.'%';
+                                break;
+                            case 'kana01':
+                                    $where .= " AND kana01 ILIKE ? ";
+                                    $sqlval[$key] = '%'.$val.'%';
+                                break;
+                            case 'kana02':
+                                    $where .= " AND kana02 ILIKE ? ";
+                                    $sqlval[$key] = '%'.$val.'%';
+                                break;
+                            default :
+                                break;
+                        }
+                    }
+                }
+
+                $is_select = true;
+            }
+
+
+            if( $is_select === true ){
+                $objQuery = new SC_Query();
+
+                // 既に購入した事がある顧客を取得
+                $col = '*';
+                $from = 'dtb_customer';
+                $order = 'customer_id';
+                $arrCustomer = $objQuery->select($col, $from, $where, $sqlval);
+
+                // 顧客情報を取得できたら、テンプレートに
+                if( is_array($arrCustomer) === true && count($arrCustomer) > 0){
+                    $customer_count = count($arrCustomer);
+                    if( $customer_count != 0 ){
+                        $this->tpl_linemax = $customer_count;
+                    }
+                } else {
+                    $this->tpl_linemax = null;
+                }
+
+                // ページ送りの処理
+                if(isset($_POST['search_page_max'])
+                   && is_numeric($_POST['search_page_max'])) {
+                    $page_max = $_POST['search_page_max'];
+                } else {
+                    $page_max = SEARCH_PMAX;
+                }
+
+                // ページ送りの取得
+                $objNavi = new SC_PageNavi($_POST['search_pageno'], $customer_count, $page_max, "fnNaviSearchOnlyPage", NAVI_PMAX);
+                $this->tpl_strnavi = $objNavi->strnavi;      // 表示文字列
+                $startno = $objNavi->start_row;
+
+                // 取得範囲の指定(開始行番号、行数のセット)
+                $objQuery->setlimitoffset($page_max, $startno);
+                // 表示順序
+                $objQuery->setorder($order);
+                // 検索結果の取得
+                $this->arrCustomer = $objQuery->select($col, $from, $where, $sqlval);
+            }
+
+        }
+        // 画面の表示
+        $this->arrForm = $arrForm;
+        $objView->assignobj($this);
+        $objView->display($this->tpl_mainpage);
+    }
+
+    /**
+     * デストラクタ.
+     *
+     * @return void
+     */
+    function destroy()
+    {
+        parent::destroy();
+    }
+
+    /* パラメータ情報の初期化 */
+    function lfInitParam() {
+        $this->objFormParam->addParam("顧客ID", "search_customer_id", INT_LEN, "n", array("NUM_CHECK", "MAX_LENGTH_CHECK"));
+        $this->objFormParam->addParam("顧客名(姓)", "search_name01", STEXT_LEN, "aKV", array("NO_SPTAB", "SPTAB_CHECK" ,"MAX_LENGTH_CHECK"));
+        $this->objFormParam->addParam("顧客名(名)", "search_name02", STEXT_LEN, "aKV", array("NO_SPTAB", "SPTAB_CHECK" ,"MAX_LENGTH_CHECK"));
+        $this->objFormParam->addParam("顧客名（カナ）", 'search_kana01', STEXT_LEN, "CKV", array("NO_SPTAB", "SPTAB_CHECK" ,"MAX_LENGTH_CHECK", "KANA_CHECK"));
+        $this->objFormParam->addParam("顧客名（カナ/名）", 'search_kana02', STEXT_LEN, "CKV", array("NO_SPTAB", "SPTAB_CHECK" ,"MAX_LENGTH_CHECK", "KANA_CHECK"));
+    }
+
+    /* 入力内容のチェック */
+    function lfCheckError() {
+        // 入力データを渡す。
+        $arrRet =  $this->objFormParam->getHashArray();
+        $objErr = new SC_CheckError($arrRet);
+        $objErr->arrErr = $this->objFormParam->checkError();
+
+        return $objErr->arrErr;
+    }
+}
+?>
Index: branches/version-2_4/data/class/pages/admin/order/LC_Page_Admin_Order_Edit.php
===================================================================
--- branches/version-2_4/data/class/pages/admin/order/LC_Page_Admin_Order_Edit.php	(revision 17804)
+++ branches/version-2_4/data/class/pages/admin/order/LC_Page_Admin_Order_Edit.php	(revision 17876)
@@ -156,16 +156,21 @@
 
             if(count($this->arrErr) == 0) {
-                #if(count($this->arrErr) == 0) {
-                    if ($_POST['mode'] == 'add') {
-                        $this->lfRegistNewData();
-                        $text = "'新規受注を登録しました。'";
-                    } else {
-                        $this->lfRegistData($_POST['order_id']);
-                        $text = "'受注履歴を編集しました。'";
-                    }
-                    // DBから受注情報を再読込
-                    $this->lfGetOrderData($order_id);
-                    $this->tpl_onload = "window.alert(".$text.");";
-                #}
+                if ($_POST['mode'] == 'add') {
+                    $order_id = $this->lfRegistNewData();
+
+                    $this->tpl_order_id = $order_id;
+                    $this->tpl_mode = 'edit';
+
+                    $arrData['order_id'] = $order_id;
+                    $this->objFormParam->setParam($arrData);
+
+                    $text = "'新規受注を登録しました。'";
+                } else {
+                    $this->lfRegistData($_POST['order_id']);
+                    $text = "'受注履歴を編集しました。'";
+                }
+                // DBから受注情報を再読込
+                $this->lfGetOrderData($order_id);
+                $this->tpl_onload = "window.alert(".$text.");";
             }
             break;
@@ -225,4 +230,13 @@
             // 入力値の変換
             $this->objFormParam->convParam();
+            break;
+        /* 顧客検索ポップアップより顧客指定後、顧客情報取得*/
+        case 'search_customer':
+            // POST情報で上書き
+            $this->objFormParam->setParam($_POST);
+
+            // 検索結果から顧客IDを指定された場合、顧客情報をフォームに代入する
+            $this->lfSetCustomerInfo($_POST['edit_customer_id']);
+
             break;
         /* F-REGI決済モジュール連携用 */
@@ -389,4 +403,5 @@
         $this->objFormParam->addParam("受注番号", "order_id");
         $this->objFormParam->addParam("受注日", "create_date");
+        $this->objFormParam->addParam("発送日", "commit_date");
     }
 
@@ -587,5 +602,12 @@
             }
         }
-        $order_id = $objQuery->nextval('dtb_order', 'order_id');
+
+        // postgresqlとmysqlとで処理を分ける
+        if (DB_TYPE == "pgsql") {
+            $order_id = $objQuery->nextval("dtb_order","order_id");
+        }elseif (DB_TYPE == "mysql") {
+            $order_id = $objQuery->get_auto_increment("dtb_order");
+        }
+
         $sqlval['order_id'] = $order_id;
         $sqlval['create_date'] = "Now()";
@@ -652,4 +674,6 @@
         }
         $objQuery->commit();
+
+        return $order_id;
     }
 
@@ -697,4 +721,43 @@
         return $arrProduct;
     }
+
+    /**
+     * 検索結果から顧客IDを指定された場合、顧客情報をフォームに代入する
+     * @param int $edit_customer_id 顧客ID
+     */
+    function lfSetCustomerInfo($edit_customer_id = ""){
+        // 顧客IDが指定されている場合のみ、処理を実行する
+        if( $edit_customer_id === "" ) return ;
+
+        // 検索で選択された顧客IDが入力されている場合
+        if( is_null($edit_customer_id) === false && 0 < strlen($edit_customer_id) && SC_Utils_Ex::sfIsInt($edit_customer_id) ){
+            $objQuery = new SC_Query();
+
+            // 顧客情報を取得する
+            $arrCustomerInfo = $objQuery->select('*', 'dtb_customer', 'customer_id = ? AND del_flg = 0', array($edit_customer_id));
+
+            // 顧客情報を取得する事が出来たら、テンプレートに値を渡す
+            if( 0 < count($arrCustomerInfo) && is_array($arrCustomerInfo) === true){
+                // カラム名にorder_を付ける(テンプレート側でorder_がついている為
+                foreach($arrCustomerInfo[0] as $index=>$customer_info){
+                    // customer_idにはorder_を付けないようにする
+                    $order_index = ($index == 'customer_id') ? $index : 'order_'.$index;
+                    $arrCustomer[$order_index] = $customer_info;
+                }
+            }
+
+            // hiddenに渡す
+            $this->edit_customer_id = $edit_customer_id;
+
+            // 受注日に現在の時刻を取得し、表示させる
+            $create_date = $objQuery->getall('SELECT now() as create_date;');
+            $arrCustomer['create_date'] = $create_date[0]['create_date'];
+
+            // 情報上書き
+            $this->objFormParam->setParam($arrCustomer);
+            // 入力値の変換
+            $this->objFormParam->convParam();
+        }
+    }
 }
 ?>
