Changeset 18110


Ignore:
Timestamp:
2009/06/15 17:51:40 (15 years ago)
Author:
kajiwara
Message:

#395 お支払い方法選択時(フロント画面)のエラーを修正(お支払方法IDの整合性をチェック時、消費税計算が正常に行われていない不具合を修正)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_4/data/class/util/SC_Utils.php

    r17895 r18110  
    629629 
    630630    /* 税金計算 */ 
    631     function sfTax($price, $tax, $tax_rule) { 
     631    function sfTax($price, $tax = null, $tax_rule = null) { 
     632        // 店舗基本情報を取得 
     633        static $CONF; 
     634        if (is_null($CONF) && (is_null($tax) || is_null($tax_rule))) { 
     635            $CONF = SC_Helper_DB_Ex::sf_getBasisData(); 
     636         } 
     637        if (is_null($tax)) { 
     638            $tax = $CONF['tax']; 
     639        } 
     640        if (is_null($tax_rule)) { 
     641            $tax_rule = $CONF['tax_rule']; 
     642        } 
     643 
    632644        $real_tax = $tax / 100; 
    633645        $ret = $price * $real_tax; 
     
    654666 
    655667    /* 税金付与 */ 
    656     function sfPreTax($price, $tax, $tax_rule) { 
    657         $real_tax = $tax / 100; 
    658         $ret = $price * (1 + $real_tax); 
    659  
    660         switch($tax_rule) { 
    661         // 四捨五入 
    662         case 1: 
    663             $ret = round($ret); 
    664             break; 
    665         // 切り捨て 
    666         case 2: 
    667             $ret = floor($ret); 
    668             break; 
    669         // 切り上げ 
    670         case 3: 
    671             $ret = ceil($ret); 
    672             break; 
    673         // デフォルト:切り上げ 
    674         default: 
    675             $ret = ceil($ret); 
    676             break; 
    677         } 
    678         return $ret; 
     668    function sfPreTax($price, $tax = null, $tax_rule = null) { 
     669        return $price + SC_Utils_Ex::sfTax($price, $tax, $tax_rule); 
    679670    } 
    680671 
Note: See TracChangeset for help on using the changeset viewer.