Search This Blog

Showing posts with label visual foxpro. Show all posts
Showing posts with label visual foxpro. Show all posts

General Ledger Prooflist


The Daily Transaction Prooflist Report shows all the information for individual journal entries or account chart that were inputted for a particular date.  The report is used to verify accuracy and completeness on journal entries for a particular day prior to posting. The report can be generated by indicating the Reference Date and Branch.

Release Block User Code

In any login code, aside from status login, logout, I also made use of block. A user has a status of block if his username and password dis not match thrice in a row. This will help in the security of accessing the program.

PUBLIC pBlockUser
IF !EMPTY(THISFORM.Text2.Value)
IF THISFORM.Text4.Value = "BLOCK"
pBlockUser = THISFORM.Text3.Value
lAnswer = MESSAGEBOX("Do you want to release "+ALLTRIM(pBlockUser)+"?", 4, "Confirmation")
IF lAnswer = 6
SELECT SviewAccess
LOCATE FOR IdNum = THISFORM.Text2.Value
IF FOUND()
REPLACE AccessStatus WITH "LOGOUT"
=MESSAGEBOX("Successfully release "+ALLTRIM(pBlockUser)+" .", "Confirmation")
THISFORM.Grid1.REFRESH
ENDIF
ENDIF
ELSE
=MESSAGEBOX("Select a Block User.", "Confirmation")
ENDIF
ELSE
=MESSAGEBOX("Select User.", "Confirmation")
ENDIF

Login Form


Fill-out the Username, Password and Branch field and click the OK button to continue. The following spaces should be filled with correct Username, Password and desired Branch to continue. Selected branch will give you information and data for that branch only.

Determining First Character

If you wwould like to determine the first character or first three characters etc of your textbox, you can use below foxpro codes:

THISFORM.Text1.VALUE = LEFT(TRANS(THISFORM.Text2.Value),1)

Main Program

SET CLASSLIB TO C:\GenLed\Classlib\frame
SET CLASSLIB TO C:\GenLed\Classlib\basectrl ADDITIVE
SET CLASSLIB TO C:\GenLed\Classlib\DeBrief
_screen.picture = "C:\GenLed\Images\background.bmp"

SET CENTURY ON
SET CENTURY TO 19 ROLLOVER 60
SET EXCLUSIVE OFF

RUN NumToWords

DO FORM "C:\GenLed\Forms\Login"

ON SHUTDOWN QUIT
MainApp = CREATEOBJECT("DEBRIEF", "FMLFC GENLED - Accounting Systematic Tool")
MainApp.ReadEvents()

SET CLASSLIB TO
RETURN

Add Image on FoxPro Background

Are you bored on all white background of your FoxPro Program? Now you can pick or put a background image on your program. Just include this line of code on your main program and specify the locatin of the image.

_screen.picture = "C:\GenLed\Images\background.bmp"

Login Code

Login Code

SELECT SviewAccess
=REQUERY("SviewAccess")
PUBLIC pCurrUser, pBranchName
LOCATE FOR ALLTRIM(LOWER(Username)) = ALLTRIM(LOWER(THISFORM.Text1.Value))
IF FOUND()
IF ALLTRIM(AccessStatus) = "LOGOUT"
IF THISFORM.Text3.Value = 3
WAIT WINDOW "Three (3) incorrect attempts." NOWAIT
REPLACE SviewAccess.AccessStatus WITH "BLOCK"
THISFORM.Release()
QUIT
ELSE
IF EMPTY(ALLTRIM(THISFORM.Text2.Value))
WAIT WINDOW "Cannot continue without password." NOWAIT
ELSE
IF EMPTY(ALLTRIM(THISFORM.Combo1.Value))
WAIT WINDOW "Cannot continue without Branch Office." NOWAIT
ELSE
IF LOWER(ALLTRIM(Password)) == LOWER(ALLTRIM(THISFORM.Text2.Value))
WAIT WINDOW "Welcome " + Username NOWAIT
pDept = ALLTRIM(sviewaccess.AccessDepartment)
pCurrUser = ALLTRIM(Username)
pFullName = ALLTRIM(FullName)
pPassword = ALLTRIM(sViewAccess.Password)
pBranchName = ALLTRIM(THISFORM.Combo1.Value)
IF (ALLTRIM(THISFORM.Text1.Value)) = "MUFFIE"
ELSE
REPLACE SviewAccess.AccessStatus WITH "LOGIN"
ENDIF
THISFORM.ActivityLogin()
SELECT SviewAccess
=TABLEUPDATE(.T.)
THISFORM.Release()
=REQUERY("SviewAccess")
ELSE
WAIT WINDOW "Incorrect Password." NOWAIT
THISFORM.Text3.Value = THISFORM.Text3.Value + 1
THISFORM.Text2.SetFocus()
ENDIF
ENDIF
ENDIF
ENDIF
ELSE
=MESSAGEBOX("User currently Logged In : "+ ALLTRIM(SviewAccess.FullName)+" station.", "MultiUser: Block")
ENDIF
ENDIF

Local View and Remote View

Samples of Local View and Remote View with different filter using like, between and =.

SELECT SviewAccountChart
lAccountCode = ALLTRIM(THISFORM.Text16.Value)+"%"
=REQUERY("SviewAccountChart")

SELECT SviewJvHeader
lJvNo = ALLTRIM(THISFORM.Text20.Value)+"%"
lJvBranch = ALLTRIM(THISFORM.Text21.Value)+"%"
=REQUERY("SviewJvHeader")

SELECT SviewCheckIssueReg
lCheckNum = ALLTRIM(THISFORM.Text20.Value)+"%"
lCheckType = ALLTRIM(THISFORM.Combo3.Value)+"%"
StartDate = THISFORM.Text14.Value
EndDate = THISFORM.Text15.Value
=REQUERY("SviewCheckIssueReg")