Never mind - I figured out your problem(s):
1. Foster's charged salary as you stated isn't $268,990: it's $286,990. ($450,000*121/196) However, the real problem is...
2. Your idea was this:
MountainHawk said:
(3) Every day, you calculate the projected cap hit of the current 23 man roster as 'future games'/82 * sum of 23 man roster salarys + used cap space already. This can also never exceed the cap.
http://www.hfboards.com/showthread.php?t=208513
So I read this as saying the cap space consumed to date is calculated normally; the future cap space is computed on games remaining. So you are trying to hybrid the two methods, meaning the numbers become:
PRIOR TO TRADE
TORONTO PAYROLL = $38,000,000
CONTRIBUTION TOWARDS CAP: $24,234,694 (125/196 of season)
MINNESOTA PAYROLL = $24,000,000
CONTRIBUTION TOWARDS CAP: $15,306,122 (125/196 of season)
AFTER TRADE
TORONTO PAYROLL = $32,116,667
PROJECTED CAP HIT: $10,183,333 (26 GR / 82 games * payroll)
TOTAL CAP HIT: $34,418,027
MINNESOTA PAYROLL = $29,883,333
PROJECTED CAP HIT: $10,932,927 (30 GR / 82 games * payroll)
TOTAL CAP HIT: $26,239,049
COMBINED CAP HIT, TORONTO AND MINNESOTA: $60,657,076
Now...if we take the payrolls out to the end of the season,
THEN it finally hits $62 million towards the cap because yes - Toronto finishes just under $36 million and Minnesota finishes just over $26 million. But, your calculations for "how much room do we have under the cap?" overstates how much both teams in fact have at the time of the trade; if the cap was $38 million and Toronto decided to bump payroll to the cap knowing the projected cap number under your calculation said "you're at $38 million by the end of the season," I don't think they'd be very happy if at the end of the season they discovered they were in fact over by $1.4 million (the difference between the "indicated cap number" at the time of the trade and the actual final cap number at the end of the season).
In short: you have a nice idea in theory, but when applied it won't work.