diff --git a/booking.helper.inc b/booking.helper.inc index d210fa9..8c291f3 100644 --- a/booking.helper.inc +++ b/booking.helper.inc @@ -190,6 +190,7 @@ function _booking_change_status($nid, $status_id) function _datearray_to_ts($date) { + watchdog('booking', 'Date Conversion: @info', array('@info' => var_export($date, TRUE))); date_default_timezone_set(date_default_timezone(FALSE)); $tz = new DateTimeZone(date_default_timezone(FALSE)); @@ -208,7 +209,7 @@ function _datearray_to_ts($date) function _datetime_array_to_ts($date) { - //watchdog('booking', 'Date-time Conversion: @info', array('@info' => var_export($date, TRUE))); + watchdog('booking', 'Date-time Conversion: @info', array('@info' => var_export($date, TRUE))); //watchdog('booking', "Date time conversion timezone configured as: @info", array('@info' => date_default_timezone(FALSE))); date_default_timezone_set(date_default_timezone(FALSE)); $tz = new DateTimeZone(date_default_timezone(FALSE)); @@ -993,6 +994,7 @@ function _booking_amount_paid($nid, $person = NULL) */ function _booking_total_due($person) { + //watchdog('booking', "
_booking_total_due person:\n @info", array('@info' => print_r( $person, true))); $total_due = 0.00; //check for a spouse @@ -1018,8 +1020,20 @@ function _booking_total_due($person) //finally we must be in the late-fee period else { - $total_due = $person->booking_late_price; - } + //when first creating this node the price information won't all exist + //since we combine that with the booking_person table in the hook for node_load + if (!isset($person->booking_late_price)) { + //query the database based on the payment_id that is set when we first create the node + $query = db_select('booking_price', 'p'); + $query->condition('p.pid', $person->booking_payment_id, '=') + ->fields('p'); + $result = $query->execute()->fetchObject(); + //set the result + $total_due = $result->booking_late_price; + } else { + $total_due = $person->booking_late_price; + } + } //end payment type conditional return $total_due; } diff --git a/booking.regn_form.inc b/booking.regn_form.inc index 4a2b72d..ac75eba 100644 --- a/booking.regn_form.inc +++ b/booking.regn_form.inc @@ -1069,15 +1069,16 @@ if (variable_get('booking_enable_passport', 0) == 1) function booking_form_validate($form, &$form_state) { - return _booking_validate($form_state['values']['form_id'], $form_state['values']); + return _booking_validate($form_state['values']['form_id'], $form_state['input']); } function _booking_validate($node, &$form_state) { global $event; - + //watchdog('booking', '
Booking registration form validation:\n@info', array('@info' => print_r( $form_state, true))); + //in case the date of birth field hasn't been filled out - //watchdog('booking', 'Blank date of birth checking: @info', array('@info' => var_export($form_state['booking_dob'], TRUE))); - $dob_check = $form_state['booking_dob']['day'] != '' && $form_state['booking_dob']['month'] != '' && $form_state['booking_dob']['year'] != '' ? _date_to_ts($form_state['booking_dob']) : 0; + watchdog('booking', 'Blank date of birth checking: @info', array('@info' => var_export($form_state['booking_dob'], TRUE))); + $dob_check = $form_state['booking_dob']['day'] != '' && $form_state['booking_dob']['month'] != '' && $form_state['booking_dob']['year'] != '' ? _datearray_to_ts($form_state['booking_dob']) : 0; //Verify this is not a duplicate registration //try and find the person in the database for this event