APLIKASI PENGGAJIAN

 

Aplikasi penggajian ini merupakan aplikasi standar yang tingkat kesulitannya lumayan juga, mengingat banyak aturan pemerintah yang harus dipenuhi, diantaranya adalah masalah potongan pajak PPH 21, potongan BPJS dan lain-lain.

 

Tanpa harus bersusah-susah ria, mari kita mulai membuat aplikasi penggajian dengan langkah-langkah sebagai berikut :

 

  1. MEMBUAT PROJECT
  2. MEMBUAT DATABASE DAN TABEL-TABEL

 

 

  1. MEMBUAT MODULE KONEKSI DATABASE

a.      Klik menu project

b.      Pilih add module

c.       Klik add

d.      Ketik kodingberikut ini

 

Imports System.Data.OleDb

Imports CrystalDecisions.CrystalReports.Engine

Imports CrystalDecisions.Shared

 

Module Module1

 

    Public CONN As OleDbConnection

    Public DA As OleDbDataAdapter

    Public DS As DataSet

    Public CMD As OleDbCommand

    Public DR As OleDbDataReader

 

 

    Public laporan As New ReportDocument

    Public TabelLogon As CrystalDecisions.Shared.TableLogOnInfo

 

    Public Sub SetingLaporan()

        Dim BacaTabel As CrystalDecisions.CrystalReports.Engine.Table

        For Each BacaTabel In laporan.Database.Tables

            TabelLogon = BacaTabel.LogOnInfo

            With TabelLogon.ConnectionInfo

                .ServerName = Application.StartupPath & "\penggajian.mdb"

                .UserID = ""

                .Password = ""

                .DatabaseName = ""

            End With

            BacaTabel.ApplyLogOnInfo(TabelLogon)

        Next BacaTabel

    End Sub

 

    Public Sub Koneksi()

        CONN = New OleDbConnection("provider=microsoft.jet.oledb.4.0;data source=penggajian.mdb")

        CONN.Open()

    End Sub

End Module

 

 

  1. MEMBUAT FORM LOGIN

 

 

 

Imports System.Data.OleDb

 

Public Class Login

 

    Dim Hitung As Integer = 0

 

    Private Sub OK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK.Click

        Call Koneksi()

        CMD = New OleDbCommand("select * from tbluser where nama_user='" & txtnama.Text & "' and pwd_user='" & txtpassword.Text & "'", CONN)

        DR = CMD.ExecuteReader

        DR.Read()

        If Not DR.HasRows Then

            MsgBox("Login gagal")

            Hitung = Hitung + 1

            If Hitung > 2 Then

                End

            End If

            Exit Sub

        Else

            If txtpassword.Text <> DR.Item("pwd_user") Then

                MsgBox("password salah")

                txtpassword.Focus()

                Exit Sub

            End If

            Me.Visible = False

            MenuUtama.Show()

 

            MenuUtama.PanelKode.Text = DR.Item("id_user")

            MenuUtama.PanelNama.Text = DR.Item("nama_user")

            MenuUtama.PanelStatus.Text = DR.Item("status_user")

 

        End If

 

        '================== deteksi id profil

 

        CMD = New OleDbCommand("select * from tblprofil", CONN)

        DR = CMD.ExecuteReader

        DR.Read()

        If Not DR.HasRows Then

            Profil.Show()

            Exit Sub

        Else

            MenuUtama.PanelIDProfil.Text = DR.Item("id_profil")

        End If

    End Sub

 

    Private Sub Cancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cancel.Click

        Me.Close()

    End Sub

 

    Private Sub Login_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        Call Koneksi()

        CMD = New OleDbCommand("select * from tbluser wHere status_user='ADMIN'", CONN)

        DR = CMD.ExecuteReader

        DR.Read()

        If DR.HasRows Then

            txtnama.Text = DR.Item("nama_user")

            txtpassword.Text = DR.Item("pwd_user")

        Else

            txtnama.Clear()

            txtpassword.Clear()

        End If

 

    End Sub

End Class

 

 

  1. MEMBUAT FORM MENU UTAMA

 

 

  1. MEMBUAT FORM USER

 

 

 

Imports System.Data.OleDb

 

Public Class User

 

    Sub Kosongkan()

        TextBox1.Clear()

        TextBox2.Clear()

        ComboBox1.Text = ""

        TextBox3.Clear()

        TextBox5.Clear()

        TextBox1.Focus()

    End Sub

 

    Sub DataBaru()

        TextBox2.Clear()

        ComboBox1.Text = ""

        TextBox3.Clear()

        TextBox5.Clear()

        TextBox2.Focus()

    End Sub

 

    Sub Ketemu()

        On Error Resume Next

        TextBox2.Text = DR.Item("nama_User")

        ComboBox1.Text = DR.Item(2)

        TextBox3.Text = DR.Item(3)

        TextBox2.Focus()

    End Sub

 

    Sub TampilStatus_user()

        CMD = New OleDbCommand("select distinct Status_user from tblUser", CONN)

        DR = CMD.ExecuteReader

        ComboBox1.Items.Clear()

        Do While DR.Read

            ComboBox1.Items.Add(DR.Item("Status_user"))

        Loop

    End Sub

 

    Sub TampilGrid()

        DA = New OleDbDataAdapter("select * from tblUser", CONN)

        DS = New DataSet

        DA.Fill(DS)

        DGV.DataSource = DS.Tables(0)

        DGV.ReadOnly = True

    End Sub

 

    Sub CariKode()

        CMD = New OleDbCommand("select * from tblUser where id_user='" & TextBox1.Text & "'", CONN)

        DR = CMD.ExecuteReader

        DR.Read()

    End Sub

 

    Private Sub User_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        Call Koneksi()

        Call Kosongkan()

        Call TampilStatus_user()

        Call TampilGrid()

    End Sub

 

    Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress

        TextBox1.MaxLength = 5

        If e.KeyChar = Chr(13) Then

            Call CariKode()

            If DR.HasRows Then

                Call Ketemu()

            Else

                Call DataBaru()

            End If

        End If

    End Sub

 

 

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        If TextBox1.Text = "" Or TextBox2.Text = "" Or ComboBox1.Text = "" Or TextBox3.Text = "" Then

            MsgBox("data belum lengkap")

            Exit Sub

        Else

            Try

                Call CariKode()

                If Not DR.HasRows Then

                    Dim simpan As String = "insert into tblUser values('" & TextBox1.Text & "','" & TextBox2.Text & "','" & ComboBox1.Text & "','" & TextBox3.Text & "')"

                    CMD = New OleDbCommand(simpan, CONN)

                    CMD.ExecuteNonQuery()

                Else

                    Dim edit As String = "update tblUser set nama_User='" & TextBox2.Text & "',Status_user='" & ComboBox1.Text & "',PWD_user='" & TextBox3.Text & "' where id_user='" & TextBox1.Text & "'"

                    CMD = New OleDbCommand(edit, CONN)

                    CMD.ExecuteNonQuery()

                End If

                Call Kosongkan()

                Call TampilGrid()

                Call TampilStatus_user()

            Catch ex As Exception

                MsgBox(ex.Message) ' jelaskan salahnya karena apa...?

            End Try

        End If

    End Sub

 

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

        If TextBox1.Text = "" Then

            MsgBox("Kode harus diisi")

            TextBox1.Focus()

            Exit Sub

        End If

 

        Call CariKode()

        If Not DR.HasRows Then

            MsgBox("Kode User tidak terdaftar")

            TextBox1.Focus()

            Exit Sub

        End If

 

        If MessageBox.Show("Yakin akan dihapus...?", "", MessageBoxButtons.YesNo) = Windows.Forms.DialogResult.Yes Then

            Dim hapus As String = "delete * from tblUser where id_user='" & TextBox1.Text & "'"

            CMD = New OleDbCommand(hapus, CONN)

            CMD.ExecuteNonQuery()

            Call Kosongkan()

            Call TampilGrid()

            Call TampilStatus_user()

        Else

            Call Kosongkan()

        End If

    End Sub

 

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click

        Call Kosongkan()

    End Sub

 

    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click

        Me.Close()

    End Sub

 

    Private Sub TextBox5_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox5.TextChanged

        DA = New OleDbDataAdapter("select * from tblUser where nama_User like '%" & TextBox5.Text & "%'", CONN)

        DS = New DataSet

        DA.Fill(DS)

        DGV.DataSource = DS.Tables(0)

        DGV.ReadOnly = True

    End Sub

 

    Private Sub DGV_CellMouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellMouseEventArgs) Handles DGV.CellMouseClick

        On Error Resume Next

        TextBox1.Text = DGV.Rows(e.RowIndex).Cells(0).Value

        Call CariKode()

        If DR.HasRows Then

            Call Ketemu()

        End If

    End Sub

 

End Class

 

 

  1. MEMBUAT FORM PROFIL

 

 

Imports System.Data.OleDb

 

Public Class Profil

 

    Sub IDprofilOtomatis()

        CMD = New OleDbCommand("select id_profil from tblprofil order by id_profil desc", CONN)

        DR = CMD.ExecuteReader

        DR.Read()

        If Not DR.HasRows Then

            ID.Text = "01"

        Else

            ID.Text = "01"

        End If

        ID.Enabled = False

    End Sub

 

    Sub Kosongkan()

        On Error Resume Next

        Nama.Clear()

        Alamat.Clear()

        Telepon.Clear()

        Fax.Clear()

        Email.Clear()

        Website.Clear()

        Nama.Focus()

    End Sub

 

    Sub Ketemu()

        On Error Resume Next

        Nama.Text = DR.Item(1)

        Alamat.Text = DR.Item(2)

        Telepon.Text = Microsoft.VisualBasic.Mid(DR.Item(3), 9, 30)

        Fax.Text = Microsoft.VisualBasic.Mid(DR.Item(4), 5, 30)

        Email.Text = Microsoft.VisualBasic.Mid(DR.Item(5), 7, 30)

        Website.Text = Microsoft.VisualBasic.Mid(DR.Item(6), 9, 30)

        Nama.Focus()

    End Sub

 

 

    Sub CariIdprofil()

        CMD = New OleDbCommand("select * from tblprofil where id_profil='" & ID.Text & "'", CONN)

        DR = CMD.ExecuteReader

        DR.Read()

    End Sub

 

    Sub Awal()

        Call IDprofilOtomatis()

        Call Kosongkan()

    End Sub

 

    Private Sub Profil_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        Call Koneksi()

        'Call Awal()

        Call IDprofilOtomatis()

        Call CariIdprofil()

        If DR.HasRows Then

            Call Ketemu()

        End If

    End Sub

 

 

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

 

        Try

            Call CariIdprofil()

            If Not DR.HasRows Then

                Dim simpan As String = "insert into tblprofil values('" & ID.Text & "','" & Nama.Text & "','" & Alamat.Text & "', '" & Label4.Text & Space(1) & Telepon.Text & "', '" & Label5.Text & Space(1) & Fax.Text & " ', '" & Label6.Text & Space(1) & Email.Text & "', '" & Label7.Text & Space(1) & Website.Text & "')"

                CMD = New OleDbCommand(simpan, CONN)

                CMD.ExecuteNonQuery()

            Else

                CMD = New OleDbCommand("delete * from tblprofil", CONN)

                CMD.ExecuteNonQuery()

                Dim simpan As String = "insert into tblprofil values('" & ID.Text & "','" & Nama.Text & "','" & Alamat.Text & "', '" & Label4.Text & Space(1) & Telepon.Text & "', '" & Label5.Text & Space(1) & Fax.Text & " ', '" & Label6.Text & Space(1) & Email.Text & "', '" & Label7.Text & Space(1) & Website.Text & "')"

                CMD = New OleDbCommand(simpan, CONN)

                CMD.ExecuteNonQuery()

            End If

            'Call Awal()

            MenuUtama.PanelIDProfil.Text = ID.Text

            MsgBox("Data berhasil disimpan")

            Me.Close()

        Catch ex As Exception

            MsgBox(ex.Message)

        End Try

    End Sub

 

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click

        'Call Kosongkan()

        Call IDprofilOtomatis()

        Call Ketemu()

        Nama.Focus()

    End Sub

 

    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click

        Me.Close()

    End Sub

End Class

 

 

  1. MEMBUAT FORM JABATAN

 

            Beberapa form yang pola codingnya sama tidak saya tampilkan semuanya, hanya gambar-gambar formnya saja yang ditunjukan

 

 

  1. MEMBUAT FORM GOLONGAN

 

 

  1. MEMBUAT FORM PENDAPATAN

 

 

 

  1. MEMBUAT FORM POTONGAN

 

 

  1. MEMBUAT FORM KARYAWAN

 

 

 

  1. MEMBUAT FORM PENGGAJIAN

 

 

 

 

Imports System.Data.OleDb

 

Public Class TRPenggajian

 

    Sub Bersihkan()

        TIDKaryawan.Clear()

        Tnama.Text = ""

        TStatus.Text = ""

        TJumlahAnak.Text = ""

        TGolongan.Text = ""

        TJabatan.Text = ""

        TDivisi.Text = ""

        Label17.Text = ""

        Label13.Text = ""

        Tketerangan.Text = "-"

        TTotalPendapatan.Text = 0

        TTotalPotongan.Text = 0

        TextBox1.Text = 0

        DGV1.Columns(0).ReadOnly = True

        DGV1.Columns(1).ReadOnly = True

        For baris1 As Integer = 0 To DGV1.RowCount - 1

            DGV1.Rows(baris1).Cells(2).Value = 0

            DGV1.Columns(2).AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill

        Next

 

        DGV2.Columns(0).ReadOnly = True

        DGV2.Columns(1).ReadOnly = True

        For baris2 As Integer = 0 To DGV2.RowCount - 1

            DGV2.Rows(baris2).Cells(2).Value = 0

            DGV2.Columns(2).AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill

        Next

    End Sub

 

    Sub Otomatis()

        CMD = New OleDbCommand("select id_gaji from tblgaji order by id_gaji desc", CONN)

        DR = CMD.ExecuteReader

        DR.Read()

        If Not DR.HasRows Then

            TNomor.Text = "0000000001"

        Else

            TNomor.Text = Format(Microsoft.VisualBasic.Right(DR.Item("ID_GAJI"), 10) + 1, "0000000000")

        End If

    End Sub

 

    Sub TampilPendapatan()

        DGV1.Columns.Clear()

        DA = New OleDbDataAdapter("select ID_Pendapatan,Nama_Pendapatan from tblpendapatan", CONN)

        DS = New DataSet

        DA.Fill(DS)

        DGV1.DataSource = DS.Tables(0)

        DGV1.Columns.Add("Jumlah", "Jumlah Pendapatan")

        DGV1.Columns(2).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight

        DGV1.Columns(0).HeaderText = "ID Pendapatan"

        DGV1.Columns(1).HeaderText = "Nama Pendapatan"

    End Sub

 

    Sub TampilPotongan()

        DGV2.Columns.Clear()

        DA = New OleDbDataAdapter("select ID_Potongan,Nama_Potongan from TBLpotongan", CONN)

        DS = New DataSet

        DA.Fill(DS)

        DGV2.DataSource = DS.Tables(0)

        DGV2.Columns.Add("Jumlah", "Jumlah Potongan")

        DGV2.Columns(2).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight

        DGV2.Columns(0).HeaderText = "ID Potongan"

        DGV2.Columns(1).HeaderText = "Nama Potongan"

    End Sub

 

    Private Sub TRpenggajian_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        Call Koneksi()

        Call Otomatis()

        TTanggal.Text = Today

        Call TampilPendapatan()

        Call TampilPotongan()

        Call Bersihkan()

    End Sub

 

    Sub cariTotalPendapatan()

        Try

            Dim hitung As Integer = 0

            For baris As Integer = 0 To DGV1.RowCount - 1

                hitung = hitung + DGV1.Rows(baris).Cells(2).Value

                TTotalPendapatan.Text = FormatNumber(hitung, 0)

            Next

        Catch ex As Exception

            MsgBox(ex.Message)

        End Try

    End Sub

 

    Sub cariTotalPotongan()

        Try

            Dim hitung As Integer = 0

            For baris As Integer = 0 To DGV2.RowCount - 1

                hitung = hitung + DGV2.Rows(baris).Cells(2).Value

                TTotalPotongan.Text = FormatNumber(hitung, 0)

            Next

        Catch ex As Exception

            MsgBox(ex.Message)

        End Try

    End Sub

 

    Private Sub TIDKaryawan_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TIDKaryawan.KeyPress

 

        If e.KeyChar = Chr(13) Then

            CMD = New OleDbCommand("select id_karyawan from tblgaji where id_karyawan='" & TIDKaryawan.Text & "' and month(tanggal)='" & Month(TTanggal.Text) & "' and year(tanggal)='" & Year(TTanggal.Text) & "'", CONN)

            DR = CMD.ExecuteReader

            DR.Read()

            If DR.HasRows Then

                Call Bersihkan()

                MsgBox("data gaji karyawan tersebut bulan dan tahun ini sudah dientri")

                Exit Sub

            End If

        End If

 

        If e.KeyChar = Chr(13) Then

            CMD = New OleDbCommand("select * from tblkaryawan where ID_Karyawan='" & TIDKaryawan.Text & "'", CONN)

            DR = CMD.ExecuteReader

            DR.Read()

            If DR.HasRows Then

                Tnama.Text = DR.Item("nama_karyawan")

                TStatus.Text = DR.Item("status_pernikahan")

                TJumlahAnak.Text = DR.Item("jumlah_anak")

                TJabatan.Text = DR.Item("id_jabatan")

                TGolongan.Text = DR.Item("id_golongan")

                TDivisi.Text = DR.Item("divisi")

                DGV1.Rows(0).Cells(2).Value = DR.Item("gaji_pokok")

 

                '========================================GOLONGAN

                CMD = New OleDbCommand("select * from tblgolongan where id_golongan='" & TGolongan.Text & "'", CONN)

                DR = CMD.ExecuteReader

                DR.Read()

                If DR.HasRows Then

                    DGV1.Rows(1).Cells(2).Value = DR.Item("tunjangan_golongan")

                    Label17.Text = DR.Item("Nama_golongan")

                End If

                '=======================================jabatan

                CMD = New OleDbCommand("select * from tbljabatan where id_jabatan='" & TJabatan.Text & "'", CONN)

                DR = CMD.ExecuteReader

                DR.Read()

                If DR.HasRows Then

                    DGV1.Rows(2).Cells(2).Value = DR.Item("tunjangan_jabatan")

                    Label13.Text = DR.Item("Nama_jabatan")

                    If TStatus.Text = "BELUM MENIKAH" Then

                        DGV1.Rows(3).Cells(2).Value = 0

                    Else

                        DGV1.Rows(3).Cells(2).Value = DR.Item("tunjangan_keluarga")

                    End If

 

                    If TJumlahAnak.Text > 3 Then

                        DGV1.Rows(4).Cells(2).Value = 3 * DR.Item("tunjangan_anak")

                    Else

                        DGV1.Rows(4).Cells(2).Value = TJumlahAnak.Text * DR.Item("tunjangan_anak")

                    End If

                    DGV1.Rows(0).ReadOnly = True

                    DGV1.Rows(1).ReadOnly = True

                    DGV1.Rows(2).ReadOnly = True

                    DGV1.Rows(3).ReadOnly = True

                    DGV1.Rows(4).ReadOnly = True

                End If

                '=======bpjs 1% dari total pendapatan = 4% DIBAYAR OLEH PERUSAHAAN

 

                Call cariTotalPendapatan()

 

                DGV2.Rows(1).Cells(2).Value = Val(Microsoft.VisualBasic.Str(TTotalPendapatan.Text) * 1 / 100)

                Call cariTotalPotongan()

            Else

 

                Call Bersihkan()

                MsgBox("ID Karyawan tidak terdaftar")

            End If

        End If

    End Sub

 

  

 

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click

        Call Bersihkan()

   End Sub

 

 

    Private Sub DGV1_CellEndEdit(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DGV1.CellEndEdit

        If e.ColumnIndex = 2 Then

            Call cariTotalPendapatan()

        End If

    End Sub

 

    Private Sub DGV2_CellEndEdit(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DGV2.CellEndEdit

        If e.ColumnIndex = 2 Then

            Call cariTotalPotongan()

        End If

    End Sub

 

    Private Sub TTotalPendapatan_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TTotalPendapatan.TextChanged

        On Error Resume Next

        TextBox1.Text = Val(Microsoft.VisualBasic.Str(TTotalPendapatan.Text)) - Val(Microsoft.VisualBasic.Str(TTotalPotongan.Text))

        DGV2.Rows(0).Cells(2).Value = Val(Microsoft.VisualBasic.Str(TTotalPendapatan.Text)) * 10 / 100

       TextBox1.Text = FormatNumber(TextBox1.Text, 0)

    End Sub

 

    Private Sub TTotalPotongan_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TTotalPotongan.TextChanged

        On Error Resume Next

        TextBox1.Text = Val(Microsoft.VisualBasic.Str(TTotalPendapatan.Text)) - Val(Microsoft.VisualBasic.Str(TTotalPotongan.Text))

       TextBox1.Text = FormatNumber(TextBox1.Text, 0)

    End Sub

 

 

    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click

        Me.Close()

    End Sub

End Class

 

 

  1. MEMBUAT FORM LAPORAN MASTER

 

 

 

  1. MEMBUAT FORM LAPORAN PENGGAJIAN

 

 

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        '

 

        DA = New OleDbDataAdapter("SELECT tblgaji.id_gaji,tanggal,tblkaryawan.id_karyawan,nama_karyawan,tblgaji.total_pendapatan,total_potongan,gaji_bersih FROM TBLGAJI,tblkaryawan where tblgaji.id_karyawan=tblkaryawan.id_karyawan and month(tblgaji.tanggal)='" & Month(DTP1.Text) & "' and year(tblgaji.tanggal)='" & Year(DTP1.Text) & "'", CONN)

        DS = New DataSet

        DA.Fill(DS)

        DGV.DataSource = DS.Tables(0)

        DGV.ReadOnly = True

 

    End Sub

 

 

 

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click

 

        Cetak.Show()

        Cetak.CRV.SelectionFormula = "month({tblgaji.tanggal})=(" & Month(DTP1.Text) & ") and year({tblgaji.tanggal})=(" & Year(DTP1.Text) & ")"

        laporan.Load("LAP gaji.rpt")

        Call SetingLaporan()

        Cetak.CRV.ReportSource = laporan

        Cetak.CRV.RefreshReport()

    End Sub

 

 

 

Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click

        Cetak.Show()

        Cetak.CRV.SelectionFormula = "{tblpotongan.nama_potongan}='PPh 21' and month({tblgaji.tanggal})=(" & Month(DTP2.Text) & ") and year({tblgaji.tanggal})=(" & Year(DTP2.Text) & ")"

        laporan.Load("pph21.rpt")

        Call SetingLaporan()

        Cetak.CRV.ReportSource = laporan

        Cetak.CRV.RefreshReport()

    End Sub

 

 

Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click

        Cetak.Show()

        Cetak.CRV.SelectionFormula = "{tblpotongan.nama_potongan}='BPJS' and month({tblgaji.tanggal})=(" & Month(DTP2.Text) & ") and year({tblgaji.tanggal})=(" & Year(DTP2.Text) & ")"

        laporan.Load("BPJS.rpt")

        Call SetingLaporan()

        Cetak.CRV.ReportSource = laporan

        Cetak.CRV.RefreshReport()

    End Sub