Skip to content

Commit

Permalink
unused parameter.
Browse files Browse the repository at this point in the history
  • Loading branch information
demmings committed Dec 9, 2024
1 parent 08064e9 commit 7e5dea6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
9 changes: 4 additions & 5 deletions dist/CanadianTaxes.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ function GET_GROSS_INCOMES_V2(income, ageInFuture, currentAge, projectedInflatio
* @returns {Number[][]}
* @customfunction
*/
function GET_NET_INCOMES_V2(yearlyGrossIncome, ageInFuture, currentAge = 65, inflation = null, taxYear = null, capitalGains = null, dividendIncome = null, OAS = null, pension) {
function GET_NET_INCOMES_V2(yearlyGrossIncome, ageInFuture, currentAge = 65, inflation = null, taxYear = null, capitalGains = null, dividendIncome = null, OAS = null, pension = null) {
const taxData = CanadianIncomeCalculator.validateIncomeSettings(yearlyGrossIncome, ageInFuture, currentAge, taxYear, inflation, capitalGains, dividendIncome, OAS, pension);

return CanadianIncomeCalculator.getNetIncomes(taxData);
Expand Down Expand Up @@ -597,7 +597,7 @@ class CanadianIncomeTax {
getNetProvincialTax(taxData, grossIncome) {
taxData.ontHealthPremium = CanadianIncomeTax.calculateTaxInBracket(this.provTaxRates.ontHealthBracketInfo, taxData.totalIncomeForTaxPurposes)
taxData.ontTaxBeforeCredits = CanadianIncomeTax.calculateTaxInBracket(this.provTaxRates.ontTaxBracketInfo, taxData.netIncomeForTaxPurposes);
taxData.totalProvNonRefundableTaxCreditsBeforeDividendTaxCredits = this.getProvincialTaxCredits(taxData, grossIncome + taxData.taxableCapitalGains + taxData.OAS, taxData.ageInFuture, taxData.incomeEligibleForPensionCredit, taxData.grossedUpEligibleDividends)
taxData.totalProvNonRefundableTaxCreditsBeforeDividendTaxCredits = this.getProvincialTaxCredits(taxData, grossIncome + taxData.taxableCapitalGains + taxData.OAS)
if (taxData.totalProvNonRefundableTaxCreditsBeforeDividendTaxCredits > taxData.ontTaxBeforeCredits) {
taxData.totalProvNonRefundableTaxCreditsBeforeDividendTaxCredits = taxData.ontTaxBeforeCredits;
}
Expand Down Expand Up @@ -677,7 +677,7 @@ class CanadianIncomeTax {
}

taxData.provAgeCredit = this.getAgeCredit(taxData.ageInFuture, grossIncome + taxData.grossedUpEligibleDividends, this.provTaxRates.ontAgeAmount, this.provTaxRates.ontAgeThreshold, this.fedTaxRates.ageExcessPercent);
taxData.totalNonRefundableProvTaxCredits = this.getProvBasicPersonalAmount(taxData, grossIncome) + taxData.provAgeCredit + provincialEligiblePensionIncome;
taxData.totalNonRefundableProvTaxCredits = this.getProvBasicPersonalAmount(taxData) + taxData.provAgeCredit + provincialEligiblePensionIncome;
const lowestTaxRate = CanadianIncomeTax.getMarginalTaxRate(this.provTaxRates.ontTaxBracketInfo, 0);

let provincialTaxCredits = taxData.totalNonRefundableProvTaxCredits * lowestTaxRate;
Expand All @@ -688,10 +688,9 @@ class CanadianIncomeTax {
/**
*
* @param {TaxData} taxData
* @param {Number} income
* @returns
*/
getProvBasicPersonalAmount(taxData, income) {
getProvBasicPersonalAmount(taxData) {
taxData.provAdjustedBPA = this.provTaxRates.ontBasicPersonAmount;

return taxData.provAdjustedBPA;
Expand Down
9 changes: 4 additions & 5 deletions src/CanadianTaxes.js
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ function GET_GROSS_INCOMES_V2(income, ageInFuture, currentAge, projectedInflatio
* @returns {Number[][]}
* @customfunction
*/
function GET_NET_INCOMES_V2(yearlyGrossIncome, ageInFuture, currentAge = 65, inflation = null, taxYear = null, capitalGains = null, dividendIncome = null, OAS = null, pension) {
function GET_NET_INCOMES_V2(yearlyGrossIncome, ageInFuture, currentAge = 65, inflation = null, taxYear = null, capitalGains = null, dividendIncome = null, OAS = null, pension = null) {
const taxData = CanadianIncomeCalculator.validateIncomeSettings(yearlyGrossIncome, ageInFuture, currentAge, taxYear, inflation, capitalGains, dividendIncome, OAS, pension);

return CanadianIncomeCalculator.getNetIncomes(taxData);
Expand Down Expand Up @@ -616,7 +616,7 @@ class CanadianIncomeTax {
getNetProvincialTax(taxData, grossIncome) {
taxData.ontHealthPremium = CanadianIncomeTax.calculateTaxInBracket(this.provTaxRates.ontHealthBracketInfo, taxData.totalIncomeForTaxPurposes)
taxData.ontTaxBeforeCredits = CanadianIncomeTax.calculateTaxInBracket(this.provTaxRates.ontTaxBracketInfo, taxData.netIncomeForTaxPurposes);
taxData.totalProvNonRefundableTaxCreditsBeforeDividendTaxCredits = this.getProvincialTaxCredits(taxData, grossIncome + taxData.taxableCapitalGains + taxData.OAS, taxData.ageInFuture, taxData.incomeEligibleForPensionCredit, taxData.grossedUpEligibleDividends)
taxData.totalProvNonRefundableTaxCreditsBeforeDividendTaxCredits = this.getProvincialTaxCredits(taxData, grossIncome + taxData.taxableCapitalGains + taxData.OAS)
if (taxData.totalProvNonRefundableTaxCreditsBeforeDividendTaxCredits > taxData.ontTaxBeforeCredits) {
taxData.totalProvNonRefundableTaxCreditsBeforeDividendTaxCredits = taxData.ontTaxBeforeCredits;
}
Expand Down Expand Up @@ -696,7 +696,7 @@ class CanadianIncomeTax {
}

taxData.provAgeCredit = this.getAgeCredit(taxData.ageInFuture, grossIncome + taxData.grossedUpEligibleDividends, this.provTaxRates.ontAgeAmount, this.provTaxRates.ontAgeThreshold, this.fedTaxRates.ageExcessPercent);
taxData.totalNonRefundableProvTaxCredits = this.getProvBasicPersonalAmount(taxData, grossIncome) + taxData.provAgeCredit + provincialEligiblePensionIncome;
taxData.totalNonRefundableProvTaxCredits = this.getProvBasicPersonalAmount(taxData) + taxData.provAgeCredit + provincialEligiblePensionIncome;
const lowestTaxRate = CanadianIncomeTax.getMarginalTaxRate(this.provTaxRates.ontTaxBracketInfo, 0);

let provincialTaxCredits = taxData.totalNonRefundableProvTaxCredits * lowestTaxRate;
Expand All @@ -707,10 +707,9 @@ class CanadianIncomeTax {
/**
*
* @param {TaxData} taxData
* @param {Number} income
* @returns
*/
getProvBasicPersonalAmount(taxData, income) {
getProvBasicPersonalAmount(taxData) {
taxData.provAdjustedBPA = this.provTaxRates.ontBasicPersonAmount;

return taxData.provAdjustedBPA;
Expand Down

0 comments on commit 7e5dea6

Please sign in to comment.