Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Outstanding balance uses reimbursement #10411

Merged
merged 1 commit into from
Aug 11, 2020

Conversation

chrishummel
Copy link
Contributor

This updates outstanding_balance to use the value of "reimbursements" when determining the payment total.

Currently outstanding_balance (when a refund exists) is defined as

total - (payment_total + refunds.sum(:amount))

Because refunds are included in the payment_total here the outstanding balance ends up equalling the "order total minus your completed payment total, regardless of whether those payments have been refunded or not".

In a couple scenarios this does not work as expected:

  • User places an order with one payment method
  • They reach out and request to switch payment methods
  • Admin refunds payment and submits a new payment
    In this case the payment total will be double the order total and the order will show as refund owed.

In any scenario where the order is modified after payment is complete:

  • User accidentally orders Product A (price $100) instead of Product B (price $10)
  • Before Product A is shipped, user requests a switch to Product B
  • Admin removes Product A, adds Product B, and refunds $90

@damianlegawiec damianlegawiec merged commit caead16 into spree:master Aug 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants