Skip to main content

render_schedule_se

Function render_schedule_se 

Source
pub fn render_schedule_se(
    year: i32,
    result: Option<&SeTaxResult>,
    gross_se: Usd,
    table_present: bool,
    schedule_c_expenses: Usd,
    w2_ss_wages: Usd,
    w2_medicare_wages: Usd,
) -> Option<String>
Expand description

P2-D Task 2 / Chunk B (Schedule SE): render the standalone §1401 SE-tax block for year as an informational block that does NOT feed engine B (TaxResult::total_federal_tax_attributable is UNCHANGED by SE tax).

Three-way None split [R0-I1] (no silent drop — mirrors P2-C’s m6):

  • gross_se == 0None (no business SE income → no Schedule SE section at all).
  • gross_se > 0 && !table_present → a “SS wage base unavailable for {year}” note (business SE income exists but the year has no bundled table → the wage base is unknown; the §1401 tax is NOT computed rather than silently dropped).
  • gross_se > 0 && table_present && result == None → a “fully expensed” line (expenses ≥ gross → net_se == 0 → no §1401 SE tax owed; distinct from the “wage base unavailable” case).
  • result = Some(r) → the full Schedule SE section (breakout or $0 note, components, total, §164(f) advisory, W-2 coordination, the Chunk-B expense advisory, and the [D5] standalone note).

§Parameters

  • gross_se: se_net_income(state, year) — the GROSS SE income before expenses (caller computes).
  • table_present: tables.table_for(year).is_some() (caller has this from the and_then chain).
  • schedule_c_expenses: from TaxProfile.schedule_c_expenses (≥ 0). When > 0 triggers the breakout line and the Chunk-B ordinary-income advisory.
  • w2_ss_wages / w2_medicare_wages: from TaxProfile (both ≥ 0). When either is > $0 the W-2 coordinated disclosure is rendered; when both are $0 the short $0-assumed note is shown.