Skip to main content

Invoice,Billing Application(Software)


Introduction

This is a simple billing project which was developed using C# & SQL Server 2005. You can use it for all type of invoice/Bill preparation after small modification.
Download Project
Download SQL Script

Video in Youtube

Create Database
There are two ways to create a database.
         1. SQL Management Studio Query Analyser.
         2. SQL Management Studio Visual Tool.
The following sql script create a database with default option using SQL Management Studio Query Analyser.
CREATE DATABASE [MyBill]
(where MyBill is a name of database)
Open SQL Server Management Studio Express and execute the above mentioned query.
CreateDB
Create a database using SQL Server Management Studio Express
Right Click on Databases.
Select New Database... from the popup

Type your database name(Eg. "MyBill")
Select "OK"

Table Creation
Table Name Purpose
CompanyInfo Store the Company name & Address, it will be used in Invoice
PrMaster Store the Product details such as Product code, description, Rate, Unit etc.
InvoiceMain Store the invoice details such as Invoice No., Date, Customer Name & Address,
InvoiceSub Store the product details for corresponding invoice.
Script for Create the Table.
Copy the following script and paste in SQL Server Management studio Query Analyser. Press "F5" or Click "Run" button in the Tool bar.
        Use MyBill
go
CREATE TABLE [dbo].[InvoiceMain](
 [InvId] [int] IDENTITY(1,1) NOT NULL,
 [InvoiceNo] [int] NULL,
 [InvoiceDate] [datetime] NULL,
 [InvoiceCustomer] [varchar](200) NULL,
 [InvoiceAddress] [varchar](500) NULL,
 [InvoiceCustomerId] [varchar](50) NULL,
 [InvoiceChequeNo] [varchar](25) NULL,
 [InvoiceBank] [varchar](100) NULL,
 [InvChequeDate] [datetime] NULL,
 [InvNetAmount] [numeric](18, 2) NULL,
 [InvTaxNetAmount] [numeric](18, 2) NULL,
 CONSTRAINT [PK_InvoiceMain] PRIMARY KEY CLUSTERED 
(
 [InvId] ASC
) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[InvoiceSub](
 [RowId] [int] IDENTITY(1,1) NOT NULL,
 [InvId] [int] NULL,
 [PrId] [int] NULL,
 [PrQty] [numeric](18, 2) NULL,
 [PrRate] [numeric](18, 2) NULL,
 [PrTaxPercent] [numeric](18, 2) NULL,
 CONSTRAINT [PK_InvoiceSub] PRIMARY KEY CLUSTERED 
(
 [RowId] ASC
) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[CompanyInfo](
 [CompanyId] [int] IDENTITY(1,1) NOT NULL,
 [CompanyName] [varchar](100) NULL,
 [CompanyAddress1] [varchar](100) NULL,
 [CompanyAddress2] [varchar](100) NULL,
 [CompanyAddress3] [varchar](100) NULL,
 [CompanyPINCode] [varchar](50) NULL,
 [CompanyPhone1] [varchar](100) NULL,
 [CompanyTNGST] [varchar](50) NULL,
 [CompanyCST] [varchar](50) NULL,
 [CompanyTIN] [varchar](50) NULL,
 CONSTRAINT [PK_CompanyInfo] PRIMARY KEY CLUSTERED 
(
 [CompanyId] ASC
) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[PrMaster](
 [PrId] [int] IDENTITY(1,1) NOT NULL,
 [PrCode] [varchar](50) NULL,
 [PrDesc] [varchar](500) NULL,
 [PrUnit] [varchar](50) NULL,
 CONSTRAINT [PK_PrMaster] PRIMARY KEY CLUSTERED 
(
 [PrId] ASC
) ON [PRIMARY]
) ON [PRIMARY]
GO
Database Diagram(E-R Diagram)
Insert data into Companyinfo Table
       INSERT INTO [CompanyInfo]
           ([CompanyName]
           ,[CompanyAddress1]
           ,[CompanyAddress2]
           ,[CompanyAddress3]
           ,[CompanyPINCode]
           ,[CompanyPhone1]
           ,[CompanyTNGST]
           ,[CompanyCST]
           ,[CompanyTIN])
     VALUES
           ('My Company',
   'Address1',
   'Address2',
   'Address3',
   'PIN Code',
   'Phone No',
   'TNGST No',
   'CST No',
   'TIN'
   )
go
Select * from CompanyInfo
         

Insert Data in Product Master

Please refer the screen structure. I have designed this application in VS 2010 with C# Code. Below mentioned screen used to create Product.



Saved data in SQL Server.


Invoice/Bill Preparation

Please refer screen structure for Invoice/Bill.


Invoice List


Add - Create New Invoice.
Delete - Delete the selected Invoice.
Close - Close Invoice List.
Print - Print the selected Invoice.

Report Designing - Crystal Report.

Now I am going to design invoice/Billing application in  below mentioned format using Crystal Report.
Download Crystal report for Visual studio 2010


Add Crystal Report

Select Project Menu->Add New Item->Visual C# Items->Crystal Reports
Type the Report Name(MyInvoice.rpt)

Select "As a Blank Report"

Report Sections

Add fields to Report


Connect with Data source

Select View Menu->Server Explorer(Refer below screen)

Follow the images for data source connections.


Add table schema to Dataset

Drag & drop the "PrintInvoice" stored Procedure with "Invoicedataset.xsd"(Refer below screen)
PrintInvoice is a Stored Procedure which returns the necessary records for print the Invoice.

Place the field in Crystal Report.

Swith to MyInvoice.rpt Design mode.
Open Field Explorer.(If Field Explorer not visible Go to View Menu View->Other Windows->Document Outline)


Paper size & Margin Settings

Refer the below screen for Paper size & Margin settings.



Report Design


Place the fields in Report Area

Place the fields in Report(Refer the Image)


Preview the Report

Add new form and Place Crystal report viewer and name it CRV.

Change the DOCK Property of Crystal report viewer to Fill(Refer screen)

Switch to design view of frmInvoiceList.cs. Double click and write the following code in click Event


Refer the screen for Print the invoice.

  
private void btnPrint_Click(object sender, EventArgs e) {
            if (lstMain.SelectedItems.Count == 0)
            {
                MessageBox.Show("Please select the invoice...");
                return;
            }
            DataTable dt = new DataTable();
            string InvId;
            InvId = this.lstMain.SelectedItems[0].SubItems[6].Text;
            dt = Invoice.InvoicePrint(InvId);
            frmReportShow f = new frmReportShow();
            rptinvoice rpt = new rptinvoice();
            rpt.SetDataSource(dt);
            f.CRV.ReportSource = rpt;           
            f.ShowDialog();
        }

Print the Invoice(Refer Screen)


Invoice Output


Points to Remember
Just look at below screen.
Script of PrintInvoice stored Procedure
ALTER Proc [dbo].[PrintInvoice](@InvId int)
as
SELECT  dbo.InvoiceMain.InvId,
dbo.InvoiceMain.InvoiceNo,dbo.InvoiceMain.InvoiceDate, dbo.InvoiceMain.InvoiceCustomer,
dbo.InvoiceMain.InvoiceAddress, dbo.InvoiceMain.InvoiceCustomerId,
dbo.InvoiceMain.InvoiceChequeNo,dbo.InvoiceMain.InvoiceBank,
dbo.InvoiceMain.InvChequeDate, dbo.InvoiceMain.InvNetAmount,
dbo.InvoiceMain.InvTaxNetAmount,dbo.InvoiceSub.RowId,
dbo.InvoiceSub.PrId,dbo.InvoiceSub.PrQty,dbo.InvoiceSub.PrRate, 
dbo.InvoiceSub.PrTaxPercent,dbo.PrMaster.PrCode,
dbo.PrMaster.PrDesc,dbo.PrMaster.PrUnit,
dbo.CompanyInfo.CompanyName, dbo.CompanyInfo.CompanyAddress1,
dbo.CompanyInfo.CompanyAddress2,dbo.CompanyInfo.CompanyAddress3,
dbo.CompanyInfo.CompanyPINCode, dbo.CompanyInfo.CompanyPhone1,
dbo.CompanyInfo.CompanyTNGST, dbo.CompanyInfo.CompanyCST,
dbo.CompanyInfo.CompanyTIN,
dbo.AmountToWords(InvNetAmount)+' only.' as Amountinwords
FROM dbo.InvoiceMain 
INNER JOIN dbo.InvoiceSub ON dbo.InvoiceMain.InvId =
 dbo.InvoiceSub.InvId INNER JOIN
dbo.PrMaster ON dbo.InvoiceSub.PrId = 
dbo.PrMaster.PrId CROSS JOIN
dbo.CompanyInfo
where dbo.InvoiceMain.InvId=@InvId
order by rowId
The field InvId(Identity Column) is a primary key of InvoiceMain Table.
The field InvId is a Foreign key of InvoiceSub Table which used to create ONE TO MANY relationship between the tables.
The PrintInvoice stored Procedure used to print the invoice. When you execute this procedure it should return some records. If it is return Zero record, the blank report will open.
In invoice no 1, there are two items are used.
In invoice no 2, there are three items are used.

ER Diagram for Invoice Print The above ER Diagram show the relationship between the table. The CompanyInfo table cross join with other table.
The CompanyInfo table must have only one record. If it have more than one record, the duplicate records will be return byPrintInvoice stored procedure.
The CompanyInfo table is optional. I have stored the Company details in that table. You can directly type(static text) company details in Crystal Report using Text box control. After deployment of the application, you may need to change the company details. If you use the CompanyInfo table, just update the details in Corresponding field in CompanyInfo. It will reflect immediately in the report.
if you use the static text method, you have to again deploy the entire project.

If you want the source code, Please send the mail to mailtobabum@gmail.com

Troubleshoot

So many user post their comments. But they have written, the application returned blank reports. Please run the following query in your Sql Server management studio(Refer Image). All the query should return at least one row. Otherwise you will get the blank report. If any of the query return no records, kindly check whether the table has record or not.

select * from [dbo].[CompanyInfo]

select * from [dbo].[PrMaster]

select * from [dbo].[InvoiceMain] order by invid 

select * from [dbo].[InvoiceSub] order by invid 


SELECT  dbo.AmountToWords(InvNetAmount)+' only.' as Amountinwords,   dbo.InvoiceMain.InvId,
 dbo.InvoiceMain.InvoiceNo,
 dbo.InvoiceMain.InvoiceDate, dbo.InvoiceMain.InvoiceCustomer, dbo.InvoiceMain.InvoiceAddress, 
dbo.InvoiceMain.InvoiceCustomerId, dbo.InvoiceMain.InvoiceChequeNo, dbo.InvoiceMain.InvoiceBank,
 dbo.InvoiceMain.InvChequeDate, 
dbo.InvoiceMain.InvNetAmount, dbo.InvoiceMain.InvTaxNetAmount, dbo.InvoiceSub.RowId,
 dbo.InvoiceSub.PrId, dbo.InvoiceSub.PrQty, dbo.InvoiceSub.PrRate, 
dbo.InvoiceSub.PrTaxPercent, dbo.PrMaster.PrCode, dbo.PrMaster.PrDesc, dbo.PrMaster.PrUnit,
 dbo.CompanyInfo.CompanyName, 
dbo.CompanyInfo.CompanyAddress1, dbo.CompanyInfo.CompanyAddress2, dbo.CompanyInfo.CompanyAddress3,
 dbo.CompanyInfo.CompanyPINCode, 
dbo.CompanyInfo.CompanyPhone1, dbo.CompanyInfo.CompanyTNGST, dbo.CompanyInfo.CompanyCST,
 dbo.CompanyInfo.CompanyTIN
FROM dbo.InvoiceMain INNER JOIN
dbo.InvoiceSub ON dbo.InvoiceMain.InvId = dbo.InvoiceSub.InvId INNER JOIN
dbo.PrMaster ON dbo.InvoiceSub.PrId = dbo.PrMaster.PrId CROSS JOIN
dbo.CompanyInfo
 

Comments

Anonymous said…
Its Working . But Its Generate Blank Report.

Please help me sooon...........
Anonymous said…
i got a report .


thank you so much
Sumeet Jain said…
Thank you


Now i can print invoice because of your article
Saravana Kumar said…
Its Working . But Its Generate Blank Report.

Plzz help me...

ma maill id is dsksaravana@hotmail.com
Unknown said…
This is an awesome weblog!!! I like your web page very much and I’ll sign-up to it if you post more content like this!
cloud billing software
Unknown said…
Generate Blank Report.
babu said…
Please send me your project.
babu said…
Please send me your project.
Unknown said…
Tableau Data Visualization Software
SQIAR (http://www.sqiar.com/solutions/technology/tableau) is a leading Business Intelligence company and provides Tableau Software consultancy across United Kingdom and USA.
Chviga said…
This is great.
Thank you so much for this.
Unknown said…
Thanks Alot
its so helpfull
Anonymous said…
SIR I RUN THIS PROJECT SUCCESSFULLY BUT IT GENERATE THE BLANK REPORT HELP ME OUT,


EMAIL ID:nturankar@yahoo.com
Unknown said…
Good Sfternoon Sir,
I get Invoioce Print Project Run Successfully but it generate Blank report Please help me out.

Thanks.

email id:shumakar07@gmail.com
Anonymous said…
The type or namespace name 'CrystalDecisions' could not be found (are you missing a using directive or an assembly reference?)

Pls Help me to fix it.

Thanks in Advance
babu said…
Did you install the Crystal Report?
Download and Install Crystal from
http://downloads.businessobjects.com/akdlm/cr4vs2010/CRforVS_13_0_2.exe
Anonymous said…
I am also getting blank report...
please help me out...
My Email Id : apurvpungliya@gmail.com
babu said…
If you get Blank Report, please follow the steps.


Run the following qry. It should return a row.

Select * from CompanyInfo

If no record found, please insert below record.

INSERT INTO [CompanyInfo]
([CompanyName]
,[CompanyAddress1]
,[CompanyAddress2]
,[CompanyAddress3]
,[CompanyPINCode]
,[CompanyPhone1]
,[CompanyTNGST]
,[CompanyCST]
,[CompanyTIN])
VALUES
('My Company',
'Address1',
'Address2',
'Address3',
'PIN Code',
'Phone No',
'TNGST No',
'CST No',
'TIN'
)

Below mentioned qry is final qry. The qry should return at least one row. Otherwise you will get blank report. If your invoice has 2 product, it should return 2 rows and so on.

SELECT dbo.InvoiceMain.InvId,
dbo.InvoiceMain.InvoiceNo,dbo.InvoiceMain.InvoiceDate, dbo.InvoiceMain.InvoiceCustomer,
dbo.InvoiceMain.InvoiceAddress, dbo.InvoiceMain.InvoiceCustomerId,
dbo.InvoiceMain.InvoiceChequeNo,dbo.InvoiceMain.InvoiceBank,
dbo.InvoiceMain.InvChequeDate, dbo.InvoiceMain.InvNetAmount,
dbo.InvoiceMain.InvTaxNetAmount,dbo.InvoiceSub.RowId,
dbo.InvoiceSub.PrId,dbo.InvoiceSub.PrQty,dbo.InvoiceSub.PrRate,
dbo.InvoiceSub.PrTaxPercent,dbo.PrMaster.PrCode,
dbo.PrMaster.PrDesc,dbo.PrMaster.PrUnit,
dbo.CompanyInfo.CompanyName, dbo.CompanyInfo.CompanyAddress1,
dbo.CompanyInfo.CompanyAddress2,dbo.CompanyInfo.CompanyAddress3,
dbo.CompanyInfo.CompanyPINCode, dbo.CompanyInfo.CompanyPhone1,
dbo.CompanyInfo.CompanyTNGST, dbo.CompanyInfo.CompanyCST,
dbo.CompanyInfo.CompanyTIN,
dbo.AmountToWords(InvNetAmount)+' only.' as Amountinwords
FROM dbo.InvoiceMain
INNER JOIN dbo.InvoiceSub ON dbo.InvoiceMain.InvId =
dbo.InvoiceSub.InvId INNER JOIN
dbo.PrMaster ON dbo.InvoiceSub.PrId =
dbo.PrMaster.PrId CROSS JOIN
dbo.CompanyInfo
where dbo.InvoiceMain.InvId=@InvId
order by rowId
Unknown said…
Sir, I am also getting blank report, It was fine but after importing logo on head of bill i found my report blank, and now its totally blank.
Please help me,

My email id is pradeepupadhyay471@gmail.com
nice tutorial for crystal report but
i think crystal report is not useful
andymore so many out there software that i can say is fully innovative than crystal report like wisp billing system
Unknown said…
Impel Inventory Software is an inventory system for small to mid size businesses to handle sales, purchasing, and inventory management and control.

Invoice Management Software
shouvith said…
thanks very helpful
Marian said…
Thanks for sharing this, I am currently using an isp billing software by Visp and it really help me a lot. But still, I'm looking forward to try this, I'm going a programmer. Yey!
Unknown said…
Thanks to share this with us, It is very helpful .
I am currently using CloudBooks as Billing Software and completely satisfied with it and suggest to everyone to try it. For More info visit at: - https://www.cloudbooksapp.com/
kathayan said…
hello..sir want this software.
email:-ankittajpara@gmail.com
Ravi said…
Please share your code of this application. Its very halpful for me.

Thanks a lot for this post.
Email- ravi29khandelwal@gmail.com
The type or namespace name 'CrystalDecisions' could not be found (are you missing a using directive or an assembly reference?)easy to use project management software
babu said…
Hi Richard,

Did you install the Crystal report?

please install it and try again.

Crystal report URL :http://downloads.businessobjects.com/akdlm/cr4vs2010/CRforVS_13_0_2.exe
Anonymous said…

Assayamu galeykum . Please help me. I downloaded the project and the base , now with the addition of "Invoice" in the "Invoice list" is not added.

email: beima@bk.ru
skype: beiima
Pls send prasant38@gmail.com
SHerkhan said…

Assayamu galeykum . Please help me. I downloaded the project and the base , now with the addition of "Invoice" in the "Invoice list" is not added.

email: beima@bk.ru
skype: beiima
Unknown said…
developed lot many popular software including Billing Software (for chemists, C&F, manufacturing companies)
Anonymous said…
Finally! Exactly what i was looking for... thank you GST Billing Software

You can visit our official website: http://www.myentry.co.in
Niranjan said…
Hello, i want full source code for this project. i already sent you an email. Please do the needful.
neha said…
#GSTsupported, #Readytouse, #Invoice, #Billingsoftware, #sakshambillingsoftware
GST Supported| Different Invoice templates| Platform Independent| Import/Export Feature
Simple & secure Invoicing though there is no better substitute for Saksham Billing & Invoice Software. You can create & send attractive Invoices with customized designs.
Get all this features in a single kit
For Free Demo Call us at: 8947027625
To know more click here : www.kriscent.in
Or www.saksham.kriscent.in
Or You may also reach us at: info@kriscent.in

Unknown said…
This comment has been removed by the author.
Great post thanks for sharing this post with us. http://pathesolution.com/
Chandni pandey said…
Thanks for sharing this blog with us. Its very useful post for us. Gst billing software
Wow beautifully you write this blog, i amazed,i really like it, thanks for sharing.
Unknown said…
Is there anyway to translate "SQLserver" script to "MSaccess" script,,meaning... using "MSaccess" than "SQLserver"
Unknown said…
Hi,

Thanks for sharing a very interesting article about Invoice POS Billing Application Software. This is very useful information for online blog review readers. Keep it up such a nice posting like this.

From,
Retailmass,
POS Billing Software
Unknown said…
I appreciate this effort. Find the right Billing Software for Mental Health Professionals for your organization.
Unknown said…
Very nice blog on Accounting Software. Thanks for posting the blog. We also refer m-Billing software/app. With m-Billing You can do invoicing and billing, expense tracking, inventory management, balance sheet, accounts receivables and payables, sales orders, voucher customization, profit & loss statement, GSTR 1, GSTR2, GSTR-3B reports, journal vouchers, ledgers and more. m-Billing is multi-user, multi-location app. For more details call @ 9870326600 or plz visit :- https://www.mbilling.in/
Busy Accounting Software App
Billing Software App
GST Billing App
appgst
Billing Software
go gst bill software
Free Inventory Management Software with GST
Inventory Management and Billing Software
Stock Management and Billing Software
Accounting Software
Accounting App
Online Accounting Software
GST Billing Software
Billing Software
Accounting Software India
GST Ready Software
Inventory Management Software
Accounting And Inventory Software
Financial Management
GST Tax Return
GST Tax Filing
Inventory Management
I read your post and got it quite informative. I couldn't find any knowledge on this matter prior to. I would like to thanks for sharing this article here. Online free Invoice Generator UK
Jason Berge said…
I think this is an informative post and it is very useful and knowledgeable about subscription billing management software. therefore, I would like to thank you for the efforts you have made in writing this article.
David Stangley said…
Thanks for the blog filled with so many information. Stopping by your blog helped me to get what I was looking for. Now my task has become as easy as ABC.

stock software for small business
Most companies today are faced with the challenge of handling overwhelming amounts of data. The challenge is that they must also ensure that the data is available at any time for decision-making and reporting.Data lake companiesare a way to address these challenges.
Varun said…
How To Make Invoice ? No problem, as per my openion just check BUSY Software, as its best in making invoice.
Hotel Transfers said…
Share great information about your blog , Blog really helpful for us .
Medical Billing Application
Krishna said…
Thank you for sharing this blog. The blog was neatly presented and the information about billing software is really good. Literally these warehouse and logistics software are more useful for eCommerce retailers, manufacturers, wholesalers, and distributors. I heard about Shipping Agency Softwarewhich is optimize for inventory management that reduces waste, improves efficiency and saves time and money on shipping costs.
SEO said…
Thanks for starting this home business accounting and invoicing software! One can use KudoBooks ERP invoicing software to manage, plan your accounting system!
Jack William said…
Nice presentation! I need some clarifications regarding invoice purpose. I am a single business owner, is free invoice generator tool is enough for my startup or else am i need to create the individual invoice software.

Popular posts from this blog

Print the Invoice in Computer Stationery using Dot Matrix Printer

This post Explains how to Print the invoice in Pre-Print format(Continuous paper/Multipart forms). Sample Format Please go through my previous article before start. The alignment & Scale process is same for Laser & Dot matrix Printer. Continuous Paper Feeding Method(Refer the Image) Make sure your paper has a clean, straight leading edge. Open the sprocket covers. Fit the first holes of the paper over the sprocket pins and then close the sprocket covers. Slide the right sprocket to remove any slack in the paper and lock it in place. Turn on the printer. Press the "Load/Eject" button. Now the paper will feed automatically and stop at corresponding position. You should not use "Knob/Roller" to adjust the position. Adjust the Paper thickness lever. Because you may need to print multi-part paper. Paper Type Lever Position Standard Paper(Single Sheets or continuous) 0 Multipart

Print the Invoice in Pre-print Format using Crystal Report

This post Explains how to Print the invoice in Pre-Print format(The format is given below). Step 1 : Add new Crystal report. Step 2 : Specify the margin. Scale the Margin from your Invoice template(Refer the below image). Select & Specify the Paper size & Margin(Refer the below image) (To open Page setup dialog box right on Crystal report->Design->Page Setup) Step 3 : Drag & Drop the field from Field Explorer to Crystal Report.(Refer below Image) Step 4 : Measurement Unit Settings(Optional). Use the Ruler at left & top of report when place the report field. You can change the Measurement unit from Centimeter to Millimeter or vice versa(Refer below Image) * US - Inches * Metric - Centimeter Change your measurement system as per your requirement and close and re-open the report in Visual Studio. (To change Measurement Option - Control Panel -> Regional Settings - > Change Date, Time & Number formats) I alway