Added Section 179 Limits

This commit is contained in:
2026-06-05 05:55:43 -05:00
parent 4072695432
commit dfd999b6a9
11 changed files with 454 additions and 16 deletions

View File

@@ -652,6 +652,15 @@ function initialize() {
updated_at TEXT NOT NULL
);
CREATE TABLE IF NOT EXISTS section_179_limits (
id INTEGER PRIMARY KEY AUTOINCREMENT,
tax_year INTEGER NOT NULL UNIQUE,
base_limit REAL NOT NULL DEFAULT 0,
phaseout_threshold REAL NOT NULL DEFAULT 0,
created_at TEXT NOT NULL,
updated_at TEXT NOT NULL
);
CREATE TABLE IF NOT EXISTS audit_logs (
id INTEGER PRIMARY KEY AUTOINCREMENT,
actor_id INTEGER REFERENCES users(id),
@@ -694,6 +703,8 @@ function migrate() {
ensureColumn('assets', 'servicenow_sys_id', 'TEXT');
ensureColumn('assets', 'asset_class_number', 'TEXT');
ensureColumn('assets', 'special_zone', 'TEXT');
ensureColumn('depreciation_zones', 'section_179_increase', 'REAL NOT NULL DEFAULT 0');
ensureColumn('depreciation_zones', 'section_179_cost_factor', 'REAL NOT NULL DEFAULT 1');
dropUsersRoleCheck();
}
@@ -758,6 +769,34 @@ function seed() {
'30% special depreciation allowance for qualified NY Liberty Zone property; qualified leasehold improvements use a 5-year life; increased Section 179. Verify current tax law before filing.', 1, ?, ?)`,
[createdAt, createdAt]
);
// Enterprise / Empowerment Zone: raises the Section 179 limit by $35,000 (2002-2020) and counts
// only 50% of the property's cost toward the §179 investment-phaseout threshold.
run(
`INSERT OR IGNORE INTO depreciation_zones
(code, name, allowance_percent, pis_start, pis_end, real_property_end, max_recovery_years, leasehold_life_years,
section_179_increase, section_179_cost_factor, notes, enabled, created_at, updated_at)
VALUES ('enterprise_zone', 'Enterprise Zone (Empowerment Zone)', 0, '2002-01-01', '2020-12-31', NULL, NULL, NULL,
35000, 0.5,
'Section 179 limit increase for qualified empowerment/enterprise zone property: +$35,000 (2002-2020; +$20,000 for 1993-2001) and only 50% of cost counts toward the investment-phaseout threshold. Not available after 2020. Verify current tax law before filing.', 1, ?, ?)`,
[createdAt, createdAt]
);
// Annual Section 179 deduction limits & investment-phaseout thresholds (IRS historical values).
// Seeded once, then user-managed in Admin → Application Configuration → Section 179 limits.
const section179Limits = [
[2014, 500000, 2000000], [2015, 500000, 2000000], [2016, 500000, 2010000], [2017, 510000, 2030000],
[2018, 1000000, 2500000], [2019, 1020000, 2550000], [2020, 1040000, 2590000], [2021, 1050000, 2620000],
[2022, 1080000, 2700000], [2023, 1160000, 2890000], [2024, 1220000, 3050000], [2025, 1250000, 3130000],
[2026, 1250000, 3130000]
];
for (const [year, limit, threshold] of section179Limits) {
run(
`INSERT OR IGNORE INTO section_179_limits (tax_year, base_limit, phaseout_threshold, created_at, updated_at)
VALUES (?, ?, ?, ?, ?)`,
[year, limit, threshold, createdAt, createdAt]
);
}
if (!one('SELECT id FROM teams LIMIT 1')) {
run('INSERT INTO teams (name, description, created_at) VALUES (?, ?, ?)', [
'Finance Operations',