Class: FacturX::Totals

Inherits:
Object
  • Object
show all
Defined in:
lib/factur_x/totals.rb

Overview

The document level totals (BT-106 to BT-115). The gem never derives these; the invoicing domain supplies them and they are checked for coherence against the lines and the VAT breakdowns.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(line_total:, tax_basis_total:, grand_total:, due_payable:, tax_total: nil, allowance_total: nil, charge_total: nil, rounding_amount: nil, prepaid: nil) ⇒ Totals

Returns a new instance of Totals.



13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/factur_x/totals.rb', line 13

def initialize(line_total:, tax_basis_total:, grand_total:, due_payable:,
               tax_total: nil, allowance_total: nil, charge_total: nil,
               rounding_amount: nil, prepaid: nil)
  @line_total = line_total
  @allowance_total = allowance_total
  @charge_total = charge_total
  @tax_basis_total = tax_basis_total
  @tax_total = tax_total
  @rounding_amount = rounding_amount
  @grand_total = grand_total
  @prepaid = prepaid
  @due_payable = due_payable
end

Instance Attribute Details

#allowance_totalObject (readonly)

Returns the value of attribute allowance_total.



10
11
12
# File 'lib/factur_x/totals.rb', line 10

def allowance_total
  @allowance_total
end

#charge_totalObject (readonly)

Returns the value of attribute charge_total.



10
11
12
# File 'lib/factur_x/totals.rb', line 10

def charge_total
  @charge_total
end

#due_payableObject (readonly)

Returns the value of attribute due_payable.



10
11
12
# File 'lib/factur_x/totals.rb', line 10

def due_payable
  @due_payable
end

#grand_totalObject (readonly)

Returns the value of attribute grand_total.



10
11
12
# File 'lib/factur_x/totals.rb', line 10

def grand_total
  @grand_total
end

#line_totalObject (readonly)

Returns the value of attribute line_total.



10
11
12
# File 'lib/factur_x/totals.rb', line 10

def line_total
  @line_total
end

#prepaidObject (readonly)

Returns the value of attribute prepaid.



10
11
12
# File 'lib/factur_x/totals.rb', line 10

def prepaid
  @prepaid
end

#rounding_amountObject (readonly)

Returns the value of attribute rounding_amount.



10
11
12
# File 'lib/factur_x/totals.rb', line 10

def rounding_amount
  @rounding_amount
end

#tax_basis_totalObject (readonly)

Returns the value of attribute tax_basis_total.



10
11
12
# File 'lib/factur_x/totals.rb', line 10

def tax_basis_total
  @tax_basis_total
end

#tax_totalObject (readonly)

Returns the value of attribute tax_total.



10
11
12
# File 'lib/factur_x/totals.rb', line 10

def tax_total
  @tax_total
end