@seethruhead/cra-payroll 0.3.0 → 0.3.1
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/dist/cra-payroll.js +15 -8
- package/package.json +1 -1
package/dist/cra-payroll.js
CHANGED
|
@@ -79567,7 +79567,7 @@ import { existsSync as existsSync3, renameSync, unlinkSync, chmodSync } from "fs
|
|
|
79567
79567
|
// package.json
|
|
79568
79568
|
var package_default = {
|
|
79569
79569
|
name: "@seethruhead/cra-payroll",
|
|
79570
|
-
version: "0.3.
|
|
79570
|
+
version: "0.3.1",
|
|
79571
79571
|
description: "Calculate Canadian payroll deductions using CRA's Payroll Deductions Online Calculator",
|
|
79572
79572
|
type: "module",
|
|
79573
79573
|
bin: {
|
|
@@ -79764,7 +79764,7 @@ ${line("═", W)}
|
|
|
79764
79764
|
|
|
79765
79765
|
// src/views/table.ts
|
|
79766
79766
|
var col = (v, w) => typeof v === "number" ? money(v).padStart(w) : v.padStart(w);
|
|
79767
|
-
var renderRow = (r2) => `${r2.label} │ ${col(r2.gross, 10)} │ ${col(r2.fedTax, 10)} │ ${col(r2.provTax, 10)} │ ${col(r2.cpp, 10)} │ ${col(r2.cpp2, 6)} │ ${col(r2.ei, 10)} │ ${col(r2.netPay, 10)}${r2.
|
|
79767
|
+
var renderRow = (r2) => `${r2.label} │ ${col(r2.gross, 10)} │ ${col(r2.fedTax, 10)} │ ${col(r2.provTax, 10)} │ ${col(r2.cpp, 10)} │ ${col(r2.cpp2, 6)} │ ${col(r2.ei, 10)} │ ${col(r2.netPay, 10)}${r2.rrspYou !== undefined ? ` │ ${col(r2.rrspYou, 10)} │ ${col(r2.rrspEr, 10)} │ ${col(r2.takeHome, 10)}` : ""} │ ${col(r2.cumCppEi, 10)}${r2.suffix ?? ""}`;
|
|
79768
79768
|
var totalEmployeeRrsp = (r2) => r2.rrspMatched + r2.rrspUnmatched;
|
|
79769
79769
|
var totalEmployeeRrspTotals = (t8) => t8.rrspMatched + t8.rrspUnmatched;
|
|
79770
79770
|
var showRrsp = (totals) => totals.rrspMatched > 0 || totals.rrspUnmatched > 0 || totals.rrspEmployer > 0;
|
|
@@ -79779,7 +79779,7 @@ var toRow = (r2, first2, rrsp) => ({
|
|
|
79779
79779
|
cpp2: r2.cpp2,
|
|
79780
79780
|
ei: r2.ei,
|
|
79781
79781
|
netPay: r2.netPay,
|
|
79782
|
-
...rrspFields(rrsp, {
|
|
79782
|
+
...rrspFields(rrsp, { rrspYou: totalEmployeeRrsp(r2), rrspEr: r2.rrspEmployer, takeHome: r2.netPay - totalEmployeeRrsp(r2) }),
|
|
79783
79783
|
cumCppEi: r2.cumulativeCpp + r2.cumulativeCpp2 + r2.cumulativeEi,
|
|
79784
79784
|
suffix: annotate(r2, first2)
|
|
79785
79785
|
});
|
|
@@ -79792,7 +79792,7 @@ var headerRow = (rrsp) => ({
|
|
|
79792
79792
|
cpp2: "CPP2",
|
|
79793
79793
|
ei: "EI",
|
|
79794
79794
|
netPay: "Net Pay",
|
|
79795
|
-
...rrspFields(rrsp, {
|
|
79795
|
+
...rrspFields(rrsp, { rrspYou: "RRSP You", rrspEr: "RRSP Er", takeHome: "Take Home" }),
|
|
79796
79796
|
cumCppEi: "Cum CPP/EI"
|
|
79797
79797
|
});
|
|
79798
79798
|
var totalsRow = (totals, rrsp) => ({
|
|
@@ -79804,10 +79804,17 @@ var totalsRow = (totals, rrsp) => ({
|
|
|
79804
79804
|
cpp2: totals.cpp2,
|
|
79805
79805
|
ei: totals.ei,
|
|
79806
79806
|
netPay: totals.netPay,
|
|
79807
|
-
...rrspFields(rrsp, {
|
|
79807
|
+
...rrspFields(rrsp, { rrspYou: totalEmployeeRrspTotals(totals), rrspEr: totals.rrspEmployer, takeHome: totals.netPay - totalEmployeeRrspTotals(totals) }),
|
|
79808
79808
|
cumCppEi: ""
|
|
79809
79809
|
});
|
|
79810
|
-
var renderTable = (yearly, periodsPerYear, year = 2026) => t3(yearly, (ctx) => ({ ...ctx, rrsp: showRrsp(ctx.totals) }), (ctx) => ({ ...ctx, header: renderRow(headerRow(ctx.rrsp)) }), (ctx) => ({ ...ctx, bodyRows: ctx.rows.map((r2) => renderRow(toRow(r2, ctx.rows[0], ctx.rrsp))) }), (ctx) => ({ ...ctx, totalsStr: renderRow(totalsRow(ctx.totals, ctx.rrsp)), W: ctx.header.length }), (ctx) =>
|
|
79810
|
+
var renderTable = (yearly, periodsPerYear, year = 2026) => t3(yearly, (ctx) => ({ ...ctx, rrsp: showRrsp(ctx.totals) }), (ctx) => ({ ...ctx, header: renderRow(headerRow(ctx.rrsp)) }), (ctx) => ({ ...ctx, bodyRows: ctx.rows.map((r2) => renderRow(toRow(r2, ctx.rows[0], ctx.rrsp))) }), (ctx) => ({ ...ctx, totalsStr: renderRow(totalsRow(ctx.totals, ctx.rrsp)), W: ctx.header.length }), (ctx) => {
|
|
79811
|
+
const t8 = ctx.totals;
|
|
79812
|
+
const empTotal = totalEmployeeRrspTotals(t8);
|
|
79813
|
+
const rrspSummary = !ctx.rrsp ? "" : `
|
|
79814
|
+
RRSP You: $${money(empTotal)}/yr ($${money(empTotal / periodsPerYear)}/period)${t8.rrspMatched > 0 ? ` — matched: $${money(t8.rrspMatched)}/yr` : ""}${t8.rrspUnmatched > 0 ? ` — unmatched: $${money(t8.rrspUnmatched)}/yr` : ""}
|
|
79815
|
+
RRSP Er: $${money(t8.rrspEmployer)}/yr ($${money(t8.rrspEmployer / periodsPerYear)}/period)
|
|
79816
|
+
RRSP Total (You + Er): $${money(empTotal + t8.rrspEmployer)}/yr`;
|
|
79817
|
+
return `Per-Paycheck Table (${year})
|
|
79811
79818
|
${line("═", ctx.W)}
|
|
79812
79819
|
${ctx.header}
|
|
79813
79820
|
${line("─", ctx.W)}
|
|
@@ -79815,8 +79822,8 @@ ${ctx.bodyRows.join(`
|
|
|
79815
79822
|
`)}
|
|
79816
79823
|
${line("─", ctx.W)}
|
|
79817
79824
|
${ctx.totalsStr}
|
|
79818
|
-
${line("═", ctx.W)}${
|
|
79819
|
-
|
|
79825
|
+
${line("═", ctx.W)}${rrspSummary}`;
|
|
79826
|
+
});
|
|
79820
79827
|
|
|
79821
79828
|
// src/views/summary.ts
|
|
79822
79829
|
var W2 = 42;
|