Computer Hope

Software => Computer programming => Topic started by: Kola42 on April 21, 2010, 09:28:33 AM

Title: Source Code to design an invoice using Visual basic 6.0
Post by: Kola42 on April 21, 2010, 09:28:33 AM
Pls i need the source code & forms any one with ideas should please post. Thanks
Title: Re: Source Code to design an invoice using Visual basic 6.0
Post by: BC_Programmer on April 21, 2010, 06:58:37 PM
 ::)
Title: Re: Source Code to design an invoice using Visual basic 6.0
Post by: Big on April 22, 2010, 02:02:57 PM
Well, BC_Programmer, that was a very useful post.

Here is the image of an invoice, so we can base ourselves on that:
invoice (http://linasbeautystuff.files.wordpress.com/2010/01/invoice_printed.gif)

Now let's sum up the fields and entities, with Windows Forms and UML notation::

- company label : Label

Company : Entity (class)
- Company name : String
- Street address : String
- City, State, Zip code : String
- Phone number, web address, e-mail : String

- Date : Date
- Invoice # : int (or auto-int or whatever)

Bill To : Label, TextArea

- CompanyID : int
- Company name : String
- Street address : String
- City, State, Zip code : String
- Country : String

Ship To: : Label, TextArea

- Company name : String
- Street address : String
- City, State, Zip code : String

- P.O.# : GridView.Header/ListBox.Header
- Sales Rep. Name : GridView.Header/ListBox.Header
- Ship Date : GridView.Header/ListBox.Header
- Ship Via : GridView.Header/ListBox.Header
- Terms : GridView.Header/ListBox.Header
- Due date : GridView.Header/ListBox.Header

Product : (Entity, class)

- Product ID : GridView.Header/ListBox.Header
- Description : GridView.Header/ListBox.Header
- Quantity : GridView.Header/ListBox.Header
- Unit price : GridView.Header/ListBox.Header
- Line Total (calc field) : Label
- Subtotal (calc field) : Label
- price PST% : Label
- price GST% : Label
- Shipping & handling : Label
- Total : Label
- Paid : Label
- Due (calc field) : Label

- Notes : Label, TextArea
- endlabel : Label

Now that we have these things, we can conclude a few things, OO related:

Requirements Elicitation:

classes

- Product
  - fields
     - Product ID
     - Description
     - Quantity
     - Unit price

- Company
  - fields
     - Company name
     - Street address
     - City, State, Zip code
     - Phone number
     - web address
     - e-mail

- Receiver
  - fields
     - Name
     - Address
     - City
     - State
     - CityState = (concatenated String)
     - Country

Then there is the bill to company. Maybe with some overloads.

Now let's see if anyone else cares to answer.
Give some comments if you want, so we can help this person further.

Title: Re: Source Code to design an invoice using Visual basic 6.0
Post by: BC_Programmer on April 22, 2010, 06:24:55 PM
Now let's sum up the fields and entities, with Windows Forms and UML notation::
neither Windows Forms or UML are used by Visual Basic 6.

Quote
Then there is the bill to company. Maybe with some overloads.
neither are Overloads.


The data entry would need to be designed especially for the input of whatever the invoice is for- additionally, they make no mention of wether any information is being pulled from a database via ID values.

Also, creating a printed invoice from the data requires custom code working with the graphics methods of the printer object. Given the relatively large amount of effort involved and the terseness and loose definition of the request it's no surprise that I'm not exactly enthusiastic at the prospect of wasting an afternoon on this problem guessing and making assumptions about their invoice requirements, at least until the Original Poster actually puts forth some more details.
Title: Re: Source Code to design an invoice using Visual basic 6.0
Post by: Big on April 22, 2010, 06:40:08 PM
VB6 has no OO?
Title: Re: Source Code to design an invoice using Visual basic 6.0
Post by: BC_Programmer on April 22, 2010, 06:51:27 PM
VB6 has no OO?

It supports Interface Inheritance but not Implementation Inheritance... you can "emulate" implementation inheritance using interface inheritance and an aggregate class, but such a venture is usually not worth the effort.

Also, I forgot what UML was and confused it with XAML. The only missing piece then is that you simply cannot have derived classes.


the CProduct would probaby be something like this:
Code: [Select]
Private mProductID as Long
Private mDescription as String
Private mQuantity as Long
Private mUnitPrice as Currency

Friend Property Let ProductID(Byval Vdata as Long)
mProductID = Vdata
End Property
Public Property Get ProductID() as Long
ProductID = mProductID
End Property

Public Property Let Description(ByVal Vdata as String)
mDescription = Vdata
End Property
Public Property Get Description() as String
Description = MDescription
End Property

Public Property Let Quantity(Byval Vdata as Long)
mQuantity = Vdata
End Property
Public Property Get Quantity() as Long
Quantity = mQuantity
End Property


Public Property Let UnitPrice(Byval Vdata as Currency)
mUnitPrice = Vdata
End Property
Public Property Get UnitPrice() as Currency
UnitPrice = mUnitPrice
End Property

and of course, similar code for the other classes. Usually, these would be present in a back-end layer, usually a ActiveX DLL, which is used to access the database or however else the invoice data is stored; and then the UI program manages the User interface part of the invoicing, including the printing requirements and so forth.

I still think the OP needs to provide quite a bit more information before we can really help them, after all, we're operating on quite a number of assumptions of what they need.
Title: Re: Source Code to design an invoice using Visual basic 6.0
Post by: Big on April 22, 2010, 06:57:14 PM
Yeah. I spent 20 minutes writing that stuff.
Title: Re: Source Code to design an invoice using Visual basic 6.0
Post by: Kola42 on April 25, 2010, 03:51:53 AM
thanks very much
Title: Re: Source Code to design an invoice using Visual basic 6.0
Post by: Salmon Trout on April 25, 2010, 04:14:03 AM
Some IT services procurement methods:

1. Identify a requirement, place it out to tender, award contract, roll out application.
2. Ask on Computerhope.


Title: Re: Source Code to design an invoice using Visual basic 6.0
Post by: Salmon Trout on April 25, 2010, 04:14:23 AM
Yeah. I spent 20 minutes writing that stuff.

You should bill the OP.
Title: Re: Source Code to design an invoice using Visual basic 6.0
Post by: Big on April 25, 2010, 04:25:22 AM
Excuse me? I'm a benevolent person.
Also this is a forum, not a freelance bureau.

*censored*......
Title: Re: Source Code to design an invoice using Visual basic 6.0
Post by: Salmon Trout on April 25, 2010, 04:27:15 AM
Excuse me? I'm a benevolent person.
Also this is a forum, not a freelance bureau.

*censored*......


I was being "facetious". Look it up.