TaxRuleService
Table of Contents
| $BaseInfo | BaseInfo | |
|---|---|---|
| $taxRuleRepository | TaxRuleRepository | |
| __construct() | mixed | |
| getTax() | 設定情報に基づいて税金の金額を返す | float | 
| getPriceIncTax() | calcIncTax | float | 
| calcTax() | 税金額を計算する | float | 
| calcTaxIncluded() | 税込金額から税金額を計算する | float | 
| roundByRoundingType() | 課税規則に応じて端数処理を行う | float | 
Properties
$BaseInfo
        protected
                BaseInfo
        $BaseInfo
            
            
$taxRuleRepository
        protected
                TaxRuleRepository
        $taxRuleRepository
            
            
Methods
__construct()
        public
                                __construct(
                    
                            $taxRuleRepository :
                TaxRuleRepository
                            
                    
            ,                 $baseInfoRepository :
                BaseInfoRepository
                            
                )
        : mixed
    
    
            Parameters
- $taxRuleRepository : TaxRuleRepository
 - $baseInfoRepository : BaseInfoRepository
 
Return values
mixedgetTax()
設定情報に基づいて税金の金額を返す
        public
                                getTax(
                    
                            $price :
                int
                            
                    
            [,                 $product :
                int|null|Product
                 = null ]            
                    
            [,                 $productClass :
                int|null|ProductClass
                 = null ]            
                    
            [,                 $pref :
                int|null|Pref
                 = null ]            
                    
            [,                 $country :
                int|null|Country
                 = null ]            
                )
        : float
    
    
            Parameters
- $price : int
 計算対象の金額
- $product : int|null|Product = null
 商品
- $productClass : int|null|ProductClass = null
 商品規格
- $pref : int|null|Pref = null
 都道府県
- $country : int|null|Country = null
 国
Return values
float —税金付与した金額
getPriceIncTax()
calcIncTax
        public
                                getPriceIncTax(
                    
                            $price :
                int
                            
                    
            [,                 $product :
                int|null|Product
                 = null ]            
                    
            [,                 $productClass :
                int|null|ProductClass
                 = null ]            
                    
            [,                 $pref :
                int|null|Pref
                 = null ]            
                    
            [,                 $country :
                int|null|Country
                 = null ]            
                )
        : float
    
    
            Parameters
- $price : int
 計算対象の金額
- $product : int|null|Product = null
 商品
- $productClass : int|null|ProductClass = null
 商品規格
- $pref : int|null|Pref = null
 都道府県
- $country : int|null|Country = null
 国
Return values
floatcalcTax()
税金額を計算する
        public
                                calcTax(
                    
                            $price :
                int
                            
                    
            ,                 $taxRate :
                int
                            
                    
            ,                 $RoundingType :
                int
                            
                    
            ,                 $taxAdjust :
                int
                            
                )
        : float
    
    
            Parameters
- $price : int
 計算対象の金額
- $taxRate : int
 税率(%単位)
- $RoundingType : int
 端数処理
- $taxAdjust : int
 調整額
Return values
float —税金額
calcTaxIncluded()
税込金額から税金額を計算する
        public
                                calcTaxIncluded(
                    
                            $price :
                int
                            
                    
            ,                 $taxRate :
                int
                            
                    
            ,                 $RoundingType :
                int
                            
                    
            ,                 $taxAdjust :
                int
                            
                )
        : float
    
    
            Parameters
- $price : int
 計算対象の金額
- $taxRate : int
 税率(%単位)
- $RoundingType : int
 端数処理
- $taxAdjust : int
 調整額
Return values
float —税金額
roundByRoundingType()
課税規則に応じて端数処理を行う
        public
                                roundByRoundingType(
                    
                            $value :
                int
                            
                    
            ,                 $RoundingType :
                int
                            
                )
        : float
    
    
            Parameters
- $value : int
 端数処理を行う数値
- $RoundingType : int
 
Return values
float —端数処理後の数値