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