Make your own free website on Tripod.com

Invoice Algo
Back Home Up

 

  Theory

Projects

Articles

 Written Books

Report

Technical Report

Survey Reports

Workshop

Presentations

Tutorials

Algorithms

Contact Me

Yourself

wpe19.jpg (7336 bytes)

 

Step1:

 

Enter your choice

 

1.add records

2.information about records

3.read specic record

4.daily sales record

5.custumer wise sales record

6.item wise sale record

7.change perticular record

8.item in stock

9.to delete record

enter your choice

 

if choice ==1

step1

open file invoice and reach at the end of file and save invoice code and increment it so that it can used for upcoming records.

Step2

a.input item code

a1.now item code is sezrch in file stock

and coresponding item name and item price will be save.

b.input consumer name

c. consumer code==invoicecode

d.input consumer address

e.input item quantity

f.input date

price=price*itemqty;

 

Step3.

a.open file invoice.dat in append mode

b. write the structure associated with file invoice that is a

c. now close file invoice;

Step4.

a. open file initem.dat in append mode

b.write the whole structure associated with file initem

c.now close the file

Step5

a. open file item.datin append mode

b. write the whole structure of file item

c.now close the file

Step6

a.open file address.dat in append mode

b.now writethe whole stucture of file address

c.now close the file

 

if choice is 2

step1

a. open file invoice.dat in read mode

b. while loop read file till end od file

c save primary key of file invoice dincode=a.concode

d. save pointer position

e. print invoicenumber,invoicedate

f. now open file adress.dat

 

step2

a.whileloop

a1.now read file structures till end of file

b1.till

c1 dincode==d.concode

d1 .print consumername

e1 .break;

a i.close file adress.dat

a j.close file invoice

if choice ==3

a.clearscreen

b.to get any bill enter invoicecode(INPUTCO)

c. and costumername(INPUTAN)

d.open file invoice.dat in read mode

 

a. while loop read structure tiil end of file

b if condition (inputco==a.innum)

save primary (key1=a.innum) and

return the pointer in bigining of file

a print invoicenum,date, consumercode,

item name

 

a.close file invoice.dat

aopen file initem.dat in read mode

b. while loop read structure tiil end of file

c. if condition(primary key1==b.innum )

save primary key( primarykey2=b.itemcode)

d. return the pointer in bigining of file

e.print itemquanty,titemcode

f.close file initem(fp2);

 

a. open file item.dat

b. while loop read structure tiil end of file or it does

it satisfy the condition if(primary key2==c.itemcode)

c.return the pointer in bigining of file print price

a close file item .dat(fp3);

 

a. open file address.dat

b. while loop read structure tiil end of file

c. string compare (d.conname,inputna)

d if both are same

e. return the pointer in bigining of file

f.print consumername,consumeraddress

g. close file address.dat

 

case==4

a.input date of which you want sale record

b.open file invoice.dat in read mode

c.while loop read structure tiil end of file

{

 if(dindate==a.indate)

{

dinnum=a.innum;

save pointer position

}

}

d.open file initem.dat in read mode

f.

if(fp2==NULL)

{

error

exit

}

 h. while loop read structure tiil end of file

ifcondition (dinnum==b.innum)

dincode=b.itemcode;

i.close file initem.dat

j.opening file item.datin reading mode

k. while loop read structure tiil end of file

till incode==c.itemcode

a.totalprice=totalprice+c.price

IFCHOICE==6

STEP1

a.input date of which you want item wise sale record

b.open file invoice.dat in read mode

c. while loop read structure tiil end of file

d. {

e.if condition(primary key1=a.innum;)

return the pointer in bigining of file

print invoicenum,date, consumercode, item name

f.close file invoice.dat

STEP2

a.open file initem.dat in read mode

b. error message

c. while loop read structure tiil end of file

if(dinnum==b.innum)

dincode=b.itemcode;

d.close file initem.dat

STEP3

a.opening file item.datin reading mode

b. while loop read structure tiil end of file

c. if condition (dincode==c.itemcode)

{

printprice

d.closeing file item.dat(fp3);

STEP 4

a.closing file fp1

IF CHOICE ==7

a.Input date of which you want consumer wise sale record

b. a.input date of which you want sale record

b.open file invoice.dat in read mode

c.while loop read structure tiil end of file

if(dindate==a.indate)

dinnum=a.innum;

d.open file initem.dat in read mode

f. error condition if file is not open

h. while loop read structure tiil end of file

till dinnum==b.innum

i.save the primary key

i.close file initem.dat

STEP 4.

a. open file item.dat

b.if error if cannot open file

c.while loop till end of the file is reach {

if condition to search primary key in the file (dincode==c.itemcode)

print price

d.close file item.dat

STEP 5

a.open file address.dat in reading mode

b.if error if cannot open file

c.while loop till end of the file is reach

if condition to search primary key in the file(dcotcode==d.concode)

print CONSUMER NAME

d.close file address.dat

STEP5

Close file invoice .dat(fp1);

IF CHOICE==7

STEP1

input concumer name and code

STEP2

a.opening file invoice.dat

b.while loop search consumercode in the file

1.save primary key

key1=a.innum

c.input new date,new consumer code and item name

d.bring the pinter at the bigining of the structure

e.write the whole structure

f.close file

STEP3

a.open file initem.dat

b.while loop search consumercode in the file

1.save primary key

c.

2.input itemquantity,itemcode,

d.bring the pinter at the bigining of the structure

e.write the whole structure

f.close file

STEP4

a.open file item.dat

b.while loop search consumercode in the file

1.save primary key

c.itemcode=b.itemcode;

c.input item price

d.bring the pointer at the bigining of the structure

e.write the whole structure

f.now close the file

STEP5

a.open file address.dat

b.while loop till input name is not found in the file

1.input new consumer name and consumer address and. Save consumer concode in the file

c. bring the pointer at the bigining of the structure

d.write the whole astructure

e.close the file

IF CHOICE ==8

In stock option a file open stock.dat

Option 1

1.Enter stock

a.input item name ,consumer code and invoice code

Option 2

2.read stocks

print the records as above algo

IF CHOICE ==9

for the deletion prosess put all null values in the structures

if choice ==10

exit