Jumat, 03 Juni 2016

PEMROGRAMAN BISNIS UAS


      Pada kali ini, saya akan menjelaskan pembuatan aplikasi untuk perhitumngan pajak yang langsung terhubung dengan excel
Designnya seperti diatas berisi 11 textbox, 1 combobox, 4 button , 1 openfiledialog, 1 listbox, dan 12 label. hanya 1 textbox yang berisi TRUE dan yang lainnya saya buat false agar proses penginputan tidak terlalu banyak. Langkah-langkahnya adalah memasukkan source code persis seperti dibawah ini
Public Class Form1
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim var1 As Object
        Dim var2 As Object
        Dim var3 As Object
        Dim var4 As Object
        Dim var5 As Object
        Dim var6 As Object
        Dim var7 As Object
        Dim var8 As Object
        Dim var9 As Object
        Dim var10 As Object
        Dim var11 As Object
        Dim var12 As Object
        Dim nofile As Short
        nofile = FreeFile()

        FileOpen(nofile, "lokasi file anda", OpenMode.Append)
        var1 = TextBox1.Text
        var2 = ComboBox1.Text
        var3 = TextBox2.Text
        var4 = TextBox3.Text
        var5 = TextBox4.Text
        var6 = TextBox5.Text
        var7 = TextBox6.Text
        var8 = TextBox7.Text
        var9 = TextBox8.Text
        var10 = TextBox9.Text
        var11 = TextBox10.Text
        var12 = TextBox11.Text

        ListBox1.Items.Add(var1 & "---" & var2 & "---" & var3 & "---" & var4 & "---" & var5 & "---" & var6 & "---" & var7 & "---" & var8 & "---" & var9 & "---" & var10 & "---" & var11 & "---" & var12 & "---")
        WriteLine(1, var1, var2, var3, var4, var5, var6, var7, var8, var9, var10, var11, var12)
        FileClose(1)
    End Sub

    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Dim var1 As Object
        Dim var2 As Object
        Dim var3 As Object
        Dim var4 As Object
        Dim var5 As Object
        Dim var6 As Object
        Dim var7 As Object
        Dim var8 As Object
        Dim var9 As Object
        Dim var10 As Object
        Dim var11 As Object
        Dim var12 As Object
        Dim nofile As Short
        nofile = FreeFile()
        FileOpen(nofile, "Lokasi file anda", OpenMode.Input)

        Do While Not EOF(nofile)
            Input(1, var1)
            Input(1, var2)
            Input(1, var3)
            Input(1, var4)
            Input(1, var5)
            Input(1, var6)
            Input(1, var7)
            Input(1, var8)
            Input(1, var9)
            Input(1, var10)
            Input(1, var11)

            ListBox1.Items.Add(var1 & "---" & var2 & "---" & var3 & "---" & var4 & "---" & var5 & "---" & var6 & "---" & var7 & "---" & var8 & "---" & var9 & "---" & var10 & "---" & var11 & "---" & var12 & "---")
        Loop
        FileClose(nofile)
    End Sub

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

        If ComboBox1.Text = 1 Then
            TextBox2.Text = 50000000
            TextBox3.Text = 5000000
            TextBox4.Text = 5000000
            TextBox5.Text = 1000000
            TextBox6.Text = 1500000
            TextBox7.Text = 500000
            TextBox8.Text = 2000000
            TextBox9.Text = Val(TextBox2.Text) + Val(TextBox3.Text) + Val(TextBox4.Text) + Val(TextBox5.Text) + Val(TextBox6.Text) + Val(TextBox7.Text) + Val(TextBox8.Text)
            TextBox10.Text = TextBox9.Text * 0.3
            TextBox11.Text = Val(TextBox9.Text) - Val(TextBox10.Text)
        ElseIf ComboBox1.Text = 2 Then
            TextBox2.Text = 40000000
            TextBox3.Text = 4000000
            TextBox4.Text = 4000000
            TextBox5.Text = 800000
            TextBox6.Text = 1200000
            TextBox7.Text = 450000
            TextBox8.Text = 1800000
            TextBox9.Text = Val(TextBox2.Text) + Val(TextBox3.Text) + Val(TextBox4.Text) + Val(TextBox5.Text) + Val(TextBox6.Text) + Val(TextBox7.Text) + Val(TextBox8.Text)
            TextBox10.Text = TextBox9.Text * 0.25
            TextBox11.Text = Val(TextBox9.Text) - Val(TextBox10.Text)
        ElseIf ComboBox1.Text = 3 Then
            TextBox2.Text = 30000000
            TextBox3.Text = 3000000
            TextBox4.Text = 3000000
            TextBox5.Text = 600000
            TextBox6.Text = 1000000
            TextBox7.Text = 400000
            TextBox8.Text = 1500000
            TextBox9.Text = Val(TextBox2.Text) + Val(TextBox3.Text) + Val(TextBox4.Text) + Val(TextBox5.Text) + Val(TextBox6.Text) + Val(TextBox7.Text) + Val(TextBox8.Text)
            TextBox10.Text = TextBox9.Text * 0.2
            TextBox11.Text = Val(TextBox9.Text) - Val(TextBox10.Text)
        ElseIf ComboBox1.Text = 4 Then
            TextBox2.Text = 20000000
            TextBox3.Text = 2000000
            TextBox4.Text = 2000000
            TextBox5.Text = 500000
            TextBox6.Text = 1000000
            TextBox7.Text = 350000
            TextBox8.Text = 1250000
            TextBox9.Text = Val(TextBox2.Text) + Val(TextBox3.Text) + Val(TextBox4.Text) + Val(TextBox5.Text) + Val(TextBox6.Text) + Val(TextBox7.Text) + Val(TextBox8.Text)
            TextBox10.Text = TextBox9.Text * 0.25
            TextBox11.Text = Val(TextBox9.Text) - Val(TextBox10.Text)
        ElseIf ComboBox1.Text = 5 Then
            TextBox2.Text = 10000000
            TextBox3.Text = 1000000
            TextBox4.Text = 1000000
            TextBox5.Text = 450000
            TextBox6.Text = 900000
            TextBox7.Text = 300000
            TextBox8.Text = 1000000
            TextBox9.Text = Val(TextBox2.Text) + Val(TextBox3.Text) + Val(TextBox4.Text) + Val(TextBox5.Text) + Val(TextBox6.Text) + Val(TextBox7.Text) + Val(TextBox8.Text)
            TextBox10.Text = TextBox9.Text * 0.25
            TextBox11.Text = Val(TextBox9.Text) - Val(TextBox10.Text)
        End If

    End Sub

    Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
        TextBox1.Text = ""
        TextBox2.Text = ""
        TextBox3.Text = ""
        TextBox4.Text = ""
        TextBox5.Text = ""
        TextBox6.Text = ""
        TextBox7.Text = ""
        TextBox8.Text = ""
        TextBox9.Text = ""
        TextBox10.Text = ""
        TextBox11.Text = ""
        ComboBox1.Text = ""
        TextBox1.Focus()
    End Sub

    Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
        Dim pesan As Integer

        pesan = MsgBox("SELESAI", vbInformation + vbYesNoCancel, "KELUAR")
        If pesan = vbYes Then
            Me.Close()
        End If
    End Sub
End Class

untuk lokasi file anda sendiri, buat file berupa excel dengan format CSV(Comma Delimeted) yang kemudian lokasinya di pastekan di bagian source code diatas. Excel yang saya buat adalah seperti ini:
Untuk buttonnya sendiri, apabila anda menekan tombol mulai akan mengosongkan form, apabila menekan button simpan form akan tersimpan di excel, apabila tekan proses form akan memproses segala perhitungan gaji dan PPh anda, dan apabila menekan selesai anda akan keluar dari form tersebut. berikut adalah videonya agar anda lebih jelas:



Terimas Kasih, Semoga bermanfaat
Lanang Pangestu
1506761034