Professional Documents
Culture Documents
Sample Payroll System Codes Via Visual Fox Pro
Sample Payroll System Codes Via Visual Fox Pro
Sample Payroll System Codes Via Visual Fox Pro
CODES FOR PAYROLL SYSTEM ***creating database ***project.prg clear @3,2 to 35,50 double set color to g+ @5,10 say PAYROLL DATABASE @6,20 say SYSTEM @9,23 say BY @12,14 say Diana Jane M. Hermida ? ? ? ? ? ? Wait Press any key to continue..
***password.prg Clear @2,2 to 25,50 double Set color to gr+ @10,10 say PASSWORD CONFIRMATION @14,10 ACCEPT Enter Password to PW ? If PW= Payroll System Do payroll.prg Else ? INVALID PASSWORD ? Wait Retry? Press any key. Do password.prg Endif Return
**payroll.prg Clear Set color at gr+ @3,2 to 35,60 double @9,7 say ****************************** @11,20 say PAYROLL DATABASE
@13,7 say ****************************** @15,7 say CHOICES @17,9 say *A+ Workers Information @19,9 say *B+ Regular Time @21,9 say *C+ Over Time @23,9 say *D+ Deductions @25,9 say *E+ Update Payroll @27,9 say *F+ Generate Report @29,9 say *Q+ Quit ? Wait Enter Your Choice. to Choice Do Case Case Upper (Choice)=A Do wi.prg Case Upper (Choice)=B Do rti.prg Case Upper (Choice)=C Do ot.prg Case Upper (Choice)=D Do deductions.prg Case Upper (Choice)=E Do update.prg Case Upper (Choice)=F Do report.prg Case Upper (Choice)=Q Do quit.prg Endcase Return
***wi.prg Clear @2,2 to 35,50 double @4,6 say Enter Employees Information Use payroll_system.dbf Append blank @8,5 say Employees Name: Get emp_name @10,5 say Employees Number: Get emp_no Read ? @30,8 Wait Enter Another *Y/N+? to Choice If Upper(Choice)=Y Do wi.prg Else Do payroll.prg EndIf
Return
***rt.prg clear @2,2 to 35,50 double @4,6 say Enter Regular Time of Employees Use payroll_system.dbf ? ? ? ? ? ? ? ? Accept Employees Name: to name Accept Employees Number: to number Locate for emp_name=name .and. emp_no=number
***deduction.prg Clear @2,2 to 35,50 double @4,6 say Enter Deduction of Employees Use payroll_system.dbf ? ? ? ? ? ? ? ? Accept Employees Name: to name Input Employees Number: to number Locate for emp_name= name .and. emp_no= number If emp_name= name .and. emp_no= number Input Income Taxes: to IT Input SSS Contribution: to S Input Phil-Health: to PH Input Pag-ibig: to P Input Others: to O Replace with_tax with IT
Replace sss with S Replace philhealth with PH Replace others with O ***Computations TD= with_tax+ sss+ philhealth+ pagibig+ others Replace total_ded with TD ? ***Computations TD=with_tax + sss + philhealth + pagibig + others Replace total_ded with TD ? @25,5 Wait Enter Another *Y/N+? to Choice If Upper(Choice)=Y Do deductions.prg Else Do payroll.prg EndIf Else @25,5 say Record not found! @27,5 Accept Retry*Y/N+? to Choice If Upper(Choice)=Y Do deductions.prg Else Do payroll.prg EndIf EndIf Return
***update.prg Clear @2,2 to 35,50 double @4,6 say Update Employees Gross Income Use payroll_system.dbf ? ? ? ? ? ? ?
? Accept Employees Name: to name Input Employees Number: to number Locate for emp_name = name .and. emp_no = number If emp_name = name .and. emp_no = emp_number Input Regular Rate/Hour: to reg Input Overtime Rate/Hour: to ot Locate for emp_name = name .and. emp_no = number Replace reg_rate with reg Replace ot_rate with ot Locate for emp_name = name .and. emp_no = number ***Computations RE=(reg_time+overtime)*reg_rate OE=overtime*ot_rate GE=RE=OE NE=GE-total_ded Locate for emp_name = name .and. emp_no = number Replace g_earnings with GE Replace n_earnings with NE