Enhacements to manual payment form
This commit is contained in:
@@ -34,7 +34,7 @@ function booking_manual_payment_admin($nid)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//any html to put at the start of the form
|
//any html to put at the start of the form
|
||||||
$prefix = t("<p>Manually enter payment details.</p>");
|
$prefix = t("<h3>Create manual payment records</h3><p>Enter the amount below, select the people making the payment, then click the Update button at the bottom of the page</p>");
|
||||||
|
|
||||||
$form['booking_earlybird'] = array (
|
$form['booking_earlybird'] = array (
|
||||||
'#type' => 'hidden',
|
'#type' => 'hidden',
|
||||||
@@ -43,7 +43,8 @@ function booking_manual_payment_admin($nid)
|
|||||||
$form['payment-type'] = array(
|
$form['payment-type'] = array(
|
||||||
'#type' => 'select',
|
'#type' => 'select',
|
||||||
'#title' => t('Payment Type'),
|
'#title' => t('Payment Type'),
|
||||||
'#required' => TRUE,
|
'#description' => t('Either select one of the built-in payment amounts, or enter a custom dollar amount in the next field.'),
|
||||||
|
'#required' => FALSE,
|
||||||
'#default_value' => '0',
|
'#default_value' => '0',
|
||||||
'#options' => $payment_type_options,
|
'#options' => $payment_type_options,
|
||||||
);
|
);
|
||||||
@@ -64,7 +65,7 @@ function booking_manual_payment_admin($nid)
|
|||||||
'A total payment will replace the person\'s total payment with the value entered above.'),
|
'A total payment will replace the person\'s total payment with the value entered above.'),
|
||||||
'#options' => $payment_balance_options,
|
'#options' => $payment_balance_options,
|
||||||
'#default_value' => 1,
|
'#default_value' => 1,
|
||||||
'#required' => TRUE
|
'#required' => FALSE,
|
||||||
);
|
);
|
||||||
|
|
||||||
$header = array (
|
$header = array (
|
||||||
@@ -122,7 +123,7 @@ function booking_manual_payment_admin_submit($form, &$form_state) {
|
|||||||
$fully_paid = 'N';
|
$fully_paid = 'N';
|
||||||
$payment_date = REQUEST_TIME;
|
$payment_date = REQUEST_TIME;
|
||||||
$checkboxes = $form_state['values']['table']; //$values['booking_price_active'];
|
$checkboxes = $form_state['values']['table']; //$values['booking_price_active'];
|
||||||
watchdog('booking', 'Formstate when setting buttons: @info', array ('@info' => var_export($form_state['values'], TRUE)));
|
//watchdog('booking', 'Formstate when setting buttons: @info', array ('@info' => var_export($form_state['values'], TRUE)));
|
||||||
//watchdog('booking', 'Checkboxes when setting buttons: @info', array ('@info' => var_export($checkboxes, TRUE)));
|
//watchdog('booking', 'Checkboxes when setting buttons: @info', array ('@info' => var_export($checkboxes, TRUE)));
|
||||||
//watchdog('booking', 'Manual payment form contents: @info', array('@info' => var_export($form_state['values'], TRUE)));
|
//watchdog('booking', 'Manual payment form contents: @info', array('@info' => var_export($form_state['values'], TRUE)));
|
||||||
|
|
||||||
@@ -176,8 +177,10 @@ function booking_manual_payment_admin_submit($form, &$form_state) {
|
|||||||
$total_paid = $price;
|
$total_paid = $price;
|
||||||
//change $price so that we add the correct dollar amount in the payment record
|
//change $price so that we add the correct dollar amount in the payment record
|
||||||
//the actual amount newly paid is the price entered in the form, subtracting what they had previously paid
|
//the actual amount newly paid is the price entered in the form, subtracting what they had previously paid
|
||||||
watchdog('booking', 'Changing price for payment record from $!price to !newprice.', array('!price' => $price, '!newprice' => ($price - $person->booking_amount_paid)));
|
//use the function so it takes care of paypal transaction fees etc
|
||||||
$price = $price - $person->booking_amount_paid;
|
$newprice = $price - _booking_amount_paid($key, $person);
|
||||||
|
watchdog('booking', 'Changing price for payment record from $!price to !newprice.', array('!price' => $price, '!newprice' => $newprice));
|
||||||
|
$price = $newprice;
|
||||||
}
|
}
|
||||||
|
|
||||||
//check if they have now fully paid
|
//check if they have now fully paid
|
||||||
|
Reference in New Issue
Block a user