ninjaman01
Programmer
Hi Everyone,
I have updated this application to include the emprole and rollevel fields in the dbf file, I can now update and send the file thru the email, however I want to include the updated record from the file to the email body, anyone knows how? I tried multiple methods but it won't fix my problem.
this is my code for the procedure of sending the email.
I have updated this application to include the emprole and rollevel fields in the dbf file, I can now update and send the file thru the email, however I want to include the updated record from the file to the email body, anyone knows how? I tried multiple methods but it won't fix my problem.
this is my code for the procedure of sending the email.
Code:
select employee
copy to &mfile2 field company,dept,cempno,empno,emptype,name,position,fname,lname,mi,; &&copied the fields from employee.dbf to mfile2.dbf
birthdate,bank,promoid,from,to,bankac,exemp,base,basedte,base15,base15dte,base30,;
base30dte,cola,coladte,cola15,cola15dte,cola30,cola30dte,erpag,otrate,adjustment,;
workdays,sssno,tan,sex,cvstatus,provadd,cityadd,degreecs,rate,emprole,rollevel,branch,;
baseflag for ltrim(str(dept,fsizeccno)) $ mdept;
copy to &tmpcount for ltrim(str(dept,fsizeccno)) $ mdept and dltype = 1 and alltrim(dldesc) = "UPLOAD"
replace dltype with 2, dldesc with "DOWNLOADED" for ltrim(str(dept,fsizeccno)) $ mdept and dltype =1 and alltrim(dldesc) = "UPLOAD"
use &mfile2 alias mfile2 in 0 shared
select mfile2
create cursor tempstru(company N(1), dept N(fsizeccno), empno n(6), jobtype C(1),;
name C(30), fname c(15), mi c(2), lname c(15),;
bdate d(8), bank c(4), promoid c(1), from d(8), to d(8),;
bankac c(15), exemp c(3), base n(8,2), basedte d(8), base15 n(8,2), base15dte d(8),;
base30 n(8,2), base30dte d(8), cola n(8,2), coladte d(8), cola15 n(8,2), cola15dte d(8),;
cola30 n(8,2), cola30dte d(8), otreg n(8,2), otsun n(8,2), othol n(8,2), otsphol n(8,2),;
tleghol n(8,2), otspleghol n(8,2), nprem n(8,2), wtax n(8,2), wtax30 n(8,2),;
sss n(8,2), sss30 n(8,2), medicare n(8,2), med30 n(8,2), pagibig n(8,2), pagibig30 n(8,2),;
sssloan n(8,2), sssloan30 n(8,2), pibigloan n(8,2), pibig30 n(8,2), advances n(8,2), advance30 n(8,2),;
otherinc n(8,2), otherded n(8,2), other30 n(8,2),;
erpag n(8,2), adjustment n(8,2), workdays n(2),;
sssno c(15), tan c(20), position c(20), sex c(1), civstat c(2),;
dcola n(2), dabsent n(2), pin c(14), gender c(2), shift c(2), ersss n(8,2),;
ermed n(8,2), erecc n(8,2), lastbase n(8,2), lastgross n(8,2), skill n(1),;
rate n(15,2), education c(30), address1 c(40), address2 c(40), otrate n(7,2),;
branch c(15),emprole c(30), rollevel n(1))
select tempstru
copy to &tempemp stru
use
use &tempemp alias tempemp in 0 shared
sele mfile2
go top
do while .not. eof()
mjobtype = ""
mcempno = cempno
if !empty(rate)
xbase = rate
xrate = round(xbase/8,2)
else
xbase = round((base*12)/313,2)
xrate = round(xbase/8,2)
endif
if baseflag = "1" or (empty(baseflag) and UPPER(ALLT(emptype)) = "DIRECT")
xbase = 0
xrate = 0
endif
sele tempemp
locate for str(empno) = mcempno
if !found()
sele tempemp
appe blank
repl empno with val(mcempno)
endif
do case
case mfile2.emptype = "DIRECT"
mjobtype = "R"
case mfile2.emptype = "KMC PROD"
mjobtype = "K"
case mfile2.emptype = "GREAT VALUE" .or. mfile2.emptype = "GV OFC" .or. mfile2.emptype = "GV PROD"
mjobtype = "G"
otherwise
mjobtype = "A"
endcase
replace company with mfile2.company, dept with mfile2.dept, jobtype with mjobtype,; &&iif(ALLT(UPPER(mfile2.emptype)) = "DIRECT","R","A")
name with SUBSTR(ALLT(mfile2.name),1,30), fname with SUBSTR(ALLT(mfile2.fname),1,15), mi with mfile2.mi, lname with mfile2.lname,;
bdate with mfile2.birthdate, bank with mfile2.bank, promoid with mfile2.promoid, tempemp.from with mfile2.from, to with mfile2.to,;
bankac with mfile2.bankac, exemp with mfile2.exemp,;
base with xbase, basedte with mfile2.basedte, base15 with 0,;
base15dte with mfile2.base15dte, base30 with 0, base30dte with mfile2.base30dte, cola with mfile2.cola,;
coladte with mfile2.coladte, cola15 with mfile2.cola15, cola15dte with mfile2.cola15dte, cola30 with mfile2.cola30, cola30dte with mfile2.cola30dte,;
erpag with mfile2.erpag, otrate with mfile2.otrate, ;
adjustment with mfile2.adjustment, workdays with val(substr(allt(str(mfile2.workdays)),1,2)), sssno with mfile2.sssno, tan with mfile2.tan,;
position with SUBSTR(ALLT(mfile2.position),1,20), sex with mfile2.sex, civstat with mfile2.cvstatus, gender with allt(mfile2.sex), rate with xrate,;
education with substr(allt(mfile2.degreecs),1,30), address1 with SUBSTR(ALLT(mfile2.cityadd),1,40), address2 with SUBSTR(ALLT(mfile2.cityadd),41,80),;
branch with mfile2.branch, emprole with mfile2.emprole, rollevel with mfile2.rollevel
select mfile2
skip
enddo
select tempemp
copy to &mfile type foxplus
run 7z a &mzip &mfile
erase &mfile
use &tmpcount alias tmpcount in 0 shared
select tmpcount
index on cempno to &emp
if thisform.dtyp = "ftp"
copy file &mzip to &mtopath
thisform.emailbody3
else
thisform.emailattach3
endif