Beispiel #1
0
 public static EmployerUnemploymentInsurance CalculateEmployerUnemploymentInsurance(
     SalaryConfig salaryConfig,
     EmployeeMonthlyRecord employeeMonthlyRecord,
     InsuranceSalary insuranceSalary)
 {
     return(new EmployerUnemploymentInsurance(Calculate(
                                                  employeeMonthlyRecord: employeeMonthlyRecord,
                                                  minimumWage: salaryConfig.RegionalMinimumWage,
                                                  coefficientSocialCare: salaryConfig.CoefficientSocialCare,
                                                  rateOfDeductionOfCompulsoryInsurance: employeeMonthlyRecord.IsForeigner
                                 ? salaryConfig.ForeignEmployerUnemploymentInsuranceRate : salaryConfig.EmployerUnemploymentInsuranceRate,
                                                  amount: insuranceSalary.Amount)));
 }
Beispiel #2
0
        public static InsuranceSalary CalculateInsuranceSalary(
            SalaryConfig salaryConfig,
            EmployeeMonthlyRecord employeeMonthlyRecord)
        {
            var insurancePaidAmount = salaryConfig.IsInsurancePaidFullSalary
                                ? employeeMonthlyRecord.GrossContractedSalary.Amount
                                : salaryConfig.InsurancePaidAmount;

            var actualPaidAmount = employeeMonthlyRecord.IsEligibleForSocialInsurance() || employeeMonthlyRecord.IsOnProbation()
                                ? insurancePaidAmount
                                : Money.ZeroVND;

            return(new InsuranceSalary(actualPaidAmount));
        }
Beispiel #3
0
        public static EmployerUnionFee CalculateEmployerUnionFee(
            SalaryConfig salaryConfig,
            EmployeeMonthlyRecord employeeMonthlyRecord,
            InsuranceSalary insuranceSalary)
        {
            var unionEmployerRate = employeeMonthlyRecord.InUnion
                                ? salaryConfig.EmployerUnionFeeRate - salaryConfig.EmployeeUnionFeeRate
                                : salaryConfig.EmployerUnionFeeRate;

            return(new EmployerUnionFee(Calculate(
                                            employeeMonthlyRecord: employeeMonthlyRecord,
                                            minimumWage: salaryConfig.CommonMinimumWage,
                                            coefficientSocialCare: salaryConfig.CoefficientSocialCare,
                                            rateOfDeductionOfCompulsoryInsurance: unionEmployerRate,
                                            amount: insuranceSalary.Amount)));
        }
Beispiel #4
0
        public static EmployeeUnionFee CalculateEmployeeUnionFee(
            SalaryConfig salaryConfig,
            EmployeeMonthlyRecord employeeMonthlyRecord,
            InsuranceSalary insuranceSalary)
        {
            if (employeeMonthlyRecord.InUnion is false)
            {
                return(new EmployeeUnionFee(Money.ZeroVND));
            }

            return(new EmployeeUnionFee(Calculate(
                                            employeeMonthlyRecord: employeeMonthlyRecord,
                                            minimumWage: salaryConfig.CommonMinimumWage,
                                            coefficientSocialCare: salaryConfig.MaximumUnionFeeRate,
                                            rateOfDeductionOfCompulsoryInsurance: 1m,
                                            amount: Calculate(
                                                employeeMonthlyRecord,
                                                salaryConfig.CommonMinimumWage,
                                                salaryConfig.CoefficientSocialCare,
                                                salaryConfig.EmployeeUnionFeeRate,
                                                insuranceSalary.Amount))));
        }