Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
OTHER >>  SAMPLE DATA AS TEXT TO POST ON FORUMS

  Cetin Basoz
  Where is Cetin Basoz?
 Izmir
 Turkey
 Cetin Basoz



We often see SQL with or w/o some accompanying sample data. Sometimes one needs to create cursors with data in them for testing purposes before replying. Unfortunately posters seldomly post code to create that test data. Sometimes they include some 'list' style plain text to represent how their data looks like (better than nothing).
To make the life easier for all I created a variation of 'sampler' code that I posted to fox4um before. What does it do?
-Writes code to clipboard needed to create cursors for sample data
-Poster then could paste it in their messages to transfer part of their data as text

For example assume I have 2 cursors named t1 and t2 and a table on disk named "c:\my folder\myTable.dbf". I want to send 'all' records of t1 and t2 cursors + 3 records from myTable.dbf to show my problem. I'd do this:

At command window run:

SampleDataAsText("t1,0,t2,0,c:\my folder\myTable,3")

and then come here Ctrl+V to paste.

It's not bulletproof, doesn't of course make it for all datatypes but I think would still provide some benefit.

Here is the code:

*!*	*** Calling samples

*!*	
*!*	TEXT TO cSampleDataAsText TEXTMERGE noshow
*!*	myCursor1,0
*!*	myCursor2,0
*!*	MyCursor3,10
*!*	<<_samples+'data\Customer'>>,3
*!*	<<_samples+'data\Employee'>>,5
*!*	ENDTEXT

*!*	sampleDataAsText(m.cSampleDataAsText)

*!*	SampleDataAsText( ;
*!*	  'myCursor1,0,'+;
*!*	  'myCursor2,0,'+;
*!*	  'myCursor3,10,'+;
*!*	  _samples+'data\Customer,3,'+;
*!*	  _samples+'data\Employee,5' )

*!*	*** Calling is in pairs.
*!*	**First one is an alias of open cursor/table
*!*	**second specifies how many records to copy - 0 means all

* SampleDataAsText.prg
Lparameters tcInfo
LOCAL loCloseTemp, ix
loCloseTemp = CREATEOBJECT('CloseTemp')

LOCAL ARRAY laInfo[1]
Create Cursor crsSampler (procedureName m, procedureCode m)
For ix = 1 To ALINES(laInfo,m.tcInfo,1+4,',',CHR(13),CHR(10)) STEP 2
  GetProcedureCode(laInfo[m.ix],VAL(laInfo[m.ix+1]))
Endfor
DataCreationCodeToClip()
MESSAGEBOX('Data creation is copied to clipboard',0,'Sample Data',3000)

Procedure DataCreationCodeToClip
  Local Array aProcCode[1]
  Local lcTemp1,lcTemp2
  lcTemp1 = Sys(2015)+'.tmp'
  lcTemp2 = Sys(2015)+'.tmp'
  Select crsSampler
  Scan
    Strtofile(procedureName,m.lcTemp1,.T.)
    Strtofile(procedureCode,m.lcTemp2,.T.)
  Endscan
  _Cliptext = Filetostr(m.lcTemp1) + Filetostr(m.lcTemp2)
  Erase (m.lcTemp1)
  Erase (m.lcTemp2)
Endproc

Procedure GetProcedureCode(tcAlias,tnRecords)
  Local lcTemp, ix, lcData, lcRetVal
  lcTemp = Sys(2015)+'.tmp'
  If !Used(m.tcAlias)
    Select * From (m.tcAlias) Into Cursor crsSampling nofilter
    lcCursorName = Juststem(m.tcAlias)
  Else
    Select (m.tcAlias)
    lcCursorName = Alias()
  Endif
  Locate
  If Empty(m.tnRecords)
    Copy To (m.lcTemp) Type Delimited
  Else
    Copy To (m.lcTemp) Type Delimited Next m.tnRecords
  Endif
  lcData = Filetostr(m.lcTemp)
  Erase (m.lcTemp)

  Set Textmerge Delimiters To '%%','%%'
  Set Textmerge To (m.lcTemp) Noshow
  Set Textmerge On
\
\ Procedure CreateCursor_%%m.lcCursorName%%
\ LOCAL lcData, lcTemp
\ lcTemp = SYS(2015)+'.tmp'
\ TEXT TO m.lcData noshow
\ %%m.lcData%%
\ ENDTEXT
\
\ STRTOFILE(m.lcData,m.lcTemp)
\
\ create CURSOR %%m.lcCursorName%% ;
\ ( ;
  For ix=1 To Afields(aStruc)
\  %%IIF(m.ix > 1,',','')%%
\\%%aStruc[m.ix,1]%% %%aStruc[m.ix,2]%%(%%aStruc[m.ix,3]%%,%%aStruc[m.ix,4]%%)
\\ %%IIF(aStruc[m.ix,5],'',' NOT ')%% NULL
\\ %%IIF(aStruc[m.ix,6],'NOCPTRANS','')%% ;
  Endfor
\  )
\
\ APPEND FROM (m.lcTemp) TYPE delimited
\ ERASE (m.lcTemp)
\ endproc
  Set Textmerge To
  Set Textmerge Off
  Insert Into crsSampler Values (	Textmerge('CreateCursor_%%m.lcCursorName%%()%%CHR(13)+CHR(10)%%'), Filetostr(m.lcTemp) )
  Set Textmerge Delimiters
  Erase (m.lcTemp)
ENDPROC

** Class to close any cursors created after it was instantiated
** Author: Dragan Nedeljkovich
Define Class CloseTemp As Custom
  Dimension a1[1]
  nFiles=0
  Procedure Init
    This.nFiles=Aused(atemp)
    If This.nFiles > 0
      Acopy(atemp, This.a1)
    Else
      This.a1=""
    Endif
  endproc

  Procedure Destroy
    For i=1 To Aused(aNow)
      If Ascan(This.a1, aNow[i,1],-1,-1,1,2+4)=0
        Use In aNow[i,1]
      Endif
    Endfor
  endproc
Enddefine

FEEDBACK

vam prabu @ 10/29/2008 3:27:52 PM
I'm very new to Visual Foxpro.... I am an accountant. I purchased this Banking software... which got corrupted... Using Refox I got source code... Which I posted below.. From that I'm trying to create exe file. whichever the last *.mpr that menu only coming.... previous *.mpr menus not coming...

CMENUNAME = 'Company.mpr'
DO (m.CMENUNAME)
CMENUNAME = 'Users.mpr'
DO (m.CMENUNAME)
CMENUNAME = 'Transactions.mpr'
DO (m.CMENUNAME)
CMENUNAME = 'Deposits.mpr'
DO (m.CMENUNAME)
CMENUNAME = 'File.mpr'
DO (m.CMENUNAME)
---------------------------------------

LPARAMETERS LCALLEDBYSETPROC, LWITHOUTCOMPANYMENU
LOCAL LSV, NUSERCODE, LALREADYSV, CPATH, CFORMNAME, CMENUNAME, NTMPUSERCODE
IF CLOSEALLFORMS(' ')
M.NUSERCODE = 0
M.CFORMNAME = 'Login'
DO FORM &CFORMNAME TO M.NUSERCODE
IF M.NUSERCODE==0
IF M.LCALLEDBYSETPROC
QUIT
ENDIF
ELSE
M.CPATH = SYS(05)+CURDIR()
SET PATH TO (M.CPATH)
PUBCOMPANYOPENED = .F.
_SCREEN.CAPTION = 'Tag'
GETUSERCODEINFO(PUBUSERCODE, @M.LALREADYSV)
PUBUSERCODE = M.NUSERCODE
GETUSERCODEINFO(M.NUSERCODE, @M.LSV)
IF .NOT. M.LWITHOUTCOMPANYMENU
IF M.LSV .AND. .NOT. M.LALREADYSV
M.CMENUNAME = 'Company.mpr'
DO &CMENUNAME
M.CMENUNAME = 'Users.mpr'
DO &CMENUNAME
ENDIF
IF .NOT. M.LSV .AND. M.LALREADYSV
RELEASEUSERCOMPANYMENU()
ENDIF
ENDIF
DO OpenCompany.PRG
ENDIF
ENDIF
RETURN
ENDPROC
**
PROCEDURE ReleaseUserCompanyMenu
LOCAL I, CNOOFPADS, CPAD
M.CNOOFPADS = CNTPAD('_MSYSMENU')
FOR I = M.CNOOFPADS TO 1 STEP -1
M.CPAD = PRMPAD('_MSYSMENU', GETPAD('_MSYSMENU', I))
IF INLIST(UPPER(M.CPAD), 'USERS', 'COMPANY')
RELEASE PAD (M.CPAD) OF _MSYSMENU
ENDIF
NEXT
RETURN
ENDPROC
**
M.CMENUNAME = 'File.mpr'
DO &CMENUNAME
ENDPROC
**
**
PROCEDURE PrepAccReports
LPARAMETERS NTYPE, OFRM
LOCAL LHORIZONTAL, LHEADING, LCOMBINED, LINNER, LHEADTAMIL, COPENINGSTOCK, CCLOSINGSTOCK, CNETPROFIT, CNETLOSS, CGROSSPROFIT, CGROSSLOSS, NNOOFPARAMS
M.NNOOFPARAMS = PARAMETERS()
IF TYPE("m.oFrm")<>'O'
M.LINNER = .T.
ELSE
IF M.OFRM.BASECLASS<>'Form' .OR. UPPER(M.OFRM.CLASS)<>'FRMFROMTO'
M.LINNER = .T.
ENDIF
ENDIF
IF M.NNOOFPARAMS<2 .OR. M.LINNER
SET CLASSLIB TO "D:\Visual.Fox\tecClassLib\tecReportClass" ALIAS TECREPORT ADDITIVE
M.OFRM = CREATEOBJECT('tecReport.FrmFromTo')
RELEASE CLASSLIB "D:\Visual.Fox\tecClassLib\tecReportClass"
ENDIF
WITH M.OFRM
M.LHORIZONTAL = .LHORIZONTAL
M.LHEADING = .LWITHHEADING
M.LCOMBINED = .LCOMBINE
M.LINNER = .LINNER
M.LHEADTAMIL = .LHEADTAMIL
M.LACCHEADTAMIL = .LACCHEADTAMIL
M.LDETAILTAMIL = .LDETAILTAMIL
IF M.LACCHEADTAMIL
M.COPENINGSTOCK = .CTOPENINGSTOCK
M.CCLOSINGSTOCK = .CTCLOSINGSTOCK
M.CGROSSPROFIT = .CTGROSSPROFIT
M.CGROSSLOSS = .CTGROSSLOSS
M.CNETPROFIT = .CTNETPROFIT
M.CNETLOSS = .CTNETLOSS
ELSE
M.COPENINGSTOCK = .COPENINGSTOCK
M.CCLOSINGSTOCK = .CCLOSINGSTOCK
M.CGROSSPROFIT = .CGROSSPROFIT
M.CGROSSLOSS = .CGROSSLOSS
M.CNETPROFIT = .CNETPROFIT
M.CNETLOSS = .CNETLOSS
ENDIF
ENDWITH
LOCAL NTRGRP, NGRP, NTOTAMT, NRECCOUNT, I, CCURALIAS, NGROSSPAY, NNETPAY, NDEBITERECNO, NCREDITERECNO, NPREVTRGRP, LRECALREADYPROCSSED, LOPHEADER, NCURRECNO, NSIDE, CPREVFILTER
M.CCURALIAS = SELECT()
SELECT ('TrialBal')
SET ORDER TO ACCREPORTS
M.NGROSSPAY = GETGROSSPAY()
M.NNETPAY = GETNETPAY(M.NGROSSPAY)
IF M.NTYPE==03
REPLACE TRIALBAL.AMOUNT WITH -TRIALBAL.AMOUNT ALL FOR TRIALBAL.HEADER=='C' IN 'TrialBal'
ENDIF
M.NPREVTRGRP = -1
M.NSIDE = -1
M.LRECALREADYPROCSSED = .F.
M.LOPHEADER = .F.
M.CPREVFILTER = FILTER('TrialBal')
SETFILTERTOTRIALBAL(00, M.NTYPE, M.CPREVFILTER)
IF M.NTYPE==02 .OR. M.NTYPE==03
IF M.NTYPE==02
M.NTOTAMT = M.NGROSSPAY
M.CTEMP = IIF(M.NGROSSPAY>0, M.CGROSSPROFIT, M.CGROSSLOSS)
ENDIF
IF M.NTYPE==03
M.NTOTAMT = M.NNETPAY
M.CTEMP = IIF(M.NNETPAY>0, M.CNETPROFIT, M.CNETLOSS)
ENDIF
IF M.NTOTAMT<0
REPCURSACCDEBIT(M.CTEMP, 'A', -M.NTOTAMT)
M.NSIDE = 00
ELSE
REPCURSACCCREDIT(M.CTEMP, 'A', M.NTOTAMT)
M.NSIDE = 01
ENDIF
ENDIF
IF M.NSIDE==01 .AND. M.LHORIZONTAL
GOTO TOP IN 'cursAcc'
ENDIF
GOTO TOP IN 'TrialBal'
DO WHILE .NOT. EOF('TrialBal')
IF M.LOPHEADER .AND. (M.NPREVTRGRP<>TRIALBAL.TRGRPCODE .OR. TRIALBAL.HEADER<>'O' .AND. TRIALBAL.HEADER<>'C')
M.LOPHEADER = .F.
REPCURSACCDEBIT('', '')
ENDIF
IF (TRIALBAL.HEADER=='O' .OR. TRIALBAL.HEADER=='C') .AND. TRIALBAL.TRGRPCODE<>M.NPREVTRGRP .AND. (TRIALBAL.AMOUNT+TRIALBAL.OPENBAL)<0
M.NPREVTRGRP = TRIALBAL.TRGRPCODE
M.LOPHEADER = .T.
M.CTEMP = IIF(TRIALBAL.HEADER=='O', M.COPENINGSTOCK, M.CCLOSINGSTOCK)
REPCURSACCDEBIT(M.CTEMP, 'H')
ENDIF
IF M.LCOMBINED .AND. TRIALBAL.COMBINE
M.NTRGRP = TRIALBAL.TRGRPCODE
M.NGRP = TRIALBAL.GRPCODE
M.NTOTAMT = 0
DO WHILE .NOT. EOF('TrialBal') .AND. TRIALBAL.COMBINE .AND. TRIALBAL.TRGRPCODE==M.NTRGRP .AND. TRIALBAL.GRPCODE==M.NGRP
M.NTOTAMT = M.NTOTAMT+TRIALBAL.AMOUNT+TRIALBAL.OPENBAL
SKIP IN 'TrialBal'
ENDDO
SKIP -1 IN 'TrialBal'
M.LRECALREADYPROCSSED = .T.
IF M.NTOTAMT<0
IF M.NPREVTRGRP<>M.NTRGRP .AND. M.LHEADING
IF M.LHEADTAMIL
REPCURSACCDEBIT(TRGRPCODETOTPGROUP(M.NTRGRP), 'H')
ELSE
REPCURSACCDEBIT(TRGRPCODETOPGROUP(M.NTRGRP), 'H')
ENDIF
M.NPREVTRGRP = M.NTRGRP
ENDIF
IF M.LHEADTAMIL
REPCURSACCDEBIT(ACCGRPCODETOTPGROUP(M.NGRP), 'A', -M.NTOTAMT)
ELSE
REPCURSACCDEBIT(ACCGRPCODETOPGROUP(M.NGRP), 'A', -M.NTOTAMT)
ENDIF
ENDIF
ELSE
M.LRECALREADYPROCSSED = .F.
ENDIF
IF (M.LINNER .AND. TRIALBAL.INNER .AND. .NOT. M.LRECALREADYPROCSSED)
M.NTRGRP = TRIALBAL.TRGRPCODE
M.NGRP = TRIALBAL.GRPCODE
M.NTOTAMT = 0
M.NRECCOUNT = 0
M.NCURRECNO = RECNO('TrialBal')
DO WHILE .NOT. EOF('TrialBal') .AND. TRIALBAL.INNER .AND. TRIALBAL.TRGRPCODE==M.NTRGRP .AND. TRIALBAL.GRPCODE==M.NGRP .AND. .NOT. (TRIALBAL.COMBINE .AND. M.LCOMBINED)
M.NRECCOUNT = M.NRECCOUNT+1
M.NTOTAMT = M.NTOTAMT+TRIALBAL.AMOUNT+TRIALBAL.OPENBAL
SKIP IN 'TrialBal'
ENDDO
IF M.NRECCOUNT>0
SKIP -1 IN 'TrialBal'
M.LRECALREADYPROCSSED = .T.
IF M.NTOTAMT<0
IF M.NPREVTRGRP<>M.NTRGRP .AND. M.LHEADING
IF M.LHEADTAMIL
REPCURSACCDEBIT(TRGRPCODETOTPGROUP(M.NTRGRP), 'H')
ELSE
REPCURSACCDEBIT(TRGRPCODETOPGROUP(M.NTRGRP), 'H')
ENDIF
M.NPREVTRGRP = M.NTRGRP
ENDIF
IF M.NRECCOUNT>1
GOTO M.NCURRECNO IN 'TrialBal'
FOR I = 1 TO M.NRECCOUNT
REPCURSACCDEBIT(TRIALBAL.DETAIL, TRIALBAL.HEADER, 0.0 , TRIALBAL.AMOUNT+TRIALBAL.OPENBAL)
SKIP IN 'TrialBal'
NEXT
SKIP -1 IN 'TrialBal'
REPCURSACCDEBIT('', '=', -M.NTOTAMT)
ELSE
REPCURSACCDEBIT(TRIALBAL.DETAIL, TRIALBAL.HEADER, -(TRIALBAL.AMOUNT+TRIALBAL.OPENBAL), 0.0 )
ENDIF
ENDIF
ENDIF
ENDIF
IF .NOT. M.LRECALREADYPROCSSED .AND. (TRIALBAL.AMOUNT+TRIALBAL.OPENBAL)<0
IF M.LHEADING .AND. M.NPREVTRGRP<>TRIALBAL.TRGRPCODE .AND. TRIALBAL.TRGRPCODE>0 .AND. TRIALBAL.TRGRPCODE<999999
M.NPREVTRGRP = TRIALBAL.TRGRPCODE
IF M.LHEADTAMIL
REPCURSACCDEBIT(TRGRPCODETOTPGROUP(TRIALBAL.TRGRPCODE), 'H')
ELSE
REPCURSACCDEBIT(TRGRPCODETOPGROUP(TRIALBAL.TRGRPCODE), 'H')
ENDIF
ENDIF
REPCURSACCDEBIT(TRIALBAL.DETAIL, TRIALBAL.HEADER, ABS(TRIALBAL.AMOUNT+TRIALBAL.OPENBAL))
ENDIF
IF .NOT. EOF('TrialBal')
SKIP IN 'TrialBal'
ENDIF
ENDDO
M.NDEBITERECNO = IIF(EOF('cursAcc'), RECNO('cursAcc')-1, RECNO('cursAcc'))
SETFILTERTOTRIALBAL(01, M.NTYPE, M.CPREVFILTER)
GOTO TOP IN 'TrialBal'
IF M.LHORIZONTAL
GOTO TOP IN 'cursAcc'
IF M.NSIDE==01
SKIP IN 'cursAcc'
ENDIF
ENDIF
M.NPREVTRGRP = -1
M.LOPHEADER = .F.
M.LRECALREADYPROCSSED = .F.
DO WHILE .NOT. EOF('TrialBal')
IF M.LOPHEADER .AND. (M.NPREVTRGRP<>TRIALBAL.TRGRPCODE .OR. TRIALBAL.HEADER<>'C')
M.LOPHEADER = .F.
REPCURSACCCREDIT('', '')
ENDIF
IF TRIALBAL.HEADER=='C' .AND. TRIALBAL.TRGRPCODE<>M.NPREVTRGRP
M.NPREVTRGRP = TRIALBAL.TRGRPCODE
M.LOPHEADER = .T.
REPCURSACCCREDIT(M.CCLOSINGSTOCK, 'H')
ENDIF
IF M.LCOMBINED .AND. TRIALBAL.COMBINE
M.NTRGRP = TRIALBAL.TRGRPCODE
M.NGRP = TRIALBAL.GRPCODE
M.NTOTAMT = 0
DO WHILE .NOT. EOF('TrialBal') .AND. TRIALBAL.COMBINE .AND. TRIALBAL.TRGRPCODE==M.NTRGRP .AND. TRIALBAL.GRPCODE==M.NGRP
M.NTOTAMT = M.NTOTAMT+TRIALBAL.AMOUNT+TRIALBAL.OPENBAL
SKIP IN 'TrialBal'
ENDDO
SKIP -1 IN 'TrialBal'
M.LRECALREADYPROCSSED = .T.
IF M.NTOTAMT>-1
IF M.NPREVTRGRP<>M.NTRGRP .AND. M.LHEADING
IF M.LHEADTAMIL
REPCURSACCCREDIT(TRGRPCODETOTPGROUP(M.NTRGRP), 'H')
ELSE
REPCURSACCCREDIT(TRGRPCODETOPGROUP(M.NTRGRP), 'H')
ENDIF
M.NPREVTRGRP = M.NTRGRP
ENDIF
IF M.LHEADTAMIL
REPCURSACCCREDIT(ACCGRPCODETOTPGROUP(M.NGRP), 'A', M.NTOTAMT)
ELSE
REPCURSACCCREDIT(ACCGRPCODETOPGROUP(M.NGRP), 'A', M.NTOTAMT)
ENDIF
ENDIF
ELSE
M.LRECALREADYPROCSSED = .F.
ENDIF
IF (M.LINNER .AND. TRIALBAL.INNER .AND. .NOT. M.LRECALREADYPROCSSED)
M.NTRGRP = TRIALBAL.TRGRPCODE
M.NGRP = TRIALBAL.GRPCODE
M.NTOTAMT = 0
M.NRECCOUNT = 0
M.NCURRECNO = RECNO('TrialBal')
DO WHILE .NOT. EOF('TrialBal') .AND. TRIALBAL.INNER .AND. TRIALBAL.TRGRPCODE==M.NTRGRP .AND. TRIALBAL.GRPCODE==M.NGRP .AND. (( .NOT. TRIALBAL.COMBINE .AND. M.LCOMBINED) .OR. .NOT. M.LCOMBINED)
M.NRECCOUNT = M.NRECCOUNT+1
M.NTOTAMT = M.NTOTAMT+TRIALBAL.AMOUNT+TRIALBAL.OPENBAL
SKIP IN 'TrialBal'
ENDDO
SKIP -1 IN 'TrialBal'
IF M.NRECCOUNT>0
M.LRECALREADYPROCSSED = .T.
IF M.NTOTAMT>-1
IF M.NPREVTRGRP<>M.NTRGRP .AND. M.LHEADING
IF M.LHEADTAMIL
REPCURSACCCREDIT(TRGRPCODETOTPGROUP(M.NTRGRP), 'H')
ELSE
REPCURSACCCREDIT(TRGRPCODETOPGROUP(M.NTRGRP), 'H')
ENDIF
M.NPREVTRGRP = M.NTRGRP
ENDIF
IF M.NRECCOUNT>1
GOTO M.NCURRECNO IN 'TrialBal'
FOR I = 1 TO M.NRECCOUNT
REPCURSACCCREDIT(TRIALBAL.DETAIL, TRIALBAL.HEADER, 0.0 , TRIALBAL.AMOUNT+TRIALBAL.OPENBAL)
SKIP IN 'TrialBal'
NEXT
REPCURSACCCREDIT('', '=', M.NTOTAMT)
SKIP -1 IN 'TrialBal'
ELSE
REPCURSACCCREDIT(TRIALBAL.DETAIL, TRIALBAL.HEADER, TRIALBAL.AMOUNT+TRIALBAL.OPENBAL, 0.0 )
ENDIF
ENDIF
ENDIF
ENDIF
IF .NOT. M.LRECALREADYPROCSSED .AND. (TRIALBAL.AMOUNT+TRIALBAL.OPENBAL)>-1
IF M.LHEADING .AND. M.NPREVTRGRP<>TRIALBAL.TRGRPCODE .AND. TRIALBAL.TRGRPCODE<999999
M.NPREVTRGRP = TRIALBAL.TRGRPCODE
IF M.LHEADTAMIL
REPCURSACCCREDIT(TRGRPCODETOTPGROUP(TRIALBAL.TRGRPCODE), 'H')
ELSE
REPCURSACCCREDIT(TRGRPCODETOPGROUP(TRIALBAL.TRGRPCODE), 'H')
ENDIF
ENDIF
REPCURSACCCREDIT(TRIALBAL.DETAIL, TRIALBAL.HEADER, TRIALBAL.AMOUNT+TRIALBAL.OPENBAL)
ENDIF
IF .NOT. EOF('TrialBal')
SKIP IN 'TrialBal'
ENDIF
ENDDO
M.NCREDITERECNO = IIF(EOF('cursAcc'), RECNO('cursAcc')-1, RECNO('cursAcc'))
DO CASE
CASE M.NTYPE==01
M.CTEMP = IIF(M.NGROSSPAY>0, M.CGROSSPROFIT, M.CGROSSLOSS)
M.NTOTAMT = M.NGROSSPAY
CASE M.NTYPE==02 .OR. M.NTYPE==04
M.CTEMP = IIF(M.NNETPAY>0, M.CNETPROFIT, M.CNETLOSS)
M.NTOTAMT = M.NNETPAY
ENDCASE
IF M.NTYPE==01 .OR. M.NTYPE==02 .OR. M.NTYPE==04
IF M.NTOTAMT>0
IF M.NDEBITERECNO>0
GOTO M.NDEBITERECNO IN 'cursAcc'
ENDIF
IF .NOT. M.LHORIZONTAL
GOTO BOTTOM IN 'cursAcc'
ENDIF
IF .NOT. EOF('cursAcc')
SKIP IN 'cursAcc'
ENDIF
REPCURSACCDEBIT('', '')
REPCURSACCDEBIT(M.CTEMP, 'A', M.NTOTAMT)
ELSE
REPCURSACCCREDIT('', '')
REPCURSACCCREDIT(M.CTEMP, 'A', -M.NTOTAMT)
ENDIF
ENDIF
SET FILTER TO
SELECT (M.CCURALIAS)
RETURN
ENDPROC
**
PROCEDURE RepcursAccDebit
LPARAMETERS CDETAIL, CHEADER, NAMOUNT, NINAMOUNT
LOCAL NNOOFPARAM, LRVAL
M.LRVAL = .T.
M.NNOOFPARAM = PARAMETERS()
IF M.NNOOFPARAM<4
M.NINAMOUNT = 0.0
ENDIF
IF M.NNOOFPARAM<3
M.NAMOUNT = 0.0
ENDIF
IF M.NNOOFPARAM>=2
IF EOF('cursAcc')
APPEND IN 'cursAcc' BLANK
ENDIF
REPLACE CURSACC.DDETAIL WITH M.CDETAIL, CURSACC.DHEADER WITH M.CHEADER, CURSACC.DAMOUNT WITH M.NAMOUNT, CURSACC.DINAMOUNT WITH M.NINAMOUNT IN 'cursAcc'
IF .NOT. EOF('cursAcc')
SKIP IN 'cursAcc'
ENDIF
ELSE
M.LRVAL = .F.
ENDIF
RETURN M.LRVAL
ENDPROC
**
PROCEDURE RepcursAccCredit
LPARAMETERS CDETAIL, CHEADER, NAMOUNT, NINAMOUNT
LOCAL NNOOFPARAM, LRVAL
M.LRVAL = .T.
M.NNOOFPARAM = PARAMETERS()
IF M.NNOOFPARAM<4
M.NINAMOUNT = 0.0
ENDIF
IF M.NNOOFPARAM<3
M.NAMOUNT = 0.0
ENDIF
IF M.NNOOFPARAM>=2
IF EOF('cursAcc')
APPEND IN 'cursAcc' BLANK
ENDIF
REPLACE CURSACC.CDETAIL WITH M.CDETAIL, CURSACC.CHEADER WITH M.CHEADER, CURSACC.CAMOUNT WITH M.NAMOUNT, CURSACC.CINAMOUNT WITH M.NINAMOUNT IN 'cursAcc'
IF .NOT. EOF('cursAcc')
SKIP IN 'cursAcc'
ENDIF
ELSE
M.LRVAL = .F.
ENDIF
RETURN M.LRVAL
ENDPROC
**
PROCEDURE GetGrossPay
LOCAL NGROSSPAY, CCURALIAS, NDBCRCLAMT, NOPAMT
M.NDBCRCLAMT = 0
M.NOPAMT = 0
M.NGROSSPAY = 0
M.CCURALIAS = SELECT()
SELECT 'TrialBal'
GOTO TOP IN 'TrialBal'
SUM AMOUNT+OPENBAL TO M.NGROSSPAY FOR HEADER=='O' .OR. HEADER=='C' .OR. TYPE==01
SELECT (M.CCURALIAS)
RETURN M.NGROSSPAY
ENDPROC
**
PROCEDURE GetNetPay
LPARAMETERS NGROSSPAY
LOCAL NNETPAY, NNOOFPARAM, CCURALIAS
M.NNOOFPARAM = PARAMETERS()
IF M.NNOOFPARAM<1
M.NGROSSPAY = GETGROSSPAY()
ENDIF
M.CCURALIAS = SELECT()
SELECT 'TrialBal'
GOTO TOP IN 'TrialBal'
SUM AMOUNT+OPENBAL TO M.NNETPAY FOR TYPE==02
M.NNETPAY = M.NNETPAY+M.NGROSSPAY
SELECT (M.CCURALIAS)
RETURN M.NNETPAY
ENDPROC
**
PROCEDURE NetPay
LPARAMETERS NNETPAY
LOCAL CCURALIAS, NGROSSPAY
M.NGROSSPAY = GETGROSSPAY()
M.CCURALIAS = SELECT()
SELECT 'TrialBal'
GOTO TOP IN 'TrialBal'
SUM AMOUNT+OPENBAL TO M.NNETPAY FOR TYPE==02
M.NNETPAY = M.NNETPAY+M.NGROSSPAY
SELECT (M.CCURALIAS)
RETURN
ENDPROC
**
PROCEDURE SetFilterToTrialBal
LPARAMETERS NSIDE, NTYPE, CPREVFILTER
LOCAL CFILTER
IF EMPTY(M.CPREVFILTER)
M.CFILTER = '.T.'
ELSE
M.CFILTER = M.CPREVFILTER
ENDIF
M.CFILTER = M.CFILTER+".and.(TrialBal->AMOUNT + TrialBal->OPENBAL )!= 0"
DO CASE
CASE M.NTYPE==01
IF M.NSIDE==00
SET FILTER TO ( TRIALBAL->TYPE == 01 .OR. TRIALBAL->HEADER == 'O' ) .AND. &CFILTER
ELSE
SET FILTER TO ( TRIALBAL->TYPE == 01 .OR. TRIALBAL->HEADER == 'C' ) .AND. &CFILTER
ENDIF
CASE M.NTYPE==02
SET FILTER TO TRIALBAL->TYPE == 02 .AND. &CFILTER
CASE M.NTYPE==03
IF M.NSIDE==00
SET FILTER TO ( TRIALBAL->TYPE == 03 .OR. TRIALBAL->HEADER == 'C' ) .AND. &CFILTER
ELSE
SET FILTER TO TRIALBAL->TYPE == 03 .AND. &CFILTERLPARAMETERS NACTCTRLCASE
LOCAL OACTCTRL, CNEWTEXT, CTEXT, LCOMBOBOX
M.OACTCTRL = GETACTIVECONTROL()
IF TYPE("m.oActCtrl")=="O"
WITH M.OACTCTRL
M.LCOMBOBOX = UPPER(.BASECLASS)=='COMBOBOX'
M.CTEXT = IIF(M.LCOMBOBOX, .DISPLAYVALUE, .VALUE)
IF .SELLENGTH==0
M.CTEXT = GETCTRLCASE(M.NACTCTRLCASE, M.CTEXT)
ELSE
M.CNEWTEXT = GETCTRLCASE(M.NACTCTRLCASE, .SELTEXT)
M.CTEXT = STUFF(M.CTEXT, .SELSTART+1, .SELLENGTH, M.CNEWTEXT)
ENDIF
IF M.LCOMBOBOX
.DISPLAYVALUE = M.CTEXT
ELSE
.VALUE = M.CTEXT
ENDIF
ENDWITH
ENDIF
RETURN
ENDPROC
**
PROCEDURE GetActiveControl
LOCAL OACTIVECTRL, I, J
IF TYPE("_SCREEN.ActiveForm.ActiveControl")=="O"
M.OACTIVECTRL = _SCREEN.ACTIVEFORM.ACTIVECONTROL
IF .NOT. VALIDCTRL(M.OACTIVECTRL)
WITH M.OACTIVECTRL
IF UPPER(.BASECLASS)=='GRID'
I = 1
DO WHILE .COLUMNS(I).COLUMNORDER<>.ACTIVECOLUMN
I = I+1
ENDDO
WITH .COLUMNS(I)
J = 1
DO WHILE .CONTROLS(J).NAME<>.CURRENTCONTROL
J = J+1
ENDDO
IF VALIDCTRL(.CONTROLS(J))
M.OACTIVECTRL = .CONTROLS(J)
ELSE
M.OACTIVECTRL = .F.
ENDIF
ENDWITH
ELSE
M.OACTIVECTRL = .F.
ENDIF
ENDWITH
ENDIF
ENDIF
RETURN M.OACTIVECTRL
ENDPROC
**
PROCEDURE ValidCtrl
LPARAMETERS OACTCTRL
LOCAL LRVAL, CBASECLASS
M.CBASECLASS = UPPER(M.OACTCTRL.BASECLASS)
M.LRVAL = (M.CBASECLASS=='TEXTBOX' .OR. M.CBASECLASS=='EDITBOX') .OR. (M.CBASECLASS=='COMBOBOX' .AND. M.OACTCTRL.STYLE==0) .AND. .NOT. M.OACTCTRL.READONLY
RETURN M.LRVAL
ENDPROC
**
PROCEDURE GetCtrlCase
LPARAMETERS NOPTION, UVAL
IF TYPE("m.uVal")=="C"
DO CASE
CASE NOPTION==1
M.UVAL = UPPER(M.UVAL)
CASE NOPTION==2
M.UVAL = LOWER(M.UVAL)
CASE NOPTION==3
M.UVAL = PROPER(M.UVAL)
ENDCASE
ENDIF
RETURN M.UVAL
ENDPROC
**
**
PROCEDURE BillOrder
LPARAMETERS NITEMTYPE, NQTY
LOCAL NVALUE
M.NVALUE = 0
IF M.NQTY<0
M.NVALUE = 07
ELSE
DO CASE
CASE M.NITEMTYPE==3
M.NVALUE = 006
CASE M.NITEMTYPE==6
M.NVALUE = 008
CASE M.NITEMTYPE==4
M.NVALUE = 009
CASE M.NITEMTYPE==5
M.NVALUE = 010
OTHERWISE
M.NVALUE = 005
ENDCASE
ENDIF
RETURN STR(M.NVALUE, 3)
ENDPROC
**
DO FORM CheckFiles
RETURN .T.
ENDPROC
**
LPARAMETERS CFILENAME
PRIVATE LERR
M.LERR = .T.
ON ERROR DO ERRHAND
RESTORE MACROS FROM (M.CFILENAME)
ON ERROR
IF .NOT. M.LERR
ERASE (M.CFILENAME)
ENDIF
RETURN M.LERR
ENDPROC
**
PROCEDURE ErrHand
M.LERR = .F.
RETURN
ENDPROC
**
LOCAL OTAGHIST, OPATH
OTAGHIST = NEWOBJECT('TagHistory', 'J:\Visual.Fox\tecClassLib\TagUtils')
OPATH = NEWOBJECT('tecPath', 'J:\Visual.Fox\tecClassLib\tecTables')
IF OPATH.ISCOMPANYLEFTOPENED()
OTAGHIST.CLOSECOMPANY(PUBGCODE, PUBCCODE, PUBYEARNO)
ENDIF
OTAGHIST.DESTROY()
OPATH.DESTROY()
CLEAR EVENTS
ENDPROC
**

ENDIF
OTHERWISE
IF M.NSIDE==00
SET FILTER TO ( TRIALBAL->TYPE != 03 .OR. TRIALBAL->HEADER == 'O' ) .AND. &CFILTER
ELSE
SET FILTER TO ( TRIALBAL->TYPE != 03 .OR. TRIALBAL->HEADER == 'C' ) .AND. &CFILTER
ENDIF
ENDCASE
RETURN
ENDPROC
**
**
PROCEDURE DynamicMenu
LPARAMETERS NUSERCODE
IF .F.
LOCAL CCURLIB, OOBJ
M.CCURLIB = SET('CLASSLIB')
M.CLIBRARY = "j:\Visual.Fox\tecClassLib\DynamicMenu\tecMenu.VCX"
SET CLASSLIB TO &CLIBRARY
OOBJ = CREATEOBJECT("DefineMenu")
OOBJ.SETUSERMENU(M.NUSERCODE)
RELEASE OOBJ
IF EMPTY(M.CCURLIB)
SET CLASSLIB TO
ELSE
SET CLASSLIB TO &CCURLIB
ENDIF
ENDIF
RETURN
ENDPROC
**
**
PROCEDURE AcodeToYearOpenBal
LPARAMETERS NACODE
= SEEK(M.NACODE, 'OpenBal', 'ACODE')
RETURN OPENBAL.AMOUNT
ENDPROC
**
PROCEDURE AccGrpNoToGROUP
LPARAMETERS NGRPNO
= SEEK(NGRPNO, 'AccGroups', 'GRPNO')
RETURN ACCGROUPS.GROUP
ENDPROC
**
PROCEDURE AccGrpNoToPGROUP
LPARAMETERS NGRPNO
= SEEK(NGRPNO, 'AccGroups', 'GRPNO')
RETURN ACCGROUPS.PGROUP
ENDPROC
**
PROCEDURE AccGrpCodeToGROUP
LPARAMETERS NGRPCODE
= SEEK(NGRPCODE, 'AccGroups', 'GRPCODE')
RETURN ACCGROUPS.GROUP
ENDPROC
**
PROCEDURE AccGrpCodeToPGROUP
LPARAMETERS NGRPCODE
= SEEK(NGRPCODE, 'AccGroups', 'GRPCODE')
RETURN ACCGROUPS.PGROUP
ENDPROC
**
PROCEDURE AccGrpCodeToTGROUP
LPARAMETERS NGRPCODE
= SEEK(NGRPCODE, 'AccGroups', 'GRPCODE')
RETURN ACCGROUPS.TGROUP
ENDPROC
**
PROCEDURE AccGrpCodeToTPGROUP
LPARAMETERS NGRPCODE
= SEEK(NGRPCODE, 'AccGroups', 'GRPCODE')
RETURN ACCGROUPS.TPGROUP
ENDPROC
**
PROCEDURE TrGrpNoToGROUP
LPARAMETERS NTRGRPNO
= SEEK(M.NTRGRPNO, 'TrGroups', 'GRPCODE')
RETURN TRGROUPS.GROUP
ENDPROC
**
PROCEDURE TrGrpNoToPGROUP
LPARAMETERS NTRGRPNO
= SEEK(M.NTRGRPNO, 'TrGroups', 'GRPCODE')
RETURN TRGROUPS.PGROUP
ENDPROC
**
PROCEDURE TrGrpCodeToGROUP
LPARAMETERS NTRGRPCODE
= SEEK(M.NTRGRPCODE, 'TrGroups', 'GRPCODE')
RETURN TRGROUPS.GROUP
ENDPROC
**
PROCEDURE TrGrpCodeToPGROUP
LPARAMETERS NTRGRPCODE
= SEEK(M.NTRGRPCODE, 'TrGroups', 'GRPCODE')
RETURN TRGROUPS.PGROUP
ENDPROC
**
PROCEDURE TrGrpCodeToTGROUP
LPARAMETERS NGRPCODE
= SEEK(NGRPCODE, 'TrGroups', 'GRPCODE')
RETURN TRGROUPS.TGROUP
ENDPROC
**
PROCEDURE TrGrpCodeToTPGROUP
LPARAMETERS NGRPCODE
= SEEK(NGRPCODE, 'TrGroups', 'GRPCODE')
RETURN TRGROUPS.TPGROUP
ENDPROC
**
PROCEDURE ItemGrpNoToGROUP
LPARAMETERS NGRPNO
= SEEK(NGRPNO, 'ItemGroups', 'GRPNO')
RETURN ITEMGROUPS.GROUP
ENDPROC
**
PROCEDURE ItemGrpNoToPGROUP
LPARAMETERS NGRPNO
= SEEK(NGRPNO, 'ItemGroups', 'GRPNO')
RETURN ITEMGROUPS.PGROUP
ENDPROC
**
PROCEDURE ItemTrGrpNoToGROUP
LPARAMETERS NTRGRPNO
= SEEK(NTRGRPNO, 'ItemTrGroups', 'GRPNO')
RETURN ITEMTRGROUPS.GROUP
ENDPROC
**
PROCEDURE ItemTrGrpNoToPGROUP
LPARAMETERS NTRGRPNO
= SEEK(NTRGRPNO, 'ItemTrGroups', 'GRPNO')
RETURN ITEMTRGROUPS.PGROUP
ENDPROC
**
PROCEDURE ItemGrpCodeToGROUP
LPARAMETERS NGRPCODE
= SEEK(NGRPCODE, 'ItemGroups', 'GRPCODE')
RETURN ITEMGROUPS.GROUP
ENDPROC
**
PROCEDURE ItemGrpCodeToPGROUP
LPARAMETERS NGRPCODE
= SEEK(NGRPCODE, 'ItemGroups', 'GRPCODE')
RETURN ITEMGROUPS.PGROUP
ENDPROC
**
PROCEDURE ItemGrpCodeToTGROUP
LPARAMETERS NGRPCODE
= SEEK(NGRPCODE, 'ItemGroups', 'GRPCODE')
RETURN ITEMGROUPS.TGROUP
ENDPROC
**
PROCEDURE ItemGrpCodeToTPGROUP
LPARAMETERS NGRPCODE
= SEEK(NGRPCODE, 'ItemGroups', 'GRPCODE')
RETURN ITEMGROUPS.TPGROUP
ENDPROC
**
PROCEDURE ItemTrGrpCodeToGROUP
LPARAMETERS NGRPCODE
= SEEK(NGRPCODE, 'ItemTrGroups', 'GRPCODE')
RETURN ITEMTRGROUPS.GROUP
ENDPROC
**
PROCEDURE ItemTrGrpCodeToPGROUP
LPARAMETERS NGRPCODE
= SEEK(NGRPCODE, 'ItemTrGroups', 'GRPCODE')
RETURN ITEMTRGROUPS.PGROUP
ENDPROC
**
PROCEDURE ItemTrGrpCodeToTGROUP
LPARAMETERS NGRPCODE
= SEEK(NGRPCODE, 'ItemTrGroups', 'GRPCODE')
RETURN ITEMTRGROUPS.TGROUP
ENDPROC
**
PROCEDURE ItemTrGrpCodeToTPGROUP
LPARAMETERS NGRPCODE
= SEEK(NGRPCODE, 'ItemTrGroups', 'GRPCODE')
RETURN ITEMTRGROUPS.TPGROUP
ENDPROC
**
PROCEDURE AcodeToAcc
LPARAMETERS NACODE
= SEEK(NACODE, 'Accounts', 'ACODE')
RETURN ACCOUNTS.ACC
ENDPROC
**
PROCEDURE AcodeToTAcc
LPARAMETERS NACODE
= SEEK(NACODE, 'Accounts', 'ACODE')
RETURN ACCOUNTS.TACC
ENDPROC
**
PROCEDURE AcodeToPACC
LPARAMETERS NACODE
IF NACODE==-1
RETURN 'Opening Balance'
ELSE
= SEEK(NACODE, 'Accounts', 'ACODE')
RETURN ACCOUNTS.PACC
ENDIF
ENDPROC
**
PROCEDURE AcodeToTPACC
LPARAMETERS NACODE
= SEEK(NACODE, 'Accounts', 'ACODE')
RETURN ACCOUNTS.TPACC
ENDPROC
**
PROCEDURE AcodeToGRPNO
LPARAMETERS NACODE
= SEEK(NACODE, 'Accounts', 'ACODE')
RETURN ACCOUNTS.GRPNO
ENDPROC
**
PROCEDURE AcodeToTRGRPNO
LPARAMETERS NACODE
= SEEK(NACODE, 'Accounts', 'ACODE')
RETURN ACCOUNTS.TRGRPNO
ENDPROC
**
PROCEDURE AcodeToGRPCODE
LPARAMETERS NACODE
= SEEK(NACODE, 'Accounts', 'ACODE')
= SEEK(ACCOUNTS.GRPNO, 'AccGroups', 'GRPNO')
RETURN ACCGROUPS.GRPCODE
ENDPROC
**
PROCEDURE AcodeToTRGRPCODE
LPARAMETERS NACODE
= SEEK(NACODE, 'Accounts', 'ACODE')
= SEEK(ACCOUNTS.TRGRPNO, 'TrGroups', 'GRPNO')
RETURN TRGROUPS.GRPCODE
ENDPROC
**
PROCEDURE AccToAcode
LPARAMETERS CACC
= SEEK(UPPER(CACC), 'Accounts', 'ACCOUNT')
RETURN ACCOUNTS.ACODE
ENDPROC
**
PROCEDURE AcodeToBillBookNo
LPARAMETERS NACODE
= SEEK(NACODE, 'Accounts', 'ACODE')
RETURN ACCOUNTS.BILLBOOKNO
ENDPROC
**
PROCEDURE AcodeToAddress
LPARAMETERS NACODE
= SEEK(NACODE, 'AccExt', 'ACODE')
RETURN ACCEXT.ADDRESS
ENDPROC
**
PROCEDURE AcodeToSAddress
LPARAMETERS NACODE
= SEEK(NACODE, 'AccExt', 'ACODE')
RETURN ACCEXT.SADDRESS
ENDPROC
**
PROCEDURE AcodeToTAddress
LPARAMETERS NACODE
= SEEK(NACODE, 'AccExt', 'ACODE')
RETURN ACCEXT.TADDRESS
ENDPROC
**
PROCEDURE AcodeToCity
LPARAMETERS NACODE
= SEEK(NACODE, 'AccExt', 'ACODE')
= SEEK(ACCEXT.CITYCODE, 'Cities', 'CITYCODE')
RETURN CITIES.CITY
ENDPROC
**
PROCEDURE AcodeToTCity
LPARAMETERS NACODE
= SEEK(NACODE, 'AccExt', 'ACODE')
= SEEK(ACCEXT.CITYCODE, 'Cities', 'CITYCODE')
RETURN CITIES.TCITY
ENDPROC
**
PROCEDURE AcodeToArea
LPARAMETERS NACODE
= SEEK(NACODE, 'AccExt', 'ACODE')
= SEEK(ACCEXT.AREACODE, 'Areas', 'AREACODE')
RETURN AREAS.AREA
ENDPROC
**
PROCEDURE AreaCodetoArea
LPARAMETERS NAREACODE
= SEEK(M.NAREACODE, 'Areas', 'AREACODE')
RETURN AREAS.AREA
ENDPROC
**
PROCEDURE AcodeToCategory
LPARAMETERS NACODE
= SEEK(NACODE, 'AccExt', 'ACODE')
= SEEK(ACCEXT.CATECODE, 'Categories', 'CATECODE')
RETURN CATEGORIES.CATEGORY
ENDPROC
**
PROCEDURE AcodeToSST
LPARAMETERS NACODE
= SEEK(NACODE, 'AccExt', 'ACODE')
RETURN ACCEXT.SST
ENDPROC
**
PROCEDURE AcodeToCST
LPARAMETERS NACODE
= SEEK(NACODE, 'AccExt', 'ACODE')
RETURN ACCEXT.CST
ENDPROC
**
PROCEDURE AcodeToLicenseNo
LPARAMETERS NACODE
= SEEK(M.NACODE, 'AccExt', 'ACODE')
RETURN ACCEXT.LICENSENO
ENDPROC
**
PROCEDURE AcodeToPhone
LPARAMETERS NACODE
= SEEK(NACODE, 'AccExt', 'ACODE')
RETURN ACCEXT.PHONE
ENDPROC
**
PROCEDURE AcodeToAddressString
LPARAMETERS NACODE
LOCAL NNOOFLINES, I, CRVAL
= SEEK(NACODE, 'AccExt', 'ACODE')
NNOOFLINES = MEMLINES(ACCEXT.ADDRESS)
CRVAL = ''
FOR I = 1 TO NNOOFLINES
CRVAL = CRVAL+MLINE(ACCEXT.ADDRESS, I)
NEXT
RETURN CRVAL
ENDPROC
**
PROCEDURE CCodeToCompany
LPARAMETERS NCCODE
= SEEK(M.NCCODE, 'Company', 'CCODE')
RETURN COMPANY.COMPANY
ENDPROC
**
PROCEDURE CompanyToCCode
LPARAMETERS CCOMPANY
= SEEK(UPPER(M.CCOMPANY), 'Company', 'Company')
RETURN COMPANY.CCODE
ENDPROC
**
PROCEDURE UnitCodeToUnit
LPARAMETERS NUNITCODE
= SEEK(NUNITCODE, 'Units', 'UnitCode')
RETURN UNITS.UNIT
ENDPROC
**
PROCEDURE UnitCodeToTUnit
LPARAMETERS NUNITCODE
= SEEK(NUNITCODE, 'Units', 'UnitCode')
RETURN UNITS.TUNIT
ENDPROC
**
PROCEDURE UnitCodeToShortUnit
LPARAMETERS NUNITCODE
= SEEK(NUNITCODE, 'Units', 'UnitCode')
RETURN UNITS.SHORTUNIT
ENDPROC
**
PROCEDURE UnitCodeToTShortUnit
LPARAMETERS NUNITCODE
= SEEK(NUNITCODE, 'Units', 'UnitCode')
RETURN UNITS.TSHORTUNIT
ENDPROC
**
PROCEDURE ItemCodeToGrpNo
LPARAMETERS NITEMCODE
= SEEK(NITEMCODE, 'Items', 'ITEMCODE')
RETURN ITEMS.GRPNO
ENDPROC
**
PROCEDURE ItemCodeToTrGrpNo
LPARAMETERS NITEMCODE
= SEEK(NITEMCODE, 'Items', 'ITEMCODE')
RETURN ITEMS.TRGRPNO
ENDPROC
**
PROCEDURE ItemCodeToGrpCode
LPARAMETERS NITEMCODE
= SEEK(NITEMCODE, 'Items', 'ITEMCODE')
= SEEK(ITEMS.GRPNO, 'ItemGroups', 'GRPNO')
RETURN ITEMGROUPS.GRPCODE
ENDPROC
**
PROCEDURE ItemCodeToTrGrpCode
LPARAMETERS NITEMCODE
= SEEK(NITEMCODE, 'Items', 'ITEMCODE')
= SEEK(ITEMS.TRGRPNO, 'ItemTrGroups', 'GRPNO')
RETURN ITEMTRGROUPS.GRPCODE
ENDPROC
**
PROCEDURE ItemCodeToItem
LPARAMETERS NITEMCODE
= SEEK(NITEMCODE, 'Items', 'ITEMCODE')
RETURN ITEMS.ITEM
ENDPROC
**
PROCEDURE ItemCodeToTItem
LPARAMETERS NITEMCODE
= SEEK(NITEMCODE, 'Items', 'ITEMCODE')
RETURN ITEMS.TITEM
ENDPROC
**
PROCEDURE ItemCodeToPItem
LPARAMETERS NITEMCODE
= SEEK(NITEMCODE, 'Items', 'ITEMCODE')
RETURN ITEMS.PITEM
ENDPROC
**
PROCEDURE ItemCodeToTPItem
LPARAMETERS NITEMCODE
= SEEK(NITEMCODE, 'Items', 'ITEMCODE')
RETURN ITEMS.PTITEM
ENDPROC
**
PROCEDURE ItemCodeToBrand
LPARAMETERS NITEMCODE
= SEEK(NITEMCODE, 'Items', 'ITEMCODE')
RETURN ITEMS.BRAND
ENDPROC
**
PROCEDURE ItemCodeToUNITCODE
LPARAMETERS NITEMCODE
= SEEK(NITEMCODE, 'Items', 'ITEMCODE')
RETURN ITEMS.UNITCODE
ENDPROC
**
PROCEDURE ItemCodeToPUNITCODE
LPARAMETERS NITEMCODE
= SEEK(NITEMCODE, 'Items', 'ITEMCODE')
RETURN ITEMS.PUNITCODE
ENDPROC
**
PROCEDURE ItemCodeToPUnitRate
LPARAMETERS NITEMCODE
= SEEK(NITEMCODE, 'Items', 'ITEMCODE')
RETURN ITEMS.PUNITRATE
ENDPROC
**
PROCEDURE IndCodeToIndustry
LPARAMETERS NINDCODE
= SEEK(NINDCODE, 'Industries', 'INDCODE')
RETURN INDUSTRIES.INDUSTRY
ENDPROC
**
PROCEDURE IndCodeToPIndustry
LPARAMETERS NINDCODE
= SEEK(NINDCODE, 'Industries', 'INDCODE')
RETURN INDUSTRIES.PINDUSTRY
ENDPROC
**
PROCEDURE IndCodeToTIndustry
LPARAMETERS NINDCODE
= SEEK(NINDCODE, 'Industries', 'INDCODE')
RETURN INDUSTRIES.TINDUSTRY
ENDPROC
**
PROCEDURE IndCodeToPTIndustry
LPARAMETERS NINDCODE
= SEEK(NINDCODE, 'Industries', 'INDCODE')
RETURN INDUSTRIES.TINDUSTRY
ENDPROC
**
PROCEDURE IndCodeToAddress
LPARAMETERS NINDCODE
= SEEK(NINDCODE, 'Industries', 'INDCODE')
RETURN INDUSTRIES.ADDRESS
ENDPROC
**
PROCEDURE IndCodeToTAddress
LPARAMETERS NINDCODE
= SEEK(NINDCODE, 'Industries', 'INDCODE')
RETURN INDUSTRIES.TADDRESS
ENDPROC
**
PROCEDURE IndCodeToIndType
LPARAMETERS NINDCODE
= SEEK(NINDCODE, 'Industries', 'INDCODE')
RETURN INDUSTRIES.INDTYPE
ENDPROC
**
PROCEDURE IndCodeToAcode
LPARAMETERS NINDCODE
= SEEK(NINDCODE, 'Industries', 'INDCODE')
RETURN INDUSTRIES.ACODE
ENDPROC
**
PROCEDURE BillBookNoToPrinter
LPARAMETERS NBILLBOOKNO
= SEEK(M.NBILLBOOKNO, 'BillBook', 'BILLBOOKNO')
RETURN BILLBOOK.PRINTER
ENDPROC
**
PROCEDURE BillBookNoToBookName
LPARAMETERS NBILLBOOKNO
= SEEK(M.NBILLBOOKNO, 'BillBook', 'BILLBOOKNO')
RETURN BILLBOOK.BOOKNAME
ENDPROC
**
PROCEDURE BillBookNoToPBookName
LPARAMETERS NBILLBOOKNO
= SEEK(M.NBILLBOOKNO, 'BillBook', 'BILLBOOKNO')
RETURN BILLBOOK.PBOOKNAME
ENDPROC
**
PROCEDURE BillBookNoToReportName
LPARAMETERS NBILLBOOKNO
= SEEK(M.NBILLBOOKNO, 'BillBook', 'BILLBOOKNO')
RETURN BILLBOOK.REPORTNAME
ENDPROC
**
PROCEDURE AccTypeTocType
LPARAMETERS NTYPE
LOCAL CTYPE
M.CTYPE = ''
DO CASE
CASE M.NTYPE==01
M.CTYPE = 'Trade Account'
CASE M.NTYPE==02
M.CTYPE = 'P & L Account'
CASE M.NTYPE==03
M.CTYPE = 'Balance Sheet'
ENDCASE
RETURN M.CTYPE
ENDPROC
**
PROCEDURE IndTypeTocType
LPARAMETERS NINDTYPE
LOCAL CINDTYPE
DO CASE
CASE M.NINDTYPE==1
M.CINDTYPE = 'Own Reservoir'
CASE M.NINDTYPE==2
M.CINDTYPE = 'Own Process'
CASE M.NINDTYPE==3
M.CINDTYPE = 'Own Stock Yard'
CASE M.NINDTYPE==4
M.CINDTYPE = 'Other Process'
CASE M.NINDTYPE==5
M.CINDTYPE = 'Other Stock Yard'
OTHERWISE
M.CINDTYPE = ''
ENDCASE
RETURN M.CINDTYPE
ENDPROC
**
PROCEDURE LinesToLine
LPARAMETERS CLINES, NSPACE
LOCAL CLINE, NSPOS, NEPOS, NOCC, CSPACE, CCRLF
M.CCRLF = CHR(13)+CHR(10)
M.CLINE = ''
M.NOCC = 1
M.NSPOS = 1
M.CSPACE = ''
IF .NOT. EMPTY(M.NSPACE)
M.CSPACE = SPACE(M.NSPACE)
ENDIF
M.NEPOS = AT(M.CCRLF, M.CLINES, M.NOCC)
DO WHILE M.NEPOS<>0
M.NOCC = M.NOCC+1
M.CLINE = M.CLINE+SUBSTR(M.CLINES, M.NSPOS, M.NEPOS-M.NSPOS)+M.CSPACE
M.NSPOS = M.NEPOS+2
M.NEPOS = AT(M.CCRLF, CLINES, M.NOCC)
ENDDO
M.CLINE = M.CLINE+SUBSTR(M.CLINES, M.NSPOS)
RETURN M.CLINE
ENDPROC
**
PROCEDURE RemoveEnters
LPARAMETERS CSTRING
LOCAL NLEN, I, NSPOS
M.NLEN = LEN(M.CSTRING)
I = 1
DO WHILE ASC(SUBSTR(M.CSTRING, I, 1))<=32 .AND. I<=M.NLEN
I = I+1
ENDDO
M.NSPOS = I
I = M.NLEN
DO WHILE I>0 .AND. ASC(SUBSTR(M.CSTRING, I, 1))<=32
I = I-1
ENDDO
RETURN SUBSTR(M.CSTRING, M.NSPOS, I-M.NSPOS+1)
ENDPROC
**
PROCEDURE RupeesToWord
LPARAMETERS NNO
LOCAL NRUPEES
PRIVATE CWORDS, CTENSWORDS
DECLARE CWORDS[19], CTENSWORDS[9]
CWORDS[1] = ' One'
CWORDS[2] = ' Two'
CWORDS[3] = ' Three'
CWORDS[4] = ' Four'
CWORDS[5] = ' Five'
CWORDS[6] = ' Six'
CWORDS[7] = ' Seven'
CWORDS[8] = ' Eight'
CWORDS[9] = ' Nine'
CWORDS[10] = ' Ten'
CWORDS[11] = ' Eleven'
CWORDS[12] = ' Twelve'
CWORDS[13] = ' Thirteen'
CWORDS[14] = ' Fourteen'
CWORDS[15] = ' Fifteen'
CWORDS[16] = ' Sixteen'
CWORDS[17] = ' Seventeen'
CWORDS[18] = ' Eighteen'
CWORDS[19] = ' Nineteen'
CTENSWORDS[1] = ' Ten'
CTENSWORDS[2] = ' Twenty'
CTENSWORDS[3] = ' Thirty'
CTENSWORDS[4] = ' Fourty'
CTENSWORDS[5] = ' Fifty'
CTENSWORDS[6] = ' Sixty'
CTENSWORDS[7] = ' Seventy'
CTENSWORDS[8] = ' Eighty'
CTENSWORDS[9] = ' Ninety'
LOCAL CRVAL, CRUPEES, NRUPEES, NPAISE, CRUPEES, CPAISE, NCRORE
CRVAL = ''
NRUPEES = INT(NNO)
NPAISE = (NNO-NRUPEES)*100
M.NCRORE = INT(M.NRUPEES/10000000)
M.CRUPEES = ''
IF M.NCRORE>0
M.CRUPEES = CALLDIGITS(M.NCRORE)+' Crore'
ENDIF
CRUPEES = M.CRUPEES+CALLDIGITS(NRUPEES-M.NCRORE*10000000)
CPAISE = CALLDIGITS(NPAISE)
CRVAL = CRUPEES
IF NRUPEES>0 .AND. NPAISE>0
CRVAL = CRVAL+' And'
ENDIF
IF NPAISE>0
CRVAL = CRVAL+' Paise'+CPAISE
ENDIF
IF NNO<=0
CRVAL = ' Nill'
ENDIF
CRVAL = CRVAL+' Only'
RELEASE CWORDS, CTENSWORDS
RETURN CRVAL
ENDPROC
**
PROCEDURE cAllDigits
LPARAMETERS NNO
LOCAL NDIGITSPROCESSED, CRVAL, CTEMP
NDIGITSPROCESSED = 0
CRVAL = ''
CTEMP = ''
DO WHILE (NNO>0)
IF NDIGITSPROCESSED==1
NTWODIGITS = MOD(NNO, 10)
NNO = (NNO-NTWODIGITS)/10
ELSE
NTWODIGITS = MOD(NNO, 100)
NNO = (NNO-NTWODIGITS)/100
ENDIF
NDIGITSPROCESSED = NDIGITSPROCESSED+1
CTEMP = CTWODIGITS(NTWODIGITS)
DO CASE
CASE NDIGITSPROCESSED==2
IF NTWODIGITS>0
CTEMP = CTEMP+' Hundred'
IF .NOT. EMPTY(CRVAL)
CRVAL = ' And'+CRVAL
ENDIF
ENDIF
CASE NDIGITSPROCESSED==3 .AND. NTWODIGITS>0
CTEMP = CTEMP+' Thousand'
CASE NDIGITSPROCESSED==4 .AND. NTWODIGITS>0
CTEMP = CTEMP+' Lakh'
CASE NDIGITSPROCESSED>=5 .AND. NTWODIGITS>0
CTEMP = CTEMP+' Crore'
ENDCASE
CRVAL = CTEMP+CRVAL
ENDDO
RETURN CRVAL
ENDPROC
**
PROCEDURE cTwoDigits
LPARAMETERS NNO
LOCAL CRVAL, NREMAINDER, NQUOTIENT
CRVAL = ''
NREMAINDER = MOD(NNO, 10)
NQUOTIENT = (NNO-NREMAINDER)/10
IF NNO>0 .AND. NNO<20
CRVAL = CWORDS(NNO)
ELSE
IF NREMAINDER<>0
CRVAL = CWORDS(NREMAINDER)
ENDIF
IF NQUOTIENT<>0
CRVAL = CTENSWORDS(NQUOTIENT)+CRVAL
ENDIF
ENDIF
RETURN CRVAL
ENDPROC
**
PROCEDURE GetPath
LOCAL CPATH, CFULLPATH
M.CPATH = CURDIR()
M.CFULLPATH = M.CPATH
M.CPATH = M.CPATH+ALLTRIM(STR(PUBGCODE))+'\'
M.CFULLPATH = M.CFULLPATH+';'+M.CPATH
M.CPATH = M.CPATH+ALLTRIM(STR(PUBCCODE))+'\'
M.CFULLPATH = M.CFULLPATH+';'+M.CPATH
M.CPATH = M.CPATH+ALLTRIM(STR(PUBYEARNO))+'\'
M.CFULLPATH = M.CFULLPATH+';'+M.CPATH
RETURN M.CFULLPATH
ENDPROC
**
PROCEDURE NoOfDaysInMonth
LPARAMETERS DDATE
LOCAL NDAY, NMONTH, NYEAR
M.NDAY = 0
IF .NOT. EMPTY(M.DDATE)
M.NMONTH = MONTH(M.DDATE)
M.NYEAR = YEAR(M.DDATE)
DO CASE
CASE M.NMONTH==4 .OR. M.NMONTH==6 .OR. M.NMONTH==9 .OR. M.NMONTH==11
M.NDAY = 30
CASE M.NMONTH==2
IF (MOD(M.NYEAR, 100)<>0 .AND. MOD(M.NYEAR, 4)==0) .OR. MOD(M.NYEAR, 400)==0
M.NDAY = 29
ELSE
M.NDAY = 28
ENDIF
OTHERWISE
M.NDAY = 31
ENDCASE
ENDIF
RETURN M.NDAY
ENDPROC
**
PROCEDURE GetUserCodeInfo
LPARAMETERS NUSERCODE, LSUPERVISOR, LALLOWCHGPASS, LCONFIRMPASSLOGGEDON
LOCAL ITHBIT, NRETUSERCODE
M.LSUPERVISOR = BITTEST(M.NUSERCODE, 30)
M.LALLOWCHGPASS = BITTEST(M.NUSERCODE, 29)
M.LCONFIRMPASSLOGGEDON = BITTEST(M.NUSERCODE, 28)
M.NRETUSERCODE = M.NUSERCODE
FOR M.ITHBIT = 24 TO 31
M.NRETUSERCODE = BITCLEAR(M.NRETUSERCODE, M.ITHBIT)
NEXT
RETURN M.NRETUSERCODE
ENDPROC
**
PROCEDURE CloseAllForms
LPARAMETERS CMSG, CMSGTITLE
LOCAL NNOOFPARAMS, LASKQUES, NFRMCOUNT, I
M.NNOOFPARAMS = PARAMETERS()
WITH _SCREEN
M.LASKQUES = M.NNOOFPARAMS>0 .AND. .FORMCOUNT>0
IF M.LASKQUES
IF EMPTY(M.CMSG)
M.CMSG = ' Do you want to close all the screens '+CHR(13)+CHR(13)+ ;
' and To proceed operation.'+CHR(13)
ENDIF
IF EMPTY(M.CMSGTITLE)
M.CMSGTITLE = 'Close all the screens.'
ENDIF
M.LASKQUES = MESSAGEBOX(M.CMSG, 036, M.CMSGTITLE)==7
ENDIF
IF .NOT. M.LASKQUES
M.NFRMCOUNT = -1
DO WHILE .FORMCOUNT<>0 .AND. .FORMCOUNT<>M.NFRMCOUNT
M.NFRMCOUNT = .FORMCOUNT
IF TYPE(".Forms[ .FormCount ].Parent")=='O'
.FORMS(.FORMCOUNT).PARENT.RELEASE()
ELSE
.FORMS(.FORMCOUNT).RELEASE()
ENDIF
ENDDO
M.LASKQUES = M.NFRMCOUNT==1
ENDIF
ENDWITH
RETURN .NOT. M.LASKQUES
ENDPROC
**
PROCEDURE ReleaseBar
LPARAMETERS CMENUNAME, CRELEASEBAR
LOCAL NNOOFBARS, I, NBAR, LRVAL
M.CRELEASEBAR = UPPER(M.CRELEASEBAR)
M.NNOOFBARS = CNTBAR(M.CMENUNAME)
M.LRVAL = .F.
FOR I = M.NNOOFBARS TO 1 STEP -1
M.NBAR = GETBAR(M.CMENUNAME, I)
M.CBAR = UPPER(PRMBAR(M.CMENUNAME, M.NBAR))
IF M.CBAR==M.CRELEASEBAR
RELEASE BAR M.NBAR OF (M.CMENUNAME)
M.LRVAL = .T.
ENDIF
NEXT
RETURN M.LRVAL
ENDPROC
**
PROCEDURE ReleasePad
LPARAMETERS CMENUNAME, CRELEASEPAD
LOCAL I, NNOOFPADS, CPAD
M.CRELEASEPAD = UPPER(M.CRELEASEPAD)
M.LRVAL = .F.
M.NNOOFPADS = CNTPAD(M.CMENUNAME)
FOR I = M.NNOOFPADS TO 1 STEP -1
M.CPAD = PRMPAD(M.CMENUNAME, GETPAD(M.CMENUNAME, I))
IF UPPER(M.CPAD)==M.CRELEASEPAD
RELEASE PAD (M.CPAD) OF (M.CMENUNAME)
M.LRVAL = .T.
ENDIF
NEXT
RETURN M.LRVAL
ENDPROC
**
PROCEDURE CurGCompPath
RETURN SYS(05)+CURDIR()+ALLTRIM(STR(PUBGCODE))+'\'
ENDPROC
**
PROCEDURE CurCompPath
RETURN CURGCOMPPATH()+ALLTRIM(STR(PUBCCODE))+'\'
ENDPROC
**
PROCEDURE CurYearPath
RETURN CURCOMPPATH()+ALLTRIM(STR(PUBYEARNO))+'\'
ENDPROC
**
PROCEDURE DateToLongDate
LPARAMETERS DDATE
LOCAL CLONGDATE, CDATEFORMAT
M.CDATEFORMAT = SET("DATE")
SET DATE TO LONG
M.CLONGDATE = DTOC(M.DDATE)
SET DATE TO (M.CDATEFORMAT)
RETURN M.CLONGDATE
ENDPROC
**
PROCEDURE PrinterExist
LPARAMETERS CPRINTERNAME, CPORTNAME
LOCAL APRNNAMES, NNOOFPRNS, I, LFOUND
DECLARE APRNNAMES(1)
M.NNOOFPRNS = APRINTERS(M.APRNNAMES)
M.CPRINTERNAME = UPPER(M.CPRINTERNAME)
I = 1
M.LFOUND = .F.
DO WHILE I<=M.NNOOFPRNS .AND. .NOT. M.LFOUND
M.LFOUND = M.CPRINTERNAME==UPPER(M.APRNNAMES(I, 1))
I = I+1
ENDDO
IF .NOT. M.LFOUND
IF M.NNOOFPRNS>0
M.CPRINTERNAME = M.APRNNAMES(1, 1)
ELSE
M.CPRINTERNAME = ''
ENDIF
ENDIF
RETURN M.LFOUND
ENDPROC
**
PROCEDURE GetFirstDate
LPARAMETERS DDATE
RETURN CTOD(STUFF(DTOC(M.DDATE), 1, 2, '01'))
ENDPROC
**
PROCEDURE SetFlag
LPARAMETERS LFLAG
M.LFLAG = .T.
RETURN M.LFLAG
ENDPROC
**
PROCEDURE ReSetFlag
LPARAMETERS LFLAG
M.LFLAG = .F.
RETURN M.LFLAG
ENDPROC
**
PROCEDURE SetLedgerIndex
LPARAMETERS NACODELEDG, NPAGENO
IF USED('LedgerIndex')
IF .NOT. SEEK(M.NACODELEDG, 'LedgerIndex', 'ACODE')
APPEND IN 'LedgerIndex' BLANK
ENDIF
REPLACE LEDGERINDEX.ACODE WITH M.NACODELEDG, LEDGERINDEX.INDEX WITH M.NPAGENO ;
IN 'LedgerIndex'
ENDIF
RETURN M.NACODELEDG
ENDPROC
**
PROCEDURE ColumnsToString
LPARAMETERS CFIELD, NWIDTH, NPRECISION, NFROMCOL, NTOCOL, UPRINTZERO, CEXP
LOCAL CSTRING, I, CMACROSTR, NVALUE
IF EMPTY(M.CEXP)
M.CEXP = ''
ENDIF
M.CSTRING = ''
IF TYPE("m.uPrintZero")=='C'
FOR I = M.NFROMCOL TO M.NTOCOL
M.CMACROSTR = M.CFIELD+LTRIM(STR(I))+M.CEXP
M.NVALUE = &CMACROSTR
M.CMACROSTR = RIGHT(TRANSFORM(M.NVALUE, M.UPRINTZERO), M.NWIDTH)
M.CSTRING = M.CSTRING+SPACE(M.NWIDTH-LEN(M.CMACROSTR))+M.CMACROSTR
NEXT
ELSE
FOR I = M.NFROMCOL TO M.NTOCOL
M.CMACROSTR = M.CFIELD+LTRIM(STR(I))+M.CEXP
M.NVALUE = &CMACROSTR
IF M.UPRINTZERO .OR. M.NVALUE<>0
M.CSTRING = M.CSTRING+STR(M.NVALUE, M.NWIDTH, M.NPRECISION)
ELSE
M.CSTRING = M.CSTRING+SPACE(M.NWIDTH)
ENDIF
NEXT
ENDIF
RETURN M.CSTRING
ENDPROC
**
PROCEDURE HeadingsToString
LPARAMETERS CFIELD, NWIDTH, NFROMCOL, NTOCOL, NBEGSPACE, NALIGNMENT
LOCAL CSTRING, I, CMACROSTR, ACHEADING, NNOCOLS, NLEN, NMAXLEN, ACLINES, NLINE, ;
NNOOFLINES, CSUBSTRING, NNOOFPARAMS
M.NNOOFPARAMS = PARAMETERS()
IF M.NNOOFPARAMS<5
M.NBEGSPACE = 0
ENDIF
IF M.NNOOFPARAMS<6
M.NALIGNMENT = 1
ENDIF
M.NNOCOLS = M.NTOCOL-M.NFROMCOL+1
DECLARE ACHEADING[M.NNOCOLS, 2]
M.NMAXLEN = 0
FOR I = 1 TO M.NNOCOLS
M.CMACROSTR = M.CFIELD+LTRIM(STR(I+M.NFROMCOL-1))
ACHEADING[I, 1] = ALLTRIM(&CMACROSTR)
ACHEADING[I, 2] = LEN(ACHEADING(I, 1))
M.NMAXLEN = MAX(M.NMAXLEN, ACHEADING(I, 2))
NEXT
M.NWIDTH = M.NWIDTH-1
M.NNOOFLINES = CEILING(M.NMAXLEN/M.NWIDTH)
DECLARE ACLINES[M.NNOOFLINES]
ACLINES = ''
FOR I = 1 TO M.NNOCOLS
M.NLINE = 0
FOR J = 1 TO M.NMAXLEN STEP M.NWIDTH
M.NLINE = M.NLINE+1
M.CSUBSTRING = SUBSTR(ACHEADING(I, 1), J, M.NWIDTH)
M.NLEN = LEN(M.CSUBSTRING)
IF M.NLEN M.CSTRING = SPACE(M.NWIDTH-M.NLEN)
IF M.NALIGNMENT==1
M.CSUBSTRING = M.CSTRING+M.CSUBSTRING
ELSE
M.CSUBSTRING = M.CSUBSTRING+M.CSTRING
ENDIF
M.CSUBSTRING = M.CSUBSTRING+' '
ELSE
IF M.NLINE M.CSUBSTRING = M.CSUBSTRING+'-'
ELSE
M.CSUBSTRING = M.CSUBSTRING+' '
ENDIF
ENDIF
ACLINES[M.NLINE] = ACLINES(M.NLINE)+M.CSUBSTRING
NEXT
NEXT
M.CSTRING = ''
M.CMACROSTR = CHR(13)+CHR(10)
FOR I = 1 TO M.NNOOFLINES
M.CSTRING = M.CSTRING+SPACE(M.NBEGSPACE)+ACLINES(I)+M.CMACROSTR
NEXT
RETURN M.CSTRING
ENDPROC
**
PROCEDURE VoucherToDateNo
LPARAMETERS CVOUVHER
LOCAL OVOUCHER, CMSGSTR
M.OVOUCHER = NEWOBJECT('Voucher', 'J:\Visual.Fox\tecClassLib\tecClass.VCX')
WITH M.OVOUCHER
.SETVOUCHER(M.CVOUVHER)
M.CMSGSTR = ' Date : '+DTOC(.DVOUCHERDATE)+', Voucher No : '+ ;
LTRIM(STR(.NVOUCHERNUMBER))
ENDWITH
RETURN M.CMSGSTR
ENDPROC
**
PROCEDURE SetStockLedgerIndex
LPARAMETERS NITEMCODE, NPAGENO
IF USED('StockLedgerIndex')
IF .NOT. SEEK(M.NITEMCODE, 'StockLedgerIndex', 'ITEMCODE')
APPEND IN 'StockLedgerIndex' BLANK
ENDIF
REPLACE STOCKLEDGERINDEX.ITEMCODE WITH M.NITEMCODE, STOCKLEDGERINDEX.INDEX WITH ;
M.NPAGENO IN 'StockLedgerIndex'
ENDIF
RETURN M.NITEMCODE
ENDPROC
**
PROCEDURE ProcessCodetoPProcess
LPARAMETERS NPROCESSCODE
LOCAL CPROCESS
M.CPROCESS = ''
IF SEEK(M.NPROCESSCODE, 'Process', 'PROCESSCOD')
M.CPROCESS = PROCESS.PPROCESS
ENDIF
RETURN M.CPROCESS
ENDPROC
**
PROCEDURE AdjustLength
LPARAMETERS CSTRING, NMAXLENGTH
M.CSTRING = LEFT(ALLTRIM(M.CSTRING), M.NMAXLENGTH)
M.CSTRING = M.CSTRING+SPACE(M.NMAXLENGTH-LEN(M.CSTRING))
RETURN M.CSTRING
ENDPROC
**
PROCEDURE xItemCodeToItem
LPARAMETERS NITEMCODE
= SEEK(M.NITEMCODE, 'TaxItem', 'XITEMCODE')
RETURN TAXITEM.XITEM
ENDPROC
**
PROCEDURE xItemCodeToPItem
LPARAMETERS NITEMCODE
= SEEK(M.NITEMCODE, 'TaxItem', 'XITEMCODE')
RETURN TAXITEM.PXITEM
ENDPROC
**
PROCEDURE myLoginasSupervisor
LOCAL LSUPERVISOR
= GETUSERCODEINFO(PUBUSERCODE, @M.LSUPERVISOR)
RETURN M.LSUPERVISOR
ENDPROC
**
PROCEDURE PayModeToModeName
LPARAMETERS NMODE
LOCAL CNAME
M.CNAME = ''
DO CASE
CASE M.NMODE==1
M.CNAME = 'Cash'
CASE M.NMODE==2
M.CNAME = 'Cheque'
CASE M.NMODE==3
M.CNAME = 'Demand Draft'
CASE M.NMODE==4
M.CNAME = 'Money Order'
CASE M.NMODE==5
M.CNAME = 'Credit Card'
ENDCASE
RETURN M.CNAME
ENDPROC
**
PROCEDURE TagCustItemTypeTocType
LPARAMETERS NTYPE
LOCAL CTYPE
M.CTYPE = ''
DO CASE
CASE M.NTYPE==01
M.CTYPE = 'Product'
CASE M.NTYPE==04
M.CTYPE = 'Others'
CASE M.NTYPE==02
M.CTYPE = 'Returnable Container'
CASE M.NTYPE==03
M.CTYPE = 'Consumable Container'
ENDCASE
RETURN M.CTYPE
ENDPROC
**
PROCEDURE XItemTypeToString
LPARAMETERS NXITEMTYPE
LOCAL CTYPE
M.CTYPE = ''
DO CASE
CASE M.NXITEMTYPE==1
M.CTYPE = 'SST'
CASE M.NXITEMTYPE==2
M.CTYPE = 'CST'
CASE M.NXITEMTYPE==3
M.CTYPE = 'Surcharge'
CASE M.NXITEMTYPE==4
M.CTYPE = 'Discount'
CASE M.NXITEMTYPE==5
M.CTYPE = 'Handling'
CASE M.NXITEMTYPE==6
M.CTYPE = 'Excise Duty'
CASE M.NXITEMTYPE==7
M.CTYPE = 'Turnover Tax'
CASE M.NXITEMTYPE==8
M.CTYPE = 'Additional ExciseDuty'
CASE M.NXITEMTYPE==10
M.CTYPE = 'AED On EDuty'
CASE M.NXITEMTYPE==11
M.CTYPE = 'Cess For ED'
ENDCASE
RETURN M.CTYPE
ENDPROC
**
PROCEDURE AcodeToDetail
LPARAMETERS NACODE
= SEEK(NACODE, 'AccExt', 'ACODE')
RETURN ACCEXT.DETAIL
ENDPROC
**
**
PROCEDURE gCreateObject
LPARAMETERS CCLASS, CLIBPATH
LOCAL CCURLIB, OOBJ
M.CCURLIB = SET('CLASSLIB')
SET CLASSLIB TO &CLIBPATH
OOBJ = CREATEOBJECT(M.CCLASS)
IF EMPTY(M.CCURLIB)
SET CLASSLIB TO
ELSE
SET CLASSLIB TO &CCURLIB
ENDIF
RETURN OOBJ
ENDPROC
**
**
PROCEDURE GetCustomLibPathObject
RETURN NEWOBJECT('CustomLibPath', 'Custom.VCX')
ENDPROC
**
LPARAMETERS CPOPUP, CPROMPT, NBAR
LOCAL NCHARTTYPE, CFONTNAME, NFONTSIZE, CFONTSTYLE, OFONT
M.CPOPUP = UPPER(M.CPOPUP)
M.CPROMPT = UPPER(M.CPROMPT)
IF ISOLEGRAPH() .AND. .NOT. EMPTY(M.CPROMPT)
WAIT WINDOW NOCLEAR NOWAIT "Please wait Change the "+PROPER(M.CPROMPT)+"'s of "+ ;
M.CPOPUP+" ..."
WITH _VFP.ACTIVEFORM.OLEGRAPH
DO CASE
CASE LEFT(M.CPOPUP, 5)=='GRAPH'
DO CASE
CASE M.CPROMPT=='TITLE'
.HASTITLE = .NOT. .HASTITLE
IF .HASTITLE=.T.
.CHARTTITLE.CAPTION = _VFP.ACTIVEFORM.CCHARTTITLE
ENDIF
SET MARK OF BAR M.NBAR OF (M.CPOPUP) TO .HASTITLE
CASE M.CPROMPT=='LEGEND'
.HASLEGEND = .NOT. .HASLEGEND
SET MARK OF BAR M.NBAR OF (M.CPOPUP) TO .HASLEGEND
CASE M.CPROMPT=='DATA LABELS'
FOR M.NFONTSIZE = 1 TO .SERIESCOLLECTION.COUNT
M.CFONTNAME = .NOT. .SERIESCOLLECTION(M.NFONTSIZE).HASDATALABELS
.SERIESCOLLECTION(M.NFONTSIZE).HASDATALABELS = M.CFONTNAME
NEXT
SET MARK OF BAR M.NBAR OF (M.CPOPUP) TO M.CFONTNAME
ENDCASE
CASE M.CPOPUP=='TYPES'
DO CASE
CASE M.CPROMPT=="3D AREA"
M.NCHARTTYPE = -4098
CASE M.CPROMPT=="3D BAR"
M.NCHARTTYPE = -4099
CASE M.CPROMPT=="3D COLUMN"
M.NCHARTTYPE = -4100
CASE M.CPROMPT=="3D LINE"
M.NCHARTTYPE = -4101
CASE M.CPROMPT=="3D PIE"
M.NCHARTTYPE = -4102
CASE M.CPROMPT=="3D SURFACE"
M.NCHARTTYPE = -4103
CASE M.CPROMPT=="2D AREA"
M.NCHARTTYPE = 1
CASE M.CPROMPT=="2D BAR"
M.NCHARTTYPE = 2
CASE M.CPROMPT=="2D COLUMN"
M.NCHARTTYPE = 3
CASE M.CPROMPT=="2D LINE"
M.NCHARTTYPE = 4
CASE M.CPROMPT=="2D PIE"
M.NCHARTTYPE = 5
CASE M.CPROMPT=="2D DOUGHNUT"
M.NCHARTTYPE = -4120
CASE M.CPROMPT=="2D RADAR"
M.NCHARTTYPE = -4151
CASE M.CPROMPT=="2D XY SCATTER"
M.NCHARTTYPE = -4169
ENDCASE
FOR M.NFONTSIZE = 1 TO CNTBAR(M.CPOPUP)
SET MARK OF BAR M.NFONTSIZE OF (M.CPOPUP) TO .F.
NEXT
SET MARK OF BAR M.NBAR OF (M.CPOPUP) TO .T.
.TYPE = M.NCHARTTYPE
.SUBTYPE = 1
.PARENT.NCURSUBTYPE = 1
.AUTOFORMAT(M.NCHARTTYPE, 1)
.REFRESH()
CASE M.CPOPUP=='FONTS'
DECLARE M.OFONT(3)
M.OFONT = ''
DO CASE
CASE M.CPROMPT=="ALL"
M.OFONT(1) = IIF(.HASTITLE, .CHARTTITLE.FONT, '')
M.OFONT(2) = IIF(.HASLEGEND, .LEGEND.FONT, '')
M.OFONT(3) = IIF(.SERIESCOLLECTION(1).HASDATALABELS, ;
.SERIESCOLLECTION(1).DATALABELS.FONT, '')
CASE M.CPROMPT=="CHART TITLE"
M.OFONT(1) = IIF(.HASTITLE, .CHARTTITLE.FONT, '')
CASE M.CPROMPT=="LEGEND"
M.OFONT(1) = IIF(.HASLEGEND, .LEGEND.FONT, '')
CASE M.CPROMPT=="DATA LABELS"
M.OFONT(1) = IIF(.SERIESCOLLECTION(1).HASDATALABELS, ;
.SERIESCOLLECTION(1).DATALABELS.FONT, '')
ENDCASE
GETFONTDETAILS(@CFONTNAME, @NFONTSIZE, @CFONTSTYLE)
FOR M.NCHARTTYPE = 1 TO 3
IF TYPE("m.oFont(m.nChartType)")=="O"
SETGRAPHFONT(M.OFONT(M.NCHARTTYPE), M.CFONTNAME, M.NFONTSIZE, ;
M.CFONTSTYLE)
ENDIF
NEXT
FOR M.NFONTSIZE = 1 TO CNTBAR(M.CPOPUP)
SET MARK OF BAR M.NFONTSIZE OF (M.CPOPUP) TO .F.
NEXT
SET MARK OF BAR M.NBAR OF (M.CPOPUP) TO .T.
ENDCASE
ENDWITH
ENDIF
WAIT CLEAR
RETURN
ENDPROC
**
PROCEDURE isOleGraph
LOCAL LRVAL
M.LRVAL = .F.
IF TYPE("_VFP.ActiveForm")=='O' .AND. TYPE("_VFP.ActiveForm.OleGraph")=="O"
M.LRVAL = .T.
ENDIF
RETURN M.LRVAL
ENDPROC
**
PROCEDURE GetFontDetails
LPARAMETERS CFONTNAME, NFONTSIZE, CFONTSTYLE
LOCAL CFONT
M.CFONT = GETFONT()
M.NFONTSIZE = AT(',', M.CFONT, 1)
M.CFONTNAME = SUBSTR(M.CFONT, 1, M.NFONTSIZE-1)
M.NCHARTTYPE = AT(',', M.CFONT, 2)
M.NFONTSIZE = VAL(SUBSTR(M.CFONT, M.NFONTSIZE+1, M.NCHARTTYPE-M.NFONTSIZE-1))
M.CFONTSTYLE = SUBSTR(M.CFONT, M.NCHARTTYPE+1)
RETURN M.CFONT
ENDPROC
**
PROCEDURE SetGraphFont
LPARAMETERS OFONT, CFONTNAME, NFONTSIZE, CFONTSTYLE
M.OFONT.NAME = M.CFONTNAME
M.OFONT.SIZE = M.NFONTSIZE
IF .NOT. EMPTY(ATC('B', M.CFONTSTYLE))
M.OFONT.BOLD = .T.
ELSE
M.OFONT.BOLD = .F.
ENDIF
IF .NOT. EMPTY(ATC('I', M.CFONTSTYLE))
M.OFONT.ITALIC = .T.
ELSE
M.OFONT.ITALIC = .F.
ENDIF
RETURN
ENDPROC
**
RETURN
ENDPROC
**
LPARAMETERS LSUPERVISOR
LOCAL LOPENED, LGCOMPEXIST, NTMPUSERCODE
IF FILE('GCompany.DBF')
USE SHARED 'GCompany' IN 0
GOTO TOP IN 'GCompany'
M.LGCOMPEXIST = .NOT. EOF('GCompany')
USE IN 'GCompany'
IF M.LGCOMPEXIST
CLOSE DATABASES
DO FORM OpenCompany.SCX TO M.LOPENED
CLOSE DATABASES
M.NTMPUSERCODE = GETUSERCODEINFO(PUBUSERCODE)
= DYNAMICMENU(M.NTMPUSERCODE)
IF M.LOPENED
= SETSCRFORSCHEME(M.NTMPUSERCODE)
ENDIF
ENDIF
ENDIF
= CHECKPRNEXIST()
RETURN
ENDPROC
**
PROCEDURE CheckPrnExist
LOCAL LFILEALREDYOPEN, OTAGSETTINGS, CPRINTER
M.LFILEALREDYOPEN = .T.
IF .NOT. USED('TechNo')
USE 'TechNo' ALIAS 'TechNo' IN 0
M.LFILEALREDYOPEN = .F.
ENDIF
M.OTAGSETTINGS = NEWOBJECT('TagSettings', 'J:\Visual.Fox\tecClassLib\tagUtils')
IF M.OTAGSETTINGS.GETDETAILS(49)
M.CPRINTER = ALLTRIM(M.OTAGSETTINGS.CTECHCHAR)
ELSE
M.CPRINTER = ''
ENDIF
M.OTAGSETTINGS.DESTROY()
IF .NOT. PRINTEREXIST(@M.CPRINTER)
IF .NOT. SEEK(49, 'TechNo', 'TECHTYPE')
APPEND IN 'TechNo' BLANK
ENDIF
REPLACE TECHNO.TECHTYPE WITH 49, TECHNO.TECHCHAR WITH M.CPRINTER IN 'TechNo'
IF EMPTY(M.CPRINTER)
= MESSAGEBOX(' Please add Printer '+CHR(13)+ ;
' (Start Button, Settings, Printers - Add Printer). ', 64, ;
' Printer not Installed... ')
ELSE
= MESSAGEBOX(' Selected as Default Printer. ', 64, M.CPRINTER)
ENDIF
ENDIF
IF .NOT. M.LFILEALREDYOPEN
USE IN 'TechNo'
ENDIF
RETURN
ENDPROC
**
LPARAMETERS CCURSORNAME, NACCOUNTTYPE
LOCAL CDETAIL, CBDETAIL, CHDETAIL
M.CDETAIL = 'Opening Balance'+SPACE(0085)
M.CBDETAIL = SPACE(0037)
M.CHDETAIL = SPACE(75)
SELECT OPENBALDETAILS.ACODE AS ACODELEDG, OPENBALDETAILS.BILLDATE AS VOUCHDATE, ;
M.CDETAIL AS DETAIL, OPENBALDETAILS.AMOUNT, OPENBALDETAILS.BILLNO+ ;
M.CBDETAIL AS BDETAIL, M.CHDETAIL AS HDETAIL FROM OpenBalDetails, ;
Accounts WHERE OPENBALDETAILS.AMOUNT<>0 AND OPENBALDETAILS.ACODE== ;
ACCOUNTS.ACODE AND ACCOUNTS.ACCTYPE==M.NACCOUNTTYPE UNION ALL SELECT ;
LEDGER.ACODELEDG, LEDGER.VOUCHDATE, LEDGER.DETAIL, SUM(LEDGER.AMOUNT) AS ;
AMOUNT, LEDGER.BDETAIL, LEDGER.HDETAIL FROM Ledger, Accounts WHERE ;
LEDGER.BILLBOOKNO>=0 AND LEDGER.ACODELEDG==ACCOUNTS.ACODE AND ;
ACCOUNTS.ACCTYPE==M.NACCOUNTTYPE GROUP BY LEDGER.ACODELEDG, ;
LEDGER.VOUCHER, LEDGER.BILLBOOKNO UNION ALL SELECT LEDGER.ACODELEDG, ;
LEDGER.VOUCHDATE, LEDGER.DETAIL, LEDGER.AMOUNT, LEDGER.BDETAIL, ;
LEDGER.HDETAIL FROM Ledger, Accounts WHERE LEDGER.BILLBOOKNO<0 AND ;
LEDGER.ACODELEDG==ACCOUNTS.ACODE AND ACCOUNTS.ACCTYPE==M.NACCOUNTTYPE ;
INTO CURSOR (M.CCURSORNAME)
RETURN
ENDPROC
**
LPARAMETERS CCURSORNAME
LOCAL CDETAIL, CBDETAIL, CHDETAIL
M.CDETAIL = 'Opening Balance'+SPACE(0085)
M.CBDETAIL = SPACE(0037)
M.CHDETAIL = SPACE(75)
SELECT OPENBALDETAILS.ACODE AS ACODELEDG, 0000000 AS ACODE, ;
OPENBALDETAILS.BILLDATE AS VOUCHDATE, M.CDETAIL AS DETAIL, ;
OPENBALDETAILS.AMOUNT, OPENBALDETAILS.BILLNO+M.CBDETAIL AS BDETAIL, ;
M.CHDETAIL AS HDETAIL FROM OpenBalDetails, Accounts WHERE ;
OPENBALDETAILS.AMOUNT<>0 AND OPENBALDETAILS.ACODE==ACCOUNTS.ACODE UNION ;
ALL SELECT LEDGER.ACODELEDG, 0000000 AS ACODE, LEDGER.VOUCHDATE, ;
LEDGER.DETAIL, SUM(LEDGER.AMOUNT) AS AMOUNT, LEDGER.BDETAIL, ;
LEDGER.HDETAIL FROM Ledger, Accounts WHERE LEDGER.BILLBOOKNO>=0 AND ;
LEDGER.ACODELEDG==ACCOUNTS.ACODE GROUP BY LEDGER.ACODELEDG, ;
LEDGER.VOUCHER, LEDGER.BILLBOOKNO UNION ALL SELECT LEDGER.ACODELEDG, ;
LEDGER.ACODE, LEDGER.VOUCHDATE, LEDGER.DETAIL, LEDGER.AMOUNT, ;
LEDGER.BDETAIL, LEDGER.HDETAIL FROM Ledger, Accounts WHERE ;
LEDGER.BILLBOOKNO<0 AND LEDGER.ACODELEDG==ACCOUNTS.ACODE INTO CURSOR ;
(M.CCURSORNAME)
RETURN
ENDPROC
**
**
PROCEDURE PrepTrialBal
LPARAMETERS DFDATE, DTDATE, OFRM, LEXCEPTOPSTOCK, LPREOPERATIVEEXPENSES
LOCAL NOPTRGRP, NOPGRP, NCLTRGRP, NCLGRP, CPITEM, CITEM, LOPCOMBINE, LCLCOMBINE, ;
NCURAREA, NNOOFPARAMS, LACCHEADTAMIL, LDETAILTAMIL
M.NNOOFPARAMS = PARAMETERS()
LOCAL CPATH, CALIAS
M.CPATH = CURYEARPATH()
M.CTABLENAME = 'TrialBal'
IF USED(M.CTABLENAME)
USE IN M.CTABLENAME
ENDIF
IF DIRECTORY(M.CPATH)
M.CTABLENAME = M.CPATH+M.CTABLENAME
ENDIF
ERASE (M.CTABLENAME)
IF TYPE("m.oFrm")<>'O'
M.LOPCOMBINE = .T.
ELSE
IF M.OFRM.BASECLASS<>'Form' .OR. UPPER(M.OFRM.CLASS)<>'FRMFROMTO'
M.LOPCOMBINE = .T.
ENDIF
ENDIF
IF M.NNOOFPARAMS<3 .OR. M.LOPCOMBINE
SET CLASSLIB TO "J:\Visual.Fox\tecClassLib\tecReportClass" ALIAS TECREPORT ADDITIVE
M.OFRM = CREATEOBJECT('tecReport.FrmFromTo')
RELEASE CLASSLIB "J:\Visual.Fox\tecClassLib\tecReportClass"
ENDIF
WITH M.OFRM
M.LACCHEADTAMIL = .LACCHEADTAMIL
M.LDETAILTAMIL = .LDETAILTAMIL
ENDWITH
SELECT JOURTRAN.ACODE, SUM(IIF(JOURDATE.VOUCHDATE>=M.DFDATE AND ;
JOURDATE.VOUCHDATE<=M.DTDATE, JOURTRAN.AMOUNT, 0000000000000000.00 )) AS ;
AMOUNT, SUM(IIF(JOURDATE.VOUCHDATE 0000000000000000.00 )) AS OPENBAL FROM JourTran, JourDate WHERE ;
JOURTRAN.VOUCHER==JOURDATE.VOUCHER GROUP BY JOURTRAN.ACODE INTO CURSOR ;
'cursSum'
IF M.LACCHEADTAMIL
SELECT ACCOUNTS.ACODE, ACCGROUPS.GRPCODE, TRGROUPS.GRPCODE AS TRGRPCODE, ;
ACCOUNTS.TPACC AS DETAIL, ACCOUNTS.TACC AS SELHEAD, ACCOUNTS.INNER, ;
ACCOUNTS.TYPE, ACCOUNTS.ACCTYPE, ACCGROUPS.COMBINE, 'A' AS HEADER, ;
0000000 AS SNO FROM Accounts, AccGroups, TrGroups WHERE ACCOUNTS.GRPNO== ;
ACCGROUPS.GRPNO AND ACCOUNTS.TRGRPNO==TRGROUPS.GRPNO AND ;
ACCOUNTS.CUSTTYPE<>14 INTO CURSOR 'cursAccounts'
ELSE
SELECT ACCOUNTS.ACODE, ACCGROUPS.GRPCODE, TRGROUPS.GRPCODE AS TRGRPCODE, ;
ACCOUNTS.PACC AS DETAIL, ACCOUNTS.ACC AS SELHEAD, ACCOUNTS.INNER, ;
ACCOUNTS.TYPE, ACCOUNTS.ACCTYPE, ACCGROUPS.COMBINE, 'A' AS HEADER, ;
0000000 AS SNO FROM Accounts, AccGroups, TrGroups WHERE ACCOUNTS.GRPNO== ;
ACCGROUPS.GRPNO AND ACCOUNTS.TRGRPNO==TRGROUPS.GRPNO AND ;
ACCOUNTS.CUSTTYPE<>14 INTO CURSOR 'cursAccounts'
ENDIF
IF USED('cursOpenBal')
USE IN 'cursOpenBal'
ENDIF
SELECT CURSACCOUNTS.ACODE, NVL(OPENBAL.AMOUNT, 0000000000000000.00 ) AS OPENBAL, ;
CURSACCOUNTS.GRPCODE, CURSACCOUNTS.TRGRPCODE, CURSACCOUNTS.DETAIL, ;
CURSACCOUNTS.SELHEAD, CURSACCOUNTS.INNER, CURSACCOUNTS.TYPE, ;
CURSACCOUNTS.ACCTYPE, CURSACCOUNTS.HEADER, CURSACCOUNTS.SNO, ;
CURSACCOUNTS.COMBINE FROM cursAccounts LEFT JOIN OpenBal ON ;
CURSACCOUNTS.ACODE==OPENBAL.ACODE INTO CURSOR 'cursOpenBal'
SELECT CURSOPENBAL.ACODE, NVL(CURSSUM.AMOUNT, 0000000000000000.00 ) AS AMOUNT, ;
CURSOPENBAL.OPENBAL+NVL(CURSSUM.OPENBAL, 0000000000000000.00 ) AS OPENBAL, ;
CURSOPENBAL.TRGRPCODE, CURSOPENBAL.GRPCODE, CURSOPENBAL.DETAIL, ;
CURSOPENBAL.COMBINE, CURSOPENBAL.SELHEAD, CURSOPENBAL.INNER, ;
CURSOPENBAL.TYPE, CURSOPENBAL.ACCTYPE, CURSOPENBAL.HEADER, ;
CURSOPENBAL.SNO FROM cursOpenBal LEFT JOIN cursSum ON CURSOPENBAL.ACODE== ;
CURSSUM.ACODE INTO TABLE (M.CTABLENAME)
USE IN 'cursSum'
USE IN 'cursOpenBal'
IF .NOT. M.LEXCEPTOPSTOCK
M.NOPTRGRP = 0
M.NOPGRP = 0
M.NCLTRGRP = 999999
M.NCLGRP = 999999
IF SEEK('OPENING STOCK', 'TrGroups', 'GROUP')
M.NOPTRGRP = TRGROUPS.GRPCODE
ENDIF
IF SEEK('OPENING STOCK', 'AccGroups', 'GROUP')
M.NOPGRP = ACCGROUPS.GRPCODE
M.LOPCOMBINE = ACCGROUPS.COMBINE
ENDIF
IF SEEK('CLOSING STOCK', 'TrGroups', 'GROUP')
M.NCLTRGRP = TRGROUPS.GRPCODE
ENDIF
IF SEEK('CLOSING STOCK', 'AccGroups', 'GROUP')
M.NCLGRP = ACCGROUPS.GRPCODE
M.LCLCOMBINE = ACCGROUPS.COMBINE
ENDIF
SELECT OPENINGSTOCK.ITEMCODE, SUM(OPENINGSTOCK.AMOUNT) AS OPENVALUE, ;
SUM(OPENINGSTOCK.CLOSEVALUE) AS CLOSEVALUE FROM OpeningStock GROUP BY ;
OPENINGSTOCK.ITEMCODE INTO CURSOR 'cursOpStock'
GOTO TOP IN 'cursOpStock'
DO WHILE .NOT. EOF('cursOpStock')
IF M.LACCHEADTAMIL
M.CPITEM = ITEMCODETOTPITEM(CURSOPSTOCK.ITEMCODE)
ELSE
M.CPITEM = ITEMCODETOPITEM(CURSOPSTOCK.ITEMCODE)
ENDIF
M.CITEM = ITEMCODETOITEM(CURSOPSTOCK.ITEMCODE)
IF CURSOPSTOCK.OPENVALUE<>0
APPEND IN 'TrialBal' BLANK
REPLACE TRIALBAL.DETAIL WITH M.CPITEM, TRIALBAL.SELHEAD WITH M.CITEM, ;
TRIALBAL.AMOUNT WITH 0.0 , TRIALBAL.OPENBAL WITH - ;
CURSOPSTOCK.OPENVALUE, TRIALBAL.HEADER WITH 'O', TRIALBAL.TRGRPCODE ;
WITH M.NOPTRGRP, TRIALBAL.GRPCODE WITH M.NOPGRP, TRIALBAL.COMBINE ;
WITH M.LOPCOMBINE IN 'TrialBal'
ENDIF
IF CURSOPSTOCK.CLOSEVALUE<>0
APPEND IN 'TrialBal' BLANK
REPLACE TRIALBAL.DETAIL WITH M.CPITEM, TRIALBAL.SELHEAD WITH M.CITEM, ;
TRIALBAL.OPENBAL WITH 0.0 , TRIALBAL.AMOUNT WITH ;
CURSOPSTOCK.CLOSEVALUE, TRIALBAL.HEADER WITH 'C', TRIALBAL.TRGRPCODE ;
WITH M.NCLTRGRP, TRIALBAL.GRPCODE WITH M.NCLGRP, TRIALBAL.COMBINE ;
WITH M.LCLCOMBINE IN 'TrialBal'
ENDIF
SKIP IN 'cursOpStock'
ENDDO
USE IN 'cursOpStock'
ENDIF
M.NCURAREA = SELECT()
SELECT 'TrialBal'
DELETE ALL FOR TRIALBAL.OPENBAL==0 .AND. TRIALBAL.AMOUNT==0
PACK
INDEX ON STR(TRGRPCODE)+STR(GRPCODE)+UPPER(SELHEAD) TO ACCREPORTS
SELECT (M.NCURAREA)
RETURN
ENDPROC
**
PROCEDURE PrepTrialBalanceReports
LPARAMETERS NTRIALBALTYPE, OFRM
LOCAL LHEADING, LCOMBINED, LINNER, LHEADTAMIL, LACCHEADTAMIL, LDETAILTAMIL, ;
COPENINGSTOCK, CCLOSINGSTOCK, NNOOFPARAMS
M.NNOOFPARAMS = PARAMETERS()
IF TYPE("m.oFrm")<>'O'
M.LINNER = .T.
ELSE
IF M.OFRM.BASECLASS<>'Form' .OR. UPPER(M.OFRM.CLASS)<>'FRMFROMTO'
M.LINNER = .T.
ENDIF
ENDIF
IF M.NNOOFPARAMS<2 .OR. M.LINNER
SET CLASSLIB TO "D:\Visual.Fox\tecClassLib\tecReportClass" ALIAS TECREPORT ADDITIVE
M.OFRM = CREATEOBJECT('tecReport.FrmFromTo')
RELEASE CLASSLIB "D:\Visual.Fox\tecClassLib\tecReportClass"
ENDIF
WITH M.OFRM
M.LHEADING = .LWITHHEADING
M.LCOMBINED = .LCOMBINE
M.LINNER = .LINNER
M.LHEADTAMIL = .LHEADTAMIL
M.LACCHEADTAMIL = .LACCHEADTAMIL
M.LDETAILTAMIL = .LDETAILTAMIL
IF M.LACCHEADTAMIL
M.COPENINGSTOCK = .CTOPENINGSTOCK
M.CCLOSINGSTOCK = .CTCLOSINGSTOCK
ELSE
M.COPENINGSTOCK = .COPENINGSTOCK
M.CCLOSINGSTOCK = .CCLOSINGSTOCK
ENDIF
ENDWITH
LOCAL NTRGRP, NGRP, NTOTAMT, NOPTOTAMT, NRECCOUNT, I, CCURALIAS, NPREVTRGRP, ;
LRECALREADYPROCSSED, LOPHEADER, NCURRECNO, NSERIALNO
M.CCURALIAS = SELECT()
SELECT ('TrialBal')
SET ORDER TO ACCREPORTS
IF M.NTRIALBALTYPE==04
REPLACE TRIALBAL.AMOUNT WITH -TRIALBAL.AMOUNT ALL FOR TRIALBAL.HEADER=='C' IN ;
'TrialBal'
ENDIF
M.NPREVTRGRP = -1
M.LOPHEADER = .F.
M.NSERIALNO = 0
M.LRECALREADYPROCSSED = .F.
SETFILTERTOTRIALBAL(M.NTRIALBALTYPE, FILTER('TrialBal'))
GOTO TOP IN 'TrialBal'
DO WHILE .NOT. EOF('TrialBal')
IF M.LOPHEADER .AND. (M.NPREVTRGRP<>TRIALBAL.TRGRPCODE .OR. TRIALBAL.HEADER<> ;
'O' .AND. TRIALBAL.HEADER<>'C')
M.LOPHEADER = .F.
REPCURSACC('', '')
ENDIF
IF TRIALBAL.HEADER=='O' .AND. TRIALBAL.TRGRPCODE<>M.NPREVTRGRP
M.NPREVTRGRP = TRIALBAL.TRGRPCODE
M.LOPHEADER = .T.
REPCURSACC(M.COPENINGSTOCK, 'H')
ENDIF
M.NTRGRP = TRIALBAL.TRGRPCODE
M.NGRP = TRIALBAL.GRPCODE
M.NTOTAMT = 0
M.NOPTOTAMT = 0
IF M.LCOMBINED .AND. TRIALBAL.COMBINE
DO WHILE .NOT. EOF('TrialBal') .AND. TRIALBAL.COMBINE .AND. ;
TRIALBAL.TRGRPCODE==M.NTRGRP .AND. TRIALBAL.GRPCODE==M.NGRP
M.NTOTAMT = M.NTOTAMT+TRIALBAL.AMOUNT
M.NOPTOTAMT = M.NOPTOTAMT+TRIALBAL.OPENBAL
SKIP IN 'TrialBal'
ENDDO
SKIP -1 IN 'TrialBal'
M.LRECALREADYPROCSSED = .T.
IF M.NPREVTRGRP<>M.NTRGRP .AND. M.LHEADING
IF M.LHEADTAMIL
REPCURSACC(TRGRPCODETOTPGROUP(M.NTRGRP), 'H')
ELSE
REPCURSACC(TRGRPCODETOPGROUP(M.NTRGRP), 'H')
ENDIF
M.NPREVTRGRP = M.NTRGRP
ENDIF
M.NSERIALNO = M.NSERIALNO+1
IF M.LHEADTAMIL
REPCURSACC(ACCGRPCODETOTPGROUP(M.NGRP), 'A', M.NTOTAMT, M.NSERIALNO, ;
M.NOPTOTAMT)
ELSE
REPCURSACC(ACCGRPCODETOPGROUP(M.NGRP), 'A', M.NTOTAMT, M.NSERIALNO, ;
M.NOPTOTAMT)
ENDIF
ELSE
M.LRECALREADYPROCSSED = .F.
ENDIF
IF (M.LINNER .AND. TRIALBAL.INNER .AND. .NOT. M.LRECALREADYPROCSSED)
M.NRECCOUNT = 0
M.NCURRECNO = RECNO('TrialBal')
DO WHILE .NOT. EOF('TrialBal') .AND. TRIALBAL.INNER .AND. TRIALBAL.TRGRPCODE== ;
M.NTRGRP .AND. TRIALBAL.GRPCODE==M.NGRP .AND. .NOT. (TRIALBAL.COMBINE ;
.AND. M.LCOMBINED)
M.NRECCOUNT = M.NRECCOUNT+1
M.NTOTAMT = M.NTOTAMT+TRIALBAL.AMOUNT
M.NOPTOTAMT = M.NOPTOTAMT+TRIALBAL.OPENBAL
SKIP IN 'TrialBal'
ENDDO
IF M.NRECCOUNT>0
SKIP -1 IN 'TrialBal'
M.LRECALREADYPROCSSED = .T.
IF M.NPREVTRGRP<>M.NTRGRP .AND. M.LHEADING
IF M.LHEADTAMIL
REPCURSACC(TRGRPCODETOTPGROUP(M.NTRGRP), 'H')
ELSE
REPCURSACC(TRGRPCODETOPGROUP(M.NTRGRP), 'H')
ENDIF
M.NPREVTRGRP = M.NTRGRP
ENDIF
ENDIF
IF M.NRECCOUNT>1
GOTO M.NCURRECNO IN 'TrialBal'
FOR I = 1 TO M.NRECCOUNT
M.NSERIALNO = M.NSERIALNO+1
REPCURSACC(TRIALBAL.DETAIL, TRIALBAL.HEADER, 0.0 , M.NSERIALNO, ;
TRIALBAL.OPENBAL, TRIALBAL.AMOUNT)
SKIP IN 'TrialBal'
NEXT
SKIP -1 IN 'TrialBal'
REPCURSACC('', '=', M.NTOTAMT, 0.0 , M.NOPTOTAMT)
ELSE
IF M.NRECCOUNT==1
M.NSERIALNO = M.NSERIALNO+1
REPCURSACC(TRIALBAL.DETAIL, TRIALBAL.HEADER, TRIALBAL.AMOUNT, M.NSERIALNO, ;
TRIALBAL.OPENBAL)
ENDIF
ENDIF
ENDIF
IF .NOT. M.LRECALREADYPROCSSED
IF M.LHEADING .AND. M.NPREVTRGRP<>TRIALBAL.TRGRPCODE .AND. TRIALBAL.TRGRPCODE> ;
0
M.NPREVTRGRP = TRIALBAL.TRGRPCODE
IF M.LHEADTAMIL
REPCURSACC(TRGRPCODETOTPGROUP(TRIALBAL.TRGRPCODE), 'H')
ELSE
REPCURSACC(TRGRPCODETOPGROUP(TRIALBAL.TRGRPCODE), 'H')
ENDIF
ENDIF
M.NSERIALNO = M.NSERIALNO+1
REPCURSACC(TRIALBAL.DETAIL, TRIALBAL.HEADER, TRIALBAL.AMOUNT, M.NSERIALNO, ;
TRIALBAL.OPENBAL)
ENDIF
IF .NOT. EOF('TrialBal')
SKIP IN 'TrialBal'
ENDIF
ENDDO
RETURN
ENDPROC
**
PROCEDURE RepcursAcc
LPARAMETERS CDETAIL, CHEADER, NAMOUNT, NSERIALNO, NOPENBAL, NINAMOUNT
LOCAL NNOOFPARAM, LRVAL, LINNER
M.LRVAL = .T.
M.LINNER = .T.
M.NNOOFPARAM = PARAMETERS()
IF M.NNOOFPARAM<6
M.NINAMOUNT = 0.0
M.LINNER = .F.
ENDIF
IF M.NNOOFPARAM<5
M.NOPENBAL = 0.0
ENDIF
IF M.NNOOFPARAM<4
M.NSERIALNO = 0.0
ENDIF
IF M.NNOOFPARAM<3
M.NAMOUNT = 0.0
ENDIF
IF M.NNOOFPARAM>=2
IF EOF('cursAcc')
APPEND IN 'cursAcc' BLANK
ENDIF
REPLACE CURSACC.SNO WITH M.NSERIALNO, CURSACC.DDETAIL WITH M.CDETAIL, ;
CURSACC.DHEADER WITH M.CHEADER, CURSACC.DAMOUNT WITH M.NAMOUNT, ;
CURSACC.DOPENBAL WITH M.NOPENBAL, CURSACC.DINAMOUNT WITH M.NINAMOUNT, ;
CURSACC.DINNER WITH M.LINNER IN 'cursAcc'
IF .NOT. EOF('cursAcc')
SKIP IN 'cursAcc'
ENDIF
ELSE
M.LRVAL = .F.
ENDIF
RETURN M.LRVAL
ENDPROC
**
PROCEDURE SetFilterToTrialBal
LPARAMETERS NTRIALBALTYPE, CPREFILTERCONDI
LOCAL NCURAREA, CFILTER
M.NCURAREA = SELECT()
SELECT ('TrialBal')
IF EMPTY(M.CPREFILTERCONDI)
M.CFILTER = '.T.'
ELSE
M.CFILTER = M.CPREFILTERCONDI
ENDIF
DO CASE
CASE M.NTRIALBALTYPE==02
SET FILTER TO ( &CFILTER );
.AND. TRIALBAL->HEADER != 'O';
.AND. TRIALBAL->HEADER != 'C';
.AND. TRIALBAL->AMOUNT != 0
CASE M.NTRIALBALTYPE==03
SET FILTER TO ( &CFILTER ).AND. TRIALBAL->HEADER != 'C';
.AND. ( TRIALBAL->HEADER == 'O';
.OR. TRIALBAL->OPENBAL != 0 )
CASE M.NTRIALBALTYPE==04
SET FILTER TO ( &CFILTER ) .AND. (TRIALBAL->AMOUNT + TRIALBAL->OPENBAL) != 0
OTHERWISE
SET FILTER TO ( &CFILTER );
.AND. TRIALBAL->HEADER != 'C';
.AND. (TRIALBAL->AMOUNT + TRIALBAL->OPENBAL) != 0
ENDCASE
IF .NOT. EMPTY(M.NCURAREA)
SELECT (M.NCURAREA)
ENDIF
RETURN
ENDPROC
**
**
PROCEDURE PrepCursRecpPaym
LPARAMETERS CCURSNAME, LHEADING, LCOMBINED, COUTPUTCURSNAME
LOCAL NTRGRP, NGRP, NTOTAMT1, NTOTAMT2, LRECALREADYPROCSSED, NPREVTRGRP
CRECURS(M.COUTPUTCURSNAME)
GOTO TOP IN M.CCURSNAME
M.NPREVTRGRP = -1
DO WHILE .NOT. EOF(M.CCURSNAME)
IF M.LCOMBINED .AND. &CCURSNAME->RCOMBINE
M.NTRGRP = &CCURSNAME->RTRGRPCODE
M.NGRP = &CCURSNAME->RGRPCODE
M.NTOTAMT1 = 0
M.NTOTAMT2 = 0
DO WHILE !eof( m.cCursName );
.and. &cCursName->RCOMBINE ;
.and. &cCursName->RTRGRPCODE == m.nTrGrp ;
.and. &cCursName->RGRPCODE == m.nGrp
M.NTOTAMT1 = M.NTOTAMT1 + &CCURSNAME->RCPTUPTO
M.NTOTAMT2 = M.NTOTAMT2 + &CCURSNAME->RCPTDURING
SKIP IN M.CCURSNAME
ENDDO
SKIP -1 IN M.CCURSNAME
M.LRECALREADYPROCSSED = .T.
IF M.NPREVTRGRP<>M.NTRGRP .AND. M.LHEADING
REPCURSDEBIT(M.COUTPUTCURSNAME, TRGRPCODETOPGROUP(M.NTRGRP), 'H')
M.NPREVTRGRP = M.NTRGRP
ENDIF
REPCURSDEBIT(M.COUTPUTCURSNAME, ACCGRPCODETOPGROUP(M.NGRP), 'A', M.NTOTAMT1, ;
M.NTOTAMT2)
ELSE
M.LRECALREADYPROCSSED = .F.
ENDIF
IF .NOT. M.LRECALREADYPROCSSED
IF M.LHEADING .AND. M.NPREVTRGRP != &CCURSNAME->RTRGRPCODE
M.NPREVTRGRP = &CCURSNAME->RTRGRPCODE
REPCURSDEBIT( M.COUTPUTCURSNAME, TRGRPCODETOPGROUP( &CCURSNAME->RTRGRPCODE), 'H' )
ENDIF
REPCURSDEBIT( M.COUTPUTCURSNAME, &CCURSNAME->RPACC, &CCURSNAME->RHEADER, &CCURSNAME->RCPTUPTO,;
&CCURSNAME->RCPTDURING )
ENDIF
IF .NOT. EOF(M.CCURSNAME)
SKIP IN M.CCURSNAME
ENDIF
ENDDO
GOTO TOP IN M.CCURSNAME
GOTO TOP IN M.COUTPUTCURSNAME
M.NPREVTRGRP = -1
DO WHILE .NOT. EOF(M.CCURSNAME)
IF M.LCOMBINED .AND. &CCURSNAME->DCOMBINE
M.NTRGRP = &CCURSNAME->DTRGRPCODE
M.NGRP = &CCURSNAME->DGRPCODE
M.NTOTAMT1 = 0
M.NTOTAMT2 = 0
DO WHILE !eof( m.cCursName );
.and. &cCursName->DCOMBINE ;
.and. &cCursName->DTRGRPCODE == m.nTrGrp ;
.and. &cCursName->DGRPCODE == m.nGrp
M.NTOTAMT1 = M.NTOTAMT1 + &CCURSNAME->DISBUPTO
M.NTOTAMT2 = M.NTOTAMT2 + &CCURSNAME->DISBDURING
SKIP IN M.CCURSNAME
ENDDO
SKIP -1 IN M.CCURSNAME
M.LRECALREADYPROCSSED = .T.
IF M.NPREVTRGRP<>M.NTRGRP .AND. M.LHEADING
REPCURSCREDIT(M.COUTPUTCURSNAME, TRGRPCODETOPGROUP(M.NTRGRP), 'H')
M.NPREVTRGRP = M.NTRGRP
ENDIF
REPCURSCREDIT(M.COUTPUTCURSNAME, ACCGRPCODETOPGROUP(M.NGRP), 'A', M.NTOTAMT1, ;
M.NTOTAMT2)
ELSE
M.LRECALREADYPROCSSED = .F.
ENDIF
IF .NOT. M.LRECALREADYPROCSSED
IF M.LHEADING .AND. M.NPREVTRGRP != &CCURSNAME->DTRGRPCODE
M.NPREVTRGRP = &CCURSNAME->DTRGRPCODE
REPCURSCREDIT( M.COUTPUTCURSNAME, TRGRPCODETOPGROUP( &CCURSNAME->DTRGRPCODE), 'H' )
ENDIF
REPCURSCREDIT( M.COUTPUTCURSNAME, &CCURSNAME->DPACC, &CCURSNAME->DHEADER, &CCURSNAME->DISBUPTO,;
&CCURSNAME->DISBDURING )
ENDIF
IF .NOT. EOF(M.CCURSNAME)
SKIP IN M.CCURSNAME
ENDIF
ENDDO
RETURN .T.
ENDPROC
**
PROCEDURE CreCurs
LPARAMETERS CCURSNAME
LOCAL NCURAREA
M.NCURAREA = SELECT()
CREATE CURSOR (M.CCURSNAME) (RHEADER C (1), RPACC C (25), RCPTUPTO N (18, 2), ;
RCPTDURING N (18, 2), RCPTTOTAL N (18, 2), DHEADER C (1), DPACC C (25), ;
DISBUPTO N (18, 2), DISBDURING N (18, 2), DISBTOTAL N (18, 2))
SELECT (M.NCURAREA)
RETURN .T.
ENDPROC
**
PROCEDURE RepCursDebit
LPARAMETERS CCURSNAME, CDETAIL, CHEADER, NAMTUPTO, NAMTDURING
LOCAL NNOOFPARAM, LRVAL
M.LRVAL = .T.
M.NNOOFPARAM = PARAMETERS()
IF M.NNOOFPARAM<5
M.NAMTDURING = 0.0
ENDIF
IF M.NNOOFPARAM<4
M.NAMTUPTO = 0.0
ENDIF
IF M.NNOOFPARAM>=2
IF EOF(M.CCURSNAME)
APPEND IN M.CCURSNAME BLANK
ENDIF
REPLACE &CCURSNAME->RPACC WITH M.CDETAIL, &CCURSNAME->RHEADER WITH M.CHEADER,;
&CCURSNAME->RCPTUPTO WITH M.NAMTUPTO, &CCURSNAME->RCPTDURING WITH M.NAMTDURING,;
&CCURSNAME->RCPTTOTAL WITH M.NAMTUPTO + M.NAMTDURING IN M.CCURSNAME
IF .NOT. EOF(M.CCURSNAME)
SKIP IN M.CCURSNAME
ENDIF
ELSE
M.LRVAL = .F.
ENDIF
RETURN M.LRVAL
ENDPROC
**
PROCEDURE RepCursCredit
LPARAMETERS CCURSNAME, CDETAIL, CHEADER, NAMTUPTO, NAMTDURING
LOCAL NNOOFPARAM, LRVAL
M.LRVAL = .T.
M.NNOOFPARAM = PARAMETERS()
IF M.NNOOFPARAM<5
M.NAMTDURING = 0.0
ENDIF
IF M.NNOOFPARAM<4
M.NAMTUPTO = 0.0
ENDIF
IF M.NNOOFPARAM>=2
IF EOF(M.CCURSNAME)
APPEND IN M.CCURSNAME BLANK
ENDIF
REPLACE &CCURSNAME->DPACC WITH M.CDETAIL, &CCURSNAME->DHEADER WITH M.CHEADER,;
&CCURSNAME->DISBUPTO WITH M.NAMTUPTO, &CCURSNAME->DISBDURING WITH M.NAMTDURING;
&CCURSNAME->DISBTOTAL WITH M.NAMTUPTO + M.NAMTDURING IN M.CCURSNAME
IF .NOT. EOF(M.CCURSNAME)
SKIP IN M.CCURSNAME
ENDIF
ELSE
M.LRVAL = .F.
ENDIF
RETURN M.LRVAL
ENDPROC
**
**
PROCEDURE RunMenuSelection
LPARAMETERS NPADNO, NBARNO, CPADNAME, CCOMMAND, NMENUTYPE
IF TYPE("_SCREEN.ActiveForm")=='O' .AND. UPPER(_SCREEN.ACTIVEFORM.NAME)== ;
'FRMMENUFORSCHEMES'
_SCREEN.ACTIVEFORM.MYMENUSELECTED(M.NPADNO, M.NBARNO, M.CPADNAME)
ELSE
&CCOMMAND
ENDIF
ENDPROC
**
PUBTAG = ''
RETURN
ENDPROC
**
LPARAMETERS MENUNAME, LMENUAPPEND, LWITHOUTUSER, LWITHOUTCOMPANYMENU
LOCAL CMENUNAME, NOOFPARAMS, CFINAME, NFILEHANDLE, CCURFOLDER
NOOFPARAMS = PARAMETERS()
M.CCURFOLDER = SYS(5)+CURDIR()
IF RIGHT(M.CCURFOLDER, 8)=='DESKTOP\'
= MESSAGEBOX(' From "DESKTOP" as a Data Area. '+CHR(13)+ ;
" Shortcut's 'Start in:' is InValid/Empty Path. ", 16, ;
"Can't Start Application.")
QUIT
ENDIF
WITH _SCREEN
.CLOSABLE = .F.
.CAPTION = 'AA 520 VEERAPPAMPALAYAM PACB INDIA - 638 101.'
.WINDOWSTATE = 2
M.CMENUNAME = 'BackGroundTAG.BMP'
IF FILE(M.CCURFOLDER+'BMPS\'+'BackGround.BMP')
M.CMENUNAME = M.CCURFOLDER+'BMPS\'+'BackGround.BMP'
ELSE
IF FILE(M.CCURFOLDER+'BackGround.BMP')
M.CMENUNAME = M.CCURFOLDER+'BackGround.BMP'
ENDIF
ENDIF
.PICTURE = M.CMENUNAME
ENDWITH
ADDPICTURE("Tag.Bmp")
DO DEFINESETCOMMANDS
DO DEFINEPUBVARIABLES
IF FILE('Tag.hlp')
SET HELP TO Tag
ENDIF
SET PROCEDURE TO PRGS\FUNCT.PRG ADDITIVE
SET PROCEDURE TO PRGS\DynamicMenu\TagMenuProcedures.PRG ADDITIVE
IF M.NOOFPARAMS==0 .OR. M.NOOFPARAMS>=2 .AND. M.LMENUAPPEND
M.CMENUNAME = 'File.mpr'
DO &CMENUNAME
M.CMENUNAME = 'Details.mpr'
DO &CMENUNAME
M.CMENUNAME = 'Transactions.mpr'
DO &CMENUNAME
M.CMENUNAME = 'Utilities.mpr'
DO &CMENUNAME
M.CMENUNAME = 'AccountReports.mpr'
DO &CMENUNAME
M.CMENUNAME = 'StockReports.mpr'
DO &CMENUNAME
ELSE
DO USERMENU
ENDIF
IF M.NOOFPARAMS<>0 .AND. .NOT. EMPTY(M.MENUNAME)
M.CMENUNAME = M.MENUNAME+'.mpr'
DO &CMENUNAME
ENDIF
DO Help.mpr
DO CHECKMACRO IN 'J:\Visual.Fox\Tag\Prgs\CheckMacro' WITH (PUBMACROFILENAME)
LOCAL LTEMP
M.LTEMP = .T.
IF M.LTEMP
IF M.LWITHOUTUSER
M.CMENUNAME = 'Company.mpr'
DO &CMENUNAME
ELSE
DO UserLogin.PRG WITH .T., M.LWITHOUTCOMPANYMENU
ENDIF
READ EVENTS
RELEASE MENU
ENDIF
= FCLOSE(M.NFILEHANDLE)
IF .NOT. EMPTY(PUBMACROFILENAME)
SAVE MACROS TO (PUBMACROFILENAME)
ENDIF
CLOSE ALL
CLEAR ALL
_SCREEN.CLOSABLE = .T.
_SCREEN.CAPTION = 'Visual FoxPro'
_SCREEN.WINDOWSTATE = 2
_SCREEN.PICTURE = ''
SET SYSMENU TO DEFAULT
CLEAR RESOURCES
ENDPROC
**
PROCEDURE AddPicture
LPARAMETERS CBMPFILENAME, NPOSITION
WITH _SCREEN
.ADDOBJECT('oPicture', 'Image')
WITH .OPICTURE
.BACKSTYLE = 0
.PICTURE = M.CBMPFILENAME
.LEFT = (.PARENT.WIDTH/2)-(.WIDTH/2)
.TOP = (.PARENT.HEIGHT/2)-(.HEIGHT/2)
.VISIBLE = .T.
ENDWITH
ENDWITH
RETURN
ENDPROC
**
PROCEDURE DefineSETCommands
SET TALK OFF
SET SCOREBOARD OFF
SET SAFETY OFF
SET DEBUG OFF
SET STEP OFF
SET DATE TO DMY
SET EXACT ON
SET CENTURY ON
SET DELETED ON
SET EXCLUSIVE OFF
SET REPROCESS TO 4 SECONDS
SET ESCAPE OFF
SET MACKEY TO SHIFT+F11
RETURN
ENDPROC
**
PROCEDURE DefinePubVariables
PUBLIC PUBTAMILFONTNAME, PUBTAMILFONTSIZE, PUBCOMPANYOPENED, PUBCUSTOM, ;
PUBMACROFILENAME, PUBUSERCODE, PUBTAG, PUBLICENSENO, PUBRCNUMBER, PUBSST, ;
PUBCST
PUBLIC PUBASCRFORSCHEME(1, 2)
PUBTAMILFONTNAME = 'GANGHA'
PUBTAMILFONTSIZE = 12
PUBCOMPANYOPENED = .F.
PUBCUSTOM = .F.
PUBMACROFILENAME = 'Tag.FKY'
PUBUSERCODE = 0
PUBTAG = ''
PUBLICENSENO = ''
PUBRCNUMBER = ''
PUBSST = ''
PUBCST = ''
DO LOADTAMIL
PUBLIC PUBSDATE, PUBEDATE
PUBSDATE = DATE()
PUBEDATE = PUBSDATE
PUBLIC PUBGCODE, PUBGCOMPANY, PUBPGCOMPANY
PUBLIC PUBCCODE, PUBCOMPANY, PUBPCOMPANY, PUBTPCOMPANY, PUBYEARNO, PUBPYEAR
M.PUBGCODE = 0
M.PUBGCOMPANY = ''
M.PUBPGCOMPANY = ''
M.PUBCCODE = 0
M.PUBCOMPANY = ''
M.PUBPCOMPANY = ''
M.PUBTPCOMPANY = 'blf;ndhfpuhl;'
M.PUBYEARNO = 0
M.PUBPYEAR = ''
DO SETAPPPASSWORD
RETURN
ENDPROC
**
**
PROCEDURE SetScrForScheme
LPARAMETERS NUSERCODE
LOCAL NARRLEN, NCURAREA, LUSED, ISCHEMEID, LUSERSETTINGSUSED
DECLARE ARRTEMP(1, 2)
M.ISCHEMEID = 0
M.NCURAREA = SELECT()
IF .NOT. USED('UserSettings')
IF FILE('UserSettings.Dbf')
SELECT 0
USE 'UserSettings' ALIAS 'UserSettings'
M.LUSERSETTINGSUSED = .F.
ELSE
WAIT WINDOW NOWAIT 'File UserSettings Not Found'
WAIT CLEAR
ENDIF
ELSE
M.LUSERSETTINGSUSED = .T.
ENDIF
IF M.LUSERSETTINGSUSED .OR. USED('UserSettings')
IF SEEK(M.NUSERCODE, 'UserSettings', 'USERCODE')
M.ISCHEMEID = USERSETTINGS.SCRSCHEME
ELSE
M.ISCHEMEID = 0
ENDIF
ENDIF
M.LUSED = USED('ScrForScheme')
IF .NOT. M.LUSED
IF FILE('ScrForScheme.Dbf')
SELECT 0
USE 'ScrForScheme' ALIAS 'ScrForScheme'
ELSE
WAIT WINDOW NOWAIT 'File ScrForScheme Not Found'
WAIT CLEAR
ENDIF
ENDIF
IF USED('ScrForScheme')
SELECT SCRFORSCHEME.SCREENID, SCRFORSCHEME.OTHERS FROM ScrForScheme WHERE ;
SCRFORSCHEME.SCHEMEID==M.ISCHEMEID INTO ARRAY ARRTEMP
ENDIF
M.NARRLEN = ALEN(ARRTEMP, 1)
DECLARE PUBASCRFORSCHEME(M.NARRLEN, 2)
= ACOPY(ARRTEMP, PUBASCRFORSCHEME)
IF .NOT. M.LUSERSETTINGSUSED .AND. USED('UserSettings')
USE IN 'UserSettings'
ENDIF
IF .NOT. M.LUSED .AND. USED('ScrForScheme')
USE IN 'ScrForScheme'
ENDIF
IF .NOT. EMPTY(M.NCURAREA)
SELECT (M.NCURAREA)
ENDIF
RETURN
ENDPROC
**
DO SETPROC WITH 'Society', .T.
ENDPROC
**
**
PROCEDURE procDoForm
LPARAMETERS CFORMNAME
IF CLOSEALLFORMS(' ')
CLOSE DATABASES
DO FORM (M.CFORMNAME)
ENDIF
RETURN
ENDPROC
**
PROCEDURE ProcOpenCompany
LOCAL NTMPUSERCODE
IF CLOSEALLFORMS(' ')
CLOSE DATABASES
DO OPENCOMPANY
ENDIF
RETURN
ENDPROC
**
PROCEDURE ProcCalculator
LOCAL CWINCALCULATOR
M.CWINCALCULATOR = GETENV('WINDIR')+'\'+'CALC.EXE'
IF FILE(M.CWINCALCULATOR)
M.CWINCALCULATOR = '/N '+M.CWINCALCULATOR
! &CWINCALCULATOR
ELSE
ACTIVATE WINDOW CALCULATOR
ENDIF
RETURN
ENDPROC
**
PROCEDURE ProcMacro
KEYBOARD ('{'+SET("MACKEY")+'}')
RETURN
ENDPROC
**
PROCEDURE ProcClearMacros
CLEAR MACROS
PUBMACROFILENAME = ' '
RETURN
ENDPROC
**
PROCEDURE procLoadMacros
LOCAL CFULFINAME
M.CFULFINAME = GETFILE( 'FKY', '', '&Load')
IF FILE(M.CFULFINAME) .AND. CHECKMACRO(M.CFULFINAME)
CLEAR MACROS
PUBMACROFILENAME = M.CFULFINAME
RESTORE MACROS FROM (M.CFULFINAME)
ENDIF
RETURN
ENDPROC
**
PROCEDURE procSaveMacros
LOCAL CFULFINAME
M.CFULFINAME = GETFILE( 'FKY', '', '&Save' )
IF .NOT. EMPTY(M.CFULFINAME)
SAVE MACROS TO (M.CFULFINAME)
PUBMACROFILENAME = M.CFULFINAME
ENDIF
RETURN
ENDPROC
**
PROCEDURE procOpen
SELECT 0
USE ?
RETURN
ENDPROC
**
PROCEDURE procCopyOldTAGData
LOCAL CPSW, CFORM
M.CFORM = 'GetPassword'
DO FORM &CFORM TO M.CPSW
M.CFORM = 'DataConver'
IF .NOT. EMPTY(M.CPSW) .AND. M.CPSW=='Puli4Kesi'
DO FORM &CFORM
ENDIF
RETURN
ENDPROC
**
PROCEDURE procCopyBillBookNo
LOCAL CPSW, CFORM
M.CFORM = 'GetPassword'
DO FORM &CFORM TO M.CPSW
IF .NOT. EMPTY(M.CPSW) .AND. M.CPSW=='Puli4Kesi'
M.CFORM = 'UpdateBillBooks'
DO FORM &CFORM
ENDIF
RETURN
ENDPROC
**
PROCEDURE procLoadSaveTransactions
LOCAL CPSW, CFORM
M.CFORM = 'GetPassword'
DO FORM &CFORM TO M.CPSW
IF .NOT. EMPTY(M.CPSW) .AND. M.CPSW=='Puli4Kesi'
M.CFORM = 'Update'
DO FORM &CFORM
ENDIF
RETURN
ENDPROC
**
PROCEDURE procUpdate
IF TYPE("_SCREEN.ActiveForm.tecCmdButtons.cmdAddMod")=='O'
IF _SCREEN.ACTIVEFORM.TECCMDBUTTONS.ADDMODBUTTONSTATE
KEYBOARD '{\ ELSE
KEYBOARD '{\ ENDIF
ENDIF
RETURN
ENDPROC
**
PROCEDURE procUndo
SYS(1500, '_MED_UNDO', '_MEDIT')
RETURN
ENDPROC
**
PROCEDURE procRedo
SYS(1500, '_MED_REDO', '_MEDIT')
RETURN
ENDPROC
**
PROCEDURE procCut
SYS(1500, '_MED_CUT', '_MEDIT')
RETURN
ENDPROC
**
PROCEDURE procCopy
SYS(1500, '_MED_COPY', '_MEDIT')
RETURN
ENDPROC
**
PROCEDURE procPaste
SYS(1500, '_MED_PASTE', '_MSM_EDIT')
RETURN
ENDPROC
**
PROCEDURE procFind
SYS(1500, '_MED_FIND', '_MEDIT')
RETURN
ENDPROC
**
PROCEDURE procFindAgain
SYS(1500, '_MED_FINDA', '_MEDIT')
RETURN
ENDPROC
**
PROCEDURE procIndexing
LOCAL CEXCLUSIVE
M.CEXCLUSIVE = SET('EXCLUSIVE')
IF CLOSEALLFORMS(' ')
CLOSE DATABASES
SET EXCLUSIVE ON
DO FORM Indexing
ENDIF
IF M.CEXCLUSIVE='OFF'
SET EXCLUSIVE OFF
ELSE
SET EXCLUSIVE ON
ENDIF
RETURN
ENDPROC
**
PROCEDURE ProcTagExit
IF CLOSEALLFORMS(' ')
DO CLOSETAG
ENDIF
RETURN
ENDPROC
**
PROCEDURE procHelp
SYS(1500, '_mst_help', '_MSM_SYSTM')
RETURN
ENDPROC
**
**
PROCEDURE TRupeesToWord
LPARAMETERS NNO
LOCAL NRUPEES
PRIVATE CWORDS, CTENSWORDS
DECLARE CWORDS[19], CTENSWORDS[9], CHUNDREDWORDS[9], CCONWORDS[9]
CWORDS[1] = 'Xd;W '
CWORDS[2] = ',uz;L '
CWORDS[3] = 'Kd;W '
CWORDS[4] = 'ehd;F '
CWORDS[5] = 'Ie;J '
CWORDS[6] = 'MW '
CWORDS[7] = 'VG '
CWORDS[8] = 'vl;L '
CWORDS[9] = 'Xd;gJ '
CWORDS[10] = 'gj;J '
CWORDS[11] = 'gjpbdhd;W '
CWORDS[12] = 'gdpbuz;L '
CWORDS[13] = 'gj:pKd;W '
CWORDS[14] = 'gjpdhd;F '
CWORDS[15] = 'gjpide;J '
CWORDS[16] = 'gjp;dhW '
CWORDS[17] = 'gjpndG '
CWORDS[18] = 'gjpbdl;L '
CWORDS[19] = 'gj;bjhd;gJ '
CTENSWORDS[1] = 'gj;J '
CTENSWORDS[2] = ',UgJ '
CTENSWORDS[3] = 'Kg;gJ '
CTENSWORDS[4] = 'ehw;gJ '
CTENSWORDS[5] = 'Ik;gJ '
CTENSWORDS[6] = 'mWgJ '
CTENSWORDS[7] = 'vGgJ '
CTENSWORDS[8] = 'vz;gJ '
CTENSWORDS[9] = 'bjhz;;Q}W '
CCONWORDS[1] = ''
CCONWORDS[2] = ',Ugj;jp '
CCONWORDS[3] = 'Kg;gj;jp '
CCONWORDS[4] = 'ehw;;gj;jp '
CCONWORDS[5] = 'Ik;gj;jp '
CCONWORDS[6] = 'mWgj;jp '
CCONWORDS[7] = 'vGgj;jp '
CCONWORDS[8] = 'vz;gj;jp '
CCONWORDS[9] = 'bjhz;Q}w;wp '
CHUNDREDWORDS[1] = ''
CHUNDREDWORDS[2] = ',U'
CHUNDREDWORDS[3] = 'Ke;'
CHUNDREDWORDS[4] = 'eh'
CHUNDREDWORDS[5] = 'I'
CHUNDREDWORDS[6] = 'mW'
CHUNDREDWORDS[7] = 'vG'
CHUNDREDWORDS[8] = 've;'
CHUNDREDWORDS[9] = 'bjhs;shapuk;'
LOCAL CRVAL, CRUPEES, NRUPEES, NPAISE, CRUPEES, CPAISE
CRVAL = ''
NRUPEES = INT(NNO)
NPAISE = INT((NNO-NRUPEES)*100)
CRUPEES = CALLDIGITS(NRUPEES)
CPAISE = CALLDIGITS(NPAISE)
CRVAL = CRUPEES
IF NRUPEES>0 .AND. NPAISE>0
CRVAL = CRVAL+''
ENDIF
IF NPAISE>0
CRVAL = CRVAL+'igrh '+CPAISE
ENDIF
IF NNO<=0
CRVAL = ' -----'
ENDIF
CRVAL = CRVAL+'kl;Lk;'
RELEASE CWORDS, CTENSWORDS
RETURN CRVAL
ENDPROC
**
PROCEDURE cAllDigits
LPARAMETERS NNO
LOCAL NDIGITSPROCESSED, CRVAL, CTEMP
NDIGITSPROCESSED = 0
CRVAL = ''
CTEMP = ''
DO WHILE (NNO>0)
IF NDIGITSPROCESSED==1
NTWODIGITS = MOD(NNO, 10)
NNO = (NNO-NTWODIGITS)/10
ELSE
NTWODIGITS = MOD(NNO, 100)
NNO = (NNO-NTWODIGITS)/100
ENDIF
NDIGITSPROCESSED = NDIGITSPROCESSED+1
CTEMP = CTWODIGITS(NTWODIGITS, NDIGITSPROCESSED)
DO CASE
CASE NDIGITSPROCESSED==2 .AND. NTWODIGITS>0
CTEMP = CHUNDREDWORDS(NTWODIGITS)
IF NTWODIGITS<>9
IF .NOT. EMPTY(CRVAL)
CTEMP = CTEMP+'E}w;wp '
ELSE
CTEMP = CTEMP+'E}W '
ENDIF
ELSE
IF .NOT. EMPTY(CRVAL)
CTEMP = 'bjhs;shapuj;J'
ENDIF
ENDIF
CASE NDIGITSPROCESSED==3 .AND. NTWODIGITS>0
IF .NOT. EMPTY(CRVAL)
CTEMP = CTEMP+'Mapuj;J '
ELSE
CTEMP = CTEMP+'Mapuk; '
ENDIF
CASE NDIGITSPROCESSED==4 .AND. NTWODIGITS>0
IF .NOT. EMPTY(CRVAL)
CTEMP = CTEMP+',yl;rj;J '
ELSE
CTEMP = CTEMP+',yl;rk; '
ENDIF
CASE NDIGITSPROCESSED==5 .AND. NTWODIGITS>0
IF .NOT. EMPTY(CRVAL)
CTEMP = CTEMP+'nfhona '
ELSE
CTEMP = CTEMP+'nfho '
ENDIF
ENDCASE
CRVAL = CTEMP+CRVAL
ENDDO
RETURN CRVAL
ENDPROC
**
PROCEDURE cTwoDigits
LPARAMETERS NNO, NDIGITSPROCESSED
LOCAL CRVAL, NREMAINDER, NQUOTIENT
CRVAL = ''
NREMAINDER = MOD(NNO, 10)
NQUOTIENT = (NNO-NREMAINDER)/10
IF NNO==1 .AND. NDIGITSPROCESSED>1
CRVAL = 'xU '
ELSE
IF NNO>0 .AND. NNO<20
CRVAL = CWORDS(NNO)
ELSE
IF NREMAINDER<>0
CRVAL = CWORDS(NREMAINDER)
ENDIF
IF NQUOTIENT<>0
IF NREMAINDER==0
CRVAL = CTENSWORDS(NQUOTIENT)+CRVAL
ELSE
CRVAL = CCONWORDS(NQUOTIENT)+CRVAL
ENDIF
ENDIF
ENDIF
ENDIF
RETURN CRVAL
ENDPROC
**

Sajan Jacob @ 7/1/2011 11:27:30 AM
RCDATA - Table

pk_pqcrid pqcrslp_no date fk_partid fg_qty sno fk_itemid bqty rm_qty issue_qty yn_run
770 926 10-06-2011 7501 50 1 376 1 50 0 F
770 926 10-06-2011 7501 50 2 388 1 50 0 F
770 926 10-06-2011 7501 50 3 1357 12 600 0 F
770 926 10-06-2011 7501 50 4 1349 2 100 0 F
770 926 10-06-2011 7501 50 5 1353 5 225 0 F
770 926 10-06-2011 7501 50 6 1351 7 335 0 F
770 926 10-06-2011 7501 50 7 1104 3 150 0 F
770 926 10-06-2011 7501 50 8 1051 1 50 0 F
770 926 10-06-2011 7501 50 9 824 2 110 0 F
770 926 10-06-2011 7501 50 10 646 0 20 0 F
770 926 10-06-2011 7501 50 11 642 2 100 0 F
770 926 10-06-2011 7501 50 12 1689 2 116 0 F
770 926 10-06-2011 7501 50 13 1673 2 116 0 F
607 921 12-06-2011 7501 195 1 376 1 195 0 F
607 921 12-06-2011 7501 195 2 388 1 195 0 F
607 921 12-06-2011 7501 195 3 1357 12 2340 0 F
607 921 12-06-2011 7501 195 4 1349 2 390 0 F
607 921 12-06-2011 7501 195 5 1353 5 877.5 0 F
607 921 12-06-2011 7501 195 6 1351 7 1306.5 0 F
607 921 12-06-2011 7501 195 7 1104 3 585 0 F
607 921 12-06-2011 7501 195 8 1051 1 195 0 F
607 921 12-06-2011 7501 195 9 824 2 429 0 F
607 921 12-06-2011 7501 195 10 646 0 78 0 F
607 921 12-06-2011 7501 195 11 642 2 390 0 F
607 921 12-06-2011 7501 195 12 1689 2 452.4 0 F
607 921 12-06-2011 7501 195 13 1673 2 452.4 0 F
786 937 15-06-2011 8502 37 1 263 1 37 0 F
786 937 15-06-2011 8502 37 2 296 1 37 0 F
786 937 15-06-2011 8502 37 3 497 1 37 0 F
786 937 15-06-2011 8502 37 4 1275 2 74 0 F
786 937 15-06-2011 8502 37 5 1238 6 222 0 F
786 937 15-06-2011 8502 37 6 1239 2 74 0 F
786 937 15-06-2011 8502 37 7 1245 2 74 0 F
786 937 15-06-2011 8502 37 8 1392 6 222 0 F
786 937 15-06-2011 8502 37 9 1359 2 74 0 F
786 937 15-06-2011 8502 37 10 514 1 37 0 F
786 937 15-06-2011 8502 37 11 2055 2 74 0 F
786 937 15-06-2011 8502 37 12 819 0 5.55 0 F
786 937 15-06-2011 8502 37 13 27 0 1.85 0 T
786 937 15-06-2011 8502 37 14 1098 0 3.7 0 F
786 937 15-06-2011 8502 37 15 889 1 37 0 F
786 937 15-06-2011 8502 37 16 11 0 0 0 F
786 937 15-06-2011 8502 37 17 646 0 1.48 0 F
786 937 15-06-2011 8502 37 18 650 0 0.37 0 F
786 937 15-06-2011 8502 37 19 1082 0 1.48 0 F
786 937 15-06-2011 8502 37 20 12 0 0 0 F
786 937 15-06-2011 8502 37 21 648 0 0 0 F
786 937 15-06-2011 8502 37 22 1829 0 7.03 0 F
786 937 15-06-2011 8502 37 23 1831 0 7.03 0 F
786 937 15-06-2011 8502 37 24 1824 0 7.03 0 F
786 937 15-06-2011 8502 37 25 1841 0 7.03 0 F
786 937 15-06-2011 8502 37 26 1849 0 7.03 0 F
786 937 15-06-2011 8502 37 27 1855 0 7.03 0 F
786 937 15-06-2011 8502 37 28 1923 0 7.03 0 F
786 937 15-06-2011 8502 37 29 1920 0 7.03 0 F
786 937 15-06-2011 8502 37 30 1434 0 11.84 0 F
751 936 23-06-2011 8502 50 1 263 1 50 0 F
751 936 23-06-2011 8502 50 2 296 1 50 0 F
751 936 23-06-2011 8502 50 3 497 1 50 0 F
751 936 23-06-2011 8502 50 4 1275 2 100 0 F
751 936 23-06-2011 8502 50 5 1238 6 300 0 F
751 936 23-06-2011 8502 50 6 1239 2 100 0 F
751 936 23-06-2011 8502 50 7 1245 2 100 0 F
751 936 23-06-2011 8502 50 8 1392 6 300 0 F
751 936 23-06-2011 8502 50 9 1359 2 100 0 F
751 936 23-06-2011 8502 50 10 514 1 50 0 F
751 936 23-06-2011 8502 50 11 2055 2 100 0 F
751 936 23-06-2011 8502 50 12 819 0 7.5 0 F
751 936 23-06-2011 8502 50 13 27 0 2.5 0 T
751 936 23-06-2011 8502 50 14 1098 0 5 0 F
751 936 23-06-2011 8502 50 15 889 1 50 0 F
751 936 23-06-2011 8502 50 16 11 0 0 0 F
751 936 23-06-2011 8502 50 17 646 0 2 0 F
751 936 23-06-2011 8502 50 18 650 0 0.5 0 F
751 936 23-06-2011 8502 50 19 1082 0 2 0 F
751 936 23-06-2011 8502 50 20 12 0 0 0 F
751 936 23-06-2011 8502 50 21 648 0 0 0 F
751 936 23-06-2011 8502 50 22 1829 0 9.5 0 F
751 936 23-06-2011 8502 50 23 1831 0 9.5 0 F
751 936 23-06-2011 8502 50 24 1824 0 9.5 0 F
751 936 23-06-2011 8502 50 25 1841 0 9.5 0 F
751 936 23-06-2011 8502 50 26 1849 0 9.5 0 F
751 936 23-06-2011 8502 50 27 1855 0 9.5 0 F
751 936 23-06-2011 8502 50 28 1923 0 9.5 0 F
751 936 23-06-2011 8502 50 29 1920 0 9.5 0 F
751 936 23-06-2011 8502 50 30 1434 0 16 0 F

Sajan Jacob @ 7/1/2011 11:27:51 AM
ISDATA
pk_issid issue_date sno fk_itemid issue_qty recd_qty bal_qty status yn_run
101 05-06-2011 1 376 70 F
101 05-06-2011 2 388 65 F
101 05-06-2011 3 1357 720 F
101 05-06-2011 4 1349 100 F
101 05-06-2011 5 1353 240 F
101 05-06-2011 6 1351 350 F
101 05-06-2011 7 1104 185 F
101 05-06-2011 8 1051 50 F
101 05-06-2011 9 824 100 F
101 05-06-2011 10 646 20 F
101 05-06-2011 11 642 110 F
101 05-06-2011 12 1689 140 F
101 05-06-2011 13 1673 150 F
102 08-06-2011 1 376 205 F
102 08-06-2011 2 388 195 F
102 08-06-2011 3 1357 100 F
102 08-06-2011 4 1349 400 F
102 08-06-2011 5 1353 100 F
102 08-06-2011 6 1351 410 F
102 08-06-2011 7 1104 10 F
102 08-06-2011 8 1051 200 F
102 08-06-2011 9 824 440 F
102 08-06-2011 10 646 20 F
102 08-06-2011 11 642 40 F
102 08-06-2011 12 1689 450 F
102 08-06-2011 13 1673 452 F
104 12-06-2011 1 263 37 F
104 12-06-2011 2 296 37 F
104 12-06-2011 3 497 37 F
104 12-06-2011 4 1275 74 F
104 12-06-2011 5 1238 222 F
104 12-06-2011 6 1239 74 F
104 12-06-2011 7 1245 74 F
104 12-06-2011 8 1392 222 F
104 12-06-2011 9 1359 74 F
104 12-06-2011 10 514 37 F
104 12-06-2011 11 2055 74 F
104 12-06-2011 12 819 6 F
104 12-06-2011 13 27 2 T
104 12-06-2011 14 1098 4 F
104 12-06-2011 15 889 37 F
104 12-06-2011 16 11 0 F
104 12-06-2011 17 646 1 Completed F
104 12-06-2011 18 650 0 F
104 12-06-2011 19 1082 1 Completed F
104 12-06-2011 20 12 0 F
104 12-06-2011 21 648 0 F
104 12-06-2011 22 1829 7 Completed F
104 12-06-2011 23 1831 7 Completed F
104 12-06-2011 24 1824 7 Completed F
104 12-06-2011 25 1841 7 Completed F
104 12-06-2011 26 1849 7 Completed F
104 12-06-2011 27 1855 7 Completed F
104 12-06-2011 28 1923 7 Completed F
104 12-06-2011 29 1920 7 Completed F
104 12-06-2011 30 1434 12 Pending F
105 14-06-2011 1 263 50 Completed F
105 14-06-2011 2 296 50 Completed F
105 14-06-2011 3 497 50 Completed F
105 14-06-2011 4 1275 100 Completed F
105 14-06-2011 5 1238 300 Completed F
105 14-06-2011 6 1239 100 Completed F
105 14-06-2011 7 1245 100 Completed F
105 14-06-2011 8 1392 300 Completed F
105 14-06-2011 9 1359 100 Completed F
105 14-06-2011 10 514 50 Completed F
105 14-06-2011 11 2055 100 Completed F
105 14-06-2011 12 819 8 Completed F
105 14-06-2011 13 27 3 Completed T
105 14-06-2011 14 1098 5 Completed F
105 14-06-2011 15 889 50 Completed F
105 14-06-2011 16 11 0 F
105 14-06-2011 17 646 2 Completed F
105 14-06-2011 18 650 1 Pending F
105 14-06-2011 19 1082 2 Completed F
105 14-06-2011 20 12 0 F
105 14-06-2011 21 648 0 F
105 14-06-2011 22 1829 10 Completed F
105 14-06-2011 23 1831 10 Completed F
105 14-06-2011 24 1824 10 Completed F
105 14-06-2011 25 1841 10 Completed F
105 14-06-2011 26 1849 10 Completed F
105 14-06-2011 27 1855 10 Completed F
105 14-06-2011 28 1923 10 Completed F
105 14-06-2011 29 1920 10 Completed F
105 14-06-2011 30 1434 16 Completed F



Your Name: 
Your Feedback: 

Spam Protection:
Enter the code shown: