Sha256: 95314ccb5d6791f657c40ac430f713211a5140b470096a9fd7e6d9f903bcfcef

Contents?: true

Size: 389 Bytes

Versions: 2

Compression:

Stored size: 389 Bytes

Contents

# frozen_string_literal: true

module SolidusLegacyPromotions
  module SpreeCalculatorReturnsDefaultRefundAmountDecorator
    private

    def weighted_order_adjustment_amount(inventory_unit)
      inventory_unit.order.adjustments.eligible.non_tax.sum(:amount) * percentage_of_order_total(inventory_unit)
    end

    Spree::Calculator::Returns::DefaultRefundAmount.prepend self
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
solidus_legacy_promotions-4.4.1 app/decorators/solidus_legacy_promotions/models/spree_calculator_returns_default_refund_amount_decorator.rb
solidus_legacy_promotions-4.4.0 app/decorators/solidus_legacy_promotions/models/spree_calculator_returns_default_refund_amount_decorator.rb