Vbnet+billing+software+source+code May 2026

If dt.Rows.Count > 0 Then Dim productID As Integer = dt.Rows(0)("ProductID") Dim pName As String = dt.Rows(0)("ProductName") Dim price As Decimal = Convert.ToDecimal(dt.Rows(0)("UnitPrice")) Dim gstPercent As Integer = Convert.ToInt32(dt.Rows(0)("GST_Percent"))

' Check if already in cart Dim existingRow() As DataRow = cartTable.Select($"ProductID = productID") If existingRow.Length > 0 Then existingRow(0)("Quantity") += 1 Dim qty As Integer = Convert.ToInt32(existingRow(0)("Quantity")) Dim totalBeforeGST As Decimal = qty * price Dim gstAmt As Decimal = totalBeforeGST * (gstPercent / 100) existingRow(0)("GST_Amount") = gstAmt existingRow(0)("Total") = totalBeforeGST + gstAmt Else Dim gstAmt As Decimal = price * (gstPercent / 100) Dim totalWithGST As Decimal = price + gstAmt cartTable.Rows.Add(productID, pName, 1, price, gstPercent, gstAmt, totalWithGST) End If CalculateTotals() txtProductCode.Clear() txtProductCode.Focus() Else MessageBox.Show("Product not found!") End If End If End Sub vbnet+billing+software+source+code

Private WithEvents pd As New Printing.PrintDocument Private invoiceContent As String Private Sub PrintInvoice(ByVal invNo As String) ' Build invoice text Dim sb As New System.Text.StringBuilder() sb.AppendLine(" MY BILLING SOFTWARE ") sb.AppendLine("--------------------------") sb.AppendLine($"Invoice No: invNo") sb.AppendLine($"Date: DateTime.Now") sb.AppendLine("--------------------------") sb.AppendLine("Item Qty Price Total") For Each row As DataRow In cartTable.Rows sb.AppendLine($"row("ProductName") row("Quantity") row("Price") row("Total")") Next sb.AppendLine("--------------------------") sb.AppendLine($"Grand Total: lblGrandTotal.Text") sb.AppendLine("--------------------------") sb.AppendLine(" Thank you! ") Public Sub CloseConnection() If conn

Private Sub pd_PrintPage(sender As Object, e As Printing.PrintPageEventArgs) Handles pd.PrintPage Dim font As New Font("Courier New", 10) Dim yPos As Single = 10 Dim leftMargin As Single = e.MarginBounds.Left Dim lines As String() = invoiceContent.Split(Environment.NewLine) If dt.Rows.Count &gt

Private Sub CalculateTotals() Dim subTotal As Decimal = 0 Dim totalGST As Decimal = 0 For Each row As DataRow In cartTable.Rows subTotal += Convert.ToDecimal(row("Price")) * Convert.ToInt32(row("Quantity")) totalGST += Convert.ToDecimal(row("GST_Amount")) Next Dim grandTotal As Decimal = subTotal + totalGST lblSubTotal.Text = subTotal.ToString("N2") lblGST.Text = totalGST.ToString("N2") lblGrandTotal.Text = grandTotal.ToString("N2") currentGrandTotal = grandTotal End Sub

Introduction In the world of small to medium-sized retail businesses, supermarkets, and restaurants, billing software is the backbone of daily operations. While cloud-based solutions are popular, desktop applications built with VB.NET and SQL Server (or MS Access) remain highly relevant due to their speed, offline accessibility, and low cost of ownership.

Public Sub CloseConnection() If conn.State = ConnectionState.Open Then conn.Close() End If End Sub