Script VB6.0 Program Penggajian Guru
, at 6:50 AM, in
Sub bersih()
Unload Me
Load Me
Me.Show
End Sub
Private Sub Command1_Click()
Unload Me
Menu.Enabled = True
Menu.Show
End Sub
Private Sub Form_Load()
ADOSLIP.RecordSource = "Select count(*) as JmlRec from TBL_GAJI"
ADOSLIP.Refresh
JmlRec = ADOSLIP.Recordset!JmlRec + 1
pj = Len(Trim(Str(JmlRec)))
XSLIP = "S" + Left("00000", 5 - pj) + Trim(Str(JmlRec))
Dim I As Integer
For I = 1 To 31
XTGLL.AddItem I
Next
For I = 1 To 12
XBLN.AddItem MonthName(I)
Next
For I = 2009 To 2019
XTHN.AddItem I
Next
OK.Enabled = False
End Sub
Private Sub OK_Click()
Adodc4.RecordSource = "SELECT * FROM TBL_GAJI WHERE NO_SLIP ='" & XSLIP & "'"
Adodc4.Refresh
If Adodc4.Recordset.EOF Then
XX = XBLN + " - " + XTHN
Adodc6.RecordSource = "SELECT * FROM TBL_GAJI WHERE NIP ='" & XNIP & "'"
Adodc6.Refresh
If Not Adodc6.Recordset.EOF Then
XX = XBLN + " - " + XTHN
If Adodc6.Recordset!BLN_THN = XX Then
MsgBox "MAAF SUDAH TERIMA GAJI PADA BLN " + XX, , "INFORMASI"
Else
Adodc4.RecordSource = "SELECT * FROM TBL_GAJI WHERE NO_SLIP ='" & XSLIP & "'"
Adodc4.Refresh
Adodc4.Recordset.AddNew
Adodc4.Recordset!NO_SLIP = XSLIP
Adodc4.Recordset!NIP = XNIP
Adodc4.Recordset!kd_kasir = Menu.StatusBar1.Panels(2).Text
Adodc4.Recordset!JUMLAH = XTOTAL
Adodc4.Recordset!TGL_TERIMA = XTGLL
XX = XBLN + " - " + XTHN
Adodc4.Recordset!BLN_THN = XX
Adodc4.Recordset.Update
MSG = MsgBox("CETAK SLIP " + XSLIP + " TIDAK", vbYesNoCancel, "KONFIRMASI")
If MSG = vbYes Then
Adodc1.RecordSource = "select * from TBL_GAJI where NIP = '" & XNIP & "'"
Adodc1.Refresh
If Not Adodc1.Recordset.EOF Then
RPT1.ReportFileName = App.Path + "\lapgaji.rpt"
RPT1.RetrieveDataFiles
RPT1.WindowState = crptMaximized
RPT1.Action = 1
Else
MsgBox "Sorry Nip " & XNIP & " Yang Anda Inputkan Belum Melakukan Transaksi", vbInformation, "LAP GAJI"
End If
ElseIf MSG = vbNo Then
bersih
Else
XNIP.SetFocus
End If
End If
Else
Adodc4.Recordset.AddNew
Adodc4.Recordset!NO_SLIP = XSLIP
Adodc4.Recordset!NIP = XNIP
Adodc4.Recordset!kd_kasir = Menu.StatusBar1.Panels(2).Text
Adodc4.Recordset!JUMLAH = XTOTAL
Adodc4.Recordset!TGL_TERIMA = XTGLL
XX = XBLN + " - " + XTHN
Adodc4.Recordset!BLN_THN = XX
Adodc4.Recordset.Update
MSG = MsgBox("CETAK SLIP " + XSLIP + " TIDAK", vbYesNoCancel, "KONFIRMASI")
If MSG = vbYes Then
RPT1.SelectionFormula = "{TBL_GAJI.NIP} = '" & XNIP.Text & "'"
RPT1.RetrieveDataFiles
RPT1.Action = 1
MsgBox "BERHASIL DI CETAK", , "INFORMASI"
ElseIf MSG = vbNo Then
bersih
Else
XNIP.SetFocus
End If
End If
Else
MsgBox "MAAF SUDAH TERIMA GAJI", , "INFORMASI"
End If
End Sub
Private Sub Timer1_Timer()
XTGL = Date
End Sub
Private Sub XBLN_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
If XBLN = "" Then
XBLN.SetFocus
Else
XTHN.SetFocus
End If
End If
End Sub
Private Sub XNIP_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Adodc6.RecordSource = "select * from TBL_PEGAWAI where nip ='" & XNIP & "'"
Adodc6.Refresh
If Adodc6.Recordset.RecordCount > 0 Then
XNAMA = Adodc6.Recordset!NAMA
XTEMPAT = Adodc6.Recordset!TEMPAT_LHR
XTGL_LHR = Adodc6.Recordset!TGL_LHR
XGOL = Adodc6.Recordset!GOL
XJAB = Adodc6.Recordset!JABATAN
Dim Y As String
Dim Z As Integer
Y = Adodc6.Recordset!Status
If Y = "KAWIN" Then
Z = Adodc6.Recordset!JML_ANAK
'XTUNJ_AN = 50000 * Z
'XTUNJ_IS = 150000
XTUNJAB = 200000 * Z
Else
XTUNJAB = 0
'XTUNJ_AN = 0
'XTUNJ_IS = 0
End If
Adodc1.RecordSource = "select * from TBL_GOL WHERE GOL ='" & XGOL & "'"
Adodc1.Refresh
If Not Adodc1.Recordset.EOF Then
XGAPOK = Adodc1.Recordset!GAPOK
Else
XNIP.SetFocus
End If
Adodc2.RecordSource = "select * from TBL_JABATAN WHERE JABATAN ='" & XJAB & "'"
Adodc2.Refresh
If Not Adodc2.Recordset.EOF Then
XTUNJ_FG = Adodc2.Recordset!Tunj_Fungsional
Else
XNIP.SetFocus
End If
XTOTAL = Val(XGAPOK) + Val(XTUNJ_FG) + Val(XTUNJAB)
XTGLL.SetFocus
Else
MsgBox "DATA PEGAWAI TIDAK ADA", , "INFORMASI"
XNIP.SetFocus
End If
End If
End Sub
Private Sub XTGLL_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
If XTGLL = "" Then
XTGLL.SetFocus
Else
XBLN.SetFocus
End If
End If
End Sub
Private Sub XTHN_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
If XTHN = "" Then
XTHN.SetFocus
Else
OK.Enabled = True
OK.SetFocus
End If
End If
End Sub
Subscribe to:
Posts (Atom)