Ignore:
Timestamp:
2013/08/24 23:33:52 (11 years ago)
Author:
kimoto
Message:

#2043 typo修正・ソース整形・ソースコメントの改善 for 2.13.0
PHP4的な書き方の修正

File:
1 edited

Legend:

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

    r23088 r23124  
    3434     * 設定情報に基づいて税金付与した金額を返す 
    3535     * 
    36      * @param integer $price 計算対象の金額 
     36     * @param  integer $price 計算対象の金額 
    3737     * @return integer 税金付与した金額 
    3838     */ 
    39     function sfCalcIncTax($price, $product_id = 0, $product_class_id = 0, $pref_id =0, $country_id = 0) 
     39    public function sfCalcIncTax($price, $product_id = 0, $product_class_id = 0, $pref_id =0, $country_id = 0) 
    4040    { 
    4141        return $price + SC_Helper_TaxRule_Ex::sfTax($price, $product_id, $product_class_id, $pref_id, $country_id); 
     
    4545     * 設定情報に基づいて税金の金額を返す 
    4646     * 
    47      * @param integer $price 計算対象の金額 
     47     * @param  integer $price 計算対象の金額 
    4848     * @return integer 税金した金額 
    4949     */ 
    50     function sfTax($price, $product_id = 0, $product_class_id = 0, $pref_id =0, $country_id = 0) 
     50    public function sfTax($price, $product_id = 0, $product_class_id = 0, $pref_id =0, $country_id = 0) 
    5151    { 
    5252        $arrTaxRule = SC_Helper_TaxRule_Ex::getTaxRule($product_id, $product_class_id, $pref_id, $country_id); 
     
    5959     * (受注データのようにルールが決まっている場合用) 
    6060     * 
    61      * @param integer $price 計算対象の金額 
     61     * @param  integer $price 計算対象の金額 
    6262     * @return integer 税金付与した金額 
    6363     */ 
    64     function calcIncTaxFromRuleId($price, $tax_rule_id = 0) 
     64    public function calcIncTaxFromRuleId($price, $tax_rule_id = 0) 
    6565    { 
    6666        return $price + SC_Helper_TaxRule_Ex::calcTaxFromRuleId($price, $tax_rule_id); 
     
    7171     * (受注データのようにルールが決まっている場合用) 
    7272     * 
     73     * @param  integer $price 計算対象の金額 
     74     * @return integer 税金した金額 
     75     */ 
     76    public function calcTaxFromRuleId($price, $tax_rule_id = 0) 
     77    { 
     78        $arrTaxRule = SC_Helper_TaxRule_Ex::getTaxRuleData($tax_rule_id); 
     79 
     80        return SC_Helper_TaxRule_Ex::calcTax($price, $arrTaxRule['tax_rate'], $arrTaxRule['tax_rule'], $arrTaxRule['tax_adjust']); 
     81    } 
     82 
     83    /** 
     84     * 税金額を計算する 
     85     * 
    7386     * @param integer $price 計算対象の金額 
    74      * @return integer 税金した金額 
    75      */ 
    76     function calcTaxFromRuleId($price, $tax_rule_id = 0) 
    77     { 
    78         $arrTaxRule = SC_Helper_TaxRule_Ex::getTaxRuleData($tax_rule_id); 
    79  
    80         return SC_Helper_TaxRule_Ex::calcTax($price, $arrTaxRule['tax_rate'], $arrTaxRule['tax_rule'], $arrTaxRule['tax_adjust']); 
    81     } 
    82  
    83     /** 
    84      * 税金額を計算する 
    85      * 
    86      * @param integer $price 計算対象の金額 
    87      * @param integer $tax 税率(%単位) 
     87     * @param integer $tax   税率(%単位) 
    8888     *     XXX integer のみか不明 
    89      * @param integer $tax_rule 端数処理 
     89     * @param  integer $tax_rule 端数処理 
    9090     * @return integer 税金額 
    9191     */ 
    92     function calcTax ($price, $tax, $calc_rule, $tax_adjust = 0) 
     92    public function calcTax ($price, $tax, $calc_rule, $tax_adjust = 0) 
    9393    { 
    9494        $real_tax = $tax / 100; 
     
    119119     * 現在有効な税金設定情報を返す 
    120120     * 
    121      * @param integer $price 計算対象の金額 
    122      * @return array 税設定情報 
    123      */ 
    124     function getTaxRule ($product_id = 0, $product_class_id = 0, $pref_id = 0, $country_id = 0) 
     121     * @param  integer $price 計算対象の金額 
     122     * @return array   税設定情報 
     123     */ 
     124    public function getTaxRule ($product_id = 0, $product_class_id = 0, $pref_id = 0, $country_id = 0) 
    125125    { 
    126126        // 初期化 
     
    214214     * 税金設定情報を登録する(商品管理用) 
    215215     * 
    216      * @param decimal $tax_rate 消費税率 
    217      * @param integer $product_id 商品ID 
    218      * @param integer $product_class_id 商品規格ID 
    219      * @param decimal $tax_adjust 消費税加算額 
    220      * @param integer $pref_id 県ID 
    221      * @param integer $country_id 国ID 
     216     * @param  decimal $tax_rate        消費税率 
     217     * @param  integer $product_id      商品ID 
     218     * @param  integer $product_class_id 商品規格ID 
     219     * @param  decimal $tax_adjust      消費税加算額 
     220     * @param  integer $pref_id          県ID 
     221     * @param  integer $country_id      国ID 
    222222     * @return void 
    223223     */ 
    224     function setTaxRuleForProduct($tax_rate, $product_id = 0, $product_class_id = 0, $tax_adjust=0, $pref_id = 0, $country_id = 0) 
     224    public function setTaxRuleForProduct($tax_rate, $product_id = 0, $product_class_id = 0, $tax_adjust=0, $pref_id = 0, $country_id = 0) 
    225225    { 
    226226        // 基本設定を取得 
     
    228228 
    229229        // 基本設定の消費税率と一緒であれば設定しない 
    230         if( $arrRet['tax_rate'] != $tax_rate ) { 
     230        if ($arrRet['tax_rate'] != $tax_rate) { 
    231231            // 課税規則は基本設定のものを使用 
    232232            $calc_rule = $arrRet['calc_rule']; 
     
    244244     * @return 
    245245     */ 
    246     function setTaxRule($calc_rule, $tax_rate, $apply_date, $tax_rule_id=NULL, $tax_adjust=0, $product_id = 0, $product_class_id = 0, $pref_id = 0, $country_id = 0) 
     246    public function setTaxRule($calc_rule, $tax_rate, $apply_date, $tax_rule_id=NULL, $tax_adjust=0, $product_id = 0, $product_class_id = 0, $pref_id = 0, $country_id = 0) 
    247247    { 
    248248        $table = 'dtb_tax_rule'; 
     
    257257        // 新規か更新か? 
    258258        $objQuery =& SC_Query_Ex::getSingletonInstance(); 
    259         if($tax_rule_id == NULL && $product_id != 0 && $product_class_id != 0){ 
     259        if ($tax_rule_id == NULL && $product_id != 0 && $product_class_id != 0) { 
    260260            $where = 'product_id = ? AND product_class_id= ? AND pref_id = ? AND country_id = ?'; 
    261261            $arrVal = array($product_id, $product_class_id, $pref_id, $country_id); 
     
    264264        } 
    265265 
    266         if($tax_rule_id == NULL) { 
     266        if ($tax_rule_id == NULL) { 
    267267            // 税情報を新規 
    268268            // INSERTの実行 
     
    282282    } 
    283283 
    284     function getTaxRuleList($has_deleted = false) 
     284    public function getTaxRuleList($has_deleted = false) 
    285285    { 
    286286        $objQuery =& SC_Query_Ex::getSingletonInstance(); 
     
    298298    } 
    299299 
    300     function getTaxRuleData($tax_rule_id, $has_deleted = false) 
     300    public function getTaxRuleData($tax_rule_id, $has_deleted = false) 
    301301    { 
    302302        $objQuery =& SC_Query_Ex::getSingletonInstance(); 
     
    309309    } 
    310310 
    311     function getTaxRuleByTime($apply_date, $has_deleted = false) 
     311    public function getTaxRuleByTime($apply_date, $has_deleted = false) 
    312312    { 
    313313        $objQuery =& SC_Query_Ex::getSingletonInstance(); 
     
    324324     * 税規約の削除. 
    325325     * 
    326      * @param integer $tax_rule_id 税規約ID 
     326     * @param  integer $tax_rule_id 税規約ID 
    327327     * @return void 
    328328     */ 
    329     function deleteTaxRuleData($tax_rule_id) 
     329    public function deleteTaxRuleData($tax_rule_id) 
    330330    { 
    331331        $objQuery =& SC_Query_Ex::getSingletonInstance(); 
Note: See TracChangeset for help on using the changeset viewer.