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

[13.x] Fix receipt totals and balance #1388

Merged
merged 1 commit into from
Jun 30, 2022
Merged

[13.x] Fix receipt totals and balance #1388

merged 1 commit into from
Jun 30, 2022

Conversation

driesvints
Copy link
Member

This PR fixes receipt totals when a balance is applied.

Here's an example with the current Cashier receipt:

Screenshot 2022-06-30 at 17 23 47

And here's the Stripe invoice:

Screenshot 2022-06-30 at 17 24 03

As you can see these numbers do not match. There's no reason the total customer balance should be displayed and the final total invoice amount isn't correct (should be €12.10).

With this PR it gets fixed to:

Screenshot 2022-06-30 at 17 45 05

So it's the same as the Stripe one. I've added new methods to the Invoice object to accommodate for these changes.

There's one note I'd like to make: the current behavior of the Invoice's total method is actually incorrect. I've added a new realTotal method to temporarily accommodate for the true value. I did not want to break backwards compatibility which is why I opted for a new method. In Cashier v14, I strongly want to urge to change the behavior of the total method and remove the realTotal method again.

@taylorotwell taylorotwell merged commit 3c9b2ed into 13.x Jun 30, 2022
@taylorotwell taylorotwell deleted the fix-receipts branch June 30, 2022 17:20
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.

2 participants