Class: Payday::Invoice
- Inherits:
-
Object
- Object
- Payday::Invoice
- Includes:
- Invoiceable
- Defined in:
- lib/payday/invoice.rb
Overview
Basically just an invoice. Stick a ton of line items in it, add some details, and then render it out!
Instance Attribute Summary collapse
-
#bill_to ⇒ Object
Returns the value of attribute bill_to.
-
#currency ⇒ Object
Returns the value of attribute currency.
-
#due_at ⇒ Object
Returns the value of attribute due_at.
-
#invoice_date ⇒ Object
Returns the value of attribute invoice_date.
-
#invoice_details ⇒ Object
Returns the value of attribute invoice_details.
-
#invoice_number ⇒ Object
Returns the value of attribute invoice_number.
-
#line_items ⇒ Object
Returns the value of attribute line_items.
-
#notes ⇒ Object
Returns the value of attribute notes.
-
#paid_at ⇒ Object
Returns the value of attribute paid_at.
-
#refunded_at ⇒ Object
Returns the value of attribute refunded_at.
-
#ship_to ⇒ Object
Returns the value of attribute ship_to.
-
#shipping_description ⇒ Object
Returns the value of attribute shipping_description.
-
#shipping_rate ⇒ Object
Returns the value of attribute shipping_rate.
-
#tax_description ⇒ Object
Returns the value of attribute tax_description.
-
#tax_rate ⇒ Object
Returns the value of attribute tax_rate.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Invoice
constructor
A new instance of Invoice.
Methods included from Invoiceable
#each_detail, #overdue?, #paid?, #refunded?, #render_pdf, #render_pdf_to_file, #shipping, #subtotal, #tax, #total
Constructor Details
#initialize(options = {}) ⇒ Invoice
Returns a new instance of Invoice.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/payday/invoice.rb', line 9 def initialize( = {}) self.invoice_number = [:invoice_number] || nil self.bill_to = [:bill_to] || nil self.ship_to = [:ship_to] || nil self.notes = [:notes] || nil self.line_items = [:line_items] || [] self.shipping_rate = [:shipping_rate] || nil self.shipping_description = [:shipping_description] || nil self.tax_rate = [:tax_rate] || nil self.tax_description = [:tax_description] || nil self.due_at = [:due_at] || nil self.paid_at = [:paid_at] || nil self.refunded_at = [:refunded_at] || nil self.currency = [:currency] || nil self.invoice_details = [:invoice_details] || [] self.invoice_date = [:invoice_date] || nil end |
Instance Attribute Details
#bill_to ⇒ Object
Returns the value of attribute bill_to.
6 7 8 |
# File 'lib/payday/invoice.rb', line 6 def bill_to @bill_to end |
#currency ⇒ Object
Returns the value of attribute currency.
6 7 8 |
# File 'lib/payday/invoice.rb', line 6 def currency @currency end |
#due_at ⇒ Object
Returns the value of attribute due_at.
6 7 8 |
# File 'lib/payday/invoice.rb', line 6 def due_at @due_at end |
#invoice_date ⇒ Object
Returns the value of attribute invoice_date.
6 7 8 |
# File 'lib/payday/invoice.rb', line 6 def invoice_date @invoice_date end |
#invoice_details ⇒ Object
Returns the value of attribute invoice_details.
6 7 8 |
# File 'lib/payday/invoice.rb', line 6 def invoice_details @invoice_details end |
#invoice_number ⇒ Object
Returns the value of attribute invoice_number.
6 7 8 |
# File 'lib/payday/invoice.rb', line 6 def invoice_number @invoice_number end |
#line_items ⇒ Object
Returns the value of attribute line_items.
6 7 8 |
# File 'lib/payday/invoice.rb', line 6 def line_items @line_items end |
#notes ⇒ Object
Returns the value of attribute notes.
6 7 8 |
# File 'lib/payday/invoice.rb', line 6 def notes @notes end |
#paid_at ⇒ Object
Returns the value of attribute paid_at.
6 7 8 |
# File 'lib/payday/invoice.rb', line 6 def paid_at @paid_at end |
#refunded_at ⇒ Object
Returns the value of attribute refunded_at.
6 7 8 |
# File 'lib/payday/invoice.rb', line 6 def refunded_at @refunded_at end |
#ship_to ⇒ Object
Returns the value of attribute ship_to.
6 7 8 |
# File 'lib/payday/invoice.rb', line 6 def ship_to @ship_to end |
#shipping_description ⇒ Object
Returns the value of attribute shipping_description.
6 7 8 |
# File 'lib/payday/invoice.rb', line 6 def shipping_description @shipping_description end |
#shipping_rate ⇒ Object
Returns the value of attribute shipping_rate.
6 7 8 |
# File 'lib/payday/invoice.rb', line 6 def shipping_rate @shipping_rate end |
#tax_description ⇒ Object
Returns the value of attribute tax_description.
6 7 8 |
# File 'lib/payday/invoice.rb', line 6 def tax_description @tax_description end |
#tax_rate ⇒ Object
Returns the value of attribute tax_rate.
6 7 8 |
# File 'lib/payday/invoice.rb', line 6 def tax_rate @tax_rate end |