Class: BlackStack::InvoiceItem
- Inherits:
-
Object
- Object
- BlackStack::InvoiceItem
- Defined in:
- lib/invoiceitem.rb
Instance Method Summary collapse
-
#number_of_packages ⇒ Object
Returns the number of plans ordered in this item.
- #plan_descriptor ⇒ Object
Instance Method Details
#number_of_packages ⇒ Object
Returns the number of plans ordered in this item
11 12 13 14 15 16 17 18 |
# File 'lib/invoiceitem.rb', line 11 def number_of_packages() plan = BlackStack::InvoicingPaymentsProcessing.plan_descriptor(self.item_number) if self.amount.to_f == plan[:trial_fee].to_f || self.amount.to_f == plan[:trial2_fee].to_f return 1.to_i else return (self.units.to_f / plan[:credits].to_f).to_i end end |
#plan_descriptor ⇒ Object
6 7 8 |
# File 'lib/invoiceitem.rb', line 6 def plan_descriptor() BlackStack::InvoicingPaymentsProcessing::plan_descriptor(self.item_number) end |