Friday, 7 June 2019

How to create Simple Billing Invoice in VB.NET

How to create Simple Billing Invoice in VB.NET

how to create invoice in vb.net...

Drag & Drop 16 TextBox Control ,10  Label and 1 Button control .

invoice
Invoice Form screenshot

Source code:



       

           Public Class Form1



    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        ' Declaring the quantity to buy

        Dim qtyone As Decimal

        Dim qtytwo As Decimal

        Dim qtythree As Decimal



        ' Declaring the item that you are going to buy

        Dim itemone As String

        Dim itemtwo As String

        Dim itemthree As String





        'Declaring the price for 1 item

        Dim unitpriceone As Decimal

        Dim unitpricetwo As Decimal

        Dim unitpricethree As Decimal



        ' Declaring the price for each one

        Dim priceunitone As Decimal

        Dim priceunittwo As Decimal

        Dim priceunitthree As Decimal



        ' the total calculation everything added

        Dim total As Decimal



        

        ' setting the quantity to be in those textboxes

        qtyone = Val(TextBox1.Text)

        qtytwo = Val(TextBox2.Text)

        qtythree = Val(TextBox3.Text)



        ' setting the items to be in those textboxes

        itemone = TextBox8.Text

        itemtwo = TextBox9.Text

        itemthree = TextBox10.Text



        ' setting the price/ 1 item to be in those textboxes

        unitpriceone = Val(TextBox4.Text)

        unitpricetwo = Val(TextBox5.Text)

        unitpricethree = Val(TextBox6.Text)



        ' setting the price / each one to be in those textboxes

        priceunitone = Val(TextBox7.Text)

        priceunittwo = Val(TextBox11.Text)

        priceunitthree = Val(TextBox12.Text)



        ' calculating the price for each one

        TextBox7.Text = unitpriceone * qtyone

        TextBox11.Text = unitpricetwo * qtytwo

        TextBox12.Text = unitpricethree * qtythree



        ' calculating the subtotal

        TextBox13.Text = (unitpriceone * qtyone) + (unitpricetwo * qtytwo) + (unitpricethree * qtythree)



        ' calculating the GST

        TextBox14.Text = 0.06 * ((unitpriceone * qtyone) + (unitpricetwo * qtytwo) + (unitpricethree * qtythree))



        ' calculating the PST

        TextBox15.Text = 0.07 * ((unitpriceone * qtyone) + (unitpricetwo * qtytwo) + (unitpricethree * qtythree))



        'setting what the total will equal to

        total = (0.07 * ((unitpriceone * qtyone) + (unitpricetwo * qtytwo) + (unitpricethree * qtythree))) + (0.06 * ((unitpriceone * qtyone) + (unitpricetwo * qtytwo) + (unitpricethree * qtythree))) + ((unitpriceone * qtyone) + (unitpricetwo * qtytwo) + (unitpricethree * qtythree))



        ' calculating the total price gst + pst + subtotal

        TextBox16.Text = (0.07 * ((unitpriceone * qtyone) + (unitpricetwo * qtytwo) + (unitpricethree * qtythree))) + (0.06 * ((unitpriceone * qtyone) + (unitpricetwo * qtytwo) + (unitpricethree * qtythree))) + ((unitpriceone * qtyone) + (unitpricetwo * qtytwo) + (unitpricethree * qtythree))



        'displaying the information

        Label10.Text = "Thankyou for purchasing the following items: " & Chr(13) & "You have purcheased: " & qtyone & " of " & itemone & " =&" & Val(TextBox7.Text) & Chr(13) & "You have purcheased: " & qtytwo & " of " & itemtwo & " =&" & Val(TextBox11.Text) & Chr(13) & "You have purcheased: " & qtythree & " of " & itemthree & " =&" & Val(TextBox13.Text)





    End Sub

End Class


       
 

_______________________________________________________________________

Watch our Video Tutorial 

               How to create Invoice system in vb.net?










Thanks for being with us make sure you share and stay with us with subscribing us -
 regards CODERBABA


No comments:

Post a comment

Popular Posts