forked from solidusio/solidus
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Correct behavior of Order#outstanding_balance
This commit addresses an issue in `Spree::Order#outstanding_balance`, in circumstances where an Order has had refunds applied. The existing behaviour cancels out the amount of refunded payments, resulting in a negative outstanding balance and an order state of 'credit_due', when in fact the order balance is zero. This is caused by the calculation of `payment_total` already factoring in refunds. Some more discussion about this behaviour can be found in the following issues: solidusio#1107 solidusio#1536 With these changes, `outstanding_balance` is now defined as `total - payment_total`. This corrects the behaviour around refunds. Tests have been updated accordingly, with some help from DanielePalombo's commit: solidusio@c851404
- Loading branch information
Showing
2 changed files
with
35 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters