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

[BUG]: Royalty points redemption miscalculation #45

Closed
ahashad opened this issue Mar 13, 2021 · 2 comments
Closed

[BUG]: Royalty points redemption miscalculation #45

ahashad opened this issue Mar 13, 2021 · 2 comments

Comments

@ahashad
Copy link

ahashad commented Mar 13, 2021

Versions

-ERPNext: v12.18.0 (version-12)
-Frappe Framework: v12.15.0 (version-12)
-POS Awesome: v1.0.3 (master)

Stacktrace / full error message

It is miscalculation in royalty points redemption.

Steps to reproduce

1- Create loyalty program:
Collection factor = 1 ( 1 point for each dollar)
Conversion Factor = 0.05 ( 5 cent to each royalty point)
2- Create customer and add loyalty points for testing.
3- try to redeem some royalty point through POS Awesome

What is Expected?

1- Customer has 77 loyalty points
2- He can redeem upto 3.85$ ( 0.05 for each dollar)
Royalty cash = Royality points (77) x Conversion factor (0.05) = 3.85 $
3- After redemption the royalty points of customer must decrease by 77 points and add new 82 points for new purchase. the net will be 82 points

What is actually happening?

1- POS Awesome show wrong value in "You can redeem upto" field. It show customer can redeem upto 1540 $ not 3.85$. because of miscalculation. app uses a division not multiplication. ( 77 point / 0.05 (conversion factor) = 1540 $).
2- App does not deducted 77 royalty points - which customer has been used in previous purchase- from customer, so the royalty point increased from 77 to 159 points. the correct points must be 82 not 159.

Additional context

nothing

Screenshots

pos_error_1

pos_error_2

pos_error_3

@olamide2
Copy link
Contributor

Nice catch

The assumption was that you will do it the other way round.

USD 20 to earn 1 point
1 point = USD 1

Pending when @youssef does the fix you might want to change to this approach. It gives the customer the same points/usd at the end of the day.

@yrestom
Copy link
Owner

yrestom commented Mar 14, 2021

34127b9

@yrestom yrestom closed this as completed Mar 14, 2021
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

No branches or pull requests

3 participants