@classytic/ca-tax 0.0.18 → 0.0.19
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/CHANGELOG.md +65 -0
- package/dist/forms.mjs +44 -39
- package/dist/index3.d.mts +113 -1
- package/dist/t2.mjs +109 -12
- package/package.json +4 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,70 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.19] - 2026-09-09
|
|
4
|
+
|
|
5
|
+
### Fixed — AT1 Schedule 12 was missing three mandatory computed lines entirely
|
|
6
|
+
|
|
7
|
+
Lines 050, 090 and 091 are all marked `M` (mandatory) in §3.2.3.13 and none was ever filed. The
|
|
8
|
+
schedule went out with net income at 054 but neither the federal total that produces it (050)
|
|
9
|
+
nor the taxable income it leads to (090/091) — and 090 is what AT1 page 2 line 062 is taken
|
|
10
|
+
from, so its absence left the jacket's own taxable income undisclosed on the schedule that
|
|
11
|
+
derives it.
|
|
12
|
+
|
|
13
|
+
- **050** — the federal/Alberta discretionary-difference total, signed per the spec's own
|
|
14
|
+
formula (`−005 +007 −009 −011 +013 +015 −017 +019 −021 −023 −027 −029 −031 −033 +037 −039
|
|
15
|
+
+041`). Filed as an explicit zero, not omitted, when nothing diverges — the spec states so
|
|
16
|
+
verbatim.
|
|
17
|
+
- **090/091** — taxable income, Alberta and federal: `054 − (Area B Alberta) + 082` and
|
|
18
|
+
`002 − (Area B federal) + 083`, with the printed qualification that a corporation whose
|
|
19
|
+
deductions exhaust its income reports its s.110.5 additions as the figure rather than a
|
|
20
|
+
negative. New `Schedule12FilingInput.taxableIncome?: { alberta, federal }` lets a caller
|
|
21
|
+
supply the real computed figure instead — the line-derived sum is only as complete as the
|
|
22
|
+
deduction lines this engine actually models (a central credit union allocation, prospector's
|
|
23
|
+
shares, the non-qualified-securities deduction, if uncarried, would silently overstate it).
|
|
24
|
+
Line 052 (the printed subtotal en route to 054) and Area B's own 080/081 subtotals are
|
|
25
|
+
confirmed print-only — no line code, nothing to file — same as the jacket's line 088.
|
|
26
|
+
|
|
27
|
+
### Added — five previously-unfiled Schedule 12 Area B pairs
|
|
28
|
+
|
|
29
|
+
Taxable dividends deductible (060/061), Part VI.1 tax deduction (062/063), central credit union
|
|
30
|
+
allocation (074/075), prospector's and grubstaker's shares (078/079), non-qualified-securities
|
|
31
|
+
employer deduction (140/141) — all mandatory pairs with no prior emitter. Each now transmits
|
|
32
|
+
both sides whenever the caller supplies it; absent data stays unfiled rather than defaulting to
|
|
33
|
+
zero, since filing 0 would assert a deduction the corporation is not known to lack.
|
|
34
|
+
|
|
35
|
+
### Fixed — Schedule 12's s.110.5 additions line traced a typo on TRA's own printed form
|
|
36
|
+
|
|
37
|
+
083 is annotated on the page as "T2 line 335" — that line is limited partnership losses, a
|
|
38
|
+
*deduction*, already this schedule's 072/073 pair, and cannot be what an *additions* line reads.
|
|
39
|
+
§3.2.3.13's own rule says "must equal fed 200355", and CRA line 355 is the s.110.5/115(1)(a)(vii)
|
|
40
|
+
additions line. The engine now follows the spec and CRA over the form's own annotation, per
|
|
41
|
+
`section110_5Additions`.
|
|
42
|
+
|
|
43
|
+
### Fixed — Schedule 12 label and note corrections
|
|
44
|
+
|
|
45
|
+
"Taxable dividends deductible under ITA s.112, 113 or **186**(6)" corrected to **138**(6). Four
|
|
46
|
+
Area B notes claiming "no Alberta divergence path" or "both sides read the same federal line"
|
|
47
|
+
corrected — each box in fact accepts a preparer-entered Alberta-side override; there was simply
|
|
48
|
+
no modelled path to supply one until this release.
|
|
49
|
+
|
|
50
|
+
### Fixed — Schedule 18's ABIL rows filed the name and shares/debt flag but none of the money
|
|
51
|
+
|
|
52
|
+
Every printed column on the small-business-corporation row is its own filed box — 086 (date of
|
|
53
|
+
acquisition), 088/090/092 (proceeds, adjusted cost base, outlays) — and the emitter previously
|
|
54
|
+
wrote only 082 and 084. The 094 total was correct; nothing underneath it showed TRA how the loss
|
|
55
|
+
was arrived at. 086 is genuinely optional on the form and is omitted (not filed as an empty
|
|
56
|
+
string) when no acquisition date is recorded.
|
|
57
|
+
|
|
58
|
+
### Fixed — Schedule 18's `FormDefinition` invented a page section that isn't on the form
|
|
59
|
+
|
|
60
|
+
The definition split dispositions into two sections, "Dispositions by category" and "Adjustments
|
|
61
|
+
to the total gain" (lines 062-099). The form prints exactly two block headings total — capital
|
|
62
|
+
property dispositions (page 1) and the ABIL block (page 2) — and every line the definition had
|
|
63
|
+
called "adjustments" sits under the same page-1 heading as the six-category grid above it. A
|
|
64
|
+
preparer holding the paper form would look for that second heading and not find it. Merged back
|
|
65
|
+
into one `dispositions` section per the actual page; both sections now carry their printed page
|
|
66
|
+
number.
|
|
67
|
+
|
|
3
68
|
## [0.0.18] - 2026-09-08
|
|
4
69
|
|
|
5
70
|
### Removed — AT1 Schedules 5, 6, 7, 8 and 9 (BREAKING)
|
package/dist/forms.mjs
CHANGED
|
@@ -1810,12 +1810,12 @@ const AT1_SCHEDULE_12_PAIRS = [
|
|
|
1810
1810
|
note: "If Schedule 20 exists, Alberta = 020076; otherwise Alberta = federal."
|
|
1811
1811
|
},
|
|
1812
1812
|
{
|
|
1813
|
-
label: "Taxable dividends deductible under ITA s.112, 113 or
|
|
1813
|
+
label: "Taxable dividends deductible under ITA s.112, 113 or 138(6)",
|
|
1814
1814
|
federal: "061",
|
|
1815
1815
|
alberta: "060",
|
|
1816
1816
|
section: "area-b",
|
|
1817
1817
|
emitOnlyWhenDifferent: false,
|
|
1818
|
-
note: "
|
|
1818
|
+
note: "Alberta = federal unless the preparer enters a different amount (ri.albertaSchedule12.albertaTaxableDividendsDeductible) — no Alberta schedule computes this independently, but the box is not fixed to federal by rule."
|
|
1819
1819
|
},
|
|
1820
1820
|
{
|
|
1821
1821
|
label: "Part VI.1 tax deduction",
|
|
@@ -1879,7 +1879,7 @@ const AT1_SCHEDULE_12_PAIRS = [
|
|
|
1879
1879
|
alberta: "074",
|
|
1880
1880
|
section: "area-b",
|
|
1881
1881
|
emitOnlyWhenDifferent: false,
|
|
1882
|
-
note: "
|
|
1882
|
+
note: "Alberta = federal unless the preparer enters a different amount (ri.albertaSchedule12.albertaCentralCreditUnionAllocation) — no Alberta schedule computes this independently, but the box is not fixed to federal by rule."
|
|
1883
1883
|
},
|
|
1884
1884
|
{
|
|
1885
1885
|
label: "Prospector's and grubstaker's shares",
|
|
@@ -1887,7 +1887,7 @@ const AT1_SCHEDULE_12_PAIRS = [
|
|
|
1887
1887
|
alberta: "078",
|
|
1888
1888
|
section: "area-b",
|
|
1889
1889
|
emitOnlyWhenDifferent: false,
|
|
1890
|
-
note: "
|
|
1890
|
+
note: "The federal side reads T2 line 350, which the form prints over the box. Alberta follows it unless the preparer enters a different amount (ri.albertaSchedule12.albertaProspectorsShares)."
|
|
1891
1891
|
},
|
|
1892
1892
|
{
|
|
1893
1893
|
label: "Employer deduction for non-qualified securities",
|
|
@@ -1895,7 +1895,7 @@ const AT1_SCHEDULE_12_PAIRS = [
|
|
|
1895
1895
|
alberta: "140",
|
|
1896
1896
|
section: "area-b",
|
|
1897
1897
|
emitOnlyWhenDifferent: false,
|
|
1898
|
-
note: "
|
|
1898
|
+
note: "The federal side reads T2 line 352. Alberta follows it unless the preparer enters a different amount (ri.albertaSchedule12.albertaNonQualifiedSecuritiesDeduction)."
|
|
1899
1899
|
},
|
|
1900
1900
|
{
|
|
1901
1901
|
label: "ITA section 110.5 and/or subparagraph 115(1)(a)(vii) additions",
|
|
@@ -2774,24 +2774,29 @@ const AT1_SCHEDULE_18_CATEGORIES = [
|
|
|
2774
2774
|
lossRestricted: true
|
|
2775
2775
|
}
|
|
2776
2776
|
];
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
|
|
2794
|
-
|
|
2777
|
+
/**
|
|
2778
|
+
* The form prints exactly TWO block headings, and these are them verbatim —
|
|
2779
|
+
* "CAPITAL PROPERTY DISPOSITIONS" on page 1 and the ABIL block on page 2.
|
|
2780
|
+
*
|
|
2781
|
+
* There used to be a third section here, "Adjustments to the total gain",
|
|
2782
|
+
* grouping lines 062-099. No such heading exists on the page: every one of
|
|
2783
|
+
* those lines sits inside the page-1 dispositions block, under the same
|
|
2784
|
+
* printed heading as the six-category grid above them. Splitting them out
|
|
2785
|
+
* read as a separate part of the form that a preparer holding the paper
|
|
2786
|
+
* would look for and not find, so they are back where the page puts them.
|
|
2787
|
+
*/
|
|
2788
|
+
const SECTIONS$25 = [{
|
|
2789
|
+
id: "dispositions",
|
|
2790
|
+
title: "Capital property dispositions",
|
|
2791
|
+
description: "Proceeds, cost base and outlays for each of six categories, then the reserves, donated securities, flow-through share threshold and section 34.2 partnership amounts that adjust the total. Losses on personal-use and listed personal property are restricted and do not net against ordinary gains.",
|
|
2792
|
+
page: 1
|
|
2793
|
+
}, {
|
|
2794
|
+
id: "abil",
|
|
2795
|
+
title: "Property qualifying for and resulting in an allowable business investment loss",
|
|
2796
|
+
secondary: true,
|
|
2797
|
+
description: "A capital loss on a small business corporation. Unlike an ordinary capital loss it is deductible against ANY income, which is why the form gives it its own page.",
|
|
2798
|
+
page: 2
|
|
2799
|
+
}];
|
|
2795
2800
|
/**
|
|
2796
2801
|
* The four printed columns, and the prefix §3.2.3.19 puts on each column's own
|
|
2797
2802
|
* Line Name — "Adjusted cost base: Total of all shares", not "Shares — B".
|
|
@@ -2857,7 +2862,7 @@ const REST = [
|
|
|
2857
2862
|
caption: "Total of Column D",
|
|
2858
2863
|
kind: "money",
|
|
2859
2864
|
role: "computed",
|
|
2860
|
-
section: "
|
|
2865
|
+
section: "dispositions",
|
|
2861
2866
|
note: "EXCLUDES lines 059 and 060 where the difference is a net loss — restricted losses are dropped, not netted. Summing column D over-deducts."
|
|
2862
2867
|
},
|
|
2863
2868
|
{
|
|
@@ -2865,28 +2870,28 @@ const REST = [
|
|
|
2865
2870
|
caption: "Capital gains dividends",
|
|
2866
2871
|
kind: "money",
|
|
2867
2872
|
role: "input",
|
|
2868
|
-
section: "
|
|
2873
|
+
section: "dispositions"
|
|
2869
2874
|
},
|
|
2870
2875
|
{
|
|
2871
2876
|
field: "066",
|
|
2872
2877
|
caption: "Add: capital gain reserve opening balance, if any",
|
|
2873
2878
|
kind: "money",
|
|
2874
2879
|
role: "input",
|
|
2875
|
-
section: "
|
|
2880
|
+
section: "dispositions"
|
|
2876
2881
|
},
|
|
2877
2882
|
{
|
|
2878
2883
|
field: "068",
|
|
2879
2884
|
caption: "Deduct: capital gain reserve closing balance, if any",
|
|
2880
2885
|
kind: "money",
|
|
2881
2886
|
role: "input",
|
|
2882
|
-
section: "
|
|
2887
|
+
section: "dispositions"
|
|
2883
2888
|
},
|
|
2884
2889
|
{
|
|
2885
2890
|
field: "070",
|
|
2886
2891
|
caption: "Capital gain or (loss): Line 062 + line 064 + line 066 - line 068",
|
|
2887
2892
|
kind: "money",
|
|
2888
2893
|
role: "computed",
|
|
2889
|
-
section: "
|
|
2894
|
+
section: "dispositions",
|
|
2890
2895
|
note: "Line 062 plus 064 plus 066 minus 068."
|
|
2891
2896
|
},
|
|
2892
2897
|
{
|
|
@@ -2894,21 +2899,21 @@ const REST = [
|
|
|
2894
2899
|
caption: "Deduct: Gain on the donation to a qualified donee of a share, debt obligation, or right listed on a designated stock exchange and other securities under paragraphs 38(a.1)(i) and (iii) of the federal Act",
|
|
2895
2900
|
kind: "money",
|
|
2896
2901
|
role: "input",
|
|
2897
|
-
section: "
|
|
2902
|
+
section: "dispositions"
|
|
2898
2903
|
},
|
|
2899
2904
|
{
|
|
2900
2905
|
field: "073",
|
|
2901
2906
|
caption: "Deduct: Gain on the donation to a qualified donee of ecologically sensitive land under paragraph 38(a.2) of the federal Act",
|
|
2902
2907
|
kind: "money",
|
|
2903
2908
|
role: "input",
|
|
2904
|
-
section: "
|
|
2909
|
+
section: "dispositions"
|
|
2905
2910
|
},
|
|
2906
2911
|
{
|
|
2907
2912
|
field: "075",
|
|
2908
2913
|
caption: "Line 070 minus (line 071 + 073)",
|
|
2909
2914
|
kind: "money",
|
|
2910
2915
|
role: "computed",
|
|
2911
|
-
section: "
|
|
2916
|
+
section: "dispositions",
|
|
2912
2917
|
note: "Line 070 minus lines 071 and 073."
|
|
2913
2918
|
},
|
|
2914
2919
|
{
|
|
@@ -2916,7 +2921,7 @@ const REST = [
|
|
|
2916
2921
|
caption: "Add: Exemption threshold at time of disposal",
|
|
2917
2922
|
kind: "money",
|
|
2918
2923
|
role: "input",
|
|
2919
|
-
section: "
|
|
2924
|
+
section: "dispositions",
|
|
2920
2925
|
note: "Flow-through share class of property — ITA subsection 40(12)."
|
|
2921
2926
|
},
|
|
2922
2927
|
{
|
|
@@ -2924,14 +2929,14 @@ const REST = [
|
|
|
2924
2929
|
caption: "Add: Total of all capital gains from the disposition of the actual property",
|
|
2925
2930
|
kind: "money",
|
|
2926
2931
|
role: "input",
|
|
2927
|
-
section: "
|
|
2932
|
+
section: "dispositions"
|
|
2928
2933
|
},
|
|
2929
2934
|
{
|
|
2930
2935
|
field: "079",
|
|
2931
2936
|
caption: "Lesser of lines 077 or 078",
|
|
2932
2937
|
kind: "money",
|
|
2933
2938
|
role: "computed",
|
|
2934
|
-
section: "
|
|
2939
|
+
section: "dispositions",
|
|
2935
2940
|
note: "The LESSER of lines 077 and 078 — not their sum. Adding them inflates the gain."
|
|
2936
2941
|
},
|
|
2937
2942
|
{
|
|
@@ -2939,7 +2944,7 @@ const REST = [
|
|
|
2939
2944
|
caption: "Taxable capital gains under section 34.2 of the federal Act (line 275 of federal Schedule 73, Income Inclusion Summary for Corporations that are members of Partnerships) X 2 =",
|
|
2940
2945
|
kind: "money",
|
|
2941
2946
|
role: "carried-in",
|
|
2942
|
-
section: "
|
|
2947
|
+
section: "dispositions",
|
|
2943
2948
|
from: {
|
|
2944
2949
|
form: "T2SCH73",
|
|
2945
2950
|
line: "270"
|
|
@@ -2951,7 +2956,7 @@ const REST = [
|
|
|
2951
2956
|
caption: "Subtotal: Line 075 + line 079 + line 096",
|
|
2952
2957
|
kind: "money",
|
|
2953
2958
|
role: "computed",
|
|
2954
|
-
section: "
|
|
2959
|
+
section: "dispositions",
|
|
2955
2960
|
note: "Lines 075 plus 079 plus 096."
|
|
2956
2961
|
},
|
|
2957
2962
|
{
|
|
@@ -2959,7 +2964,7 @@ const REST = [
|
|
|
2959
2964
|
caption: "Deduct: Allowable capital losses under section 34.2 of the federal Act (line 285 of federal Schedule 73, Income Inclusion Summary for Corporations that are Members of Partnerships) X 2 =",
|
|
2960
2965
|
kind: "money",
|
|
2961
2966
|
role: "carried-in",
|
|
2962
|
-
section: "
|
|
2967
|
+
section: "dispositions",
|
|
2963
2968
|
from: {
|
|
2964
2969
|
form: "T2SCH73",
|
|
2965
2970
|
line: "285"
|
|
@@ -2971,7 +2976,7 @@ const REST = [
|
|
|
2971
2976
|
caption: "Total capital gains or losses: Line 097 - line 098",
|
|
2972
2977
|
kind: "money",
|
|
2973
2978
|
role: "computed",
|
|
2974
|
-
section: "
|
|
2979
|
+
section: "dispositions",
|
|
2975
2980
|
note: "If line 099 is NEGATIVE, carry the capital loss forward to Schedule 21, line 057, and no taxable capital gain arises at line 076.",
|
|
2976
2981
|
to: {
|
|
2977
2982
|
form: "AT1SCH21",
|
|
@@ -2984,7 +2989,7 @@ const REST = [
|
|
|
2984
2989
|
caption: "Taxable capital gain: Line 099 X 50%",
|
|
2985
2990
|
kind: "money",
|
|
2986
2991
|
role: "computed",
|
|
2987
|
-
section: "
|
|
2992
|
+
section: "dispositions",
|
|
2988
2993
|
note: "Line 099 at the inclusion rate — the only place the halving happens. If line 099 is positive, carry this forward to Schedule 12, line 040. The 50% printed here is the current rate; a year whose dispositions straddle an inclusion-rate change needs supporting documentation with the RSI (§3.2.3.19 filing-requirement exception).",
|
|
2989
2994
|
to: {
|
|
2990
2995
|
form: "AT1SCH12",
|
package/dist/index3.d.mts
CHANGED
|
@@ -1424,9 +1424,19 @@ interface At1CategoryResult {
|
|
|
1424
1424
|
differsFromFederal: boolean;
|
|
1425
1425
|
}
|
|
1426
1426
|
interface At1AbilResult {
|
|
1427
|
+
/** 018082 — name of the small business corporation. */
|
|
1427
1428
|
name: string;
|
|
1429
|
+
/** 018084 — shares (1) or debt (2). */
|
|
1428
1430
|
kind: 'shares' | 'debt';
|
|
1429
|
-
/**
|
|
1431
|
+
/** 018086 — date of acquisition, ISO `YYYY-MM-DD`, when supplied. */
|
|
1432
|
+
dateOfAcquisition?: string;
|
|
1433
|
+
/** 018088 — A, proceeds of disposition. */
|
|
1434
|
+
proceeds: number;
|
|
1435
|
+
/** 018090 — B, adjusted cost base. */
|
|
1436
|
+
acb: number;
|
|
1437
|
+
/** 018092 — C, outlays and expenses. */
|
|
1438
|
+
outlays: number;
|
|
1439
|
+
/** 088 − (090 + 092) — the business investment loss before the inclusion rate. Not itself a printed line; feeds 018094's total. */
|
|
1430
1440
|
businessInvestmentLoss: number;
|
|
1431
1441
|
}
|
|
1432
1442
|
interface AlbertaSchedule18Result {
|
|
@@ -2602,6 +2612,108 @@ interface Schedule12FilingInput {
|
|
|
2602
2612
|
alberta: number;
|
|
2603
2613
|
federal: number;
|
|
2604
2614
|
};
|
|
2615
|
+
/**
|
|
2616
|
+
* 012040 / 012041 / 012048 — "Other for Alberta / federal purposes — specify",
|
|
2617
|
+
* and the explanation line 048 that TRA requires alongside it.
|
|
2618
|
+
*
|
|
2619
|
+
* A CATCH-ALL, not a single reconciling item: §3.2.3.13 defines 040 as "the
|
|
2620
|
+
* total amount of any other discretionary account items not specifically
|
|
2621
|
+
* listed on form 012", plus two named inclusions. Callers accumulate their
|
|
2622
|
+
* components into one figure per side.
|
|
2623
|
+
*
|
|
2624
|
+
* The two named inclusions, verbatim:
|
|
2625
|
+
*
|
|
2626
|
+
* 1. If form 018 exists, 040 must include `018076 + 018094` as an addition
|
|
2627
|
+
* — the taxable capital gain and the allowable business investment loss.
|
|
2628
|
+
* The matching federal side of 041 is `fed 001113 minus 001406`, which
|
|
2629
|
+
* is federal Schedule 1's "Taxable capital gains from Schedule 6" less
|
|
2630
|
+
* its "Allowable business investment loss from Schedule 6".
|
|
2631
|
+
*
|
|
2632
|
+
* The asymmetry is the spec's, not a transcription slip, and it is
|
|
2633
|
+
* consistent once the signs are seen: an ABIL reaches 018094 already
|
|
2634
|
+
* NEGATIVE (see `albertaAbilDifference` — "the inputs arrive negative
|
|
2635
|
+
* per the form"), while federal line 406 is a deduction line reported
|
|
2636
|
+
* positive. Both expressions therefore net the loss out of the gain.
|
|
2637
|
+
* Do not "correct" either into matching the other.
|
|
2638
|
+
*
|
|
2639
|
+
* 2. If form 015 exists, 040 must also include the Schedule 15 Area C, D,
|
|
2640
|
+
* F, G and H expense computations — but only where a computation comes
|
|
2641
|
+
* out NEGATIVE, and then entered as a positive amount. That component is
|
|
2642
|
+
* NOT modelled here; a caller with Schedule 15 resource pools has to add
|
|
2643
|
+
* it to `alberta` itself. Named rather than silently omitted.
|
|
2644
|
+
*
|
|
2645
|
+
* Line 048 is not optional decoration: "If 012040 exists, then 012048 must
|
|
2646
|
+
* exist." Supply `explanation` whenever the pair is non-nil.
|
|
2647
|
+
*/
|
|
2648
|
+
other?: {
|
|
2649
|
+
alberta: number;
|
|
2650
|
+
federal: number;
|
|
2651
|
+
explanation?: string;
|
|
2652
|
+
};
|
|
2653
|
+
/** 012060 / 012061 — taxable dividends deductible under ITA s.112, 113 or 138(6). Both sides are federal T2 line 320. */
|
|
2654
|
+
taxableDividendsDeductible?: {
|
|
2655
|
+
alberta: number;
|
|
2656
|
+
federal: number;
|
|
2657
|
+
};
|
|
2658
|
+
/** 012062 / 012063 — Part VI.1 tax deduction. Both sides are federal T2 line 325. */
|
|
2659
|
+
partVI1Deduction?: {
|
|
2660
|
+
alberta: number;
|
|
2661
|
+
federal: number;
|
|
2662
|
+
};
|
|
2663
|
+
/** 012074 / 012075 — taxable capital gains or taxable dividends allocated from a central credit union. Both sides are federal T2 line 340. */
|
|
2664
|
+
centralCreditUnion?: {
|
|
2665
|
+
alberta: number;
|
|
2666
|
+
federal: number;
|
|
2667
|
+
};
|
|
2668
|
+
/** 012078 / 012079 — prospector's and grubstaker's shares. Both sides are federal T2 line 350. */
|
|
2669
|
+
prospectorsShares?: {
|
|
2670
|
+
alberta: number;
|
|
2671
|
+
federal: number;
|
|
2672
|
+
};
|
|
2673
|
+
/** 012140 / 012141 — employer deduction for non-qualified securities. Both sides are federal T2 line 352. */
|
|
2674
|
+
nonQualifiedSecurities?: {
|
|
2675
|
+
alberta: number;
|
|
2676
|
+
federal: number;
|
|
2677
|
+
};
|
|
2678
|
+
/**
|
|
2679
|
+
* 012082 / 012083 — ITA s.110.5 and/or subparagraph 115(1)(a)(vii) ADDITIONS,
|
|
2680
|
+
* the one Area B item that adds to taxable income rather than deducting.
|
|
2681
|
+
*
|
|
2682
|
+
* Alberta's side comes from AT1 Schedule 21 line 017; the federal side is T2
|
|
2683
|
+
* line 355, "Section 110.5 additions or subparagraph 115(1)(a)(vii)
|
|
2684
|
+
* additions".
|
|
2685
|
+
*
|
|
2686
|
+
* The printed AT1 Schedule 12 annotates 083 as "T2 line 335" — that is a
|
|
2687
|
+
* TYPO on TRA's form. T2 line 335 is "Limited partnership losses of previous
|
|
2688
|
+
* tax years from Schedule 4", which is already this schedule's 072/073 pair
|
|
2689
|
+
* and is a deduction, not an addition. §3.2.3.13's own rule for 083 says
|
|
2690
|
+
* "Must equal fed 200355", and CRA's line 355 is the s.110.5 additions line.
|
|
2691
|
+
* Follow the spec and CRA, not the annotation.
|
|
2692
|
+
*/
|
|
2693
|
+
section110_5Additions?: {
|
|
2694
|
+
alberta: number;
|
|
2695
|
+
federal: number;
|
|
2696
|
+
};
|
|
2697
|
+
/**
|
|
2698
|
+
* 012090 / 012091 — taxable income, when the caller already knows it.
|
|
2699
|
+
*
|
|
2700
|
+
* Prefer supplying these. This builder can derive them from the Area B lines
|
|
2701
|
+
* it emits, and does when they are absent, but that derivation is only as
|
|
2702
|
+
* complete as the deduction lines actually modelled: any Division C item this
|
|
2703
|
+
* engine does not carry (a central credit union allocation, prospector's
|
|
2704
|
+
* shares, the non-qualified-securities deduction) is missing from the sum and
|
|
2705
|
+
* OVERSTATES taxable income — and 090 is what AT1 page 2 line 062 is taken
|
|
2706
|
+
* from, so an overstatement there is Alberta tax on income the corporation
|
|
2707
|
+
* does not have.
|
|
2708
|
+
*
|
|
2709
|
+
* A caller that ran the engine has the real figure. Passing it makes the
|
|
2710
|
+
* filed line agree with the tax actually computed, and leaves the derived
|
|
2711
|
+
* value as a cross-check rather than the source.
|
|
2712
|
+
*/
|
|
2713
|
+
taxableIncome?: {
|
|
2714
|
+
alberta: number;
|
|
2715
|
+
federal: number;
|
|
2716
|
+
};
|
|
2605
2717
|
/**
|
|
2606
2718
|
* Area B — losses of preceding taxation years, deducted in arriving at Alberta
|
|
2607
2719
|
* taxable income. Same federal/Alberta pairing as Area A, but NOT the same
|
package/dist/t2.mjs
CHANGED
|
@@ -251,11 +251,6 @@ const AT1_SCHEDULES_WITH_BUILDERS = Object.freeze([
|
|
|
251
251
|
"002",
|
|
252
252
|
"003",
|
|
253
253
|
"004",
|
|
254
|
-
"005",
|
|
255
|
-
"006",
|
|
256
|
-
"007",
|
|
257
|
-
"008",
|
|
258
|
-
"009",
|
|
259
254
|
"010",
|
|
260
255
|
"012",
|
|
261
256
|
"013",
|
|
@@ -424,14 +419,16 @@ function schedule18Values(result) {
|
|
|
424
419
|
put("076", result.taxableCapitalGain);
|
|
425
420
|
result.abil.forEach((entry, i) => {
|
|
426
421
|
const n = i + 1;
|
|
427
|
-
values.push({
|
|
428
|
-
lineItemId: at1LineItemId("018",
|
|
429
|
-
value
|
|
430
|
-
});
|
|
431
|
-
values.push({
|
|
432
|
-
lineItemId: at1LineItemId("018", "084", n),
|
|
433
|
-
value: entry.kind === "shares" ? 1 : 2
|
|
422
|
+
const row = (fieldId, value) => values.push({
|
|
423
|
+
lineItemId: at1LineItemId("018", fieldId, n),
|
|
424
|
+
value
|
|
434
425
|
});
|
|
426
|
+
row("082", entry.name);
|
|
427
|
+
row("084", entry.kind === "shares" ? 1 : 2);
|
|
428
|
+
if (entry.dateOfAcquisition) row("086", entry.dateOfAcquisition);
|
|
429
|
+
row("088", entry.proceeds);
|
|
430
|
+
row("090", entry.acb);
|
|
431
|
+
row("092", entry.outlays);
|
|
435
432
|
});
|
|
436
433
|
put("094", result.allowableBusinessInvestmentLoss);
|
|
437
434
|
return {
|
|
@@ -679,6 +676,10 @@ function schedule12Values(input) {
|
|
|
679
676
|
pair("032", "033", input.cogpe);
|
|
680
677
|
pair("036", "037", input.reservesDeductedPriorYear);
|
|
681
678
|
pair("038", "039", input.reservesClaimedCurrentYear);
|
|
679
|
+
if (input.other && input.other.alberta !== input.other.federal) {
|
|
680
|
+
pair("040", "041", input.other);
|
|
681
|
+
if (input.other.explanation) put("048", input.other.explanation);
|
|
682
|
+
}
|
|
682
683
|
const alwaysPair = (albertaField, federalField, p) => {
|
|
683
684
|
if (!p) return;
|
|
684
685
|
put(albertaField, p.alberta);
|
|
@@ -693,7 +694,99 @@ function schedule12Values(input) {
|
|
|
693
694
|
alwaysPair("056", "057", input.donations?.charitable);
|
|
694
695
|
alwaysPair("058", "059", input.donations?.gifts);
|
|
695
696
|
alwaysPair("130", "131", input.restrictedInterestAndFinancing);
|
|
697
|
+
alwaysPair("060", "061", input.taxableDividendsDeductible);
|
|
698
|
+
alwaysPair("062", "063", input.partVI1Deduction);
|
|
699
|
+
alwaysPair("074", "075", input.centralCreditUnion);
|
|
700
|
+
alwaysPair("078", "079", input.prospectorsShares);
|
|
701
|
+
alwaysPair("140", "141", input.nonQualifiedSecurities);
|
|
702
|
+
alwaysPair("082", "083", input.section110_5Additions);
|
|
696
703
|
put("054", input.albertaNetIncomeForTax);
|
|
704
|
+
const filed = /* @__PURE__ */ new Map();
|
|
705
|
+
for (const v of values) if (typeof v.value === "number") filed.set(v.lineItemId.slice(3, 6), v.value);
|
|
706
|
+
const n = (field) => filed.get(field) ?? 0;
|
|
707
|
+
const sum = (fields) => fields.reduce((t, f) => t + n(f), 0);
|
|
708
|
+
put("050", sum([
|
|
709
|
+
"007",
|
|
710
|
+
"013",
|
|
711
|
+
"015",
|
|
712
|
+
"019",
|
|
713
|
+
"037",
|
|
714
|
+
"041"
|
|
715
|
+
]) - sum([
|
|
716
|
+
"005",
|
|
717
|
+
"009",
|
|
718
|
+
"011",
|
|
719
|
+
"017",
|
|
720
|
+
"021",
|
|
721
|
+
"023",
|
|
722
|
+
"027",
|
|
723
|
+
"029",
|
|
724
|
+
"031",
|
|
725
|
+
"033",
|
|
726
|
+
"039"
|
|
727
|
+
]));
|
|
728
|
+
/**
|
|
729
|
+
* 090 / 091 — taxable income, Alberta and federal. Both mandatory, and
|
|
730
|
+
* neither was filed; 090 is also what AT1 page 2 line 062 is taken from
|
|
731
|
+
* ("Enter this amount on AT1 page 2, line 062"), so its absence left the
|
|
732
|
+
* jacket's own taxable income undisclosed on the schedule that derives it.
|
|
733
|
+
*
|
|
734
|
+
* The printed form numbers the two Area B subtotals 080 (Alberta) and 081
|
|
735
|
+
* (federal) and strikes:
|
|
736
|
+
*
|
|
737
|
+
* 090 = 054 − 080 + 082 091 = 002 − 081 + 083
|
|
738
|
+
*
|
|
739
|
+
* with the qualification, printed under each: "If there is an amount at line
|
|
740
|
+
* 082 and line 054 − line 080 is negative, then line 090 must equal line
|
|
741
|
+
* 082" (and the same for 083/081/091). That is not rounding defensiveness —
|
|
742
|
+
* a corporation whose deductions exhaust its income reports its ITA s.110.5
|
|
743
|
+
* additions as the figure, not a negative.
|
|
744
|
+
*
|
|
745
|
+
* 080 and 081 are NOT transmitted — they carry no line-number marker on the
|
|
746
|
+
* page, and §3.2.3.13 defines no row for either, expanding both inline
|
|
747
|
+
* instead. So they are summed here rather than emitted, exactly as 052 is on
|
|
748
|
+
* page 1. The members below are the spec's own expansion, which matches the
|
|
749
|
+
* Alberta and federal deduction columns of Area B row for row.
|
|
750
|
+
*/
|
|
751
|
+
const AREA_B_ALBERTA = [
|
|
752
|
+
"056",
|
|
753
|
+
"058",
|
|
754
|
+
"060",
|
|
755
|
+
"062",
|
|
756
|
+
"064",
|
|
757
|
+
"066",
|
|
758
|
+
"068",
|
|
759
|
+
"070",
|
|
760
|
+
"072",
|
|
761
|
+
"074",
|
|
762
|
+
"078",
|
|
763
|
+
"130",
|
|
764
|
+
"140"
|
|
765
|
+
];
|
|
766
|
+
const AREA_B_FEDERAL = [
|
|
767
|
+
"057",
|
|
768
|
+
"059",
|
|
769
|
+
"061",
|
|
770
|
+
"063",
|
|
771
|
+
"065",
|
|
772
|
+
"067",
|
|
773
|
+
"069",
|
|
774
|
+
"071",
|
|
775
|
+
"073",
|
|
776
|
+
"075",
|
|
777
|
+
"079",
|
|
778
|
+
"131",
|
|
779
|
+
"141"
|
|
780
|
+
];
|
|
781
|
+
/**
|
|
782
|
+
* The formula, applied to the lines this builder emitted. Used only when the
|
|
783
|
+
* caller did not supply the real figure — see `taxableIncome` on the input
|
|
784
|
+
* for why supplying it matters: this sum is only as complete as the deduction
|
|
785
|
+
* lines actually modelled, and a missing one overstates the result.
|
|
786
|
+
*/
|
|
787
|
+
const derive = (income, deductions, additions) => income - deductions < 0 && additions > 0 ? additions : income - deductions + additions;
|
|
788
|
+
put("090", input.taxableIncome?.alberta ?? derive(n("054"), sum(AREA_B_ALBERTA), n("082")));
|
|
789
|
+
put("091", input.taxableIncome?.federal ?? derive(n("002"), sum(AREA_B_FEDERAL), n("083")));
|
|
697
790
|
return {
|
|
698
791
|
scheduleId: "012",
|
|
699
792
|
values
|
|
@@ -5340,6 +5433,10 @@ function computeAlbertaSchedule18(input) {
|
|
|
5340
5433
|
const abil = (input.abilEntries ?? []).map((e) => ({
|
|
5341
5434
|
name: e.name,
|
|
5342
5435
|
kind: e.kind,
|
|
5436
|
+
...e.dateOfAcquisition ? { dateOfAcquisition: e.dateOfAcquisition } : {},
|
|
5437
|
+
proceeds: nn$23(e.proceeds),
|
|
5438
|
+
acb: nn$23(e.acb),
|
|
5439
|
+
outlays: nn$23(e.outlays),
|
|
5343
5440
|
businessInvestmentLoss: nn$23(e.proceeds) - (nn$23(e.acb) + nn$23(e.outlays))
|
|
5344
5441
|
}));
|
|
5345
5442
|
const totalBil = abil.reduce((s, e) => s + Math.min(0, e.businessInvestmentLoss), 0);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@classytic/ca-tax",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.19",
|
|
4
4
|
"description": "Canadian corporate tax engine for @classytic/tax-core — federal T2, Alberta AT1 and Québec CO-17 with form definitions traced to the published forms, plus GST/HST/PST/QST with dated provincial regimes.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -64,7 +64,9 @@
|
|
|
64
64
|
"lint:fix": "biome check src/ tests/ --write",
|
|
65
65
|
"check": "biome ci src/ tests/ --diagnostic-level=error",
|
|
66
66
|
"prepublishOnly": "npm run check && npm run build && npm run typecheck && npm test",
|
|
67
|
-
"push": "classytic-push"
|
|
67
|
+
"push": "classytic-push",
|
|
68
|
+
"format": "biome check --write --staged",
|
|
69
|
+
"format:baseline": "biome check --write src/ tests/"
|
|
68
70
|
},
|
|
69
71
|
"peerDependencies": {
|
|
70
72
|
"@classytic/primitives": ">=0.26.4",
|