company_id = PRIMARY_COMPANY_ID; TTDate::setTimeZone( 'Etc/GMT+8' ); //Force to non-DST timezone. 'PST' isnt actually valid. } public function tearDown(): void { Debug::text( 'Running tearDown(): ', __FILE__, __LINE__, __METHOD__, 10 ); } public function mf( $amount ) { return Misc::MoneyRound( $amount ); } // // July 2008 // // // BC - Provincial Taxes // function testBC_2008b_BiWeekly_Claim1_MedIncome() { Debug::text( 'BC - BiWeekly - Beginning of 2008 01-Jan-08: ', __FILE__, __LINE__, __METHOD__, 10 ); $pd_obj = new PayrollDeduction( 'CA', 'BC' ); $pd_obj->setDate( strtotime( '01-Jul-08' ) ); $pd_obj->setEnableCPPAndEIDeduction( true ); //Deduct CPP/EI. $pd_obj->setAnnualPayPeriods( 26 ); $pd_obj->setFederalTotalClaimAmount( 9600 ); $pd_obj->setProvincialTotalClaimAmount( 9189 ); $pd_obj->setWCBRate( 0.18 ); $pd_obj->setEIExempt( false ); $pd_obj->setCPPExempt( false ); $pd_obj->setFederalTaxExempt( false ); $pd_obj->setProvincialTaxExempt( false ); $pd_obj->setYearToDateCPPContribution( 0 ); $pd_obj->setYearToDateEIContribution( 0 ); $pd_obj->setGrossPayPeriodIncome( 2774.00 ); $this->assertEquals( '2774.00', $this->mf( $pd_obj->getGrossPayPeriodIncome() ) ); Debug::text( 'Prov Ded: ' . $pd_obj->getProvincialPayPeriodDeductions(), __FILE__, __LINE__, __METHOD__, 10 ); $this->assertEquals( '159.15', $this->mf( $pd_obj->getProvincialPayPeriodDeductions() ) ); } function testBC_2008b_BiWeekly_Claim5_MedIncome() { Debug::text( 'BC - BiWeekly - Beginning of 2008 01-Jan-08: ', __FILE__, __LINE__, __METHOD__, 10 ); $pd_obj = new PayrollDeduction( 'CA', 'BC' ); $pd_obj->setDate( strtotime( '01-Jul-08' ) ); $pd_obj->setEnableCPPAndEIDeduction( true ); //Deduct CPP/EI. $pd_obj->setAnnualPayPeriods( 26 ); $pd_obj->setFederalTotalClaimAmount( 9600 ); $pd_obj->setProvincialTotalClaimAmount( 16427.01 ); $pd_obj->setWCBRate( 0.18 ); $pd_obj->setEIExempt( false ); $pd_obj->setCPPExempt( false ); $pd_obj->setFederalTaxExempt( false ); $pd_obj->setProvincialTaxExempt( false ); $pd_obj->setYearToDateCPPContribution( 0 ); $pd_obj->setYearToDateEIContribution( 0 ); $pd_obj->setGrossPayPeriodIncome( 2774.00 ); $this->assertEquals( '2774.00', $this->mf( $pd_obj->getGrossPayPeriodIncome() ) ); Debug::text( 'Prov Ded: ' . $pd_obj->getProvincialPayPeriodDeductions(), __FILE__, __LINE__, __METHOD__, 10 ); $this->assertEquals( '144.87', $this->mf( $pd_obj->getProvincialPayPeriodDeductions() ) ); } // // January 2008 // function testCA_2008a_BasicClaimAmount() { Debug::text( 'CA - BiWeekly - Beginning of 2008 01-Jan-08: ', __FILE__, __LINE__, __METHOD__, 10 ); $pd_obj = new PayrollDeduction( 'CA', 'BC' ); $pd_obj->setDate( strtotime( '01-Jan-08' ) ); $pd_obj->setEnableCPPAndEIDeduction( true ); //Deduct CPP/EI. $pd_obj->setAnnualPayPeriods( 26 ); $pd_obj->setFederalTotalClaimAmount( 8128 ); //Amount from 2005, Should use amount from 2007 automatically. $pd_obj->setProvincialTotalClaimAmount( 8858 ); $pd_obj->setWCBRate( 0.18 ); $pd_obj->setEIExempt( false ); $pd_obj->setCPPExempt( false ); $pd_obj->setFederalTaxExempt( false ); $pd_obj->setProvincialTaxExempt( false ); $pd_obj->setYearToDateCPPContribution( 0 ); $pd_obj->setYearToDateEIContribution( 0 ); $pd_obj->setGrossPayPeriodIncome( 2770.00 ); //var_dump($pd_obj->getArray()); $this->assertEquals( '2770.00', $this->mf( $pd_obj->getGrossPayPeriodIncome() ) ); $this->assertEquals( '430.21', $this->mf( $pd_obj->getFederalPayPeriodDeductions() ) ); $this->assertEquals( '165.26', $this->mf( $pd_obj->getProvincialPayPeriodDeductions() ) ); } function testCA_2008a_BasicClaimAmountB() { Debug::text( 'CA - BiWeekly - Beginning of 2008 01-Jan-08: ', __FILE__, __LINE__, __METHOD__, 10 ); $pd_obj = new PayrollDeduction( 'CA', 'BC' ); $pd_obj->setDate( strtotime( '01-Jan-08' ) ); $pd_obj->setEnableCPPAndEIDeduction( true ); //Deduct CPP/EI. $pd_obj->setAnnualPayPeriods( 26 ); $pd_obj->setFederalTotalClaimAmount( 9600 ); $pd_obj->setProvincialTotalClaimAmount( 9189 ); $pd_obj->setWCBRate( 0.18 ); $pd_obj->setEIExempt( false ); $pd_obj->setCPPExempt( false ); $pd_obj->setFederalTaxExempt( false ); $pd_obj->setProvincialTaxExempt( false ); $pd_obj->setYearToDateCPPContribution( 0 ); $pd_obj->setYearToDateEIContribution( 0 ); $pd_obj->setGrossPayPeriodIncome( 2770.00 ); //var_dump($pd_obj->getArray()); $this->assertEquals( '2770.00', $this->mf( $pd_obj->getGrossPayPeriodIncome() ) ); $this->assertEquals( '430.21', $this->mf( $pd_obj->getFederalPayPeriodDeductions() ) ); $this->assertEquals( '165.26', $this->mf( $pd_obj->getProvincialPayPeriodDeductions() ) ); } function testCA_2008a_BiWeekly_Claim1_LowIncome() { Debug::text( 'CA - BiWeekly - Beginning of 2008 01-Jan-08: ', __FILE__, __LINE__, __METHOD__, 10 ); $pd_obj = new PayrollDeduction( 'CA', 'BC' ); $pd_obj->setDate( strtotime( '01-Jan-08' ) ); $pd_obj->setEnableCPPAndEIDeduction( true ); //Deduct CPP/EI. $pd_obj->setAnnualPayPeriods( 26 ); $pd_obj->setFederalTotalClaimAmount( 9600 ); $pd_obj->setProvincialTotalClaimAmount( 0 ); $pd_obj->setWCBRate( 0.18 ); $pd_obj->setEIExempt( false ); $pd_obj->setCPPExempt( false ); $pd_obj->setFederalTaxExempt( false ); $pd_obj->setProvincialTaxExempt( false ); $pd_obj->setYearToDateCPPContribution( 0 ); $pd_obj->setYearToDateEIContribution( 0 ); $pd_obj->setGrossPayPeriodIncome( 589.00 ); //var_dump($pd_obj->getArray()); $this->assertEquals( '589.00', $this->mf( $pd_obj->getGrossPayPeriodIncome() ) ); $this->assertEquals( '22.18', $this->mf( $pd_obj->getFederalPayPeriodDeductions() ) ); } function testCA_2008a_BiWeekly_Claim1_MedIncome() { Debug::text( 'CA - BiWeekly - Beginning of 2008 01-Jan-08: ', __FILE__, __LINE__, __METHOD__, 10 ); $pd_obj = new PayrollDeduction( 'CA', 'BC' ); $pd_obj->setDate( strtotime( '01-Jan-08' ) ); $pd_obj->setEnableCPPAndEIDeduction( true ); //Deduct CPP/EI. $pd_obj->setAnnualPayPeriods( 26 ); $pd_obj->setFederalTotalClaimAmount( 9600 ); $pd_obj->setProvincialTotalClaimAmount( 0 ); $pd_obj->setWCBRate( 0.18 ); $pd_obj->setEIExempt( false ); $pd_obj->setCPPExempt( false ); $pd_obj->setFederalTaxExempt( false ); $pd_obj->setProvincialTaxExempt( false ); $pd_obj->setYearToDateCPPContribution( 0 ); $pd_obj->setYearToDateEIContribution( 0 ); $pd_obj->setGrossPayPeriodIncome( 2407.00 ); $this->assertEquals( '2407.00', $this->mf( $pd_obj->getGrossPayPeriodIncome() ) ); $this->assertEquals( '350.35', $this->mf( $pd_obj->getFederalPayPeriodDeductions() ) ); } function testCA_2008a_BiWeekly_Claim1_HighIncome() { Debug::text( 'CA - BiWeekly - Beginning of 2008 01-Jan-08: ', __FILE__, __LINE__, __METHOD__, 10 ); $pd_obj = new PayrollDeduction( 'CA', 'BC' ); $pd_obj->setDate( strtotime( '01-Jan-08' ) ); $pd_obj->setEnableCPPAndEIDeduction( true ); //Deduct CPP/EI. $pd_obj->setAnnualPayPeriods( 26 ); $pd_obj->setFederalTotalClaimAmount( 9600 ); $pd_obj->setProvincialTotalClaimAmount( 0 ); $pd_obj->setWCBRate( 0.18 ); $pd_obj->setEIExempt( false ); $pd_obj->setCPPExempt( false ); $pd_obj->setFederalTaxExempt( false ); $pd_obj->setProvincialTaxExempt( false ); $pd_obj->setYearToDateCPPContribution( 0 ); $pd_obj->setYearToDateEIContribution( 0 ); $pd_obj->setGrossPayPeriodIncome( 7199.00 ); $this->assertEquals( '7199.00', $this->mf( $pd_obj->getGrossPayPeriodIncome() ) ); $this->assertEquals( '1649.83', $this->mf( $pd_obj->getFederalPayPeriodDeductions() ) ); } function testCA_2008a_BiWeekly_Claim5_LowIncome() { Debug::text( 'CA - BiWeekly - Beginning of 2008 01-Jan-08: ', __FILE__, __LINE__, __METHOD__, 10 ); $pd_obj = new PayrollDeduction( 'CA', 'BC' ); $pd_obj->setDate( strtotime( '01-Jan-08' ) ); $pd_obj->setEnableCPPAndEIDeduction( true ); //Deduct CPP/EI. $pd_obj->setAnnualPayPeriods( 26 ); $pd_obj->setFederalTotalClaimAmount( 16334.01 ); //Claim Code5 midpoint $pd_obj->setProvincialTotalClaimAmount( 0 ); $pd_obj->setWCBRate( 0.18 ); $pd_obj->setEIExempt( false ); $pd_obj->setCPPExempt( false ); $pd_obj->setFederalTaxExempt( false ); $pd_obj->setProvincialTaxExempt( false ); $pd_obj->setYearToDateCPPContribution( 0 ); $pd_obj->setYearToDateEIContribution( 0 ); $pd_obj->setGrossPayPeriodIncome( 815.00 ); $this->assertEquals( '815.00', $this->mf( $pd_obj->getGrossPayPeriodIncome() ) ); $this->assertEquals( '14.97', $this->mf( $pd_obj->getFederalPayPeriodDeductions() ) ); } function testCA_2008a_BiWeekly_Claim5_HighIncome() { Debug::text( 'CA - BiWeekly - Beginning of 2008 01-Jan-08: ', __FILE__, __LINE__, __METHOD__, 10 ); $pd_obj = new PayrollDeduction( 'CA', 'BC' ); $pd_obj->setDate( strtotime( '01-Jan-08' ) ); $pd_obj->setEnableCPPAndEIDeduction( true ); //Deduct CPP/EI. $pd_obj->setAnnualPayPeriods( 26 ); $pd_obj->setFederalTotalClaimAmount( 16334.01 ); //Claim Code5 $pd_obj->setProvincialTotalClaimAmount( 0 ); $pd_obj->setWCBRate( 0.18 ); $pd_obj->setEIExempt( false ); $pd_obj->setCPPExempt( false ); $pd_obj->setFederalTaxExempt( false ); $pd_obj->setProvincialTaxExempt( false ); $pd_obj->setYearToDateCPPContribution( 0 ); $pd_obj->setYearToDateEIContribution( 0 ); $pd_obj->setGrossPayPeriodIncome( 7199.00 ); $this->assertEquals( '7199.00', $this->mf( $pd_obj->getGrossPayPeriodIncome() ) ); $this->assertEquals( '1610.98', $this->mf( $pd_obj->getFederalPayPeriodDeductions() ) ); } function testCA_2008a_SemiMonthly_Claim1_LowIncome() { Debug::text( 'CA - SemiMonthly - Beginning of 2008 01-Jan-08: ', __FILE__, __LINE__, __METHOD__, 10 ); $pd_obj = new PayrollDeduction( 'CA', 'BC' ); $pd_obj->setDate( strtotime( '01-Jan-08' ) ); $pd_obj->setEnableCPPAndEIDeduction( true ); //Deduct CPP/EI. $pd_obj->setAnnualPayPeriods( 24 ); $pd_obj->setFederalTotalClaimAmount( 9600 ); $pd_obj->setProvincialTotalClaimAmount( 0 ); $pd_obj->setWCBRate( 0.18 ); $pd_obj->setEIExempt( false ); $pd_obj->setCPPExempt( false ); $pd_obj->setFederalTaxExempt( false ); $pd_obj->setProvincialTaxExempt( false ); $pd_obj->setYearToDateCPPContribution( 0 ); $pd_obj->setYearToDateEIContribution( 0 ); $pd_obj->setGrossPayPeriodIncome( 615.00 ); $this->assertEquals( '615.00', $this->mf( $pd_obj->getGrossPayPeriodIncome() ) ); $this->assertEquals( '20.80', $this->mf( $pd_obj->getFederalPayPeriodDeductions() ) ); //One penny off } function testCA_2008a_SemiMonthly_Claim1_MedIncome() { Debug::text( 'CA - SemiMonthly - Beginning of 2008 01-Jan-08: ', __FILE__, __LINE__, __METHOD__, 10 ); $pd_obj = new PayrollDeduction( 'CA', 'BC' ); $pd_obj->setDate( strtotime( '01-Jan-08' ) ); $pd_obj->setEnableCPPAndEIDeduction( true ); //Deduct CPP/EI. $pd_obj->setAnnualPayPeriods( 24 ); $pd_obj->setFederalTotalClaimAmount( 9600 ); $pd_obj->setProvincialTotalClaimAmount( 0 ); $pd_obj->setWCBRate( 0.18 ); $pd_obj->setEIExempt( false ); $pd_obj->setCPPExempt( false ); $pd_obj->setFederalTaxExempt( false ); $pd_obj->setProvincialTaxExempt( false ); $pd_obj->setYearToDateCPPContribution( 0 ); $pd_obj->setYearToDateEIContribution( 0 ); $pd_obj->setGrossPayPeriodIncome( 2720.00 ); $this->assertEquals( '2720.00', $this->mf( $pd_obj->getGrossPayPeriodIncome() ) ); $this->assertEquals( '404.28', $this->mf( $pd_obj->getFederalPayPeriodDeductions() ) ); //One penny off } function testCA_2008a_SemiMonthly_Claim1_HighIncome() { Debug::text( 'CA - SemiMonthly - Beginning of 2008 01-Jan-08: ', __FILE__, __LINE__, __METHOD__, 10 ); $pd_obj = new PayrollDeduction( 'CA', 'BC' ); $pd_obj->setDate( strtotime( '01-Jan-08' ) ); $pd_obj->setEnableCPPAndEIDeduction( true ); //Deduct CPP/EI. $pd_obj->setAnnualPayPeriods( 24 ); $pd_obj->setFederalTotalClaimAmount( 9600 ); $pd_obj->setProvincialTotalClaimAmount( 0 ); $pd_obj->setWCBRate( 0.18 ); $pd_obj->setEIExempt( false ); $pd_obj->setCPPExempt( false ); $pd_obj->setFederalTaxExempt( false ); $pd_obj->setProvincialTaxExempt( false ); $pd_obj->setYearToDateCPPContribution( 0 ); $pd_obj->setYearToDateEIContribution( 0 ); $pd_obj->setGrossPayPeriodIncome( 7781.00 ); $this->assertEquals( '7781.00', $this->mf( $pd_obj->getGrossPayPeriodIncome() ) ); $this->assertEquals( '1782.12', $this->mf( $pd_obj->getFederalPayPeriodDeductions() ) ); //One penny off } // // CPP/ EI // function testCA_2008a_BiWeekly_CPP_LowIncome() { Debug::text( 'CA - BiWeekly - CPP - Beginning of 2008 01-Jan-08: ', __FILE__, __LINE__, __METHOD__, 10 ); $pd_obj = new PayrollDeduction( 'CA', 'BC' ); $pd_obj->setDate( strtotime( '01-Jan-08' ) ); $pd_obj->setEnableCPPAndEIDeduction( true ); //Deduct CPP/EI. $pd_obj->setAnnualPayPeriods( 26 ); $pd_obj->setFederalTotalClaimAmount( 9600 ); $pd_obj->setProvincialTotalClaimAmount( 0 ); $pd_obj->setWCBRate( 0.18 ); $pd_obj->setEIExempt( false ); $pd_obj->setCPPExempt( false ); $pd_obj->setFederalTaxExempt( false ); $pd_obj->setProvincialTaxExempt( false ); $pd_obj->setYearToDateCPPContribution( 0 ); $pd_obj->setYearToDateEIContribution( 0 ); $pd_obj->setGrossPayPeriodIncome( 585.32 ); $this->assertEquals( '585.32', $this->mf( $pd_obj->getGrossPayPeriodIncome() ) ); $this->assertEquals( '22.31', $this->mf( $pd_obj->getEmployeeCPP() ) ); $this->assertEquals( '22.31', $this->mf( $pd_obj->getEmployerCPP() ) ); } function testCA_2008a_SemiMonthly_CPP_LowIncome() { Debug::text( 'CA - BiWeekly - CPP - Beginning of 2008 01-Jan-08: ', __FILE__, __LINE__, __METHOD__, 10 ); $pd_obj = new PayrollDeduction( 'CA', 'BC' ); $pd_obj->setDate( strtotime( '01-Jan-08' ) ); $pd_obj->setEnableCPPAndEIDeduction( true ); //Deduct CPP/EI. $pd_obj->setAnnualPayPeriods( 24 ); $pd_obj->setFederalTotalClaimAmount( 9600 ); $pd_obj->setProvincialTotalClaimAmount( 0 ); $pd_obj->setWCBRate( 0.18 ); $pd_obj->setEIExempt( false ); $pd_obj->setCPPExempt( false ); $pd_obj->setFederalTaxExempt( false ); $pd_obj->setProvincialTaxExempt( false ); $pd_obj->setYearToDateCPPContribution( 0 ); $pd_obj->setYearToDateEIContribution( 0 ); $pd_obj->setGrossPayPeriodIncome( 585.23 ); $this->assertEquals( '585.23', $this->mf( $pd_obj->getGrossPayPeriodIncome() ) ); $this->assertEquals( '21.75', $this->mf( $pd_obj->getEmployeeCPP() ) ); $this->assertEquals( '21.75', $this->mf( $pd_obj->getEmployerCPP() ) ); } function testCA_2008a_EI_LowIncome() { Debug::text( 'CA - EI - Beginning of 2008 01-Jan-08: ', __FILE__, __LINE__, __METHOD__, 10 ); $pd_obj = new PayrollDeduction( 'CA', 'BC' ); $pd_obj->setDate( strtotime( '01-Jan-08' ) ); $pd_obj->setEnableCPPAndEIDeduction( true ); //Deduct CPP/EI. $pd_obj->setAnnualPayPeriods( 26 ); $pd_obj->setFederalTotalClaimAmount( 9600 ); $pd_obj->setProvincialTotalClaimAmount( 0 ); $pd_obj->setWCBRate( 0.18 ); $pd_obj->setEIExempt( false ); $pd_obj->setCPPExempt( false ); $pd_obj->setFederalTaxExempt( false ); $pd_obj->setProvincialTaxExempt( false ); $pd_obj->setYearToDateCPPContribution( 0 ); $pd_obj->setYearToDateEIContribution( 0 ); $pd_obj->setGrossPayPeriodIncome( 587.76 ); //var_dump($pd_obj->getArray()); $this->assertEquals( '587.76', $this->mf( $pd_obj->getGrossPayPeriodIncome() ) ); $this->assertEquals( '10.17', $this->mf( $pd_obj->getEmployeeEI() ) ); $this->assertEquals( '14.24', $this->mf( $pd_obj->getEmployerEI() ) ); } // // BC - Provincial Taxes // function testBC_2008a_BiWeekly_Claim1_MedIncome() { Debug::text( 'BC - BiWeekly - Beginning of 2008 01-Jan-08: ', __FILE__, __LINE__, __METHOD__, 10 ); $pd_obj = new PayrollDeduction( 'CA', 'BC' ); $pd_obj->setDate( strtotime( '01-Jan-08' ) ); $pd_obj->setEnableCPPAndEIDeduction( true ); //Deduct CPP/EI. $pd_obj->setAnnualPayPeriods( 26 ); $pd_obj->setFederalTotalClaimAmount( 9600 ); $pd_obj->setProvincialTotalClaimAmount( 9189 ); $pd_obj->setWCBRate( 0.18 ); $pd_obj->setEIExempt( false ); $pd_obj->setCPPExempt( false ); $pd_obj->setFederalTaxExempt( false ); $pd_obj->setProvincialTaxExempt( false ); $pd_obj->setYearToDateCPPContribution( 0 ); $pd_obj->setYearToDateEIContribution( 0 ); $pd_obj->setGrossPayPeriodIncome( 2774.00 ); $this->assertEquals( '2774.00', $this->mf( $pd_obj->getGrossPayPeriodIncome() ) ); Debug::text( 'Prov Ded: ' . $pd_obj->getProvincialPayPeriodDeductions(), __FILE__, __LINE__, __METHOD__, 10 ); $this->assertEquals( '165.68', $this->mf( $pd_obj->getProvincialPayPeriodDeductions() ) ); } function testBC_2008a_BiWeekly_Claim5_MedIncome() { Debug::text( 'BC - BiWeekly - Beginning of 2008 01-Jan-08: ', __FILE__, __LINE__, __METHOD__, 10 ); $pd_obj = new PayrollDeduction( 'CA', 'BC' ); $pd_obj->setDate( strtotime( '01-Jan-08' ) ); $pd_obj->setEnableCPPAndEIDeduction( true ); //Deduct CPP/EI. $pd_obj->setAnnualPayPeriods( 26 ); $pd_obj->setFederalTotalClaimAmount( 9600 ); $pd_obj->setProvincialTotalClaimAmount( 16427.01 ); $pd_obj->setWCBRate( 0.18 ); $pd_obj->setEIExempt( false ); $pd_obj->setCPPExempt( false ); $pd_obj->setFederalTaxExempt( false ); $pd_obj->setProvincialTaxExempt( false ); $pd_obj->setYearToDateCPPContribution( 0 ); $pd_obj->setYearToDateEIContribution( 0 ); $pd_obj->setGrossPayPeriodIncome( 2774.00 ); $this->assertEquals( '2774.00', $this->mf( $pd_obj->getGrossPayPeriodIncome() ) ); Debug::text( 'Prov Ded: ' . $pd_obj->getProvincialPayPeriodDeductions(), __FILE__, __LINE__, __METHOD__, 10 ); $this->assertEquals( '150.79', $this->mf( $pd_obj->getProvincialPayPeriodDeductions() ) ); } // // AB - Provincial Taxes // function testAB_2008a_BiWeekly_Claim0_LowIncome() { Debug::text( 'AB - BiWeekly - Beginning of 2008 01-Jan-08: ', __FILE__, __LINE__, __METHOD__, 10 ); $pd_obj = new PayrollDeduction( 'CA', 'AB' ); $pd_obj->setDate( strtotime( '01-Jan-08' ) ); $pd_obj->setEnableCPPAndEIDeduction( true ); //Deduct CPP/EI. $pd_obj->setAnnualPayPeriods( 26 ); $pd_obj->setFederalTotalClaimAmount( 9600 ); $pd_obj->setProvincialTotalClaimAmount( 0 ); $pd_obj->setWCBRate( 0.18 ); $pd_obj->setEIExempt( false ); $pd_obj->setCPPExempt( false ); $pd_obj->setFederalTaxExempt( false ); $pd_obj->setProvincialTaxExempt( false ); $pd_obj->setYearToDateCPPContribution( 0 ); $pd_obj->setYearToDateEIContribution( 0 ); $pd_obj->setGrossPayPeriodIncome( 1422.00 ); Debug::text( 'Fed Ded: ' . $pd_obj->getFederalPayPeriodDeductions(), __FILE__, __LINE__, __METHOD__, 10 ); Debug::text( 'Prov Ded: ' . $pd_obj->getProvincialPayPeriodDeductions(), __FILE__, __LINE__, __METHOD__, 10 ); $this->assertEquals( '1422.00', $this->mf( $pd_obj->getGrossPayPeriodIncome() ) ); $this->assertEquals( '133.37', $this->mf( $pd_obj->getProvincialPayPeriodDeductions() ) ); //133.37 } function testAB_2008a_BiWeekly_Claim1_LowIncome() { Debug::text( 'AB - BiWeekly - Beginning of 2008 01-Jan-08: ', __FILE__, __LINE__, __METHOD__, 10 ); $pd_obj = new PayrollDeduction( 'CA', 'AB' ); $pd_obj->setDate( strtotime( '01-Jan-08' ) ); $pd_obj->setEnableCPPAndEIDeduction( true ); //Deduct CPP/EI. $pd_obj->setAnnualPayPeriods( 26 ); $pd_obj->setFederalTotalClaimAmount( 9600 ); $pd_obj->setProvincialTotalClaimAmount( 16161 ); $pd_obj->setWCBRate( 0.18 ); $pd_obj->setEIExempt( false ); $pd_obj->setCPPExempt( false ); $pd_obj->setFederalTaxExempt( false ); $pd_obj->setProvincialTaxExempt( false ); $pd_obj->setYearToDateCPPContribution( 0 ); $pd_obj->setYearToDateEIContribution( 0 ); $pd_obj->setGrossPayPeriodIncome( 1422.00 ); Debug::text( 'Fed Ded: ' . $pd_obj->getFederalPayPeriodDeductions(), __FILE__, __LINE__, __METHOD__, 10 ); Debug::text( 'Prov Ded: ' . $pd_obj->getProvincialPayPeriodDeductions(), __FILE__, __LINE__, __METHOD__, 10 ); $this->assertEquals( '1422.00', $this->mf( $pd_obj->getGrossPayPeriodIncome() ) ); $this->assertEquals( '71.21', $this->mf( $pd_obj->getProvincialPayPeriodDeductions() ) ); //Should be 71.21 } function testAB_2008a_BiWeekly_Claim5_LowIncome() { Debug::text( 'AB - BiWeekly - Beginning of 2008 01-Jan-08: ', __FILE__, __LINE__, __METHOD__, 10 ); $pd_obj = new PayrollDeduction( 'CA', 'AB' ); $pd_obj->setDate( strtotime( '01-Jan-08' ) ); $pd_obj->setEnableCPPAndEIDeduction( true ); //Deduct CPP/EI. $pd_obj->setAnnualPayPeriods( 26 ); $pd_obj->setFederalTotalClaimAmount( 9600 ); $pd_obj->setProvincialTotalClaimAmount( 24435 ); $pd_obj->setWCBRate( 0.18 ); $pd_obj->setEIExempt( false ); $pd_obj->setCPPExempt( false ); $pd_obj->setFederalTaxExempt( false ); $pd_obj->setProvincialTaxExempt( false ); $pd_obj->setYearToDateCPPContribution( 0 ); $pd_obj->setYearToDateEIContribution( 0 ); $pd_obj->setGrossPayPeriodIncome( 1422.00 ); Debug::text( 'Prov Ded: ' . $pd_obj->getProvincialPayPeriodDeductions(), __FILE__, __LINE__, __METHOD__, 10 ); $this->assertEquals( '1422.00', $this->mf( $pd_obj->getGrossPayPeriodIncome() ) ); $this->assertEquals( '39.39', $this->mf( $pd_obj->getProvincialPayPeriodDeductions() ) ); //Should be 39.39 } // // SK - Provincial Taxes // function testSK_2008a_BiWeekly_Claim1_MedIncome() { Debug::text( 'SK - BiWeekly - Beginning of 2008 01-Jan-08: ', __FILE__, __LINE__, __METHOD__, 10 ); $pd_obj = new PayrollDeduction( 'CA', 'SK' ); $pd_obj->setDate( strtotime( '01-Jan-08' ) ); $pd_obj->setEnableCPPAndEIDeduction( true ); //Deduct CPP/EI. $pd_obj->setAnnualPayPeriods( 26 ); $pd_obj->setFederalTotalClaimAmount( 9600 ); $pd_obj->setProvincialTotalClaimAmount( 8945.00 ); $pd_obj->setWCBRate( 0.18 ); $pd_obj->setEIExempt( false ); $pd_obj->setCPPExempt( false ); $pd_obj->setFederalTaxExempt( false ); $pd_obj->setProvincialTaxExempt( false ); $pd_obj->setYearToDateCPPContribution( 0 ); $pd_obj->setYearToDateEIContribution( 0 ); $pd_obj->setGrossPayPeriodIncome( 2840.00 ); $this->assertEquals( '2840.00', $this->mf( $pd_obj->getGrossPayPeriodIncome() ) ); Debug::text( 'Prov Ded: ' . $pd_obj->getProvincialPayPeriodDeductions(), __FILE__, __LINE__, __METHOD__, 10 ); $this->assertEquals( '289.56', $this->mf( $pd_obj->getProvincialPayPeriodDeductions() ) ); } function testSK_2008a_SemiMonthly_Claim1_MedIncome() { Debug::text( 'SK - SemiMonthly - Beginning of 2008 01-Jan-08: ', __FILE__, __LINE__, __METHOD__, 10 ); $pd_obj = new PayrollDeduction( 'CA', 'SK' ); $pd_obj->setDate( strtotime( '01-Jan-08' ) ); $pd_obj->setEnableCPPAndEIDeduction( true ); //Deduct CPP/EI. $pd_obj->setAnnualPayPeriods( 24 ); $pd_obj->setFederalTotalClaimAmount( 9600 ); $pd_obj->setProvincialTotalClaimAmount( 8945.00 ); $pd_obj->setWCBRate( 0.18 ); $pd_obj->setEIExempt( false ); $pd_obj->setCPPExempt( false ); $pd_obj->setFederalTaxExempt( false ); $pd_obj->setProvincialTaxExempt( false ); $pd_obj->setYearToDateCPPContribution( 0 ); $pd_obj->setYearToDateEIContribution( 0 ); $pd_obj->setGrossPayPeriodIncome( 2824.00 ); $this->assertEquals( '2824.00', $this->mf( $pd_obj->getGrossPayPeriodIncome() ) ); Debug::text( 'Prov Ded: ' . $pd_obj->getProvincialPayPeriodDeductions(), __FILE__, __LINE__, __METHOD__, 10 ); $this->assertEquals( '280.85', $this->mf( $pd_obj->getProvincialPayPeriodDeductions() ) ); } // // MB - Provincial Taxes // function testMB_2008a_BiWeekly_Claim1_MedIncome() { Debug::text( 'MB - BiWeekly - Beginning of 2008 01-Jan-08: ', __FILE__, __LINE__, __METHOD__, 10 ); $pd_obj = new PayrollDeduction( 'CA', 'MB' ); $pd_obj->setDate( strtotime( '01-Jan-08' ) ); $pd_obj->setEnableCPPAndEIDeduction( true ); //Deduct CPP/EI. $pd_obj->setAnnualPayPeriods( 26 ); $pd_obj->setFederalTotalClaimAmount( 9600 ); $pd_obj->setProvincialTotalClaimAmount( 8034 ); $pd_obj->setWCBRate( 0.18 ); $pd_obj->setEIExempt( false ); $pd_obj->setCPPExempt( false ); $pd_obj->setFederalTaxExempt( false ); $pd_obj->setProvincialTaxExempt( false ); $pd_obj->setYearToDateCPPContribution( 0 ); $pd_obj->setYearToDateEIContribution( 0 ); $pd_obj->setGrossPayPeriodIncome( 2754.00 ); $this->assertEquals( '2754.00', $this->mf( $pd_obj->getGrossPayPeriodIncome() ) ); Debug::text( 'Prov Ded: ' . $pd_obj->getProvincialPayPeriodDeductions(), __FILE__, __LINE__, __METHOD__, 10 ); $this->assertEquals( '294.17', $this->mf( $pd_obj->getProvincialPayPeriodDeductions() ) ); } function testMB_2008a_SemiMonthly_Claim1_MedIncome() { Debug::text( 'MB - SemiMonthly - Beginning of 2008 01-Jan-08: ', __FILE__, __LINE__, __METHOD__, 10 ); $pd_obj = new PayrollDeduction( 'CA', 'MB' ); $pd_obj->setDate( strtotime( '01-Jan-08' ) ); $pd_obj->setEnableCPPAndEIDeduction( true ); //Deduct CPP/EI. $pd_obj->setAnnualPayPeriods( 24 ); $pd_obj->setFederalTotalClaimAmount( 9600 ); $pd_obj->setProvincialTotalClaimAmount( 8034 ); $pd_obj->setWCBRate( 0.18 ); $pd_obj->setEIExempt( false ); $pd_obj->setCPPExempt( false ); $pd_obj->setFederalTaxExempt( false ); $pd_obj->setProvincialTaxExempt( false ); $pd_obj->setYearToDateCPPContribution( 0 ); $pd_obj->setYearToDateEIContribution( 0 ); $pd_obj->setGrossPayPeriodIncome( 2705.00 ); $this->assertEquals( '2705.00', $this->mf( $pd_obj->getGrossPayPeriodIncome() ) ); Debug::text( 'Prov Ded: ' . $pd_obj->getProvincialPayPeriodDeductions(), __FILE__, __LINE__, __METHOD__, 10 ); $this->assertEquals( '272.32', $this->mf( $pd_obj->getProvincialPayPeriodDeductions() ) ); } // // ON - Provincial Taxes // function testON_2008a_BiWeekly_Claim1_MedIncome() { Debug::text( 'ON - BiWeekly - Beginning of 2008 01-Jan-08: ', __FILE__, __LINE__, __METHOD__, 10 ); $pd_obj = new PayrollDeduction( 'CA', 'ON' ); $pd_obj->setDate( strtotime( '01-Jan-08' ) ); $pd_obj->setEnableCPPAndEIDeduction( true ); //Deduct CPP/EI. $pd_obj->setAnnualPayPeriods( 26 ); $pd_obj->setFederalTotalClaimAmount( 9600 ); $pd_obj->setProvincialTotalClaimAmount( 8681 ); $pd_obj->setWCBRate( 0.18 ); $pd_obj->setEIExempt( false ); $pd_obj->setCPPExempt( false ); $pd_obj->setFederalTaxExempt( false ); $pd_obj->setProvincialTaxExempt( false ); $pd_obj->setYearToDateCPPContribution( 0 ); $pd_obj->setYearToDateEIContribution( 0 ); $pd_obj->setGrossPayPeriodIncome( 2749.00 ); $this->assertEquals( '2749.00', $this->mf( $pd_obj->getGrossPayPeriodIncome() ) ); Debug::text( 'Prov Ded: ' . $pd_obj->getProvincialPayPeriodDeductions(), __FILE__, __LINE__, __METHOD__, 10 ); $this->assertEquals( '209.40', $this->mf( $pd_obj->getProvincialPayPeriodDeductions() ) ); } function testON_2008a_SemiMonthly_Claim1_MedIncome() { Debug::text( 'ON - SemiMonthly - Beginning of 2008 01-Jan-08: ', __FILE__, __LINE__, __METHOD__, 10 ); $pd_obj = new PayrollDeduction( 'CA', 'ON' ); $pd_obj->setDate( strtotime( '01-Jan-08' ) ); $pd_obj->setEnableCPPAndEIDeduction( true ); //Deduct CPP/EI. $pd_obj->setAnnualPayPeriods( 24 ); $pd_obj->setFederalTotalClaimAmount( 9600 ); $pd_obj->setProvincialTotalClaimAmount( 8681 ); $pd_obj->setWCBRate( 0.18 ); $pd_obj->setEIExempt( false ); $pd_obj->setCPPExempt( false ); $pd_obj->setFederalTaxExempt( false ); $pd_obj->setProvincialTaxExempt( false ); $pd_obj->setYearToDateCPPContribution( 0 ); $pd_obj->setYearToDateEIContribution( 0 ); $pd_obj->setGrossPayPeriodIncome( 2830.00 ); $this->assertEquals( '2830.00', $this->mf( $pd_obj->getGrossPayPeriodIncome() ) ); Debug::text( 'Prov Ded: ' . $pd_obj->getProvincialPayPeriodDeductions(), __FILE__, __LINE__, __METHOD__, 10 ); $this->assertEquals( '210.59', $this->mf( $pd_obj->getProvincialPayPeriodDeductions() ) ); //214.00 } // // PEI - Provincial Taxes // function testPE_2008a_BiWeekly_Claim1_MedIncome() { Debug::text( 'PE - BiWeekly - Beginning of 2008 01-Jan-08: ', __FILE__, __LINE__, __METHOD__, 10 ); $pd_obj = new PayrollDeduction( 'CA', 'PE' ); $pd_obj->setDate( strtotime( '01-Jan-08' ) ); $pd_obj->setEnableCPPAndEIDeduction( true ); //Deduct CPP/EI. $pd_obj->setAnnualPayPeriods( 26 ); $pd_obj->setFederalTotalClaimAmount( 9600 ); $pd_obj->setProvincialTotalClaimAmount( 14254 ); $pd_obj->setWCBRate( 0.18 ); $pd_obj->setEIExempt( false ); $pd_obj->setCPPExempt( false ); $pd_obj->setFederalTaxExempt( false ); $pd_obj->setProvincialTaxExempt( false ); $pd_obj->setYearToDateCPPContribution( 0 ); $pd_obj->setYearToDateEIContribution( 0 ); $pd_obj->setGrossPayPeriodIncome( 2060 ); $this->assertEquals( '2060.00', $this->mf( $pd_obj->getGrossPayPeriodIncome() ) ); Debug::text( 'Prov Ded: ' . $pd_obj->getProvincialPayPeriodDeductions(), __FILE__, __LINE__, __METHOD__, 10 ); $this->assertEquals( '170.96', $this->mf( $pd_obj->getProvincialPayPeriodDeductions() ) ); } function testPE_2008a_BiWeekly_Claim1_HighIncome() { Debug::text( 'PE - BiWeekly - Beginning of 2008 01-Jan-08: ', __FILE__, __LINE__, __METHOD__, 10 ); $pd_obj = new PayrollDeduction( 'CA', 'PE' ); $pd_obj->setDate( strtotime( '01-Jan-08' ) ); $pd_obj->setEnableCPPAndEIDeduction( true ); //Deduct CPP/EI. $pd_obj->setAnnualPayPeriods( 26 ); $pd_obj->setFederalTotalClaimAmount( 9600 ); $pd_obj->setProvincialTotalClaimAmount( 7708 ); $pd_obj->setWCBRate( 0.18 ); $pd_obj->setEIExempt( false ); $pd_obj->setCPPExempt( false ); $pd_obj->setFederalTaxExempt( false ); $pd_obj->setProvincialTaxExempt( false ); $pd_obj->setYearToDateCPPContribution( 0 ); $pd_obj->setYearToDateEIContribution( 0 ); $pd_obj->setGrossPayPeriodIncome( 2759 ); $this->assertEquals( '2759.00', $this->mf( $pd_obj->getGrossPayPeriodIncome() ) ); Debug::text( 'Prov Ded: ' . $pd_obj->getProvincialPayPeriodDeductions(), __FILE__, __LINE__, __METHOD__, 10 ); $this->assertEquals( '300.76', $this->mf( $pd_obj->getProvincialPayPeriodDeductions() ) ); //298.75 } function testPE_2008a_BiWeekly_Claim1_MedIncomeB() { Debug::text( 'PE - BiWeekly - Beginning of 2008 01-Jan-08: ', __FILE__, __LINE__, __METHOD__, 10 ); $pd_obj = new PayrollDeduction( 'CA', 'PE' ); $pd_obj->setDate( strtotime( '01-Jan-08' ) ); $pd_obj->setEnableCPPAndEIDeduction( true ); //Deduct CPP/EI. $pd_obj->setAnnualPayPeriods( 24 ); $pd_obj->setFederalTotalClaimAmount( 9600 ); $pd_obj->setProvincialTotalClaimAmount( 7708 ); $pd_obj->setWCBRate( 0.18 ); $pd_obj->setEIExempt( false ); $pd_obj->setCPPExempt( false ); $pd_obj->setFederalTaxExempt( false ); $pd_obj->setProvincialTaxExempt( false ); $pd_obj->setYearToDateCPPContribution( 0 ); $pd_obj->setYearToDateEIContribution( 0 ); $pd_obj->setGrossPayPeriodIncome( 2725 ); $this->assertEquals( '2725.00', $this->mf( $pd_obj->getGrossPayPeriodIncome() ) ); Debug::text( 'Prov Ded: ' . $pd_obj->getProvincialPayPeriodDeductions(), __FILE__, __LINE__, __METHOD__, 10 ); $this->assertEquals( '281.75', $this->mf( $pd_obj->getProvincialPayPeriodDeductions() ) ); //281.74 } function testPE_2008a_SemiMonthly_Claim1_MedIncome() { Debug::text( 'PE - SemiMonthly - Beginning of 2008 01-Jan-08: ', __FILE__, __LINE__, __METHOD__, 10 ); $pd_obj = new PayrollDeduction( 'CA', 'PE' ); $pd_obj->setDate( strtotime( '01-Jan-08' ) ); $pd_obj->setEnableCPPAndEIDeduction( true ); //Deduct CPP/EI. $pd_obj->setAnnualPayPeriods( 24 ); $pd_obj->setFederalTotalClaimAmount( 9600 ); $pd_obj->setProvincialTotalClaimAmount( 7708 ); $pd_obj->setWCBRate( 0.18 ); $pd_obj->setEIExempt( false ); $pd_obj->setCPPExempt( false ); $pd_obj->setFederalTaxExempt( false ); $pd_obj->setProvincialTaxExempt( false ); $pd_obj->setYearToDateCPPContribution( 0 ); $pd_obj->setYearToDateEIContribution( 0 ); $pd_obj->setGrossPayPeriodIncome( 2763.00 ); $this->assertEquals( '2763.00', $this->mf( $pd_obj->getGrossPayPeriodIncome() ) ); Debug::text( 'Prov Ded: ' . $pd_obj->getProvincialPayPeriodDeductions(), __FILE__, __LINE__, __METHOD__, 10 ); $this->assertEquals( '288.09', $this->mf( $pd_obj->getProvincialPayPeriodDeductions() ) ); //285.90 } } ?>