foreach ($test_data[$country][$province_code]['income'] as $income) {
                            $pd_obj = new PayrollDeduction($country, $province_code);
                            $pd_obj->setDate($effective_date);
                            $pd_obj->setAnnualPayPeriods($pay_periods);
                            $pd_obj->setEnableCPPAndEIDeduction(TRUE);
                            //Deduct CPP/EI.
                            $pd_obj->setFederalTotalClaimAmount($federal_claim);
                            $pd_obj->setProvincialTotalClaimAmount($provincial_claim);
                            $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($income);
                            $retarr[] = array('country' => $country, 'province' => $province_code, 'date' => date('m/d/y', $effective_date), 'pay_periods' => $pay_periods, 'federal_claim' => $pd_obj->getFederalTotalClaimAmount(), 'provincial_claim' => $pd_obj->getProvincialTotalClaimAmount(), 'gross_income' => $income, 'federal_deduction' => Misc::MoneyFormat($pd_obj->getFederalPayPeriodDeductions(), FALSE), 'provincial_deduction' => Misc::MoneyFormat($pd_obj->getProvincialPayPeriodDeductions(), FALSE));
                        }
                    }
                }
            }
        }
        //generate column array.
        $column_keys = array_keys($retarr[0]);
        foreach ($column_keys as $column_key) {
            $columns[$column_key] = $column_key;
        }
        //var_dump($test_data);
        //var_dump($retarr);
        echo Misc::Array2CSV($retarr, $columns, FALSE, $include_header = TRUE);
    }
}