Buat Program Inventory + Akuntansi pada VB.NET

Program yang saya coba buat kali ini tentang Inventory atau Penjualan/Pembelian serta Stok barangnya. Semua Transaksi nya bisa langsung di Jurnal kan sesuai kebutuhan akuntansi😀
Berikut Contoh Coding dari transaksi jual / beli langsung bisa dijurnalkan…

Public Class classcontrol

Function dml(ByVal query As String) As Boolean
Dim sukses As Boolean = False
xcom.Connection = xcon
xcon.Open()
xcom.CommandText = query
xcom.CommandType = CommandType.Text
Try
xcom.ExecuteNonQuery()
sukses = True
Catch ex As Exception
MessageBox.Show(ex.Message)
MsgBox(query)
Finally
xcon.Close()
End Try
Return sukses
End Function
End Class

Public klsktrl As New classcontrol

Private Sub cmdSimpan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdSimpan.Click
If klsktrl.dml(“INSERT INTO nOTA_jUAL VALUES(‘” & txtNoNota.Text & “‘,'” & UserLogin & “‘,'” & txtMember.Text & “‘,'” & txtNMMember.Text & “‘,'” & dtpTgl.Value & “‘,'” & txtTotal.Text & “‘)”) = True Then

For i = 0 To lstKode.Items.Count – 1

klsktrl.dml(“INSERT INTO DETAIL_jUAL VALUES(‘” & txtNoNota.Text & “‘,'” & lstKode.Items.Item(i) & “‘,'” & lstNama.Items.Item(i) & “‘,'” & lstjumlah.Items.Item(i) & “‘,'” & lstHarga.Items.Item(i) & “‘, ‘” & lstDisc.Items.Item(i) & “‘,'” & lstSubtotal.Items.Item(i) & “‘)”)
klsktrl.dml(“INSERT INTO KARTU_STOK VALUES (‘” & dtpTgl.Value.ToString(“d”) & “‘,'” & lstKode.Items.Item(i) & “‘,0,'” & lstjumlah.Items.Item(i) & “‘ )”)
klsktrl.dml(“Update Master_Barang set stok=STOK – ‘” & CInt(lstjumlah.Items.Item(i)) & “‘ where kode_brg='” & lstKode.Items.Item(i) & “‘”)

Next
MessageBox.Show(“Data Penjualan Telah DiSimpan”, “INFORMASI”, MessageBoxButtons.OK, MessageBoxIcon.Information)

‘MENYIMPAN ke JURNAL
Sql = “insert Into Jurnal values (‘” & txtNoJurnal.Text & “‘,'” & Date.Now.ToShortDateString & “‘,'” & txtNoNota.Text & “‘,’Penjualan ‘ + ‘ ” & “TUNAI” & ” ‘ + ‘ ” & txtNMMember.Text & ” ‘ )”
klsktrl.dml(Sql)

‘111002 => Kas Keuangan
‘411001 => Penjualan
Sql = “insert Into detailJurnal values (‘” & txtNoJurnal.Text & “‘,’111002’,” & (“0” & txtTotal.Text) & “,0)” ‘DEBET
klsktrl.dml(Sql)
Sql = “insert Into detailJurnal values (‘” & txtNoJurnal.Text & “‘,’411001’,0,” & (“0” & txtTotal.Text) & “)” ‘KREDIT
klsktrl.dml(Sql)

Else
MessageBox.Show(“Data Penjualan Gagal DiSimpan”, “INFORMASI”, MessageBoxButtons.OK, MessageBoxIcon.Information)
End If

End Sub

3 Tanggapan

  1. koq gitu doank ya mas??trus databasenya gmana??

  2. nanggung amat pah ngasih ilmunya, saya mau dong belajar

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s

%d blogger menyukai ini: