Class: Comptaline::AccountingEntry::Invoice

Inherits:
Base
  • Object
show all
Defined in:
lib/comptaline/accounting_entry/invoice.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#format_date

Constructor Details

#initialize(type = {}) ⇒ Invoice

Returns a new instance of Invoice.



7
8
9
# File 'lib/comptaline/accounting_entry/invoice.rb', line 7

def initialize(type = {})
  @is_credit_note = type[:is_credit_note] == true
end

Instance Attribute Details

#account_assignmentObject

Returns the value of attribute account_assignment.



4
5
6
# File 'lib/comptaline/accounting_entry/invoice.rb', line 4

def 
  @account_assignment
end

#amountObject

Returns the value of attribute amount.



4
5
6
# File 'lib/comptaline/accounting_entry/invoice.rb', line 4

def amount
  @amount
end

#amount_with_vatObject

Returns the value of attribute amount_with_vat.



4
5
6
# File 'lib/comptaline/accounting_entry/invoice.rb', line 4

def amount_with_vat
  @amount_with_vat
end

#communicationObject

Returns the value of attribute communication.



4
5
6
# File 'lib/comptaline/accounting_entry/invoice.rb', line 4

def communication
  @communication
end

#currency_codeObject

Returns the value of attribute currency_code.



4
5
6
# File 'lib/comptaline/accounting_entry/invoice.rb', line 4

def currency_code
  @currency_code
end

#customerObject

Returns the value of attribute customer.



4
5
6
# File 'lib/comptaline/accounting_entry/invoice.rb', line 4

def customer
  @customer
end

#dateObject

Returns the value of attribute date.



4
5
6
# File 'lib/comptaline/accounting_entry/invoice.rb', line 4

def date
  @date
end

#due_dateObject

Returns the value of attribute due_date.



4
5
6
# File 'lib/comptaline/accounting_entry/invoice.rb', line 4

def due_date
  @due_date
end

#invoice_numberObject

Returns the value of attribute invoice_number.



4
5
6
# File 'lib/comptaline/accounting_entry/invoice.rb', line 4

def invoice_number
  @invoice_number
end

#is_credit_noteObject

Returns the value of attribute is_credit_note.



4
5
6
# File 'lib/comptaline/accounting_entry/invoice.rb', line 4

def is_credit_note
  @is_credit_note
end

#match_idObject

Returns the value of attribute match_id.



4
5
6
# File 'lib/comptaline/accounting_entry/invoice.rb', line 4

def match_id
  @match_id
end

#structured_communicationObject

Returns the value of attribute structured_communication.



4
5
6
# File 'lib/comptaline/accounting_entry/invoice.rb', line 4

def structured_communication
  @structured_communication
end

#vat_amountObject

Returns the value of attribute vat_amount.



4
5
6
# File 'lib/comptaline/accounting_entry/invoice.rb', line 4

def vat_amount
  @vat_amount
end

#vat_codeObject

Returns the value of attribute vat_code.



4
5
6
# File 'lib/comptaline/accounting_entry/invoice.rb', line 4

def vat_code
  @vat_code
end

Instance Method Details

#to_aObject



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/comptaline/accounting_entry/invoice.rb', line 11

def to_a
  [
    action,                                        
    @customer.id,                  
    journal,                               
    period,        
    invoice_number,                 
    format_date(@date),
    format_date(@due_date),
    @communication,                               
    @structured_communication,
    ,              
    vat_code,                           
    @amount,                         
    @vat_amount,                                      
    @amount_with_vat,                       
    @currency_code,                                
    @match_id,                             
    credit_note_flag                       
  ]
end