Sha256: 84b4a2a1f08adb820bc9f27367c727f001de510f591a13bbefb5c1728fe26e4b

Contents?: true

Size: 554 Bytes

Versions: 15

Compression:

Stored size: 554 Bytes

Contents

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

    class << self
      def reimburse(reimbursement, _return_items, simulate)
        unpaid_amount = reimbursement.total.round(2, :down)
        payments = reimbursement.order.payments.completed

        refund_list, _unpaid_amount = create_refunds(reimbursement, payments, unpaid_amount, simulate)
        reimbursement.update(total: refund_list.sum(&:amount))
        refund_list
      end
    end
  end

end

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
spree-returnly-0.13.1 app/models/reimbursement_type/original_payment_no_items.rb
solidus-returnly-0.13.1 app/models/reimbursement_type/original_payment_no_items.rb
spree-returnly-0.13.0 app/models/reimbursement_type/original_payment_no_items.rb
solidus-returnly-0.13.0 app/models/reimbursement_type/original_payment_no_items.rb
solidus-returnly-0.12.0 app/models/reimbursement_type/original_payment_no_items.rb
solidus-returnly-0.11.0 app/models/reimbursement_type/original_payment_no_items.rb
solidus-returnly-0.10.0 app/models/reimbursement_type/original_payment_no_items.rb
solidus-returnly-0.9.0 app/models/reimbursement_type/original_payment_no_items.rb
solidus-returnly-0.8.1 app/models/reimbursement_type/original_payment_no_items.rb
solidus-returnly-0.8.0 app/models/reimbursement_type/original_payment_no_items.rb
solidus-returnly-0.7.1 app/models/reimbursement_type/original_payment_no_items.rb
solidus-returnly-0.7.0 app/models/reimbursement_type/original_payment_no_items.rb
solidus-returnly-0.6.2 app/models/reimbursement_type/original_payment_no_items.rb
solidus-returnly-0.6.1 app/models/reimbursement_type/original_payment_no_items.rb
solidus-returnly-0.6.0 app/models/reimbursement_type/original_payment_no_items.rb