Sha256: 690dbf8dca7aaea0259a5036eefa3171ea7ddc2853979649f5334068bf6f8589

Contents?: true

Size: 743 Bytes

Versions: 29

Compression:

Stored size: 743 Bytes

Contents

class Kaui::BusinessInvoice < Kaui::Base
  define_attr :invoice_id
  define_attr :invoice_number
  define_attr :account_id
  define_attr :account_key
  define_attr :invoice_date
  define_attr :target_date
  define_attr :currency
  define_attr :balance
  define_attr :amount_paid
  define_attr :amount_charged
  define_attr :amount_credited

  has_many :invoice_items, Kaui::BusinessInvoiceItem

  def balance_to_money
    Kaui::Base.to_money(balance.abs, currency)
  end

  def amount_paid_to_money
    Kaui::Base.to_money(amount_paid.abs, currency)
  end

  def amount_charged_to_money
    Kaui::Base.to_money(amount_charged.abs, currency)
  end

  def amount_credited_to_money
    Kaui::Base.to_money(amount_credited.abs, currency)
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
kaui-0.6.6 app/models/kaui/business_invoice.rb
kaui-0.6.5 app/models/kaui/business_invoice.rb
kaui-0.6.4 app/models/kaui/business_invoice.rb
kaui-0.6.3 app/models/kaui/business_invoice.rb
kaui-0.6.2 app/models/kaui/business_invoice.rb
kaui-0.6.1 app/models/kaui/business_invoice.rb
kaui-0.6.0 app/models/kaui/business_invoice.rb
kaui-0.5.3 app/models/kaui/business_invoice.rb
kaui-0.5.2 app/models/kaui/business_invoice.rb
kaui-0.5.1 app/models/kaui/business_invoice.rb
kaui-0.5.0 app/models/kaui/business_invoice.rb
kaui-0.4.9 app/models/kaui/business_invoice.rb
kaui-0.4.8 app/models/kaui/business_invoice.rb
kaui-0.4.7 app/models/kaui/business_invoice.rb
kaui-0.4.6 app/models/kaui/business_invoice.rb
kaui-0.4.5 app/models/kaui/business_invoice.rb
kaui-0.4.4 app/models/kaui/business_invoice.rb
kaui-0.4.3 app/models/kaui/business_invoice.rb
kaui-0.4.2 app/models/kaui/business_invoice.rb
kaui-0.4.1 app/models/kaui/business_invoice.rb