Home arrow Delphi-Kylix arrow Page 3 - Invoicing in Delphi: Show Me the Money
DELPHI-KYLIX

Invoicing in Delphi: Show Me the Money


Have you been looking for a way to tame the invoices in your small business? In this article, the first of two parts, we are going to create a fully functioning invoicing system that can be used in almost any environment and situation. Interested? Keep reading.

Author Info:
By: Chris Neeman
Rating: 5 stars5 stars5 stars5 stars5 stars / 2
July 09, 2007
TABLE OF CONTENTS:
  1. · Invoicing in Delphi: Show Me the Money
  2. · Building the Database
  3. · Building the Application Interface
  4. · Finished Code
  5. · Rest of the Code and the Conclusion

print this article
SEARCH DEVARTICLES

TOOLS YOU CAN USE

advertisement
Invoicing in Delphi: Show Me the Money - Building the Application Interface
(Page 3 of 5 )

Start a new project in Delphi and add seven forms to it. Save the units with the following names:

Unit  Name    Save as...
 unit1           invmain
 unit2           newinv
 unit3           settings
 unit4           stats
 unit5           viewchange
 unit6           viewclients
 unit7           about

Finally save the project as: invoicing. Now close all other forms except the one saved as invmain, because that is the one that we need to start developing first. Once you have Form1 in front of you, from the Standard tab drop the Mainmenu component on the form. Double click on it and add the following menu items:

A file with a submenu item called Exit. Double click on the exit submenu item and add the following code:

procedure TForm1.Exit1Click(Sender: TObject); 
begin
  close; 
end;

Now create the second menu item, called Clients, with a submenu item called Manage Clients. Double click on it and add the following code:

procedure TForm1.ViewAllClients1Click(Sender: TObject); 
begin 
  form6.show; 
end;

Create the third menu item and call it Tools. Then add the following submenu items:

Settings

Double click on the above submenu item and add the following code:

procedure TForm1.Settings1Click(Sender: TObject); 
begin 
 
form3.show 
end;

Statistics

Double click on the above submenu item and add the following code:

procedure TForm1.Statistics1Click(Sender: TObject); 
begin 
  form4.show; 
end;

Then create the final menu item called Help, and add a submenu item called About. Double click on it and add the following code:

procedure TForm1.About1Click(Sender: TObject); 
begin 
  form7.show; 
end;

That's it for the menu items. Now on the form add a panel and align it to "all top." Put on the panel the following components:

Two radio buttons - Name them rb1 and rb2 respectively.Then give them the captions: Search by Invoice Name and Search by Invoice Number.

Tedit - Name the edit "edsearch." Clear the text property if there is any text in it.

Button - name the button "btnsearch" and add the caption "Search."

Save your work. Next, from the Data Controls tab add the database grid and set its align property to all client. Double click on the grid and the column property editor should come up. Add five columns and give them the following captions:

Invoice Number
Invoice Name
Invoice Date
Status

You add captions by going to the title property of each column.

Next, we add another panel and set its align property to "alBottom." On this panel add the following widgets:

  • Two static text -- with caption names "Total Invoices" and "Current Invoice #."
  • Two labels
  • Three buttons, named btnDelete, btnAddInv and btnExit respectively. 

 To the three buttons, add the following code, in the order given:

btnDelete:

procedure TForm1.btndeleteClick(Sender: TObject);
begin
 
if ado1.RecordCount > 0 then 
  
begin
   
ado1.Delete;
 
end
 
else
   
showmessage('No invoices to delete'); 
end;

btnAddInv:

procedure TForm1.btnAddInvClick(Sender: TObject);
begin
 
ado1.Active:=false;
 
//form1.ado1.TableName:='';
 
form2.show;
end;

btnExit:

procedure TForm1.btnExitClick(Sender: TObject);
begin
  close;
end;

Then finally drop a datasource component (name it d1) from the Data Access tab and an ADO table component (name it ado1) from the Ado Tab. Set form1's caption to Invoice Manager. That completes the design on the first form. Your form should look something like this:


blog comments powered by Disqus
DELPHI-KYLIX ARTICLES

- Loading an XML Document into the DOM
- Delphi Wrapper Classes and XML
- Delphi and the DOM
- Delphi and XML
- Internet Access: Client Service
- Finishing the Client for an Internet Access ...
- The Client for an Internet Access Control Ap...
- User Management for an Internet Access Contr...
- Important Procedures for an Internet Access ...
- Server Code for an Internet Access Control A...
- Constructing the Interface for an Internet A...
- Building a Server Application for an Interne...
- Building an Internet Access Control Applicat...
- Client Dataset: Working with Data Packets an...
- Using the Client Dataset in an N-Tiered Appl...

Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 



© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 7 - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials