fix wrong date returned when using timezone
using a table generate by plpgsql
clean up code
add allocation
add set price on date range