Refactored: calculate energy charges implementation so that it can be used for both consumption and production