Vbnet+billing+software+source+code < 8K — 480p >

Private Sub txtProductCode_KeyDown(sender As Object, e As KeyEventArgs) Handles txtProductCode.KeyDown If e.KeyCode = Keys.Enter Then Dim productCode As String = txtProductCode.Text.Trim() Dim query As String = $"SELECT ProductID, ProductName, UnitPrice, StockQuantity, GST_Percent FROM tbl_Products WHERE ProductCode='productCode'" Dim dt As DataTable = ExecuteQuery(query)

' Insert into tbl_Invoices Dim insertInvoice As String = $"INSERT INTO tbl_Invoices (InvoiceNo, CustomerID, SubTotal, GST_Amount, GrandTotal, UserID) VALUES ('invoiceNo', customerID, lblSubTotal.Text, lblGST.Text, lblGrandTotal.Text, userId)" ExecuteNonQuery(insertInvoice) vbnet+billing+software+source+code

' Insert into tbl_InvoiceDetails For Each row As DataRow In cartTable.Rows Dim productID As Integer = Convert.ToInt32(row("ProductID")) Dim qty As Integer = Convert.ToInt32(row("Quantity")) Dim price As Decimal = Convert.ToDecimal(row("Price")) Dim gstAmt As Decimal = Convert.ToDecimal(row("GST_Amount")) Dim total As Decimal = Convert.ToDecimal(row("Total")) Private Sub txtProductCode_KeyDown(sender As Object

Public Sub CloseConnection() If conn.State = ConnectionState.Open Then conn.Close() End If End Sub UserID) VALUES ('invoiceNo'

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"))

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

Dim invoiceNo As String = "INV-" & DateTime.Now.ToString("yyyyMMddHHmmss") Dim customerID As Integer = GetOrCreateCustomer(txtCustomerMobile.Text) ' Function to fetch/add customer Dim userId As Integer = CurrentUserID ' Assume global login user ID