fix: use net PP&E in capex formula to prevent depreciation double-count (#354)#540
Merged
AlexFiliakov merged 1 commit intodevelopfrom Feb 8, 2026
Merged
Conversation
…nt (#354) The cash flow statement's capex calculation used gross PP&E, which is not reduced by depreciation. The formula Capex = ΔPP&E + Depreciation is only correct with **net** PP&E. With gross PP&E the depreciation was added back in operating activities *and* subtracted again as investing capex, making cash flow from investing too negative by the full depreciation amount. Switch _calculate_capex to read net_ppe instead of gross_ppe and update all affected test fixtures (cash balances, expected capex, comments).
Coverage Report
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
_calculate_capexusedgross_ppe(not reduced by depreciation), so adding depreciation back double-counted it — cash flow from investing was too negative by the full depreciation amount each periodnet_ppe(gross_ppe − accumulated_depreciation) which is reduced by depreciation, makingCapex = Δ(Net PP&E) + Depreciationcorrectnet_ppevalues and recalculated expected cash/capex amountsCloses #354
Test plan
test_cash_flow_statement.py— 18 tests pass (capex, investing CF, reconciliation)test_cash_reconciliation.py— 9 tests pass (all reconciliation scenarios)test_financial_statements.py— 37 tests pass (generator, balance sheet, income statement, cash flow)test_financial_statements_coverage.py— 41 tests pass (coverage edge cases including capex missing-dep error)test_depreciation_tracking.py,test_balance_sheet_classification.py,test_working_capital_changes.py,test_dividend_phantom_payments.py— 59 tests pass (no regressions)test_manufacturer_methods.py,test_manufacturer_coverage.py,test_roe_insurance.py,test_excel_reporter.py— 94 tests pass (no regressions)