Extra logging and fix deposit paypal calculation

This commit is contained in:
2015-03-19 12:59:11 +11:00
parent ef4a87b97f
commit dbae57532d
3 changed files with 16 additions and 9 deletions

View File

@@ -825,7 +825,7 @@ function _booking_deposit_amount($include_fees = TRUE)
//add the 30 cent fixed cost //add the 30 cent fixed cost
$amount_owing = $deposit->booking_price + 0.3; $amount_owing = $deposit->booking_price + 0.3;
//and the 2.4 percent transaction fee //and the 2.4 percent transaction fee
$amount_owing = $amount_owing / (1 - 0.024); $amount_owing = $amount_owing / (1 - 0.026);
} }
else else
{ {

View File

@@ -935,7 +935,7 @@ function _booking_validate($node, &$form_state) {
//in case the date of birth field hasn't been filled out //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))); //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; $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;
//Verify this is not a duplicate registration //Verify this is not a duplicate registration
//try and find the person in the database for this event //try and find the person in the database for this event
@@ -1069,6 +1069,13 @@ function _booking_validate($node, &$form_state) {
//verify that a state has been entered if "Other" was selected //verify that a state has been entered if "Other" was selected
if (($form_state['booking_state'] == 'Other' ) && ($form_state['booking_other_state'] == '')) if (($form_state['booking_state'] == 'Other' ) && ($form_state['booking_other_state'] == ''))
form_set_error('booking_other_state', t('You must enter your State in the address section of the Contact details. Please put N/A if your country does not have states.')); form_set_error('booking_other_state', t('You must enter your State in the address section of the Contact details. Please put N/A if your country does not have states.'));
//if there are any errors then log the data the user entered so we can check it later
if (form_get_errors()) {
watchdog('booking', "<pre>Detected validation error(s):\n@errors\n\n User data:\n@info</pre>",
array('@info' => print_r( $form_state, true), '@errors' => print_r( form_get_errors(), true)));
}
} }
function booking_form_submit($form, &$form_state) { function booking_form_submit($form, &$form_state) {

View File

@@ -354,13 +354,6 @@ $booking_registration_intro_text = variable_get('booking_registration_intro_text
'This will be sent either at initial registration if the full amount is paid, or when the balance is paid.'), 'This will be sent either at initial registration if the full amount is paid, or when the balance is paid.'),
'#default_value' => variable_get('booking_email_regn_complete_text', $booking_email_regn_complete_text), '#default_value' => variable_get('booking_email_regn_complete_text', $booking_email_regn_complete_text),
); );
$form['emails']['booking_email_partialpayment_received_text'] = array(
'#title' => t('Email text to send a person thanking them for their partial payment'),
'#type' => 'textarea',
//'#format' => 'full_html',
'#description' => t(''),
'#default_value' => variable_get('booking_email_partialpayment_received_text', ''),
);
$form['emails']['booking_email_waitinglist_text'] = array( $form['emails']['booking_email_waitinglist_text'] = array(
'#title' => t('Registration on Waiting List Email'), '#title' => t('Registration on Waiting List Email'),
'#description' => t('Email text to indicate a person has registered but is on the waiting list. ' . '#description' => t('Email text to indicate a person has registered but is on the waiting list. ' .
@@ -369,6 +362,13 @@ $booking_registration_intro_text = variable_get('booking_registration_intro_text
//'#format' => 'full_html', //'#format' => 'full_html',
'#default_value' => variable_get('booking_email_waitinglist_text', $booking_email_waitinglist_text), '#default_value' => variable_get('booking_email_waitinglist_text', $booking_email_waitinglist_text),
); );
$form['emails']['booking_email_partialpayment_received_text'] = array(
'#title' => t('Email text to send a person thanking them for their partial payment'),
'#type' => 'textarea',
//'#format' => 'full_html',
'#description' => t(''),
'#default_value' => variable_get('booking_email_partialpayment_received_text', ''),
);
$form['emails']['booking_email_paymentoutstanding_subject'] = array ( $form['emails']['booking_email_paymentoutstanding_subject'] = array (
'#type' => 'textfield', '#type' => 'textfield',
'#title' => t('Balance Outstanding Email Subject'), '#title' => t('Balance Outstanding Email Subject'),