Class: Spree::Tax::ItemTax

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Model
Defined in:
app/models/spree/tax/item_tax.rb

Overview

Simple object used to hold tax data for an item.

This generic object will hold the amount of tax that should be applied to an item. (Either a Order, a LineItem or a Shipment.)

Instance Attribute Summary collapse

Instance Attribute Details

#amountBigDecimal

the amount of tax applied to the item

Returns:

  • (BigDecimal)

    the current value of amount



18
19
20
# File 'app/models/spree/tax/item_tax.rb', line 18

def amount
  @amount
end

#included_in_priceBoolean

whether the amount is included in the items price, or additional tax.

Returns:

  • (Boolean)

    the current value of included_in_price



18
19
20
# File 'app/models/spree/tax/item_tax.rb', line 18

def included_in_price
  @included_in_price
end

#item_idInteger

the LineItem or Shipment ID. Or blank if an order-level tax.

Returns:

  • (Integer)

    the current value of item_id



18
19
20
# File 'app/models/spree/tax/item_tax.rb', line 18

def item_id
  @item_id
end

#labelString

information about the taxes

Returns:

  • (String)

    the current value of label



18
19
20
# File 'app/models/spree/tax/item_tax.rb', line 18

def label
  @label
end

#tax_rateSpree::TaxRate

will be used as the source for tax adjustments

Returns:



18
19
20
# File 'app/models/spree/tax/item_tax.rb', line 18

def tax_rate
  @tax_rate
end