Hi

I am trying to figure out the potential use of this great module (6.x-2.0-beta2) on my site. I hope to build a sample site for Japanese clients, and needs to set the currency to Japanese yen (JPY). So, I did as follows:

(1) Administer -> Store Administration -> Configuration -> Store Settings -> Format Settings
(2) Set the Currency Format to JPY

Then, I go back to set the Base Rates to, say, 25,000 JPY. Specifically, I input "25000" as a value to one of the base rates on a calendar. After saving the value, base rates are set to 999.999. After several attempts, I figured that base rates are not designed to exceed 1000.

I suspect that this is a part of validation, but for a use of Japanese currency, will make it impossible to implement for production sites. This may be a possible problem for US/EUR/GBP or other currencies for the class of room above standard rate.

Thank you and with best regards
ceel

Comments

willvincent’s picture

As the module was initially designed in a VERY rushed way, and not for non-US use, the limit was set purely for display purposes.

Given the changes that larowlan is working on, this limitation can probably be removed.

larowlan’s picture

Hi ceel
I'm working on this in the coming week (as part of other work), when I designed the db, I didn't think about yen (clearly).
What do you think a reasonable amount would be, is 5 places plus 2 decimal enough (7 in total) or is it likely that a room might cost more than 99,999 JPY?
Lee

ceel’s picture

Thank you Lee and tcindie

I think it understandable that yen was ruled out at the initial display.

As far as I can check the hotel quote, 600,000 JPY is the highest rate offered by any hotel. i.e., I would like to make proposal of the limit of 999,999 JPY . But for the rate I am working with at the moment, 99,999 JPY works well.

Ceel

larowlan’s picture

New version (beta3) should resolve this, please install, run update.php and report back how you went.
Thanks

larowlan’s picture

Status: Active » Postponed (maintainer needs more info)
larowlan’s picture

Status: Postponed (maintainer needs more info) » Fixed
vlooivlerke’s picture

Version: 6.x-2.0-beta2 » 6.x-2.0-beta4
Status: Fixed » Active

Sorry to open this, but I have this bug on the 6.x-2.0-Beta4 version

This bug also will not allow you to display prices over 1000 in views output, e.g priced from

Then the bug described above is also active in the rates section. 999.999

larowlan’s picture

Hi
Have you run update.php?
If so can you log in to your database and have a look at the output of the following:

describe hotel_booking_rate_calendars;

This is for MySql only.
If you use table prefixing, add the prefix before hotel_booking_rate_calendars.
If you don't have command line access, can you paste a screenshot of the structure of the table from phpMyAdmin or similar?
It should look like this

mysql> describe hotel_booking_rate_calendars;
+-------------+-----------------------+------+-----+---------+-------+
| Field       | Type                  | Null | Key | Default | Extra |
+-------------+-----------------------+------+-----+---------+-------+
| hbrid       | int(10) unsigned      | YES  |     | NULL    |       |
| calendar_dt | datetime              | YES  |     | NULL    |       |
| rate        | decimal(9,3) unsigned | NO   |     | 0.000   |       |
+-------------+-----------------------+------+-----+---------+-------+
3 rows in set (0.00 sec)

The (9,3) is the important part, that means you have 9 digits for the price with three reserved for after the decimal place, ie up to 999999.999.

Thanks
Lee

vlooivlerke’s picture

Field------------ 	Type----------------------	Null-------- 	Default----- 	Comments
hbrid------------	int(10) UNSIGNED-------	Yes------------  	NULL	 
calendar_dt----- 	datetime-----------------	Yes------------  	NULL  	 
rate------------ 	decimal(9,3) UNSIGNED	No------------  	0.000  	 
No index defined!

Mine looks just like yours, except it states "No index defined!"
Any ideas
Thanks

larowlan’s picture

Status: Active » Postponed (maintainer needs more info)

Hmm, your table looks ok - can you please provide steps to reproduce this?

vlooivlerke’s picture

I did a fresh install of the beta4 version but had some pre installed modules active.

The problem started when I made my first price over 1000, prior to that it was working fine.

Do you think I should install/upgrade the current dev version, I see there is alot of changes.

I am working on a demo site and will post you a link shortly, would that help? I will not be able to give you access to the code.

larowlan’s picture

Hi
I've just tested this on a fresh install of the module.
I can't replicate it.
Is it possible that you're schema is cached - can you flush all of your caches and report back.
Failing that I can't see what else this could be

vlooivlerke’s picture

Ok here is my fix, but this i do not understand.

I edit the rates fields in the hotel_booking_rate_calendars table

I changed 9,3 to 9,2 and 0.000 to 0.00

Then after I update the table and brows it the currency shows correct with 2 decimals, like R1200.00 and not R1200.000

I flushed very hard, but no success, but this fix works so far.

limsherwin’s picture

Version: 6.x-2.0-beta4 » 7.x-1.0-alpha1

Hello,

I would like to know if this base rate limit is fixed in version 7-alpha1 ?

I got the following errors:

PDOException: SQLSTATE[22003]: Numeric value out of range: 1264 Out of range value adjusted for column 'from_rate' at row 1: UPDATE {hotel_booking_room_types} SET from_rate=:db_update_placeholder_0 WHERE (nid = :db_condition_placeholder_0) ; Array ( [:db_update_placeholder_0] => 1000.000 [:db_condition_placeholder_0] => 47 ) in hotel_booking_set_room_from_rate() (line 546 of /home/grandmen/public_html/sites/all/modules/uc_hotel/hotel_booking/hotel_booking.util.inc).

I took at look hotel_booking_room_types table and saw that from_rate field is decimal(6,3). Can use phpMyAdmin to change to decimal(9,3) ?

Thanks,
Sherwin

larowlan’s picture

Version: 7.x-1.0-alpha1 » 6.x-4.0-alpha1
Issue tags: +Release blocker

Yeah, that would work