Vb.net: Billing Software Source Code [top]

Creating billing software in is a common academic and professional project used to manage sales, inventory, and customer records. It typically involves a desktop application built on the .NET Framework Windows Forms for the interface and a database like SQL Server for data storage. Core Modules of a Billing System

Public Class BillingForm Private Sub btnGenerateInvoice_Click(sender As Object, e As EventArgs) Handles btnGenerateInvoice.Click ' Define the file path (e.g., on the Desktop) Dim filePath As String = Path.Combine(My.Computer.FileSystem.SpecialDirectories.Desktop, "Invoice.txt") vb.net billing software source code

Public Class frmBilling Private dtCart As New DataTable() Private currentInvoiceNumber As String = "" Creating billing software in is a common academic

Public Class clsBillingEngine
    Public Function CalculateLineTotal(quantity As Integer, price As Decimal, gstPercent As Decimal) As Decimal
        Dim subtotal = quantity * price
        Dim gstAmount = subtotal * (gstPercent / 100)
        Return subtotal + gstAmount
    End Function
Public Function CalculateInvoiceTotal(dt As DataTable) As Dictionary(Of String, Decimal)
    Dim subTotal As Decimal = 0
    Dim totalGST As Decimal = 0
    For Each row As DataRow In dt.Rows
        Dim qty = Convert.ToDecimal(row("Quantity"))
        Dim price = Convert.ToDecimal(row("Price"))
        Dim gst = Convert.ToDecimal(row("GST_Percent"))
        Dim lineSub = qty * price
        subTotal += lineSub
        totalGST += lineSub * (gst / 100)
    Next
    Dim result As New Dictionary(Of String, Decimal)
    result.Add("SubTotal", subTotal)
    result.Add("TotalGST", totalGST)
    result.Add("GrandTotal", subTotal + totalGST)
    Return result
End Function