Vbnet+billing+software+source+code -

Fast to customize – You want a new field on the invoice form? Open the designer, add a textbox, tweak the database table, and you're done. VB.NET + ADO.NET is incredibly direct.

Great for learning – If you’re a student or junior dev, studying this code teaches practical CRUD operations, event handling, and report generation without the complexity of modern frameworks.

Local-first – No internet needed. Great for small shops, warehouses, or rural businesses.

Printing & Barcodes – Many examples include direct printer support or barcode generation (e.g., using Graphics.DrawString or free barcode fonts). vbnet+billing+software+source+code

This section provides source code snippets demonstrating the core functionality using VB.NET and ADO.NET.

While this article provides the complete logic, I recommend you type every line yourself to understand the flow. Only by debugging will you master billing software architecture.

If you need the complete Visual Studio solution (including SQL scripts, forms, and modules), many GitHub repositories offer open-source VB.NET billing projects. Search for "vbnet billing software source code github". ✅ Fast to customize – You want a

| Feature | Typical Quality | Notes | |--------|----------------|-------| | Invoice creation | ✅ Good | Usually works out of box | | Tax calculation | ✅ Good | Fixed formulas, may lack special cases | | Customer management | ✅ Basic | Works for small scale | | Inventory tracking | ⚠️ Basic | Often deducts stock locally, no batch/lot | | Backup/Restore | ❌ Rare | Often missing or manual file copy | | Multi-user support | ❌ Risky | No transaction handling in most free code |


Note: This paper presents a simplified educational model. Production environments would require enhanced error logging, user authentication encryption, and potentially a migration to WPF or a Web API backend.


Imports System.Data.SqlClient

Public Class frmInvoice Private dtDetails As New DataTable() Note: This paper presents a simplified educational model

Private Sub frmInvoice_Load(sender As Object, e As EventArgs) Handles MyBase.Load
    txtInvoiceDate.Text = DateTime.Now.ToString("yyyy-MM-dd")
    LoadInvoiceNumber()
    LoadCustomers()
    InitializeDetailsGrid()
End Sub
Private Sub LoadInvoiceNumber()
    Dim query As String = "SELECT ISNULL(MAX(CAST(SUBSTRING(InvoiceNo, 3, LEN(InvoiceNo)) AS INT)), 0) + 1 FROM tbl_Invoice_Master WHERE InvoiceNo LIKE 'IN%'"
    Dim nextNum As Integer = Convert.ToInt32(ExecuteScalar(query))
    txtInvoiceNo.Text = "IN" & nextNum.ToString("D6")
End Sub
Private Sub LoadCustomers()
    Dim dt As DataTable = GetDataTable("SELECT CustomerID, CustomerName FROM tbl_Customers")
    cmbCustomer.DisplayMember = "CustomerName"
    cmbCustomer.ValueMember = "CustomerID"
    cmbCustomer.DataSource = dt
End Sub
Private Sub InitializeDetailsGrid()
    dtDetails.Columns.Add("ProductID", GetType(Integer))
    dtDetails.Columns.Add("ProductName", GetType(String))
    dtDetails.Columns.Add("Quantity", GetType(Decimal))
    dtDetails.Columns.Add("Rate", GetType(Decimal))
    dtDetails.Columns.Add("TaxableValue", GetType(Decimal))
    dtDetails.Columns.Add("CGST", GetType(Decimal))
    dtDetails.Columns.Add("SGST", GetType(Decimal))
    dgvDetails.DataSource = dtDetails
End Sub
Private Sub btnAddProduct_Click(sender As Object, e As EventArgs) Handles btnAddProduct.Click
    ' Assume a popup product search form returns selected product
    Dim frm As New frmProductSearch()
    If frm.ShowDialog() = DialogResult.OK Then
        Dim newRow As DataRow = dtDetails.NewRow()
        newRow("ProductID") = frm.SelectedProductID
        newRow("ProductName") = frm.SelectedProductName
        newRow("Quantity") = 1
        newRow("Rate") = frm.Rate
        ' Tax calculation will be done row-by-row based on GST%
        Dim gstPercent As Decimal = frm.GSTPercent
        Dim taxable As Decimal = newRow("Quantity") * newRow("Rate")
        newRow("TaxableValue") = taxable
        newRow("CGST") = Math.Round(taxable * (gstPercent / 100) / 2, 2)
        newRow("SGST") = Math.Round(taxable * (gstPercent / 100) / 2, 2)
        dtDetails.Rows.Add(newRow)
        CalculateTotals()
    End If
End Sub
Private Sub CalculateTotals()
    Dim subTotal As Decimal = 0
    Dim totalCGST As Decimal = 0
    Dim totalSGST As Decimal = 0
For Each row As DataRow In dtDetails.Rows
        subTotal += CDec(row("TaxableValue"))
        totalCGST += CDec(row("CGST"))
        totalSGST += CDec(row("SGST"))
    Next
lblSubtotal.Text = subTotal.ToString("N2")
    lblTotalCGST.Text = totalCGST.ToString("N2")
    lblTotalSGST.Text = totalSGST.ToString("N2")
    lblGrandTotal.Text = (subTotal + totalCGST + totalSGST).ToString("N2")
End Sub
Private Sub btnSaveInvoice_Click(sender As Object, e As EventArgs) Handles btnSaveInvoice.Click
    If dtDetails.Rows.Count = 0 Then
        MessageBox.Show("Add at least one product")
        Return
    End If
Using conn As New SqlConnection(ConnectionString)
        conn.Open()
        Dim transaction = conn.BeginTransaction()
Try
            ' Insert into Invoice Master
            Dim masterCmd As New SqlCommand("INSERT INTO tbl_Invoice_Master (InvoiceNo, InvoiceDate, CustomerID, SubTotal, TotalCGST, TotalSGST, GrandTotal) VALUES (@invNo, @date, @custId, @sub, @cgst, @sgst, @grand)", conn, transaction)
            masterCmd.Parameters.AddWithValue("@invNo", txtInvoiceNo.Text)
            masterCmd.Parameters.AddWithValue("@date", Convert.ToDateTime(txtInvoiceDate.Text))
            masterCmd.Parameters.AddWithValue("@custId", cmbCustomer.SelectedValue)
            masterCmd.Parameters.AddWithValue("@sub", CDec(lblSubtotal.Text))
            masterCmd.Parameters.AddWithValue("@cgst", CDec(lblTotalCGST.Text))
            masterCmd.Parameters.AddWithValue("@sgst", CDec(lblTotalSGST.Text))
            masterCmd.Parameters.AddWithValue("@grand", CDec(lblGrandTotal.Text))
            masterCmd.ExecuteNonQuery()
' Insert Details
            For Each row As DataRow In dtDetails.Rows
                Dim detailCmd As New SqlCommand("INSERT INTO tbl_Invoice_Details (InvoiceNo, ProductID, Quantity, Rate, TaxableValue, CGST_Amount, SGST_Amount) VALUES (@invNo, @pid, @qty, @rate, @taxable, @cgst, @sgst)", conn, transaction)
                detailCmd.Parameters.AddWithValue("@invNo", txtInvoiceNo.Text)
                detailCmd.Parameters.AddWithValue("@pid", row("ProductID"))
                detailCmd.Parameters.AddWithValue("@qty", row("Quantity"))
                detailCmd.Parameters.AddWithValue("@rate", row("Rate"))
                detailCmd.Parameters.AddWithValue("@taxable", row("TaxableValue"))
                detailCmd.Parameters.AddWithValue("@cgst", row("CGST"))
                detailCmd.Parameters.AddWithValue("@sgst", row("SGST"))
                detailCmd.ExecuteNonQuery()
            Next
transaction.Commit()
            MessageBox.Show("Invoice Saved Successfully!")
            Me.Close()
        Catch ex As Exception
            transaction.Rollback()
            MessageBox.Show("Error: " & ex.Message)
        End Try
    End Using
End Sub

End Class

After mastering the basic vbnet billing software source code, consider adding:

Billing software is data-heavy. Look for a project that uses SQL Server (Express or Standard). The code should demonstrate:

Contact Info

Mon - Sat : 9:00 -18:00
+91 762 1002001
info@sakrat.com

Office Address

2nd & 3rd floor, Matruchhaya Complex, Jahangirpura, Surat, Gujarat, India