Vb.net Billing Software Source Code 【TRENDING · SECRETS】
ProductID (AutoNumber, PK) ProductName (Text) HSN (Text) Price (Currency)
Private Sub btnPrint_Click(sender As Object, e As EventArgs) Handles btnPrint.Click PrintDocument1.Print() End Sub
Public Sub New(billID As Integer) InitializeComponent() Me.billID = billID LoadBillData() End Sub
' Save Customer Dim custID As Integer = SaveCustomer(txtCustomerName.Text, txtMobile.Text, txtGSTIN.Text) vb.net billing software source code
ItemID (AutoNumber, PK) BillID (Number) ProductID (Number) Quantity (Number) Price (Currency) Total (Currency) Note : This is a working minimal example. Add error handling, data validation, and DB connection string as needed. 1. Main Form – frmBilling.vb Imports System.Data.OleDb Public Class frmBilling
Dim taxRate As Decimal = 5.0 ' 5% GST Dim taxAmount As Decimal = subtotal * (taxRate / 100) Dim discount As Decimal = nudDiscount.Value Dim grandTotal As Decimal = subtotal + taxAmount - discount
Private Sub CalculateTotals() Dim subtotal As Decimal = 0 For Each row As DataGridViewRow In dgvItems.Rows If Not row.IsNewRow Then subtotal += CDec(row.Cells("colTotal").Value) End If Next Main Form – frmBilling
Private Sub LoadBillData() ' Fetch Bill Header and Items using billID from DB ' (Implement using OleDbDataAdapter) ' Then bind to PrintDocument End Sub
' Save Bill Items For Each row As DataGridViewRow In dgvItems.Rows If Not row.IsNewRow Then SaveBillItem(billID, CInt(row.Cells("colProductID").Value), CInt(row.Cells("colQty").Value), CDec(row.Cells("colPrice").Value), CDec(row.Cells("colTotal").Value)) End If Next
Private Sub btnAddItem_Click(sender As Object, e As EventArgs) Handles btnAddItem.Click If cboProduct.SelectedValue Is Nothing Then Exit Sub Dim productID As Integer = CInt(cboProduct.SelectedValue) Dim productName As String = cboProduct.Text Dim qty As Integer = CInt(nudQuantity.Value) Dim price As Decimal = GetProductPrice(productID) Dim total As Decimal = price * qty txtGSTIN.Text) ItemID (AutoNumber
Private Sub frmBilling_Load(sender As Object, e As EventArgs) Handles MyBase.Load LoadProductsIntoCombo() ResetBill() End Sub
lblSubtotal.Text = subtotal.ToString("N2") lblTax.Text = taxAmount.ToString("N2") lblDiscount.Text = discount.ToString("N2") lblGrandTotal.Text = grandTotal.ToString("N2") End Sub

