Home > database >  PB generate XML file with the tax system interface
PB generate XML file with the tax system interface

Time:09-25

Due to the limited length, code section omit,
Long li_row li_selectedrow, li_i
String ls_exepath
Datetime ldt_sfrq_start ldt_sfrq_end, ldt_bbrq
Ldt_sfrq_start=datetime (Date (left (em_sfrq_start. Text, 10)), Time (em_sfrq_start. Text, 8) (right))
Ldt_sfrq_end=datetime (Date (left (em_sfrq_end. Text, 10)), Time (em_sfrq_end. Text, 8) (right))
Ldt_bbrq=gf_getdatetime ()
Setpointer (hourglass!
Ls_exepath=GetCurrentDirectory ()

Setpointer (hourglass!
Dw_1. Settransobject (sqlca)
If dw_1. Rowcount () & lt; 1 then
Messagebox (' prompt ', 'no charge data! ')
Setpointer (arrow!
Return
End the if

Long li_fileno
Li_fileno=fileopen (' D: \ \ NsrXsktFpsjSbb tax data XML. XML ', LineMode! The Write! , LockWrite! The Replace!
If li_fileno=1 then
Messagebox (' prompt ', 'create file NsrXsktFpsjSbb. XML failed, please check whether other applications are using this file,')
Return
End the if

FileWrite (li_fileno, '& lt; ? The XML version="1.0" encoding="GB2312"?> ')
FileWrite (li_fileno, '& lt; SCHEMA NAME="NsrXsktFpsjSbb CNNAME"="taxpayers selling open fill invoice data declaration form" VERSION="1.0" XMLNS: xsi="http://www.w3.org/2001/XMLSchema-instance" xsi: noNamespaceSchemaLocation="model. XSD & gt;" ')
FileWrite (li_fileno, '& lt; HEAD> ')
FileWrite (li_fileno, '& lt; NSRSBH> 530924748298822 & lt;/NSRSBH> ')
FileWrite (li_fileno, '& lt; SSSQ_Q & gt; '+ string (ldt_sfrq_start,' yyyy - mm - dd) + '& lt;/SSSQ_Q & gt; ')
FileWrite (li_fileno, '& lt; SSSQ_Z & gt; '+ string (ldt_sfrq_end,' yyyy - mm - dd) + '& lt;/SSSQ_Z & gt; ')
FileWrite (li_fileno, '& lt; TBRQ> '+ string (ldt_bbrq,' yyyy - mm - dd) + '& lt;/TBRQ> ')
FileWrite (li_fileno, '& lt; NSRMC> Water supply co., LTD & lt;/NSRMC> ')

FileWrite (li_fileno, '& lt; DZ> ')
FileWrite (li_fileno, '& lt; DHHM> ')
FileWrite (li_fileno, '& lt; JBR> Luo Guiqin & lt;/JBR> ')
FileWrite (li_fileno, '& lt; BZ> ')
FileWrite (li_fileno, '& lt;/HEAD> ')

FileWrite (li_fileno, '& lt; HEAD_AFFIX & gt; ')
FileWrite (li_fileno, '& lt; HYFL_DM & gt; 4610 & lt;/HYFL_DM & gt; ')
FileWrite (li_fileno, '& lt; HYFL_MC & gt; Tap water production and supply & lt;/HYFL_MC & gt; ')
FileWrite (li_fileno, '& lt;/HEAD_AFFIX & gt; ')

FileWrite (li_fileno, '& lt; BODY> ')
String yhh, updatetime, CBKH QBBH, QBLC, yyhh, pym, yhm, yhdz, LXDH, QJMC, PJH, FPDM, sfry, FPZT
String SCZDS BCZDS, SSCBB CBBMC, CBXH, ls_id
String ls_line
Long li_id
Datetime SFRQ

Updatetime=string (gf_getdatetime ())
For li_row=1 to dw_1. Rowcount ()
Yhh=dw_1. Getitemstring (li_row, 'yhh)
.
FPZT=dw_1. Getitemstring (li_row, 'FPZT')//invoice state [10: normal, 20: invalid]
Ls_line='& lt; FP ID="' + string (li_row) + '" & gt; '//invoice information, according to the total export invoice number 1 to n
FileWrite (li_fileno ls_line)
Ls_line='& lt; FPZL_DM & gt; '+' 26149 '+' & lt;/FPZL_DM & gt; '
FileWrite (li_fileno ls_line)

Ls_line='& lt; XXSL> '+' 6 '+' & lt;/XXSL> '
FileWrite (li_fileno ls_line)

Ls_line='& lt; GMBZ> '+' y '+' & lt;/GMBZ> '
FileWrite (li_fileno ls_line)

Ls_line='& lt; DKBZ> '+' 0 '+' & lt;/DKBZ> '
FileWrite (li_fileno ls_line)

Ls_line='& lt; NCPBZ> '+' n '+' & lt;/NCPBZ> '
FileWrite (li_fileno ls_line)

Ls_line='& lt; FP_DM & gt; '+ FPDM + & lt;/FP_DM & gt; '
FileWrite (li_fileno ls_line)

Ls_line='& lt; FPHM> '+ PJH + & lt;/FPHM> '
FileWrite (li_fileno ls_line)

Ls_line='& lt; KPRQ> '+ string (datetime (SFRQ),' mm - dd yyyy - hh: mm: ss ') + '& lt;/KPRQ> '
FileWrite (li_fileno ls_line)

Ls_line='& lt; HYFL> '+' tap water production and supply of '+' & lt;/HYFL> '
FileWrite (li_fileno ls_line)

Ls_line='& lt; FKMC> '+ yhm + & lt;/FKMC> '
FileWrite (li_fileno ls_line)

Ls_line='& lt; FKSBH> '+' & lt;/FKSBH> '
FileWrite (li_fileno ls_line)

Dw_2. Settransobject (sqlca)
Dw_2. Retrieve (yhh, PJH)
For li_i=1 to dw_2. Rowcount ()
Ldec_id=dw_2. Getitemnumber (li_i, 'compute_1)
.//intermediate code for li_i=1 to li_i=6
End for

FileWrite (li_fileno, '& lt; FPMX COUNT="6" & gt; ')//project maximum six lines
FileWrite (li_fileno, '& lt; Mx1 & gt; ')
Ls_line='& lt; HLMC> '+' tap water production and supply of '+' & lt;/HLMC> '
FileWrite (li_fileno ls_line)
Ls_line='& lt; GG> '+' '+' & lt;/GG> '
FileWrite (li_fileno ls_line)
Ls_line='& lt; DW> '+' cube '+' & lt;/DW> '
FileWrite (li_fileno ls_line)
Ls_line='& lt; DJ> '+ string (ldec_sj1) +' & lt;/DJ> '
FileWrite (li_fileno ls_line)
Ls_line='& lt; SL> '+ string (ldec_sl1) +' & lt;/SL> '
FileWrite (li_fileno ls_line)
Ls_line='& lt; JE> '+ string (ldec_yssf1) +' & lt;/JE> '
FileWrite (li_fileno ls_line)
Ls_line='& lt; ZDY> '+' & lt;/ZDY> '
FileWrite (li_fileno ls_line)
FileWrite (li_fileno, '& lt;/mx1 & gt; ')

FileWrite (li_fileno, '& lt; Mx2 & gt; ')
Ls_line='& lt; HLMC> '+' tap water production and supply of '+' & lt;/HLMC> '
FileWrite (li_fileno ls_line)
Ls_line='& lt; GG> '+' '+' & lt;/GG> '
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related