Aplikasi ini dibuat dengan tujuan mempermudah input data
untuk penagihan pajak, yang mana tidak mengharuskan kita menghitung dan
meng-input secara manual. Sehingga pada saat entry kita dapat langsung mencetak surat penagihan atau hanya sekedar menyimpan surat tersebut untuk
dapat digunakan kedepannya.
Source Code Loading/Opening :
Public Class FormOpening
Private Sub FormOpening_Load(sender As Object, e As EventArgs) Handles MyBase.Load
PictureBox1.Load("E:\Kuliah\Konsep Pemrograman Bisnis 2\UTS VB2\logo.png")
Timer1.Start()
End Sub
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
If ProgressBar1.Value < 100 Then
ProgressBar1.Value += 5
ElseIf ProgressBar1.Value = 100 Then
Timer1.Stop()
FormPajak.Show()
End If
End Sub
End Class
Source Code Form Pajak :
Public Class FormPajak
Dim AppWord As New
Microsoft.Office.Interop.Word.Application
Dim DocWord As
Microsoft.Office.Interop.Word.Document
Dim AppExcel As New
Microsoft.Office.Interop.Excel.Application
Dim BookExcel As
Microsoft.Office.Interop.Excel.Workbook
Private Sub BtnHitung_Click(sender As Object, e As EventArgs) Handles BtnHitung.Click
Dim GM As Integer = 10000000
Dim Manager As Integer = 7500000
Dim Supervisor As Integer = 5000000
Dim StaffAdm As Integer = 3000000
Dim Marketing As Integer = 2500000
'menghitung gaji
jabatan & tunjangan jabatan
If ComboJbtn.Text = "General Manager" Then
TxtGajiKotor.Text = GM
TxtTunjJab.Text = 5000000
ElseIf ComboJbtn.Text = "Manager" Then
TxtGajiKotor.Text = Manager
TxtTunjJab.Text = 4000000
ElseIf ComboJbtn.Text = "Supervisor" Then
TxtGajiKotor.Text = Supervisor
TxtTunjJab.Text = 3000000
ElseIf ComboJbtn.Text = "Staff
Administrasi"
Then
TxtGajiKotor.Text = StaffAdm
TxtTunjJab.Text = 2000000
Else
TxtGajiKotor.Text = Marketing
TxtTunjJab.Text = 1000000
End If
'menghitung
tunjangan istri
If ComboStatus.Text = "Menikah" And ComboJnsKlmn.Text = "Laki-laki" Then
TxtTunjIstri.Text = 1500000
Else
TxtTunjIstri.Text = 0
End If
'menghitung
tunjangan anak
If Rdbtn1anak.Checked = True Then
TxtTunjAnak.Text = 500000
ElseIf Rdbtn2anak.Checked = True Then
TxtTunjAnak.Text = 1000000
ElseIf Rdbtn3anak.Checked = True Then
TxtTunjAnak.Text = 1500000
Else
TxtTunjAnak.Text = 0
End If
'total tunjangan
TxtTotalTunj.Text = Val(TxtTunjJab.Text) + Val(TxtTunjIstri.Text) +
Val(TxtTunjAnak.Text)
'hitung pph 21
TxtPPh.Text = 0.15 * (Val(TxtTotalTunj.Text) + Val(TxtGajiKotor.Text))
'hitung gaji bersih
TxtGajiBersih.Text = Val(TxtGajiKotor.Text) + Val(TxtTotalTunj.Text) -
Val(TxtPPh.Text)
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
TxtAlamat.Text = ""
TxtGajiBersih.Text = ""
TxtGajiKotor.Text = ""
TxtNama.Text = ""
TxtPPh.Text = ""
TxtTotalTunj.Text = ""
TxtTunjAnak.Text = ""
TxtTunjIstri.Text = ""
TxtTunjJab.Text = ""
ComboJbtn.Text = ""
ComboJnsKlmn.Text = ""
ComboStatus.Text = ""
TxtNama.Focus()
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
'membuat file word
DocWord = AppWord.Documents.Open("E:\Kuliah\Konsep Pemrograman Bisnis 2\Surat
Tagihan.docx")
DocWord.Bookmarks("nama").Select()
AppWord.Selection.TypeText(TxtNama.Text)
DocWord.Bookmarks("jabatan").Select()
AppWord.Selection.TypeText(ComboJbtn.Text)
DocWord.Bookmarks("alamat").Select()
AppWord.Selection.TypeText(TxtAlamat.Text)
DocWord.Bookmarks("pajak").Select()
AppWord.Selection.TypeText(TxtPPh.Text)
DocWord.Bookmarks("gaji").Select()
AppWord.Selection.TypeText(TxtGajiBersih.Text)
DocWord.SaveAs2("E:\Kuliah\Konsep Pemrograman Bisnis 2\" + TxtNama.Text + ".docx")
AppWord.Visible = True
BookExcel = AppExcel.Workbooks.Open("E:\Kuliah\Konsep Pemrograman Bisnis 2\Arsip
Pajak.xlsx")
'mengisi form
AppExcel.Range("A2").Value
= TxtNama.Text
AppExcel.Range("B2").Value
= TxtAlamat.Text
AppExcel.Range("C2").Value
= ComboJbtn.Text
AppExcel.Range("D2").Value
= ComboStatus.Text
AppExcel.Range("E2").Value
= TxtGajiBersih.Text
AppExcel.Range("F2").Value
= TxtPPh.Text
'save di file baru
BookExcel.SaveAs("E:\Kuliah\Konsep Pemrograman Bisnis 2\" + TxtNama.Text + ".xlsx")
'menampilkan
AppExcel.Visible = True
End Sub
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
PictureBox1.Load("E:\Kuliah\Konsep Pemrograman Bisnis 2\UTS VB2\logo.png")
End Sub
End Class
Anda hanya
perlu mengisi nama s/d status dan jumlah anak saja, setelah itu anda bisa meng-klik button hitung lalu semua perhitungan akan
otomatis ditampilkan. Jika anda ingin meng-input data tersebut ke dalam bentuk surat penagihan dan sebagai arsip, anda hanya perlu meng-klik Entry.
Maka data akan segera terinput ke file surat dan arsip tersebut.
Input Data dan Perhitungan
Hasil dari Entry
Ok
BalasHapusterima kasih atas artikelnya,semoga selalu bermanfaat
BalasHapusmyblog