经过ahk群和tc群大佬指点改进的,尤其感谢td大佬提供的多个方案
原来ahk可以用三目运算符,真香
;变量:起征点.工资
F6::
Gui,destroy
; Gui Add, Picture,, C:\Users\Administrator\Desktop\1.png
Gui, Font, s30
Gui, Add, Text,,综合所得汇算清缴计算器
Gui, Font, s16
Gui, Add, Text,,输入年综合所得`,即可计算汇算清缴应纳税
Gui, Add, Edit, vACI x+10
Gui, add, button, ,计算
Gui, add, button, ,综合所得税率表
Gui, Show
return
button综合所得税率表:
Gui,destroy
Gui Add, Picture,, .\综合所得汇算清缴税率表.png
Gui, Show
return
Button计算:
Gui, submit, NoHide
tax := Round(IndividualTax(ACI, 起征点:=60000 ), 2)
MsgBox,% "扣除起征金额后应纳税所得额为" inc "`r`n汇算清缴应纳税额为" tax
IndividualTax(income, 起征点:= 60000){
inc := income - 起征点
Return inc <=0 ? 0
: inc <= 36000 ? inc*0.03
: inc <= 144000 ? inc*0.1 -2520
: inc <= 300000 ? inc*0.2 -16920
: inc <= 420000 ? inc*0.25 -31920
: inc <= 600000 ? inc*0.3 -52920
: inc <= 960000 ? inc*0.35 -85920
: inc*0.45-181920
}
;老写法
; ButtonCalculate:
; Gui, submit, NoHide
; TT:=60000
; TI:=ACI-TT
; if (TI<0)
; IIT:=0
; else if (TI<36000)
; IIT:=TI*0.03
; else if (TI between 36000 and 144000)
; IIT:=TI*0.1 -2520
; else if (TI between 14400 and 300000)
; IIT:=TI*0.2 -16920
; else if (TI between 30000 and 420000)
; IIT:=TI*0.25 -31920
; else if (TI between 420000 and 600000)
; IIT:=TI*0.3 -52920
; else if (TI between 660000 and 960000)
; IIT:=TI*0.35 -85920
; else
; IIT:=TI*0.45-181920
; IIT:=Round(IIT,2)
; MsgBox,% "扣除起征金额后应纳税所得额为"TI "汇算清缴应纳税额为" IIT
; Button计算:
; Gui, submit, NoHide
; TT:=60000
; TI:=ACI-TT
; if (TI<0)
; IIT:=0
; else if (TI<36000)
; IIT:=TI*0.03
; else if (TI < 144000)
; IIT:=TI*0.1 -2520
; else if (TI < 300000)
; IIT:=TI*0.2 -16920
; else if (TI < 420000)
; IIT:=TI*0.25 -31920
; else if (TI < 600000)
; IIT:=TI*0.3 -52920
; else if (TI < 960000)
; IIT:=TI*0.35 -85920
; else
; IIT:=TI*0.45-181920
; IIT:=Round(IIT,2)
; Clipboard:=IIT
; MsgBox,% "扣除起征金额后应纳税所得额为" TI "`r`n汇算清缴应纳税额为" IIT "`r`n已经把应纳税额写入了剪切板"