Infor LN (BaaN ERP)论坛

 找回密码
 加入Baan会员

QQ登录

只需一步,快速开始

QQ群一:61560730(已满)QQ群二:34342363
查看: 3098|回复: 0

金税发票号码回写Baan

[复制链接]
发表于 2010-6-3 09:53:08 | 显示全部楼层 |阅读模式
Untitled-2.jpg
  1. declaration:
  2. #ident "@(#)T1896_07_01, Ganesh Moorthy J, 2008-09-10, B50C_c_x201"
  3. #ident "@(#)T1896_07_02, Ganesh Moorthy J, 2008-09-12, B50C_c_x201"

  4.         table        tfxacr005        | VAT Information in Getpaid System

  5.         extern  domain  tcmcs.str132m   fpath
  6.         extern  domain  fxex.datf       datf
  7.                 domain  tcncmp          site
  8.                 domain  tcmcs.str11     ninv
  9.                 domain  tcmcs.long      vtno
  10.                 domain  tfgld.date      vtdt
  11.                 long    retval

  12.     #include <bic_tt>
  13.     #pragma used dll "ofxcomdll0001"
  14. |****************************** form section **********************************
  15. group.1:
  16. init.group:
  17.     get.screen.defaults()
  18. |****************************** choice section ********************************

  19. choice.cont.process:
  20. on.choice:
  21.     retval = 0
  22.     if not process.file()  then
  23.         fxcom.dll0001.close()
  24.         choice.again()
  25.     else
  26.         message("File Uploaded Successfully")   
  27.     endif

  28. |****************************** field section *********************************

  29. field.fpath:
  30. check.input:
  31.     if rpos(fpath, "/") = len(fpath) then
  32.         message("Please Specify the file name")
  33.         choice.again()
  34.     endif

  35. |****************************** function section ******************************

  36. functions:

  37. function domain tcbool process.file()
  38. {   
  39.     if fxcom.dll0001.open(fpath, 4, ",") < 1 then
  40.         return(false)
  41.     endif
  42.     fxcom.dll0001.set.date.array(4, datf, 0, 1)
  43.     while retval = 0
  44.         retval = get.file.values()
  45.         if retval = 2 then
  46.             message("Wrong Data")
  47.             return(false)
  48.         endif
  49.         if retval = 0 then
  50.             tt.align.according.domain(ninv, ninv, "tcmcs.str11")
  51.             update.main.table()
  52.         endif
  53.     endwhile
  54.     fxcom.dll0001.close()
  55.     return(true)
  56. }

  57. function long get.file.values()
  58. {
  59.     site = 0
  60.     ninv = ""
  61.     vtno = 0
  62.     vtdt = 0
  63.     return(fxcom.dll0001.get.values(site, ninv, vtno, vtdt))
  64. }

  65. function update.main.table()
  66. {
  67.         domain  tfgld.ttyp  ttyp
  68.         domain  tfgld.docn  docn
  69.        
  70.         ninv = strip$(shiftl$(ninv))
  71.         ttyp = ninv(1;3)
  72. |        docn = val(ninv(3))                                                |#T1896_07_02.o
  73.     docn = val(ninv(4))                                         |#T1896_07_02.n
  74.        
  75.         db.retry.point()       
  76.         select        fxacr005.*
  77.         from        fxacr005 for update
  78.         where   fxacr005._index1 = {:site, :ttyp, :docn}
  79.         order by fxacr005._index1
  80.         selectdo
  81.         selectempty
  82.             fxacr005.site = site
  83.             fxacr005.ttyp = ttyp
  84.             fxacr005.ninv = docn
  85.             fxacr005.vtno = vtno
  86.             fxacr005.vtdt = vtdt
  87.                 | update set
  88.                 db.insert(tfxacr005, db.retry)
  89.                 commit.transaction()
  90.         endselect
  91. }
复制代码
您需要登录后才可以回帖 登录 | 加入Baan会员

本版积分规则

QQ|Archiver|手机版|小黑屋|Infor LN Baan论坛 沪ICP备20006045号-3

GMT+8, 2024-5-2 11:06 , Processed in 0.168384 second(s), 20 queries .

Powered by Discuz! X3.5

Copyright © 2001-2023 Tencent Cloud.

快速回复 返回顶部 返回列表