Пример #1
0
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="salary">税前工资</param>
        /// <param name="sb">社保比例类</param>
        /// <param name="yearbonus">年终奖</param>
        public Person(decimal salary, SBRate sb, decimal yearbonus = 0)
        {
            var sc = new SalaryCalculator(salary, sb);

            SBJS          = sc.SBJS;
            GJJJS         = sc.GJJJS;
            PerYL         = sc.GetPerYL();
            PerYiL        = sc.GetPerYiL();
            PerSY         = sc.GetPerSY();
            PerShiYe      = sc.GetPerShiYe();
            PerGS         = sc.GetPerGS();
            PerGJJ        = sc.GetPerGJJ();
            ComGJJ        = sc.GetComGJJ();
            ComGS         = sc.GetComGS();
            ComShiYe      = sc.GetComShiYe();
            ComSY         = sc.GetComSY();
            ComYiL        = sc.GetComYiL();
            ComYL         = sc.GetComYL();
            PerSum        = PerYL + PerYiL + PerSY + PerShiYe + PerGS + PerGJJ;
            ComSum        = ComYL + ComYiL + ComSY + ComShiYe + ComGS + ComGJJ;
            ComTotal      = ComSum + salary;
            TaxableAmount = salary - PerSum - 3500;
            if (TaxableAmount < 0)
            {
                TaxableAmount = 0;
            }
            PerTax         = TaxableAmount > 0 ? sc.GetPerTax(TaxableAmount) : 0;
            SalaryAfterTax = salary - PerSum - PerTax;
        }
Пример #2
0
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="salary">税前工资</param>
        /// <param name="sb">社保比例类</param>
        /// <param name="yearbonus">年终奖</param>
        public Person(decimal salary, SBRate sb, decimal yearbonus = 0)
        {
            var sc = new SalaryCalculator(salary, sb);

            _sbjs          = sc.SBJS;
            _gjjjs         = sc.GJJJS;
            _perYL         = sc.GetPerYL();
            _perYiL        = sc.GetPerYiL();
            _perSY         = sc.GetPerSY();
            _perShiYe      = sc.GetPerShiYe();
            _perGS         = sc.GetPerGS();
            _perGJJ        = sc.GetPerGJJ();
            _comGJJ        = sc.GetComGJJ();
            _comGS         = sc.GetComGS();
            _comShiYe      = sc.GetComShiYe();
            _comSY         = sc.GetComSY();
            _comYiL        = sc.GetComYiL();
            _comYL         = sc.GetComYL();
            _perSum        = _perYL + _perYiL + _perSY + _perShiYe + _perGS + _perGJJ;
            _comSum        = _comYL + _comYiL + _comSY + _comShiYe + _comGS + _comGJJ;
            _comTotal      = _comSum + salary;
            _taxableAmount = salary - _perSum - 3500;
            if (_taxableAmount < 0)
            {
                _taxableAmount = 0;
            }
            _perTax         = _taxableAmount > 0 ? sc.GetPerTax(_taxableAmount) : 0;
            _salaryAfterTax = salary - _perSum - _perTax;
        }