Class: Facturae::Tax

Inherits:
Object
  • Object
show all
Includes:
Validatable
Defined in:
lib/facturae/models/tax.rb

Overview

Represents a tax.

Constant Summary collapse

TAX_IVA =
"01"
TAX_IPSI =
"02"
TAX_IGIC =
"03"
TAX_IRPF =
"04"
TAX_OTHER =
"05"
TAX_ITPAJD =
"06"
TAX_IE =
"07"
TAX_RA =
"08"
TAX_IGTECM =
"09"
TAX_IECDPCAC =
"10"
TAX_IIIMAB =
"11"
TAX_ICIO =
"12"
TAX_IMVDN =
"13"
TAX_IMSN =
"14"
TAX_IMGSN =
"15"
TAX_IMPN =
"16"
TAX_REIVA =
"17"
TAX_REIGIC =
"18"
TAX_REIPSI =
"19"
TAX_IPS =
"20"
TAX_RLEA =
"21"
TAX_IVPEE =
"22"
TAX_IPCNG =
"23"
TAX_IACNG =
"24"
TAX_IDEC =
"25"
TAX_ILTCAC =
"26"
TAX_IGFEI =
"27"
TAX_IRNR =
"28"
TAX_ISS =
"29"
TAXES_TYPES =
[TAX_IVA, TAX_IPSI, TAX_IGIC, TAX_IGIC, TAX_IRPF, TAX_OTHER, TAX_ITPAJD,
TAX_IE, TAX_RA, TAX_IGTECM, TAX_IECDPCAC, TAX_IIIMAB, TAX_ICIO,
TAX_IMVDN, TAX_IMSN, TAX_IMGSN, TAX_IMPN, TAX_REIVA, TAX_REIGIC,
TAX_REIPSI, TAX_IPS, TAX_RLEA, TAX_IVPEE, TAX_IPCNG, TAX_IACNG,
TAX_IDEC, TAX_ILTCAC, TAX_IGFEI, TAX_IRNR, TAX_ISS].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Validatable

#errors, #valid?

Constructor Details

#initialize(tax_rate:, taxable_base:, tax_amount:, tax_type_code:) ⇒ Tax

Returns a new instance of Tax.



52
53
54
55
56
57
# File 'lib/facturae/models/tax.rb', line 52

def initialize(tax_rate:, taxable_base:, tax_amount:, tax_type_code:)
  @tax_rate = tax_rate
  @taxable_base = taxable_base
  @tax_amount = tax_amount
  @tax_type_code = tax_type_code
end

Instance Attribute Details

#tax_amountObject

Returns the value of attribute tax_amount.



47
48
49
# File 'lib/facturae/models/tax.rb', line 47

def tax_amount
  @tax_amount
end

#tax_rateFloat

The tax rate.

Returns:

  • (Float)

    the current value of tax_rate



8
9
10
# File 'lib/facturae/models/tax.rb', line 8

def tax_rate
  @tax_rate
end

#tax_type_codeString

The tax type code.

Returns:

  • (String)

    the current value of tax_type_code



8
9
10
# File 'lib/facturae/models/tax.rb', line 8

def tax_type_code
  @tax_type_code
end

#taxable_baseFloat

The taxable base.

Returns:

  • (Float)

    the current value of taxable_base



8
9
10
# File 'lib/facturae/models/tax.rb', line 8

def taxable_base
  @taxable_base
end