# MTComtax

## Program ID

MetraPipeline.MTComTaxPlugin.1

## Description

The MTComTax plug-in performs US based telecom taxation using Commtax21. Commtax21 21 is a telecommunications taxation package by Vertex. For more information on Commtax21, see Vertex's documentation.

The MetraTech default behavior is to calculate taxes using a Vertex Geocode. The geocode plug-in looks up the geocode based on the users city, state, and ZIP code.

## Required Input Properties

Tag name | Value type | Description
Origin_NPA | String | The area code of the originating call.
Origin_NXX | String | The first 3 digits (exchange) of a 7 digit phone number.
Destination_NPA | String | The area code of the destination call
Destination_NXX | string | The destination first 3 digits (exchange) of a 7 digit phone number.
GeoCode | Long | The Geocode is a propietary number for determining the taxation jurisdition for Vertex products. If OverideWithAccountGeoCode is true the GeoCode will be used instead of the NPA/NXX.
PreTaxAmount | decimal | The amount prior to taxation.
TaxExemptAll | bool | Set if the user is exempt from all taxes. If the session property does not exist it will default to false.
TaxExemptFederal | bool | Same as taxExemptAll but for federal taxes.
TaxExemptState | bool | Same as taxExemptAll but for state taxes.
TaxExemptCounty | bool | Same as taxExemptAll but for county taxes.
TaxExemptCity | bool | Same as taxExemptAll but for city taxes.
InvoiceDate | Datetime | The time the call occurred. This is very important to determine which tax rate should be used.
Country | String | Must be "USA" for US taxation, anything else for VAT taxation.

## Required output properties

Tag name | Value type | Description
TaxAmount | decimal | The total amount of tax that was calculated.
FedTax | decimal | Federal tax. The property name should be " _FedTax"
StateTax | decimal | State tax. The property should be " _StateTax"
CountyTax | decimal | County tax. The property should be " _CountyTax"
LocalTax | decimal | Local (city or town) tax. The property should be " _LocalTax"
OtherTax | decimal | Any other applicable taxes. The property should be "OtherTax"

## Additional configuration tags

Tag name | Value type | Description
TreatInternationalAsInterstate | Boolean | Not used
OverideWithAccountGeoCode | Boolean | Always use the Geocode when determining the taxation jurisdictions. This is the MetraTech default. The default value is True.
ConfigFile | String | The location of the tax configuration file. This should always be tax\taxconfig.xml
ComTaxConfigFile | String | The location of the Commtax configuration file. This should always be tax\MTComTax.xml
ConfigInstallFile | String | File that describes Commtax installation information. This should always be tax\ComTaxInstallInfo.xml

## Configuration example

<configdata>
<!-- Inputs -->
<Origin_NPA>Origin_NPA</Origin_NPA>
<Origin_NXX>Origin_NXX</Origin_NXX>
<Destination_NPA>Destination_NPA</Destination_NPA>
<Destination_NXX>Destination_NXX</Destination_NXX>
<GeoCode>GeoCode</GeoCode>
<PreTaxAmount>PostDiscountAmount</PreTaxAmount>
<TaxExemptAll>taxexempt</TaxExemptAll>
<TaxExemptFederal>TaxExemptFederal</TaxExemptFederal>
<TaxExemptState>TaxExemptState</TaxExemptState>
<TaxExemptCounty>TaxExemptCounty</TaxExemptCounty>
<TaxExemptCity>TaxExemptCity</TaxExemptCity>
<InvoiceDate>DisconnectTime</InvoiceDate>
<Country>CountryName</Country>
<!-- Outputs -->
<TaxAmount>TaxAmount</TaxAmount>
<FedTax>_FedTax</FedTax>
<StateTax>_StateTax</StateTax>
<CountyTax>_CountyTax</CountyTax>
<LocalTax>_LocalTax</LocalTax>
<OtherTax>_OtherTax</OtherTax>
<TreatInternationalAsInterstate ptype="BOOLEAN">yes</TreatInternationalAsInterstate>
<OverideWithAccountGeoCode ptype="BOOLEAN">yes</OverideWithAccountGeoCode>
<ConfigFile>tax\taxconfig.xml</ConfigFile>
<ComTaxConfigFile>tax\MTComTax.xml</ComTaxConfigFile>
<ConfigInstallFile>tax\ComTaxInstallInfo.xml</ConfigInstallFile>
</configdata>

## Remarks

MetraTech by default uses the Geocode to determine the jurisdiction. The NPA/NXX can be generated from using the Phonecrack plug-in given that the service definition contains the origin and destination phone number.