之前写过一篇文章是在介绍第三方税包STQ的install step: Vertex Sales Tax Q Serieis(STQ)第三方税包安装学习
最近在做另外一个第三方税包CTQ的feature,有时间就把自己了解到的东西总结一下吧。下面总结的都是用英语的,比较简单就不翻译成中文了。
This article is a summary on how to install and configureCTQ on Unix (Solaris) environment, CTQversion is 2.02. Also, you can refer to the Vertex Communications Tax Q SeriesImplementation Guide to get the detail information.
Introduction to CTQ
Before introduce CTQ, I have to introduce CTL (VertexCommunications Tax L Series .It is a communications tax compliance systemthat enables you to compute taxes on wire line and wireless telecommunicationsservices, data transmission services, Internet access, and trunk lines. Thesystem enables you to customize Vertex data and define bundled service fees andfranchise fees. It supports max and tier taxes and covers jurisdictions in boththe United States and Canada. It uses COBOL language to implement the taxcalculation. A COBOL compiler is required before installing CTL on yourcomputer
CTQ istotally a different version from CTL , it is VertexCommunicationsTax Q Series, it provides C language API to calculate tax orGeocode. And it uses DBMS such as oracle to store rate and jurisdictioninformation. We can get rid of cobol compiler if using CTQ.
Before you install the CTQ, you’d better to create a schemafor CTQ database. For example, when I do implemention the feature for CTQ , Irun a schema cwuk_yy/arbor123@ RDCO1106.
Install and configuration
1. install steps
· get the installation package
Communications_Tax_Q_Series_2.02.00_Programs_Solaris.zip
· unzip the installationpackage and then unpack tar
a. unzip Communications_Tax_Q_Series_2.02.00_Programs_Solaris.zip
Archive: Communications_Tax_Q_Series_2.02.00_Programs_Solaris.zip
creating: Programs - Solaris/Solaris 8.0/
inflating: Programs - Solaris/Solaris 8.0/CTQ.tar
creating: Programs - Solaris/Solaris 9.0/
inflating: Programs - Solaris/Solaris 9.0/CTQ.tar
b. tar xvf CTQ.tar
32bit/ 64bit/ doc/
Note: Inmy env, I use solaris 9.0 64 bit. For inconvient, I move it to /usr1/arbor/bin/ctq/s9/64bitfor the after use.
· run install_drivers.sh to install ODBC driver
a. cd bin directory (eg./usr1/arbor/bin/ctq/s9/64bit/bin)
b. run install_drivers.sh
A messagedisplays notifying you that the ODBC drivers have been
successfullyinstalled.
Thenyou can find a directory odbc created in bin directory.
· define ODBC data source
a. cd odbc
b. vim odbc.ini
c. find (Navigate)to the section titled [Oracle Wire Protocol]
d. Replace the term[OracleWire Protocol] with a name of your choosing for yourODBC data source. The name you select must conform to the name specified by thedsn attribute of the target dbConnection within the ctqcfg.xml
Forexample: I need to use [RDCO1106] to replace [Oracle WireProtocol]
e. Replace the termHostName=Oracleserver withthe host name of your Oracle database server.
Eg.HostName=haha.kenan.com
f. Replace the termPortNumber=OracleServer Port with the appropriate port number on the server forthe database connection of your choice.
PortNumber=1521
g. Replace the termSID=OracleSID withthe appropriate Oracle System Identifier for the instance of Oracle running onyour server. If there is only one instance, this may be specified as SID=*.
SID="RDCO1106"
At the same time, I also set
LogonID=cwuk_yy
Password=arbor123
TNSNamesFile=/u1/yyang/tnsnames.ora
ServerName=
· Configure ctqcfg.xml
You can define The element configuration name value as you want, default value is : CTQ UNIX Test(example). Then define dsn/user/password for each dbconnection.
Example:
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<!-- Configuration file for Vertex Communications Tax Q Series (CTQ) -->
<!DOCTYPE ctqcfg SYSTEM "ctqcfg.dtd">
<ctqcfg version="2.0">
<configuration name="CTQ UNIX Test (example)">
<fileControl>
<updatePath>/usr1/arbor/bin/ctq/s9/64bit/dat</updatePath>
<archivePath>/usr1/arbor/bin/ctq/s9/64bit/dat</archivePath>
<callFilePath>/usr1/arbor/bin/ctq/s9/64bit/dat</callFilePath>
<reportPath>/usr1/arbor/bin/ctq/s9/64bit/rpt</reportPath>
<logPath>/usr1/arbor/bin/ctq/s9/64bit/log</logPath>
</fileControl>
<reportControl>
<pageLength>66</pageLength>
</reportControl>
<logControl>
<logAllData/>
<logAllEvents/>
</logControl>
<registerControl>
<writeToAcc/>
<writeToJrn/>
<!-- returnZeroRateTaxes/ -->
<!-- zip4Err/ -->
</registerControl>
<cacheControl>
<cache name="LocGeo" mode="dynamic"/>
<cache name="LocNpa" mode="dynamic"/>
<cache name="LocZip" mode="off"/>
<cache name="LocDgh" mode="preload"/>
<cache name="Rte" mode="dynamic"/>
</cacheControl>
<dbConnection name="Customization">
<dsn>RDCO1106</dsn>
<schema></schema>
<catalog></catalog>
<username>cwuk_yy</username>
<password encrypted= "false">arbor123</password>
</dbConnection>
<dbConnection name="Location">
<dsn>RDCO1106</dsn>
<schema></schema>
<catalog></catalog>
<username>cwuk_yy</username>
<password encrypted= "false">arbor123</password>
</dbConnection>
<dbConnection name="Rate">
<dsn>RDCO1106</dsn>
<schema></schema>
<catalog></catalog>
<username>cwuk_yy</username>
<password encrypted= "false">arbor123</password>
</dbConnection>
<dbConnection name="Register">
<dsn>RDCO1106</dsn>
<schema></schema>
<catalog></catalog>
<username>cwuk_yy</username>
<password encrypted= "false">arbor123</password>
<sequenceBlockSize table="RegAcc">100</sequenceBlockSize>
<sequenceBlockSize table="RegAdd">200</sequenceBlockSize>
<sequenceBlockSize table="RegJrn">1000</sequenceBlockSize>
<sequenceBlockSize table="RegJtx">5000</sequenceBlockSize>
<retryInterval>0</retryInterval>
<maximumRetries>50</maximumRetries>
</dbConnection>
</configuration>
</ctqcfg>
2. Creating CTQ dataobjects
− rtecreate.sql (Rate objects)
− loccreate.sql (Locationobjects)
− ctzcreate.sql (Customizationobjects)
− regcreate.sql(Registerobjects)
Eg. cd /usr1/arbor/bin/ctq/s9/64bit/sql/Oracle
sqlplus arbor123/arbor123@R RDCO1106
@ rtecreate.sql
@ loccreate.sql
@ ctzcreate.sql
@ regcreate.sql
· Copy monthly update file to$CTQ_HOME/dat
C4CTXUPD CTQ202UPD SOCCTQ.XLS VC4SORC.RPT VGA2UPD
· Run$CTQ_HOME/bin/ctqupdate to populate data for CTQ tables
Eg. ./ctqupdate -h /usr1/arbor/bin/ctq/s9/64bit/cfg/ -c "CTQ UNIX Test (example)" -i/usr1/arbor/bin/ctq/s9/64bit/dat/
SUCCESS: ctqupdate completedsuccessfully
Note: -c "CTQ UNIX Test(example)" is ctqcfg.xml :
<configuration name="CTQ UNIX Test (example)">
3. set UNIX environment variables
setenv CTQ_HOME /usr1/arbor/bin/ctq/s9/64bit
setenv CTQ_CFG_HOME $CTQ_HOME/cfg
setenv CTQ_CFG_NAME "CTQ UNIX Test (example)"
setenv ODBC_HOME$CTQ_HOME/bin/odbc/
setenv ODBCINI$CTQ_HOME/bin/odbc/odbc.ini
setenv PATH $CTQ_HOME/bin:${PATH}
setenv PATH $CTQ_HOME/bin/odbc/:${PATH}
setenv LD_LIBRARY_PATH$CTQ_HOME/lib:$CTQ_HOME/bin/odbc/lib/:$LD_LIBRARY_PATH
After the above steps CTQ installation and configuration complete. You can start your implemention for your feature.
如果有时间在总结一些看完代码后了解的东西吧。待续。。。。。