Ignore:
Timestamp:
2013/08/30 18:47:51 (11 years ago)
Author:
m_uehara
Message:

#2363 r23157 - r23159, r23165 - r23167, r23169 をマージ

Location:
branches/version-2_13-dev/data/class
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_13-dev/data/class/SC_CartSession.php

    r23124 r23170  
    171171            $incTax = SC_Helper_TaxRule_Ex::sfCalcIncTax($price, 
    172172                $this->cartSession[$productTypeId][$i]['productsClass']['product_id'], 
    173                 $this->cartSession[$productTypeId][$i]['id'][0], 
     173                $this->cartSession[$productTypeId][$i]['productsClass']['product_class_id'], 
    174174                $pref_id, $country_id); 
    175175 
     
    191191            $tax = SC_Helper_TaxRule_Ex::sfTax($price, 
    192192                $this->cartSession[$productTypeId][$i]['productsClass']['product_id'], 
    193                 $this->cartSession[$productTypeId][$i]['id'][0], 
     193                $this->cartSession[$productTypeId][$i]['productsClass']['product_class_id'], 
    194194                $pref_id, $country_id); 
    195195 
     
    416416                $arrTaxRule = SC_Helper_TaxRule_Ex::getTaxRule( 
    417417                                    $this->cartSession[$productTypeId][$i]['productsClass']['product_id'], 
    418                                     $this->cartSession[$productTypeId][$i]['id'][0], 
     418                                    $this->cartSession[$productTypeId][$i]['productsClass']['product_class_id'], 
    419419                                    $pref_id, 
    420420                                    $country_id); 
  • branches/version-2_13-dev/data/class/helper/SC_Helper_TaxRule.php

    r23124 r23170  
    168168            $table = 'dtb_tax_rule'; 
    169169            $cols = '*'; 
    170             $where = '((product_id = 0 OR product_id = ?)' 
    171                         . ' OR (product_class_id = 0 OR product_class_id = ?))' 
    172                         . ' AND (pref_id = 0 OR pref_id = ?)' 
    173                         . ' AND (country_id = 0 OR country_id = ?)' 
    174                         . ' AND apply_date < CURRENT_TIMESTAMP' 
    175                         . ' AND del_flg = 0'; 
    176  
    177             $arrVal = array($product_id, $product_class_id, $pref_id, $country_id); 
     170             
     171            // 商品税率有無設定により分岐 
     172            if(OPTION_PRODUCT_TAX_RULE == 1) { 
     173                $where = '((product_id = 0 OR product_id = ?)' 
     174                            . ' OR (product_class_id = 0 OR product_class_id = ?))' 
     175                            . ' AND (pref_id = 0 OR pref_id = ?)' 
     176                            . ' AND (country_id = 0 OR country_id = ?)' 
     177                            . ' AND apply_date < CURRENT_TIMESTAMP' 
     178                            . ' AND del_flg = 0'; 
     179                $arrVal = array($product_id, $product_class_id, $pref_id, $country_id); 
     180            } else { 
     181                $where = '     product_id = 0 ' 
     182                       . ' AND product_class_id = 0 ' 
     183                       . ' AND (pref_id = 0 OR pref_id = ?)' 
     184                       . ' AND (country_id = 0 OR country_id = ?)' 
     185                       . ' AND apply_date < CURRENT_TIMESTAMP' 
     186                       . ' AND del_flg = 0'; 
     187                $arrVal = array($pref_id, $country_id); 
     188            } 
     189 
    178190            $order = 'apply_date DESC'; 
    179191            $objQuery->setOrder($order); 
  • branches/version-2_13-dev/data/class/pages/admin/basis/LC_Page_Admin_Basis_Tax.php

    r23124 r23170  
    116116                        $this->tpl_onload = "alert('登録が完了しました。');"; 
    117117                    } 
     118                } else { 
     119                    // エラーが存在する場合、メッセージを表示する為に代入 
     120                    $this->arrErr['product_tax_flg'] = $arrErr['product_tax_flg']; 
    118121                } 
     122                 
    119123                break; 
    120124 
     
    132136                        // 完了メッセージ 
    133137                        $this->tpl_onload = "alert('登録が完了しました。');"; 
     138 
    134139                        // リロード 
    135140                        SC_Response_Ex::reload(); 
    136141                    } 
     142                } else if(SC_Utils_Ex::isBlank($this->arrErr['tax_rule_id'])) { 
     143                    // 税率ID以外のエラーの場合、ID情報を引き継ぐ 
     144                    $this->tpl_tax_rule_id = $tax_rule_id; 
    137145                } 
    138146 
     
    188196        $objFormParam->addParam('消費税率', 'tax_rate', PERCENTAGE_LEN, 'n', array('EXIST_CHECK', 'NUM_CHECK', 'MAX_LENGTH_CHECK')); 
    189197        $objFormParam->addParam('課税規則', 'calc_rule', PERCENTAGE_LEN, 'n', array('EXIST_CHECK', 'NUM_CHECK', 'MAX_LENGTH_CHECK')); 
     198 
    190199        // 適用日時 
    191200        $objFormParam->addParam('適用年', 'apply_date_year', INT_LEN, 'n', array('EXIST_CHECK', 'MAX_LENGTH_CHECK', 'NUM_CHECK')); 
     
    194203        $objFormParam->addParam('適用時', 'apply_date_hour', INT_LEN, 'n', array('EXIST_CHECK', 'MAX_LENGTH_CHECK', 'NUM_CHECK')); 
    195204        $objFormParam->addParam('適用分', 'apply_date_minutes', INT_LEN, 'n', array('EXIST_CHECK', 'MAX_LENGTH_CHECK', 'NUM_CHECK')); 
    196         $objFormParam->addParam('適用日時', 'apply_date_year', 'apply_date_month', 'apply_date_day', INT_LEN, 'n', array("CHECK_DATE")); 
    197205    } 
    198206 
     
    256264        $arrErr = $objFormParam->checkError(); 
    257265        $arrForm = $objFormParam->getHashArray(); 
     266        $objErr = new SC_CheckError_Ex($arrForm); 
    258267 
    259268        // tax_rule_id の正当性チェック 
     
    267276        } 
    268277 
    269         if ($arrForm['tax_rule_id'] != '0') { 
    270         $apply_date = SC_Utils_Ex::sfGetTimestampistime( 
    271                 $arrForm['apply_date_year'], 
    272                 sprintf("%02d", $arrForm['apply_date_month']), 
    273                 sprintf("%02d", $arrForm['apply_date_day']), 
    274                 sprintf("%02d", $arrForm['apply_date_hour']), 
    275                 sprintf("%02d", $arrForm['apply_date_minutes']) 
    276                 ); 
    277  
    278         // 税規約情報読み込み 
    279         $arrTaxRuleByTime = $objTaxRule->getTaxRuleByTime($apply_date); 
    280         // 編集中のレコード以外に同じ消費税率、課税規則が存在する場合 
     278        // 適用日時チェック 
     279        $objErr->doFunc(array('適用日時', 'apply_date_year', 'apply_date_month', 'apply_date_day'), array('CHECK_DATE')); 
     280        if (SC_Utils_Ex::isBlank($objErr->arrErr['apply_date_year']) && $arrForm['tax_rule_id'] != '0') { 
     281            $apply_date = SC_Utils_Ex::sfGetTimestampistime( 
     282                    $arrForm['apply_date_year'], 
     283                    sprintf("%02d", $arrForm['apply_date_month']), 
     284                    sprintf("%02d", $arrForm['apply_date_day']), 
     285                    sprintf("%02d", $arrForm['apply_date_hour']), 
     286                    sprintf("%02d", $arrForm['apply_date_minutes']) 
     287                    ); 
     288 
     289            // 税規約情報読み込み 
     290            $arrTaxRuleByTime = $objTaxRule->getTaxRuleByTime($apply_date); 
     291 
     292            // 編集中のレコード以外に同じ消費税率、課税規則が存在する場合 
    281293            if ( 
    282294                !SC_Utils_Ex::isBlank($arrTaxRuleByTime) 
     
    287299            } 
    288300        } 
     301        if (!SC_Utils_Ex::isBlank($objErr->arrErr)) { 
     302            $arrErr = array_merge($arrErr, $objErr->arrErr); 
     303        } 
    289304 
    290305        return $arrErr; 
  • branches/version-2_13-dev/data/class/pages/admin/order/LC_Page_Admin_Order_Edit.php

    r23124 r23170  
    367367        $objFormParam->addParam('規格名1', 'classcategory_name1'); 
    368368        $objFormParam->addParam('規格名2', 'classcategory_name2'); 
    369         $objFormParam->addParam('税率', 'tax_rate'); 
    370         $objFormParam->addParam('課税規則', 'tax_rule'); 
     369        $objFormParam->addParam('税率', 'tax_rate', INT_LEN, 'n', array('NUM_CHECK')); 
     370        $objFormParam->addParam('課税規則', 'tax_rule', INT_LEN, 'n', array('NUM_CHECK')); 
    371371        $objFormParam->addParam('メモ', 'note', MTEXT_LEN, 'KVa', array('MAX_LENGTH_CHECK')); 
    372372        $objFormParam->addParam('削除用項番', 'delete_no', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK')); 
  • branches/version-2_13-dev/data/class/pages/products/LC_Page_Products_Detail.php

    r23124 r23170  
    541541            $this->arrErr = $this->lfCheckError($this->mode,$this->objFormParam); 
    542542            if (count($this->arrErr) == 0) { 
    543                 if ($this->lfRegistFavoriteProduct($this->objFormParam->getValue('favorite_product_id'),$objCustomer->getValue('customer_id'))) { 
    544                     $objPlugin = SC_Helper_Plugin_Ex::getSingletonInstance($this->plugin_activate_flg); 
    545                     $objPlugin->doAction('LC_Page_Products_Detail_action_add_favorite', array($this)); 
     543                if (!$this->lfRegistFavoriteProduct($this->objFormParam->getValue('favorite_product_id'),$objCustomer->getValue('customer_id'))) { 
     544                    SC_Response_Ex::actionExit();  
    546545                } 
     546                $objPlugin = SC_Helper_Plugin_Ex::getSingletonInstance($this->plugin_activate_flg); 
     547                $objPlugin->doAction('LC_Page_Products_Detail_action_add_favorite', array($this)); 
    547548            } 
    548549        } 
Note: See TracChangeset for help on using the changeset viewer.