Form 4562 Report

This commit is contained in:
2026-06-11 01:41:46 -05:00
parent 5074a3ad63
commit ab6e4c2a56
4 changed files with 153 additions and 23 deletions

View File

@@ -2053,6 +2053,16 @@ async function main() {
if (farmDisp.section_1255_recapture !== 10000) throw new Error(`§1255 recapture wrong: expected 10,000, got ${farmDisp.section_1255_recapture}`);
if (farmDisp.section_1231_gain !== 28000) throw new Error(`Farm §1231 gain wrong: expected 28,000, got ${farmDisp.section_1231_gain}`);
// ---- Form 4562 filing worksheet (self-contained on a clean year) -----------
await request('/api/assets', { method: 'POST', headers: aHeaders, body: JSON.stringify({ asset_id: `F62M-${suffix}`, description: 'Machine', category: 'Computer Equipment', acquisition_cost: 10000, acquired_date: '2035-04-01', in_service_date: '2035-04-01', useful_life_months: 60, books: [{ book_type: 'FEDERAL', active: true, depreciation_method: 'macrs_gds_200db_5', convention: 'half_year', useful_life_months: 60, bonus_percent: 0, section_179_amount: 0, cost: 10000 }] }) });
await request('/api/assets', { method: 'POST', headers: aHeaders, body: JSON.stringify({ asset_id: `F62A-${suffix}`, description: 'Auto', category: 'Computer Equipment', acquisition_cost: 90000, acquired_date: '2035-06-01', in_service_date: '2035-06-01', useful_life_months: 60, passenger_auto: true, business_use_percent: 100, books: [{ book_type: 'FEDERAL', active: true, depreciation_method: 'macrs_gds_200db_5', convention: 'half_year', useful_life_months: 60, bonus_percent: 0, section_179_amount: 0, cost: 90000 }] }) });
const f4562 = (await request('/api/reports/run', { method: 'POST', headers: aHeaders, body: JSON.stringify({ type: 'form_4562', options: { year: 2035 } }) })).report;
if (!f4562.rows.some((r) => r.line === '12') || !f4562.rows.some((r) => r.line === '22')) throw new Error('Form 4562 worksheet missing §179 (line 12) / total (line 22)');
if (!f4562.meta || !Array.isArray(f4562.meta.sections) || f4562.meta.sections.length !== 2) throw new Error('Form 4562 missing Part III / Part V sections');
const f4562Line19 = f4562.rows.find((r) => r.line === '19');
if (!f4562Line19 || Math.abs(f4562Line19.amount - 2000) > 1) throw new Error(`Form 4562 line 19 (current-year MACRS) wrong: expected 2,000, got ${f4562Line19 && f4562Line19.amount}`);
if (!f4562.meta.sections[1].rows.some((r) => r.type === 'Auto')) throw new Error('Form 4562 Part V should list the passenger auto');
// ---- Literal MACRS tables (MT200), true ADS recovery period, short tax year ---
const deprRow = async (assetId, year) => (await request('/api/reports/run', { method: 'POST', headers: aHeaders, body: JSON.stringify({ type: 'depreciation_expense', options: { book: 'FEDERAL', year } }) })).report.rows.find((r) => r.asset_id === assetId);
// #1 MT200 uses the literal Pub 946 Appendix-A percentages (5-year property year-1 = 20% = 2,000).