Changeset 22702


Ignore:
Timestamp:
2013/03/10 10:26:06 (11 years ago)
Author:
AMUAMU
Message:

税設定選択ルーチンを修正

File:
1 edited

Legend:

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

    r22700 r22702  
    123123    function getTaxRule ($product_id = 0, $product_class_id = 0, $pref_id = 0, $country_id = 0) 
    124124    { 
     125        // 初期化 
     126        $product_id = $product_id > 0 ? $product_id : 0; 
     127        $product_class_id = $product_class_id > 0 ? $product_class_id : 0; 
     128        $pref_id = $pref_id > 0 ? $pref_id : 0; 
     129        $country_id = $country_id > 0 ? $country_id : 0; 
     130 
     131        $objCustomer = new SC_Customer_Ex(); 
     132        if ($objCustomer->isLoginSuccess(true)) { 
     133            if ($country_id == 0) { 
     134                $objCustomer->getValue('country_id'); 
     135            } 
     136            if ($pref_id == 0) { 
     137                $objCustomer->getValue('pref'); 
     138            } 
     139        } 
     140 
    125141        // リクエストの配列化 
    126142        $arrRequest = array('product_id' => $product_id, 
     
    144160            $table = 'dtb_tax_rule'; 
    145161            $cols = '*, CASE WHEN apply_date IS NULL THEN 1 ELSE 0 END as nullorder'; 
    146             $where = '(product_id = 0 OR product_id = ?)' 
    147                         . ' AND (product_class_id = 0 OR product_class_id = ?)' 
     162            $where = '((product_id = 0 OR product_id = ?)' 
     163                        . ' OR (product_class_id = 0 OR product_class_id = ?))' 
    148164                        . ' AND (pref_id = 0 OR pref_id = ?)' 
    149165                        . ' AND (country_id = 0 OR country_id = ?)' 
     
    183199        } 
    184200 
    185         GC_Utils_Ex::gfDebugLog('tax_key=' . $cache_key . ' result_tax=' . print_r($data_c[$cache_key],true)); 
     201        GC_Utils_Ex::gfPrintLog('tax_key=' . $cache_key . ' result_tax=' . print_r($data_c[$cache_key],true)); 
    186202        return $data_c[$cache_key]; 
    187203    } 
     
    208224            // 税情報を設定 
    209225            SC_Helper_TaxRule_Ex::setTaxRule($calc_rule, $tax_rate, $apply_date, $tax_rule_id=NULL, $tax_adjust=0, $product_id, $product_class_id, $pref_id, $country_id); 
    210      
     226 
    211227        } 
    212228    } 
Note: See TracChangeset for help on using the changeset viewer.