月工资计税办法
应纳税额 = 月工资应纳税所得额×适用税率-速算扣除数
月工资应纳税所得额 = 计税月工资额 - 3500
注: 3500 为个人所得税起征点,即税法规定的费用扣除额。
1.2、年终奖综合计税(不拆分、拆分一月、拆两月份)
2、开发平台与技术
技术架构:SpringMVC+Hibernate++MySql+jQuery+BootStrap+css+js+jsp
开发平台:Eclipse、Tomcat7、JDK1.7
3、项目设计
3.1、模型设计
国家税率标准的展现存表(income_tax_rate),对应的实体类:com.tax.entity.TaxRate
income_tax_rate结构如下:
id | int | ID(主键,自增长类型) |
title | varchar | 标题 |
floorAmount | decimal | 下限 |
upperAmount | decimal | 上限 |
tax_rate | decimal | 税率 |
deduction | int | 速算扣除数 |
createtime | datetime | 创立时间 |
isdelete | int | 能否删除:0、是;1、否 |
state | int | 状态:0、屏蔽;1、激活 |
对查询计算结果的保存记录表(tax_query_record),对应的实体类:com.tax.entity.Record
tax_query_record表结构如下:
id | int | ID(主键,自增长类型) |
category_code | int | 类别编码:1、月工资;2、年终奖 |
category_name | varchar | 类别名称 |
yearBonusAmount | decimal | 年终奖金额 |
split_type | varchar | 年终奖拆分方式 |
amount | decimal | 税前月工资速 |
rate | decimal | 执行税率 |
deduction_amount | decimal | 扣除数 |
amount_tax | decimal | 税后金额 |
note | varchar | 备注 |
createtime | datetime | 创立时间 |
ip | varchar | 请求用户端IP地址 |
为了方便捕捉异常发生的接口以及起因类型等信息,创立一个异常记录表errorreport,程序抛异常时记录到数据库中,抛异常的起因可能是程序不健壮,方便开发者维护优化。对应的实体类:com.tax.entity.ErrorReport
Errorreport表结构如下:
id | int | ID(主键,自增长类型) |
actionurl | varchar | 异常路径 |
request_method | varchar | 请求方式(post或者get) |
cdate | datetime | 异常产生时间 |
descp | varchar | 形容 |
ip | varchar | 请求用户端IP地址 |
3.2、项目相关调用
1、项目启动后,首先请求"/",进入页面\WebContent\WEB-INF\views\tax.jsp页面。
页面加载时以post方式请求右侧国家税率标准表
接口 | http://localhost:8080/taxDemo/searchTaxRate |
请求方式 | POST |
请求参数 | pageNumber Integer 页码(第1页) pageSize Integer 每页显示条数(这里定义最多显示100条) |
返回数据 (GSON) | { |
2、选择项目,填入税前工资,前台会对输入数值进行验证,
金额输入验证用到两个正则表达式
var reg = /^[0]{1}[.]{1}[0-9]{1,2}$/; /*0开头的数字串*/
var reg = /^[1-9]{1}[0-9]{0,10}[.]{0,1}[0-9]{0,2}$/; /*非0开头的数字*/
若输入非金额类型会自动清空
点击计算,请求必要输入的金额进行非空验证,金额格式验证,验证通过post方式请求后端接口进行计算
接口 | http://localhost:8080/taxDemo/calculation |
请求方式 | POST |
请求参数 | category Integer 项目分类:1、月工资;2、年终奖 amount BigDecimal 税前工资 yearBonusAmount BigDecimal 年终奖金额 spiltType Integer 年终奖拆分方式:1、不拆分;2、拆分一月; 3、拆两月分 |
返回数据 (GSON) 样例 |
1、月工资计税返回样例(记录存库并返回) { "amount": 5000, "amountTax": 4955, "categoryCode": 1, "categoryName": "月工资", "createtime": "2017-05-22", "deductionAmount": 45, "id": 129, "ip": "192.168.169.1", "monthAmount": 1500, "note": "", "rate": 0.03, "splitType": "", "taxRateStr": "3%", "yearBonusAmount": 0 }
2、年终奖计税返回样例(记录存库并返回) { "amount": 5000, "amountTax": 45105, "categoryCode": 2, "categoryName": "年终奖", "createtime": "2017-05-22", "deductionAmount": 4895, "id": 130, "ip": "192.168.169.1", "monthAmount": 0, "note": "", "rate": 0, "splitType": "不拆分", "taxRateStr": "不计税", "yearBonusAmount": 50000 } |
项目结构设计
启动项目,浏览器地址栏里输入:http://localhost:8080/taxDemo
1、月工资计税截图展现
点击计算后
2、年终奖计税截图展现
3、提醒
lib.rar并解压,将jar文件放到项目的lib目录下
温馨提醒:
1、因为源码商品属于可复制性产品,发货后禁止买家以各种理由退款!
2、本店源码均由店主亲测后发布,不得以存在BUG为理由退款!
3、本店不参加源码修改和功能维护!
4、本店所有源码严禁用于非法用途,若用于非法用途所造成的后果本店概不负责!
5、需要安装服务,有肯定时间工作量,请独立购买安装部署服务,本源码不提供安装服务,请不要在本源码中购买安装服务,谢谢配合!
6、若您购买本商品,将视为您已同意以上5点!
亲测没问题。
买家须知
源码属于特殊商品,不退不换。