<% IF TYPE([orequest])=[O] oresponse.expires=-1 functionname=orequest.querystring("functionname") if isnull(functionname) functionname=orequest.form("functionname") endif bulkfolder=addbs(ADDBS(oprop.appstartpath)+'bulkdata') *strtofile(thedata,(bulkfolder+[\]+theuniquetr+'.txt')) thevtype=orequest.form("vtype") thetrnum=orequest.form("trnum") ipAddress = nvl(ORequest.ServerVariables("HTTP_X_FORWARDED_FOR"),'') IF empty(IPADDRESS) OR LOWER(IPADDRESS)="unknown" ipAddress = [remote ]+nvl(oRequest.ServerVariables("REMOTE_ADDR"),'') ENDIF *ipaddress of the calling pc or it can be the domain name too theCallingPC=nvl(orequest.servervariables('http_host'),'') sqlinprogressfile=addbs(oprop.appstartpath)+[temp\TimerInProgress.txt] ELSE theCallingPC=SUBSTR(SYS(0),1,AT([#],SYS(0))-1) functionname=[SQLTRANSACTIONS] sqlinprogressfile=addbs(mydir)+[temp\TimerInProgress.txt] SET PROCEDURE TO (mydir+[mh\prg\shahfuncs.fxp]) ADDITIVE SET PROCEDURE TO (mydir+[mh\prg\main.prg]) ADDITIVE bulkfolder=addbs(ADDBS(mydir+'mh\')+'bulkdata') ENDIF **** theresponse=[Transaction updates finished!] processdtime=datetime() if directory(bulkfolder) allfiles=adir(filelist,bulkfolder+[\_*.txt]) if allfiles>0 theresponse=[FOUND ]+ALLTRIM(TRANSFORM(allfiles))+[ Sale records ] *oJSON=NEWOBJECT('json','json.prg') IF TYPE([orequest])=[O] and NOT [NFJSON] $ SET("Procedure") SET PROCEDURE TO (ADDBS(oprop.appstartpath)+[prg\nfjson.FXP]) additive endif for tlst=1 to allfiles if datetime()-processdtime>3 exit endif tfile=bulkfolder+[\]+allt(filelist(tlst,1)) thefiledata=FILETOSTR(tfile) nfJsonToCursor(thefiledata, 'newtcsdata',.f.) SELECT [newtcsdata] go top ***** servicecharges=srvchgs mAccount=accountid NewNum=transid newdate=date newuser=opt newsaleman=iif(empty(saleman),[140000],saleman) newsess=sess newdtime=dtime if empty(newdtime) newdtime=datetime() endif newmemberid=invmemberid mcrit=invcrit newpayment=invpayment newtotal=invtotal newdiscount=invdiscount *newtotal=VAL(TRANSFORM(orequest.form('newtotal'))) *newdiscount=VAL(TRANSFORM(orequest.form('newdiscount'))) newname=custname newmemdisc=memdisc countersales='050000' &&TRANSFORM(orequest.form('countersales')) newspot=spot &&VAL(TRANSFORM(orequest.form('newspot'))) *mAccount=orequest.form('') usesafe([cashsale]) usesafe([cashdata]) usesafe([negatives]) usesafe([itemmast]) usesafe([accounts]) SELECT [cashsale] =SEEK(newnum,[cashsale],[transid]) IF EOF() GO bottom IF date<>DATE() salesrno=1 ELSE salesrno=daysrno+1 endif APPEND BLANK replace daysrno WITH salesrno ENDIF Replace CASHSALE.transid With NewNum,; CASHSALE.customer With COUNTERSALES,; CASHSALE.depositid With mAccount,; CASHSALE.Payment With newpayment,; CASHSALE.Date With newdate,; CASHSALE.modified With newdtime,; CASHSALE.saleman With newsaleman,; CASHSALE.Total With newtotal,; CASHSALE.discount WITH newdiscount,; cashsale.name WITH newname,; CASHSALE.crit With mcrit,; CASHSALE.opt With newuser,; CASHSALE.Sess With newsess,; CASHSALE.spot With newspot,; CASHSALE.dtime With newdtime,; CASHSALE.memdisc With newmemdisc,; cashsale.memberid WITH newmemberid,; cashsale.srvchgs WITH servicecharges,; cashsale.sql with .t. *COPY TO (TEMPLOCATION+[TMPINV.DBF]) salesrno=cashsale.daysrno TheResponse=[TRANSID:]+PADR(ALLTRIM(TRANSFORM(NewNum)),9,[ ])+ALLTRIM(TRANSFORM(salesrno)) SELECT [newtcsdata] Select "CashData" Set Order To transid =Seek(NewNum,"CashData","Transid") Do While cashdata.transid=NewNum And Not Eof("CashData") Delete If Not Eof() SKIP ELSE exit Endif Enddo SELECT [newtcsdata] totalcost=0 Scan =seek(newtcsdata.ItemID,[itemmast],[itemid]) Select "CASHDATA" Append Blank Replace cashdata.transid With NewNum,; cashdata.ItemID With newtcsdata.ItemID,; cashdata.Desc With newtcsdata.Name,; cashdata.qty With newtcsdata.qty,; cashdata.rate With newtcsdata.rate,; cashdata.dqty With newtcsdata.dqty,; cashdata.drate With newtcsdata.drate,; cashdata.discpcnt With newtcsdata.discpcnt,; cashdata.div With newtcsdata.div,; cashdata.Total With iif(empty(newtcsdata.dqty),newtcsdata.qty*newtcsdata.rate,newtcsdata.dqty*newtcsdata.drate),; cashdata.discount With newtcsdata.discount,; cashdata.sr_no With newtcsdata.no,; cashdata.saleman With newtcsdata.saleman if type([CASHDATA.vendor])=[C] and type([CASHDATA.purchase])=[C] replace CASHDATA.purchase WITH IIF(EMPTY(itemmast.pcost),itemmast.cost,itemmast.pcost),; CASHDATA.vendor WITH itemmast.vendor endif If xcompany.MEMP Replace SALEMAN With newtcsdata.SALEMAN Endif If xcompany.zerorecord And Seek(ItemID,'itemmast','itemid') And itemmast.stock29 strtofile(tmakestring,sqlinprogressfile) endif endif upmastertbl=[cashbill] updchildtbl=[cbilldata] updvtype=PADR([CashBill],10,[ ]) tSQL=[ SELECT TOP 20 x.transid,dtime, updvtype as vtype FROM (']+dbclocation+upmastertbl+[') x WHERE processdtime-x.modified>10 and x.sql=.t. and x.transid ] tSQL=tSQL+[ in (SELECT DISTINCT y.transid FROM (']+dbclocation+updchildtbl+[') y where y.sql=.t. ) ] tSQL=tSQL+[ ORDER BY x.dtime into cursor sqlupdater Readwrite ] &tsql tsql2=[SELECT distinct y.transid, datetime() as dtime, updvtype as vtype FROM (']+dbclocation+updchildtbl+[') y where y.sql=.t. into cursor sqlother2 ] &tsql2 if reccount([sqlother2])>0 SQLotherTable=DBF() select [sqlupdater] addsqlcmd=[append from (']+SQLotherTable+[')] &addsqlcmd ENDIF tsql2=[SELECT distinct x.transid, dtime, updvtype as vtype FROM (']+dbclocation+upmastertbl+[') x where processdtime-x.modified>100 and x.sql=.t. into cursor sqlother2 ] &tsql2 if reccount([sqlother2])>0 SQLotherTable=DBF() select [sqlupdater] addsqlcmd=[append from (']+SQLotherTable+[')] &addsqlcmd endif use in select(upmastertbl) use in select(updchildtbl) if reccount([sqlupdater])<20 upmastertbl=[bill] updchildtbl=[billdata] updvtype=[Bill] tSQL=[ SELECT TOP 20 x.transid,dtime, updvtype as vtype FROM (']+dbclocation+upmastertbl+[') x WHERE processdtime-x.modified>10 and x.sql=.t. and x.transid ] tSQL=tSQL+[ in (SELECT DISTINCT y.transid FROM (']+dbclocation+updchildtbl+[') y where y.sql=.t. ) ] tSQL=tSQL+[ ORDER BY x.dtime into cursor sqlother ] &tsql if reccount([sqlother])>0 SQLotherTable=DBF() select [sqlupdater] addsqlcmd=[append from (']+SQLotherTable+[')] &addsqlcmd endif tsql2=[SELECT distinct y.transid, datetime() as dtime, updvtype as vtype FROM (']+dbclocation+updchildtbl+[') y where y.sql=.t. into cursor sqlother2 ] &tsql2 if reccount([sqlother2])>0 SQLotherTable=DBF() select [sqlupdater] addsqlcmd=[append from (']+SQLotherTable+[')] &addsqlcmd ENDIF tsql2=[SELECT distinct x.transid, dtime, updvtype as vtype FROM (']+dbclocation+upmastertbl+[') x where processdtime-x.modified>100 and x.sql=.t. into cursor sqlother2 ] &tsql2 if reccount([sqlother2])>0 SQLotherTable=DBF() select [sqlupdater] addsqlcmd=[append from (']+SQLotherTable+[')] &addsqlcmd endif use in select(upmastertbl) use in select(updchildtbl) &tsql if reccount([sqlupdater])>0 SQLotherTable=DBF() select [sqlupdater] addsqlcmd=[append from (']+SQLotherTable+[')] &addsqlcmd endif endif if reccount([sqlupdater])<20 upmastertbl=[invoice] updchildtbl=[invdata] updvtype=[Invoice] tSQL=[ SELECT TOP 20 x.transid,dtime, updvtype as vtype FROM (']+dbclocation+upmastertbl+[') x WHERE processdtime-x.modified>10 and x.sql=.t. and x.transid ] tSQL=tSQL+[ in (SELECT DISTINCT y.transid FROM (']+dbclocation+updchildtbl+[') y where y.sql=.t. ) ] tSQL=tSQL+[ ORDER BY x.dtime into cursor sqlother ] &tsql if reccount([sqlother])>0 SQLotherTable=DBF() select [sqlupdater] addsqlcmd=[append from (']+SQLotherTable+[')] &addsqlcmd endif tsql2=[SELECT distinct y.transid, datetime() as dtime, updvtype as vtype FROM (']+dbclocation+updchildtbl+[') y where y.sql=.t. into cursor sqlother2 ] &tsql2 if reccount([sqlother2])>0 SQLotherTable=DBF() select [sqlupdater] addsqlcmd=[append from (']+SQLotherTable+[')] &addsqlcmd ENDIF tsql2=[SELECT distinct x.transid, dtime, updvtype as vtype FROM (']+dbclocation+upmastertbl+[') x where processdtime-x.modified>100 and x.sql=.t. into cursor sqlother2 ] &tsql2 if reccount([sqlother2])>0 SQLotherTable=DBF() select [sqlupdater] addsqlcmd=[append from (']+SQLotherTable+[')] &addsqlcmd endif use in select(upmastertbl) use in select(updchildtbl) endif if reccount([sqlupdater])<20 upmastertbl=[CashSale] updchildtbl=[cashdata] updvtype=[CashSale] tSQL=[ SELECT TOP 20 x.transid,dtime, updvtype as vtype FROM (']+dbclocation+upmastertbl+[') x WHERE processdtime-x.modified>10 and x.sql=.t. and x.transid ] tSQL=tSQL+[ in (SELECT DISTINCT y.transid FROM (']+dbclocation+updchildtbl+[') y where y.sql=.t. ) ] tSQL=tSQL+[ ORDER BY x.dtime into cursor sqlother ] &tsql if reccount([sqlother])>0 SQLotherTable=DBF() select [sqlupdater] addsqlcmd=[append from (']+SQLotherTable+[')] &addsqlcmd endif tsql2=[SELECT distinct y.transid, datetime() as dtime, updvtype as vtype FROM (']+dbclocation+updchildtbl+[') y where y.sql=.t. into cursor sqlother2 ] &tsql2 if reccount([sqlother2])>0 SQLotherTable=DBF() select [sqlupdater] addsqlcmd=[append from (']+SQLotherTable+[')] &addsqlcmd ENDIF tsql2=[SELECT distinct x.transid, dtime, updvtype as vtype FROM (']+dbclocation+upmastertbl+[') x where processdtime-x.modified>100 and x.sql=.t. into cursor sqlother2 ] &tsql2 if reccount([sqlother2])>0 SQLotherTable=DBF() select [sqlupdater] addsqlcmd=[append from (']+SQLotherTable+[')] &addsqlcmd endif use in select(upmastertbl) use in select(updchildtbl) ENDIF if reccount([sqlupdater])<20 upmastertbl=[rBill] updchildtbl=[rbilldata] updvtype=[CreditBill] tSQL=[ SELECT TOP 20 x.transid,dtime, updvtype as vtype FROM (']+dbclocation+upmastertbl+[') x WHERE processdtime-x.modified>10 and x.sql=.t. and x.transid ] tSQL=tSQL+[ in (SELECT DISTINCT y.transid FROM (']+dbclocation+updchildtbl+[') y where y.sql=.t. ) ] tSQL=tSQL+[ ORDER BY x.dtime into cursor sqlother ] &tsql if reccount([sqlother])>0 SQLotherTable=DBF() select [sqlupdater] addsqlcmd=[append from (']+SQLotherTable+[')] &addsqlcmd endif tsql2=[SELECT distinct y.transid, datetime() as dtime, updvtype as vtype FROM (']+dbclocation+updchildtbl+[') y where y.sql=.t. into cursor sqlother2 ] &tsql2 if reccount([sqlother2])>0 SQLotherTable=DBF() select [sqlupdater] addsqlcmd=[append from (']+SQLotherTable+[')] &addsqlcmd ENDIF tsql2=[SELECT distinct x.transid, dtime, updvtype as vtype FROM (']+dbclocation+upmastertbl+[') x where processdtime-x.modified>100 and x.sql=.t. into cursor sqlother2 ] &tsql2 if reccount([sqlother2])>0 SQLotherTable=DBF() select [sqlupdater] addsqlcmd=[append from (']+SQLotherTable+[')] &addsqlcmd endif use in select(upmastertbl) use in select(updchildtbl) ENDIF if reccount([sqlupdater])<20 upmastertbl=[adjust] updchildtbl=[adjdata] updvtype=[Adjustment] tSQL=[ SELECT TOP 20 x.transid,dtime, updvtype as vtype FROM (']+dbclocation+upmastertbl+[') x WHERE processdtime-x.modified>10 and x.sql=.t. and x.transid ] tSQL=tSQL+[ in (SELECT DISTINCT y.transid FROM (']+dbclocation+updchildtbl+[') y where y.sql=.t. ) ] tSQL=tSQL+[ ORDER BY x.dtime into cursor sqlother ] &tsql if reccount([sqlother])>0 SQLotherTable=DBF() select [sqlupdater] addsqlcmd=[append from (']+SQLotherTable+[')] &addsqlcmd endif tsql2=[SELECT distinct y.transid, datetime() as dtime, updvtype as vtype FROM (']+dbclocation+updchildtbl+[') y where y.sql=.t. into cursor sqlother2 ] &tsql2 if reccount([sqlother2])>0 SQLotherTable=DBF() select [sqlupdater] addsqlcmd=[append from (']+SQLotherTable+[')] &addsqlcmd ENDIF tsql2=[SELECT distinct x.transid, dtime, updvtype as vtype FROM (']+dbclocation+upmastertbl+[') x where processdtime-x.modified>100 and x.sql=.t. into cursor sqlother2 ] &tsql2 if reccount([sqlother2])>0 SQLotherTable=DBF() select [sqlupdater] addsqlcmd=[append from (']+SQLotherTable+[')] &addsqlcmd endif use in select(upmastertbl) use in select(updchildtbl) ENDIF if reccount([sqlupdater])<20 upmastertbl=[storetrf] updchildtbl=[strfdata] updvtype=[StoreTRF] tSQL=[ SELECT TOP 20 x.transid,dtime, updvtype as vtype FROM (']+dbclocation+upmastertbl+[') x WHERE processdtime-x.modified>10 and x.sql=.t. and x.transid ] tSQL=tSQL+[ in (SELECT DISTINCT y.transid FROM (']+dbclocation+updchildtbl+[') y where y.sql=.t. ) ] tSQL=tSQL+[ ORDER BY x.dtime into cursor sqlother ] &tsql if reccount([sqlother])>0 SQLotherTable=DBF() select [sqlupdater] addsqlcmd=[append from (']+SQLotherTable+[')] &addsqlcmd endif tsql2=[SELECT distinct y.transid, datetime() as dtime, updvtype as vtype FROM (']+dbclocation+updchildtbl+[') y where y.sql=.t. into cursor sqlother2 ] &tsql2 if reccount([sqlother2])>0 SQLotherTable=DBF() select [sqlupdater] addsqlcmd=[append from (']+SQLotherTable+[')] &addsqlcmd ENDIF tsql2=[SELECT distinct x.transid, dtime, updvtype as vtype FROM (']+dbclocation+upmastertbl+[') x where processdtime-x.modified>100 and x.sql=.t. into cursor sqlother2 ] &tsql2 if reccount([sqlother2])>0 SQLotherTable=DBF() select [sqlupdater] addsqlcmd=[append from (']+SQLotherTable+[')] &addsqlcmd endif use in select(upmastertbl) use in select(updchildtbl) ENDIF if reccount([sqlupdater])<20 upmastertbl=[rcinvoice] updchildtbl=[rcinvdata] updvtype=[CREFUND] tSQL=[ SELECT TOP 20 x.transid,dtime, updvtype as vtype FROM (']+dbclocation+upmastertbl+[') x WHERE processdtime-x.modified>10 and x.sql=.t. and x.transid ] tSQL=tSQL+[ in (SELECT DISTINCT y.transid FROM (']+dbclocation+updchildtbl+[') y where y.sql=.t. ) ] tSQL=tSQL+[ ORDER BY x.dtime into cursor sqlother ] &tsql if reccount([sqlother])>0 SQLotherTable=DBF() select [sqlupdater] addsqlcmd=[append from (']+SQLotherTable+[')] &addsqlcmd endif tsql2=[SELECT DISTINCT y.transid,datetime() as dtime, updvtype as vtype FROM (']+dbclocation+updchildtbl+[') y where y.sql=.t. into cursor sqlother2 ] &tsql2 if reccount([sqlother2])>0 SQLotherTable=DBF() select [sqlupdater] addsqlcmd=[append from (']+SQLotherTable+[')] &addsqlcmd ENDIF tsql2=[SELECT distinct x.transid, dtime, updvtype as vtype FROM (']+dbclocation+upmastertbl+[') x where processdtime-x.modified>100 and x.sql=.t. into cursor sqlother2 ] &tsql2 if reccount([sqlother2])>0 SQLotherTable=DBF() select [sqlupdater] addsqlcmd=[append from (']+SQLotherTable+[')] &addsqlcmd endif use in select(upmastertbl) use in select(updchildtbl) ENDIF if reccount([sqlupdater])<20 upmastertbl=[rinvoice] updchildtbl=[rinvdata] updvtype=[CREDITMEMO] tSQL=[ SELECT TOP 20 x.transid,dtime, updvtype as vtype FROM (']+dbclocation+upmastertbl+[') x WHERE processdtime-x.modified>10 and x.sql=.t. and x.transid ] tSQL=tSQL+[ in (SELECT DISTINCT y.transid FROM (']+dbclocation+updchildtbl+[') y where y.sql=.t. ) ] tSQL=tSQL+[ ORDER BY x.dtime into cursor sqlother ] &tsql if reccount([sqlother])>0 SQLotherTable=DBF() select [sqlupdater] addsqlcmd=[append from (']+SQLotherTable+[')] &addsqlcmd endif tsql2=[SELECT distinct y.transid, datetime() as dtime, updvtype as vtype FROM (']+dbclocation+updchildtbl+[') y where y.sql=.t. into cursor sqlother2 ] &tsql2 if reccount([sqlother2])>0 SQLotherTable=DBF() select [sqlupdater] addsqlcmd=[append from (']+SQLotherTable+[')] &addsqlcmd ENDIF tsql2=[SELECT distinct x.transid, dtime, updvtype as vtype FROM (']+dbclocation+upmastertbl+[') x where processdtime-x.modified>100 and x.sql=.t. into cursor sqlother2 ] &tsql2 if reccount([sqlother2])>0 SQLotherTable=DBF() select [sqlupdater] addsqlcmd=[append from (']+SQLotherTable+[')] &addsqlcmd endif use in select(upmastertbl) use in select(updchildtbl) ENDIF if reccount([sqlupdater])<20 upmastertbl=[journal] updchildtbl=[jdata] updvtype=[Journal] tSQL=[ SELECT TOP 20 x.transid,dtime, updvtype as vtype FROM (']+dbclocation+upmastertbl+[') x WHERE processdtime-x.modified>10 and x.sql=.t. and x.transid ] tSQL=tSQL+[ in (SELECT DISTINCT y.transid FROM (']+dbclocation+updchildtbl+[') y where y.sql=.t. ) ] tSQL=tSQL+[ ORDER BY x.dtime into cursor sqlother ] &tsql if reccount([sqlother])>0 SQLotherTable=DBF() select [sqlupdater] addsqlcmd=[append from (']+SQLotherTable+[')] &addsqlcmd endif if file (dbclocation+updchildtbl+'.dbf') tsql2=[SELECT distinct y.transid, datetime() as dtime, updvtype as vtype FROM (']+dbclocation+updchildtbl+[') y where y.sql=.t. into cursor sqlother2 ] &tsql2 if reccount([sqlother2])>0 SQLotherTable=DBF() select [sqlupdater] addsqlcmd=[append from (']+SQLotherTable+[')] &addsqlcmd endif ENDIF tsql2=[SELECT distinct x.transid, dtime, updvtype as vtype FROM (']+dbclocation+upmastertbl+[') x where processdtime-x.modified>100 and x.sql=.t. into cursor sqlother2 ] &tsql2 if reccount([sqlother2])>0 SQLotherTable=DBF() select [sqlupdater] addsqlcmd=[append from (']+SQLotherTable+[')] &addsqlcmd endif use in select(upmastertbl) use in select(updchildtbl) ENDIF if reccount([sqlupdater])<20 tSQL=[ SELECT TOP 20 x.transid,dtime, 'Transfer' as vtype FROM (']+dbclocation+[transfer') x WHERE processdtime-x.modified>10 and x.sql ] tSQL=tSQL+[ ORDER BY x.dtime into cursor sqlother ] &tsql if reccount([sqlother])>0 SQLotherTable=DBF() select [sqlupdater] addsqlcmd=[append from (']+SQLotherTable+[')] &addsqlcmd endif use in select('transfer') ENDIF if reccount([sqlupdater])<20 tSQL=[ SELECT TOP 20 x.transid,dtime, 'Session' as vtype FROM (']+dbclocation+[salessession') x WHERE processdtime-x.modified>10 and x.sql ] tSQL=tSQL+[ ORDER BY x.dtime into cursor sqlother ] &tsql if reccount([sqlother])>0 SQLotherTable=DBF() select [sqlupdater] addsqlcmd=[append from (']+SQLotherTable+[')] &addsqlcmd endif use in select('salessession') ENDIF if reccount([sqlupdater])<20 tSQL=[ SELECT TOP 20 x.transid,dtime, 'Receipt' as vtype FROM (']+dbclocation+[payment') x WHERE processdtime-x.modified>10 and x.sql ] tSQL=tSQL+[ ORDER BY x.dtime into cursor sqlother ] &tsql if reccount([sqlother])>0 SQLotherTable=DBF() select [sqlupdater] addsqlcmd=[append from (']+SQLotherTable+[')] &addsqlcmd endif use in select('payment') ENDIF if reccount([sqlupdater])<20 tSQL=[ SELECT TOP 20 x.transid,dtime, 'Payment' as vtype FROM (']+dbclocation+[Billpay') x WHERE processdtime-x.modified>10 and x.sql ] tSQL=tSQL+[ ORDER BY x.dtime into cursor sqlother ] &tsql if reccount([sqlother])>0 SQLotherTable=DBF() select [sqlupdater] addsqlcmd=[append from (']+SQLotherTable+[')] &addsqlcmd endif use in select('billpay') ENDIF *copy to (addbs(oprop.appstartpath)+[temp\sqlrecs]) recordsfoundforupdate=reccount('sqlupdater') select [sqlupdater] delete all for empty(transid) go top if recordsfoundforupdate>0 and not eof() index on dtime tag dtime go top DO WHILE NOT EOF() AND abs(DATETIME()-processdtime)<5 thevtype=vtype thetrnum=transid theDtime=ttoc(dtime) theresponse=updatetransactions(thevtype,thetrnum) *theresponse=transtype+[ ]+mTransnum+[ ] theresponse=CHRTRAN(CHRTRAN(CHRTRAN(chrtran(allt(theresponse),chr(13)+chr(10),''),[ ],[ ]),[ ],[ ]),[ ],[ ]) Do Case Case Upper(theresponse)=Upper("Sales") Or Upper(theresponse)='CASHSALE' &&CashSale tsql=[update (']+dbclocation+[CashSale') set sql=.f. where allt(transid)==']+allt(thetrnum)+['] &tsql Case Upper(theresponse)=Upper("Invoice") tsql=[update (']+dbclocation+[Invoice') set sql=.f. where allt(transid)==']+allt(thetrnum)+['] &tsql Case Upper(theresponse)=Upper("Bill") &&Bill tsql=[update (']+dbclocation+[Bill') set sql=.f. where allt(transid)==']+allt(thetrnum)+['] &tsql Case Upper(theresponse)=Upper("CashBill") &&Cashbill tsql=[update (']+dbclocation+[CashBill') set sql=.f. where allt(transid)==']+allt(thetrnum)+['] &tsql Case Upper(theresponse)=Upper("CreditBill") tsql=[update (']+dbclocation+[rBill') set sql=.f. where allt(transid)==']+allt(thetrnum)+['] &tsql Case Upper(theresponse)=Upper("Adjustment") tsql=[update (']+dbclocation+[adjust') set sql=.f. where allt(transid)==']+allt(thetrnum)+['] &tsql Case Upper(theresponse)=Upper("STORETRF") tsql=[update (']+dbclocation+[storetrf') set sql=.f. where allt(transid)==']+allt(thetrnum)+['] &tsql Case Upper(theresponse)=Upper("RETURNS") Or theresponse='CREFUND' &&CREFUND tsql=[update (']+dbclocation+[rcinvoice') set sql=.f. where allt(transid)==']+allt(thetrnum)+['] &tsql Case Upper(theresponse)=Upper("CREDITMEMO") tsql=[update (']+dbclocation+[rinvoice') set sql=.f. where allt(transid)==']+allt(thetrnum)+['] &tsql Case Upper(theresponse)=Upper("Journal") tsql=[update (']+dbclocation+[journal') set sql=.f. where allt(transid)==']+allt(thetrnum)+['] &tsql Case Upper(theresponse)=Upper("Transfer") tsql=[update (']+dbclocation+[transfer') set sql=.f. where allt(transid)==']+allt(thetrnum)+['] &tsql Case Upper(theresponse)=Upper("Session") tsql=[update (']+dbclocation+[salessession') set sql=.f. where allt(transid)==']+allt(thetrnum)+['] &tsql Case Upper(theresponse)=Upper("Receipt") tsql=[update (']+dbclocation+[payment') set sql=.f. where allt(transid)==']+allt(thetrnum)+['] &tsql Case Upper(theresponse)=Upper("Payment") tsql=[update (']+dbclocation+[billpay') set sql=.f. where allt(transid)==']+allt(thetrnum)+['] &tsql Otherwise theresponse=[Error ]+[ ]+allt(TRANSFORM(thetrnum))+[ ]+allt(thevtype)+[ ]+theresponse ENDCASE totalresponse=totalresponse+theresponse+[ ] SELECT [sqlupdater] skip enddo *erase (sqlinprogressfile) ELSE totalresponse=[Transaction updates finished!] *erase (sqlinprogressfile) endif USE IN SELECT('sqlother') use in select('sqlupdater') endif close tables IF TYPE([orequest])<>[U] oresponse.write(totalresponse) oresponse.flush ELSE inspect(totalresponse) RETURN totalresponse endif %>