Ejemplo n.º 1
0
        public PersonalIncomeTax this[AssessableIncome income]
        {
            get
            {
                var progressiveTaxRateContainsAssessableIncome = _progressiveTaxes
                                                                 .SingleOrDefault(p => p.HasAssessableIncomeWithinRange(income));

                if (progressiveTaxRateContainsAssessableIncome is null)
                {
                    return(new PersonalIncomeTax(Money.ZeroVND));
                }

                var pit = (income.Amount - progressiveTaxRateContainsAssessableIncome.LowerBound) *
                          progressiveTaxRateContainsAssessableIncome.Rate + _progressiveTaxes
                          .Where(_ => _.ProgressiveTaxRateLevel < progressiveTaxRateContainsAssessableIncome.ProgressiveTaxRateLevel)
                          .Select(p => p.MaxIncomeTaxPerLevel)
                          .Sum();
                return(new PersonalIncomeTax(pit.Round()));
            }
        }
Ejemplo n.º 2
0
 public bool HasAssessableIncomeWithinRange(AssessableIncome assessableIncome)
 {
     return(LowerBound <= assessableIncome.Amount && assessableIncome.Amount < UpperBound);
 }