select Payslip
locate for SPERIOD = ldSperiod
if found()
select a.*,JOBTYPE,NAME,TAX_UNIT,GL_ACCOUNT,RANK ;&&included RANK by FDF April 21, 2009
from Payslip a ;
inner join Empmas b on a.E_EMPNO = b.E_EMPNO ;
order by NAME,a.SECTION_CO,JOBTYPE,a.E_EMPNO ;
into cursor crPayslip
sele crPayslip
index on NAME to a
select distinct a.EARNCODE ;
from Earndetl a;
inner join Earncode b on a.EARNCODE = b.EARNCODE ;
where a.E_EMPNO in (select E_EMPNO from crPayslip) and upper(POSTED) = 'Y' and upper(TAXABLE) <> 'Y';
order by a.EARNCODE ;
into cursor crNonTaxEarnlist
Sele crNonTaxEarnlist
index on EARNCODE to b
scan
endscan
select distinct a.EARNCODE ;
from Earndetl a;
inner join Earncode b on a.EARNCODE = b.EARNCODE ;
where a.E_EMPNO in (select E_EMPNO from crPayslip) and upper(POSTED) = 'Y' and upper(TAXABLE) = 'Y';
order by a.EARNCODE ;
into cursor crTaxEarnlist
Sele crTaxEarnlist
index on EARNCODE to c
select distinct DEDCODE ;
from Ded_detl a;
inner join Empmas b on a.E_EMPNO = b.E_EMPNO ;
where upper(POSTED) = 'Y' ;
order by DEDCODE ;
into cursor crDedlist
Sele crDedlist
index on DEDCODE to d
select a.E_EMPNO,EARNCODE,sum(AMOUNT) as AMOUNT ;
from Earndetl a;
inner join crPayslip b on a.E_EMPNO = b.E_EMPNO ;
where upper(POSTED) = 'Y' ;
order by a.E_EMPNO,EARNCODE ;
group by a.E_EMPNO,EARNCODE ; && Jan 25, 2005 by RLA
into cursor crEarndetl
Sele crEarndetl
index on E_EMPNO+EARNCODE to e
select a.E_EMPNO,DEDCODE,sum(AMOUNT) as AMOUNT ;
from Ded_detl a;
inner join crPayslip b on a.E_EMPNO = b.E_EMPNO ;
where upper(POSTED) = 'Y' ;
order by a.E_EMPNO,DEDCODE ;
group by a.E_EMPNO,DEDCODE ; && Jan 25, 2005 by RLA
into cursor crDed_detl
sele crDed_detl
index on E_EMPNO+DEDCODE to f
select a.* ;
from Timesht a;
inner join crPayslip b on a.E_EMPNO = b.E_EMPNO ;
where DISREGARD <> 'Y' ;
order by a.E_EMPNO ;
into cursor crTimesht
sele crTimesht
index on E_EMPNO to g
select a.* ;
from Overtime a;
inner join crPayslip b on a.E_EMPNO = b.E_EMPNO ;
where DISREGARD <> 'Y' ;
order by a.E_EMPNO ;
into cursor crOvertime
Sele crOvertime
index on E_EMPNO to h
endif
* tpos papasok sya sa isang method ito naman gagawin
select crNonTaxEarnlist
scan
select crEarndetl
locate for E_EMPNO+EARNCODE = crPayslip.E_EMPNO+crNonTaxEarnlist.EARNCODE
This.is_uploaded(.f.,@lnCtr,crNonTaxEarnlist.EARNCODE)
endscan
select crTaxEarnlist
scan
select crEarndetl
locate for E_EMPNO+EARNCODE = crPayslip.E_EMPNO+crTaxEarnlist.EARNCODE
This.is_uploaded(.f.,@lnCtr,crTaxEarnlist.EARNCODE)
endscan
select crDedlist
scan
select crDed_detl
locate for E_EMPNO+DEDCODE = crPayslip.E_EMPNO+crDedlist.DEDCODE
goXLApp.ActiveSheet.cells(pnSheet1Ctr,lnCtr).value = iif(found(),AMOUNT,0)
lnCtr = lnCtr + 1
endscan