com.met.cptl
Class CptlManager

java.lang.Object
  extended by com.met.cptl.CptlManager
All Implemented Interfaces:
Cptl

public class CptlManager
extends java.lang.Object
implements Cptl


Constructor Summary
CptlManager()
           
 
Method Summary
 CptlResult calcDeductions(EmployeeData empInfo)
          calcDeductions(EmployeeData empInfo) returns a CptlResult object with results of calculated required CRA payroll deductions, including deduction amounts for Canada Pension Plan (CPP), Employment Insurance (EI), and Income Tax (federal and Provincial/Territorial, excluding Quebec).
 int calcIndexedTD1Claim(int TD1BaseClaim, int TD1NoIndexAmount)
          calcIndexedTD1Claim(int TD1BaseClaim, int TD1NoIndexAmount) returns the current year's indexed federal TD1 Claim Amount for the specified previous year TD1 total claim amount (TD1BaseClaim) and non-indexable previous year TD1 claim amount (TD1NoIndexAmount).
 int calcIndexedTD1PClaim(java.lang.String aProv, int TD1PBaseClaim, int TD1PNoIndexAmount)
          calcIndexedTD1PClaim(String aProv, int TD1PBaseClaim, int TD1PNoIndexAmount) returns the current year's indexed provincial/territorial TD1P Claim Amount for the specified province (aProv), previous year TD1P total claim amount (TD1PBaseClaim) and non-indexable previous year TD1P claim amount (TD1PNoIndexAmount).
 com.met.cptl.v2014B.Cptl getCptlInstance(java.util.Date aDate)
          getCptlInstance(Date aDate) returns the applicable 'version' instance of the Cptl class, based on a user-specified payroll payment date as the input parameter.
 java.lang.String getEffDate()
          getEffDate() returns a string value in the ISO 8601 date format YYYY-MM-DD, which indicates the effective date for this version of CptlManager instance.
 int getMaxCPP()
          getMaxCPP() returns an integer value equal to the maximum annual employee CPP deduction for the current taxation year.
 int getMaxCPPearnings()
          getMaxCPPearnings() returns an integer value equal to the maximum annual employee CPP pensionable earnings for the current taxation year.
 int getMaxEI(java.lang.String aProv)
          getMaxEI(String aProv) returns an integer value equal to the maximum annual employee EI deduction for the current taxation year.
 int getMaxEIearnings(java.lang.String aProv)
          getMaxEIearnings(String aProv) returns an integer value equal to the maximum annual employee EI insurable earnings for the current taxation year.
 java.lang.String getStartEffDate()
          getStartEffDate() returns a string value in the ISO 8601 date format YYYY-MM-DD, which indicates the earliest effective date for this CptlManager instance.
 int getTaxYear()
          getTaxYear() returns the taxation year the current CptlManager has been released for.
 int getTD1Claim(int claimCode)
          getTD1Claim(int claimCode) returns the value of the federal TD1 Claim Amount associated with the specified TD1 claim code.
 int getTD1ClaimCode(int TD1_ClaimAmount)
          getTD1ClaimCode(int TD1_ClaimAmount) returns the federal TD1 Claim Code associated with the specified TD1 claim amount.
 int getTD1ClaimRange(int claimCode)
          getTD1ClaimRange(int claimCode) returns the upper value of the federal TD1 Claim Code range associated with the specified TD1 claim code.
 int getTD1PClaim(java.lang.String aProv, int claimCode)
          getTD1PClaim(String aProv, int claimCode) returns the value of the provincial/territorial TD1P Claim Amount associated with the specified province and TD1P claim code.
 int getTD1PClaimCode(java.lang.String aProv, int TD1P_ClaimAmount)
          getTD1PClaimCode(String aProv, int TD1P_ClaimAmount) feturns the provincial/territorial TD1P Claim Code associated with the specified TD1P claim amount.
 int getTD1PClaimRange(java.lang.String aProv, int claimCode)
          getTD1PClaimRange(String aProv, int claimCode) returns the upper value of the provincial/territorial TD1P Claim Code range associated with the specified TD1P claim code.
 java.lang.String getVersion()
          getVersion() returns the version identification string for the current CptlManager instance.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CptlManager

public CptlManager()
Method Detail

getCptlInstance

public com.met.cptl.v2014B.Cptl getCptlInstance(java.util.Date aDate)
                                         throws CptlException
getCptlInstance(Date aDate) returns the applicable 'version' instance of the Cptl class, based on a user-specified payroll payment date as the input parameter.

The Cptl class for each 'version' will expose it's public methods when accessed as an instance created by this CptlManager method.

Use this method when you want to access the public methods of a non-current Cptl versions, e.g. for retrieving a federal TD1 claim amount from a previous taxation year using the Cptl.getTD1Claim method.

Parameters:
aDate - A payroll payment date applicable to the requested Cptl method.
Returns:
Returns the applicable 'version' instance of Cptl class - e.g. com.met.cptl.v2013B
Throws:
CptlException

calcDeductions

public CptlResult calcDeductions(EmployeeData empInfo)
                          throws CptlException
Description copied from interface: Cptl
calcDeductions(EmployeeData empInfo) returns a CptlResult object with results of calculated required CRA payroll deductions, including deduction amounts for Canada Pension Plan (CPP), Employment Insurance (EI), and Income Tax (federal and Provincial/Territorial, excluding Quebec).

Use this method to calculate employee payroll deductions for any payroll date beginning with the current effective date of CptlManager class (use CptlManager.getEffDate() method), and up to December 31 of the current taxation year of CptlManager class (use CptlManager.getTaxYear() method).

Specified by:
calcDeductions in interface Cptl
Parameters:
empInfo - An EmployeeData object containing all the input data related to the requested payroll calculation.
Returns:
CptlResult object with calculated required CRA payroll deductions.
Throws:
CptlException

calcIndexedTD1Claim

public int calcIndexedTD1Claim(int TD1BaseClaim,
                               int TD1NoIndexAmount)
                        throws CptlException
Description copied from interface: Cptl
calcIndexedTD1Claim(int TD1BaseClaim, int TD1NoIndexAmount) returns the current year's indexed federal TD1 Claim Amount for the specified previous year TD1 total claim amount (TD1BaseClaim) and non-indexable previous year TD1 claim amount (TD1NoIndexAmount).

Specified by:
calcIndexedTD1Claim in interface Cptl
Parameters:
TD1BaseClaim - previous year TD1 total claim amount.
TD1NoIndexAmount - previous year non-indexable portion of TD1 total claim amount.
Returns:
Integer value of the calculated indexed TD1 total claim amount for the current taxation year. This value is expressed in whole cents - e.g. value 100.00 will be returned as 10000
Throws:
CptlException

calcIndexedTD1PClaim

public int calcIndexedTD1PClaim(java.lang.String aProv,
                                int TD1PBaseClaim,
                                int TD1PNoIndexAmount)
                         throws CptlException
Description copied from interface: Cptl
calcIndexedTD1PClaim(String aProv, int TD1PBaseClaim, int TD1PNoIndexAmount) returns the current year's indexed provincial/territorial TD1P Claim Amount for the specified province (aProv), previous year TD1P total claim amount (TD1PBaseClaim) and non-indexable previous year TD1P claim amount (TD1PNoIndexAmount).

Specified by:
calcIndexedTD1PClaim in interface Cptl
Parameters:
aProv - 2 character province/territory code: AB = Alberta BC = British Columbia MB = Manitoba NB = New Brunswick NL = Newfoundland/Labrador NT = Northwest Territories NS = Nova Scotia NU = Nunavut ON = Ontario PE = Prince Edward Island QC = Quebec SK = Saskatchewan YT = Yukon NA or OC = Cdn resident outside a province (e.g. Overseas military personnel) NR = Non-resident
TD1PBaseClaim - = previous year TD1P total claim amount.
TD1PNoIndexAmount - = previous year non-indexable portion of TD1P total claim amount.
Returns:
Integer value of the calculated indexed TD1P total claim amount for the current taxation year. This value is expressed in whole cents - e.g. value 100.00 will be returned as 10000
Throws:
CptlException

getEffDate

public java.lang.String getEffDate()
                            throws CptlException
Description copied from interface: Cptl
getEffDate() returns a string value in the ISO 8601 date format YYYY-MM-DD, which indicates the effective date for this version of CptlManager instance. This is the date that the most recent version of Cptl class is effective for, or the date that the current version of CptlManager becomes effective.

Specified by:
getEffDate in interface Cptl
Returns:
String value in the ISO 8601 date format YYYY-MM-DD
Throws:
CptlException

getMaxCPP

public int getMaxCPP()
              throws CptlException
Description copied from interface: Cptl
getMaxCPP() returns an integer value equal to the maximum annual employee CPP deduction for the current taxation year.

Specified by:
getMaxCPP in interface Cptl
Returns:
Integer value equal to the maximum annual employee CPP deduction for the current taxation year. This value is expressed in whole cents - e.g. value 100.00 will be returned as 10000
Throws:
CptlException

getMaxCPPearnings

public int getMaxCPPearnings()
                      throws CptlException
Description copied from interface: Cptl
getMaxCPPearnings() returns an integer value equal to the maximum annual employee CPP pensionable earnings for the current taxation year.

Specified by:
getMaxCPPearnings in interface Cptl
Returns:
Integer value equal to the maximum annual employee CPP pensionable earnings for the current taxation year. This value is expressed in whole cents - e.g. value 100.00 will be returned as 10000
Throws:
CptlException

getMaxEI

public int getMaxEI(java.lang.String aProv)
             throws CptlException
Description copied from interface: Cptl
getMaxEI(String aProv) returns an integer value equal to the maximum annual employee EI deduction for the current taxation year.

Specified by:
getMaxEI in interface Cptl
Parameters:
aProv - 2 character province/territory code: AB = Alberta BC = British Columbia MB = Manitoba NB = New Brunswick NL = Newfoundland/Labrador NT = Northwest Territories NS = Nova Scotia NU = Nunavut ON = Ontario PE = Prince Edward Island QC = Quebec SK = Saskatchewan YT = Yukon NA or OC = Cdn resident outside a province (e.g. Overseas military personnel) NR = Non-resident
Returns:
Integer value equal to the maximum annual employee EI deduction for the current taxation year. This value is expressed in whole cents - e.g. value 100.00 will be returned as 10000
Throws:
CptlException

getMaxEIearnings

public int getMaxEIearnings(java.lang.String aProv)
                     throws CptlException
Description copied from interface: Cptl
getMaxEIearnings(String aProv) returns an integer value equal to the maximum annual employee EI insurable earnings for the current taxation year.

Specified by:
getMaxEIearnings in interface Cptl
Parameters:
aProv - 2 character province/territory code: AB = Alberta BC = British Columbia MB = Manitoba NB = New Brunswick NL = Newfoundland/Labrador NT = Northwest Territories NS = Nova Scotia NU = Nunavut ON = Ontario PE = Prince Edward Island QC = Quebec SK = Saskatchewan YT = Yukon NA or OC = Cdn resident outside a province (e.g. Overseas military personnel) NR = Non-resident
Returns:
Integer value equal to the maximum annual employee EI insurable earnings for the current taxation year. This value is expressed in whole cents - e.g. value 100.00 will be returned as 10000
Throws:
CptlException

getStartEffDate

public java.lang.String getStartEffDate()
                                 throws CptlException
getStartEffDate() returns a string value in the ISO 8601 date format YYYY-MM-DD, which indicates the earliest effective date for this CptlManager instance. This is the earliest payroll payment date that the CptlManager.calcDeductions() method can be used for a payroll deduction calculation.

Returns:
String value in the ISO 8601 date format YYYY-MM-DD
Throws:
CptlException

getTD1Claim

public int getTD1Claim(int claimCode)
                throws CptlException
Description copied from interface: Cptl
getTD1Claim(int claimCode) returns the value of the federal TD1 Claim Amount associated with the specified TD1 claim code.

Specified by:
getTD1Claim in interface Cptl
Parameters:
claimCode - The TD1 claim code. Valid values: 0-10. Use claimCode = 1 to obtain the default Basic Federal Claim Amount.
Returns:
Integer value of the federal TD1 Claim Amount rounded to the nearest penny. This value is expressed in whole cents - e.g. the value 11138.00 will be returned as 1113800
Throws:
CptlException

getTD1ClaimCode

public int getTD1ClaimCode(int TD1_ClaimAmount)
                    throws CptlException
Description copied from interface: Cptl
getTD1ClaimCode(int TD1_ClaimAmount) returns the federal TD1 Claim Code associated with the specified TD1 claim amount.

Specified by:
getTD1ClaimCode in interface Cptl
Parameters:
TD1_ClaimAmount - The federal TD1 claim amount rounded to the nearest whole penny Ð e.g. the value 11138.00 should be passed as 1113800
Returns:
Integer value of the federal TD1 Claim Code (0-10).
Throws:
CptlException

getTD1ClaimRange

public int getTD1ClaimRange(int claimCode)
                     throws CptlException
Description copied from interface: Cptl
getTD1ClaimRange(int claimCode) returns the upper value of the federal TD1 Claim Code range associated with the specified TD1 claim code.

Specified by:
getTD1ClaimRange in interface Cptl
Parameters:
claimCode - The TD1 claim code. Valid values: 0-10. Use claimCode = 1 to obtain the default Basic Federal Claim Amount.
Returns:
Integer value of the federal TD1 Claim Amount rounded to the nearest penny. This value is expressed in whole cents - e.g. the value 11138.00 will be returned as 1113800
Throws:
CptlException

getTD1PClaim

public int getTD1PClaim(java.lang.String aProv,
                        int claimCode)
                 throws CptlException
Description copied from interface: Cptl
getTD1PClaim(String aProv, int claimCode) returns the value of the provincial/territorial TD1P Claim Amount associated with the specified province and TD1P claim code.

Specified by:
getTD1PClaim in interface Cptl
Parameters:
aProv - 2 character province/territory code: AB = Alberta BC = British Columbia MB = Manitoba NB = New Brunswick NL = Newfoundland/Labrador NT = Northwest Territories NS = Nova Scotia NU = Nunavut ON = Ontario PE = Prince Edward Island QC = Quebec SK = Saskatchewan YT = Yukon NA or OC = Cdn resident outside a province (e.g. Overseas military personnel) NR = Non-resident
claimCode - The TD1P claim code. Valid values: 0-10. Use claimCode = 1 to obtain the default Basic Provincial/Territorial Claim Amount.
Returns:
Integer value of the provincial/territorial TD1P Claim Amount rounded to the nearest penny. This value is expressed in whole cents - e.g. the value 9670.00 will be returned as 967000
Throws:
CptlException

getTD1PClaimCode

public int getTD1PClaimCode(java.lang.String aProv,
                            int TD1P_ClaimAmount)
                     throws CptlException
Description copied from interface: Cptl
getTD1PClaimCode(String aProv, int TD1P_ClaimAmount) feturns the provincial/territorial TD1P Claim Code associated with the specified TD1P claim amount.

Specified by:
getTD1PClaimCode in interface Cptl
Parameters:
aProv - 2 character province/territory code: AB = Alberta BC = British Columbia MB = Manitoba NB = New Brunswick NL = Newfoundland/Labrador NT = Northwest Territories NS = Nova Scotia NU = Nunavut ON = Ontario PE = Prince Edward Island QC = Quebec SK = Saskatchewan YT = Yukon NA or OC = Cdn resident outside a province (e.g. Overseas military personnel) NR = Non-resident
TD1P_ClaimAmount - The provincial/territorial TD1P claim amount rounded to the nearest whole penny Ð e.g. the value 9670.00 should be passed as 967000
Returns:
Integer value of the provincial/territorial TD1P Claim Code (0-10).
Throws:
CptlException

getTD1PClaimRange

public int getTD1PClaimRange(java.lang.String aProv,
                             int claimCode)
                      throws CptlException
Description copied from interface: Cptl
getTD1PClaimRange(String aProv, int claimCode) returns the upper value of the provincial/territorial TD1P Claim Code range associated with the specified TD1P claim code.

Specified by:
getTD1PClaimRange in interface Cptl
claimCode - The TD1P claim code. Valid values: 0-10. Use claimCode = 1 to obtain the default Basic Provincial/Territorial Claim Amount.
Returns:
Integer value of the provincial/territorial TD1P Claim Amount rounded to the nearest penny. This value is expressed in whole cents - e.g. the value 9670.00 will be returned as 967000
Throws:
CptlException

getTaxYear

public int getTaxYear()
               throws CptlException
Description copied from interface: Cptl
getTaxYear() returns the taxation year the current CptlManager has been released for. The library cannot be used for payroll dates that are after this year.

Specified by:
getTaxYear in interface Cptl
Returns:
Integer value equal to calendar taxation year
Throws:
CptlException

getVersion

public java.lang.String getVersion()
                            throws CptlException
Description copied from interface: Cptl
getVersion() returns the version identification string for the current CptlManager instance. The version string has the following format: CPTLW.yyyyX.Y.Z, where: yyyy = calendar tax year X = tax year update identifier (A = Jan 1; B = Jul 1) Y = major release number (is used for major updates) Z = minor release number (is used for minor updates/bug fixes)

Specified by:
getVersion in interface Cptl
Returns:
Version identification string for the current CptlManager() instance.
Throws:
CptlException