# /// script # requires-python = ">=3.12" # dependencies = [] # exclude-newer = "2026-08-08T00:00:00Z" # /// """Readable income-tax provision bridge for a fictional Cedar Trail scenario.""" from __future__ import annotations def money(amount: float) -> str: """Format dollars with commas and accounting parentheses.""" return f"({abs(amount):,.2f})" if amount < 0 else f"{amount:,.2f}" def percent(rate: float) -> str: return f"{rate:.2%}" def show_table(title: str, rows: list[tuple[str, float]]) -> None: print(f"\n{title}") print("-" * len(title)) width = max(len(label) for label, _ in rows) for label, amount in rows: print(f"{label:<{width}} {money(amount):>16}") # Current return rail. Positive adjustments increase taxable income. pretax_book_income = 1_000_000.00 current_adjustments = { "Additional tax depreciation": -120_000.00, "Warranty deductible later": 60_000.00, "Tax-exempt municipal interest": -20_000.00, "Nondeductible penalty": 10_000.00, "NOL deduction": -100_000.00, } current_rate = 0.21 current_credit = 4_300.00 taxable_income = pretax_book_income + sum(current_adjustments.values()) gross_current_tax = taxable_income * current_rate return_current_tax = gross_current_tax - current_credit show_table( "Book-to-taxable-income bridge", [ ("Pretax book income", pretax_book_income), *current_adjustments.items(), ("Taxable income", taxable_income), ], ) show_table( "Current return tax", [ ("Gross current tax", gross_current_tax), ("Current tax credit", -current_credit), ("Return current tax", return_current_tax), ], ) # Ending deferred rail. Tax bases and reversal conclusions are supplied facts. deferred_rows = [ ("Equipment", "DTL", 300_000.00, 0.21, 0.25), ("Warranty", "DTA", 120_000.00, 0.21, 0.25), ("Accrued compensation", "DTA", 80_000.00, 0.21, 0.21), ("NOL carryforward", "DTA", 200_000.00, 0.21, 0.21), ] tax_credit_dta = 15_000.00 gross_dta = tax_credit_dta gross_dtl = 0.00 rate_change_effect = 0.00 print("\nDeferred-tax measurement") print("------------------------") print(f"{'Source':<24} {'Kind':<5} {'Future amount':>16} {'Rate':>9} {'Deferred tax':>16}") for label, kind, future_amount, enacted_rate, old_rate in deferred_rows: deferred_tax = future_amount * enacted_rate if kind == "DTA": gross_dta += deferred_tax rate_change_effect -= future_amount * (enacted_rate - old_rate) else: gross_dtl += deferred_tax rate_change_effect += future_amount * (enacted_rate - old_rate) print( f"{label:<24} {kind:<5} {money(future_amount):>16} " f"{percent(enacted_rate):>9} {money(deferred_tax):>16}" ) credit_label = "Tax credit carryforward" print( f"{credit_label:<24} {'DTA':<5} {'direct tax amount':>16} " f"{'—':>9} {money(tax_credit_dta):>16}" ) opening_gross_dta = 102_400.00 opening_gross_dtl = 40_000.00 opening_allowance = 15_000.00 ending_allowance = 20_000.00 opening_net_liability = opening_gross_dtl - (opening_gross_dta - opening_allowance) ending_net_liability = gross_dtl - (gross_dta - ending_allowance) deferred_tax_expense = ending_net_liability - opening_net_liability show_table( "Deferred-tax bridge", [ ("Gross deferred tax asset", gross_dta), ("Gross deferred tax liability", gross_dtl), ("Ending valuation allowance", ending_allowance), ("Opening net deferred liability", opening_net_liability), ("Ending net deferred liability", ending_net_liability), ("Deferred tax expense", deferred_tax_expense), ("Enacted-rate change effect", rate_change_effect), ], ) # Supplied uncertain-position conclusion and probability measurement. return_benefit = 50_000.00 settlement_outcomes = [(50_000.00, 0.20), (40_000.00, 0.35), (20_000.00, 0.30), (0.00, 0.15)] cumulative = 0.00 recognized_benefit = 0.00 print("\nUncertain-position measurement") print("------------------------------") print(f"{'Benefit sustained':>18} {'Probability':>13} {'Cumulative':>13}") for benefit, probability in settlement_outcomes: cumulative += probability if recognized_benefit == 0 and cumulative > 0.50: recognized_benefit = benefit print(f"{money(benefit):>18} {percent(probability):>13} {percent(cumulative):>13}") opening_unrecognized_benefit = 6_000.00 ending_unrecognized_benefit = return_benefit - recognized_benefit uncertain_tax_expense = ending_unrecognized_benefit - opening_unrecognized_benefit interest_and_penalties = 2_000.00 recognized_current_tax_expense = return_current_tax + uncertain_tax_expense + interest_and_penalties total_tax_expense = recognized_current_tax_expense + deferred_tax_expense show_table( "Provision", [ ("Recognized current tax expense", recognized_current_tax_expense), ("Deferred tax expense", deferred_tax_expense), ("Total tax expense", total_tax_expense), ], ) # Intraperiod allocation and cash-tax disclosure are separate controls. oci_tax_benefit = -6_000.00 discontinued_tax_expense = 12_000.00 continuing_tax_expense = total_tax_expense - oci_tax_benefit - discontinued_tax_expense taxes_paid = {"Federal": 120_000.00, "State": 25_000.00, "Foreign": 15_000.00} cash_taxes_paid = sum(taxes_paid.values()) paid_threshold = cash_taxes_paid * 0.05 opening_current_payable = 30_000.00 ending_current_payable = opening_current_payable + return_current_tax - cash_taxes_paid show_table( "Intraperiod allocation", [ ("Continuing operations", continuing_tax_expense), ("Discontinued operations", discontinued_tax_expense), ("Other comprehensive income", oci_tax_benefit), ("Total tax expense", total_tax_expense), ], ) print(f"\nEffective tax rate: {percent(total_tax_expense / pretax_book_income)}") print(f"Taxes-paid 5% threshold: {money(paid_threshold)}") for jurisdiction, amount in taxes_paid.items(): route = "separate" if amount >= paid_threshold else "aggregate" print(f" {jurisdiction:<10} {money(amount):>16} {route}") print(f"Ending current tax payable: {money(ending_current_payable)}") # Arithmetic release controls. They do not approve the supplied judgments. assert abs(taxable_income - 830_000.00) < 0.01 assert abs(return_current_tax - 170_000.00) < 0.01 assert abs(gross_dta - 99_000.00) < 0.01 assert abs(gross_dtl - 63_000.00) < 0.01 assert abs(rate_change_effect - (-7_200.00)) < 0.01 assert abs(recognized_benefit - 40_000.00) < 0.01 assert abs(total_tax_expense - 207_400.00) < 0.01 assert ( abs(continuing_tax_expense + discontinued_tax_expense + oci_tax_benefit - total_tax_expense) < 0.01 ) assert abs(ending_current_payable - 40_000.00) < 0.01 print("\nArithmetic controls: PASS")