Active
Project:
Hotel Booking System for Ubercart
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
8 Aug 2011 at 19:27 UTC
Updated:
9 Aug 2011 at 14:29 UTC
I have detected that discount all nights by percent isn't working propoerly. I have take a look at the code of hotel_discounts.module and I have watch a possible bug in the line 299.
I have make this change:
- $new_price = ceil($apply_price * (1 - $discount->rate) / 50) * 50;
+ $new_price = ceil($apply_price - ($apply_price * $discount->rate));
Before when you looking for a room with this discount, there wasn't any change in the price.
Now it's working fine.
Comments
Comment #1
larowlanThe two lines of code are mathematically equivalent except the original code rounds to the nearest $50.
Perhaps that's the issue. Maybe it should round to the nearest $10 or $5 instead.
Comment #2
davidlorenzo commentedOk you are true. But I have checked and are the same. But I don't know why before make that change, the module didn't calculate the discount, so in the final price of the book hadn't any discount. And after I did the change, all works fine...