📄 frmjsalary.frm
字号:
Width = 1215
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
DataField = "所属部门编号"
DataSource = "Adodc1"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Index = 7
Left = 4800
TabIndex = 51
Top = 240
Width = 1215
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "就业时间:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Index = 5
Left = 6360
TabIndex = 23
Top = 720
Width = 1095
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "所属部门名称:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Index = 4
Left = 3120
TabIndex = 22
Top = 720
Width = 1695
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "职务:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Index = 3
Left = 6840
TabIndex = 8
Top = 240
Width = 735
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "所属部门编号:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Index = 2
Left = 3120
TabIndex = 6
Top = 240
Width = 1695
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "员工姓名:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Index = 1
Left = 240
TabIndex = 5
Top = 720
Width = 1215
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "员工编号:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Index = 0
Left = 240
TabIndex = 4
Top = 240
Width = 1215
End
End
End
Attribute VB_Name = "frmJSalary"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'Dim flag As Integer
'Private Sub gengxin()
'
'If flag = 1 Then Adodc1.RecordSource = "select * from 职工信息表 where 员工姓名='" & Text2.Text & "'"
'If flag = 2 Then Adodc1.RecordSource = "select * from 职工信息表 where 员工姓名='" & Text2.Text & "'"
'Adodc1.Refresh
'
'End Sub
Dim JBGZE As Integer
Dim BYBZ As Integer
Dim QTKK As Integer
Private Sub Command1_Click() '返回
'Me.Hide
Unload Me
Exit Sub
End Sub
Private Sub Command2_Click() '计算
'Adodc4.Recordset.AddNew
If Text4(2) = "" Then
MsgBox "请输入奖金金额!", vbOKOnly + vbExclamation, "提示"
Text4(2).SetFocus
Else
If Text4(3) = "" Then
MsgBox "请输入其他补助金额!", vbOKOnly + vbExclamation, "提示"
Text4(3).SetFocus
Else
Text4(11) = Date
Dim GL As Integer
GL = Val(Year(Date) - Year(Label1(10).Caption)) '计算工龄
Label2(8).Caption = Val(Label2(11).Caption) * GL '计算工龄工资
Text4(1).Text = Val(Label2(12).Caption) * Val(Label3(10).Caption) '计算加班工资
Text4(4).Text = Val(Label2(15).Caption) * Val(Label3(11).Caption) '计算迟到扣款
Text4(5).Text = Val(Label2(13).Caption) * Val(Label3(9).Caption) '计算病假扣款
Text4(6).Text = Val(Label2(14).Caption) * Val(Label3(8).Caption) '计算事假扣款
Text4(0).Text = Val(Text4(4).Text) + Val(Text4(5).Text) + Val(Text4(6).Text) '计算考勤扣款
Dim money As Integer '应发金额
money = Val(Label2(9).Caption) + Val(Label2(10).Caption) + Val(Label2(8).Caption) _
+ Val(Text4(1).Text) + Val(Text4(2).Text) + Val(Text4(3).Text) - Val(Text4(0).Text) - Val(Text4(7).Text)
'计算个人所得税
If money <= 800 Then
Text4(8).Text = 0
Else
If (money - 800) <= 500 Then
Text4(8).Text = (money - 800) * 0.05
Else
If (money - 800) > 500 And (money - 800) <= 2000 Then
Text4(8).Text = (money - 800) * 0.1
Else
If (money - 800) > 2000 And (money - 800) <= 0.15 Then
Text4(8).Text = (money - 800) * 0.15
Else
If (money - 800) > 5000 And (money - 800) <= 20000 Then
Text4(8).Text = (money - 800) * 0.2
End If
End If
End If
End If
End If
End If
End If
'计算实发金额
Text4(9).Text = money - Val(Text4(8).Text)
'计算基本工资额,包括职务津贴、基本工资、工龄工资
JBGZE = Val(Label2(10).Caption) + Val(Label2(9).Caption) + Val(Label2(8).Caption)
'计算本月补助,包括加班工资、奖金、其他补助
BYBZ = Val(Text4(1).Text) + Val(Text4(2).Text) + Val(Text4(3).Text)
'计算其他扣款,包括违纪罚款和个人所得税
QTKK = Val(Text4(7).Text) + Val(Text4(0).Text)
End Sub
Private Sub Command3_Click() '更新
'Dim flag As Boolean
'If flag = False Then
If Text1(0).Text = "" And Text2.Text = "" Then
MsgBox "请输入员工编号或员工姓名!", vbOKOnly + vbExclamation, "提示"
Exit Sub
End If
'If Text1(0).Text = Adodc2.Recordset.Fields("员工编号").Value Then
If Combo1.Text = "" Then
MsgBox "请选择年份!", vbOKOnly + vbExclamation, "提示"
Else
If Combo2.Text = "" Then
MsgBox "请选择月份!", vbOKOnly + vbExclamation, "提示"
Else
' If Text1(0).Text = Adodc2.Recordset.Fields("员工编号").Value Then
' If Combo1.Text = Adodc2.Recordset.Fields("年份").Value And Combo2.Text = Adodc2.Recordset.Fields("月份").Value Then
' If Combo2.Text = Adodc2.Recordset.Fields("月份").Value Then
Adodc2.RecordSource = "select * from 考勤信息表 where 年份=" & Combo1.Text & " and 月份=" & Combo2.Text & " and 员工编号='" & Text1(0).Text & "'"
Adodc2.Refresh
' Else
' Label3(8).Caption = ""
' Label3(9).Caption = ""
' Label3(10).Caption = ""
' Label3(11).Caption = ""
' MsgBox "对不起,无相应的考勤记录!", vbOKOnly + vbExclamation, "提示"
' End If
' Else
' Label3(8).Caption = ""
' Label3(9).Caption = ""
' Label3(10).Caption = ""
' Label3(11).Caption = ""
' MsgBox "对不起,无相应的考勤记录!", vbOKOnly + vbExclamation, "提示"
' End If
End If
End If
End Sub
Private Sub Command4_Click() '保存
If MsgBox("确定保存当前资料吗?", vbInformation + vbYesNo, "保存资料?") = vbYes Then
Adodc4.Recordset.Fields("员工编号") = Text1(0).Text
Adodc4.Recordset.Fields("员工姓名") = Text2.Text
Adodc4.Recordset.Fields("所属部门编号") = Label1(7).Caption
Adodc4.Recordset.Fields("所属部门名称") = Label1(8).Caption
Adodc4.Recordset.Fields("职务") = Label1(9).Caption
Adodc4.Recordset.Fields("职务津贴") = Val(Label2(10).Caption)
Adodc4.Recordset.Fields("基本工资") = Val(Label2(9).Caption)
Adodc4.Recordset.Fields("工龄工资") = Val(Label2(8).Caption)
Adodc4.Recordset.Fields("加班工资") = Val(Text4(1).Text)
Adodc4.Recordset.Fields("奖金") = Text4(2).Text
Adodc4.Recordset.Fields("其他补助") = Text4(3).Text
Adodc4.Recordset.Fields("迟到扣款") = Val(Text4(4).Text)
Adodc4.Recordset.Fields("病假扣款") = Val(Text4(5).Text)
Adodc4.Recordset.Fields("事假扣款") = Val(Text4(6).Text)
Adodc4.Recordset.Fields("违纪罚款") = Val(Text4(7).Text)
Adodc4.Recordset.Fields("个人所得税") = Val(Text4(8).Text)
Adodc4.Recordset.Fields("实发金额") = Val(Text4(9).Text)
Adodc4.Recordset.Fields("年份") = Combo1.Text
Adodc4.Recordset.Fields("月份") = Combo2.Text
Adodc4.Recordset.Fields("备注") = Text4(10).Text
Adodc4.Recordset.Fields("操作时间") = Text4(11).Text
Adodc4.Recordset.Fields("考勤扣款") = Text4(0).Text
Adodc4.Recordset.Fields("基本工资额") = JBGZE
Adodc4.Recordset.Fields("本月补助") = BYBZ
Adodc4.Recordset.Fields("其他扣款") = QTKK
Adodc4.Recordset.Update
Adodc4.Recordset.MoveFirst
End If
End Sub
Private Sub Form_Load()
Combo1.AddItem "2000"
Combo1.AddItem "2001"
Combo1.AddItem "2002"
Combo1.AddItem "2003"
Combo1.AddItem "2004"
Combo1.AddItem "2005"
Combo1.AddItem "2006"
Combo2.AddItem "1"
Combo2.AddItem "2"
Combo2.AddItem "3"
Combo2.AddItem "4"
Combo2.AddItem "5"
Combo2.AddItem "6"
Combo2.AddItem "7"
Combo2.AddItem "8"
Combo2.AddItem "9"
Combo2.AddItem "10"
Combo2.AddItem "11"
Combo2.AddItem "12"
End Sub
Private Sub Text1_KeyPress(Index As Integer, KeyAscii As Integer)
If KeyAscii = 13 And Index = 0 Then
Adodc3.RecordSource = "select * from 职工工资明细表 where 员工编号='" & Text1(0).Text & "'"
Adodc3.Refresh
Adodc1.RecordSource = "select * from 职工信息表 where 员工编号='" & Text1(0).Text & "'"
Adodc1.Refresh
End If
End Sub
Private Sub Text2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Adodc3.RecordSource = "select * from 职工工资明细表 where 员工姓名='" & Text2.Text & "'"
Adodc3.Refresh
Adodc1.RecordSource = "select * from 职工信息表 where 员工姓名='" & Text2.Text & "'"
Adodc1.Refresh
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -