- declaration:
- #ident "@(#)T1896_07_01, Ganesh Moorthy J, 2008-09-10, B50C_c_x201"
- #ident "@(#)T1896_07_02, Ganesh Moorthy J, 2008-09-12, B50C_c_x201"
- table tfxacr005 | VAT Information in Getpaid System
- extern domain tcmcs.str132m fpath
- extern domain fxex.datf datf
- domain tcncmp site
- domain tcmcs.str11 ninv
- domain tcmcs.long vtno
- domain tfgld.date vtdt
- long retval
- #include <bic_tt>
- #pragma used dll "ofxcomdll0001"
- |****************************** form section **********************************
- group.1:
- init.group:
- get.screen.defaults()
- |****************************** choice section ********************************
- choice.cont.process:
- on.choice:
- retval = 0
- if not process.file() then
- fxcom.dll0001.close()
- choice.again()
- else
- message("File Uploaded Successfully")
- endif
- |****************************** field section *********************************
- field.fpath:
- check.input:
- if rpos(fpath, "/") = len(fpath) then
- message("Please Specify the file name")
- choice.again()
- endif
- |****************************** function section ******************************
- functions:
- function domain tcbool process.file()
- {
- if fxcom.dll0001.open(fpath, 4, ",") < 1 then
- return(false)
- endif
- fxcom.dll0001.set.date.array(4, datf, 0, 1)
- while retval = 0
- retval = get.file.values()
- if retval = 2 then
- message("Wrong Data")
- return(false)
- endif
- if retval = 0 then
- tt.align.according.domain(ninv, ninv, "tcmcs.str11")
- update.main.table()
- endif
- endwhile
- fxcom.dll0001.close()
- return(true)
- }
- function long get.file.values()
- {
- site = 0
- ninv = ""
- vtno = 0
- vtdt = 0
- return(fxcom.dll0001.get.values(site, ninv, vtno, vtdt))
- }
- function update.main.table()
- {
- domain tfgld.ttyp ttyp
- domain tfgld.docn docn
-
- ninv = strip$(shiftl$(ninv))
- ttyp = ninv(1;3)
- | docn = val(ninv(3)) |#T1896_07_02.o
- docn = val(ninv(4)) |#T1896_07_02.n
-
- db.retry.point()
- select fxacr005.*
- from fxacr005 for update
- where fxacr005._index1 = {:site, :ttyp, :docn}
- order by fxacr005._index1
- selectdo
- selectempty
- fxacr005.site = site
- fxacr005.ttyp = ttyp
- fxacr005.ninv = docn
- fxacr005.vtno = vtno
- fxacr005.vtdt = vtdt
- | update set
- db.insert(tfxacr005, db.retry)
- commit.transaction()
- endselect
- }
复制代码 |