public class TaxHelper
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
TAX_PRECISION_KEY |
static java.lang.String |
TAX_ROUNDING_MODE_KEY |
| Constructor and Description |
|---|
TaxHelper() |
| Modifier and Type | Method and Description |
|---|---|
void |
addTaxFramework(com.highdeal.tax.Tax.TaxationModule taxationModule,
com.highdeal.tax.TaxFramework taxFramework) |
void |
applyTax(ChargedTransaction transac,
TaxedAmount taxedAmount)
Applies tax(es) on a charged transaction.
|
Money |
calculateNet(Money grossAmount,
Transaction transaction,
com.highdeal.tax.TaxInfoEntity taxInfo)
Calculates the net amount from a gross amount.
|
TaxedAmount |
calculateTax(Transaction transac,
com.highdeal.tax.TaxInfoEntity taxInfo,
boolean isPrepaidAccTaxExclUsingSubs)
Calculates tax(es) for a charged transaction.
|
TaxedAmount |
calculateTax(Transaction transac,
com.highdeal.tax.VatDataEntity vatData,
com.highdeal.tax.EztaxDataEntity eztaxData,
boolean isPrepaidAccTaxExclUsingSubs)
Calculates tax(es) for a charged transaction.
|
static boolean |
checkTaxParameters(TaxParameterSetModel expected,
TaxParameterSetModel actual) |
java.util.Vector<TaxArea> |
getAvailableTaxAreaList(java.util.Date at)
Retrieves all tax area which are valid at the date "at".
|
java.util.Vector<TransServType> |
getAvailableTransServTypeList()
Retrieves all Transaction/Service Types which are valid for EZTax.
|
static TaxHelper |
getInstance()
Returns the TaxHelper instance.
|
com.highdeal.tax.TaxFramework |
getTaxFramework(com.highdeal.tax.Tax.TaxationModule taxationModule) |
int |
getTaxPrecision(Currency fromCurrency)
Gets the tax amount precision.
|
int |
getTaxRoundingMode()
Gets the tax rounding mode.
|
static com.highdeal.tax.TaxData |
getUSInstance(java.lang.String taxDataStr) |
void |
initialize(java.util.List<com.highdeal.tax.Tax.TaxationModule> taxationModules,
java.util.Properties props)
Initializes the tax framework(s).
|
static boolean |
isDifferentTaxPrefix(java.lang.String detailName,
com.highdeal.tax.Tax.TaxationModule taxationModule) |
boolean |
isInitialized()
Indicates if TaxHelper has been initialized, i.e.
|
static boolean |
isValid(com.highdeal.tax.TaxData taxData) |
boolean |
refreshTransServTypeList()
Refreshes all Transaction/Service Types which are valid for EZTax.
|
void |
setTaxPrecision(int taxPrecision)
Sets the tax amount precision.
|
void |
setTaxRoundingMode(int taxRoundingMode)
Sets the tax rounding mode.
|
void |
storeTax(java.math.BigInteger transId,
java.util.Date transDate,
java.util.Date recordDate,
java.lang.String vendor,
java.lang.String buyer,
java.util.List<TaxDetailModel> taxDetails,
boolean prepaid)
Stores tax(es) for a set of refill, prepaid or postpaid transactions.
|
static java.lang.String |
toUSString(com.highdeal.tax.TaxData taxData) |
public static final java.lang.String TAX_PRECISION_KEY
public static final java.lang.String TAX_ROUNDING_MODE_KEY
public boolean isInitialized()
public static boolean isDifferentTaxPrefix(java.lang.String detailName,
com.highdeal.tax.Tax.TaxationModule taxationModule)
public static TaxHelper getInstance()
public void initialize(java.util.List<com.highdeal.tax.Tax.TaxationModule> taxationModules,
java.util.Properties props)
throws InvalidTaxException
taxationModules - the list of tax frameworks to initialize.props - the tax properties to set (tax precision and tax rounding mode).InvalidTaxExceptionpublic int getTaxPrecision(Currency fromCurrency)
fromCurrency - the currency use to apply the tax.public void setTaxPrecision(int taxPrecision)
throws InvalidTaxException
taxPrecision - the tax amount precision.InvalidTaxExceptionpublic int getTaxRoundingMode()
public void setTaxRoundingMode(int taxRoundingMode)
throws InvalidTaxException
taxRoundingMode - the tax rounding mode.InvalidTaxExceptionpublic TaxedAmount calculateTax(Transaction transac, com.highdeal.tax.VatDataEntity vatData, com.highdeal.tax.EztaxDataEntity eztaxData, boolean isPrepaidAccTaxExclUsingSubs) throws InvalidTaxException
transac - the transaction on which the tax is applied.vatData - the Value Added Tax information at the subscriber account level.eztaxData - the US Telco Tax information at the external/prepaid account level.isPrepaidAccTaxExclUsingSubs - indicates if the transaction has been generated for a prepaid account tax excl. having a subscription.InvalidTaxException - if an error occurs during the computation of the tax.public TaxedAmount calculateTax(Transaction transac, com.highdeal.tax.TaxInfoEntity taxInfo, boolean isPrepaidAccTaxExclUsingSubs) throws InvalidTaxException
transac - the transaction on which the tax is applied.taxInfo - the tax information at the subscriber account level.isPrepaidAccTaxExclUsingSubs - indicates if the transaction has been generated for a prepaid account tax excl. having a subscription.InvalidTaxExceptionpublic Money calculateNet(Money grossAmount, Transaction transaction, com.highdeal.tax.TaxInfoEntity taxInfo) throws InvalidTaxException
grossAmount - the gross amount.transaction - the transaction on which the tax is applied.taxInfo - the tax information at the subscriber account level.InvalidTaxExceptionpublic void applyTax(ChargedTransaction transac, TaxedAmount taxedAmount)
transac - the charged transaction for which the tax is applied.taxedAmount - the taxed amount to apply on the charged transaction.IncompatibleCurrenciesExceptionpublic void storeTax(java.math.BigInteger transId,
java.util.Date transDate,
java.util.Date recordDate,
java.lang.String vendor,
java.lang.String buyer,
java.util.List<TaxDetailModel> taxDetails,
boolean prepaid)
throws InvalidTaxException
InvalidTaxExceptionpublic java.util.Vector<TaxArea> getAvailableTaxAreaList(java.util.Date at)
at - the date when the tax area must be valid.public java.util.Vector<TransServType> getAvailableTransServTypeList()
public boolean refreshTransServTypeList()
public void addTaxFramework(com.highdeal.tax.Tax.TaxationModule taxationModule,
com.highdeal.tax.TaxFramework taxFramework)
public com.highdeal.tax.TaxFramework getTaxFramework(com.highdeal.tax.Tax.TaxationModule taxationModule)
public static final boolean isValid(com.highdeal.tax.TaxData taxData)
public static final java.lang.String toUSString(com.highdeal.tax.TaxData taxData)
public static final com.highdeal.tax.TaxData getUSInstance(java.lang.String taxDataStr)
public static final boolean checkTaxParameters(TaxParameterSetModel expected, TaxParameterSetModel actual)