CalculateHraExemption() public method

public CalculateHraExemption ( bool fromMetro, double rentPaid ) : double
fromMetro bool
rentPaid double
return double
Exemplo n.º 1
0
 public void ShouldCalculateHraExemption()
 {
     var taxPayer = new User(50000, true, Gender.Male);
     var annualSalary = new AnnualSalary
                            {
                                Basic = 100000,
                                Hra = 40000,
                                ProfessionalTax = 100,
                                SpecialAllowance = 10
                            };
     Assert.AreEqual(40000, annualSalary.CalculateHraExemption(taxPayer.FromMetro, taxPayer.RentPaid));
 }
Exemplo n.º 2
0
        private double CalculateGrossIncome(User taxPayer)
        {
            double retAmt = AnnualSalary.GetTaxableSalary();

            retAmt -= GetHousingLoanInterestAmount();

            if (OtherIncomes != null)
            {
                retAmt += OtherIncomes.CalculateTotalAmount();
            }


            retAmt -= (AnnualSalary.CalculateHraExemption(taxPayer.FromMetro, taxPayer.RentPaid) +
                       AnnualSalary.ProfessionalTax);

            retAmt -= DonationsUnder80G.GetDeduction();

            return(retAmt);
        }
Exemplo n.º 3
0
        public void MustCalculateNetPayableTaxWithAnnualSalaryOtherIncomesAndChapter6Investments()
        {
            var taxPayer = new User(50000, true, Gender.Female);
            TaxSlabs ts = TaxSlabs.GetInstance();
            AnnualSalary asal = new AnnualSalary
                                   {
                                       Basic = 800000.50,
                                       Hra = 1000,
                                       ProfessionalTax = 100,
                                       SpecialAllowance = 10
                                   };

            OtherIncomes otherIncomes = new OtherIncomes();
            otherIncomes.Add(new OtherIncomeItem("Income from Interest", 4000.0));
            otherIncomes.Add(new OtherIncomeItem("Income from House Rent", 8000.0));

            Chapter6Investments investments = new Chapter6Investments();
            investments.Add(new LifeInsurance(50000));
            investments.Add(new Elss(60000));

            TaxStatement stmt = new TaxStatement(asal,taxPayer);
            stmt.OtherIncomes = otherIncomes;
            stmt.Chapter6Investments = investments;

            double totalIncome = ((asal.GetTaxableSalary() + otherIncomes.CalculateTotalAmount())
                                  -
                                  (asal.CalculateHraExemption(taxPayer.FromMetro, taxPayer.RentPaid)));

            double totalInvestments = (asal.Epf + investments.GetTotal());

            totalIncome -= totalInvestments <= Chapter6Investments.Cap
                 ? totalInvestments
                 : Chapter6Investments.Cap;

            Assert.AreEqual(120473,
                stmt.CalculateNetPayableTax(),2);
        }
Exemplo n.º 4
0
 public void ShouldReturnRemtPaidAdjustedToBasicAsHraExemptionWhenItIsMinimumOfAllTaxComponents()
 {
     var taxPayer = new User(30000, true, Gender.Male);
     var annualSalary = new AnnualSalary
                            {
                                Basic = 100000,
                                Hra = 60000,
                                ProfessionalTax = 100,
                                SpecialAllowance = 10
                            };
     Assert.AreEqual(20000, annualSalary.CalculateHraExemption(taxPayer.FromMetro, taxPayer.RentPaid));
 }
Exemplo n.º 5
0
        public void ShouldReturnFortyPercentageOfBasicAsHraExemptionWhenItIsMinimumOfAllTaxComponentsAndPayerIsFromMetro()
        {
            var taxPayer = new User(65000, false, Gender.Male);
            var annualSalary = new AnnualSalary
                                   {
                                       Basic = 100000,
                                       Hra = 60000,
                                       ProfessionalTax = 100,
                                       SpecialAllowance = 10
                                   };

            Assert.AreEqual(40000, annualSalary.CalculateHraExemption(taxPayer.FromMetro, taxPayer.RentPaid));
        }
Exemplo n.º 6
0
 public void ShouldNotCalculateHraExemptionIfHraComponentIsNotAvailable()
 {
     var taxPayer = new User(30000, true, Gender.Male);
     var annualSalary = new AnnualSalary
                            {
                                Basic = 100000,
                                Hra = 0,
                                ProfessionalTax = 100,
                                SpecialAllowance = 10
                            };
     Assert.Throws<Exception>(() => annualSalary.CalculateHraExemption(taxPayer.FromMetro, taxPayer.RentPaid));
 }