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

fix(loyalty): loyalty point entry use wrong tier #22168

Merged

Conversation

pipech
Copy link
Contributor

@pipech pipech commented Jun 9, 2020

Fix for > [Bug] V12 - Loyalty program: Loyalty Point Entry use wrong Tier #22167

This is incorrect because it loop from highest and see if cumulative amount is less than min tier spend but it won't work if min tier spend is at 0 (Which it can be since min tier spend is not mandatory field)
that might be why he add i == 0 to skip this error.

The new method loop from lowest and check if cumulative spend is more than min spend.

@olamide2
Copy link

olamide2 commented Jun 9, 2020

Thank you. I have been complaining about this for months

@rohitwaghchaure rohitwaghchaure merged commit 6b07ae8 into frappe:version-12-hotfix Jun 10, 2020
@rohitwaghchaure
Copy link
Collaborator

@pipech Kindly send this PR on develop branch too

@marination
Copy link
Collaborator

@pipech Travis seems to be failing, please fix tests in test_loyalty_program.py
Screenshot 2020-06-10 at 7 08 19 PM

@pipech
Copy link
Contributor Author

pipech commented Jun 10, 2020

I will but it will take time for me to setup testing properly.

I've tried to run it but in some version it will error on Running "before_test" or it will take too long just to run "before_test", I haven't got to unittest part.

Do you guys have any recommendation on setting up testing environment ?

But from initial look on unittest, I think the problem is customer doctype haven't got reload after create sales invoice so loyalty_program_tier will be none.

@hoangdinhanphabe
Copy link

This issue still persists on v13 Beta 10

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.

5 participants