Add support for deducting reserved resources from totals

Implements redmine #13683