- Timestamp:
- 2013/08/24 23:33:52 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_13-dev/data/class/helper/SC_Helper_TaxRule.php
r23088 r23124 34 34 * 設定情報に基づいて税金付与した金額を返す 35 35 * 36 * @param integer $price 計算対象の金額36 * @param integer $price 計算対象の金額 37 37 * @return integer 税金付与した金額 38 38 */ 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) 40 40 { 41 41 return $price + SC_Helper_TaxRule_Ex::sfTax($price, $product_id, $product_class_id, $pref_id, $country_id); … … 45 45 * 設定情報に基づいて税金の金額を返す 46 46 * 47 * @param integer $price 計算対象の金額47 * @param integer $price 計算対象の金額 48 48 * @return integer 税金した金額 49 49 */ 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) 51 51 { 52 52 $arrTaxRule = SC_Helper_TaxRule_Ex::getTaxRule($product_id, $product_class_id, $pref_id, $country_id); … … 59 59 * (受注データのようにルールが決まっている場合用) 60 60 * 61 * @param integer $price 計算対象の金額61 * @param integer $price 計算対象の金額 62 62 * @return integer 税金付与した金額 63 63 */ 64 function calcIncTaxFromRuleId($price, $tax_rule_id = 0)64 public function calcIncTaxFromRuleId($price, $tax_rule_id = 0) 65 65 { 66 66 return $price + SC_Helper_TaxRule_Ex::calcTaxFromRuleId($price, $tax_rule_id); … … 71 71 * (受注データのようにルールが決まっている場合用) 72 72 * 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 * 73 86 * @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 税率(%単位) 88 88 * XXX integer のみか不明 89 * @param integer $tax_rule 端数処理89 * @param integer $tax_rule 端数処理 90 90 * @return integer 税金額 91 91 */ 92 function calcTax ($price, $tax, $calc_rule, $tax_adjust = 0)92 public function calcTax ($price, $tax, $calc_rule, $tax_adjust = 0) 93 93 { 94 94 $real_tax = $tax / 100; … … 119 119 * 現在有効な税金設定情報を返す 120 120 * 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) 125 125 { 126 126 // 初期化 … … 214 214 * 税金設定情報を登録する(商品管理用) 215 215 * 216 * @param decimal $tax_rate消費税率217 * @param integer $product_id商品ID218 * @param integer $product_class_id 商品規格ID219 * @param decimal $tax_adjust消費税加算額220 * @param integer $pref_id県ID221 * @param integer $country_id国ID216 * @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 222 222 * @return void 223 223 */ 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) 225 225 { 226 226 // 基本設定を取得 … … 228 228 229 229 // 基本設定の消費税率と一緒であれば設定しない 230 if ( $arrRet['tax_rate'] != $tax_rate) {230 if ($arrRet['tax_rate'] != $tax_rate) { 231 231 // 課税規則は基本設定のものを使用 232 232 $calc_rule = $arrRet['calc_rule']; … … 244 244 * @return 245 245 */ 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) 247 247 { 248 248 $table = 'dtb_tax_rule'; … … 257 257 // 新規か更新か? 258 258 $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) { 260 260 $where = 'product_id = ? AND product_class_id= ? AND pref_id = ? AND country_id = ?'; 261 261 $arrVal = array($product_id, $product_class_id, $pref_id, $country_id); … … 264 264 } 265 265 266 if ($tax_rule_id == NULL) {266 if ($tax_rule_id == NULL) { 267 267 // 税情報を新規 268 268 // INSERTの実行 … … 282 282 } 283 283 284 function getTaxRuleList($has_deleted = false)284 public function getTaxRuleList($has_deleted = false) 285 285 { 286 286 $objQuery =& SC_Query_Ex::getSingletonInstance(); … … 298 298 } 299 299 300 function getTaxRuleData($tax_rule_id, $has_deleted = false)300 public function getTaxRuleData($tax_rule_id, $has_deleted = false) 301 301 { 302 302 $objQuery =& SC_Query_Ex::getSingletonInstance(); … … 309 309 } 310 310 311 function getTaxRuleByTime($apply_date, $has_deleted = false)311 public function getTaxRuleByTime($apply_date, $has_deleted = false) 312 312 { 313 313 $objQuery =& SC_Query_Ex::getSingletonInstance(); … … 324 324 * 税規約の削除. 325 325 * 326 * @param integer $tax_rule_id 税規約ID326 * @param integer $tax_rule_id 税規約ID 327 327 * @return void 328 328 */ 329 function deleteTaxRuleData($tax_rule_id)329 public function deleteTaxRuleData($tax_rule_id) 330 330 { 331 331 $objQuery =& SC_Query_Ex::getSingletonInstance();
Note: See TracChangeset
for help on using the changeset viewer.