I am encountering a bug when adding my price modifier on a "DAILY" basis:

$days is calculated wrong in rooms_pricing.unit_pricing_calendar.inc around line 181:

 case ROOMS_SUB_DAILY:
              $price -= $modifier['#amount'] * $modifier['#quantity'] * $days;

IF the starting date is in the previous month, then ONE day is missing.
eg.:
arrival 31.1.2016
departure 2.2.2016
---> would be 2 days (nights) - but $days reports only 1 day - so discount is wrong

but if
arrival 1.2.2016
departure 3.2.2016
---> also 2 days(nights) - $days is correct - 2days - discount is correct.

It is NOT related to 30,31, 28 day-months, and not to year-change (december->january)

this is my price_modifier_alter:

function hook_rooms_price_modifier_alter(&$price_modifiers, $booking_info) {
  // This adds programmatically a 10$ discount.
  $price_modifiers['mymodule'] = array(
    '#type' => ROOMS_DYNAMIC_MODIFIER,
    '#quantity' => 1,
    '#op_type' => ROOMS_SUB_DAILY,
    '#amount' => 10
  );
}

Can anyone confirm this ?

Thank you!

Comments

rsacher1 created an issue. See original summary.

rsacher1’s picture

Issue summary: View changes
rsacher1’s picture

Issue summary: View changes