# /// script # requires-python = ">=3.12" # dependencies = [] # exclude-newer = "2026-08-08T00:00:00Z" # /// """Readable retrospective accounting-change bridge for Cedar Trail.""" from __future__ import annotations def money(amount: float) -> str: """Display financial amounts with commas, parentheses, and two decimals.""" return f"({abs(amount):,.2f})" if amount < 0 else f"{amount:,.2f}" def per_share(amount: float) -> str: """Display per-share amounts with parentheses for negative values.""" return f"({abs(amount):,.4f})" if amount < 0 else f"{amount:,.4f}" def show(title: str, rows: list[tuple[str, float]]) -> None: """Print a compact financial schedule.""" print(f"\n{title}\n{'-' * len(title)}") width = max(len(label) for label, _ in rows) for label, value in rows: print(f"{label:<{width}} {money(value):>18}") # Supplied conclusions: voluntary change is preferable and full retrospective # application is practicable. Python does not originate those judgments. tax_rate = 0.25 pre_year_2_pretax_effect = 240_000.00 opening_tax_effect = pre_year_2_pretax_effect * tax_rate opening_equity_effect = pre_year_2_pretax_effect - opening_tax_effect show( "Opening Year 2 bridge", [ ("Pretax direct effect", pre_year_2_pretax_effect), ("Deferred tax liability", -opening_tax_effect), ("Opening retained earnings", opening_equity_effect), ], ) # One dictionary is enough structure to avoid repeating formulas while keeping # the accounting readable from top to bottom. periods = { "Year 2": { "reported_pretax_income": 620_000.00, "pretax_adjustment": 70_000.00, "weighted_average_shares": 500_000.00, }, "Year 3": { "reported_pretax_income": 750_000.00, "pretax_adjustment": -30_000.00, "weighted_average_shares": 520_000.00, }, } for period, facts in periods.items(): pretax_adjustment = facts["pretax_adjustment"] tax_effect = pretax_adjustment * tax_rate after_tax_effect = pretax_adjustment - tax_effect recast_pretax_income = facts["reported_pretax_income"] + pretax_adjustment basic_eps_adjustment = after_tax_effect / facts["weighted_average_shares"] show( f"{period} comparative bridge", [ ("Pretax income as reported", facts["reported_pretax_income"]), ("Signed pretax adjustment", pretax_adjustment), ("Pretax income recast", recast_pretax_income), ("Tax effect", tax_effect), ("After-tax effect", after_tax_effect), ], ) print(f"Basic EPS adjustment {per_share(basic_eps_adjustment):>18}") assert abs(opening_equity_effect - 180_000.00) < 0.01 assert abs(periods["Year 2"]["pretax_adjustment"] * (1 - tax_rate) - 52_500.00) < 0.01 assert abs(periods["Year 3"]["pretax_adjustment"] * (1 - tax_rate) + 22_500.00) < 0.01 print("\nBoundary: this script recomputes supplied direct effects and tax assumptions.") print("It does not decide acceptability, preferability, practicability, tax law, or diluted EPS.")