org.kuali.kfs.fp.document.service.impl
Class DisbursementVoucherTaxServiceImpl

java.lang.Object
  extended by org.kuali.kfs.fp.document.service.impl.DisbursementVoucherTaxServiceImpl
All Implemented Interfaces:
DisbursementVoucherConstants, DisbursementVoucherTaxService, ParameterKeyConstants

public class DisbursementVoucherTaxServiceImpl
extends Object
implements DisbursementVoucherTaxService, DisbursementVoucherConstants

This is the default implementation of the DisbursementVoucherExtractService interface. This class handles queries and validation on tax id numbers.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.kuali.kfs.fp.document.DisbursementVoucherConstants
DisbursementVoucherConstants.DocumentStatusCodes, DisbursementVoucherConstants.DvPdpExtractGroup, DisbursementVoucherConstants.PaymentReasonCodes, DisbursementVoucherConstants.RouteLevelNames, DisbursementVoucherConstants.TabByReasonCode, DisbursementVoucherConstants.TabKey
 
Field Summary
 
Fields inherited from interface org.kuali.kfs.fp.document.DisbursementVoucherConstants
ALIEN_INDICATOR_CHECKED_PARM_NM, ALIEN_PAYMENT_REASONS_PARM_NM, ALLOW_OBJECT_CODE_EDITS, CAMPUSES_TAXED_FOR_MOVING_REIMBURSEMENTS_PARM_NM, CHECK_EMPLOYEE_PAID_OUTSIDE_PAYROLL_PARM_NM, DECEDENT_COMPENSATION_PAYMENT_REASONS_PARM_NM, DEFAULT_DOC_LOCATION_PARM_NM, DOCUMENT_TYPE_CHECKACH, DOCUMENT_TYPE_WTFD, DV_COVER_SHEET_TEMPLATE_ALIEN_PARM_NM, DV_COVER_SHEET_TEMPLATE_ATTACHMENT_PARM_NM, DV_COVER_SHEET_TEMPLATE_BAR_PARM_NM, DV_COVER_SHEET_TEMPLATE_HANDLING_PARM_NM, DV_COVER_SHEET_TEMPLATE_LINES_PARM_NM, DV_COVER_SHEET_TEMPLATE_NM, DV_COVER_SHEET_TEMPLATE_RLINES_PARM_NM, DV_PAYEE_TYPE_EMPLOYEE, DV_PAYEE_TYPE_REVOLVING_FUND_VENDOR, DV_PAYEE_TYPE_SUBJECT_PAYMENT_VENDOR, DV_PAYEE_TYPE_VENDOR, FEDERAL_TAX_PARM_PREFIX, FEDERAL_TAX_TYPE_CODE, FUNCTION_CODE_GLOBAL_RESTRICTION_PARM_NM, INDIVIDUAL_OWNERSHIP_TYPES_PARM_NM, INVALID_DOC_LOC_BY_CAMPUS_PARM, INVALID_DOC_LOC_BY_PAYMENT_REASON_PARM, INVALID_OBJ_CODE_BY_PAYMENT_REASON_PARM, INVALID_OBJ_LEVEL_BY_PAYMENT_REASON_PARM, INVALID_OBJECT_SUB_TYPES_BY_SUB_FUND_GROUP_PARM, INVALID_PAYEE_TYPES_BY_PAYMENT_REASON_PARM, INVALID_SUB_FUND_GROUPS_BY_PAYMENT_REASON_PARM, MAX_NOTE_LINE_SIZE, MOVING_PAYMENT_REASONS_PARM_NM, NO_DOCUMENTATION_LOCATION, NON_VENDOR_EMPLOYEE_PAYEE_TYPE_LABEL_PARM_NM, NONEMPLOYEE_TRAVEL_ACTUAL_MILEAGE_LIMIT_PARM_NM, NONEMPLOYEE_TRAVEL_PAY_REASONS_PARM_NM, NRA_TAX_INCOME_CLASS_FELLOWSHIP, NRA_TAX_INCOME_CLASS_INDEPENDENT_CONTRACTOR, NRA_TAX_INCOME_CLASS_NON_REPORTABLE, NRA_TAX_INCOME_CLASS_ROYALTIES, OBJECT_LEVEL_GLOBAL_RESTRICTION_PARM_NM, OBJECT_SUB_TYPE_GLOBAL_RESTRICTION_PARM_NM, OBJECT_TYPE_GLOBAL_RESTRICTION_PARM_NM, PAYMENT_METHOD_CHECK, PAYMENT_METHOD_DRAFT, PAYMENT_METHOD_WIRE, PAYMENT_REASONS_REQUIRING_TAX_REVIEW_PARM_NM, PERFORM_PREPAID_EMPL_PARM_NM, PO_AND_DV_PAYEE_TYPE_LABEL_PARM_NM, PREPAID_TRAVEL_PAYMENT_REASONS_PARM_NM, RESEARCH_NON_VENDOR_PAY_LIMIT_AMOUNT_PARM_NM, RESEARCH_PAYMENT_REASONS_PARM_NM, REVOLVING_FUND_PAYMENT_REASONS_PARM_NM, STATE_TAX_PARM_PREFIX, STATE_TAX_TYPE_CODE, SUB_FUND_GLOBAL_RESTRICTION_PARM_NM, TAX_CONTROL_CODE_ALLOWS_EMPLOYEES, TAX_CONTROL_CODE_BEGIN_WITHHOLDING, TAX_CONTROL_CODE_HOLD_PAYMENT, TAX_DOCUMENTATION_LOCATION_CODE_PARM_NM, TAX_ID_TYPE_SSN, TAX_PARM_ACCOUNT_SUFFIX, TAX_PARM_CHART_SUFFIX, TAX_PARM_OBJECT_BY_INCOME_CLASS_SUFFIX, TAX_TYPE_FEIN, TAX_TYPE_SSN, TRAVEL_PER_DIEM_MESSAGE_PARM_NM, VALID_DOC_LOC_BY_CAMPUS_PARM, VALID_DOC_LOC_BY_PAYMENT_REASON_PARM, VALID_OBJ_CODE_BY_PAYMENT_REASON_PARM, VALID_OBJ_LEVEL_BY_PAYMENT_REASON_PARM, VALID_OBJECT_SUB_TYPES_BY_SUB_FUND_GROUP_PARM, VALID_PAYEE_TYPES_BY_PAYMENT_REASON_PARM, VALID_SUB_FUND_GROUPS_BY_PAYMENT_REASON_PARM, VALID_VENDOR_OWNERSHIP_TYPES_BY_PAYMENT_REASON, VENDOR_PAYEE_TYPE_CODES
 
Constructor Summary
DisbursementVoucherTaxServiceImpl()
           
 
Method Summary
 void clearNRATaxLines(DisbursementVoucherDocument document)
          Removes non-resident alien (NRA) tax lines from the document's accounting lines and updates the check total.
protected  void generateNRATaxLines(DisbursementVoucherDocument document)
          This method generates non-resident alien (NRA) tax lines for the given disbursement voucher.
protected  AccountingLine generateTaxAccountingLine(DisbursementVoucherDocument document, String chart, String account, String objectCode, org.kuali.rice.kns.util.KualiDecimal taxPercent, org.kuali.rice.kns.util.KualiDecimal taxableAmount)
          Generates an accounting line for the chart, account, object code & tax percentage values given.
 org.kuali.rice.kns.service.BusinessObjectService getBusinessObjectService()
          Gets the value of the businessObjectService instance.
 org.kuali.rice.kns.service.MaintenanceDocumentService getMaintenanceDocumentService()
          Gets the value of the maintenanceDocumentService instance.
 org.kuali.rice.kns.util.KualiDecimal getNonResidentAlienTaxAmount(DisbursementVoucherDocument document)
          This method retrieves the non-resident alien (NRA) tax amount using the disbursement voucher given to calculate the amount.
 List<Integer> getNRATaxLineNumbers(String taxLineString)
          Parses the tax line string given and returns a list of line numbers as Integers.
 String getUniversalId(String taxIDNumber, String taxPayerTypeCode)
          This method retrieves the universal id of the individual or business entity who matches the tax id number and type code given.
 String getVendorId(String taxIDNumber, String taxPayerTypeCode)
          This method retrieves the vendor identification code for the vendor found who has a matching tax id and tax payer type code.
 void processNonResidentAlienTax(DisbursementVoucherDocument document)
          This method validates the non-resident alien (NRA) tax information for the document and if the information validates, the NRA tax lines are generated.
 void setBusinessObjectService(org.kuali.rice.kns.service.BusinessObjectService businessObjectService)
          This method sets the businessObjectService attribute to the value given.
 void setMaintenanceDocumentService(org.kuali.rice.kns.service.MaintenanceDocumentService maintenanceDocumentService)
          This method sets the maintenanceDocumentService attribute to the value given.
 void setParameterService(org.kuali.rice.kns.service.ParameterService parameterService)
          This method sets the parameterService attribute to the value given.
 void validateNonResidentAlienInformation(DisbursementVoucherDocument document)
          Validates fields for an alien payment.
protected  boolean validateNRATaxInformation(DisbursementVoucherDocument document)
          This method performs a series of validation checks to ensure that the disbursement voucher given contains non-resident alien specific information and non-resident alien tax lines are necessary.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DisbursementVoucherTaxServiceImpl

public DisbursementVoucherTaxServiceImpl()
Method Detail

getUniversalId

public String getUniversalId(String taxIDNumber,
                             String taxPayerTypeCode)
This method retrieves the universal id of the individual or business entity who matches the tax id number and type code given.

Specified by:
getUniversalId in interface DisbursementVoucherTaxService
Parameters:
taxIDNumber - The tax identification number of the user being retrieved.
taxPayerTypeCode - The tax payer type code of the user being retrieved. See the TAX_TYPE_* constants defined in DisbursementVoucherRuleConstants for examples of valid tax type codes.
Returns:
The universal id of the individual who matches the tax id and type code given. Null if no matching user is found.
See Also:
org.kuali.kfs.fp.document.service.DisbursementVoucherTaxService#getEmployeeNumber(java.lang.String, java.lang.String)

getVendorId

public String getVendorId(String taxIDNumber,
                          String taxPayerTypeCode)
This method retrieves the vendor identification code for the vendor found who has a matching tax id and tax payer type code.

Specified by:
getVendorId in interface DisbursementVoucherTaxService
Parameters:
taxIDNumber - The tax id number used to retrieve the associated vendor.
taxPayerTypeCode - The tax payer type code used to retrieve the associated vendor. See the TAX_TYPE_* constants defined in DisbursementVoucherRuleConstants for examples of valid tax type codes.
Returns:
The id of the vendor found matching the tax id and type code provided. Null if no matching vendor is found.
See Also:
org.kuali.kfs.fp.document.service.DisbursementVoucherTaxService#getPayeeNumber(java.lang.String, java.lang.String)

generateNRATaxLines

protected void generateNRATaxLines(DisbursementVoucherDocument document)
This method generates non-resident alien (NRA) tax lines for the given disbursement voucher. The NRA tax lines consist of three possible sets of tax lines: - Gross up tax lines - Federal tax lines - State tax lines Gross up tax lines are generated if the income tax gross up code is set on the DisbursementVoucherNonResidentAlienTax attribute of the disbursement voucher. Federal tax lines are generated if the federal tax rate in the DisbursementVoucherNonResidentAlienTax attribute is other than zero. State tax lines are generated if the state tax rate in the DisbursementVoucherNonResidentAlienTax attribute is other than zero.

Parameters:
document - The disbursement voucher the NRA tax lines will be added to.
See Also:
org.kuali.kfs.fp.document.service.DisbursementVoucherTaxService#generateNRATaxLines(org.kuali.kfs.fp.document.DisbursementVoucherDocument)

generateTaxAccountingLine

protected AccountingLine generateTaxAccountingLine(DisbursementVoucherDocument document,
                                                   String chart,
                                                   String account,
                                                   String objectCode,
                                                   org.kuali.rice.kns.util.KualiDecimal taxPercent,
                                                   org.kuali.rice.kns.util.KualiDecimal taxableAmount)
Generates an accounting line for the chart, account, object code & tax percentage values given.

Parameters:
document - The disbursement voucher the tax will be applied to.
chart - The chart code to be assigned to the accounting line generated.
account - The account code to be assigned to the accounting line generated.
objectCode - The object code used on the accounting line generated.
taxPercent - The tax rate to be used to calculate the tax amount.
taxableAmount - The total amount that is taxable. This amount is used in conjunction with the tax percent to calculate the amount for the accounting lined being generated.
Returns:
A fully populated AccountingLine instance representing the amount of tax that will be applied to the disbursement voucher provided.

processNonResidentAlienTax

public void processNonResidentAlienTax(DisbursementVoucherDocument document)
This method validates the non-resident alien (NRA) tax information for the document and if the information validates, the NRA tax lines are generated.

Specified by:
processNonResidentAlienTax in interface DisbursementVoucherTaxService
Parameters:
document - The disbursement voucher document the NRA tax information will be validated and the subsequent tax lines generated for.
See Also:
org.kuali.kfs.fp.document.service.DisbursementVoucherTaxService#processNonResidentAlienTax(org.kuali.kfs.fp.document.DisbursementVoucherDocument, java.util.List)

clearNRATaxLines

public void clearNRATaxLines(DisbursementVoucherDocument document)
Removes non-resident alien (NRA) tax lines from the document's accounting lines and updates the check total.

Specified by:
clearNRATaxLines in interface DisbursementVoucherTaxService
Parameters:
document - The disbursement voucher the NRA tax lines will be removed from.

getNonResidentAlienTaxAmount

public org.kuali.rice.kns.util.KualiDecimal getNonResidentAlienTaxAmount(DisbursementVoucherDocument document)
This method retrieves the non-resident alien (NRA) tax amount using the disbursement voucher given to calculate the amount. If the vendor is not a non-resident alien or they are and there is no gross up code set, the amount returned will be zero. If the vendor is a non-resident alien and gross up has been set, the amount is calculated by retrieving all the source accounting lines for the disbursement voucher provided and summing the amounts of all the lines that are NRA tax lines.

Specified by:
getNonResidentAlienTaxAmount in interface DisbursementVoucherTaxService
Parameters:
document - The disbursement voucher the NRA tax line amount will be calculated for.
Returns:
The NRA tax amount applicable to the given disbursement voucher or zero if the voucher does not have any NRA tax lines.
See Also:
DisbursementVoucherTaxService.getNonResidentAlienTaxAmount(org.kuali.kfs.fp.document.DisbursementVoucherDocument)

validateNRATaxInformation

protected boolean validateNRATaxInformation(DisbursementVoucherDocument document)
This method performs a series of validation checks to ensure that the disbursement voucher given contains non-resident alien specific information and non-resident alien tax lines are necessary. The following steps are taken to validate the disbursement voucher given: - Set all percentages (ie. federal, state) to zero if their current value is null. - Call DisbursementVoucherDocumentRule.validateNonResidentAlienInformation to perform more in-depth validation. - The vendor for the disbursement voucher given is a non-resident alien. - No reference document exists for the assigned DisbursementVoucherNonResidentAlienTax attribute of the voucher given. - There is at least one source accounting line to generate the tax line from. - Both the state and federal tax percentages are greater than zero. - The total check amount is not negative. - The total of the accounting lines is not negative. - The total check amount is equal to the total of the accounting lines.

Parameters:
document - The disbursement voucher document to validate the tax lines for.
Returns:
True if the information associated with non-resident alien tax is correct and valid, false otherwise.
See Also:
org.kuali.kfs.fp.document.service.DisbursementVoucherTaxService#validateNRATaxInformation(org.kuali.kfs.fp.document.DisbursementVoucherDocument), org.kuali.kfs.fp.document.validation.impl.DisbursementVoucherDocumentRule#validateNonResidentAlienInformation(DisbursementVoucherDocument)

getNRATaxLineNumbers

public List<Integer> getNRATaxLineNumbers(String taxLineString)
Parses the tax line string given and returns a list of line numbers as Integers.

Specified by:
getNRATaxLineNumbers in interface DisbursementVoucherTaxService
Parameters:
taxLineString - The string to be parsed.
Returns:
A collection of line numbers represented as Integers.

setParameterService

public void setParameterService(org.kuali.rice.kns.service.ParameterService parameterService)
This method sets the parameterService attribute to the value given.

Parameters:
parameterService - The ParameterService to be set.

getBusinessObjectService

public org.kuali.rice.kns.service.BusinessObjectService getBusinessObjectService()
Gets the value of the businessObjectService instance.

Returns:
Returns the businessObjectService.

setBusinessObjectService

public void setBusinessObjectService(org.kuali.rice.kns.service.BusinessObjectService businessObjectService)
This method sets the businessObjectService attribute to the value given.

Parameters:
businessObjectService - The businessObjectService to set.

getMaintenanceDocumentService

public org.kuali.rice.kns.service.MaintenanceDocumentService getMaintenanceDocumentService()
Gets the value of the maintenanceDocumentService instance.

Returns:
Returns the maintenanceDocumentService.

setMaintenanceDocumentService

public void setMaintenanceDocumentService(org.kuali.rice.kns.service.MaintenanceDocumentService maintenanceDocumentService)
This method sets the maintenanceDocumentService attribute to the value given.

Parameters:
maintenanceDocumentService - The maintenanceDocumentService to set.

validateNonResidentAlienInformation

public void validateNonResidentAlienInformation(DisbursementVoucherDocument document)
Validates fields for an alien payment.

Parameters:
document - submitted disbursement voucher document


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