@equisoft/tax-ca 2021.3.1 → 2021.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -83,6 +83,7 @@ Data relating to federal and provincial income taxes and social charges.
83
83
 
84
84
  ```
85
85
  TAXES
86
+ |--DividendCredit
86
87
  |--EmploymentInsurance
87
88
  |--IncomeTax
88
89
  |--QuebecParentalInsurancePlan
@@ -184,15 +184,15 @@ function getMaxWithdrawalPct(jurisdiction, age) {
184
184
  case 'NB':
185
185
  case 'NL':
186
186
  case 'SK':
187
- return exports.province1MaxWithdrawalPct[math_1.clamp(age, 54, 90)];
187
+ return exports.province1MaxWithdrawalPct[(0, math_1.clamp)(age, 54, 90)];
188
188
  case 'QC':
189
189
  case 'MB':
190
190
  case 'NS':
191
- return exports.province2MaxWithdrawalPct[math_1.clamp(age, 54, 89)];
191
+ return exports.province2MaxWithdrawalPct[(0, math_1.clamp)(age, 54, 89)];
192
192
  case 'CA':
193
- return exports.federalMaxWithdrawalPct[math_1.clamp(age, 54, 90)];
193
+ return exports.federalMaxWithdrawalPct[(0, math_1.clamp)(age, 54, 90)];
194
194
  default:
195
- return exports.othersMaxWithdrawalPct[math_1.clamp(age, 54, 96)];
195
+ return exports.othersMaxWithdrawalPct[(0, math_1.clamp)(age, 54, 96)];
196
196
  }
197
197
  }
198
198
  exports.getMaxWithdrawalPct = getMaxWithdrawalPct;
@@ -24,8 +24,10 @@ exports.CPP = {
24
24
  PENSIONABLE_EARNINGS: {
25
25
  MAX: 61600,
26
26
  MIN: 3500,
27
- AVG_MAX: 60180,
28
- SUP_MAX: 70224,
27
+ // Average YPE of the last 5 year (including current year)
28
+ AVG_MAX: 57780,
29
+ // 114% of AVG_MAX
30
+ SUP_MAX: 65869,
29
31
  SUP_FACTORS: [
30
32
  { FROM: 2019, TO: 2023, FACTOR: 1 },
31
33
  { FROM: 2024, TO: 2024, FACTOR: 1.07 },
@@ -57,14 +59,14 @@ exports.CPP = {
57
59
  },
58
60
  getRequestDateFactor(birthDate, requestDate, customReferenceDate) {
59
61
  const { BONUS, PENALTY } = this.MONTHLY_DELAY;
60
- const minRequestDate = date_1.addYearsToDate(birthDate, this.MIN_REQUEST_AGE);
61
- const maxRequestDate = date_1.addYearsToDate(birthDate, this.MAX_REQUEST_AGE);
62
- const referenceDate = customReferenceDate || date_1.addYearsToDate(birthDate, this.DEFAULT_REFERENCE_AGE);
63
- const monthsToToday = date_1.getMonthsDiff(birthDate, date_1.now());
64
- const monthsToMinRequestDate = date_1.getMonthsDiff(birthDate, minRequestDate);
65
- const monthsToMaxRequestDate = date_1.getMonthsDiff(birthDate, maxRequestDate);
66
- const monthsToReferenceDate = date_1.getMonthsDiff(birthDate, referenceDate);
67
- const monthsToRequestDate = date_1.getMonthsDiff(birthDate, requestDate);
62
+ const minRequestDate = (0, date_1.addYearsToDate)(birthDate, this.MIN_REQUEST_AGE);
63
+ const maxRequestDate = (0, date_1.addYearsToDate)(birthDate, this.MAX_REQUEST_AGE);
64
+ const referenceDate = customReferenceDate || (0, date_1.addYearsToDate)(birthDate, this.DEFAULT_REFERENCE_AGE);
65
+ const monthsToToday = (0, date_1.getMonthsDiff)(birthDate, (0, date_1.now)());
66
+ const monthsToMinRequestDate = (0, date_1.getMonthsDiff)(birthDate, minRequestDate);
67
+ const monthsToMaxRequestDate = (0, date_1.getMonthsDiff)(birthDate, maxRequestDate);
68
+ const monthsToReferenceDate = (0, date_1.getMonthsDiff)(birthDate, referenceDate);
69
+ const monthsToRequestDate = (0, date_1.getMonthsDiff)(birthDate, requestDate);
68
70
  const monthsToLastBirthDay = monthsToToday - (monthsToToday % 12);
69
71
  // Request date is before minimum request date
70
72
  if (monthsToRequestDate < monthsToMinRequestDate) {
@@ -78,13 +80,13 @@ exports.CPP = {
78
80
  if (monthsToToday > monthsToReferenceDate && monthsToRequestDate < monthsToLastBirthDay) {
79
81
  return 1;
80
82
  }
81
- let monthsDelta = math_1.clamp(monthsToRequestDate, monthsToMinRequestDate, monthsToMaxRequestDate);
83
+ let monthsDelta = (0, math_1.clamp)(monthsToRequestDate, monthsToMinRequestDate, monthsToMaxRequestDate);
82
84
  monthsDelta -= Math.max(monthsToLastBirthDay, monthsToReferenceDate);
83
85
  return 1 + monthsDelta * (monthsDelta >= 0 ? BONUS : PENALTY);
84
86
  },
85
87
  getAverageIndexationRate() {
86
88
  const sum = this.INDEXATION_RATE_REFERENCES.reduce((previous, current) => previous + current[1], 0);
87
- return math_1.roundToPrecision(sum / this.INDEXATION_RATE_REFERENCES.length, 3);
89
+ return (0, math_1.roundToPrecision)(sum / this.INDEXATION_RATE_REFERENCES.length, 3);
88
90
  },
89
91
  INDEXATION_RATE_REFERENCES: [
90
92
  [2007, 0.020],
@@ -6,7 +6,7 @@ Sources:
6
6
  https://www.canada.ca/en/services/benefits/publicpensions/cpp/old-age-security/eligibility.html (delay bonus)
7
7
  https://www.canada.ca/en/services/benefits/publicpensions/cpp/old-age-security/payments.html
8
8
 
9
- Revised 2021-05-05
9
+ Revised 2021-11-16
10
10
  */
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.OAS = void 0;
@@ -14,12 +14,12 @@ const date_1 = require("../utils/date");
14
14
  const math_1 = require("../utils/math");
15
15
  exports.OAS = {
16
16
  getRequestDateFactor(birthDate, requestDate) {
17
- const minRequestDate = date_1.addYearsToDate(birthDate, this.MIN_AGE);
18
- const maxRequestDate = date_1.addYearsToDate(birthDate, this.MAX_AGE);
19
- const monthsToToday = date_1.getMonthsDiff(birthDate, date_1.now());
20
- const monthsToMinRequestDate = date_1.getMonthsDiff(birthDate, minRequestDate);
21
- const monthsToMaxRequestDate = date_1.getMonthsDiff(birthDate, maxRequestDate);
22
- const monthsToRequestDate = date_1.getMonthsDiff(birthDate, requestDate);
17
+ const minRequestDate = (0, date_1.addYearsToDate)(birthDate, this.MIN_AGE);
18
+ const maxRequestDate = (0, date_1.addYearsToDate)(birthDate, this.MAX_AGE);
19
+ const monthsToToday = (0, date_1.getMonthsDiff)(birthDate, (0, date_1.now)());
20
+ const monthsToMinRequestDate = (0, date_1.getMonthsDiff)(birthDate, minRequestDate);
21
+ const monthsToMaxRequestDate = (0, date_1.getMonthsDiff)(birthDate, maxRequestDate);
22
+ const monthsToRequestDate = (0, date_1.getMonthsDiff)(birthDate, requestDate);
23
23
  const monthsToLastBirthDay = monthsToToday - (monthsToToday % 12);
24
24
  // Request date is before minimum request date
25
25
  if (monthsToRequestDate < monthsToMinRequestDate) {
@@ -29,16 +29,16 @@ exports.OAS = {
29
29
  if (monthsToMaxRequestDate < monthsToToday || monthsToRequestDate < monthsToLastBirthDay) {
30
30
  return 1;
31
31
  }
32
- let monthsDelta = math_1.clamp(monthsToRequestDate, monthsToMinRequestDate, monthsToMaxRequestDate);
32
+ let monthsDelta = (0, math_1.clamp)(monthsToRequestDate, monthsToMinRequestDate, monthsToMaxRequestDate);
33
33
  monthsDelta -= Math.max(monthsToLastBirthDay, monthsToMinRequestDate);
34
34
  return 1 + (monthsDelta * this.MONTHLY_DELAY_BONUS);
35
35
  },
36
36
  MAX_AGE: 70,
37
37
  MIN_AGE: 65,
38
- MONTHLY_PAYMENT_MAX: 618.45,
38
+ MONTHLY_PAYMENT_MAX: 635.26,
39
39
  MONTHLY_DELAY_BONUS: 0.006,
40
40
  REPAYMENT: {
41
- MAX: 128149,
41
+ MAX: 129757,
42
42
  MIN: 79054,
43
43
  RATIO: 0.15,
44
44
  },
@@ -17,8 +17,10 @@ exports.QPP = {
17
17
  PENSIONABLE_EARNINGS: {
18
18
  MAX: 61600,
19
19
  MIN: 3500,
20
- AVG_MAX: 60180,
21
- SUP_MAX: 70224,
20
+ // Average YPE of the last 5 year (including current year)
21
+ AVG_MAX: 57780,
22
+ // 114% of AVG_MAX
23
+ SUP_MAX: 65869,
22
24
  SUP_FACTORS: [
23
25
  { FROM: 2019, TO: 2023, FACTOR: 1 },
24
26
  { FROM: 2024, TO: 2024, FACTOR: 1.07 },
@@ -50,14 +52,14 @@ exports.QPP = {
50
52
  },
51
53
  getRequestDateFactor(birthDate, requestDate, customReferenceDate) {
52
54
  const { BONUS, PENALTY } = this.MONTHLY_DELAY;
53
- const minRequestDate = date_1.addYearsToDate(birthDate, this.MIN_REQUEST_AGE);
54
- const maxRequestDate = date_1.addYearsToDate(birthDate, this.MAX_REQUEST_AGE);
55
- const referenceDate = customReferenceDate || date_1.addYearsToDate(birthDate, this.DEFAULT_REFERENCE_AGE);
56
- const monthsToToday = date_1.getMonthsDiff(birthDate, date_1.now());
57
- const monthsToMinRequestDate = date_1.getMonthsDiff(birthDate, minRequestDate);
58
- const monthsToMaxRequestDate = date_1.getMonthsDiff(birthDate, maxRequestDate);
59
- const monthsToReferenceDate = date_1.getMonthsDiff(birthDate, referenceDate);
60
- const monthsToRequestDate = date_1.getMonthsDiff(birthDate, requestDate);
55
+ const minRequestDate = (0, date_1.addYearsToDate)(birthDate, this.MIN_REQUEST_AGE);
56
+ const maxRequestDate = (0, date_1.addYearsToDate)(birthDate, this.MAX_REQUEST_AGE);
57
+ const referenceDate = customReferenceDate || (0, date_1.addYearsToDate)(birthDate, this.DEFAULT_REFERENCE_AGE);
58
+ const monthsToToday = (0, date_1.getMonthsDiff)(birthDate, (0, date_1.now)());
59
+ const monthsToMinRequestDate = (0, date_1.getMonthsDiff)(birthDate, minRequestDate);
60
+ const monthsToMaxRequestDate = (0, date_1.getMonthsDiff)(birthDate, maxRequestDate);
61
+ const monthsToReferenceDate = (0, date_1.getMonthsDiff)(birthDate, referenceDate);
62
+ const monthsToRequestDate = (0, date_1.getMonthsDiff)(birthDate, requestDate);
61
63
  const monthsToLastBirthDay = monthsToToday - (monthsToToday % 12);
62
64
  // Request date is before minimum request date
63
65
  if (monthsToRequestDate < monthsToMinRequestDate) {
@@ -71,13 +73,13 @@ exports.QPP = {
71
73
  if (monthsToToday > monthsToReferenceDate && monthsToRequestDate < monthsToLastBirthDay) {
72
74
  return 1;
73
75
  }
74
- let monthsDelta = math_1.clamp(monthsToRequestDate, monthsToMinRequestDate, monthsToMaxRequestDate);
76
+ let monthsDelta = (0, math_1.clamp)(monthsToRequestDate, monthsToMinRequestDate, monthsToMaxRequestDate);
75
77
  monthsDelta -= Math.max(monthsToLastBirthDay, monthsToReferenceDate);
76
78
  return 1 + monthsDelta * (monthsDelta >= 0 ? BONUS : PENALTY);
77
79
  },
78
80
  getAverageIndexationRate() {
79
81
  const sum = this.INDEXATION_RATE_REFERENCES.reduce((previous, current) => previous + current[1], 0);
80
- return math_1.roundToPrecision(sum / this.INDEXATION_RATE_REFERENCES.length, 2);
82
+ return (0, math_1.roundToPrecision)(sum / this.INDEXATION_RATE_REFERENCES.length, 2);
81
83
  },
82
84
  INDEXATION_RATE_REFERENCES: [
83
85
  [2007, 0.021],
@@ -0,0 +1,8 @@
1
+ import { FederalCode, ProvinceCode } from '../misc';
2
+ export declare type DividendTaxCreditRate = {
3
+ GROSS_UP: number;
4
+ } & {
5
+ [key in ProvinceCode | FederalCode]: number;
6
+ };
7
+ export declare const NON_ELIGIBLE_DIVIDEND: DividendTaxCreditRate;
8
+ export declare const ELIGIBLE_DIVIDEND: DividendTaxCreditRate;
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ /*
3
+ Sources:
4
+ non-eligible dividends: https://www.taxtips.ca/dtc/non-eligible-dividend-tax-credit.htm
5
+ eligible dividends: https://www.taxtips.ca/dtc/eligible-dividends/eligible-dividend-tax-credit-rates.htm
6
+
7
+ Revised 2021-11-02
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.ELIGIBLE_DIVIDEND = exports.NON_ELIGIBLE_DIVIDEND = void 0;
11
+ exports.NON_ELIGIBLE_DIVIDEND = {
12
+ GROSS_UP: 1.15,
13
+ CA: 0.090301,
14
+ AB: 0.0218,
15
+ BC: 0.0196,
16
+ MB: 0.007835,
17
+ NB: 0.0275,
18
+ NL: 0.035,
19
+ NS: 0.0299,
20
+ NT: 0.06,
21
+ NU: 0.0261,
22
+ ON: 0.029863,
23
+ PE: 0.0196,
24
+ QC: 0.0401,
25
+ SK: 0.01695,
26
+ YT: 0.0067,
27
+ };
28
+ exports.ELIGIBLE_DIVIDEND = {
29
+ GROSS_UP: 1.38,
30
+ CA: 0.150198,
31
+ AB: 0.0812,
32
+ BC: 0.12,
33
+ MB: 0.08,
34
+ NB: 0.14,
35
+ NL: 0.054,
36
+ NS: 0.0885,
37
+ NT: 0.115,
38
+ NU: 0.0551,
39
+ ON: 0.1,
40
+ PE: 0.105,
41
+ QC: 0.117,
42
+ SK: 0.11,
43
+ YT: 0.1202,
44
+ };
@@ -527,27 +527,27 @@ exports.getProvincialBaseCredit = getProvincialBaseCredit;
527
527
  function getTotalMarginalRate(provincialCode, grossIncome, inflationRate = 0, yearsToInflate = 0) {
528
528
  const provRate = getProvincialMarginalRate(provincialCode, grossIncome, inflationRate, yearsToInflate);
529
529
  const fedRate = getFederalMarginalRate(provincialCode, grossIncome, inflationRate, yearsToInflate);
530
- return utils_1.roundToPrecision(provRate + fedRate, 4);
530
+ return (0, utils_1.roundToPrecision)(provRate + fedRate, 4);
531
531
  }
532
532
  exports.getTotalMarginalRate = getTotalMarginalRate;
533
533
  function getMaxProvincialMarginalRate(provincialCode) {
534
534
  // tslint:disable-next-line:no-non-null-assertion
535
- const marginalRate = collections_1.maxBy(getTaxRates(provincialCode), (bracket) => bracket.TO).RATE;
535
+ const marginalRate = (0, collections_1.maxBy)(getTaxRates(provincialCode), (bracket) => bracket.TO).RATE;
536
536
  // tslint:disable-next-line:no-non-null-assertion
537
- const surtaxRate = collections_1.maxBy(getSurtaxRates(provincialCode), bracket => bracket.TO).RATE;
537
+ const surtaxRate = (0, collections_1.maxBy)(getSurtaxRates(provincialCode), bracket => bracket.TO).RATE;
538
538
  return marginalRate + (marginalRate * surtaxRate);
539
539
  }
540
540
  exports.getMaxProvincialMarginalRate = getMaxProvincialMarginalRate;
541
541
  function getMaxFederalMarginalRate(provincialCode) {
542
542
  // tslint:disable-next-line:no-non-null-assertion
543
- const maxRate = collections_1.maxBy(getTaxRates(code_types_1.FEDERAL_CODE), bracket => bracket.TO).RATE;
543
+ const maxRate = (0, collections_1.maxBy)(getTaxRates(code_types_1.FEDERAL_CODE), bracket => bracket.TO).RATE;
544
544
  return maxRate * (1 - getAbatement(provincialCode));
545
545
  }
546
546
  exports.getMaxFederalMarginalRate = getMaxFederalMarginalRate;
547
547
  function getTotalMaxMarginalRate(provincialCode) {
548
548
  const provRate = getMaxProvincialMarginalRate(provincialCode);
549
549
  const fedRate = getMaxFederalMarginalRate(provincialCode);
550
- return utils_1.roundToPrecision(provRate + fedRate, 4);
550
+ return (0, utils_1.roundToPrecision)(provRate + fedRate, 4);
551
551
  }
552
552
  exports.getTotalMaxMarginalRate = getTotalMaxMarginalRate;
553
553
  function getTotalTaxAmount(provincialCode, grossIncome, inflationRate = 0, yearsToInflate = 0) {
@@ -1,3 +1,4 @@
1
+ export * from './dividend-credit';
1
2
  export * from './employment-insurance';
2
3
  export * from './income-tax';
3
4
  export * from './quebec-parental-insurance-plan';
@@ -10,6 +10,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
10
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
11
  };
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
+ __exportStar(require("./dividend-credit"), exports);
13
14
  __exportStar(require("./employment-insurance"), exports);
14
15
  __exportStar(require("./income-tax"), exports);
15
16
  __exportStar(require("./quebec-parental-insurance-plan"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equisoft/tax-ca",
3
- "version": "2021.3.1",
3
+ "version": "2021.8.0",
4
4
  "description": "Canadian tax data and calculation functions.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -35,13 +35,13 @@
35
35
  },
36
36
  "devDependencies": {
37
37
  "@equisoft/tslint-config": "~0.0.8",
38
- "@types/jest": "~26.0.4",
39
- "@types/node": "^15.0.1",
38
+ "@types/jest": "~27.0.1",
39
+ "@types/node": "^16.0.0",
40
40
  "jest": "~24.9.0",
41
- "jest-junit": "~12.0.0",
41
+ "jest-junit": "~13.0.0",
42
42
  "ts-jest": "~24.3.0",
43
43
  "tslint": "~5.20.0",
44
- "typescript": "~4.2.3"
44
+ "typescript": "~4.5.2"
45
45
  },
46
46
  "dependencies": {}
47
47
  }