@equisoft/tax-us 0.0.1-snapshot.20250723132536
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/.eslintrc.json +42 -0
- package/.tool-versions +1 -0
- package/Makefile +28 -0
- package/README.md +113 -0
- package/RELEASE.md +29 -0
- package/babel.config.js +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +21 -0
- package/dist/investments/index.d.ts +6 -0
- package/dist/investments/index.js +22 -0
- package/dist/investments/life-income-fund.d.ts +11 -0
- package/dist/investments/life-income-fund.js +291 -0
- package/dist/investments/non-registered-savings-plan.d.ts +3 -0
- package/dist/investments/non-registered-savings-plan.js +30 -0
- package/dist/investments/registered-education-savings-plan/beneficiary.d.ts +4 -0
- package/dist/investments/registered-education-savings-plan/beneficiary.js +16 -0
- package/dist/investments/registered-education-savings-plan/british-columbia-training-and-education-savings-grant.d.ts +10 -0
- package/dist/investments/registered-education-savings-plan/british-columbia-training-and-education-savings-grant.js +21 -0
- package/dist/investments/registered-education-savings-plan/canada-education-savings-grant.d.ts +2 -0
- package/dist/investments/registered-education-savings-plan/canada-education-savings-grant.js +23 -0
- package/dist/investments/registered-education-savings-plan/canada-learning-bond.d.ts +12 -0
- package/dist/investments/registered-education-savings-plan/canada-learning-bond.js +19 -0
- package/dist/investments/registered-education-savings-plan/income-level.d.ts +11 -0
- package/dist/investments/registered-education-savings-plan/income-level.js +32 -0
- package/dist/investments/registered-education-savings-plan/index.d.ts +7 -0
- package/dist/investments/registered-education-savings-plan/index.js +23 -0
- package/dist/investments/registered-education-savings-plan/quebec-education-savings-incentive.d.ts +2 -0
- package/dist/investments/registered-education-savings-plan/quebec-education-savings-incentive.js +17 -0
- package/dist/investments/registered-education-savings-plan/savings-grant.d.ts +25 -0
- package/dist/investments/registered-education-savings-plan/savings-grant.js +51 -0
- package/dist/investments/registered-education-savings-plan/tuition-fees.d.ts +6 -0
- package/dist/investments/registered-education-savings-plan/tuition-fees.js +33 -0
- package/dist/investments/registered-retirement-income-fund.d.ts +7 -0
- package/dist/investments/registered-retirement-income-fund.js +68 -0
- package/dist/investments/registered-retirement-savings-plan.d.ts +9 -0
- package/dist/investments/registered-retirement-savings-plan.js +20 -0
- package/dist/investments/tax-free-savings-account.d.ts +7 -0
- package/dist/investments/tax-free-savings-account.js +21 -0
- package/dist/misc/code-types.d.ts +11 -0
- package/dist/misc/code-types.js +19 -0
- package/dist/misc/consumer-price-index.d.ts +34 -0
- package/dist/misc/consumer-price-index.js +240 -0
- package/dist/misc/index.d.ts +5 -0
- package/dist/misc/index.js +21 -0
- package/dist/misc/ipf-stats.d.ts +18 -0
- package/dist/misc/ipf-stats.js +25 -0
- package/dist/misc/life-expectancy.d.ts +28 -0
- package/dist/misc/life-expectancy.js +58 -0
- package/dist/misc/ppp-increase-factor.d.ts +10 -0
- package/dist/misc/ppp-increase-factor.js +25 -0
- package/dist/pension/canada-pension-plan.d.ts +2 -0
- package/dist/pension/canada-pension-plan.js +176 -0
- package/dist/pension/index.d.ts +5 -0
- package/dist/pension/index.js +21 -0
- package/dist/pension/old-age-security.d.ts +21 -0
- package/dist/pension/old-age-security.js +70 -0
- package/dist/pension/public-pension-plan.d.ts +63 -0
- package/dist/pension/public-pension-plan.js +2 -0
- package/dist/pension/quebec-pension-plan.d.ts +2 -0
- package/dist/pension/quebec-pension-plan.js +176 -0
- package/dist/pension/supplemental-pension-plan.d.ts +5 -0
- package/dist/pension/supplemental-pension-plan.js +14 -0
- package/dist/taxes/dividend-credit.d.ts +8 -0
- package/dist/taxes/dividend-credit.js +45 -0
- package/dist/taxes/employment-insurance.d.ts +9 -0
- package/dist/taxes/employment-insurance.js +20 -0
- package/dist/taxes/income-tax.d.ts +39 -0
- package/dist/taxes/income-tax.js +593 -0
- package/dist/taxes/index.d.ts +4 -0
- package/dist/taxes/index.js +20 -0
- package/dist/taxes/quebec-parental-insurance-plan.d.ts +9 -0
- package/dist/taxes/quebec-parental-insurance-plan.js +17 -0
- package/dist/utils/collections.d.ts +1 -0
- package/dist/utils/collections.js +7 -0
- package/dist/utils/date.d.ts +3 -0
- package/dist/utils/date.js +18 -0
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/index.js +19 -0
- package/dist/utils/math.d.ts +2 -0
- package/dist/utils/math.js +16 -0
- package/package.json +68 -0
- package/tsconfig.json +21 -0
package/.eslintrc.json
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": [
|
|
3
|
+
"@equisoft/eslint-config-typescript",
|
|
4
|
+
"plugin:import/typescript"
|
|
5
|
+
],
|
|
6
|
+
"settings": {
|
|
7
|
+
"import/resolver": {
|
|
8
|
+
"typescript": {
|
|
9
|
+
"project": [
|
|
10
|
+
"tsconfig.json",
|
|
11
|
+
"tests/tsconfig.json"
|
|
12
|
+
]
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"rules": {
|
|
17
|
+
"import/no-extraneous-dependencies": [
|
|
18
|
+
"error",
|
|
19
|
+
{
|
|
20
|
+
"devDependencies": [
|
|
21
|
+
"/*.js",
|
|
22
|
+
"test/**/*",
|
|
23
|
+
"**/*.test.{js,jsx,ts,tsx}",
|
|
24
|
+
"**/*.spec.{js,jsx,ts,tsx}"
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
},
|
|
29
|
+
"overrides": [
|
|
30
|
+
{
|
|
31
|
+
"files": ["test/**/*"],
|
|
32
|
+
"rules": {
|
|
33
|
+
"import/no-unresolved": [
|
|
34
|
+
"error",
|
|
35
|
+
{
|
|
36
|
+
"ignore": ["^~/"]
|
|
37
|
+
}
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
]
|
|
42
|
+
}
|
package/.tool-versions
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
nodejs 22.17.0
|
package/Makefile
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
BASE_DIR := $(dir $(realpath $(firstword $(MAKEFILE_LIST))))
|
|
2
|
+
OS_TYPE := $(shell uname -s)
|
|
3
|
+
|
|
4
|
+
.PHONY: all
|
|
5
|
+
all: setup check compile test
|
|
6
|
+
|
|
7
|
+
.PHONY: setup
|
|
8
|
+
setup:
|
|
9
|
+
@asdf plugin update nodejs || (asdf plugin add nodejs && ~/.asdf/plugins/nodejs/bin/import-release-team-keyring)
|
|
10
|
+
@asdf plugin update yarn || asdf plugin add yarn
|
|
11
|
+
@asdf install
|
|
12
|
+
@yarn --cwd "$(BASE_DIR)"
|
|
13
|
+
|
|
14
|
+
.PHONY: check
|
|
15
|
+
check:
|
|
16
|
+
@yarn eslint
|
|
17
|
+
|
|
18
|
+
.PHONY: dev
|
|
19
|
+
dev:
|
|
20
|
+
@yarn dev:watch
|
|
21
|
+
|
|
22
|
+
.PHONY: compile
|
|
23
|
+
compile:
|
|
24
|
+
@yarn build
|
|
25
|
+
|
|
26
|
+
.PHONY: test
|
|
27
|
+
test:
|
|
28
|
+
@yarn test
|
package/README.md
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# tax-us
|
|
2
|
+
|
|
3
|
+
## Description
|
|
4
|
+
|
|
5
|
+
The `tax-us` library contains up-to-date provincial and federal tax data and calculation functions.
|
|
6
|
+
|
|
7
|
+
We built it so that we would have a single source of truth for taxes data across all of our applications. The initial version is derived from code from the `fna-engine` and `kronos-fna` repositories.
|
|
8
|
+
|
|
9
|
+
As we develop and update `tax-us`, we will try to make it as application-agnostic as possible.
|
|
10
|
+
|
|
11
|
+
## Installation
|
|
12
|
+
|
|
13
|
+
Using `npm` :
|
|
14
|
+
```
|
|
15
|
+
npm install @equisoft/tax-us --save
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Using `yarn` :
|
|
19
|
+
```
|
|
20
|
+
yarn add @equisoft/tax-us
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Versions
|
|
24
|
+
|
|
25
|
+
The `major` portion of the library version is named according to the year of the dataset it contains. There could be breaking changes (such as modifications to the data structure) in both `major` and `minor` updates.
|
|
26
|
+
|
|
27
|
+
Updates at the `patch` level are reserved for bug fixes, non-breaking changes and minor improvements.
|
|
28
|
+
|
|
29
|
+
We suggest you lock the library dependency to the `minor` version and execute exhaustive testing before migrating to a new version to avoid unintentional regression.
|
|
30
|
+
|
|
31
|
+
```javascript
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"@equisoft/tax-us": "^2018.0.4",
|
|
34
|
+
},
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
## Usage
|
|
39
|
+
|
|
40
|
+
To use the library, we recommend you start by going through the **Modules** list (see below) to locate the data set or function you are looking for.
|
|
41
|
+
|
|
42
|
+
Once you know where your target data or function is located, simply import the module then access it directly in the code.
|
|
43
|
+
|
|
44
|
+
```javascript
|
|
45
|
+
import { PENSION } from '@equisoft/tax-us';
|
|
46
|
+
|
|
47
|
+
const { OAS, CPP } = PENSION;
|
|
48
|
+
|
|
49
|
+
console.log("OAS maximum age: ", OAS.MAX_AGE); // 70
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
## Modules
|
|
54
|
+
|
|
55
|
+
### `INVESTMENTS`
|
|
56
|
+
|
|
57
|
+
Data relating to registered investments accounts.
|
|
58
|
+
|
|
59
|
+
```
|
|
60
|
+
INVESTMENTS
|
|
61
|
+
|--LifeIncomeFund
|
|
62
|
+
|--RegisteredRetirementIncomeFund
|
|
63
|
+
|--RegisteredRetirementSavingsPlan
|
|
64
|
+
|--TaxFreeSavingsAccount
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### `PENSION`
|
|
68
|
+
|
|
69
|
+
Data relating to federal and provincial pension plans.
|
|
70
|
+
|
|
71
|
+
```
|
|
72
|
+
PENSION
|
|
73
|
+
|--CanadaPensionPlan
|
|
74
|
+
|--OldAgeSecurity
|
|
75
|
+
|--PublicPensionPlan
|
|
76
|
+
|--QuebecPensionPlan
|
|
77
|
+
|--SupplementalPensionPlan
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### `TAXES`
|
|
81
|
+
|
|
82
|
+
Data relating to federal and provincial income taxes and social charges.
|
|
83
|
+
|
|
84
|
+
```
|
|
85
|
+
TAXES
|
|
86
|
+
|--DividendCredit
|
|
87
|
+
|--EmploymentInsurance
|
|
88
|
+
|--IncomeTax
|
|
89
|
+
|--QuebecParentalInsurancePlan
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### `MISC`
|
|
93
|
+
|
|
94
|
+
Complementary data useful in a tax calculation context.
|
|
95
|
+
|
|
96
|
+
```
|
|
97
|
+
MISC
|
|
98
|
+
|--ConsumerPriceIndex
|
|
99
|
+
|--IPFStats
|
|
100
|
+
|--LifeExpectancy
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
## Development
|
|
105
|
+
|
|
106
|
+
This library is maintained by the _Equisoft/plan_ product team in Quebec City, QC, Canada.
|
|
107
|
+
|
|
108
|
+
We strongly value [inner source](https://en.wikipedia.org/wiki/Inner_source) practices within Equisoft and encourage contributors external to the FNA team to submit issues (including feature requests) and pull requests to the repository.
|
|
109
|
+
|
|
110
|
+
## Release
|
|
111
|
+
|
|
112
|
+
Versions of this package are built by Github Actions.
|
|
113
|
+
All you need to do is create a new tag and release using the Github Interface.
|
package/RELEASE.md
ADDED
package/babel.config.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = {presets: ['@babel/preset-env', '@babel/preset-typescript']}
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./investments"), exports);
|
|
18
|
+
__exportStar(require("./misc"), exports);
|
|
19
|
+
__exportStar(require("./pension"), exports);
|
|
20
|
+
__exportStar(require("./taxes"), exports);
|
|
21
|
+
__exportStar(require("./utils"), exports);
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export * from './life-income-fund';
|
|
2
|
+
export * from './registered-retirement-income-fund';
|
|
3
|
+
export * from './registered-retirement-savings-plan';
|
|
4
|
+
export * from './tax-free-savings-account';
|
|
5
|
+
export * from './non-registered-savings-plan';
|
|
6
|
+
export * from './registered-education-savings-plan';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./life-income-fund"), exports);
|
|
18
|
+
__exportStar(require("./registered-retirement-income-fund"), exports);
|
|
19
|
+
__exportStar(require("./registered-retirement-savings-plan"), exports);
|
|
20
|
+
__exportStar(require("./tax-free-savings-account"), exports);
|
|
21
|
+
__exportStar(require("./non-registered-savings-plan"), exports);
|
|
22
|
+
__exportStar(require("./registered-education-savings-plan"), exports);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ByProvince, FederalCode, ProvinceCode } from '../misc';
|
|
2
|
+
interface MaxWithdrawalPctByAge {
|
|
3
|
+
[key: number]: number;
|
|
4
|
+
}
|
|
5
|
+
export declare const province1MaxWithdrawalPct: MaxWithdrawalPctByAge;
|
|
6
|
+
export declare const province2MaxWithdrawalPct: MaxWithdrawalPctByAge;
|
|
7
|
+
export declare const othersMaxWithdrawalPct: MaxWithdrawalPctByAge;
|
|
8
|
+
export declare const federalMaxWithdrawalPct: MaxWithdrawalPctByAge;
|
|
9
|
+
export declare function getMaxWithdrawalPct(jurisdiction: ProvinceCode | FederalCode, age: number): number;
|
|
10
|
+
export declare const YMPEUnlockingSmallBalance: ByProvince<number>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// tslint:disable:max-line-length
|
|
3
|
+
/*
|
|
4
|
+
Sources
|
|
5
|
+
Provincial: https://www.empire.ca/sites/default/files/2024-02/INV-996A-LIFMinMaxWithdrawalPercentages-EN-web.pdf
|
|
6
|
+
https://ca.rbcwealthmanagement.com/documents/1647873/2467026/2023+-+Registered+Plan+Minimums+%26+Maximums.pdf/f26cb471-e962-47cd-9033-fc1d9c34663e
|
|
7
|
+
Federal & Territories & PEI : http://www.osfi-bsif.gc.ca/Eng/pp-rr/faq/Pages/lif-frv.aspx
|
|
8
|
+
|
|
9
|
+
Conversion for Federal, Territories and PEI
|
|
10
|
+
Because the age of reference is at the end of the previous year, we must shift the reference rate
|
|
11
|
+
by one year to reflect the calculation engine which uses the age at the end of the current year.
|
|
12
|
+
i.e. : Gov has a rate for age 60 but we use it for age 61.
|
|
13
|
+
|
|
14
|
+
Revised
|
|
15
|
+
2024-12-23
|
|
16
|
+
*/
|
|
17
|
+
// tslint:enable:max-line-length
|
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
exports.YMPEUnlockingSmallBalance = exports.federalMaxWithdrawalPct = exports.othersMaxWithdrawalPct = exports.province2MaxWithdrawalPct = exports.province1MaxWithdrawalPct = void 0;
|
|
20
|
+
exports.getMaxWithdrawalPct = getMaxWithdrawalPct;
|
|
21
|
+
const utils_1 = require("../utils");
|
|
22
|
+
/* Alberta (AB), British Columbia (BC), Ontario (ON), New Brunswick (NB),
|
|
23
|
+
Newfoundland and Labrador (NL), Saskatchewan (SK)
|
|
24
|
+
*/
|
|
25
|
+
exports.province1MaxWithdrawalPct = {
|
|
26
|
+
51: 0.0627,
|
|
27
|
+
52: 0.0631,
|
|
28
|
+
53: 0.0635,
|
|
29
|
+
54: 0.0640,
|
|
30
|
+
55: 0.0645,
|
|
31
|
+
56: 0.0651,
|
|
32
|
+
57: 0.0657,
|
|
33
|
+
58: 0.0663,
|
|
34
|
+
59: 0.0670,
|
|
35
|
+
60: 0.0677,
|
|
36
|
+
61: 0.0685,
|
|
37
|
+
62: 0.0694,
|
|
38
|
+
63: 0.0704,
|
|
39
|
+
64: 0.0714,
|
|
40
|
+
65: 0.0726,
|
|
41
|
+
66: 0.0738,
|
|
42
|
+
67: 0.0752,
|
|
43
|
+
68: 0.0767,
|
|
44
|
+
69: 0.0783,
|
|
45
|
+
70: 0.0802,
|
|
46
|
+
71: 0.0822,
|
|
47
|
+
72: 0.0845,
|
|
48
|
+
73: 0.0871,
|
|
49
|
+
74: 0.0900,
|
|
50
|
+
75: 0.0934,
|
|
51
|
+
76: 0.0971,
|
|
52
|
+
77: 0.1015,
|
|
53
|
+
78: 0.1066,
|
|
54
|
+
79: 0.1125,
|
|
55
|
+
80: 0.1196,
|
|
56
|
+
81: 0.1282,
|
|
57
|
+
82: 0.1387,
|
|
58
|
+
83: 0.1519,
|
|
59
|
+
84: 0.1690,
|
|
60
|
+
85: 0.1919,
|
|
61
|
+
86: 0.2240,
|
|
62
|
+
87: 0.2723,
|
|
63
|
+
88: 0.3529,
|
|
64
|
+
89: 0.5146,
|
|
65
|
+
90: 1,
|
|
66
|
+
};
|
|
67
|
+
// Quebec (QC), Manitoba (MB), Nova Scotia (NS)
|
|
68
|
+
exports.province2MaxWithdrawalPct = {
|
|
69
|
+
51: 0.0610,
|
|
70
|
+
52: 0.0610,
|
|
71
|
+
53: 0.0610,
|
|
72
|
+
54: 0.0610,
|
|
73
|
+
55: 0.0610,
|
|
74
|
+
56: 0.0640,
|
|
75
|
+
57: 0.0650,
|
|
76
|
+
58: 0.0650,
|
|
77
|
+
59: 0.0660,
|
|
78
|
+
60: 0.0670,
|
|
79
|
+
61: 0.0670,
|
|
80
|
+
62: 0.0680,
|
|
81
|
+
63: 0.0690,
|
|
82
|
+
64: 0.0700,
|
|
83
|
+
65: 0.0710,
|
|
84
|
+
66: 0.0720,
|
|
85
|
+
67: 0.0730,
|
|
86
|
+
68: 0.0740,
|
|
87
|
+
69: 0.0760,
|
|
88
|
+
70: 0.0770,
|
|
89
|
+
71: 0.0790,
|
|
90
|
+
72: 0.0810,
|
|
91
|
+
73: 0.0830,
|
|
92
|
+
74: 0.0850,
|
|
93
|
+
75: 0.0880,
|
|
94
|
+
76: 0.0910,
|
|
95
|
+
77: 0.0940,
|
|
96
|
+
78: 0.0980,
|
|
97
|
+
79: 0.1030,
|
|
98
|
+
80: 0.1080,
|
|
99
|
+
81: 0.1150,
|
|
100
|
+
82: 0.1210,
|
|
101
|
+
83: 0.1290,
|
|
102
|
+
84: 0.1380,
|
|
103
|
+
85: 0.1480,
|
|
104
|
+
86: 0.1600,
|
|
105
|
+
87: 0.1730,
|
|
106
|
+
88: 0.1890,
|
|
107
|
+
89: 0.2000,
|
|
108
|
+
};
|
|
109
|
+
// Others: Northwest Territories (NT), Nunavut (NU), Prince Edward Island (PE), Yukon (YT)
|
|
110
|
+
exports.othersMaxWithdrawalPct = {
|
|
111
|
+
20: 0.044298,
|
|
112
|
+
21: 0.04435,
|
|
113
|
+
22: 0.044406,
|
|
114
|
+
23: 0.044465,
|
|
115
|
+
24: 0.044528,
|
|
116
|
+
25: 0.044594,
|
|
117
|
+
26: 0.044665,
|
|
118
|
+
27: 0.04474,
|
|
119
|
+
28: 0.044821,
|
|
120
|
+
29: 0.044906,
|
|
121
|
+
30: 0.044996,
|
|
122
|
+
31: 0.045093,
|
|
123
|
+
32: 0.045196,
|
|
124
|
+
33: 0.045305,
|
|
125
|
+
34: 0.045422,
|
|
126
|
+
35: 0.045546,
|
|
127
|
+
36: 0.045679,
|
|
128
|
+
37: 0.04582,
|
|
129
|
+
38: 0.045971,
|
|
130
|
+
39: 0.046132,
|
|
131
|
+
40: 0.046304,
|
|
132
|
+
41: 0.046487,
|
|
133
|
+
42: 0.046683,
|
|
134
|
+
43: 0.046893,
|
|
135
|
+
44: 0.047117,
|
|
136
|
+
45: 0.047357,
|
|
137
|
+
46: 0.047614,
|
|
138
|
+
47: 0.04789,
|
|
139
|
+
48: 0.048186,
|
|
140
|
+
49: 0.048503,
|
|
141
|
+
50: 0.048844,
|
|
142
|
+
51: 0.049211,
|
|
143
|
+
52: 0.049606,
|
|
144
|
+
53: 0.050032,
|
|
145
|
+
54: 0.050491,
|
|
146
|
+
55: 0.050987,
|
|
147
|
+
56: 0.051524,
|
|
148
|
+
57: 0.052105,
|
|
149
|
+
58: 0.052736,
|
|
150
|
+
59: 0.053421,
|
|
151
|
+
60: 0.054168,
|
|
152
|
+
61: 0.054982,
|
|
153
|
+
62: 0.055872,
|
|
154
|
+
63: 0.056848,
|
|
155
|
+
64: 0.05792,
|
|
156
|
+
65: 0.059101,
|
|
157
|
+
66: 0.060407,
|
|
158
|
+
67: 0.061856,
|
|
159
|
+
68: 0.063469,
|
|
160
|
+
69: 0.065275,
|
|
161
|
+
70: 0.067303,
|
|
162
|
+
71: 0.069597,
|
|
163
|
+
72: 0.072204,
|
|
164
|
+
73: 0.07519,
|
|
165
|
+
74: 0.078638,
|
|
166
|
+
75: 0.082655,
|
|
167
|
+
76: 0.087258,
|
|
168
|
+
77: 0.092582,
|
|
169
|
+
78: 0.098807,
|
|
170
|
+
79: 0.106178,
|
|
171
|
+
80: 0.115041,
|
|
172
|
+
81: 0.125892,
|
|
173
|
+
82: 0.139476,
|
|
174
|
+
83: 0.156966,
|
|
175
|
+
84: 0.180313,
|
|
176
|
+
85: 0.213033,
|
|
177
|
+
86: 0.262155,
|
|
178
|
+
87: 0.344082,
|
|
179
|
+
88: 0.508019,
|
|
180
|
+
89: 1,
|
|
181
|
+
};
|
|
182
|
+
// Federal
|
|
183
|
+
exports.federalMaxWithdrawalPct = {
|
|
184
|
+
20: 0.044298,
|
|
185
|
+
21: 0.04435,
|
|
186
|
+
22: 0.044406,
|
|
187
|
+
23: 0.044465,
|
|
188
|
+
24: 0.044528,
|
|
189
|
+
25: 0.044594,
|
|
190
|
+
26: 0.044665,
|
|
191
|
+
27: 0.04474,
|
|
192
|
+
28: 0.044821,
|
|
193
|
+
29: 0.044906,
|
|
194
|
+
30: 0.044996,
|
|
195
|
+
31: 0.045093,
|
|
196
|
+
32: 0.045196,
|
|
197
|
+
33: 0.045305,
|
|
198
|
+
34: 0.045422,
|
|
199
|
+
35: 0.045546,
|
|
200
|
+
36: 0.045679,
|
|
201
|
+
37: 0.04582,
|
|
202
|
+
38: 0.045971,
|
|
203
|
+
39: 0.046132,
|
|
204
|
+
40: 0.046304,
|
|
205
|
+
41: 0.046487,
|
|
206
|
+
42: 0.046683,
|
|
207
|
+
43: 0.046893,
|
|
208
|
+
44: 0.047117,
|
|
209
|
+
45: 0.047357,
|
|
210
|
+
46: 0.047614,
|
|
211
|
+
47: 0.04789,
|
|
212
|
+
48: 0.048186,
|
|
213
|
+
49: 0.048503,
|
|
214
|
+
50: 0.048844,
|
|
215
|
+
51: 0.049211,
|
|
216
|
+
52: 0.049606,
|
|
217
|
+
53: 0.050032,
|
|
218
|
+
54: 0.050491,
|
|
219
|
+
55: 0.050987,
|
|
220
|
+
56: 0.051524,
|
|
221
|
+
57: 0.052105,
|
|
222
|
+
58: 0.052736,
|
|
223
|
+
59: 0.053421,
|
|
224
|
+
60: 0.054168,
|
|
225
|
+
61: 0.054982,
|
|
226
|
+
62: 0.055872,
|
|
227
|
+
63: 0.056848,
|
|
228
|
+
64: 0.05792,
|
|
229
|
+
65: 0.059101,
|
|
230
|
+
66: 0.060407,
|
|
231
|
+
67: 0.061856,
|
|
232
|
+
68: 0.063469,
|
|
233
|
+
69: 0.065275,
|
|
234
|
+
70: 0.067303,
|
|
235
|
+
71: 0.069597,
|
|
236
|
+
72: 0.072204,
|
|
237
|
+
73: 0.07519,
|
|
238
|
+
74: 0.078638,
|
|
239
|
+
75: 0.082655,
|
|
240
|
+
76: 0.087258,
|
|
241
|
+
77: 0.092582,
|
|
242
|
+
78: 0.098807,
|
|
243
|
+
79: 0.106178,
|
|
244
|
+
80: 0.115041,
|
|
245
|
+
81: 0.125892,
|
|
246
|
+
82: 0.139476,
|
|
247
|
+
83: 0.156966,
|
|
248
|
+
84: 0.180313,
|
|
249
|
+
85: 0.213033,
|
|
250
|
+
86: 0.262155,
|
|
251
|
+
87: 0.344082,
|
|
252
|
+
88: 0.508019,
|
|
253
|
+
89: 1,
|
|
254
|
+
};
|
|
255
|
+
function getMaxWithdrawalPct(jurisdiction, age) {
|
|
256
|
+
const getAgeLimitByProvinceGroup = (group, biggest = true) => ((biggest)
|
|
257
|
+
? Math.max(...Object.keys(group).map(Number))
|
|
258
|
+
: Math.min(...Object.keys(group).map(Number)));
|
|
259
|
+
switch (jurisdiction) {
|
|
260
|
+
case 'AB':
|
|
261
|
+
case 'BC':
|
|
262
|
+
case 'ON':
|
|
263
|
+
case 'NB':
|
|
264
|
+
case 'NL':
|
|
265
|
+
case 'SK':
|
|
266
|
+
return exports.province1MaxWithdrawalPct[(0, utils_1.clamp)(age, getAgeLimitByProvinceGroup(exports.province1MaxWithdrawalPct, false), getAgeLimitByProvinceGroup(exports.province1MaxWithdrawalPct))];
|
|
267
|
+
case 'QC':
|
|
268
|
+
case 'MB':
|
|
269
|
+
case 'NS':
|
|
270
|
+
return exports.province2MaxWithdrawalPct[(0, utils_1.clamp)(age, getAgeLimitByProvinceGroup(exports.province2MaxWithdrawalPct, false), getAgeLimitByProvinceGroup(exports.province2MaxWithdrawalPct))];
|
|
271
|
+
case 'CA':
|
|
272
|
+
return exports.federalMaxWithdrawalPct[(0, utils_1.clamp)(age, getAgeLimitByProvinceGroup(exports.federalMaxWithdrawalPct, false), getAgeLimitByProvinceGroup(exports.federalMaxWithdrawalPct))];
|
|
273
|
+
default:
|
|
274
|
+
return exports.othersMaxWithdrawalPct[(0, utils_1.clamp)(age, getAgeLimitByProvinceGroup(exports.othersMaxWithdrawalPct, false), getAgeLimitByProvinceGroup(exports.othersMaxWithdrawalPct))];
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
exports.YMPEUnlockingSmallBalance = {
|
|
278
|
+
AB: 0.4,
|
|
279
|
+
BC: 0.4,
|
|
280
|
+
MB: 0.4,
|
|
281
|
+
NB: 0.4,
|
|
282
|
+
NL: 0.4,
|
|
283
|
+
NS: 0.5,
|
|
284
|
+
PE: 0.4,
|
|
285
|
+
ON: 0.4,
|
|
286
|
+
QC: 0.4,
|
|
287
|
+
SK: 0.4,
|
|
288
|
+
NT: 0.4,
|
|
289
|
+
NU: 0.4,
|
|
290
|
+
YT: 0.4,
|
|
291
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// tslint:disable:max-line-length
|
|
3
|
+
/*
|
|
4
|
+
Sources
|
|
5
|
+
https://www.canada.ca/en/department-finance/news/2024/06/capital-gains-inclusion-rate.html
|
|
6
|
+
https://www.revenuquebec.ca/en/press-room/tax-news/details/2024-06-19/capital-gains-inclusion-rate-increase-1/
|
|
7
|
+
|
|
8
|
+
Revised
|
|
9
|
+
2024-12-30
|
|
10
|
+
*/
|
|
11
|
+
// tslint:enable:max-line-length
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.CAPITAL_GAINS_BRACKETS = void 0;
|
|
14
|
+
exports.getCapitalGainsTaxableAmount = getCapitalGainsTaxableAmount;
|
|
15
|
+
exports.CAPITAL_GAINS_BRACKETS = [
|
|
16
|
+
{
|
|
17
|
+
FROM: 0,
|
|
18
|
+
TO: Infinity,
|
|
19
|
+
RATE: 0.5,
|
|
20
|
+
},
|
|
21
|
+
];
|
|
22
|
+
function getCapitalGainsTaxableAmount(totalCapitalGains) {
|
|
23
|
+
return exports.CAPITAL_GAINS_BRACKETS.reduce((taxableAmount, currentBracket) => {
|
|
24
|
+
const currentBracketRate = currentBracket.RATE;
|
|
25
|
+
const bracketTaxableAmount = Math.min(totalCapitalGains, currentBracket.TO);
|
|
26
|
+
if (bracketTaxableAmount <= currentBracket.FROM)
|
|
27
|
+
return taxableAmount;
|
|
28
|
+
return taxableAmount + ((bracketTaxableAmount - currentBracket.FROM) * currentBracketRate);
|
|
29
|
+
}, 0);
|
|
30
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
Sources
|
|
4
|
+
https://www150.statcan.gc.ca/t1/tbl1/en/tv.action?pid=3710004501&cubeTimeFrame.startYear=2024+%2F+2025&cubeTimeFrame.endYear=2024+%2F+2025&referencePeriods=20240101%2C20240101
|
|
5
|
+
|
|
6
|
+
Revised data
|
|
7
|
+
2024-09-04
|
|
8
|
+
|
|
9
|
+
Last updated
|
|
10
|
+
2025-02-07
|
|
11
|
+
*/
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.Beneficiary = void 0;
|
|
14
|
+
exports.Beneficiary = {
|
|
15
|
+
MAX_AGE: 35,
|
|
16
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface BritishColumbiaTrainingAndEducationSavingsGrant {
|
|
2
|
+
BENEFICIARY_AGE_ALLOCATION: number;
|
|
3
|
+
MAX_GRANT: number;
|
|
4
|
+
getTotalForAYear: (beneficiaryAge: number) => number;
|
|
5
|
+
}
|
|
6
|
+
export interface BritishColumbiaTrainingAndEducationSavingsGrantData {
|
|
7
|
+
BENEFICIARY_AGE_ALLOCATION: number;
|
|
8
|
+
MAX_GRANT: number;
|
|
9
|
+
}
|
|
10
|
+
export declare const BritishColumbiaTrainingAndEducationSavingsGrant: BritishColumbiaTrainingAndEducationSavingsGrant;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
Sources
|
|
4
|
+
https://www.canada.ca/en/employment-social-development/services/student-financial-aid/education-savings/resp/resp-promoters/infocapsules/bc.html
|
|
5
|
+
|
|
6
|
+
Last updated
|
|
7
|
+
2025-02-11
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.BritishColumbiaTrainingAndEducationSavingsGrant = void 0;
|
|
11
|
+
const BritishColumbiaTrainingAndEducationSavingsGrantData = {
|
|
12
|
+
BENEFICIARY_AGE_ALLOCATION: 6,
|
|
13
|
+
MAX_GRANT: 1200,
|
|
14
|
+
};
|
|
15
|
+
// Pour simplifier, on assume que si l'enfant a > 6ans, la subvention a déjà été allouée
|
|
16
|
+
// Comme on peut l'allouer une seule fois, on la donne à 6ans
|
|
17
|
+
const getTotalForAYear = (beneficiaryAge) => {
|
|
18
|
+
const { BENEFICIARY_AGE_ALLOCATION, MAX_GRANT } = BritishColumbiaTrainingAndEducationSavingsGrantData;
|
|
19
|
+
return beneficiaryAge === BENEFICIARY_AGE_ALLOCATION ? MAX_GRANT : 0;
|
|
20
|
+
};
|
|
21
|
+
exports.BritishColumbiaTrainingAndEducationSavingsGrant = Object.assign(Object.assign({}, BritishColumbiaTrainingAndEducationSavingsGrantData), { getTotalForAYear });
|