Adding commitee flag

This commit is contained in:
2014-05-14 17:44:45 +10:00
parent bbcb28cfc7
commit 71772edbd5
6 changed files with 143 additions and 50 deletions

View File

@@ -614,7 +614,7 @@ function _booking_total_due($person)
$total_due = 0.00;
//determine what rate this person needs to pay
if ($person->booking_welfare_required == 'Y')
if ($person->booking_welfare_required == 'Y' || $person->booking_committee_member == 'Y')
{
//cater for any manual adjustment
//watchdog('booking', "This registration is eligible for welfare rates");
@@ -622,10 +622,14 @@ function _booking_total_due($person)
}
//the early bird rate will be defined by default for the registration
elseif (_booking_is_earlybird() == TRUE)
{
$total_due = $person->booking_total_pay_reqd;
}
//finally we must be in the late-fee period
else
{
$total_due = $person->booking_late_price;
}
return $total_due;
}
@@ -645,14 +649,17 @@ function _booking_amount_owing($nid, $amount_paid = 0, $include_paypal_fees = TR
//$total_due = 0;
//fetch details about the person
$person = db_query("SELECT price.booking_price, price.booking_late_price, person.booking_payment_id, " .
"person.booking_total_pay_reqd, person.booking_amount_paid, person.booking_partner_id, person.booking_country, person.booking_welfare_required " .
"person.booking_total_pay_reqd, person.booking_amount_paid, person.booking_partner_id, person.booking_country, person.booking_welfare_required, person.booking_committee_member " .
"FROM {booking_person} person, {booking_price} price " .
"WHERE person.nid = :nid " .
"AND person.booking_payment_id = price.pid",
array(':nid' => $nid))
->fetchObject();
//$person = node_load($nid);
//quick sanity check
if (! $person) {
watchdog('booking', "Unable to find matching person relating to registration id '" . $nid . "' .");
@@ -684,6 +691,7 @@ function _booking_amount_owing($nid, $amount_paid = 0, $include_paypal_fees = TR
if ($person->booking_country === "Australia")
$amount_owing = $amount_owing / (1 - 0.024);
//paypal charges 3.4 percent if they're doing a currency conversion
//assume that everyone not based in Australia will be doing a currency conversion
else
{
$amount_owing = $amount_owing / (1 - 0.034);
@@ -725,8 +733,8 @@ function _booking_process_refund($person)
watchdog('booking', "Processing refund due to !first !last. Calculated as $!refund",
array('!first' => $person->booking_firstname, '!last' => $person->booking_lastname, '!refund' => $refund));
$refund_due = $person->booking_amount_paid - $refund;
if ($refund_due == 0)
//$refund_due = $person->booking_amount_paid - $refund;
if ($refund == 0)
{
//mark the refund as processed since no action is required and don't add an entry into the manual payments table
db_update('booking_person')
@@ -742,7 +750,7 @@ function _booking_process_refund($person)
//update booking_amount_paid
db_update('booking_person')
->fields(array(
'booking_refund_due' => $refund_due,
'booking_refund_due' => $refund,
))
->condition('nid', $person->nid)
->execute();