Moving isActive(), isExpired(), isValid() tests to SQL WHERE; in …

Merged bgm requested to merge github/fork/elkram/issue-138 into master

Created by: elkram

…getValidDiscounts(). Removing static functions: isEnabled(), isActive(), isExpired(), isValid().

Merge request reports