public static EmployeeSalaryCalculationResultBuilder CalculateSocialInsurance(
     this EmployeeSalaryCalculationResultBuilder builder,
     EmployeeSocialInsuranceSetting setting)
 {
     return(builder
            .Calculate(() => builder.Result.RetirementInsurance = builder.SalaryGross.GetPercent(setting.RetirementInsurancePercent))
            .Calculate(() => builder.Result.DisabilityPensionInsurance = builder.SalaryGross.GetPercent(setting.DisabilityPensionInsurancePercent))
            .Calculate(() => builder.Result.SicknessInsurance = builder.SalaryGross.GetPercent(setting.SicknessInsurancePercent))
            .Calculate(() => builder.Result.TotalSocialInsurance = builder.SalaryGross.GetPercent(setting.TotalPercent)));
 }
예제 #2
0
        private static EmployeeSalaryCalculationResultBuilder CalculateCopyrightLawsDeductibles(
            this EmployeeSalaryCalculationResultBuilder builder,
            decimal salaryMinusSocial,
            float copyrightLawsPercent)
        {
            var copyrightLawsValue = salaryMinusSocial.GetPercent(copyrightLawsPercent);

            builder.Result.CopyrightLawsValue       = copyrightLawsValue;
            builder.Result.CopyrightLawsDeductibles = copyrightLawsValue.GetPercent(CopyrightLaws.DeductiblesPercent);

            return(builder);
        }
예제 #3
0
 public static EmployeeSalaryCalculationResultBuilder CalculateTax(
     this EmployeeSalaryCalculationResultBuilder builder,
     decimal taxBase,
     decimal taxMonthlyExemption,
     decimal healthInsuranceDeductibles)
 {
     return(builder
            .Calculate(() =>
                       builder.Result.Tax = Math.Round(Math.Max(0, CalculateTax(taxBase)) -
                                                       taxMonthlyExemption -
                                                       healthInsuranceDeductibles)));
 }
 public static EmployeeSalaryCalculationResultBuilder CalculateSalaryNett(
     this EmployeeSalaryCalculationResultBuilder builder,
     decimal tax,
     decimal totalSocialInsurance,
     decimal healthInsurance)
 {
     return(builder
            .Calculate(() => builder.Result.SalaryNett = Math.Round(builder.SalaryGross -
                                                                    tax -
                                                                    totalSocialInsurance -
                                                                    healthInsurance)));
 }
예제 #5
0
        public static EmployeeSalaryCalculationResultBuilder CalculateTaxBase(
            this EmployeeSalaryCalculationResultBuilder builder,
            float copyrightLawsPercent,
            decimal totalSocialInsurance,
            decimal employmentRelationshipDeductibles)
        {
            var salaryMinusSocial = builder.SalaryGross - totalSocialInsurance;

            return(builder
                   .CalculateCopyrightLawsDeductibles(salaryMinusSocial, copyrightLawsPercent)
                   .Calculate(() => builder.Result.TotalDeductibles = employmentRelationshipDeductibles +
                                                                      builder.Result.CopyrightLawsDeductibles +
                                                                      0) //todo: context.Parameters.DriveExpenses;
                   .Calculate(() =>
                              builder.Result.TaxBase = Math.Round(salaryMinusSocial - builder.Result.TotalDeductibles)));
        }
        public static EmployeeSalaryCalculationResultBuilder CalculateHealthInsurance(
            this EmployeeSalaryCalculationResultBuilder builder,
            decimal totalSocialInsurance,
            EmployeeHealthInsuranceSetting setting)
        {
            var salaryMinusSocial = builder.SalaryGross - totalSocialInsurance;

            return(builder
                   .Calculate(() =>
                              builder.Result.HealthInsurance = salaryMinusSocial.GetPercent(setting.HealthInsurancePercent))
                   .Calculate(() =>
                              builder.Result.HealthInsuranceDeductibles =
                                  Math.Round(salaryMinusSocial.GetPercent(setting.DeductibleHealthInsurancePercent)))
                   .Calculate(() =>
                              builder.Result.HealthInsurancePaidFromNett =
                                  builder.Result.HealthInsurance - builder.Result.HealthInsuranceDeductibles));
        }