[21020] | 1 | <?php |
---|
| 2 | /* |
---|
| 3 | * This file is part of EC-CUBE |
---|
| 4 | * |
---|
[22206] | 5 | * Copyright(c) 2000-2013 LOCKON CO.,LTD. All Rights Reserved. |
---|
[21020] | 6 | * |
---|
| 7 | * http://www.lockon.co.jp/ |
---|
| 8 | * |
---|
| 9 | * This program is free software; you can redistribute it and/or |
---|
| 10 | * modify it under the terms of the GNU General Public License |
---|
| 11 | * as published by the Free Software Foundation; either version 2 |
---|
| 12 | * of the License, or (at your option) any later version. |
---|
| 13 | * |
---|
| 14 | * This program is distributed in the hope that it will be useful, |
---|
| 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 17 | * GNU General Public License for more details. |
---|
| 18 | * |
---|
| 19 | * You should have received a copy of the GNU General Public License |
---|
| 20 | * along with this program; if not, write to the Free Software |
---|
| 21 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
---|
| 22 | */ |
---|
| 23 | |
---|
[21488] | 24 | require_once CLASS_EX_REALDIR . 'page_extends/admin/order/LC_Page_Admin_Order_Ex.php'; |
---|
[21020] | 25 | |
---|
| 26 | /** |
---|
| 27 | * 受注情報表示 のページクラス. |
---|
| 28 | * |
---|
| 29 | * @package Page |
---|
| 30 | * @author LOCKON CO.,LTD. |
---|
| 31 | * @version $Id: LC_Page_Admin_Order_Disp.php 20767 2011-03-22 10:07:32Z nanasess $ |
---|
| 32 | */ |
---|
[22856] | 33 | class LC_Page_Admin_Order_Disp extends LC_Page_Admin_Order_Ex |
---|
[22567] | 34 | { |
---|
[23124] | 35 | public $arrShippingKeys = array( |
---|
[21201] | 36 | 'shipping_id', |
---|
| 37 | 'shipping_name01', |
---|
| 38 | 'shipping_name02', |
---|
| 39 | 'shipping_kana01', |
---|
| 40 | 'shipping_kana02', |
---|
[23230] | 41 | 'shipping_company_name', |
---|
[21201] | 42 | 'shipping_tel01', |
---|
| 43 | 'shipping_tel02', |
---|
| 44 | 'shipping_tel03', |
---|
| 45 | 'shipping_fax01', |
---|
| 46 | 'shipping_fax02', |
---|
| 47 | 'shipping_fax03', |
---|
[23230] | 48 | 'shipping_country_id', |
---|
| 49 | 'shipping_zipcode', |
---|
[21201] | 50 | 'shipping_pref', |
---|
| 51 | 'shipping_zip01', |
---|
| 52 | 'shipping_zip02', |
---|
| 53 | 'shipping_addr01', |
---|
| 54 | 'shipping_addr02', |
---|
| 55 | 'shipping_date_year', |
---|
| 56 | 'shipping_date_month', |
---|
| 57 | 'shipping_date_day', |
---|
| 58 | 'time_id', |
---|
| 59 | ); |
---|
| 60 | |
---|
[23124] | 61 | public $arrShipmentItemKeys = array( |
---|
[21201] | 62 | 'shipment_product_class_id', |
---|
| 63 | 'shipment_product_code', |
---|
| 64 | 'shipment_product_name', |
---|
| 65 | 'shipment_classcategory_name1', |
---|
| 66 | 'shipment_classcategory_name2', |
---|
| 67 | 'shipment_price', |
---|
| 68 | 'shipment_quantity', |
---|
| 69 | ); |
---|
| 70 | |
---|
[21020] | 71 | /** |
---|
| 72 | * Page を初期化する. |
---|
| 73 | * |
---|
| 74 | * @return void |
---|
| 75 | */ |
---|
[23124] | 76 | public function init() |
---|
[22567] | 77 | { |
---|
[21020] | 78 | parent::init(); |
---|
| 79 | $this->tpl_mainpage = 'order/disp.tpl'; |
---|
| 80 | $this->tpl_mainno = 'order'; |
---|
| 81 | $this->tpl_subnavi = ''; |
---|
| 82 | $this->tpl_subno = ''; |
---|
| 83 | $this->tpl_subtitle = '受注情報表示'; |
---|
| 84 | |
---|
| 85 | $masterData = new SC_DB_MasterData_Ex(); |
---|
| 86 | $this->arrPref = $masterData->getMasterData('mtb_pref'); |
---|
[21481] | 87 | $this->arrORDERSTATUS = $masterData->getMasterData('mtb_order_status'); |
---|
[21020] | 88 | $this->arrDeviceType = $masterData->getMasterData('mtb_device_type'); |
---|
[23230] | 89 | $this->arrCountry = $masterData->getMasterData('mtb_country'); |
---|
[23300] | 90 | $this->arrSex = $masterData->getMasterData('mtb_sex'); |
---|
| 91 | $this->arrJob = $masterData->getMasterData('mtb_job'); |
---|
[21020] | 92 | |
---|
| 93 | // 支払い方法の取得 |
---|
[22537] | 94 | $this->arrPayment = SC_Helper_Payment_Ex::getIDValueList(); |
---|
[21020] | 95 | |
---|
| 96 | // 配送業者の取得 |
---|
[22543] | 97 | $this->arrDeliv = SC_Helper_Delivery_Ex::getIDValueList(); |
---|
[21020] | 98 | } |
---|
| 99 | |
---|
| 100 | /** |
---|
| 101 | * Page のプロセス. |
---|
| 102 | * |
---|
| 103 | * @return void |
---|
| 104 | */ |
---|
[23124] | 105 | public function process() |
---|
[22567] | 106 | { |
---|
[21020] | 107 | $this->action(); |
---|
| 108 | $this->sendResponse(); |
---|
| 109 | } |
---|
| 110 | |
---|
| 111 | /** |
---|
| 112 | * Page のアクション. |
---|
| 113 | * |
---|
| 114 | * @return void |
---|
| 115 | */ |
---|
[23124] | 116 | public function action() |
---|
[22567] | 117 | { |
---|
[21020] | 118 | $objPurchase = new SC_Helper_Purchase_Ex(); |
---|
| 119 | $objFormParam = new SC_FormParam_Ex(); |
---|
[21201] | 120 | |
---|
[21020] | 121 | // パラメータ情報の初期化 |
---|
| 122 | $this->lfInitParam($objFormParam); |
---|
| 123 | $objFormParam->setParam($_REQUEST); |
---|
| 124 | $objFormParam->convParam(); |
---|
| 125 | $order_id = $objFormParam->getValue('order_id'); |
---|
[21201] | 126 | |
---|
[21020] | 127 | // DBから受注情報を読み込む |
---|
| 128 | $this->setOrderToFormParam($objFormParam, $order_id); |
---|
[21201] | 129 | |
---|
[21020] | 130 | $this->arrForm = $objFormParam->getFormParamList(); |
---|
[21201] | 131 | $this->arrAllShipping = $objFormParam->getSwapArray(array_merge($this->arrShippingKeys, $this->arrShipmentItemKeys)); |
---|
[22554] | 132 | $this->arrDelivTime = SC_Helper_Delivery_Ex::getDelivTime($objFormParam->getValue('deliv_id')); |
---|
[21205] | 133 | $this->arrInfo = SC_Helper_DB_Ex::sfGetBasisData(); |
---|
[21201] | 134 | |
---|
[21020] | 135 | $this->setTemplate($this->tpl_mainpage); |
---|
| 136 | } |
---|
[21201] | 137 | |
---|
[21020] | 138 | /** |
---|
| 139 | * パラメータ情報の初期化を行う. |
---|
| 140 | * |
---|
[23124] | 141 | * @param SC_FormParam $objFormParam SC_FormParam インスタンス |
---|
[21020] | 142 | * @return void |
---|
| 143 | */ |
---|
[23124] | 144 | public function lfInitParam(&$objFormParam) |
---|
[22567] | 145 | { |
---|
[21020] | 146 | // 検索条件のパラメータを初期化 |
---|
| 147 | parent::lfInitParam($objFormParam); |
---|
| 148 | |
---|
| 149 | // お客様情報 |
---|
[23033] | 150 | $objFormParam->addParam('注文者 お名前(姓)', 'order_name01', STEXT_LEN, 'KVa', array('EXIST_CHECK', 'SPTAB_CHECK', 'MAX_LENGTH_CHECK')); |
---|
| 151 | $objFormParam->addParam('注文者 お名前(名)', 'order_name02', STEXT_LEN, 'KVa', array('EXIST_CHECK', 'SPTAB_CHECK', 'MAX_LENGTH_CHECK')); |
---|
| 152 | $objFormParam->addParam('注文者 お名前(フリガナ・姓)', 'order_kana01', STEXT_LEN, 'KVCa', array('EXIST_CHECK', 'SPTAB_CHECK', 'MAX_LENGTH_CHECK')); |
---|
| 153 | $objFormParam->addParam('注文者 お名前(フリガナ・名)', 'order_kana02', STEXT_LEN, 'KVCa', array('EXIST_CHECK', 'SPTAB_CHECK', 'MAX_LENGTH_CHECK')); |
---|
[23230] | 154 | $objFormParam->addParam('注文者 会社名', 'order_company_name', STEXT_LEN, 'KVa', array('SPTAB_CHECK', 'MAX_LENGTH_CHECK')); |
---|
[21514] | 155 | $objFormParam->addParam('メールアドレス', 'order_email', null, 'KVCa', array('NO_SPTAB', 'EMAIL_CHECK', 'EMAIL_CHAR_CHECK')); |
---|
[23230] | 156 | if (FORM_COUNTRY_ENABLE) { |
---|
| 157 | $objFormParam->addParam('国', 'order_country_id', INT_LEN, 'n', array('EXIST_CHECK', 'NUM_CHECK')); |
---|
| 158 | $objFormParam->addParam('ZIPCODE', 'order_zipcode', STEXT_LEN, 'n', array('NO_SPTAB', 'SPTAB_CHECK', 'GRAPH_CHECK', 'MAX_LENGTH_CHECK')); |
---|
| 159 | } |
---|
[21514] | 160 | $objFormParam->addParam('郵便番号1', 'order_zip01', ZIP01_LEN, 'n', array('NUM_CHECK', 'NUM_COUNT_CHECK')); |
---|
| 161 | $objFormParam->addParam('郵便番号2', 'order_zip02', ZIP02_LEN, 'n', array('NUM_CHECK', 'NUM_COUNT_CHECK')); |
---|
| 162 | $objFormParam->addParam('都道府県', 'order_pref', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK')); |
---|
| 163 | $objFormParam->addParam('住所1', 'order_addr01', MTEXT_LEN, 'KVa', array('SPTAB_CHECK', 'MAX_LENGTH_CHECK')); |
---|
| 164 | $objFormParam->addParam('住所2', 'order_addr02', MTEXT_LEN, 'KVa', array('SPTAB_CHECK', 'MAX_LENGTH_CHECK')); |
---|
| 165 | $objFormParam->addParam('電話番号1', 'order_tel01', TEL_ITEM_LEN, 'n', array('MAX_LENGTH_CHECK' ,'NUM_CHECK')); |
---|
| 166 | $objFormParam->addParam('電話番号2', 'order_tel02', TEL_ITEM_LEN, 'n', array('MAX_LENGTH_CHECK' ,'NUM_CHECK')); |
---|
| 167 | $objFormParam->addParam('電話番号3', 'order_tel03', TEL_ITEM_LEN, 'n', array('MAX_LENGTH_CHECK' ,'NUM_CHECK')); |
---|
[23300] | 168 | $objFormParam->addParam('性別', 'order_sex', TEL_ITEM_LEN, 'n', array('MAX_LENGTH_CHECK' ,'NUM_CHECK'));
|
---|
| 169 | $objFormParam->addParam('職業', 'order_job', TEL_ITEM_LEN, 'n', array('MAX_LENGTH_CHECK' ,'NUM_CHECK')); |
---|
| 170 | $objFormParam->addParam('生年月日(年)', 'order_birth_year', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK'));
|
---|
| 171 | $objFormParam->addParam('生年月日(月)', 'order_birth_month', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK'));
|
---|
| 172 | $objFormParam->addParam('生年月日(日)', 'order_birth_day', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK'));
|
---|
[21020] | 173 | |
---|
| 174 | // 受注商品情報 |
---|
[21514] | 175 | $objFormParam->addParam('値引き', 'discount', INT_LEN, 'n', array('EXIST_CHECK', 'MAX_LENGTH_CHECK', 'NUM_CHECK'), '0'); |
---|
| 176 | $objFormParam->addParam('送料', 'deliv_fee', INT_LEN, 'n', array('EXIST_CHECK', 'MAX_LENGTH_CHECK', 'NUM_CHECK'), '0'); |
---|
| 177 | $objFormParam->addParam('手数料', 'charge', INT_LEN, 'n', array('EXIST_CHECK', 'MAX_LENGTH_CHECK', 'NUM_CHECK'), '0'); |
---|
[21020] | 178 | |
---|
| 179 | // ポイント機能ON時のみ |
---|
| 180 | if (USE_POINT !== false) { |
---|
[21514] | 181 | $objFormParam->addParam('利用ポイント', 'use_point', INT_LEN, 'n', array('EXIST_CHECK', 'MAX_LENGTH_CHECK', 'NUM_CHECK')); |
---|
[21020] | 182 | } |
---|
| 183 | |
---|
[21514] | 184 | $objFormParam->addParam('配送業者', 'deliv_id', INT_LEN, 'n', array('EXIST_CHECK', 'MAX_LENGTH_CHECK', 'NUM_CHECK')); |
---|
| 185 | $objFormParam->addParam('お支払い方法', 'payment_id', INT_LEN, 'n', array('EXIST_CHECK', 'MAX_LENGTH_CHECK', 'NUM_CHECK')); |
---|
| 186 | $objFormParam->addParam('対応状況', 'status', INT_LEN, 'n', array('EXIST_CHECK', 'MAX_LENGTH_CHECK', 'NUM_CHECK')); |
---|
| 187 | $objFormParam->addParam('お支払方法名称', 'payment_method'); |
---|
[21020] | 188 | |
---|
| 189 | // 受注詳細情報 |
---|
[21514] | 190 | $objFormParam->addParam('商品種別ID', 'product_type_id', INT_LEN, 'n', array('EXIST_CHECK', 'MAX_LENGTH_CHECK', 'NUM_CHECK'), '0'); |
---|
| 191 | $objFormParam->addParam('単価', 'price', INT_LEN, 'n', array('EXIST_CHECK', 'MAX_LENGTH_CHECK', 'NUM_CHECK'), '0'); |
---|
| 192 | $objFormParam->addParam('数量', 'quantity', INT_LEN, 'n', array('EXIST_CHECK', 'MAX_LENGTH_CHECK', 'NUM_CHECK'), '0'); |
---|
| 193 | $objFormParam->addParam('商品ID', 'product_id', INT_LEN, 'n', array('EXIST_CHECK', 'MAX_LENGTH_CHECK', 'NUM_CHECK'), '0'); |
---|
| 194 | $objFormParam->addParam('商品規格ID', 'product_class_id', INT_LEN, 'n', array('EXIST_CHECK', 'MAX_LENGTH_CHECK', 'NUM_CHECK'), '0'); |
---|
| 195 | $objFormParam->addParam('ポイント付与率', 'point_rate'); |
---|
| 196 | $objFormParam->addParam('商品コード', 'product_code'); |
---|
| 197 | $objFormParam->addParam('商品名', 'product_name'); |
---|
| 198 | $objFormParam->addParam('規格名1', 'classcategory_name1'); |
---|
| 199 | $objFormParam->addParam('規格名2', 'classcategory_name2'); |
---|
| 200 | $objFormParam->addParam('メモ', 'note', MTEXT_LEN, 'KVa', array('MAX_LENGTH_CHECK')); |
---|
| 201 | $objFormParam->addParam('削除用項番', 'delete_no', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK')); |
---|
[22218] | 202 | $objFormParam->addParam('消費税率', 'tax_rate'); |
---|
| 203 | $objFormParam->addParam('課税規則', 'tax_rule'); |
---|
[21020] | 204 | |
---|
| 205 | // DB読込用 |
---|
[21514] | 206 | $objFormParam->addParam('小計', 'subtotal'); |
---|
| 207 | $objFormParam->addParam('合計', 'total'); |
---|
| 208 | $objFormParam->addParam('支払い合計', 'payment_total'); |
---|
| 209 | $objFormParam->addParam('加算ポイント', 'add_point'); |
---|
| 210 | $objFormParam->addParam('お誕生日ポイント', 'birth_point'); |
---|
| 211 | $objFormParam->addParam('消費税合計', 'tax'); |
---|
| 212 | $objFormParam->addParam('最終保持ポイント', 'total_point'); |
---|
| 213 | $objFormParam->addParam('会員ID', 'customer_id', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK'), '0'); |
---|
| 214 | $objFormParam->addParam('会員ID', 'edit_customer_id', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK'), '0'); |
---|
| 215 | $objFormParam->addParam('現在のポイント', 'customer_point'); |
---|
| 216 | $objFormParam->addParam('受注前ポイント', 'point'); |
---|
| 217 | $objFormParam->addParam('注文番号', 'order_id'); |
---|
| 218 | $objFormParam->addParam('受注日', 'create_date'); |
---|
| 219 | $objFormParam->addParam('発送日', 'commit_date'); |
---|
| 220 | $objFormParam->addParam('備考', 'message'); |
---|
| 221 | $objFormParam->addParam('入金日', 'payment_date'); |
---|
| 222 | $objFormParam->addParam('端末種別', 'device_type_id'); |
---|
[21020] | 223 | |
---|
| 224 | // 複数情報 |
---|
[21514] | 225 | $objFormParam->addParam('配送数', 'shipping_quantity', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK'), 1); |
---|
| 226 | $objFormParam->addParam('配送ID', 'shipping_id', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK'), 0); |
---|
| 227 | $objFormParam->addParam('お名前1', 'shipping_name01', STEXT_LEN, 'KVa', array('SPTAB_CHECK', 'MAX_LENGTH_CHECK')); |
---|
| 228 | $objFormParam->addParam('お名前2', 'shipping_name02', STEXT_LEN, 'KVa', array('SPTAB_CHECK', 'MAX_LENGTH_CHECK')); |
---|
| 229 | $objFormParam->addParam('お名前(フリガナ・姓)', 'shipping_kana01', STEXT_LEN, 'KVCa', array('SPTAB_CHECK', 'MAX_LENGTH_CHECK')); |
---|
| 230 | $objFormParam->addParam('お名前(フリガナ・名)', 'shipping_kana02', STEXT_LEN, 'KVCa', array('SPTAB_CHECK', 'MAX_LENGTH_CHECK')); |
---|
[23230] | 231 | $objFormParam->addParam('会社名', 'shipping_company_name', STEXT_LEN, 'KVa', array('SPTAB_CHECK', 'MAX_LENGTH_CHECK')); |
---|
| 232 | if (FORM_COUNTRY_ENABLE) { |
---|
| 233 | $objFormParam->addParam('国', 'shipping_country_id', INT_LEN, 'n', array('EXIST_CHECK', 'NUM_CHECK')); |
---|
| 234 | $objFormParam->addParam('ZIPCODE', 'shipping_zipcode', STEXT_LEN, 'n', array('NO_SPTAB', 'SPTAB_CHECK', 'GRAPH_CHECK', 'MAX_LENGTH_CHECK')); |
---|
| 235 | } |
---|
[21514] | 236 | $objFormParam->addParam('郵便番号1', 'shipping_zip01', ZIP01_LEN, 'n', array('NUM_CHECK', 'NUM_COUNT_CHECK')); |
---|
| 237 | $objFormParam->addParam('郵便番号2', 'shipping_zip02', ZIP02_LEN, 'n', array('NUM_CHECK', 'NUM_COUNT_CHECK')); |
---|
| 238 | $objFormParam->addParam('都道府県', 'shipping_pref', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK')); |
---|
| 239 | $objFormParam->addParam('住所1', 'shipping_addr01', MTEXT_LEN, 'KVa', array('SPTAB_CHECK', 'MAX_LENGTH_CHECK')); |
---|
| 240 | $objFormParam->addParam('住所2', 'shipping_addr02', MTEXT_LEN, 'KVa', array('SPTAB_CHECK', 'MAX_LENGTH_CHECK')); |
---|
| 241 | $objFormParam->addParam('電話番号1', 'shipping_tel01', TEL_ITEM_LEN, 'n', array('MAX_LENGTH_CHECK' ,'NUM_CHECK')); |
---|
| 242 | $objFormParam->addParam('電話番号2', 'shipping_tel02', TEL_ITEM_LEN, 'n', array('MAX_LENGTH_CHECK' ,'NUM_CHECK')); |
---|
| 243 | $objFormParam->addParam('電話番号3', 'shipping_tel03', TEL_ITEM_LEN, 'n', array('MAX_LENGTH_CHECK' ,'NUM_CHECK')); |
---|
| 244 | $objFormParam->addParam('お届け時間ID', 'time_id', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK')); |
---|
| 245 | $objFormParam->addParam('お届け日(年)', 'shipping_date_year', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK')); |
---|
| 246 | $objFormParam->addParam('お届け日(月)', 'shipping_date_month', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK')); |
---|
| 247 | $objFormParam->addParam('お届け日(日)', 'shipping_date_day', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK')); |
---|
| 248 | $objFormParam->addParam('お届け日', 'shipping_date', STEXT_LEN, 'KVa', array('SPTAB_CHECK', 'MAX_LENGTH_CHECK')); |
---|
| 249 | $objFormParam->addParam('配送商品数量', 'shipping_product_quantity', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK')); |
---|
[21020] | 250 | |
---|
[21514] | 251 | $objFormParam->addParam('商品規格ID', 'shipment_product_class_id', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK')); |
---|
| 252 | $objFormParam->addParam('商品コード', 'shipment_product_code'); |
---|
| 253 | $objFormParam->addParam('商品名', 'shipment_product_name'); |
---|
| 254 | $objFormParam->addParam('規格名1', 'shipment_classcategory_name1'); |
---|
| 255 | $objFormParam->addParam('規格名2', 'shipment_classcategory_name2'); |
---|
| 256 | $objFormParam->addParam('単価', 'shipment_price', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK'), '0'); |
---|
| 257 | $objFormParam->addParam('数量', 'shipment_quantity', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK'), '0'); |
---|
[21020] | 258 | |
---|
[21514] | 259 | $objFormParam->addParam('商品項番', 'no', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK')); |
---|
| 260 | $objFormParam->addParam('追加商品規格ID', 'add_product_class_id', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK')); |
---|
| 261 | $objFormParam->addParam('修正商品規格ID', 'edit_product_class_id', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK')); |
---|
| 262 | $objFormParam->addParam('アンカーキー', 'anchor_key', STEXT_LEN, 'KVa', array('SPTAB_CHECK', 'MAX_LENGTH_CHECK')); |
---|
[21020] | 263 | } |
---|
| 264 | |
---|
| 265 | /** |
---|
| 266 | * 受注データを取得して, SC_FormParam へ設定する. |
---|
| 267 | * |
---|
[23124] | 268 | * @param SC_FormParam $objFormParam SC_FormParam インスタンス |
---|
| 269 | * @param integer $order_id 取得元の受注ID |
---|
[21020] | 270 | * @return void |
---|
| 271 | */ |
---|
[23124] | 272 | public function setOrderToFormParam(&$objFormParam, $order_id) |
---|
[22567] | 273 | { |
---|
[21020] | 274 | $objPurchase = new SC_Helper_Purchase_Ex(); |
---|
| 275 | |
---|
| 276 | // 受注詳細を設定 |
---|
| 277 | $arrOrderDetail = $objPurchase->getOrderDetail($order_id, false); |
---|
| 278 | $objFormParam->setParam(SC_Utils_Ex::sfSwapArray($arrOrderDetail)); |
---|
| 279 | |
---|
[21201] | 280 | $arrShippingsTmp = $objPurchase->getShippings($order_id); |
---|
| 281 | $arrShippings = array(); |
---|
| 282 | foreach ($arrShippingsTmp as $row) { |
---|
| 283 | // お届け日の処理 |
---|
[21481] | 284 | if (!SC_Utils_Ex::isBlank($row['shipping_date'])) { |
---|
| 285 | $ts = strtotime($row['shipping_date']); |
---|
[21201] | 286 | $row['shipping_date_year'] = date('Y', $ts); |
---|
| 287 | $row['shipping_date_month'] = date('n', $ts); |
---|
| 288 | $row['shipping_date_day'] = date('j', $ts); |
---|
[21020] | 289 | } |
---|
[21201] | 290 | $arrShippings[$row['shipping_id']] = $row; |
---|
[21020] | 291 | } |
---|
| 292 | $objFormParam->setValue('shipping_quantity', count($arrShippings)); |
---|
| 293 | $objFormParam->setParam(SC_Utils_Ex::sfSwapArray($arrShippings)); |
---|
| 294 | |
---|
| 295 | /* |
---|
| 296 | * 配送商品を設定 |
---|
| 297 | * |
---|
[21201] | 298 | * $arrShipmentItem['shipment_(key)'][$shipping_id][$item_index] = 値 |
---|
| 299 | * $arrProductQuantity[$shipping_id] = 配送先ごとの配送商品数量 |
---|
[21020] | 300 | */ |
---|
| 301 | $arrProductQuantity = array(); |
---|
| 302 | $arrShipmentItem = array(); |
---|
[21201] | 303 | foreach ($arrShippings as $shipping_id => $arrShipping) { |
---|
| 304 | $arrProductQuantity[$shipping_id] = count($arrShipping['shipment_item']); |
---|
[21020] | 305 | foreach ($arrShipping['shipment_item'] as $item_index => $arrItem) { |
---|
| 306 | foreach ($arrItem as $item_key => $item_val) { |
---|
[21201] | 307 | $arrShipmentItem['shipment_' . $item_key][$shipping_id][$item_index] = $item_val; |
---|
[21020] | 308 | } |
---|
| 309 | } |
---|
| 310 | } |
---|
| 311 | $objFormParam->setValue('shipping_product_quantity', $arrProductQuantity); |
---|
| 312 | $objFormParam->setParam($arrShipmentItem); |
---|
| 313 | |
---|
| 314 | /* |
---|
| 315 | * 受注情報を設定 |
---|
| 316 | * $arrOrderDetail と項目が重複しており, $arrOrderDetail は連想配列の値 |
---|
| 317 | * が渡ってくるため, $arrOrder で上書きする. |
---|
| 318 | */ |
---|
| 319 | $arrOrder = $objPurchase->getOrder($order_id); |
---|
[23300] | 320 | |
---|
| 321 | // 生年月日の処理
|
---|
| 322 | if (!SC_Utils_Ex::isBlank($arrOrder['order_birth'])) {
|
---|
| 323 | $order_birth = substr($arrOrder['order_birth'], 0, 10);
|
---|
| 324 | $arrOrderBirth = explode("-", $order_birth);
|
---|
| 325 | $arrOrder['order_birth_year'] = intval($arrOrderBirth[0]);
|
---|
| 326 | $arrOrder['order_birth_month'] = intval($arrOrderBirth[1]);
|
---|
| 327 | $arrOrder['order_birth_day'] = intval($arrOrderBirth[2]);
|
---|
| 328 | } |
---|
| 329 | |
---|
[21020] | 330 | $objFormParam->setParam($arrOrder); |
---|
| 331 | |
---|
[21201] | 332 | // ポイントを設定 |
---|
[21166] | 333 | list($db_point, $rollback_point) = SC_Helper_DB_Ex::sfGetRollbackPoint( |
---|
| 334 | $order_id, $arrOrder['use_point'], $arrOrder['add_point'], $arrOrder['status'] |
---|
| 335 | ); |
---|
[21020] | 336 | $objFormParam->setValue('total_point', $db_point); |
---|
| 337 | $objFormParam->setValue('point', $rollback_point); |
---|
| 338 | |
---|
| 339 | if (!SC_Utils_Ex::isBlank($objFormParam->getValue('customer_id'))) { |
---|
[21201] | 340 | $arrCustomer = SC_Helper_Customer_Ex::sfGetCustomerDataFromId($objFormParam->getValue('customer_id')); |
---|
| 341 | $objFormParam->setValue('customer_point', $arrCustomer['point']); |
---|
[21020] | 342 | } |
---|
| 343 | } |
---|
| 344 | } |
---|