org.kuali.kfs.module.purap.document.validation.impl
Class PaymentRequestTaxAreaValidation

java.lang.Object
  extended by org.kuali.kfs.sys.document.validation.ParameterizedValidation
      extended by org.kuali.kfs.sys.document.validation.GenericValidation
          extended by org.kuali.kfs.module.purap.document.validation.impl.PaymentRequestTaxAreaValidation
All Implemented Interfaces:
Validation

public class PaymentRequestTaxAreaValidation
extends GenericValidation


Constructor Summary
PaymentRequestTaxAreaValidation()
           
 
Method Summary
 org.kuali.rice.kns.service.BusinessObjectService getBusinessObjectService()
           
protected  boolean listContainsValue(ArrayList<BigDecimal> list, BigDecimal value)
          Returns true if the specified ArrayList contains the specified BigDecimal value.
 ArrayList<BigDecimal> retrieveTaxRates(String incomeClassCode, String incomeTaxTypeCode)
          Retrieve active NonResidentAlien tax rate percent from database based on the specified income class and federal/state tax type.
 void setBusinessObjectService(org.kuali.rice.kns.service.BusinessObjectService businessObjectService)
           
 boolean validate(AttributedDocumentEvent event)
          Process business rules applicable to tax area data before calculating the withholding tax on payment request.
protected  boolean validateTaxIncomeClass(PaymentRequestDocument preq)
          Validates tax income class: when Non-Reportable income class is chosen, all other fields shall be left blank; It assumed that the input tax income class code is valid (existing and active in the system) since it's chosen from drop-down list.
protected  boolean validateTaxIndicators(PaymentRequestDocument preq)
          Validates rules among tax treaty, gross up, foreign source, USAID, other exempt, and Special W-4.
protected  boolean validateTaxRates(PaymentRequestDocument preq)
          Validates federal and state tax rates based on each other and the income class.
 
Methods inherited from class org.kuali.kfs.sys.document.validation.GenericValidation
setQuitOnFail, shouldQuitOnFail, stageValidation
 
Methods inherited from class org.kuali.kfs.sys.document.validation.ParameterizedValidation
getParameterProperties, populateParameterFromEvent, populateParametersFromEvent, setParameterProperties
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PaymentRequestTaxAreaValidation

public PaymentRequestTaxAreaValidation()
Method Detail

validate

public boolean validate(AttributedDocumentEvent event)
Process business rules applicable to tax area data before calculating the withholding tax on payment request.

Parameters:
paymentRequest - - payment request document
Returns:
true if all business rules applicable passes; false otherwise.

validateTaxIncomeClass

protected boolean validateTaxIncomeClass(PaymentRequestDocument preq)
Validates tax income class: when Non-Reportable income class is chosen, all other fields shall be left blank; It assumed that the input tax income class code is valid (existing and active in the system) since it's chosen from drop-down list. otherwise tax rates and country are required;

Parameters:
paymentRequest - - payment request document
Returns:
true if this validation passes; false otherwise.

validateTaxRates

protected boolean validateTaxRates(PaymentRequestDocument preq)
Validates federal and state tax rates based on each other and the income class. Validation will be bypassed if income class is empty or N, or tax rates are null.

Parameters:
paymentRequest - - payment request document
Returns:
true if this validation passes; false otherwise.

validateTaxIndicators

protected boolean validateTaxIndicators(PaymentRequestDocument preq)
Validates rules among tax treaty, gross up, foreign source, USAID, other exempt, and Special W-4.

Parameters:
paymentRequest - - payment request document
Returns:
true if this validation passes; false otherwise.

retrieveTaxRates

public ArrayList<BigDecimal> retrieveTaxRates(String incomeClassCode,
                                              String incomeTaxTypeCode)
Retrieve active NonResidentAlien tax rate percent from database based on the specified income class and federal/state tax type.

Parameters:
incomeClassCode - The specified income class type code.
incomeTaxTypeCode - The specified income tax type code.
Returns:
The array list containing the tax rates retrieved.

listContainsValue

protected boolean listContainsValue(ArrayList<BigDecimal> list,
                                    BigDecimal value)
Returns true if the specified ArrayList contains the specified BigDecimal value.

Parameters:
list - the specified ArrayList
value - the specified BigDecimal

getBusinessObjectService

public org.kuali.rice.kns.service.BusinessObjectService getBusinessObjectService()

setBusinessObjectService

public void setBusinessObjectService(org.kuali.rice.kns.service.BusinessObjectService businessObjectService)


Copyright © 2005-2012 The Kuali Foundation. All Rights Reserved.