Sha256: 542aef62f587c3abc2de6e1a49f5d3b2aefc5fab199cc9ce964a930e7ecc4a5d

Contents?: true

Size: 685 Bytes

Versions: 1

Compression:

Stored size: 685 Bytes

Contents

module Zuora
  class Account < ZObject
    def billTo
      @billTo ||= Contact.find(self.billToId)
    end

    def soldTo
      @soldTo ||= Contact.find(self.soldToId)
    end

    def subscriptions
      @subscriptions ||= Subscription.where(:accountid => self.id)
    end

    def invoices
      @invoices ||= Invoice.where(:accountid => self.id)
    end

    def invoices_with_balance
      @invoices_with_balance ||= Invoice.where("accountId = '#{self.id}' AND Balance > 0")
    end

    def payment_methods
      @payment_methods ||= PaymentMethod.where(:accountid => self.id)
    end

    def contacts
      @contacts ||= Contact.where(:accountid => self.id)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
active_zuora-1.5.2 lib/active_zuora/account.rb