Sha256: 87085763dcd0a99882aa424af6c2732b54fe491656b2751fb5eca711f7b8a6e7
Contents?: true
Size: 754 Bytes
Versions: 165
Compression:
Stored size: 754 Bytes
Contents
module Spree module Adjustable module Adjuster class Tax < Spree::Adjustable::Adjuster::Base def update tax = adjustments.tax included_tax_total = tax.is_included.reload.map(&:update!).compact.sum additional_tax_total = tax.additional.reload.map(&:update!).compact.sum update_totals(included_tax_total, additional_tax_total) end private def adjustments adjustable.try(:all_adjustments) || adjustable.adjustments end def update_totals(included_tax_total, additional_tax_total) @totals[:included_tax_total] = included_tax_total @totals[:additional_tax_total] = additional_tax_total end end end end end
Version data entries
165 entries across 165 versions & 1 rubygems