新个税计算⽅法程序源码using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace TaxCalcer {
public partial class Form1 : Form {
public Form1() {
InitializeComponent();
}
private static decimal[] TaxRate = { 0.03m, 0.1m, 0.2m, 0.25m, 0.3m, 0.35m, 0.45m };
private void btn_Calc_Click(object nder, EventArgs e) {
var year = new PersonYear();
decimal fang = 0;
if (rb_fang1000.Checked)
fang = 1000;
el if (rb_fang1500.Checked)
fang = 1500;
var personData = new PersonMonthProfileData() {
⽉薪 = num_Salar.Value,
社保 = num_Shebao.Value,
公积⾦ = num_gjj.Value,
⼦⼥教育 = num_Edu.Value,
赡养⽼⼈ = num_Parents.Value,
⼤病医疗 = num_Bing.Value,
房住租贷 = fang,
继续教育 = num_AdvEdu.Value,
};
year.SetValues(personData);
lv_MonthData.BeginUpdate();
lv_MonthData.Items.Clear();
for (int i = 0; i < year.Months.Count; i++) {
var m = year.Months[i];
var item = new ListViewItem(new string[]
{
(m.Month+1).ToString(),
m.MonthData.⽉薪.ToString(),
m.MonthData.社保.ToString(),
m.MonthData.公积⾦.ToString(),
m.MonthData.六项减免总数().ToString(),
植物之歌m.⽉应纳税所得额.ToString(),
$"{TaxRate[m.TaxIndex]:P1}",
m.Tax.ToString(),
m.结余().ToString()
});
item.Tag = m;
lv_MonthData.Items.Add(item);
}
lv_MonthData.EndUpdate();
vc_1.Value = year.总收⼊.ToString();
vc_2.Value = year.总社保.ToString();
vc_3.Value = year.总公积⾦.ToString();
vc_4.Value = year.总交税.ToString();
vc_5.Value = year.总结余.ToString();
}
}
internal class PersonYear {
private readonly List<PersonMonth> _months = new List<PersonMonth>();
public List<PersonMonth> Months => _months;
public decimal 总收⼊ { get; t; }
public decimal 总社保 { get; t; }
public decimal 总公积⾦ { get; t; }
public decimal 总交税 { get; t; }
public decimal 总结余 { get; t; }
public PersonYear() {
}
public void SetValues(PersonMonthProfileData data) {
_months.Clear();
decimal 累计收⼊ = 0;
decimal 累计减除费⽤ = 0; //按照个税起征点5000元/⽉
decimal 累计五险⼀⾦ = 0;
decimal 累计六项减免 = 0;
decimal 已预缴预扣税额 = 0;
for (var i = 0; i < 12; i++) {
一知半解的反义词
var month = new PersonMonth() {
Month = i,
MonthData = data.Clone(),
};
//if (i == 1)
// month.MonthData.⽉薪 = 45000;
累计收⼊ += month.MonthData.⽉薪;
累计减除费⽤ += 5000;
累计五险⼀⾦ += month.MonthData.五险⼀⾦总额();
累计六项减免 += month.MonthData.六项减免总数();
var ⽉应纳税所得额 = 累计收⼊ - 累计减除费⽤ - 累计五险⼀⾦ - 累计六项减免; if (⽉应纳税所得额 < 0)
⽉应纳税所得额 = 0;
month.⽉应纳税所得额 = ⽉应纳税所得额;
decimal tax = 0;
int idx = 0;
if (⽉应纳税所得额 <= 36000) {
tax = ⽉应纳税所得额 * 0.03m;
稻香村糕点}
el if (⽉应纳税所得额 > 36000 && ⽉应纳税所得额 <= 144000) {
tax = ⽉应纳税所得额 * 0.1m - 2520;
idx = 1;
}
el if (⽉应纳税所得额 > 144000 && ⽉应纳税所得额 <= 300000) {
tax = ⽉应纳税所得额 * 0.2m - 16920;
idx = 2;
}
el if (⽉应纳税所得额 > 300000 && ⽉应纳税所得额 <= 420000) {
tax = ⽉应纳税所得额 * 0.25m - 31920;
idx = 3;
}
el if (⽉应纳税所得额 > 420000 && ⽉应纳税所得额 <= 660000) {
tax = ⽉应纳税所得额 * 0.30m - 52920;
idx = 4;
}
el if (⽉应纳税所得额 > 660000 && ⽉应纳税所得额 <= 960000) {
tax = ⽉应纳税所得额 * 0.35m - 85920;
idx = 5;
}
el if (⽉应纳税所得额 > 960000) {
tax = ⽉应纳税所得额 * 0.45m - 181920;
idx = 6;
}
month.Tax = tax - 已预缴预扣税额;
month.TaxIndex = idx;
已预缴预扣税额 += month.Tax;
_months.Add(month);
}
总收⼊ = 累计收⼊;
总社保 = _months.Sum(a => a.MonthData.社保);
总公积⾦ = _months.Sum(a => a.MonthData.公积⾦);
总交税 = _months.Sum(a => a.Tax);
总结余 = _months.Sum(a => a.结余());
}
}
internal class PersonMonth {
public PersonMonthProfileData MonthData { get; t; }
public int Month { get; t; }
public decimal Tax { get; t; }
public decimal ⽉应纳税所得额 { get; t; }
/// <summary>
/// 适⽤税率⽅式
/// </summary>
public int TaxIndex { get; t; }
public decimal 结余() {
return MonthData.⽉薪 - MonthData.五险⼀⾦总额() - Tax;
}
}
internal class PersonMonthProfileData {
public decimal ⽉薪 { get; t; }
public decimal 社保 { get; t; }
public decimal 公积⾦ { get; t; }
public decimal ⼦⼥教育 { get; t; }
public decimal 赡养⽼⼈ { get; t; }
public decimal 房住租贷 { get; t; }
public decimal 继续教育 { get; t; }
public decimal ⼤病医疗 { get; t; }
public decimal 五险⼀⾦总额() {
return 社保 + 公积⾦;刺五加皮
}
public decimal 六项减免总数() {
return ⼦⼥教育 + 赡养⽼⼈ + 房住租贷 + 继续教育 + ⼤病医疗;
}
public PersonMonthProfileData Clone() {
var rez = new PersonMonthProfileData() {
公积⾦ = 公积⾦,
⼤病医疗 = ⼤病医疗,
⼦⼥教育 = ⼦⼥教育,
房住租贷 = 房住租贷,
⽉薪 = ⽉薪,
社保 = 社保,
继续教育 = 继续教育,
赡养⽼⼈ = 赡养⽼⼈
};
return rez;
}
}
}
namespace TaxCalcer {
partial class Form1 {
/
// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使⽤的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 fal。</param> protected override void Dispo(bool disposing) {
if (disposing && (components != null)) {
components.Dispo();
}
ba.Dispo(disposing);
}
#region Windows 窗体设计器⽣成的代码
/// <summary>
/// 设计器⽀持所需的⽅法 - 不要修改
/// 使⽤代码编辑器修改此⽅法的内容。
/// </summary>
private void InitializeComponent() {
this.label1 = new System.Windows.Forms.Label();
this.num_Salar = new System.Windows.Forms.NumericUpDown();
this.num_Shebao = new System.Windows.Forms.NumericUpDown();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.num_gjj = new System.Windows.Forms.NumericUpDown();
this.radioButton3 = new System.Windows.Forms.RadioButton();
this.rb_fang1000 = new System.Windows.Forms.RadioButton();
this.rb_fang1500 = new System.Windows.Forms.RadioButton();
this.num_Bing = new System.Windows.Forms.NumericUpDown();
this.label9 = new System.Windows.Forms.Label();
this.label7 = new System.Windows.Forms.Label();
this.num_Edu = new System.Windows.Forms.NumericUpDown();
this.num_AdvEdu = new System.Windows.Forms.NumericUpDown();
this.label4 = new System.Windows.Forms.Label();
this.label6 = new System.Windows.Forms.Label();
this.num_Parents = new System.Windows.Forms.NumericUpDown();
this.label5 = new System.Windows.Forms.Label();
this.lv_MonthData = new System.Windows.Forms.ListView();
this.label8 = new System.Windows.Forms.Label();
this.btn_Calc = new System.Windows.Forms.Button();
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.vc_1 = new TaxCalcer.ValueBlock();
this.vc_2 = new TaxCalcer.ValueBlock();
this.vc_3 = new TaxCalcer.ValueBlock();
this.vc_4 = new TaxCalcer.ValueBlock();
this.vc_5 = new TaxCalcer.ValueBlock();
((System.ComponentModel.ISupportInitialize)(this.num_Salar)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.num_Shebao)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.num_gjj)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.num_Bing)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.num_Edu)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.num_AdvEdu)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.num_Parents)).BeginInit();
this.tableLayoutPanel1.SuspendLayout();
this.SuspendLayout();
//
/
/ label1
//
this.label1.AutoSize = true;
this.label1.Font = new System.Drawing.Font("微软雅⿊", 12.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label1.Location = new System.Drawing.Point(47, 26);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(44, 23);
多媒体课件制作this.label1.TabIndex = 1;
this.label1.Text = "⽉薪";
//
// num_Salar
//
this.num_Salar.Font = new System.Drawing.Font("微软雅⿊", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.num_Salar.Location = new System.Drawing.Point(103, 24);rh阳性是什么意思
this.num_Salar.Maximum = new decimal(new int[] {
9999999,
0,
0,
0});
this.num_Salar.Name = "num_Salar";
this.num_Salar.Size = new System.Drawing.Size(151, 33);
this.num_Salar.TabIndex = 0;
this.num_Salar.Value = new decimal(new int[] {
15000,
0,
0,
0});
//
// num_Shebao
//
this.num_Shebao.Font = new System.Drawing.Font("微软雅⿊", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.num_Shebao.Location = new System.Drawing.Point(103, 24);
this.num_Shebao.Maximum = new decimal(new int[] {
9999999,
0,
0,
警世名言
0});
this.num_Shebao.Name = "num_Shebao";
this.num_Shebao.Size = new System.Drawing.Size(151, 33);
this.num_Shebao.TabIndex = 1;
this.num_Shebao.Value = new decimal(new int[] {
1000,
0,
0,
0});
//
// label2
//
this.label2.AutoSize = true;
this.label2.Font = new System.Drawing.Font("微软雅⿊", 12.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label2.Location = new System.Drawing.Point(47, 26);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(44, 23);
this.label2.TabIndex = 1;求职范文
this.label2.Text = "社保";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Font = new System.Drawing.Font("微软雅⿊", 12.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label3.Location = new System.Drawing.Point(28, 76);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(61, 23);
this.label3.TabIndex = 1;
this.label3.Text = "公积⾦";
//
// num_gjj
//
this.num_gjj.Font = new System.Drawing.Font("微软雅⿊", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.num_gjj.Location = new System.Drawing.Point(103, 74);
this.num_gjj.Maximum = new decimal(new int[] {
9999999,
0,
0,
0});
this.num_gjj.Name = "num_gjj";
this.num_gjj.Size = new System.Drawing.Size(151, 33);
this.num_gjj.TabIndex = 2;
this.num_gjj.Value = new decimal(new int[] {
1000,
0,
0,
0});
//
// groupBox1
//
//
// groupBox2
//