예제 #1
0
        static void Main(string[] args)
        {
            cl.Person pers = new cl.Person();
            cl.StaticMethod.GetInfo(out pers);
            Console.WriteLine("Задание 1\nName: " + pers.Name + "\nSurname: " + pers.Surname + "\nAge: " + pers.Age + "\n\n");

            cl.Constants con = new cl.Constants();
            Console.WriteLine("Задание 2\nName: " + con.Name + "\nSurname: " + con.Surname + "\nAge: " + con.Age + "\nWeight: " + con.Weight + "\n\n");
        }
예제 #2
0
		private void AddTaxes(Millicents GrossForFICA, Millicents GrossForFed, Millicents GrossForState, Millicents GrossForLocal, Income income, Person person)
		{
			person.UpdateIncomeTaxStatusByDate(0/*JulianDay*/);
			IncomeTaxStatus status = person.IncomeTaxStatus;
			TaxTable federal = TaxTable.CreateFederal(status);
			TaxTable state = TaxTable.CreateState(status, person.Location);
			TaxTable local = TaxTable.CreateLocal(status, person.Location);

			double AnnualPayPeriods = income.Frequency.ToAnnualPeriods();

			// FICA
			double GrossFICA = GrossForFICA.ToDouble();
			double SocSecWages = Math.Min(GrossFICA, Math.Max(TaxTable.MaxSocSecWages - GrossFICA, 0));
			double SocSec = Math.Round(SocSecWages * TaxTable.SocSecPercent, 2);
			double Medicare = Math.Round(GrossFICA * TaxTable.MedicarePercent, 2);

			// Federal
			double FederalGross = GrossForFed.ToDouble() * AnnualPayPeriods;
			double FederalExemptions = federal.Exemptions(status.FederalExemptions);
			double FederalTaxableGross = Math.Max(FederalGross - FederalExemptions, 0);
			double FederalTaxTotal = Math.Round(federal.Compute(FederalTaxableGross), 2);
			double FederalTax = Math.Round(FederalTaxTotal / AnnualPayPeriods, 2);

			// State
			double StateGross = GrossForState.ToDouble() * AnnualPayPeriods;
			double StateExemptions = state.Exemptions(status.StateLocalExemptions);
			double StateTaxableGross = Math.Max(StateGross - StateExemptions, 0);
			double StateTaxTotal = Math.Round(state.Compute(StateTaxableGross), 2);
			double StateTax = Math.Round(StateTaxTotal / AnnualPayPeriods, 2);

			// Local
			double LocalGross = GrossForLocal.ToDouble() * AnnualPayPeriods;
			double LocalExemptions = local.Exemptions(status.StateLocalExemptions);
			double LocalTaxableGross = Math.Max(LocalGross - LocalExemptions, 0);
			double LocalTaxTotal = Math.Round(local.Compute(LocalTaxableGross), 2);
			double LocalTax = Math.Round(LocalTaxTotal / AnnualPayPeriods, 2);

			// Other calculations
			//double NetPay = GrossFed - SocSec - Medicare - FedTax - StateTax;
			//double AvgTaxRate = (SocSec + Medicare + FedTax + StateTax) / GrossFed;
			//double CompanyPayrollTaxes = FedTax + (2*SocSec )+ (2*Medicare);
			//double CompanyLiability = GrossFed + SocSec + Medicare;

			// If the income is not exempt, add the tax transactions
			if (!income.TaxExempt.FICA && SocSec != 0)
				income.Transactions.Add(NewTaxTransaction("Tax: SS", SocSec.ToMillicents(), income.Frequency, income.TargetAccount));
			if (!income.TaxExempt.FICA && Medicare != 0)
				income.Transactions.Add(NewTaxTransaction("Tax: Medicare", Medicare.ToMillicents(), income.Frequency, income.TargetAccount));
			if (!income.TaxExempt.Federal && FederalTax != 0)
				income.Transactions.Add(NewTaxTransaction("Tax: Federal", FederalTax.ToMillicents(), income.Frequency, income.TargetAccount));
			if (!income.TaxExempt.State && StateTax != 0)
				income.Transactions.Add(NewTaxTransaction("Tax: State", StateTax.ToMillicents(), income.Frequency, income.TargetAccount));
			if (!income.TaxExempt.Local && LocalTax != 0)
				income.Transactions.Add(NewTaxTransaction("Tax: Local", LocalTax.ToMillicents(), income.Frequency, income.TargetAccount));
		}
예제 #3
0
		internal static void AddTaxTransactions(Millicents GrossForFICA, Millicents GrossForFed, Millicents GrossForState, Millicents GrossForLocal, Income income, Person person)
		{
			Tax tax = new Tax();
			tax.AddTaxes(GrossForFICA, GrossForFed, GrossForState, GrossForLocal, income, person);
		}