Changeset 22626


Ignore:
Timestamp:
2013/03/09 16:24:38 (11 years ago)
Author:
AMUAMU
Message:

商品詳細の表示のみはdtb_tax_ruleに従うように。

Location:
branches/camp/camp-2_13-tax/data/class
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/camp/camp-2_13-tax/data/class/SC_Product.php

    r22623 r22626  
    611611    static function setIncTaxToProduct(&$arrProduct) 
    612612    { 
    613         $arrProduct['price01_min_inctax'] = isset($arrProduct['price01_min']) ? SC_Helper_DB_Ex::sfCalcIncTax($arrProduct['price01_min']) : null; 
    614         $arrProduct['price01_max_inctax'] = isset($arrProduct['price01_max']) ? SC_Helper_DB_Ex::sfCalcIncTax($arrProduct['price01_max']) : null; 
    615         $arrProduct['price02_min_inctax'] = isset($arrProduct['price02_min']) ? SC_Helper_DB_Ex::sfCalcIncTax($arrProduct['price02_min']) : null; 
    616         $arrProduct['price02_max_inctax'] = isset($arrProduct['price02_max']) ? SC_Helper_DB_Ex::sfCalcIncTax($arrProduct['price02_max']) : null; 
     613        $arrProduct['price01_min_inctax'] = isset($arrProduct['price01_min']) ? SC_Helper_TaxRule_Ex::sfCalcIncTax($arrProduct['price01_min'], $arrProduct['product_id']) : null; 
     614        $arrProduct['price01_max_inctax'] = isset($arrProduct['price01_max']) ? SC_Helper_TaxRule_Ex::sfCalcIncTax($arrProduct['price01_max'], $arrProduct['product_id']) : null; 
     615        $arrProduct['price02_min_inctax'] = isset($arrProduct['price02_min']) ? SC_Helper_TaxRule_Ex::sfCalcIncTax($arrProduct['price02_min'], $arrProduct['product_id']) : null; 
     616        $arrProduct['price02_max_inctax'] = isset($arrProduct['price02_max']) ? SC_Helper_TaxRule_Ex::sfCalcIncTax($arrProduct['price02_max'], $arrProduct['product_id']) : null; 
    617617    } 
    618618 
  • branches/camp/camp-2_13-tax/data/class/helper/SC_Helper_TaxRule.php

    r22623 r22626  
    2323 
    2424/** 
    25  * 会員規約を管理するヘルパークラス. 
     25 * 規約を管理するヘルパークラス. 
    2626 * 
    2727 * @package Helper 
     
    3131class SC_Helper_TaxRule 
    3232{ 
    33  
    3433    /** 
    3534     * 設定情報に基づいて税金付与した金額を返す 
     
    4039    function sfCalcIncTax($price, $product_id = 0, $product_class_id = 0, $pref_id =0, $country_id = 0) 
    4140    { 
    42         $arrTaxRule = SC_Helper_TaxRule_Ex::getTaxRule($product_id, $product_class_id, $pref_id, $country_id); 
    43  
    44         return $price + SC_Helper_TaxRule_Ex::sfTax($price, $arrTaxRule['tax_rate'], $arrTaxRule['tax_rule'], $arrTaxRule['tax_adjust']); 
     41        return $price + SC_Helper_TaxRule_Ex::sfTax($price, $product_id, $product_class_id, $pref_id, $country_id); 
    4542    } 
    4643 
    4744    /** 
    48      * 金額を返す 
     45     * 設定情報に基づいて税金の金額を返す 
    4946     * 
    50      * ・店舗基本情報に基づいた計算は SC_Helper_DB::sfTax() を使用する 
     47     * @param integer $price 計算対象の金額 
     48     * @return integer 税金した金額 
     49     */ 
     50    function sfTax($price, $product_id = 0, $product_class_id = 0, $pref_id =0, $country_id = 0) 
     51    { 
     52        $arrTaxRule = SC_Helper_TaxRule_Ex::getTaxRule($product_id, $product_class_id, $pref_id, $country_id); 
     53        return SC_Helper_TaxRule_Ex::calcTax($price, $arrTaxRule['tax_rate'], $arrTaxRule['tax_rule'], $arrTaxRule['tax_adjust']); 
     54    } 
     55 
     56    /** 
     57     * 税金額を計算する 
    5158     * 
    5259     * @param integer $price 計算対象の金額 
     
    5663     * @return integer 税金額 
    5764     */ 
    58     function sfTax($price, $tax, $calc_rule, $tax_adjust = 0) 
     65    function calcTax ($price, $tax, $calc_rule, $tax_adjust = 0) 
    5966    { 
    6067        $real_tax = $tax / 100; 
     
    8289 
    8390    /** 
    84      * 税金設定情報に基づいて税金額を返す 
     91     * 現在有効な税金設定情報を返す 
    8592     * 
    8693     * @param integer $price 計算対象の金額 
Note: See TracChangeset for help on using the changeset viewer.