Updates to manual payments processing page
This commit is contained in:
@@ -263,6 +263,7 @@ function booking_manual_email()
|
|||||||
'#options' => $email_options_array,
|
'#options' => $email_options_array,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/*
|
||||||
$header = array (
|
$header = array (
|
||||||
'booking_nid' => array('data' => t('Booking ID')),
|
'booking_nid' => array('data' => t('Booking ID')),
|
||||||
'booking_name' => array('data' => t('Name')),
|
'booking_name' => array('data' => t('Name')),
|
||||||
@@ -273,9 +274,31 @@ function booking_manual_email()
|
|||||||
'booking_fully_paid' => t('Fully Paid?'),
|
'booking_fully_paid' => t('Fully Paid?'),
|
||||||
'welfare_required' => t('Welfare Required?'),
|
'welfare_required' => t('Welfare Required?'),
|
||||||
);
|
);
|
||||||
|
*/
|
||||||
|
|
||||||
$result = db_query("SELECT * FROM {booking_person} WHERE booking_event_id = :eid",
|
$header = array(
|
||||||
array(':eid' => $event->eid));
|
'booking_nid' => array('data' => t('Id'), 'field' => 'nid', 'sort' => 'asc'),
|
||||||
|
'booking_name' => array('data' => t('Name'), 'field' => 'booking_lastname'),
|
||||||
|
'booking_email' => array('data' => t('Email'), 'field' => 'booking_email'),
|
||||||
|
'booking_state' => array('data' => t('State'), 'field' => 'booking_state'),
|
||||||
|
'booking_status' => array('data' => t('Status'), 'field' => 'booking_status'),
|
||||||
|
'amount_paid' => array('data' => t('Payment To Date'), 'field' => 'booking_amount_paid'),
|
||||||
|
'amount_reqd' => array('data' => t('Total Payment Required'), 'field' => 'booking_total_pay_reqd'),
|
||||||
|
'booking_fully_paid' => array('data' => t('Fully paid?')),
|
||||||
|
'welfare_required' => array('data' => t('Welfare Required?'), 'field' => 'booking_welfare_required'),
|
||||||
|
);
|
||||||
|
|
||||||
|
$query = db_select('booking_person', 'p')
|
||||||
|
->fields('p')
|
||||||
|
->fields('pr', array('booking_price', 'booking_late_price'))
|
||||||
|
->condition('p.booking_event_id', $event->eid, '=');
|
||||||
|
$query->join('booking_price', 'pr', 'pr.pid = p.booking_payment_id');
|
||||||
|
|
||||||
|
$table_sort = $query->extend('TableSort')->orderbyHeader($header);
|
||||||
|
$result = $table_sort->execute();
|
||||||
|
|
||||||
|
//$result = db_query("SELECT * FROM {booking_person} WHERE booking_event_id = :eid",
|
||||||
|
// array(':eid' => $event->eid));
|
||||||
|
|
||||||
foreach($result as $data)
|
foreach($result as $data)
|
||||||
{
|
{
|
||||||
@@ -283,10 +306,11 @@ function booking_manual_email()
|
|||||||
'booking_nid' => l(t('!id', array('!id' => $data->nid)), t('node/!id', array('!id' => $data->nid))),
|
'booking_nid' => l(t('!id', array('!id' => $data->nid)), t('node/!id', array('!id' => $data->nid))),
|
||||||
'booking_name' => $data->booking_firstname . " " . $data->booking_lastname,
|
'booking_name' => $data->booking_firstname . " " . $data->booking_lastname,
|
||||||
'booking_email' => $data->booking_email,
|
'booking_email' => $data->booking_email,
|
||||||
|
'booking_state' => $data->booking_state,
|
||||||
|
'booking_status' => _booking_status_generate($data->booking_status),
|
||||||
'amount_paid' => $data->booking_amount_paid,
|
'amount_paid' => $data->booking_amount_paid,
|
||||||
'amount_reqd' => $data->booking_total_pay_reqd,
|
'amount_reqd' => $data->booking_total_pay_reqd,
|
||||||
'booking_status' => _booking_status_generate($data->booking_status),
|
'booking_fully_paid' => _booking_amount_owing($data->nid) == 0 ? 'Yes' : 'No',
|
||||||
'booking_fully_paid' => $data->booking_amount_paid < $data->booking_total_pay_reqd ? 'No' : 'Yes',
|
|
||||||
'welfare_required' => $data->booking_welfare_required == 'Y' ? 'Yes' : 'No',
|
'welfare_required' => $data->booking_welfare_required == 'Y' ? 'Yes' : 'No',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -295,6 +319,8 @@ function booking_manual_email()
|
|||||||
'#type' => 'tableselect',
|
'#type' => 'tableselect',
|
||||||
'#header' => $header,
|
'#header' => $header,
|
||||||
'#options' => $options,
|
'#options' => $options,
|
||||||
|
'#empty' => t('No attendees found.'),
|
||||||
|
'#attributes' => array('id' => 'sort-table'),
|
||||||
);
|
);
|
||||||
|
|
||||||
$form['submit'] = array (
|
$form['submit'] = array (
|
||||||
|
@@ -114,17 +114,19 @@ function booking_manual_payment_admin_submit($form, &$form_state) {
|
|||||||
if ($form_state['values']['payment-type'] != '' && $form_state['values']['payment-custom-amount'] == '0.00')
|
if ($form_state['values']['payment-type'] != '' && $form_state['values']['payment-custom-amount'] == '0.00')
|
||||||
{
|
{
|
||||||
//look up the price relating to the price id selected
|
//look up the price relating to the price id selected
|
||||||
$price_query = db_query("SELECT price.booking_price, price.booking_late_price " .
|
$price_query = db_query("SELECT price.booking_price, price.booking_late_price, price.booking_price_descrip " .
|
||||||
"FROM {booking_price} price " .
|
"FROM {booking_price} price " .
|
||||||
"WHERE price.pid = :pid ",
|
"WHERE price.pid = :pid ",
|
||||||
array(':pid' => $form_state['values']['payment-type']))
|
array(':pid' => $form_state['values']['payment-type']))
|
||||||
->fetchObject();
|
->fetchObject();
|
||||||
|
|
||||||
$price = $form_state['values']['booking_earlybird'] == true ? $price_query->booking_price : $price_query->booking_late_price;
|
$price = $form_state['values']['booking_earlybird'] == true ? $price_query->booking_price : $price_query->booking_late_price;
|
||||||
|
$description = $price_query->booking_price_descrip;
|
||||||
}
|
}
|
||||||
elseif ($form_state['values']['payment-custom-amount'] != '0.00' && is_numeric($form_state['values']['payment-custom-amount']))
|
elseif ($form_state['values']['payment-custom-amount'] != '0.00' && is_numeric($form_state['values']['payment-custom-amount']))
|
||||||
{
|
{
|
||||||
$price = $form_state['values']['payment-custom-amount'];
|
$price = $form_state['values']['payment-custom-amount'];
|
||||||
|
$description = "Custom Amount";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -181,7 +183,7 @@ function booking_manual_payment_admin_submit($form, &$form_state) {
|
|||||||
'booking_last_name' => $person->booking_lastname,
|
'booking_last_name' => $person->booking_lastname,
|
||||||
'booking_buyer_email' => '',
|
'booking_buyer_email' => '',
|
||||||
'booking_payer_status' => '',
|
'booking_payer_status' => '',
|
||||||
'booking_item_name' => '',
|
'booking_item_name' => $description,
|
||||||
'booking_ipn_track_id' => '',
|
'booking_ipn_track_id' => '',
|
||||||
))
|
))
|
||||||
->execute();
|
->execute();
|
||||||
|
Reference in New Issue
Block a user