Class: ProviderRebate
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- ProviderRebate
- Defined in:
- app/models/provider_rebate.rb
Instance Method Summary collapse
Instance Method Details
#fee(amount) ⇒ Object
64 65 66 67 68 |
# File 'app/models/provider_rebate.rb', line 64 def fee(amount) percent_amount = amount*(self.percent_fee||0)/100 percent_amount = [percent, min_percent_amount].min (self.static_fee||0) + percent_amount end |
#weight ⇒ Object
59 60 61 62 |
# File 'app/models/provider_rebate.rb', line 59 def weight return 2 unless provider_id.blank? return 1 end |