Sha256: 2bb3f4bc89537e0c8469c1afb1b5a604c07d3bb8fea54a318c0a05d7660ee155

Contents?: true

Size: 641 Bytes

Versions: 39

Compression:

Stored size: 641 Bytes

Contents

# frozen_string_literal: true

module Spree
  class ReimbursementType::Credit < Spree::ReimbursementType
    extend Spree::ReimbursementType::ReimbursementHelpers

    class << self
      def reimburse(reimbursement, return_items, simulate, created_by: nil)
        unless created_by
          Spree::Deprecation.warn("Calling #reimburse on #{self} without created_by is deprecated")
        end
        unpaid_amount = return_items.sum(&:total).round(2, :down)
        reimbursement_list, _unpaid_amount = create_credits(reimbursement, unpaid_amount, simulate, created_by: created_by)
        reimbursement_list
      end
    end
  end
end

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
solidus_core-2.11.17 app/models/spree/reimbursement_type/credit.rb
solidus_core-2.11.16 app/models/spree/reimbursement_type/credit.rb
solidus_core-2.11.15 app/models/spree/reimbursement_type/credit.rb
solidus_core-2.11.14 app/models/spree/reimbursement_type/credit.rb
solidus_core-2.11.13 app/models/spree/reimbursement_type/credit.rb
solidus_core-2.11.12 app/models/spree/reimbursement_type/credit.rb
solidus_core-2.11.11 app/models/spree/reimbursement_type/credit.rb
solidus_core-2.10.5 app/models/spree/reimbursement_type/credit.rb
solidus_core-2.11.10 app/models/spree/reimbursement_type/credit.rb
solidus_core-2.11.9 app/models/spree/reimbursement_type/credit.rb
solidus_core-2.11.8 app/models/spree/reimbursement_type/credit.rb
solidus_core-2.11.7 app/models/spree/reimbursement_type/credit.rb
solidus_core-2.11.6 app/models/spree/reimbursement_type/credit.rb
solidus_core-2.11.5 app/models/spree/reimbursement_type/credit.rb
solidus_core-2.11.4 app/models/spree/reimbursement_type/credit.rb
solidus_core-2.11.3 app/models/spree/reimbursement_type/credit.rb
solidus_core-2.11.2 app/models/spree/reimbursement_type/credit.rb
solidus_core-2.11.1 app/models/spree/reimbursement_type/credit.rb
solidus_core-2.10.3 app/models/spree/reimbursement_type/credit.rb
solidus_core-2.11.0 app/models/spree/reimbursement_type/credit.rb