Class: Spree::ReimbursementType::Credit
- Inherits:
-
Spree::ReimbursementType
- Object
- ActiveRecord::Base
- Base
- Spree::ReimbursementType
- Spree::ReimbursementType::Credit
- Extended by:
- ReimbursementHelpers
- Defined in:
- app/models/spree/reimbursement_type/credit.rb
Constant Summary
Constants inherited from Spree::ReimbursementType
Instance Attribute Summary
Attributes included from ReimbursementHelpers
Class Method Summary collapse
Methods included from ReimbursementHelpers
create_credits, create_refunds
Methods inherited from Base
Methods included from Core::Permalinks
#generate_permalink, #save_permalink
Class Method Details
.reimburse(reimbursement, return_items, simulate, created_by:) ⇒ Object
8 9 10 11 12 |
# File 'app/models/spree/reimbursement_type/credit.rb', line 8 def reimburse(reimbursement, return_items, simulate, created_by:) 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 |