Sha256: e9391339575cda9eae42aecf1dcbb3fce408d4d3c90451faae904b29781fdfc5

Contents?: true

Size: 550 Bytes

Versions: 4

Compression:

Stored size: 550 Bytes

Contents

Spree::Shipment.class_eval do

  def avatax_cache_key
    key = ['Spree::Shipment']
    key << self.id
    key << self.cost
    key << self.stock_location.try(:cache_key)
    key << self.promo_total
    key.join('-')
  end

  def avatax_line_code
    'FR'
  end

  def shipping_method_tax_code
    tax_code = shipping_method.tax_category.try(:tax_code)
    if tax_code.nil?
      ''
    else
      tax_code
    end
  end

  def tax_category
    selected_shipping_rate.try(:tax_rate).try(:tax_category) || shipping_method.try(:tax_category)
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
solidus_avatax_certified-3.0.0 app/models/spree/shipment_decorator.rb
solidus_avatax_certified-2.0.0 app/models/spree/shipment_decorator.rb
solidus_avatax_certified-1.1.0 app/models/spree/shipment_decorator.rb
solidus_avatax_certified-1.0.0 app/models/spree/shipment_decorator.rb