Vb.net Billing Software Source Code -
Public Class frmMain Private Sub btnBilling_Click(sender As Object, e As EventArgs) Handles btnBilling.Click Dim billing As New frmBilling() billing.ShowDialog() End SubPrivate Sub btnProducts_Click(sender As Object, e As EventArgs) Handles btnProducts.Click Dim products As New frmProducts() products.ShowDialog() End Sub Private Sub btnCustomers_Click(sender As Object, e As EventArgs) Handles btnCustomers.Click Dim customers As New frmCustomers() customers.ShowDialog() End Sub Private Sub btnReports_Click(sender As Object, e As EventArgs) Handles btnReports.Click Dim reports As New frmReports() reports.ShowDialog() End Sub Private Sub frmMain_Load(sender As Object, e As EventArgs) Handles MyBase.Load lblUser.Text = "Welcome, " & Environment.UserName lblDateTime.Text = DateTime.Now.ToString() ' Timer for real-time clock Timer1.Start() End Sub Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick lblDateTime.Text = DateTime.Now.ToString() End Sub
End Class
In frm_Billing.vb, a DataGridView acts as the cart. The user scans a barcode or selects a product, and it is added to the cart.
Private Sub AddProductToCart(productID As Integer, qty As Integer) 'Fetch product details from database using productID Dim query As String = "SELECT ProductName, SellingPrice, GST_Percent FROM tbl_Products WHERE ProductID = " & productID Using conn As SqlConnection = getConnection() conn.Open() Using cmd As New SqlCommand(query, conn) Dim reader As SqlDataReader = cmd.ExecuteReader() If reader.Read() Then Dim productName As String = reader("ProductName").ToString() Dim price As Decimal = Convert.ToDecimal(reader("SellingPrice")) Dim gstPercent As Integer = Convert.ToInt32(reader("GST_Percent"))'Add row to DataGridView (dgvCart) dgvCart.Rows.Add(productID, productName, qty, price, qty * price, gstPercent) CalculateTotal() 'Update subtotal, tax, grand total End If End Using End UsingEnd Sub
Private Sub CalculateTotal() Dim subTotal As Decimal = 0 For Each row As DataGridViewRow In dgvCart.Rows subTotal += Convert.ToDecimal(row.Cells("Total").Value) Next
'Assuming GST is calculated on SubTotal (simplified) Dim gstAmount As Decimal = (subTotal * 18) / 100 '18% GST Dim grandTotal As Decimal = subTotal + gstAmount lblSubTotal.Text = subTotal.ToString("C") 'C = Currency format lblTax.Text = gstAmount.ToString("C") lblGrandTotal.Text = grandTotal.ToString("C")
End Sub
Are you tired of the monthly subscription fees of QuickBooks? Frustrated that your current invoicing software doesn’t quite fit your specific business workflow?
Every business owner reaches a breaking point where they think, "I could build this myself." If you are a developer or a tech-savvy entrepreneur, diving into VB.NET billing software source code might be the best business decision you make this year.
In this post, we’re going to explore why legacy tech isn’t dead, where to find the right source code, and how customizing your own billing engine can save you thousands of dollars.
If you go hunting for source code on platforms like CodeProject, GitHub, or CodeCanyon, don’t just download the first zip file you see. Look for these critical features to ensure the code is modern and maintainable:
1. 3-Tier Architecture Ensure the code separates the logic. You want a Data Access Layer (DAL), a Business Logic Layer (BLL), and a Presentation Layer. This makes it easier to update the UI without breaking the database calculations.
2. SQL Server Backend While Access databases are common in older VB projects, you want a source code that utilizes Microsoft SQL Server. It handles large volumes of transactions and ensures your data integrity—crucial for financial records. vb.net billing software source code
3. Clean Reporting Tools The heart of billing software is the report. Look for projects using RDLC (Report Definition Language Client) or Crystal Reports. If the source code includes a "Drag and Drop" report designer, that’s a huge bonus.
Private Sub btnAddProduct_Click(sender As Object, e As EventArgs) Handles btnAddProduct.Click
Try
OpenDB()
Dim query As String = "INSERT INTO tbl_Product (ProductCode, ProductName, Unit, SellingPrice, GST_Percent, StockQuantity)
VALUES (@code, @name, @unit, @price, @gst, @stock)"
cmd = New SqlCommand(query, conn)
cmd.Parameters.AddWithValue("@code", txtCode.Text)
cmd.Parameters.AddWithValue("@name", txtName.Text)
cmd.Parameters.AddWithValue("@unit", cmbUnit.Text)
cmd.Parameters.AddWithValue("@price", Convert.ToDecimal(txtPrice.Text))
cmd.Parameters.AddWithValue("@gst", Convert.ToDecimal(txtGST.Text))
cmd.Parameters.AddWithValue("@stock", Convert.ToDecimal(txtStock.Text))
cmd.ExecuteNonQuery()
MessageBox.Show("Product saved successfully.")
LoadProductsDataGrid()
Catch ex As Exception
MessageBox.Show("Error: " & ex.Message)
Finally
CloseDB()
End Try
End Sub
-- Create Database CREATE DATABASE BillingSystem; GOUSE BillingSystem; GO
-- Products Table CREATE TABLE Products ( ProductID INT PRIMARY KEY IDENTITY(1,1), ProductCode NVARCHAR(50) UNIQUE NOT NULL, ProductName NVARCHAR(100) NOT NULL, Category NVARCHAR(50), UnitPrice DECIMAL(10,2) NOT NULL, StockQuantity INT NOT NULL DEFAULT 0, GSTPercentage DECIMAL(5,2) DEFAULT 0, CreatedDate DATETIME DEFAULT GETDATE() );
-- Customers Table CREATE TABLE Customers ( CustomerID INT PRIMARY KEY IDENTITY(1,1), CustomerName NVARCHAR(100) NOT NULL, PhoneNumber NVARCHAR(15), Email NVARCHAR(100), Address NVARCHAR(255), CreatedDate DATETIME DEFAULT GETDATE() );
-- Invoices Table CREATE TABLE Invoices ( InvoiceID INT PRIMARY KEY IDENTITY(1,1), InvoiceNumber NVARCHAR(20) UNIQUE NOT NULL, CustomerID INT FOREIGN KEY REFERENCES Customers(CustomerID), InvoiceDate DATETIME DEFAULT GETDATE(), SubTotal DECIMAL(10,2), GSTAmount DECIMAL(10,2), TotalAmount DECIMAL(10,2), PaymentMethod NVARCHAR(50), Status NVARCHAR(20) DEFAULT 'Pending' );
-- Invoice Items Table CREATE TABLE InvoiceItems ( ItemID INT PRIMARY KEY IDENTITY(1,1), InvoiceID INT FOREIGN KEY REFERENCES Invoices(InvoiceID), ProductID INT FOREIGN KEY REFERENCES Products(ProductID), Quantity INT NOT NULL, UnitPrice DECIMAL(10,2), TotalPrice DECIMAL(10,2), GSTAmount DECIMAL(10,2) );End Class
VB.NET billing software source code offers a practical, customizable foundation for desktop invoicing systems. Whether you run a retail store, a wholesale distributor, or a service center, VB.NET gives you full control over your billing logic, tax calculations, and reporting—without recurring subscription fees.
Start with a clean database schema, implement the core billing loop, and then incrementally add features like printing, barcodes, and customer history. With the code examples provided above, you can build a production-ready billing system in weeks, not months.
Remember: the best source code is the one you understand and can modify. Download a working project, dissect its Form_Load, CalculateTotals, and SaveInvoice methods, and tailor it to your local tax laws and workflow.
Call to Action: