LAMPIRAN A: CARA PERHITUNGAN PKB
Tanggal akhir PKB = 09 april 2011 Tanggal bayar = 09 juni 2012
Maka : Bulan denda = 14 bulan
Catatan : hitung maju dari bulan april ( mei, juni,juli,agustus,September,okt,nov,des), = 8 bulan ditambah hitungan bulan mundur dari bulan juni ( januari, februari, maret, april, mei, juni= 6 bulan maka total bulan nya menjadi 8 bulan + 6 bulan = 14 bulan
Besaran denda = 2% x 14 bulan = 28 %
Maka denda yang dihasilkan adalah :
Denda = 28 % x pokok PKB x 2 ( angka 2 dilihat catatan no1) = …….(denda PKB)
Dengan ketentuan : wajib pajak hanya diperbolehkan
membayar pajak
tanggal akhir PKB lebih kecil sama dengan 45 hari, kalo lebih besar dari 45 hari maka wajib pajak tidak diperbolehkan membayar pajak kendaraan bermotor.
Sehingga dihasilkan perhitungan Total yang harus dibayar oleh wajib pajak sebagai berikut
:
Total pembayaran = denda + pokok PKB+ denda jasa raharja
Universitas Sumatera Utara
Nb : denda jasa raharja ialah apabila tanggal akhir PKB lebih besar sama dengan 3 hari maka denda jasa raharjanya untuk roda 2 dan 3 sebesar Rp.32.000,- dan roda 4 sebesar Rp.100.000,-
Catt : 1.apabila tanggal akhir PKB lebih besar sama dengan 13 bulan maka besaran denda (%) dikalikan dengan pokok pajak 2 tahun.
2.apabila tanggal akhir PKB lebih besar sama dengan 25 bulan maka besaran denda (%) dikalikan dengan pokok pajak 3 tahun. 3.apabila tanggal akhir PKB lebih besar sama dengan 49 bulan maka besaran denda (%) dikalikan dengan pokok pajak 4 tahun.
Universitas Sumatera Utara
LAMPIRAN B: LISTING PROGRAM
FrmUtama.vb Public Class frmDataPemilik Private Sub Data() 'Untuk mengisi objek lisview dengan record dari tabel pegawai’ Dim conn = koneksi.konek() ' variabel global conn yg dipanggil dari fungi koneksi 'buat objek adapter Dim myadp As MySql.Data.MySqlClient.MySqlDataAdapter 'buat perintah query disini Dim query As String query = "Select * from tabel_pemilikkendaraan" Try 'jalankan perintah baca myadp = New MySql.Data.MySqlClient.MySqlDataAdapter(query, conn) Catch ex As Exception MsgBox(ex.Message) End Try ListView1.Items.Clear() 'buat objek command Dim mycmd As New MySql.Data.MySqlClient.MySqlCommand(query, conn) 'buat objek pembaca Dim myread As MySql.Data.MySqlClient.MySqlDataReader 'jalankan query dan isi ke reader myread = mycmd.ExecuteReader() 'cek keberadaan data If myread.HasRows = True Then
While myread.Read Dim daftar As ListViewItem = ListView1.Items.Add(myread.GetString(0)) daftar.SubItems.Add(myread.GetString(1)) daftar.SubItems.Add(myread.GetString(2)) daftar.SubItems.Add(myread.GetString(3))
Universitas Sumatera Utara
daftar.SubItems.Add(myread.GetString(4)) daftar.SubItems.Add(myread.GetString(5)) daftar.SubItems.Add(myread.GetString(6)) daftar.SubItems.Add(myread.GetString(7)) daftar.SubItems.Add(myread.GetString(8)) daftar.SubItems.Add(myread.GetString(9)) daftar.SubItems.Add(myread.GetString(10)) daftar.SubItems.Add(myread.GetString(11)) daftar.SubItems.Add(myread.GetString(12)) daftar.SubItems.Add(myread.GetString(13)) daftar.SubItems.Add(myread.GetString(14)) daftar.SubItems.Add(myread.GetString(15)) End While
End If 'tutup myread myread.Close() simpan.Enabled = True edit.Enabled = False hapus.Enabled = False keluar.Enabled = True End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles simpan.Click If (bk1.Text = "") Then MessageBox.Show("No Polisi dan Nama tidak boleh kosong", "Gagal menambah data", MessageBoxButtons.OK, MessageBoxIcon.Error) Exit Sub End If Dim conn = koneksi.konek() ' variabel global conn yg dipanggil dari fungi koneksi Dim Str As String = "" Dim Str2 As String = "" Str2 = merek.Text Dim mycmd As New MySql.Data.MySqlClient.MySqlCommand("Insert Into tabel_pemilikkendaraan Values('" & Trim(bk1.Text) & _ "','" & Trim(nama.Text) & "','" & Trim(alamat.Text) &_"','" & Str2 & "','" & Trim(jenis.Text) & "','" & Trim(tahunbuat.Text) & "','" & Trim(tahunrakit.Text) &_ "','" & Trim(silinder.Text) & "','" & Trim(warna.Text) & "','"& Trim(norangka.Text) & _ "','" & Trim(nomesin.Text) & "','" & Trim(kodelokasi.Text) & "','"&Trim(bahanbakar.Text) &_"','" & Trim(warnatnkb.Text) & "','" & Trim(berat.Text) & "','" &_ Trim(tglberlaku.Text) & "')", conn)
Universitas Sumatera Utara
Try 'jalankan mycmd.ExecuteNonQuery() Catch ex As MySql.Data.MySqlClient.MySqlException MsgBox("Input data gagal") End Try CmdClear_Click() bk1.Focus() simpan.Enabled = False tambah.Enabled = True edit.Enabled = False hapus.Enabled = False keluar.Enabled = True Data() End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles edit.Click Dim Q As String Q = MsgBox("Apakah Anda Ingin Mengubahnya?", MsgBoxStyle.YesNo) If Q = vbNo Then Exit Sub End If
If Q = vbYes Then Dim tampung As String 'VARIABEL UNTUK NAMPUNG ID tampung = nopol.Text Dim conn = koneksi.konek() ' variabel global conn yg dipanggil dari fungi koneksi Dim Str2 As String = "" Str2 = merek.Text Dim mycmd As New MySql.Data.MySqlClient.MySqlCommand("Update tabel_pemilikkendaraan Set nama='" & _ Trim(nama.Text) & _ "',nopolisi='" & Trim(nopol.Text) & _ "',alamat='" & Trim(alamat.Text) & _ "',merktype='" & Trim(Str2) & _ "',jenis='" & Trim(jenis.Text) & _ "',thn_pembuatan='" & Trim(tahunbuat.Text) & _ "',thn_perakitan='" & Trim(tahunrakit.Text) & _ "',isi_silinder='" & Trim(silinder.Text) & _
Universitas Sumatera Utara
"',warna='" & Trim(warna.Text) & _ "',nomor_rangka='" & Trim(norangka.Text) & _ "',nomor_mesin='" & Trim(nomesin.Text) & _ "',kode_lokasi='" & Trim(kodelokasi.Text) & _ "',bahan_bakar='" & Trim(bahanbakar.Text) & _ "',warna_tnkb='" & Trim(warnatnkb.Text) & _ "',berat_kb='" & Trim(berat.Text) & _ "',tanggal_berlaku='" & Trim(tglberlaku.Text) & "' Where no_polisi='" & tampung & "'", conn) Try 'jalankan mycmd.ExecuteNonQuery() Catch ex As MySql.Data.MySqlClient.MySqlException MsgBox(ex.Message, "insert data gagal") End Try CmdClear_Click() bk1.Focus() simpan.Enabled = False tambah.Enabled = True edit.Enabled = True hapus.Enabled = False keluar.Enabled = False nopol.Visible = False nopol.Enabled = False bk1.Visible = True bk1.Enabled = True Data() End If End Sub Private Sub CmdClear_Click() bk1.Text = "" warnatnkb.Text = "" nama.Text = "" alamat.Text = "" merek.Text = "" kodelokasi.Text = "" merek.Text = "" jenis.Text = "" tahunbuat.Text = "" tahunrakit.Text = "" warna.Text = "" silinder.Text = "" norangka.Text = "" nomesin.Text = ""
Universitas Sumatera Utara
bahanbakar.Text = "" berat.Text = "" tglberlaku.Text = "" End Sub Private Sub ListView1_SelectedIndexChanged1(ByVal sender As Object, ByVal e As System.EventArgs) Handles ListView1.SelectedIndexChanged If ListView1.SelectedItems.Count > 0 Then nopol.Text = ListView1.SelectedItems(0).Text nama.Text = ListView1.SelectedItems(0).SubItems(1).Text alamat.Text = ListView1.SelectedItems(0).SubItems(2).Text jenis.Text = ListView1.SelectedItems(0).SubItems(4).Text() tahunbuat.Text = ListView1.SelectedItems(0).SubItems(5).Text() tahunrakit.Text = ListView1.SelectedItems(0).SubItems(6).Text() silinder.Text = ListView1.SelectedItems(0).SubItems(7).Text() warna.Text = ListView1.SelectedItems(0).SubItems(8).Text() norangka.Text = ListView1.SelectedItems(0).SubItems(9).Text() nomesin.Text = ListView1.SelectedItems(0).SubItems(10).Text() kodelokasi.Text = ListView1.SelectedItems(0).SubItems(11).Text() bahanbakar.Text = ListView1.SelectedItems(0).SubItems(12).Text() warnatnkb.Text = ListView1.SelectedItems(0).SubItems(13).Text() berat.Text = ListView1.SelectedItems(0).SubItems(14).Text() tglberlaku.Text = ListView1.SelectedItems(0).SubItems(15).Text() nopol.Visible = True simpan.Enabled = False tambah.Enabled = True edit.Enabled = True hapus.Enabled = True bk1.Visible = False bk1.Enabled = False End If End Sub Private Sub button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles hapus.Click Dim conn = koneksi.konek() ' variabel global conn yg dipanggil dari fungi koneksi Dim mycmd As New MySql.Data.MySqlClient.MySqlCommand("Delete From tabel_pemilikkendaraan Where no_polisi = '" & Trim(nopol.Text) & "' ", conn) Try 'jalankan mycmd.ExecuteNonQuery() Catch ex As MySql.Data.MySqlClient.MySqlException MsgBox(ex.Message, "Hapus data gagal")
Universitas Sumatera Utara
End Try CmdClear_Click() Data() End Sub
Private Sub tambah_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tambah.Click CmdClear_Click() simpan.Enabled = True tambah.Enabled = False edit.Enabled = False hapus.Enabled = False nopol.Visible = False bk1.Visible = True bk1.Enabled = True End Sub Private Sub bk1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles bk1.KeyDown If e.KeyCode = Keys.Enter Then Dim conn = koneksi.konek() ' variabel global conn yg dipanggil dari fungsi koneksi 'buat objek adapter Dim myadp As MySql.Data.MySqlClient.MySqlDataAdapter 'buat perintah query disini Dim query As String query = "Select * from tabel_pemilikkendaraan WHERE no_polisi='" & bk1.Text & "'" Try 'jalankan perintah baca myadp = New MySql.Data.MySqlClient.MySqlDataAdapter(query, conn) Catch ex As Exception MsgBox(ex.Message) End Try ListView1.Items.Clear() 'buat objek command Dim mycmd As New MySql.Data.MySqlClient.MySqlCommand(query, conn) 'buat objek pembaca Dim myread As MySql.Data.MySqlClient.MySqlDataReader
Universitas Sumatera Utara
'jalankan query dan isi ke reader myread = mycmd.ExecuteReader() 'cek keberadaan data If myread.HasRows = True Then While myread.Read nama.Text = myread.GetString(1) alamat.Text = myread.GetString(2) merek.Text = myread.GetString(3) jenis.Text = myread.GetString(4) tahunbuat.Text = myread.GetString(5) tahunrakit.Text = myread.GetString(6) silinder.Text = myread.GetString(7) warna.Text = myread.GetString(8) norangka.Text = myread.GetString(9) nomesin.Text = myread.GetString(10) kodelokasi.Text = myread.GetString(11) bahanbakar.Text = myread.GetString(12) warnatnkb.Text = myread.GetString(13) berat.Text = myread.GetString(14) tglberlaku.Text = myread.GetString(15) End While nopol.Visible = True simpan.Enabled = False tambah.Enabled = True edit.Enabled = True hapus.Enabled = True bk1.Visible = False bk1.Enabled = False Else edit.Enabled = False hapus.Enabled = False keluar.Enabled = True End If 'tutup myread myread.Close() 'simpan.Enabled = True End If End Sub
Universitas Sumatera Utara
FrmDataPajak.vb Public Class frmDataPajak Private Sub Data() _laporan
'Untuk mengisi objek lisview dengan record dari tabel
Dim conn = koneksi.konek() ' variabel global conn yg dipanggil dari fungi koneksi 'buat objek adapter Dim myadp As MySql.Data.MySqlClient.MySqlDataAdapter 'buat perintah query disini Dim query As String query = "Select * from tabel_pajak" Try 'jalankan perintah baca myadp = New MySql.Data.MySqlClient.MySqlDataAdapter(query, conn)
Catch ex As Exception MsgBox(ex.Message) End Try ListView1.Items.Clear() 'buat objek command Dim mycmd As New MySql.Data.MySqlClient.MySqlCommand(query, conn) 'buat objek pembaca Dim myread As MySql.Data.MySqlClient.MySqlDataReader 'jalankan query dan isi ke reader myread = mycmd.ExecuteReader() 'cek keberadaan data If myread.HasRows = True Then While myread.Read Dim daftar As ListViewItem = ListView1.Items.Add(myread.GetString(0)) daftar.SubItems.Add(myread.GetString(1)) daftar.SubItems.Add(myread.GetString(2)) daftar.SubItems.Add(myread.GetString(3)) daftar.SubItems.Add(myread.GetString(4)) daftar.SubItems.Add(myread.GetString(5)) End While
End If 'tutup myread myread.Close()
Universitas Sumatera Utara
End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles simpan.Click If (bk1.Text = "") Then MessageBox.Show("No Polisi tidak boleh kosong", "Gagal menambah data", MessageBoxButtons.OK, MessageBoxIcon.Error) End If Dim conn = koneksi.konek() ' variabel global conn yg dipanggil dari fungi koneksi Dim Str As String = "" Str = String.Concat(bk1.Text) Dim mycmd As New MySql.Data.MySqlClient.MySqlCommand("Insert Into tabel_pajak Values('" & Trim(Str) & "' , '" & Trim(bbnkb.Text) & "' , '" & Trim(pokokpkb.Text) & "' , '" & Trim(swdkllj.Text) & "','" & Trim(denda.Text) & "', '" & Trim(tglbayar.Text) & "')", conn) Try 'jalankan mycmd.ExecuteNonQuery() Catch ex As MySql.Data.MySqlClient.MySqlException MsgBox(ex.Message, "insert data gagal") End Try CmdClear_Click() bk1.Focus() Data() Exit Sub End Sub Private Sub CmdClear_Click() bk1.Text = "" bbnkb.Text = "" pokokpkb.Text = "" swdkllj.Text = "" denda.Text = "" End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles hapus.Click Dim Q As String Q = MsgBox("Apakah Anda Ingin Menghapusnya?", MsgBoxStyle.YesNo) If Q = vbNo Then Exit Sub End If
Universitas Sumatera Utara
If Q = vbYes Then Dim conn = koneksi.konek() ' variabel global conn yg dipanggil dari fungi koneksi Dim mycmd As New MySql.Data.MySqlClient.MySqlCommand("Delete from tabel_pajak Where no_polisi = '" & Trim(nopol.Text) & "'", conn) Try 'jalankan mycmd.ExecuteNonQuery() Catch ex As MySql.Data.MySqlClient.MySqlException MsgBox("Hapus data gagal") End Try CmdClear_Click() bk1.Focus() simpan.Enabled = False hapus.Enabled = True edit.Enabled = False Data() End If End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles edit.Click Dim Q As String Q = MsgBox("Apakah Anda Ingin Mengubahnya?", MsgBoxStyle.YesNo) If Q = vbNo Then Exit Sub End If If Q = vbYes Then Dim conn = koneksi.konek() ' variabel global conn yg dipanggil dari fungi koneksi Dim mycmd As New MySql.Data.MySqlClient.MySqlCommand("Update tabel_pajak Set BBN_KB='" & Trim(bbnkb.Text) & _ "',POKOK_PKB='" & Trim(pokokpkb.Text) & _ "',SWDKLLJ='" & Trim(swdkllj.Text) & _ "',DENDA='" & Trim(denda.Text) & _ "',TGL_BAYAR='" & Trim(tglbayar.Text) & _ "' Where no_polisi='" & Trim(nopol.Text) & "'", conn)
Try 'jalankan mycmd.ExecuteNonQuery()
Universitas Sumatera Utara
Catch ex As MySql.Data.MySqlClient.MySqlException MsgBox(ex.Message, "insert data gagal") End Try CmdClear_Click() bk1.Focus() simpan.Enabled = False hapus.Enabled = False edit.Enabled = False Data() End If End Sub Private Sub frmDataPajak_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Data() simpan.Enabled = False edit.Enabled = False End Sub Private Sub ListView1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ListView1.SelectedIndexChanged If ListView1.SelectedItems.Count > 0 Then nopol.Text = ListView1.SelectedItems(0).Text() bbnkb.Text = ListView1.SelectedItems(0).SubItems(1).Text() pokokpkb.Text = ListView1.SelectedItems(0).SubItems(2).Text() swdkllj.Text = ListView1.SelectedItems(0).SubItems(3).Text() denda.Text = ListView1.SelectedItems(0).SubItems(4).Text() tglbayar.Value = CDate(ListView1.SelectedItems(0).SubItems(5).Text()) End If nopol.Visible = True simpan.Enabled = False tambah.Enabled = True edit.Enabled = True hapus.Enabled = True bk1.Visible = False bk1.Enabled = False End Sub Private Sub tambah_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tambah.Click CmdClear_Click() simpan.Enabled = True tambah.Enabled = False edit.Enabled = False hapus.Enabled = False
Universitas Sumatera Utara
nopol.Visible = False bk1.Visible = True bk1.Enabled = True End Sub Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles keluar.Click 'End Me.Close() End Sub Private Sub pokokpkb_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles pokokpkb.Leave 'Dim x As Double 'x = 2 / 100 * pokokpkb.Text 'denda.Text = x End Sub End Class
FrmLaporanTransaksi.vb Public Class frmLaporanTransaksi Dim pokokpkb As Double Dim jenis As String Private Sub Data() _laporan
'Untuk mengisi objek lisview dengan record dari tabel
Dim conn = koneksi.konek() ' variabel global conn yg dipanggil dari fungi koneksi 'buat objek adapter Dim myadp As MySql.Data.MySqlClient.MySqlDataAdapter 'buat perintah query disini Dim query As String query = "Select * from tabel_laporan"
Try 'jalankan perintah baca myadp = New MySql.Data.MySqlClient.MySqlDataAdapter(query, conn) Catch ex As Exception MsgBox(ex.Message) End Try ListView1.Items.Clear() 'buat objek command Dim mycmd As New MySql.Data.MySqlClient.MySqlCommand(query, conn)
Universitas Sumatera Utara
'buat objek pembaca Dim myread As MySql.Data.MySqlClient.MySqlDataReader 'jalankan query dan isi ke reader myread = mycmd.ExecuteReader() 'cek keberadaan data If myread.HasRows = True Then While myread.Read Dim daftar As ListViewItem = ListView1.Items.Add(myread.GetString(0)) daftar.SubItems.Add(myread.GetString(1)) daftar.SubItems.Add(myread.GetString(2)) daftar.SubItems.Add(myread.GetString(3)) daftar.SubItems.Add(myread.GetString(4)) End While End If 'tutup myread myread.Close() End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles simpan.Click If (bk1.Text = "") Then MessageBox.Show("No Polisi tidak boleh kosong", "Gagal menambah data", MessageBoxButtons.OK, MessageBoxIcon.Error) End If Dim conn = koneksi.konek() ' variabel global conn yg dipanggil dari fungi koneksi Dim Str As String = "" Dim mycmd As New MySql.Data.MySqlClient.MySqlCommand("Insert Into tabel_laporan Values('" & Trim(bk1.Text) &_ "' , '" & Trim(tglbayar.Text) & _ "' , '" & Trim(tgljatuhtempo.Text) & _ "', '" & Trim(PERSEN.Text) & _ "','" & Trim(totalbayar.Text) & "')", conn) Try 'jalankan mycmd.ExecuteNonQuery() Catch ex As MySql.Data.MySqlClient.MySqlException MsgBox(ex.Message, "insert data gagal") End Try CmdClear_Click() bk1.Focus()
Universitas Sumatera Utara
Data() Exit Sub End Sub Private Sub CmdClear_Click() bk1.Text = "" tglbayar.Text = "" tgljatuhtempo.Text = "" PERSEN.Text = "" totalbayar.Text = "" End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles edit.Click Dim Q As String Q = MsgBox("Apakah Anda Ingin Mengubahnya?", MsgBoxStyle.YesNo) If Q = vbNo Then Exit Sub End If If Q = vbYes Then Dim conn = koneksi.konek() ' variabel global conn yg dipanggil dari fungi koneksi Dim mycmd As New MySql.Data.MySqlClient.MySqlCommand("Update tabel_Laporan Set TGL_bayar='" & Trim(tglbayar.Text) &_ "',TGL_JATUHTEMPO='" & Trim(tgljatuhtempo.Text) & _ "',DENDA='" & Trim(PERSEN.Text) & _ "',TOTAL_PEMBAYARAN='" & Trim(totalbayar.Text) & _ "' Where no_polisi='" & Trim(nopol.Text) & "'", conn) Try 'jalankan mycmd.ExecuteNonQuery() Catch ex As MySql.Data.MySqlClient.MySqlException MsgBox(ex.Message, "insert data gagal") End Try CmdClear_Click() bk1.Focus() simpan.Enabled = False edit.Enabled = False hapus.Enabled = False Data() End If End Sub
Universitas Sumatera Utara
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles hapus.Click Dim Q As String Q = MsgBox("Apakah Anda Ingin Menghapusnya?", MsgBoxStyle.YesNo) If Q = vbNo Then Exit Sub End If If Q = vbYes Then Dim conn = koneksi.konek() ' variabel global conn yg dipanggil dari fungi koneksi Dim mycmd As New MySql.Data.MySqlClient.MySqlCommand("Delete from tabel_laporan Where no_polisi = '" & Trim(nopol.Text) & "'", conn) Try 'jalankan mycmd.ExecuteNonQuery() Catch ex As MySql.Data.MySqlClient.MySqlException MsgBox("Input data gagal") End Try CmdClear_Click() bk1.Focus() simpan.Enabled = False edit.Enabled = True hapus.Enabled = False Data() End If End Sub
Private Sub ListView1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListView1.SelectedIndexChanged If ListView1.SelectedItems.Count > 0 Then nopol.Text = ListView1.SelectedItems(0).Text() tglbayar.Text = ListView1.SelectedItems(0).SubItems(1).Text() tgljatuhtempo.Text = ListView1.SelectedItems(0).SubItems(2).Text() PERSEN.Text = ListView1.SelectedItems(0).SubItems(3).Text() totalbayar.Text = ListView1.SelectedItems(0).SubItems(4).Text() End If nopol.Visible = True simpan.Enabled = False tambah.Enabled = True edit.Enabled = True hapus.Enabled = True
Universitas Sumatera Utara
bk1.Visible = False bk1.Enabled = False End Sub Private Sub frmLaporanTransaksi_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Data() simpan.Enabled = False edit.Enabled = False End Sub Private Sub tambah_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tambah.Click CmdClear_Click() simpan.Enabled = True tambah.Enabled = False edit.Enabled = False hapus.Enabled = False nopol.Visible = False bk1.Visible = True bk1.Enabled = True End Sub Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles keluar.Click 'End Me.Close() End Sub Private Sub tglbayar_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tglbayar.ValueChanged Dim xd Dim x As Double Dim persenx As Byte Dim xxxx xd = DateDiff(DateInterval.Month, tgljatuhtempo.Value, tglbayar.Value) 'MsgBox(xd) If xd > 13 Then x = 2 * 13 PERSEN.Text = x If xd > 25 Then x = 3 * 26 PERSEN.Text = x
Universitas Sumatera Utara
If xd > 49 Then x = 4 * 50 PERSEN.Text = x End If End If End If 'MsgBox(xd) 'MsgBox(xd / 2) 'MsgBox(pokokpkb) 'MsgBox(persenx) 'MsgBox((x / 100) * pokokpkb * persenx) DENDA.Text = (x / 100) * pokokpkb * 2 If jenis = "MOBIL" Then totalbayar.Text = Val(DENDA.Text) + pokokpkb + 100000 Else totalbayar.Text = Val(DENDA.Text) + pokokpkb + 32000 End If End Sub Private Sub bk1_Leave(ByVal sender As Object, ByVal e As System.EventArgs) Handles bk1.Leave Dim conn = koneksi.konek() ' variabel global conn yg dipanggil dari fungi koneksi 'buat objek adapter Dim myadp As MySql.Data.MySqlClient.MySqlDataAdapter 'buat perintah query disini Dim Str As String = "" 'MsgBox(Str) Dim query As String query = "Select * from tabel_pajak where no_polisi='" & bk1.Text & "'" Try 'jalankan perAintah baca myadp = New MySql.Data.MySqlClient.MySqlDataAdapter(query, conn) Catch ex As Exception MsgBox(ex.Message) End Try 'buat objek command Dim mycmd As New MySql.Data.MySqlClient.MySqlCommand(query, conn)
Universitas Sumatera Utara
'buat objek pembaca Dim myread As MySql.Data.MySqlClient.MySqlDataReader 'jalankan query dan isi ke reader myread = mycmd.ExecuteReader() 'cek keberadaan data If myread.HasRows = True Then While myread.Read pokokpkb = myread.GetString(2) 'MsgBox(pokokpkb) End While End If 'tutup myread myread.Close() query = "Select * from tabel_pemilikkendaraan where no_polisi='" & bk1.Text & "'" Try 'jalankan perintah baca myadp = New MySql.Data.MySqlClient.MySqlDataAdapter(query, conn) Catch ex As Exception MsgBox(ex.Message) End Try 'buat objek command Dim mycmd2 As New MySql.Data.MySqlClient.MySqlCommand(query, conn) 'buat objek pembaca Dim myread2 As MySql.Data.MySqlClient.MySqlDataReader 'jalankan query dan isi ke reader myread2 = mycmd2.ExecuteReader() 'cek keberadaan data If myread2.HasRows = True Then While myread2.Read jenis = myread2.GetString(4) End While End If 'tutup myread myread2.Close() tglbayar.Focus() End Sub End Class
Universitas Sumatera Utara