1 | <?php |
||
18 | class TaxRuleService |
||
|
|||
19 | { |
||
20 | /** |
||
21 | * @var TaxRuleRepository |
||
22 | */ |
||
23 | protected $taxRuleRepository; |
||
24 | |||
25 | 469 | public function __construct(TaxRuleRepository $taxRuleRepository) |
|
29 | |||
30 | /** |
||
31 | * 設定情報に基づいて税金の金額を返す |
||
32 | * |
||
33 | * @param int $price 計算対象の金額 |
||
34 | * @param int|null|\Eccube\Entity\Product $product 商品 |
||
35 | * @param int|null|\Eccube\Entity\ProductClass $productClass 商品規格 |
||
36 | * @param int|null|\Eccube\Entity\Master\Pref $pref 都道府県 |
||
37 | * @param int|null|\Eccube\Entity\Master\Country $country 国 |
||
38 | * |
||
39 | * @return double 税金付与した金額 |
||
40 | */ |
||
41 | 463 | public function getTax($price, $product = null, $productClass = null, $pref = null, $country = null) |
|
48 | |||
49 | /** |
||
50 | * calcIncTax |
||
51 | * |
||
52 | * @param int $price 計算対象の金額 |
||
53 | * @param int|null|\Eccube\Entity\Product $product 商品 |
||
54 | * @param int|null|\Eccube\Entity\ProductClass $productClass 商品規格 |
||
55 | * @param int|null|\Eccube\Entity\Master\Pref $pref 都道府県 |
||
56 | * @param int|null|\Eccube\Entity\Master\Country $country 国 |
||
57 | * |
||
58 | * @return int |
||
59 | */ |
||
60 | 462 | public function getPriceIncTax($price, $product = null, $productClass = null, $pref = null, $country = null) |
|
64 | |||
65 | /** |
||
66 | * 税金額を計算する |
||
67 | * |
||
68 | * @param int $price 計算対象の金額 |
||
69 | * @param int $taxRate 税率(%単位) |
||
70 | * @param int $RoundingType 端数処理 |
||
71 | * @param int $taxAdjust 調整額 |
||
72 | * |
||
73 | * @return double 税金額 |
||
74 | */ |
||
75 | 465 | public function calcTax($price, $taxRate, $RoundingType, $taxAdjust = 0) |
|
82 | |||
83 | /** |
||
84 | * 税込金額から税金額を計算する |
||
85 | * |
||
86 | * @param int $price 計算対象の金額 |
||
87 | * @param int $taxRate 税率(%単位) |
||
88 | * @param int $RoundingType 端数処理 |
||
89 | * @param int $taxAdjust 調整額 |
||
90 | * |
||
91 | * @return float 税金額 |
||
92 | */ |
||
93 | 203 | public function calcTaxIncluded($price, $taxRate, $RoundingType, $taxAdjust = 0) |
|
99 | |||
100 | /** |
||
101 | * 課税規則に応じて端数処理を行う |
||
102 | * |
||
103 | * @param float|integer $value 端数処理を行う数値 |
||
104 | * @param integer $calcRule 課税規則 |
||
105 | * |
||
106 | * @return double 端数処理後の数値 |
||
107 | */ |
||
108 | 469 | public function roundByRoundingType($value, $RoundingType) |
|
131 | } |
||
132 |