Don't include Refunded or Void payments when calculating discount usage.
Added membership discount constraint
NEW: introduced partial discount model / tests
Implemented filter on membership constraint
Fixes and improvements