REPORTE DE NOMINA DE LA EMPRESA ***YAZBEK***
MESA BAUTISTA IVONNE
INICIO
Private Sub Command1_Click()
If usuario.Text = "" Or contraseña.Text = "" Then
MsgBox "NO introdujo datos", vbCritical, "Welcome"
End If
If usuario.Text = "IVON" And contraseña.Text = "GERENTE" Then
Form1.Hide
Form2.Show
End If
End Sub
Private Sub Command2_Click()
s = MsgBox("QUIERES SALIR?", vbYesNo)
If s = vbYes Then
End
End If
End Sub
CALCULOS
Private Sub Command1_Click()
If id <> "" And sb <> "" And com <> "" And bp <> "" And ag <> "" And pres <> "" And pv <> "" And he <> "" And tt <> "" Then
conecta
Busca = "insert into percepciones(ID,SueldoBase,Comision,Bonos_puntualidad,Aguinaldo,Prestaciones,PrimaVacacional,Horas_Extras,Total) values(" & id & ",'" & sb & "','" & com & "','" & bp & "','" & ag & "','" & pres & "','" & pv & "','" & he & "','" & tt & "')"
Rs.Open Busca, Db, adOpenDynamic, adLockOptimistic
Db.Close
MsgBox ("Datos guardados!!!")
id.Text = ""
com.Text = ""
bp.Text = ""
ag.Text = ""
pres.Text = ""
pv.Text = ""
he.Text = ""
tt.Text = ""
Else
MsgBox ("Falta llenar datos!!!")
End If
End Sub
Private Sub Command10_Click()
If id2 <> "" And tp <> "" And td <> "" And sn <> "" And fg <> "" Then
conecta
Busca = "Update sueldo set Total_Percepciones='" & tp & "',Total_Deducciones='" & td & "',Sueldo_Neto='" & sn & "',Fecha_Pago='" & fg & "' WHERE ID= " & id2 & ""
Rs.Open Busca, Db, adOpenDynamic, adLockOptimistic
Db.Close
MsgBox ("Datos modificados!!!")
id2.Text = ""
tp.Text = ""
td.Text = ""
sn.Text = ""
fg.Text = ""
Else
MsgBox ("Falta llenar datos!!!")
End If
End Sub
Private Sub Command2_Click()
If id1 <> "" And falt <> "" And ret <> "" And imss <> "" And ispt <> "" And cj <> "" And tt1 <> "" Then
conecta
Busca = "insert into deducciones(ID,Faltas,Retardos,IMSS,ISPT,Caja_Ahorro,Total) values(" & id1 & "," & falt & "," & ret & "," & imss & "," & ispt & "," & cj & "," & tt & ")"
Rs.Open Busca, Db, adOpenDynamic, adLockOptimistic
Db.Close
MsgBox ("Datos guardados!!!")
id1.Text = ""
falt.Text = ""
ret.Text = ""
imss.Text = ""
ispt.Text = ""
cj.Text = ""
tt1.Text = ""
Else
MsgBox ("Falta llenar datos!!!")
End If
End Sub
Private Sub Command3_Click()
Form10.Hide
Form2.Show
End Sub
Private Sub Command4_Click()
If id2 <> "" And tp <> "" And td <> "" And sn <> "" And fg <> "" Then
conecta
Busca = "insert into sueldo(ID,Total_Percepciones,Total_Deducciones,Sueldo_Neto,Fecha_Pago) values(" & id2 & "," & tp & "," & td & "," & sn & "," & fg & ")"
Rs.Open Busca, Db, adOpenDynamic, adLockOptimistic
Db.Close
MsgBox ("Datos guardados!!")
id2.Text = ""
tp.Text = ""
td.Text = ""
sn.Text = ""
fg.Text = ""
Else
MsgBox ("Falta llenar datos!!!")
End If
End Sub
Private Sub Command5_Click()
If id <> "" And sb <> "" And com <> "" And bp <> "" And ag <> "" And pres <> "" And pv <> "" And he <> "" And tt <> "" Then
conecta
Busca = "Update percepciones set SueldoBase='" & sb & "',Comision='" & com & "',Bonos_puntualidad='" & bp & "',Aguinaldo='" & ag & "',Prestaciones='" & pres & "',PrimaVacacional='" & pv & "',Horas_Extras='" & he & "',Total='" & tt & "' WHERE ID= " & id & ""
Rs.Open Busca, Db, adOpenDynamic, adLockOptimistic
Db.Close
MsgBox ("Datos modificados!!!")
id.Text = ""
com.Text = ""
bp.Text = ""
ag.Text = ""
pres.Text = ""
pv.Text = ""
he.Text = ""
tt.Text = ""
Else
MsgBox ("Falta llenar datos!!!")
End If
End Sub
Private Sub Command6_Click()
If id1 <> "" And falt <> "" And ret <> "" And imss <> "" And ispt <> "" And cj <> "" And tt1 <> "" Then
conecta
Busca = "Update deducciones set Faltas='" & falt & "',Retardos='" & ret & "',IMSS='" & imss & "',ISPT='" & ispt & "',Caja_ahorro='" & cj & "',Total='" & tt1 & "' WHERE ID=" & id1 & ""
Rs.Open Busca, Db, adOpenDynamic, adLockOptimistic
Db.Close
MsgBox ("Datos modificados!!!")
id1.Text = ""
falt.Text = ""
ret.Text = ""
imss.Text = ""
ispt.Text = ""
cj.Text = ""
tt1.Text = ""
Else
MsgBox ("Falta llenar datos!!!")
End If
End Sub
Private Sub Command7_Click()
Text1 = Val(sb) / 15
Text2 = Val(Text1) / 8
pres = Val(pres) * 0.05
pv = Val(sb) * 0.25
he = Val(he) * Val(Text2)
tt = Val(com) + Val(bp) + Val(ag) + Val(pres) + Val(pv) + Val(he)
tp = tt
End Sub
Private Sub Command8_Click()
falt = Val(falt) * Val(Text1)
If ret = 2 Then
ret = Text1
Else
ret = 0
End If
imss = Val(sb) * 0.024
cj = Val(cj) * 0.03
tt1 = Val(falt) + Val(ret) + Val(imss) + Val(ispt) + Val(cj)
td = tt1
End Sub
Private Sub Command9_Click()
sn = Val(tp) - Val(td)
End Sub
Private Sub Form_Load()
Text1.Enabled = False
Text2.Enabled = False
End Sub
Private Sub id_Change()
If id <> "" Then
conecta
Dim nivel As Integer
Busca = "Select * from percepciones where ID = " & id & ""
Rs.Open Busca, Db, adOpenDynamic, adLockOptimistic
If Not Rs.EOF Then
sb.Text = Rs!SueldoBase
com.Text = Rs!Comision
bp.Text = Rs!Bonos_puntualidad
ag.Text = Rs!Aguinaldo
pres.Text = Rs!Prestaciones
pv.Text = Rs!PrimaVacacional
he.Text = Rs!Horas_Extras
tt.Text = Rs!Total
id.Text = Rs!id
Else
MsgBox ("ID no encontrado!!!")
End If
Rs.Close
Db.Close
End If
End Sub
Private Sub id1_Change()
If id1 <> "" Then
conecta
Dim nivel As Integer
Busca = "Select * from deducciones where ID = " & id1 & ""
Rs.Open Busca, Db, adOpenDynamic, adLockOptimistic
If Not Rs.EOF Then
'id1.Text = Rs!id1
falt.Text = Rs!Faltas
ret.Text = Rs!Retardos
imss.Text = Rs!imss
ispt.Text = Rs!ispt
cj.Text = Rs!Caja_ahorro
tt1.Text = Rs!Total
Else
MsgBox ("ID no encontrado!!!")
End If
Rs.Close
Db.Close
End If
End Sub
Private Sub id2_Change()
If id2 <> "" Then
conecta
Dim nivel As Integer
Busca = "Select * from sueldo where ID = " & id2 & ""
Rs.Open Busca, Db, adOpenDynamic, adLockOptimistic
If Not Rs.EOF Then
tp.Text = Rs!Total_Percepciones
td.Text = Rs!Total_Deducciones
sn.Text = Rs!Sueldo_Neto
fg.Text = Rs!Fecha_Pago
id2.Text = Rs!id
Else
MsgBox ("ID no encontrado")
End If
Rs.Close
Db.Close
End If
End Sub
SISTEMA
Private Sub Command1_Click()
RESPALDADOR.Show
End Sub
Private Sub Command2_Click()
Form4.Show
End Sub
Private Sub datper_Click()
Form1.Hide
Form3.Show
End Sub
Private Sub deduc_Click()
Form7.Show
End Sub
Private Sub nomtot_Click()
Form9.Show
End Sub
Private Sub percep_Click()
Form5.Show
End Sub
Private Sub salir_Click()
sl = MsgBox("Realmente desea salir??", vbYesNo)
If sl = vbYes Then
End
End If
End Sub
CONSULTA
Private Sub Command1_Click()
RESPALDADOR.Show
End Sub
Private Sub Command2_Click()
Form4.Show
End Sub
Private Sub datper_Click()
Form1.Hide
Form3.Show
End Sub
Private Sub deduc_Click()
Form7.Show
End Sub
Private Sub nomtot_Click()
Form9.Show
End Sub
Private Sub percep_Click()
Form5.Show
End Sub
Private Sub salir_Click()
sl = MsgBox("Realmente desea salir??", vbYesNo)
If sl = vbYes Then
End
End If
End Sub
ALTAS, BAJAS Y CAMBIOS DE TRABAJADORES
Private Sub Comalta_Click()
If idtext <> "" And rfctext <> "" And nomtext <> "" And aptext <> "" And amtext <> "" And edadtext <> "" And domtext <> "" And puestotext <> "" Then
conecta
Busca = "insert into empleados(ID,RFC,Nombre,Apellido_Paterno,Apellido_Materno,Edad,Domicilio,Puesto) values(" & idtext & ",'" & rfctext & "','" & nomtext & "','" & aptext & "','" & amtext & "', " & edadtext & ", '" & domtext & "',' " & puestotext & "')"
Rs.Open Busca, Db, adOpenDynamic, adLockOptimistic
Db.Close
MsgBox ("Empleado dado de alta!!!")
idtext.Text = ""
rfctext.Text = ""
nomtext.Text = ""
aptext.Text = ""
amtext.Text = ""
edadtext.Text = ""
domtext.Text = ""
puestotext.Text = ""
Else
MsgBox ("Falta llenar datos!!!")
End If
End Sub
Private Sub Comborrar_Click()
conecta
Busca = "Delete * from empleados where ID=" & idtext & ""
Rs.Open Busca, Db, adOpenDynamic, adLockOptimistic
Db.Close
MsgBox ("Empleado dada de baja!!!")
idtext.Text = ""
rfctext.Text = ""
nomtext.Text = ""
aptext.Text = ""
amtext.Text = ""
edadtext.Text = ""
domtext.Text = ""
puestotext.Text = ""
End Sub
Private Sub Cominicio_Click()
Form4.Hide
Form3.Show
End Sub
Private Sub Commodif_Click()
If idtext <> "" And rfctext <> "" And nomtext <> "" And aptext <> "" And amtext <> "" And edadtext <> "" And domtext <> "" And puestotext <> "" Then
conecta
Busca = "Update empleados set RFC='" & rfctext & "',Nombre='" & nomtext & "',Apellido_Paterno='" & aptext & "',Apellido_Materno='" & amtext & "',Edad=" & edadtext & ",Domicilio='" & domtext & "',Puesto='" & puestotext & "' WHERE ID= " & idtext & ""
Rs.Open Busca, Db, adOpenDynamic, adLockOptimistic
Db.Close
MsgBox ("Datos modificados!!!")
idtext.Text = ""
rfctext.Text = ""
nomtext.Text = ""
aptext.Text = ""
amtext.Text = ""
edadtext.Text = ""
domtext.Text = ""
puestotext.Text = ""
Else
MsgBox ("Falta llenar datos!!!")
End If
End Sub
Private Sub Form_Load()
Comalta.Enabled = False
Commodif.Enabled = False
Comborrar.Enabled = False
End Sub
Private Sub idtext_LostFocus()
conecta
Dim nivel As Integer
Busca = "Select * from empleados where ID = " & idtext & ""
Rs.Open Busca, Db, adOpenDynamic, adLockOptimistic
If Not Rs.EOF Then
Comalta.Enabled = False
Commodif.Enabled = True
Comborrar.Enabled = True
idtext.Text = Rs!id
rfctext.Text = Rs!RFC
nomtext.Text = Rs!Nombre
aptext.Text = Rs!Apellido_Paterno
amtext.Text = Rs!Apellido_Materno
edadtext.Text = Rs!Edad
domtext.Text = Rs!Domicilio
puestotext.Text = Rs!Puesto
Else
Comalta.Enabled = True
Commodif.Enabled = False
Comborrar.Enabled = False
rfctext.Text = ""
nomtext.Text = ""
aptext.Text = ""
amtext.Text = ""
edadtext.Text = ""
domtext.Text = ""
puestotext.Text = ""
End If
Rs.Close
Db.Close
End Sub
PERCEPCIONES
Private Sub Command1_Click()
RESPALDADOR.Show
End Sub
Private Sub Command2_Click()
Form4.Show
End Sub
Private Sub datper_Click()
Form1.Hide
Form3.Show
End Sub
Private Sub deduc_Click()
Form7.Show
End Sub
Private Sub nomtot_Click()
Form9.Show
End Sub
Private Sub percep_Click()
Form5.Show
End Sub
Private Sub salir_Click()
sl = MsgBox("Realmente desea salir??", vbYesNo)
If sl = vbYes Then
End
End If
End Sub
DEDUCCIONES
Private Sub Command1_Click()
Form7.Hide
Form10.Show
End Sub
Private Sub Command2_Click()
Form7.Hide
Form2.Show
End Sub
Private Sub Command3_Click()
idtext.Text = ""
faltext.Text = ""
imsstext.Text = ""
isptext.Text = ""
chtext.Text = ""
retext.Text = ""
ttext.Text = ""
End Sub
Private Sub Form_Load()
faltext.Enabled = False
imsstext.Enabled = False
isptext.Enabled = False
chtext.Enabled = False
retext.Enabled = False
ttext.Enabled = False
End Sub
Private Sub idtext_Change()
If idtext <> "" Then
conecta
Dim nivel As Integer
Busca = "Select * from deducciones where ID = " & idtext & ""
Rs.Open Busca, Db, adOpenDynamic, adLockOptimistic
If Not Rs.EOF Then
faltext.Text = Rs!Faltas
retext.Text = Rs!Retardos
imsstext.Text = Rs!imss
isptext.Text = Rs!ispt
chtext.Text = Rs!Caja_ahorro
ttext.Text = Rs!Total
Else
MsgBox ("ID no encontrado")
End If
Rs.Close
Db.Close
End If
End Sub
CONSULTA DE NOMINA
Private Sub Command1_Click()
Form9.Hide
Form2.Show
End Sub
Private Sub Command2_Click()
idtext2.Text = ""
tptext.Text = ""
tdtext.Text = ""
sntext.Text = ""
fptext.Text = ""
End Sub
Private Sub Form_Load()
tptext.Enabled = False
tdtext.Enabled = False
sntext.Enabled = False
fptext.Enabled = False
End Sub
Private Sub idtext2_Change()
If idtext2 <> "" Then
conecta
Dim nivel As Integer
Busca = "Select * from sueldo where ID = " & idtext2 & ""
Rs.Open Busca, Db, adOpenDynamic, adLockOptimistic
If Not Rs.EOF Then
tptext.Text = Rs!Total_Percepciones
tdtext.Text = Rs!Total_Deducciones
sntext.Text = Rs!Sueldo_Neto
fptext.Text = Rs!Fecha_Pago
Else
MsgBox ("ID no encontrado!!!")
End If
Rs.Close
Db.Close
End If
End Sub